Skip to content

davemichael/NaCl-Quake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Experimental Native Client Quake Demo
Linux, Mac, and Cygwin on Windows
Requires GNU make utility
Requires diff patch utilities

This is an experimental version of Quake for Native Client.  Quake
is now open-source.  Quake was originally produced by ID Software,
but is no longer supported by them.

  http://www.idsoftware.com

To build and run, you first need to download SDL Quake from
http://www.libsdl.org/projects/quake and extract the src and data
files into this directory. You can do this using the bash command
line.

Downloading
-----------
To download Quake and apply the patches, run the download make target.
Windows users must run this script from a Cygwin shell.

  make download nacl

This invokes a download script, which performs the following steps:

  First, it uses wget (or curl) to fetch the Quake tarballs, one for the
  source code and one for the level data.
    wget http://www.libsdl.org/projects/quake/src/sdlquake-1.0.9.tar.gz
    wget http://www.libsdl.org/projects/quake/data/quakesw-1.0.6.tar.gz

  Then it untars the contents using:
    tar -x --strip-components=1 -f sdlquake-1.0.9.tar.gz
    tar -x -f quakesw-1.0.6.tar.gz

  Note: Depending on your version of tar, you may need to replace
  --strip-components with --strip_path.

  Finally, after extraction, the download script will appy the patches
  required to build under Native Client:
    patch -p1 <nacl_quake.patch

Building
--------
Do NOT run ./configure -- a Native Client Makefile is already provided.  If
the configuration script is run, it might overwrite the provided Makefile.

Next, build the Native Client version of Quake with the GNU make utility:
(Note: The nacl target is required.)

  make clean nacl
  make debug nacl

To build & run:

  make debug nacl run

To build and run release:

  make release nacl run

Once you have built a .nexe it should run -- via sel_ldr launcher under the
makefile's run target -- on any Native Client platform without the need for
recompilation.  See the included Makefile for more build and run options.

Quake in the browser
--------------------
When a nacl build target is specified, the makefile, as a post build
process, will copy the nexe to 'nacl_quake', which is referenced by
'quake.html'  Assuming the Native Client plugin has been installed,
pointing the browser to quake.html should bring up quake in the browser.

The browser version of Quake loads the pak file and the Quake Native
Client executable relative to the location of the quake.html file.
If the quake.html and nacl_quake files are here:
  .../nacl/googleclient/native_client/tests/quake/quake.html
  .../nacl/googleclient/native_client/tests/quake/nacl_quake
Then quake expects to find the pak0.pak file here:
  .../nacl/googleclient/native_client/tests/quake/id1/pak0.pak

There are also a couple stress test html pages demonstrating multiple
instances of Quake running on a single page:
  .../nacl/googleclient/native_client/tests/quake/quake3.html
  .../nacl/googleclient/native_client/tests/quake/quake9.html

Linux, Windows: 32-bit Firefox recommended
Mac: Firefox 3 recommended (Firefox 2 unsupported on Mac at this time)

Changes made to sdlquake
------------------------
- max vertical resolution increased to 2048
- default resolution set to 1024x768
- heap size adjusted up from 8MB to 32MB
- cd_nacl.c mostly stubbed out
- net_udp.c mostly stubbed out
- net_dgrm.c entirely stubbed out
- SDL_Delay() stubbed in sys_nacl.c
- Sys_mkdir() stubbed out in sys_nacl.c
- remove Sys_MakeCodeWriteable()
- disabled setjmp/longjmp for demo loop
- snd_mixer fixed, uses larger paintbuffer
- snd_nacl tweaked to run with nacl audio interface
- uses ptheads to drive audio
- tweaked snd_nacl.c and snd_mixer.c to use 44.1k sample rate
- now uses 4096 paintbuffer
- nacl audio will only support stereo 44.1k and 48k
- support for mouse & keyboard, now playable to a limited degree
- (cannot grab mouse and warp mouse...)
- Makefile implemented using nacl tests make framework
- removed a couple of assembly files that contained unsupported x86 opcodes
- make possible to load pak file safely from browser (see nacl_file.c)
- initialize srpc library in main.c

About

Quake for Native Client (based on the SDL Quake port)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published