├── launcher └── osx │ ├── PkgInfo │ ├── SDLMain.h │ ├── SDLApplication.h │ ├── ScreenInfo.h │ ├── QuakeArgument.h │ ├── SDLApplication.m │ ├── Info.plist │ ├── QuakeArguments.h │ ├── AppController.h │ ├── ScreenInfo.m │ ├── QuakeArgument.m │ └── SDLMain.m ├── .gitignore ├── NQ ├── qe3.ico ├── quake.gif ├── quake.ico ├── wqreadme.txt ├── data │ └── ORDER.TXT ├── resource.h ├── conproc.h ├── net_wins.h ├── dosasm.S ├── net_loop.h ├── net_udp.h ├── net_dgrm.h ├── net_none.c ├── winquake.rc ├── 3dfx.txt ├── host.h ├── net_common.c ├── net_bsd.c ├── chase.c ├── net_win.c ├── dosisms.h ├── progdefs-id1.h └── docs │ └── README.X11 ├── quake.png ├── QW ├── quake.gif ├── common │ └── md4.c ├── client │ ├── qe3.ico │ ├── qwcl2.ico │ ├── quakeworld.bmp │ ├── exitscrn.txt │ ├── notes.txt │ ├── resource.h │ ├── winquake.rc │ ├── pmove.h │ ├── gl_ngraph.c │ └── quakedef.h ├── quakeworld.bmp ├── docs │ ├── qwcl-readme.txt │ └── readme.qwsv ├── progs │ ├── progs.src │ ├── sprites.qc │ ├── spectate.qc │ ├── server.qc │ ├── progdefs.h │ └── buttons.qc ├── server │ ├── notes.txt │ ├── move.txt │ ├── qwsvdef.h │ └── newnet.txt └── release233_notes.txt ├── icons ├── tyrquake.icns.10.5 └── tyrquake-1024x1024.png ├── scripts └── gcc-version ├── common ├── x11_core.c ├── snd_null.c ├── in_null.c ├── sdl_common.c ├── cd_null.c ├── r_vars.c ├── buildinfo.c ├── nonintel.c ├── d_vars.c ├── r_varsa.S ├── d_fill.c ├── vid_null.c ├── d_scana.S ├── sys_wina.S ├── d_modech.c ├── gl_extensions.c ├── sys_null.c ├── modela.S ├── d_sky.c └── d_init.c ├── include ├── x11_core.h ├── sdl_common.h ├── crc.h ├── progdefs.h ├── buildinfo.h ├── cdaudio.h ├── view.h ├── cdaudio_driver.h ├── pcx.h ├── in_x11.h ├── sbar.h ├── input.h ├── qtypes.h ├── menu.h ├── screen.h ├── wad.h ├── draw.h ├── developer.h ├── console.h ├── sys.h ├── winquake.h ├── rb_tree.h ├── asm_i386.h ├── d_ifacea.h ├── world.h ├── spritegn.h ├── progdefs-qw.h ├── block8.h ├── gl_warp_sin.h ├── block16.h ├── modelgen.h └── d_local.h ├── README.md └── readme-id.txt /launcher/osx/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | bin/* 3 | 4 | *.o 5 | -------------------------------------------------------------------------------- /NQ/qe3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/NQ/qe3.ico -------------------------------------------------------------------------------- /quake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/quake.png -------------------------------------------------------------------------------- /NQ/quake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/NQ/quake.gif -------------------------------------------------------------------------------- /NQ/quake.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/NQ/quake.ico -------------------------------------------------------------------------------- /QW/quake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/QW/quake.gif -------------------------------------------------------------------------------- /NQ/wqreadme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/NQ/wqreadme.txt -------------------------------------------------------------------------------- /QW/common/md4.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/QW/common/md4.c -------------------------------------------------------------------------------- /NQ/data/ORDER.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/NQ/data/ORDER.TXT -------------------------------------------------------------------------------- /QW/client/qe3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/QW/client/qe3.ico -------------------------------------------------------------------------------- /QW/quakeworld.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/QW/quakeworld.bmp -------------------------------------------------------------------------------- /QW/client/qwcl2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/QW/client/qwcl2.ico -------------------------------------------------------------------------------- /QW/client/quakeworld.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/QW/client/quakeworld.bmp -------------------------------------------------------------------------------- /QW/docs/qwcl-readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/QW/docs/qwcl-readme.txt -------------------------------------------------------------------------------- /icons/tyrquake.icns.10.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/icons/tyrquake.icns.10.5 -------------------------------------------------------------------------------- /icons/tyrquake-1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SerenityPorts/SerenityQuake/HEAD/icons/tyrquake-1024x1024.png -------------------------------------------------------------------------------- /QW/progs/progs.src: -------------------------------------------------------------------------------- 1 | ./qwprogs.dat 2 | 3 | defs.qc 4 | subs.qc 5 | combat.qc 6 | items.qc 7 | weapons.qc 8 | world.qc 9 | client.qc 10 | spectate.qc 11 | player.qc 12 | doors.qc 13 | buttons.qc 14 | triggers.qc 15 | plats.qc 16 | misc.qc 17 | 18 | server.qc 19 | -------------------------------------------------------------------------------- /QW/server/notes.txt: -------------------------------------------------------------------------------- 1 | 2 | new server auth design; 3 | - server includes 32bit random token S 4 | - master sees new server, request auth with MD5(M|S). m is 32bit master key 5 | - server sends register MD5( MD5(M|S) | S ) 6 | - master validates registration with server 7 | - M value changes for each server randomly 8 | -------------------------------------------------------------------------------- /QW/docs/readme.qwsv: -------------------------------------------------------------------------------- 1 | QWSV Notes (May.05.1998 Release) 2 | -------------------------------- 3 | 4 | Please refer to 5 | 6 | http://www.quakeworld.net/ 7 | 8 | for documentation. 9 | 10 | Server operators wishing to link to our master server at id, please use; 11 | 12 | qwsv +setmaster 192.246.40.37. 13 | 14 | -------------------------------------------------------------------------------- /scripts/gcc-version: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # gcc-version gcc-command 4 | # 5 | # Prints the gcc version of `gcc-command' in a canonical 4-digit form 6 | # such as `0295' for gcc-2.95, `0303' for gcc-3.3, etc. 7 | # 8 | 9 | compiler="$*" 10 | 11 | MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1) 12 | MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1) 13 | printf "%02d%02d\\n" $MAJOR $MINOR 14 | -------------------------------------------------------------------------------- /launcher/osx/SDLMain.h: -------------------------------------------------------------------------------- 1 | /* SDLMain.m - main entry point for our Cocoa-ized SDL app 2 | Initial Version: Darrell Walisser 3 | Non-NIB-Code & other changes: Max Horn 4 | 5 | Feel free to customize this file to suit your needs 6 | */ 7 | 8 | #import 9 | 10 | extern int gArgc; 11 | extern char **gArgv; 12 | extern BOOL gFinderLaunch; 13 | extern BOOL gCalledAppMainline; 14 | 15 | @interface SDLMain : NSObject 16 | @end 17 | -------------------------------------------------------------------------------- /QW/progs/sprites.qc: -------------------------------------------------------------------------------- 1 | 2 | // these are the only sprites still in the game... 3 | 4 | $spritename s_explod 5 | $type vp_parallel 6 | $load /raid/quake/id1/gfx/sprites/explod03.lbm 7 | $frame 24 24 56 56 8 | $frame 120 24 56 56 9 | $frame 216 24 56 56 10 | $frame 24 88 56 56 11 | $frame 120 88 56 56 12 | $frame 216 88 56 56 13 | 14 | 15 | $spritename s_bubble 16 | $type vp_parallel 17 | $load /raid/quake/id1/gfx/sprites/bubble.lbm 18 | $frame 16 16 16 16 19 | $frame 40 16 16 16 20 | 21 | 22 | $spritename s_light 23 | $type vp_parallel 24 | $load /raid/quake/id1/gfx/sprites/light.lbm 25 | $frame 104 32 32 32 26 | 27 | -------------------------------------------------------------------------------- /QW/server/move.txt: -------------------------------------------------------------------------------- 1 | 2 | dead state flag for no user input 3 | 4 | 5 | floor = under feet test 6 | onground? 7 | 8 | feet = wading test 9 | 10 | waist = swimming test 11 | 12 | head = submerged test 13 | 14 | 15 | if ( floor == solid) 16 | if (head == water) 17 | friction = 0.8; 18 | else if (waist == water) 19 | friction = 20 | else if (feet == water) 21 | friction = 22 | else 23 | friction = 24 | walk code 25 | return; 26 | 27 | if (floor == water) 28 | if (head == water) 29 | total underwater 30 | if (waist == water) 31 | treading water 32 | drifting down 33 | 34 | if (floor == air) 35 | falling 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /QW/client/exitscrn.txt: -------------------------------------------------------------------------------- 1 | QuakeWorld 2 | version 1.64 by id Software 3 | 4 | Programming 5 | John Carmack Michael Abrash 6 | John Cash Christian Antkow 7 | 8 | Additional Programming 9 | Dave 'Zoid' Kirsch 10 | Courtesy of ThreeWave Software 11 | Jack 'morbid' Mathews 12 | Courtesy of the QuakeSpy Team 13 | 14 | QuakeWorld is an unsupported 15 | product of id Software. 16 | 17 | Quake is a trademark of Id Software, 18 | inc., (c)1996, 1997 Id Software, inc. 19 | All rights reserved. NIN logo is a 20 | registered trademark licensed to 21 | Nothing Interactive, Inc. All rights 22 | reserved. Press y to exit 23 | -------------------------------------------------------------------------------- /common/x11_core.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "x11_core.h" 22 | 23 | #include 24 | 25 | Display *x_disp = NULL; 26 | Window x_win = None; 27 | -------------------------------------------------------------------------------- /launcher/osx/SDLApplication.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import 22 | 23 | 24 | @interface SDLApplication : NSApplication { 25 | 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /include/x11_core.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef X11_CORE_H 22 | #define X11_CORE_H 23 | 24 | #include 25 | 26 | extern Display *x_disp; 27 | extern Window x_win; 28 | 29 | #define X_CORE_MASK (VisibilityChangeMask | StructureNotifyMask | ExposureMask) 30 | 31 | #endif /* X11_CORE_H */ 32 | -------------------------------------------------------------------------------- /common/snd_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "sound.h" 21 | 22 | qboolean SNDDMA_Init(void) { return false; } 23 | int SNDDMA_GetDMAPos(void) { return 0; } 24 | void SNDDMA_Shutdown(void) { } 25 | void SNDDMA_Submit(void) { } 26 | int SNDDMA_LockBuffer(void) { return 0; } 27 | void SNDDMA_UnlockBuffer(void) { } 28 | -------------------------------------------------------------------------------- /QW/client/notes.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | movecmd_t movecmd; 4 | 5 | 6 | input from 7 | 8 | packet sender 9 | wake up on alarms or input signal 10 | if on input signal, set skipnextalrm 11 | else 12 | if skipnextalarm 13 | skipnextalarm = false; 14 | continue; 15 | lock packet 16 | get current movecmd 17 | send message 18 | unlock packet 19 | 20 | packet receiver 21 | wake up only on packet arrival 22 | identify the packet source 23 | calculate exact latency 24 | save the packet off 25 | 26 | 27 | 28 | 29 | // cause timer messages to be issued 30 | SetTimer (mainwindow, 1, 50, NULL); 31 | 32 | // cause packet received messages to be issued 33 | WSAAsyncSelect ( net_socket, mainwindow, WM_USER, FD_READ ); 34 | 35 | if (!GetMessage (&msg, NULL, 0, 0)) 36 | { 37 | TranslateMessage (&msg); 38 | DispatchMessage (&msg); 39 | while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)) 40 | { 41 | if (!GetMessage (&msg, NULL, 0, 0)) 42 | break; 43 | TranslateMessage (&msg); 44 | DispatchMessage (&msg); 45 | } 46 | PrepareToBlock (); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /include/sdl_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include 22 | 23 | extern SDL_Window *sdl_window; 24 | 25 | /* 26 | * Independent subsystems can call this to ensure the main SDL_Init() 27 | * has been called at least once before they init their subsystem 28 | * via SDL_InitSubSystem(SDL_INIT_FOO) 29 | */ 30 | void Q_SDL_InitOnce(void); 31 | -------------------------------------------------------------------------------- /include/crc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CRC_H 22 | #define CRC_H 23 | 24 | #include "qtypes.h" 25 | 26 | void CRC_Init(unsigned short *crcvalue); 27 | void CRC_ProcessByte(unsigned short *crcvalue, byte data); 28 | unsigned short CRC_Value(unsigned short crcvalue); 29 | unsigned short CRC_Block(const void *block, int count); 30 | 31 | #endif /* CRC_H */ 32 | -------------------------------------------------------------------------------- /include/progdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef PROGDEFS_H 22 | #define PROGDEFS_H 23 | 24 | #include "mathlib.h" 25 | #ifdef NQ_HACK 26 | #include "progdefs-id1.h" 27 | #else 28 | #if defined (QW_HACK) && defined(SERVERONLY) 29 | #include "progdefs-qw.h" 30 | #else 31 | #error "Progdefs are only for NQ and QW server" 32 | #endif 33 | #endif 34 | 35 | #endif /* PROGDEFS_H */ 36 | -------------------------------------------------------------------------------- /launcher/osx/ScreenInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import 22 | 23 | 24 | @interface ScreenInfo : NSObject { 25 | int width; 26 | int height; 27 | int bpp; 28 | NSString *description; 29 | } 30 | 31 | - (id)initWithWidth:(int)w height:(int)h bpp:(int)b; 32 | 33 | - (int)width; 34 | - (int)height; 35 | - (int)bpp; 36 | - (NSString *)description; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /launcher/osx/QuakeArgument.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import 22 | 23 | 24 | @interface QuakeArgument : NSObject { 25 | NSString *name; 26 | NSString *value; 27 | } 28 | 29 | - (id)initWithArgument:(NSString *)n; 30 | - (id)initWithArgument:(NSString *)n andValue:(NSString *)v; 31 | 32 | - (NSString *)name; 33 | - (NSString *)value; 34 | 35 | - (BOOL)hasValue; 36 | @end 37 | -------------------------------------------------------------------------------- /include/buildinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // 22 | // Build-time constants. 23 | // Keep them in their own compilation unit to prevent unnecessary rebuilds elsewhere. 24 | // 25 | 26 | #include 27 | 28 | extern const char *build_version; 29 | extern const int64_t build_version_timestamp; 30 | 31 | // 32 | // Return formatted date string for build version 33 | // 34 | const char *Build_DateString(); 35 | -------------------------------------------------------------------------------- /QW/client/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | /* 22 | * Windows dialog resource defines 23 | * used by winquake.rc 24 | */ 25 | #define IDI_ICON2 1 26 | #define IDD_DIALOG1 108 27 | #define IDD_PROGRESS 109 28 | #define IDB_QWBITMAP 112 29 | #define IDC_PROGRESS 1000 30 | 31 | #define IDS_PALETTE_MSG "Creating 15 bit inverse palette. This is only done once, so just be patient for the next 30-60 seconds." 32 | -------------------------------------------------------------------------------- /NQ/resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | /* 22 | * Windows dialog resource defines 23 | * used by winquake.rc 24 | */ 25 | #define IDI_ICON2 1 26 | #define IDD_DIALOG1 108 27 | #define IDD_PROGRESS 109 28 | #define IDC_PROGRESS 1000 29 | 30 | #define IDS_STARTUP_MSG "Starting TyrQuake..." 31 | #define IDS_PALETTE_MSG "Creating 15 bit inverse palette. This is only done once, so just be patient for the next 30-60 seconds." 32 | -------------------------------------------------------------------------------- /include/cdaudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CDAUDIO_H 22 | #define CDAUDIO_H 23 | 24 | #include "qtypes.h" 25 | 26 | int CDAudio_Init(void); 27 | void CDAudio_Play(byte track, qboolean looping); 28 | void CDAudio_Stop(void); 29 | void CDAudio_Pause(void); 30 | void CDAudio_Resume(void); 31 | void CDAudio_InvalidateDisk(void); 32 | void CDAudio_Shutdown(void); 33 | void CDAudio_Update(void); 34 | 35 | #endif /* CDAUDIO_H */ 36 | -------------------------------------------------------------------------------- /common/in_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // in_null.c -- for systems without a mouse 21 | 22 | #include "quakedef.h" 23 | 24 | void 25 | IN_Init(void) 26 | { 27 | } 28 | 29 | void 30 | IN_Shutdown(void) 31 | { 32 | } 33 | 34 | void 35 | IN_Commands(void) 36 | { 37 | } 38 | 39 | void 40 | IN_Move(usercmd_t *cmd) 41 | { 42 | } 43 | 44 | /* 45 | =========== 46 | IN_ModeChanged 47 | =========== 48 | */ 49 | void 50 | IN_ModeChanged(void) 51 | { 52 | } 53 | -------------------------------------------------------------------------------- /common/sdl_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include 22 | 23 | #include "qtypes.h" 24 | #include "sdl_common.h" 25 | #include "sys.h" 26 | 27 | SDL_Window *sdl_window = NULL; 28 | 29 | void 30 | Q_SDL_InitOnce(void) 31 | { 32 | static qboolean init_done = false; 33 | 34 | if (init_done) 35 | return; 36 | 37 | if (SDL_Init(0) < 0) 38 | Sys_Error("SDL_Init(0) failed: %s", SDL_GetError()); 39 | 40 | init_done = true; 41 | } 42 | -------------------------------------------------------------------------------- /launcher/osx/SDLApplication.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import "SDLApplication.h" 22 | #if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) 23 | #import 24 | #else 25 | #import "SDL.h" 26 | #endif 27 | 28 | @implementation SDLApplication 29 | - (void)terminate:(id)sender 30 | { 31 | /* Post a SDL_QUIT event */ 32 | SDL_Event event; 33 | event.type = SDL_QUIT; 34 | SDL_PushEvent(&event); 35 | 36 | [super terminate:sender]; 37 | } 38 | @end 39 | -------------------------------------------------------------------------------- /launcher/osx/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | TyrQuake 11 | CFBundleIdentifier 12 | net.disenchant.TyrQuake 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | ${TYR_VERSION} 21 | CFBundleSignature 22 | ???? 23 | LSApplicationCategoryType 24 | public.app-category.action-games 25 | LSMinimumSystemVersionByArchitecture 26 | 27 | i386 28 | 10.4.0 29 | x86_64 30 | 10.6.0 31 | 32 | NSMainNibFile 33 | Launcher 34 | NSPrincipalClass 35 | SDLApplication 36 | 37 | 38 | -------------------------------------------------------------------------------- /include/view.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef VIEW_H 22 | #define VIEW_H 23 | 24 | // view.h 25 | 26 | extern cvar_t v_gamma; 27 | extern cvar_t cl_crossx; 28 | extern cvar_t cl_crossy; 29 | extern cvar_t crosshair; 30 | extern cvar_t crosshaircolor; 31 | 32 | #ifdef GLQUAKE 33 | extern float v_blend[4]; 34 | #endif 35 | 36 | void V_Init(void); 37 | void V_RenderView(void); 38 | void V_UpdatePalette(void); 39 | void V_CalcBlend(void); 40 | 41 | float V_CalcRoll(vec3_t angles, vec3_t velocity); 42 | 43 | #endif /* VIEW_H */ 44 | -------------------------------------------------------------------------------- /NQ/conproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CONPROC_H 22 | #define CONPROC_H 23 | 24 | #include 25 | 26 | // conproc.h 27 | 28 | #define CCOM_WRITE_TEXT 0x2 29 | // Param1 : Text 30 | 31 | #define CCOM_GET_TEXT 0x3 32 | // Param1 : Begin line 33 | // Param2 : End line 34 | 35 | #define CCOM_GET_SCR_LINES 0x4 36 | // No params 37 | 38 | #define CCOM_SET_SCR_LINES 0x5 39 | // Param1 : Number of lines 40 | 41 | void InitConProc(HANDLE hFile, HANDLE heventParent, HANDLE heventChild); 42 | void DeinitConProc(void); 43 | 44 | #endif /* CONPROC_H */ 45 | -------------------------------------------------------------------------------- /common/cd_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "cdaudio_driver.h" 22 | 23 | int CDDrv_IsAudioTrack(byte track) { return 0; } 24 | int CDDrv_PlayTrack(byte track) { return 1; } 25 | int CDDrv_IsPlaying(byte track) { return 0; } 26 | int CDDrv_InitDevice(void) { return -1; } 27 | void CDDrv_CloseDevice(void) { } 28 | void CDDrv_Eject(void) { } 29 | void CDDrv_CloseDoor(void) { } 30 | void CDDrv_Stop(void) { } 31 | void CDDrv_Pause(void) { } 32 | void CDDrv_Resume(byte track) { } 33 | int CDDrv_GetMaxTrack(byte *track) { return 0; } 34 | int CDDrv_SetVolume(byte volume) { return -1; } 35 | -------------------------------------------------------------------------------- /include/cdaudio_driver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 Kevin Shanahan 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CDAUDIO_DRIVER_H 22 | #define CDAUDIO_DRIVER_H 23 | 24 | #include "qtypes.h" 25 | 26 | int CDDrv_IsAudioTrack(byte track); 27 | int CDDrv_PlayTrack(byte track); 28 | int CDDrv_IsPlaying(byte track); 29 | int CDDrv_InitDevice(void); 30 | void CDDrv_CloseDevice(void); 31 | void CDDrv_Eject(void); 32 | void CDDrv_CloseDoor(void); 33 | void CDDrv_Stop(void); 34 | void CDDrv_Pause(void); 35 | void CDDrv_Resume(byte track); 36 | int CDDrv_GetMaxTrack(byte *track); 37 | int CDDrv_SetVolume(byte volume); 38 | 39 | #endif /* CDAUDIO_DRIVER_H */ 40 | -------------------------------------------------------------------------------- /launcher/osx/QuakeArguments.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import 22 | #import "QuakeArgument.h" 23 | 24 | 25 | @interface QuakeArguments : NSObject { 26 | NSMutableArray *quakeArgs; 27 | } 28 | 29 | - (id)initWithArguments:(char **)argv count:(int)argc; 30 | - (void)parseArguments:(NSString *)args; 31 | 32 | - (void)addArgument:(NSString *)arg; 33 | - (void)addArgument:(NSString *)arg withValue:(NSString *)value; 34 | 35 | - (QuakeArgument *)argument:(NSString *)name; 36 | - (void)removeArgument:(NSString *)arg; 37 | 38 | - (int)count; 39 | - (void)setArguments:(char **)args; 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SERENITY QUAKE 2 | 3 | 4 | Version: 0.65
5 | Built from Tyr-Quake, by Kevin Shanahan
6 | Ported to Serenity OS by Jesse Buhagiar [quaker762]
7 | Author: Kevin Shanahan (aka. Tyrann)
8 | Webpage: http://disenchant.net
9 | email: kevin@shanahan.id.au
10 | 11 | Why? 12 | ---- 13 | At this point, it's just to exercise my brain with some low-level programming. 14 | I want this to be a version of Quake that basically looks like the Quake of 15 | old, but one that works on current operating systems. Some enhancements may 16 | be added, as long as they don't completely change the look and feel of the 17 | original game. 18 | 19 | Building: 20 | --------- 21 | Build like a regular Serenity port by typing `./package` in the `quake` folder. 22 | There are a few flags you can turn on/specify via `makeopts`. 23 | 24 | `SYMBOLS_ON`: Y or N, specifies whether or not debugging symbols will be stripped from the binary on a build 25 | `USE_X86_ASM`: This currently doesn't work (as it causes a linker error/undefined references) 26 | 27 | Also note that currently Serenity's implementation of `printf()` does not suppose the `.` format specifier. That means 28 | the assertion for it must be turned off or the OS will hang. Simply go to `PrintfImplementatino.cpp` found in `AK` and 29 | comment out the `ASSERT_NOT_REACHED` line in the default case of the switch. 30 | -------------------------------------------------------------------------------- /common/r_vars.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // r_vars.c: global refresh variables 21 | 22 | #include "quakedef.h" 23 | 24 | #ifndef USE_X86_ASM 25 | 26 | // all global and static refresh variables are collected in a contiguous block 27 | // to avoid cache conflicts. 28 | 29 | //------------------------------------------------------- 30 | // global refresh variables 31 | //------------------------------------------------------- 32 | 33 | // FIXME: make into one big structure, like cl or sv 34 | // FIXME: do separately for refresh engine and driver 35 | 36 | int r_bmodelactive; 37 | 38 | #endif /* USE_X86_ASM */ 39 | -------------------------------------------------------------------------------- /include/pcx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef PCX_H 21 | #define PCX_H 22 | 23 | typedef struct { 24 | char identifier; 25 | char version; 26 | char encoding; 27 | char bits_per_pixel; 28 | unsigned short xmin, ymin, xmax, ymax; 29 | unsigned short hres, vres; 30 | unsigned char palette[48]; 31 | char reserved; 32 | char color_planes; 33 | unsigned short bytes_per_line; 34 | unsigned short palette_type; 35 | char reserved2[58]; 36 | unsigned char data[]; 37 | } pcx_t; 38 | 39 | void SwapPCX(pcx_t *pcx); 40 | void WritePCXfile(const char *filename, const byte *data, int width, int height, 41 | int rowbytes, const byte *palette, qboolean upload); 42 | 43 | #endif // PCX_H 44 | -------------------------------------------------------------------------------- /common/buildinfo.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include 22 | #include 23 | 24 | #include "common.h" 25 | 26 | const char *build_version = stringify(TYR_VERSION); 27 | const int64_t build_version_timestamp = TYR_VERSION_TIME; 28 | 29 | const char * 30 | Build_DateString() 31 | { 32 | static char buffer[26]; 33 | //time_t timestamp = build_version_timestamp; 34 | //struct tm gmtimestamp; 35 | 36 | //#ifdef _WIN32 37 | //gmtime_s(&gmtimestamp, ×tamp); 38 | //#else 39 | //gmtime_r(×tamp, &gmtimestamp); 40 | //#endif 41 | //strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &gmtimestamp); 42 | 43 | strcpy(buffer, "SERENITYQUAKE\0"); 44 | 45 | return buffer; 46 | } 47 | -------------------------------------------------------------------------------- /launcher/osx/AppController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import 22 | #import "QuakeArguments.h" 23 | 24 | extern NSString *FQPrefCommandLineKey; 25 | extern NSString *FQPrefFullscreenKey; 26 | extern NSString *FQPrefScreenModeKey; 27 | 28 | @interface AppController : NSObject { 29 | IBOutlet NSWindow *launcherWindow; 30 | IBOutlet NSTextField *paramTextField; 31 | IBOutlet NSPopUpButton *screenModePopUp; 32 | IBOutlet NSButton *fullscreenCheckBox; 33 | 34 | NSMutableArray *screenModes; 35 | QuakeArguments *arguments; 36 | } 37 | 38 | - (IBAction)changeScreenMode:(id)sender; 39 | - (IBAction)launchQuake:(id)sender; 40 | - (IBAction)cancel:(id)sender; 41 | 42 | - (NSArray *)screenModes; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /launcher/osx/ScreenInfo.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import "ScreenInfo.h" 22 | 23 | 24 | @implementation ScreenInfo 25 | 26 | - (id)initWithWidth:(int)w height:(int)h bpp:(int)b { 27 | 28 | self = [super init]; 29 | if (!self) 30 | return nil; 31 | 32 | width = w; 33 | height = h; 34 | bpp = b; 35 | 36 | description = [NSString stringWithFormat:@"%d x %d %d Bit", width, height, bpp]; 37 | 38 | return self; 39 | } 40 | 41 | - (int)width { 42 | 43 | return width; 44 | } 45 | 46 | - (int)height { 47 | 48 | return height; 49 | } 50 | 51 | - (int)bpp { 52 | 53 | return bpp; 54 | } 55 | 56 | - (NSString *)description { 57 | 58 | return description; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /include/in_x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef IN_X11_H 22 | #define IN_X11_H 23 | 24 | #include "qtypes.h" 25 | #include "cvar.h" 26 | 27 | #include 28 | 29 | #define X_KEY_MASK (KeyPressMask | KeyReleaseMask) 30 | #define X_MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask) 31 | 32 | extern qboolean mouse_grab_active; 33 | 34 | extern int mouse_x, mouse_y; 35 | 36 | extern cvar_t in_mouse; 37 | extern cvar_t _windowed_mouse; 38 | 39 | void IN_Init(); 40 | void IN_Shutdown(); 41 | 42 | void IN_CenterMouse(); 43 | void IN_GrabMouse(); 44 | void IN_UngrabMouse(); 45 | void IN_GrabKeyboard(); 46 | void IN_UngrabKeyboard(); 47 | 48 | void IN_X11_HandleInputEvent(XEvent *event); 49 | 50 | #endif /* IN_X11_H */ 51 | -------------------------------------------------------------------------------- /NQ/net_wins.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef NET_WINS_H 22 | #define NET_WINS_H 23 | 24 | int WINS_Init(void); 25 | void WINS_Shutdown(void); 26 | void WINS_Listen(qboolean state); 27 | int WINS_OpenSocket(int port); 28 | int WINS_CloseSocket(int socket); 29 | int WINS_CheckNewConnections(void); 30 | int WINS_Read(int socket, void *buf, int len, netadr_t *addr); 31 | int WINS_Write(int socket, const void *buf, int len, const netadr_t *addr); 32 | int WINS_Broadcast(int socket, const void *buf, int len); 33 | int WINS_GetSocketAddr(int socket, netadr_t *addr); 34 | int WINS_GetNameFromAddr(const netadr_t *addr, char *name); 35 | int WINS_GetAddrFromName(const char *name, netadr_t *addr); 36 | int WINS_GetDefaultMTU(void); 37 | 38 | #endif /* NET_WINS_H */ 39 | -------------------------------------------------------------------------------- /NQ/dosasm.S: -------------------------------------------------------------------------------- 1 | #include "asm_i386.h" 2 | 3 | .data 4 | fpenv: .long 0, 0, 0, 0, 0, 0, 0, 0 5 | 6 | .text 7 | .globl C(StartMSRInterval) 8 | C(StartMSRInterval): 9 | movl $0x11,%ecx // read the CESR 10 | .byte 0x0F 11 | .byte 0x32 // RDMSR 12 | 13 | andl $0xFE3FFE3F,%eax // stop both counters 14 | .byte 0x0F 15 | .byte 0x30 // WRMSR 16 | 17 | movl 4(%esp),%eax // point counter 0 to desired event, with counters 18 | andl $0x3F,%eax // still stopped 19 | movl $0x11,%ecx 20 | .byte 0x0F 21 | .byte 0x30 // WRMSR 22 | 23 | movl $0x12,%ecx // set counter 0 to the value 0 24 | subl %eax,%eax 25 | subl %edx,%edx 26 | .byte 0x0F 27 | .byte 0x30 // WRMSR 28 | 29 | movl 4(%esp),%eax // restart counter 0 with selected event 30 | andl $0x3F,%eax 31 | subl %edx,%edx 32 | orl $0xC0,%eax 33 | movl $0x11,%ecx // control and event select 34 | .byte 0x0F 35 | .byte 0x30 // WRMSR 36 | 37 | ret 38 | 39 | .globl C(EndMSRInterval) 40 | C(EndMSRInterval): 41 | movl $0x12,%ecx // counter 0 42 | .byte 0x0F 43 | .byte 0x32 // RDMSR 44 | 45 | ret // lower 32 bits of count in %eax 46 | 47 | #if 0 48 | .data 49 | Lxxx: .long 0 50 | 51 | .text 52 | 53 | .globl C(setstackcheck) 54 | C(setstackcheck): 55 | 56 | movl %esp,%eax 57 | subl $0x38000,%eax 58 | movl $0x5A5A5A5A,(%eax) 59 | movl %eax,Lxxx 60 | 61 | ret 62 | 63 | 64 | .globl C(dostackcheck) 65 | C(dostackcheck): 66 | 67 | movl Lxxx,%edx 68 | movl $0,%eax 69 | 70 | cmpl $0x5A5A5A5A,(%edx) 71 | jz qqq 72 | incl %eax 73 | qqq: 74 | 75 | ret 76 | #endif 77 | 78 | -------------------------------------------------------------------------------- /include/sbar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef SBAR_H 22 | #define SBAR_H 23 | 24 | // the status bar is only redrawn if something has changed, but if anything 25 | // does, the entire thing will be redrawn for the next vid.numpages frames. 26 | 27 | #define SBAR_HEIGHT 24 28 | 29 | extern int sb_lines; // scan lines to draw 30 | 31 | void Sbar_Init(void); 32 | void Sbar_InitPics(void); 33 | 34 | void Sbar_Changed(void); 35 | 36 | // call whenever any of the client stats represented on the sbar changes 37 | 38 | void Sbar_Draw(void); 39 | 40 | // called every frame by screen 41 | 42 | void Sbar_IntermissionOverlay(void); 43 | 44 | // called each frame after the level has been completed 45 | 46 | void Sbar_FinaleOverlay(void); 47 | 48 | #endif /* SBAR_H */ 49 | -------------------------------------------------------------------------------- /NQ/net_loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef NET_LOOP_H 22 | #define NET_LOOP_H 23 | 24 | #include "net.h" 25 | 26 | // net_loop.h 27 | 28 | int Loop_Init(void); 29 | void Loop_Listen(qboolean state); 30 | void Loop_SearchForHosts(qboolean xmit); 31 | qsocket_t *Loop_Connect(const char *host); 32 | qsocket_t *Loop_CheckNewConnections(void); 33 | int Loop_GetMessage(qsocket_t *sock); 34 | int Loop_SendMessage(qsocket_t *sock, const sizebuf_t *data); 35 | int Loop_SendUnreliableMessage(qsocket_t *sock, const sizebuf_t *data); 36 | qboolean Loop_CanSendMessage(qsocket_t *sock); 37 | qboolean Loop_CanSendUnreliableMessage(qsocket_t *sock); 38 | void Loop_Close(qsocket_t *sock); 39 | void Loop_Shutdown(void); 40 | int Loop_GetDefaultMTU(void); 41 | 42 | #endif /* NET_LOOP_H */ 43 | -------------------------------------------------------------------------------- /NQ/net_udp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef NET_UDP_H 22 | #define NET_UDP_H 23 | 24 | #include "net.h" 25 | 26 | // net_udp.h 27 | 28 | int UDP_Init(void); 29 | void UDP_Shutdown(void); 30 | void UDP_Listen(qboolean state); 31 | int UDP_OpenSocket(int port); 32 | int UDP_CloseSocket(int socket); 33 | int UDP_CheckNewConnections(void); 34 | int UDP_Read(int socket, void *buf, int len, netadr_t *addr); 35 | int UDP_Write(int socket, const void *buf, int len, const netadr_t *addr); 36 | int UDP_Broadcast(int socket, const void *buf, int len); 37 | int UDP_GetSocketAddr(int socket, netadr_t *addr); 38 | int UDP_GetNameFromAddr(const netadr_t *addr, char *name); 39 | int UDP_GetAddrFromName(const char *name, netadr_t *addr); 40 | int UDP_GetDefaultMTU(void); 41 | 42 | #endif /* NET_UDP_H */ 43 | -------------------------------------------------------------------------------- /common/nonintel.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | /* 22 | * nonintel.c: code for non-Intel processors only 23 | */ 24 | 25 | #ifdef GLQUAKE 26 | #error "File not required for GLQUAKE" 27 | #endif 28 | 29 | #include "quakedef.h" 30 | #include "r_local.h" 31 | #include "d_local.h" 32 | 33 | /* 34 | ================ 35 | R_Surf8Patch 36 | ================ 37 | */ 38 | void 39 | R_Surf8Patch() 40 | { 41 | // we only patch code on Intel 42 | } 43 | 44 | 45 | /* 46 | ================ 47 | R_Surf16Patch 48 | ================ 49 | */ 50 | void 51 | R_Surf16Patch() 52 | { 53 | // we only patch code on Intel 54 | } 55 | 56 | 57 | /* 58 | ================ 59 | R_SurfacePatch 60 | ================ 61 | */ 62 | void 63 | R_SurfacePatch(void) 64 | { 65 | // we only patch code on Intel 66 | } 67 | -------------------------------------------------------------------------------- /NQ/net_dgrm.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef NET_DGRM_H 22 | #define NET_DGRM_H 23 | 24 | #include "net.h" 25 | 26 | // net_dgrm.h 27 | 28 | 29 | int Datagram_Init(void); 30 | void Datagram_Listen(qboolean state); 31 | void Datagram_SearchForHosts(qboolean xmit); 32 | qsocket_t *Datagram_Connect(const char *host); 33 | qsocket_t *Datagram_CheckNewConnections(void); 34 | int Datagram_GetMessage(qsocket_t *sock); 35 | int Datagram_SendMessage(qsocket_t *sock, const sizebuf_t *data); 36 | int Datagram_SendUnreliableMessage(qsocket_t *sock, const sizebuf_t *data); 37 | qboolean Datagram_CanSendMessage(qsocket_t *sock); 38 | qboolean Datagram_CanSendUnreliableMessage(qsocket_t *sock); 39 | void Datagram_Close(qsocket_t *sock); 40 | void Datagram_Shutdown(void); 41 | 42 | #endif /* NET_DGRM_H */ 43 | -------------------------------------------------------------------------------- /NQ/net_none.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "net.h" 22 | #include "net_loop.h" 23 | 24 | net_driver_t net_drivers[] = { 25 | { 26 | .name = "Loopback", 27 | .initialized = false, 28 | .Init = Loop_Init, 29 | .Listen = Loop_Listen, 30 | .SearchForHosts = Loop_SearchForHosts, 31 | .Connect = Loop_Connect, 32 | .CheckNewConnections = Loop_CheckNewConnections, 33 | .QGetMessage = Loop_GetMessage, 34 | .QSendMessage = Loop_SendMessage, 35 | .SendUnreliableMessage = Loop_SendUnreliableMessage, 36 | .CanSendMessage = Loop_CanSendMessage, 37 | .CanSendUnreliableMessage = Loop_CanSendUnreliableMessage, 38 | .Close = Loop_Close, 39 | .Shutdown = Loop_Shutdown 40 | } 41 | }; 42 | int net_numdrivers = 1; 43 | 44 | net_landriver_t net_landrivers[0]; 45 | int net_numlandrivers = 0; 46 | -------------------------------------------------------------------------------- /common/d_vars.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // r_vars.c: global refresh variables 21 | 22 | #ifndef USE_X86_ASM 23 | 24 | #include "mathlib.h" 25 | #include "quakedef.h" 26 | #include "vid.h" 27 | 28 | // all global and static refresh variables are collected in a contiguous block 29 | // to avoid cache conflicts. 30 | 31 | //------------------------------------------------------- 32 | // global refresh variables 33 | //------------------------------------------------------- 34 | 35 | // FIXME: make into one big structure, like cl or sv 36 | // FIXME: do separately for refresh engine and driver 37 | 38 | float d_sdivzstepu, d_tdivzstepu, d_zistepu; 39 | float d_sdivzstepv, d_tdivzstepv, d_zistepv; 40 | float d_sdivzorigin, d_tdivzorigin, d_ziorigin; 41 | 42 | fixed16_t sadjust, tadjust, bbextents, bbextentt; 43 | 44 | pixel_t *cacheblock; 45 | int cachewidth; 46 | int cacheheight; 47 | pixel_t *d_viewbuffer; 48 | short *d_pzbuffer; 49 | unsigned int d_zrowbytes; 50 | unsigned int d_zwidth; 51 | 52 | #endif /* USE_X86_ASM */ 53 | -------------------------------------------------------------------------------- /NQ/winquake.rc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include 22 | 23 | #include "resource.h" 24 | 25 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 26 | 27 | /* 28 | * Startup dialog / splash screen 29 | */ 30 | IDD_DIALOG1 DIALOGEX 0, 0, 70, 21 31 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP 32 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE 33 | FONT 16, "Times New Roman", 0, 0, 0x1 34 | BEGIN 35 | CTEXT "Starting TyrQuake...",IDC_STATIC,4,6,62,8 36 | END 37 | 38 | /* 39 | * GLQuake startup, palette creation progress 40 | */ 41 | IDD_PROGRESS DIALOGEX 0, 0, 333, 45 42 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE 43 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE 44 | FONT 8, "MS Sans Serif" 45 | BEGIN 46 | LTEXT IDS_PALETTE_MSG,IDC_STATIC,7,19,319,10 47 | CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,7,29,319,11 48 | LTEXT IDS_STARTUP_MSG,IDC_STATIC,7,4,54,8 49 | END 50 | 51 | IDI_ICON2 ICON DISCARDABLE "tyrquake.ico" 52 | -------------------------------------------------------------------------------- /common/r_varsa.S: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // r_varsa.s 22 | // 23 | 24 | #include "asm_i386.h" 25 | #include "quakeasm.h" 26 | #include "asm_draw.h" 27 | #include "d_ifacea.h" 28 | 29 | .data 30 | 31 | //------------------------------------------------------- 32 | // ASM-only variables 33 | //------------------------------------------------------- 34 | .globl float_1, float_particle_z_clip, float_point5 35 | .globl float_minus_1, float_0 36 | float_0: .single 0.0 37 | float_1: .single 1.0 38 | float_minus_1: .single -1.0 39 | float_particle_z_clip: .single PARTICLE_Z_CLIP 40 | float_point5: .single 0.5 41 | 42 | .globl fp_16, fp_64k, fp_1m, fp_64kx64k 43 | .globl fp_1m_minus_1 44 | .globl fp_8 45 | fp_1m: .single 1048576.0 46 | fp_1m_minus_1: .single 1048575.0 47 | fp_64k: .single 65536.0 48 | fp_8: .single 8.0 49 | fp_16: .single 16.0 50 | fp_64kx64k: .long 0x4f000000 // (float)0x8000*0x10000 51 | 52 | 53 | .globl FloatZero, Float2ToThe31nd, FloatMinus2ToThe31nd 54 | FloatZero: .long 0 55 | Float2ToThe31nd: .long 0x4f000000 56 | FloatMinus2ToThe31nd: .long 0xcf000000 57 | 58 | .globl C(r_bmodelactive) 59 | C(r_bmodelactive): .long 0 60 | -------------------------------------------------------------------------------- /include/input.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef INPUT_H 22 | #define INPUT_H 23 | 24 | // input.h -- external (non-keyboard) input devices 25 | 26 | #include "qtypes.h" 27 | #include "cvar.h" 28 | 29 | #ifdef NQ_HACK 30 | #include "client.h" 31 | #endif 32 | 33 | #ifdef QW_HACK 34 | #include "protocol.h" 35 | #endif 36 | 37 | // FIXME - windows only? 38 | extern unsigned int uiWheelMessage; 39 | extern qboolean mouseactive; 40 | extern cvar_t _windowed_mouse; 41 | 42 | void IN_Init(void); 43 | void IN_Shutdown(void); 44 | 45 | void IN_Commands(void); 46 | // oportunity for devices to stick commands on the script buffer 47 | 48 | void IN_Move(usercmd_t *cmd); 49 | // add additional movement on top of the keyboard move cmd 50 | 51 | void IN_ModeChanged(void); 52 | // called whenever screen dimensions change 53 | 54 | void IN_ClearStates(void); 55 | // restores all button and position states to defaults 56 | 57 | void IN_Accumulate(void); 58 | // save accumulated mouse movement (used in S_ExtraUpdate(), _WIN32 only) 59 | 60 | /* FIXME - hack to allow SDL input to pass back key events... */ 61 | void IN_ProcessEvents(void); 62 | 63 | #endif /* INPUT_H */ 64 | -------------------------------------------------------------------------------- /QW/client/winquake.rc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include 22 | 23 | #include "resource.h" 24 | 25 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 26 | 27 | /* 28 | * Startup dialog / splash screen 29 | */ 30 | IDD_DIALOG1 DIALOGEX 0, 0, 167, 27 31 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE 32 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE 33 | FONT 16, "Times New Roman", 0, 0, 0x1 34 | BEGIN 35 | CONTROL IDB_QWBITMAP,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE,0,0,167,28 36 | END 37 | 38 | /* 39 | * GLQuake startup, palette creation progress 40 | */ 41 | IDD_PROGRESS DIALOGEX 0, 0, 333, 75 42 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE 43 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE 44 | FONT 8, "MS Sans Serif", 0, 0, 0x1 45 | BEGIN 46 | LTEXT IDS_PALETTE_MSG,IDC_STATIC,7,51,319,10 47 | CONTROL IDB_QWBITMAP,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE,0,0,333,49 48 | CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,7,61,319,11 49 | END 50 | 51 | IDB_QWBITMAP BITMAP DISCARDABLE "quakeworld.bmp" 52 | IDI_ICON2 ICON DISCARDABLE "tyrquake.ico" 53 | -------------------------------------------------------------------------------- /launcher/osx/QuakeArgument.m: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-2008 Kristian Duske 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #import "QuakeArgument.h" 22 | 23 | 24 | @implementation QuakeArgument 25 | 26 | - (id)initWithArgument:(NSString *)n { 27 | 28 | return [self initWithArgument:n andValue:nil]; 29 | } 30 | 31 | - (id)initWithArgument:(NSString *)n andValue:(NSString *)v { 32 | 33 | self = [super init]; 34 | if (self == nil) 35 | return nil; 36 | 37 | name = [n retain]; 38 | if (v != nil) 39 | value = [v retain]; 40 | 41 | return self; 42 | } 43 | 44 | - (NSString *)name { 45 | 46 | return name; 47 | } 48 | 49 | - (NSString *)value { 50 | 51 | return value; 52 | } 53 | 54 | - (BOOL)hasValue { 55 | 56 | return value != nil; 57 | } 58 | 59 | - (NSString *)description { 60 | 61 | NSMutableString *buffer = [[NSMutableString alloc] init]; 62 | 63 | [buffer appendString:name]; 64 | if ([self hasValue]) { 65 | [buffer appendString:@" "]; 66 | [buffer appendString:value]; 67 | } 68 | 69 | return buffer; 70 | } 71 | 72 | - (void) dealloc 73 | { 74 | [name release]; 75 | [value release]; 76 | 77 | [super dealloc]; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /include/qtypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef QTYPES_H 22 | #define QTYPES_H 23 | 24 | typedef unsigned char byte; 25 | 26 | // KJB Undefine true and false defined in SciTech's DEBUG.H header 27 | #undef true 28 | #undef false 29 | 30 | typedef enum { false, true } qboolean; 31 | 32 | #ifndef offsetof 33 | #define offsetof(type, member) __builtin_offsetof (type, member) 34 | #endif 35 | 36 | #ifndef ARRAY_SIZE 37 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 38 | #endif 39 | 40 | /** 41 | * container_of - cast a member of a structure out to the containing structure 42 | * @ptr: the pointer to the member. 43 | * @type: the type of the container struct this is embedded in. 44 | * @member: the name of the member within the struct. 45 | * 46 | */ 47 | #define container_of(ptr, type, member) ({ \ 48 | typeof( ((type *)0)->member ) *__mptr = (ptr); \ 49 | (type *)( (char *)__mptr - offsetof(type,member) );}) 50 | 51 | #define const_container_of(ptr, type, member) ({ \ 52 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 53 | (const type *)( (const char *)__mptr - offsetof(type,member) );}) 54 | 55 | #endif /* QTYPES_H */ 56 | -------------------------------------------------------------------------------- /QW/release233_notes.txt: -------------------------------------------------------------------------------- 1 | 2 | QuakeWorld 2.33 Test Release 3 | ---------------------------- 4 | 5 | QuakeWorld 2.33 is a test release to address several issues that have 6 | come to light in the QuakeWorld community. Several different DoS 7 | (Denial Of Service) attacks have surfaced that need addressed. 8 | 9 | This test release contains both a new client and server to address these 10 | problems. This release is currently compatible with 2.30 servers and clients, 11 | but this will not be true once the test period has completed. The next 12 | release of QuakeWorld with be 2.4 and will be changed so previous versions 13 | will no longer function. This is necessary in order to fully combat all 14 | the denial of service attacks currently present and to facility some changes 15 | in the prevention of cheating. 16 | 17 | The QuakeWorld 2.33 client has the follow changes and issues addressed: 18 | 19 | - Bug where client would crash during a level change if a skin name longer 20 | than 16 characters on the server has been fixed. 21 | - The client now ignores foreign connection requests while connected to a 22 | server. 23 | - A foreign message packet with C-style format strings no longer cause a 24 | client crash. 25 | - Large packets sent to the client could cause it to exit with a fatal error 26 | - Timing issues with later versions of Windows 95 and Windows 98 that would 27 | cause clients to mistime their frame times and result in a player that could 28 | run faster/slower on a server has been changed and fixed. 29 | - When the client is running in a window, going to the menu or the console 30 | automatically frees up the mouse cursor. 31 | 32 | QuakeWorld 2.33 server changes: 33 | 34 | - Server now unpauses when all clients disconnect. 35 | - A possible server crash with large userinfo data has been fixed 36 | - A minor buffering error in network data was fixed 37 | 38 | Feedback for the release should be directed to Zoid at zoid@idsoftware.com 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /include/menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef MENU_H 22 | #define MENU_H 23 | 24 | #include "keys.h" 25 | #include "qpic.h" 26 | #include "qtypes.h" 27 | 28 | // 29 | // menus 30 | // 31 | void M_Init(void); 32 | void M_Keydown(knum_t keynum); 33 | void M_Draw(void); 34 | 35 | void M_ToggleMenu_f(void); 36 | void M_Menu_Options_f(void); 37 | void M_Menu_Quit_f(void); 38 | 39 | void M_DrawPic(int x, int y, const qpic8_t *pic); 40 | void M_DrawTransPic(int x, int y, const qpic8_t *pic); 41 | void M_DrawCharacter(int cx, int line, int num); 42 | void M_DrawCheckbox(int x, int y, qboolean checked); 43 | void M_DrawTextBox(int x, int y, int width, int lines); 44 | void M_Print(int cx, int cy, const char *str); 45 | void M_PrintWhite(int cx, int cy, const char *str); 46 | 47 | #ifdef NQ_HACK 48 | /* FIXME - These are only here for NQ/net_dgrm.c */ 49 | extern qboolean m_return_onerror; 50 | extern char m_return_reason[32]; 51 | extern int m_return_state; 52 | typedef enum { 53 | m_none, m_main, m_singleplayer, m_load, m_save, m_multiplayer, m_setup, 54 | m_options, m_video, m_keys, m_help, m_quit, m_lanconfig, m_gameoptions, 55 | m_search, m_slist 56 | } m_state_t; 57 | 58 | extern m_state_t m_state; 59 | 60 | #endif 61 | 62 | #endif /* MENU_H */ 63 | -------------------------------------------------------------------------------- /include/screen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef SCREEN_H 22 | #define SCREEN_H 23 | 24 | #include "qtypes.h" 25 | #include "cvar.h" 26 | #include "vid.h" 27 | 28 | // screen.h 29 | 30 | void SCR_Init(void); 31 | void SCR_CheckResize(); 32 | void SCR_UpdateScreen(void); 33 | void SCR_UpdateWholeScreen(void); 34 | void SCR_CenterPrint(const char *str); 35 | void SCR_BeginLoadingPlaque(void); 36 | void SCR_EndLoadingPlaque(void); 37 | int SCR_ModalMessage(const char *text); 38 | 39 | extern float scr_con_current; 40 | extern float scr_centertime_off; 41 | extern int scr_fullupdate; // set to 0 to force full redraw 42 | extern int clearnotify; // set to 0 whenever notify text is drawn 43 | extern qboolean scr_disabled_for_loading; 44 | extern qboolean scr_skipupdate; 45 | extern qboolean scr_block_drawing; 46 | extern cvar_t scr_viewsize; 47 | extern cvar_t scr_fov; 48 | extern vrect_t scr_vrect; 49 | 50 | // only the refresh window will be updated unless these variables are flagged 51 | extern int scr_copytop; 52 | extern int scr_copyeverything; 53 | 54 | extern float scr_scale; /* hud scaling factor */ 55 | extern int scr_scaled_width; 56 | extern int scr_scaled_height; 57 | extern float scr_conbackscale; /* The scaling applied to the console background */ 58 | 59 | #endif /* SCREEN_H */ 60 | -------------------------------------------------------------------------------- /include/wad.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef WAD_H 22 | #define WAD_H 23 | 24 | #include "qtypes.h" 25 | 26 | //=============== 27 | // TYPES 28 | //=============== 29 | 30 | #define CMP_NONE 0 31 | #define CMP_LZSS 1 32 | 33 | #define TYP_NONE 0 34 | #define TYP_LABEL 1 35 | 36 | #define TYP_LUMPY 64 // 64 + grab command number 37 | #define TYP_PALETTE 64 38 | #define TYP_QTEX 65 39 | #define TYP_QPIC 66 40 | #define TYP_SOUND 67 41 | #define TYP_MIPTEX 68 42 | 43 | typedef struct { 44 | int width, height; 45 | byte data[]; 46 | } dpic8_t; 47 | 48 | typedef struct { 49 | char identification[4]; // should be WAD2 or 2DAW 50 | int numlumps; 51 | int infotableofs; 52 | } wadinfo_t; 53 | 54 | #define LUMP_NAMELEN 16 55 | typedef struct { 56 | int filepos; 57 | int disksize; 58 | int size; // uncompressed 59 | char type; 60 | char compression; 61 | char pad1, pad2; 62 | char name[LUMP_NAMELEN]; // must be null terminated 63 | } lumpinfo_t; 64 | 65 | typedef struct { 66 | int numlumps; 67 | lumpinfo_t *lumps; 68 | byte *base; 69 | } wad_t; 70 | 71 | void W_LoadWadFile(wad_t *wad, const char *filename); 72 | void W_CleanupName(const char *in, char *out); 73 | lumpinfo_t *W_GetLumpinfo(wad_t *wad, const char *name); 74 | void *W_GetLumpName(wad_t *wad, const char *name); 75 | void *W_GetLumpNum(wad_t *wad, int num); 76 | 77 | void SwapDPic(dpic8_t *dpic); 78 | 79 | #endif /* WAD_H */ 80 | -------------------------------------------------------------------------------- /include/draw.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef DRAW_H 22 | #define DRAW_H 23 | 24 | #ifdef GLQUAKE 25 | #include "glquake.h" 26 | #else 27 | #include "d_iface.h" 28 | #endif 29 | 30 | #include "qpic.h" 31 | #include "qtypes.h" 32 | 33 | // draw.h -- these are the only functions outside the refresh allowed 34 | // to touch the vid buffer 35 | 36 | extern const qpic8_t *draw_disc; // also used on sbar 37 | extern const qpic8_t *draw_backtile; 38 | extern const byte *draw_chars; 39 | 40 | void Draw_Init(void); 41 | void Draw_Character(int x, int y, byte num); 42 | void Draw_Pic(int x, int y, const qpic8_t *pic); 43 | void Draw_TransPic(int x, int y, const qpic8_t *pic, byte transparent_color); 44 | void Draw_TransPicTranslate(int x, int y, const qpic8_t *pic, const byte *translation); 45 | void Draw_ConsoleBackground(int lines); 46 | void Draw_BeginDisc(void); 47 | void Draw_EndDisc(void); 48 | void Draw_TileClear(int x, int y, int w, int h); 49 | void Draw_TileClearScaled(int x, int y, int w, int h); 50 | void Draw_Fill(int x, int y, int w, int h, int c); 51 | void Draw_FadeScreen(void); 52 | void Draw_String(int x, int y, const char *str); 53 | const qpic8_t *Draw_PicFromWad(const char *name); 54 | const qpic8_t *Draw_CachePic(const char *path); 55 | 56 | void Draw_Alt_String(int x, int y, const char *str); 57 | void Draw_Crosshair(void); 58 | void Draw_SubPic(int x, int y, const qpic8_t *pic, int srcx, int srcy, 59 | int width, int height); 60 | 61 | #endif /* DRAW_H */ 62 | -------------------------------------------------------------------------------- /include/developer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | Copyright (C) 2019 Kevin Shanahan 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | 20 | */ 21 | 22 | #ifndef DEVELOPER_H 23 | #define DEVELOPER_H 24 | 25 | #include "cvar.h" 26 | #include "mathlib.h" 27 | #include "render.h" 28 | 29 | extern cvar_t _debug_models; 30 | 31 | /* 32 | * Panel of text to be drawn in worldspace. 33 | * The panel will auto-size to fit the text added. 34 | * Set scale to scale the text size relative to world coordinates. 35 | */ 36 | #define DEBUG_PANEL_MAX_LINES 20 37 | #define DEBUG_PANEL_MAX_LINE_LENGTH 100 38 | typedef struct { 39 | float scale; // Text scale (1.0 is 8 world units per char) 40 | vec3_t origin; // Origin in worldspace (center, bottom of the panel) 41 | vec3_t textorigin; // We offset the text slightly rather than polygonoffset nonsense 42 | vec3_t up, right; // Orientation 43 | float alpha; 44 | 45 | char text[DEBUG_PANEL_MAX_LINES][DEBUG_PANEL_MAX_LINE_LENGTH]; 46 | int lines, drawwidth, drawheight; 47 | } debug_panel_t; 48 | 49 | void DbgPanel_Init(debug_panel_t *panel); 50 | void DbgPanel_SetOrientation(debug_panel_t *panel, const vec3_t origin, const vec3_t up, const vec3_t right); 51 | void DbgPanel_Printf(debug_panel_t *panel, const char *fmt, ...) __attribute__((format(printf,2,3))); 52 | void DbgPanel_Draw(debug_panel_t *panel); 53 | 54 | /* MODEL DEBUG - Draw a panel above a model with some information about it. */ 55 | void DEBUG_DrawModelInfo(const entity_t *entity, const vec3_t modelorigin); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /common/d_fill.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include 22 | 23 | #include "quakedef.h" 24 | #include "vid.h" 25 | 26 | /* 27 | ================ 28 | D_FillRect 29 | ================ 30 | */ 31 | void 32 | D_FillRect(vrect_t *rect, int color) 33 | { 34 | int rx, ry, rwidth, rheight; 35 | unsigned char *dest; 36 | unsigned *ldest; 37 | 38 | rx = rect->x; 39 | ry = rect->y; 40 | rwidth = rect->width; 41 | rheight = rect->height; 42 | 43 | if (rx < 0) { 44 | rwidth += rx; 45 | rx = 0; 46 | } 47 | if (ry < 0) { 48 | rheight += ry; 49 | ry = 0; 50 | } 51 | if (rx + rwidth > vid.width) 52 | rwidth = vid.width - rx; 53 | if (ry + rheight > vid.height) 54 | rheight = vid.height - rx; 55 | 56 | if (rwidth < 1 || rheight < 1) 57 | return; 58 | 59 | dest = ((byte *)vid.buffer + ry * vid.rowbytes + rx); 60 | 61 | if (((rwidth & 0x03) == 0) && (((intptr_t)dest & 0x03) == 0)) { 62 | // faster aligned dword clear 63 | ldest = (unsigned *)dest; 64 | color += color << 16; 65 | 66 | rwidth >>= 2; 67 | color += color << 8; 68 | 69 | for (ry = 0; ry < rheight; ry++) { 70 | for (rx = 0; rx < rwidth; rx++) 71 | ldest[rx] = color; 72 | ldest = (unsigned *)((byte *)ldest + vid.rowbytes); 73 | } 74 | } else { 75 | // slower byte-by-byte clear for unaligned cases 76 | for (ry = 0; ry < rheight; ry++) { 77 | for (rx = 0; rx < rwidth; rx++) 78 | dest[rx] = color; 79 | dest += vid.rowbytes; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /include/console.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CONSOLE_H 22 | #define CONSOLE_H 23 | 24 | #include "qtypes.h" 25 | #include "shell.h" 26 | 27 | // 28 | // console 29 | // 30 | typedef struct { 31 | byte *text; // Text buffer 32 | int current; // line where next message will be printed 33 | int x; // offset in current line for next print 34 | int display; // bottom of console displays this line 35 | } console_t; 36 | 37 | extern console_t *con; 38 | 39 | extern int con_ormask; 40 | extern int con_totallines; 41 | extern int con_notifylines; // scan lines to clear for notify lines 42 | 43 | extern qboolean con_forcedup; 44 | extern qboolean con_initialized; 45 | 46 | void Con_DrawCharacter(int cx, int line, int num); 47 | void Con_CheckResize(void); 48 | void Con_Init(void); 49 | void Con_DrawConsole(int lines); 50 | void Con_Print(const char *txt); 51 | void Con_Printf(const char *fmt, ...) __attribute__((format(printf,1,2))); 52 | void Con_DPrintf(const char *fmt, ...) __attribute__((format(printf,1,2))); 53 | void Con_SafePrintf(const char *fmt, ...) __attribute__((format(printf,1,2))); 54 | void Con_Clear_f(void); 55 | void Con_DrawNotify(void); 56 | void Con_ClearNotify(void); 57 | void Con_ToggleConsole_f(void); 58 | void Con_ShowList(const char **list, int cnt, int maxlen); 59 | void Con_ShowTree(struct stree_root *root); 60 | 61 | // during startup for sound / cd warnings 62 | void Con_NotifyBox(char *text); 63 | 64 | int Con_GetWidth(void); /* return the printing width in chars*/ 65 | 66 | #endif /* CONSOLE_H */ 67 | -------------------------------------------------------------------------------- /QW/server/qwsvdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef SERVER_QWSVDEF_H 22 | #define SERVER_QWSVDEF_H 23 | 24 | // quakedef.h -- primary header for server 25 | 26 | //define PARANOID // speed sapping error checking 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include "qtypes.h" 37 | #include "cvar.h" 38 | #include "model.h" 39 | 40 | extern texture_t *r_notexture_mip; 41 | 42 | //============================================================================= 43 | 44 | // the host system specifies the base of the directory tree, the 45 | // command line parms passed to the program, and the amount of memory 46 | // available for the program to use 47 | 48 | typedef struct { 49 | const char *basedir; 50 | int argc; 51 | const char **argv; 52 | void *membase; 53 | int memsize; 54 | } quakeparms_t; 55 | 56 | 57 | //============================================================================= 58 | 59 | // 60 | // host 61 | // 62 | extern quakeparms_t host_parms; 63 | 64 | extern cvar_t developer; 65 | 66 | extern qboolean host_initialized; // true if into command execution 67 | extern double host_frametime; 68 | extern double realtime; // not bounded in any way, changed at 69 | 70 | // start of every frame, never reset 71 | 72 | void SV_Error(const char *fmt, ...) 73 | __attribute__((noreturn, format(printf,1,2))); 74 | void SV_Init(quakeparms_t *parms); 75 | 76 | #endif /* SERVER_QWSVDEF_H */ 77 | -------------------------------------------------------------------------------- /common/vid_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // vid_null.c -- null video driver to aid porting efforts 21 | 22 | #include "quakedef.h" 23 | #include "d_local.h" 24 | 25 | viddef_t vid; // global video state 26 | 27 | #define BASEWIDTH 320 28 | #define BASEHEIGHT 200 29 | 30 | byte vid_buffer[BASEWIDTH * BASEHEIGHT]; 31 | short zbuffer[BASEWIDTH * BASEHEIGHT]; 32 | byte surfcache[256 * 1024]; 33 | 34 | unsigned short d_8to16table[256]; 35 | unsigned d_8to24table[256]; 36 | 37 | void 38 | VID_SetPalette(unsigned char *palette) 39 | { 40 | } 41 | 42 | void 43 | VID_ShiftPalette(unsigned char *palette) 44 | { 45 | } 46 | 47 | void 48 | VID_Init(unsigned char *palette) 49 | { 50 | vid.maxwarpwidth = vid.width = vid.conwidth = BASEWIDTH; 51 | vid.maxwarpheight = vid.height = vid.conheight = BASEHEIGHT; 52 | vid.aspect = 1.0; 53 | vid.numpages = 1; 54 | vid.colormap = host_colormap; 55 | vid.fullbright = 256 - LittleLong(*((int *)vid.colormap + 2048)); 56 | vid.buffer = vid.conbuffer = vid_buffer; 57 | vid.rowbytes = vid.conrowbytes = BASEWIDTH; 58 | 59 | d_pzbuffer = zbuffer; 60 | D_InitCaches(surfcache, sizeof(surfcache)); 61 | } 62 | 63 | void 64 | VID_Shutdown(void) 65 | { 66 | } 67 | 68 | void 69 | VID_Update(vrect_t *rects) 70 | { 71 | } 72 | 73 | /* 74 | ================ 75 | D_BeginDirectRect 76 | ================ 77 | */ 78 | void 79 | D_BeginDirectRect(int x, int y, const byte *pbitmap, int width, int height) 80 | { 81 | } 82 | 83 | 84 | /* 85 | ================ 86 | D_EndDirectRect 87 | ================ 88 | */ 89 | void 90 | D_EndDirectRect(int x, int y, int width, int height) 91 | { 92 | } 93 | -------------------------------------------------------------------------------- /QW/progs/spectate.qc: -------------------------------------------------------------------------------- 1 | // Spectator functions 2 | // Added Aug11'97 by Zoid 3 | // 4 | // These functions are called from the server if they exist. 5 | // Note that Spectators only have one think since they movement code doesn't 6 | // track them much. Impulse commands work as usual, but don't call 7 | // the regular ImpulseCommand handler in weapons.qc since Spectators don't 8 | // have any weapons and things can explode. 9 | // 10 | // --- Zoid. 11 | 12 | /* 13 | =========== 14 | SpectatorConnect 15 | 16 | called when a spectator connects to a server 17 | ============ 18 | */ 19 | void() SpectatorConnect = 20 | { 21 | bprint (PRINT_MEDIUM, "Spectator "); 22 | bprint (PRINT_MEDIUM, self.netname); 23 | bprint (PRINT_MEDIUM, " entered the game\n"); 24 | 25 | self.goalentity = world; // used for impulse 1 below 26 | }; 27 | 28 | /* 29 | =========== 30 | SpectatorDisconnect 31 | 32 | called when a spectator disconnects from a server 33 | ============ 34 | */ 35 | void() SpectatorDisconnect = 36 | { 37 | bprint (PRINT_MEDIUM, "Spectator "); 38 | bprint (PRINT_MEDIUM, self.netname); 39 | bprint (PRINT_MEDIUM, " left the game\n"); 40 | }; 41 | 42 | /* 43 | ================ 44 | SpectatorImpulseCommand 45 | 46 | Called by SpectatorThink if the spectator entered an impulse 47 | ================ 48 | */ 49 | void() SpectatorImpulseCommand = 50 | { 51 | if (self.impulse == 1) { 52 | // teleport the spectator to the next spawn point 53 | // note that if the spectator is tracking, this doesn't do 54 | // much 55 | self.goalentity = find(self.goalentity, classname, "info_player_deathmatch"); 56 | if (self.goalentity == world) 57 | self.goalentity = find(self.goalentity, classname, "info_player_deathmatch"); 58 | if (self.goalentity != world) { 59 | setorigin(self, self.goalentity.origin); 60 | self.angles = self.goalentity.angles; 61 | self.fixangle = TRUE; // turn this way immediately 62 | } 63 | } 64 | 65 | self.impulse = 0; 66 | }; 67 | 68 | /* 69 | ================ 70 | SpectatorThink 71 | 72 | Called every frame after physics are run 73 | ================ 74 | */ 75 | void() SpectatorThink = 76 | { 77 | // self.origin, etc contains spectator position, so you could 78 | // do some neat stuff here 79 | 80 | if (self.impulse) 81 | SpectatorImpulseCommand(); 82 | }; 83 | 84 | 85 | -------------------------------------------------------------------------------- /common/d_scana.S: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // d_scana.s 22 | // x86 assembly-language turbulent texture mapping code 23 | // 24 | 25 | #include "asm_i386.h" 26 | #include "quakeasm.h" 27 | #include "asm_draw.h" 28 | #include "d_ifacea.h" 29 | 30 | .data 31 | 32 | .text 33 | 34 | //---------------------------------------------------------------------- 35 | // turbulent texture mapping code 36 | //---------------------------------------------------------------------- 37 | 38 | .align 4 39 | .globl C(D_DrawTurbulent8Span) 40 | C(D_DrawTurbulent8Span): 41 | pushl %ebp // preserve caller's stack frame pointer 42 | pushl %esi // preserve register variables 43 | pushl %edi 44 | pushl %ebx 45 | 46 | movl C(r_turb_s),%esi 47 | movl C(r_turb_t),%ecx 48 | movl C(r_turb_pdest),%edi 49 | movl C(r_turb_spancount),%ebx 50 | 51 | Llp: 52 | movl %ecx,%eax 53 | movl %esi,%edx 54 | sarl $16,%eax 55 | movl C(r_turb_turb),%ebp 56 | sarl $16,%edx 57 | andl $(TURB_CYCLE-1),%eax 58 | andl $(TURB_CYCLE-1),%edx 59 | movl (%ebp,%eax,4),%eax 60 | movl (%ebp,%edx,4),%edx 61 | addl %esi,%eax 62 | sarl $16,%eax 63 | addl %ecx,%edx 64 | sarl $16,%edx 65 | andl $(TURB_TEX_SIZE-1),%eax 66 | andl $(TURB_TEX_SIZE-1),%edx 67 | shll $(TURB_TEX_SHIFT),%edx 68 | movl C(r_turb_pbase),%ebp 69 | addl %eax,%edx 70 | incl %edi 71 | addl C(r_turb_sstep),%esi 72 | addl C(r_turb_tstep),%ecx 73 | movb (%ebp,%edx,1),%dl 74 | decl %ebx 75 | movb %dl,-1(%edi) 76 | jnz Llp 77 | 78 | movl %edi,C(r_turb_pdest) 79 | 80 | popl %ebx // restore register variables 81 | popl %edi 82 | popl %esi 83 | popl %ebp // restore caller's stack frame pointer 84 | ret 85 | -------------------------------------------------------------------------------- /include/sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef SYS_H 22 | #define SYS_H 23 | 24 | #include 25 | 26 | // FIXME - QW/server doesn't want this much stuff... 27 | 28 | // sys.h -- non-portable functions 29 | 30 | // FIXME - don't want win only stuff in header 31 | // minimized could be useful on other systems anyway... 32 | #ifdef _WIN32 33 | #include "qtypes.h" 34 | //extern qboolean Minimized; 35 | extern qboolean window_visible(void); 36 | #endif 37 | 38 | // 39 | // file IO 40 | // 41 | int64_t Sys_FileTime(const char *path); 42 | void Sys_mkdir(const char *path); 43 | 44 | // 45 | // memory protection 46 | // changes protection from start_addr, up to but not including end_addr 47 | void Sys_MakeCodeWriteable(void *start_addr, void *end_addr); 48 | 49 | // 50 | // system IO 51 | // 52 | 53 | #define MAX_PRINTMSG 4096 54 | 55 | void Sys_Printf(const char *fmt, ...) __attribute__((format(printf,1,2))); 56 | void Sys_DebugLog(const char *file, const char *fmt, ...) 57 | __attribute__((format(printf,2,3))); 58 | void Sys_Error(const char *error, ...) 59 | __attribute__((format(printf,1,2), noreturn)); 60 | 61 | // send text to the console 62 | // an error will cause the entire program to exit 63 | 64 | void Sys_Quit(void) __attribute__((noreturn)); 65 | 66 | double Sys_DoubleTime(void); 67 | 68 | char *Sys_ConsoleInput(void); 69 | 70 | void Sys_Sleep(void); 71 | 72 | // called to yield for a little bit so as 73 | // not to hog cpu when paused or debugging 74 | 75 | void Sys_SendKeyEvents(void); 76 | 77 | // Perform Key_Event () callbacks until the input que is empty 78 | 79 | void Sys_LowFPPrecision(void); 80 | void Sys_HighFPPrecision(void); 81 | void Sys_SetFPCW(void); 82 | 83 | void Sys_Init(void); 84 | 85 | #endif /* SYS_H */ 86 | -------------------------------------------------------------------------------- /NQ/3dfx.txt: -------------------------------------------------------------------------------- 1 | GLQuake Drivers 2 | 3 | Graphics Subsystem: Voodoo Graphics or Voodoo Rush 4 | 5 | Copyright ( 1997 3Dfx Interactive, Inc. ) 6 | All Rights Reserved 7 | 8 | 3Dfx Interactive, Inc. 9 | www: www.3dfx.com 10 | news: news.3dfx.com 11 | 12 | ----------------------------------------------------------------------- 13 | NOTE: GLQuake requires DirectX support DirectSound. DirectX can be 14 | installed from the media provided with your Voodoo Based 3D Accelerator. 15 | 16 | Glide 2.31 or HIGHER runtime drivers *MUST* be installed to use this 17 | GLQuake driver. Please download these drivers from your board 18 | manufacturer OR unsupported drivers from http://www.3dfx.com 19 | ----------------------------------------------------------------------- 20 | 21 | Release Notes for GLQuake's mini-GL driver 22 | 23 | What's in the distribution? 24 | --------------------------- 25 | 26 | This distribution contains GLQuake Drivers for Voodoo Based 3D 27 | Accelerators. These drivers were tested on the following boards: 28 | 29 | Voodoo Graphics: 30 | - Quantum 3D Obsidian 31 | - Diamond Monster 3D 32 | - Orchid Righteous 3D 33 | - Deltron Realvision Flash 3D 34 | - Guillemot MaxiGamer 35 | - Skywell Magic 3D 36 | 37 | Voodoo Rush: 38 | - Hercules Stringray 128-3D 39 | - Intergraph Intense 3D Voodoo 40 | - Jazz Multimedia Adrenaline Rush 41 | 42 | NOTE: The enclosed drivers are not meant to replace any Direct3D or 43 | Glide drivers provided by your Voodoo Graphics card manufacturer. 44 | Please obtain supported drivers from your board manufacturer. 45 | 46 | OEMSR2 and NT users: Do NOT replace OPENGL32.DLL located in your 47 | Windows\SYSTEM directory. 48 | 49 | Requirements 50 | ------------ 51 | 52 | - Voodoo Graphics or Voodoo Rush Based 3D Accelerator 53 | - Windows 95 (Windows NT is supported for Voodoo Rush) 54 | - A PC with a Pentium 90 or higher CPU 55 | - 16MB of RAM 56 | - 2D Video card set at 16 bit color 57 | 58 | Support and Frequently Asked Questions 59 | -------------------------------------- 60 | 61 | GLQuake is currently unsupported. You may however find answers to 62 | questions on various Quake dedicated websites. 3Dfx provides a GLQuake 63 | newsgroup on news.3dfx.com (Newsgroup name is 3dfx.games.glquake ) to 64 | discuss GLQuake with other users. 3Dfx also provides a regularly 65 | updated GLQuake FAQ at: http://www.3dfx.com/game_dev/quake_faq.html 66 | 67 | 68 | Voodoo Graphics and Voodoo Rush are trademarks of 3Dfx Interactive, Inc. 69 | All other trademarks are the property of their respective owners. -------------------------------------------------------------------------------- /NQ/host.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef HOST_H 21 | #define HOST_H 22 | 23 | #include "qtypes.h" 24 | #include "quakedef.h" 25 | #include "server.h" 26 | #include "wad.h" 27 | 28 | // FIXME - some of this is out of place or badly named... 29 | 30 | extern quakeparms_t host_parms; 31 | 32 | extern cvar_t sys_ticrate; 33 | extern cvar_t sys_nostdout; 34 | extern cvar_t developer; 35 | 36 | extern qboolean host_initialized; // true if into command execution 37 | extern double host_frametime; 38 | extern byte *host_basepal; 39 | extern byte *host_colormap; 40 | extern byte **host_transtables; 41 | 42 | extern int host_framecount; // incremented every frame, never reset 43 | extern double realtime; // not bounded in any way, changed at 44 | 45 | // start of every frame, never reset 46 | 47 | void Host_ClearMemory(void); 48 | void Host_ServerFrame(void); 49 | void Host_InitCommands(void); 50 | void Host_Init(quakeparms_t *parms); 51 | void Host_Shutdown(void); 52 | void Host_Error(const char *error, ...) 53 | __attribute__((noreturn, format(printf,1,2))); 54 | void Host_EndGame(const char *message, ...) 55 | __attribute__((noreturn, format(printf,1,2))); 56 | void Host_Frame(float time); 57 | void Host_Quit_f(void); 58 | void Host_ClientCommands(client_t *client, const char *fmt, ...) 59 | __attribute__((format(printf,2,3))); 60 | void Host_ShutdownServer(qboolean crash); 61 | 62 | extern qboolean msg_suppress_1; // suppresses resolution and cache size console 63 | 64 | // output an fullscreen DIB focus gain/loss 65 | extern int current_skill; // skill level for currently loaded level (in 66 | 67 | // case the user changes the cvar while the 68 | // level is running, this reflects the level 69 | // actually in use) 70 | 71 | extern qboolean isDedicated; 72 | 73 | extern int minimum_memory; 74 | 75 | #endif /* HOST_H */ 76 | -------------------------------------------------------------------------------- /NQ/net_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "common.h" 22 | #include "net.h" 23 | 24 | int 25 | NET_AddrCompare(const netadr_t *addr1, const netadr_t *addr2) 26 | { 27 | if (addr1->ip.l != addr2->ip.l || addr1->port != addr2->port) 28 | return -1; 29 | 30 | return 0; 31 | } 32 | 33 | int 34 | NET_GetSocketPort(const netadr_t *addr) 35 | { 36 | return (unsigned short)BigShort(addr->port); 37 | } 38 | 39 | int 40 | NET_SetSocketPort(netadr_t *addr, int port) 41 | { 42 | addr->port = BigShort(port); 43 | return 0; 44 | } 45 | 46 | /* 47 | * ============ 48 | * PartialIPAddress 49 | * 50 | * this lets you type only as much of the net address as required, 51 | * using the local network components to fill in the rest 52 | * ============ 53 | */ 54 | int 55 | NET_PartialIPAddress(const char *in, const netadr_t *myaddr, netadr_t *addr) 56 | { 57 | char buff[256]; 58 | char *b; 59 | int ip; 60 | int num; 61 | int mask; 62 | int run; 63 | int port; 64 | 65 | buff[0] = '.'; 66 | b = buff; 67 | strcpy(buff + 1, in); 68 | if (buff[1] == '.') 69 | b++; 70 | 71 | ip = 0; 72 | mask = -1; 73 | while (*b == '.') { 74 | b++; 75 | num = 0; 76 | run = 0; 77 | while (!(*b < '0' || *b > '9')) { 78 | num = num * 10 + *b++ - '0'; 79 | if (++run > 3) 80 | return -1; 81 | } 82 | if ((*b < '0' || *b > '9') && *b != '.' && *b != ':' && *b != 0) 83 | return -1; 84 | if (num < 0 || num > 255) 85 | return -1; 86 | mask <<= 8; 87 | ip = (ip << 8) + num; 88 | } 89 | 90 | if (*b++ == ':') 91 | port = Q_atoi(b); 92 | else 93 | port = net_hostport; 94 | 95 | addr->port = BigShort(port); 96 | addr->ip.l = (myaddr->ip.l & BigLong(mask)) | BigLong(ip); 97 | 98 | return 0; 99 | } 100 | -------------------------------------------------------------------------------- /include/winquake.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef WINQUAKE_H 22 | #define WINQUAKE_H 23 | 24 | // winquake.h: Win32-specific Quake header file 25 | // FIXME - all this can be moved to win specific files for sound, vid, etc. 26 | 27 | #ifndef _WIN32 28 | #error "You shouldn't be including this file for non-Win32 stuff!" 29 | #endif 30 | 31 | #include 32 | #include 33 | 34 | // FIXME - mousewheel redefined? What is this magic number? 35 | #ifndef WM_MOUSEWHEEL 36 | # define WM_MOUSEWHEEL 0x020A 37 | #endif 38 | 39 | #include "qtypes.h" 40 | 41 | extern HINSTANCE global_hInstance; 42 | extern int global_nCmdShow; 43 | 44 | typedef enum { 45 | MS_WINDOWED, MS_FULLSCREEN, MS_UNINIT 46 | } modestate_t; 47 | 48 | extern HWND mainwindow; 49 | extern qboolean ActiveApp; 50 | extern qboolean WinNT; 51 | 52 | // 53 | // vid.h (or remove) 54 | // 55 | 56 | void VID_SetDefaultMode(void); 57 | 58 | extern qboolean DDActive; 59 | 60 | // 61 | // input.h (or remove) 62 | // 63 | 64 | void IN_ShowMouse(void); 65 | void IN_DeactivateMouse(void); 66 | void IN_HideMouse(void); 67 | void IN_ActivateMouse(void); 68 | void IN_MouseEvent(int mstate); 69 | void IN_UpdateClipCursor(void); 70 | void IN_UpdateWindowRect(int x, int y, int width, int height); 71 | 72 | extern int in_window_center_x, in_window_center_y; 73 | extern RECT in_window_rect; 74 | 75 | // 76 | // sound.h (or remove) 77 | // 78 | 79 | void S_BlockSound(void); 80 | void S_UnblockSound(void); 81 | 82 | // cdaudio_driver.h 83 | LONG CDDrv_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 84 | 85 | // misc stuff that should be elsewhere... 86 | 87 | extern qboolean winsock_lib_initialized; 88 | extern HWND hwnd_dialog; 89 | 90 | /* 91 | * net stuff 92 | */ 93 | #define MAXHOSTNAMELEN 256 94 | extern int winsock_initialized; 95 | extern WSADATA winsockdata; 96 | 97 | #endif /* WINQUAKE_H */ 98 | -------------------------------------------------------------------------------- /include/rb_tree.h: -------------------------------------------------------------------------------- 1 | /* 2 | Red Black Trees 3 | (C) 1999 Andrea Arcangeli 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | ----------------------------------------------------------------------- 20 | 21 | To use rbtrees you'll have to implement your own insert and search cores. 22 | This will avoid us to use callbacks and to drop drammatically performances. 23 | I know it's not the cleaner way, but in C (not in C++) to get 24 | performances and genericity... 25 | 26 | Some example of insert and search follows here. The search is a plain 27 | normal search over an ordered tree. The insert instead must be implemented 28 | int two steps: as first thing the code must insert the element in 29 | order as a red leaf in the tree, then the support library function 30 | rb_insert_color() must be called. Such function will do the 31 | not trivial work to rebalance the rbtree if necessary. 32 | 33 | ----------------------------------------------------------------------- 34 | */ 35 | 36 | #ifndef RB_TREE_H 37 | #define RB_TREE_H 38 | 39 | #include 40 | 41 | struct rb_node { 42 | struct rb_node *rb_parent; 43 | int rb_color; 44 | #define QRB_RED 0 45 | #define QRB_BLACK 1 46 | struct rb_node *rb_right; 47 | struct rb_node *rb_left; 48 | }; 49 | 50 | struct rb_root { 51 | struct rb_node *rb_node; 52 | }; 53 | 54 | #define QRB_ROOT (struct rb_root) { NULL, } 55 | #define QRB_ROOT_INITIALIZER { NULL, } 56 | 57 | /* 58 | * 59 | */ 60 | extern void rb_insert_color(struct rb_node *, struct rb_root *); 61 | 62 | /* 63 | * 64 | */ 65 | extern void rb_erase(struct rb_node *, struct rb_root *); 66 | 67 | static inline void 68 | rb_link_node(struct rb_node *node, struct rb_node *parent, 69 | struct rb_node **rb_link) 70 | { 71 | node->rb_parent = parent; 72 | node->rb_color = QRB_RED; 73 | node->rb_left = node->rb_right = NULL; 74 | 75 | *rb_link = node; 76 | } 77 | 78 | #endif /* RB_TREE_H */ 79 | -------------------------------------------------------------------------------- /common/sys_wina.S: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // sys_wina.s 22 | // x86 assembly-language Win-dependent routines. 23 | 24 | #include "asm_i386.h" 25 | #include "quakeasm.h" 26 | 27 | // should be id386-dependent, and have an equivalent C path 28 | 29 | .data 30 | 31 | .align 4 32 | fpenv: 33 | .long 0, 0, 0, 0, 0, 0, 0, 0 34 | 35 | .text 36 | 37 | .globl C(MaskExceptions) 38 | C(MaskExceptions): 39 | fnstenv fpenv 40 | orl $0x3F,fpenv 41 | fldenv fpenv 42 | 43 | ret 44 | 45 | #if 0 46 | .globl C(unmaskexceptions) 47 | C(unmaskexceptions): 48 | fnstenv fpenv 49 | andl $0xFFFFFFE0,fpenv 50 | fldenv fpenv 51 | 52 | ret 53 | #endif 54 | 55 | .data 56 | 57 | .align 4 58 | .globl ceil_cw, single_cw, full_cw, cw, pushed_cw 59 | ceil_cw: .long 0 60 | single_cw: .long 0 61 | full_cw: .long 0 62 | cw: .long 0 63 | pushed_cw: .long 0 64 | 65 | .text 66 | 67 | .globl C(Sys_LowFPPrecision) 68 | C(Sys_LowFPPrecision): 69 | fldcw single_cw 70 | 71 | ret 72 | 73 | .globl C(Sys_HighFPPrecision) 74 | C(Sys_HighFPPrecision): 75 | fldcw full_cw 76 | 77 | ret 78 | 79 | .globl C(Sys_PushFPCW_SetHigh) 80 | C(Sys_PushFPCW_SetHigh): 81 | fnstcw pushed_cw 82 | fldcw full_cw 83 | 84 | ret 85 | 86 | .globl C(Sys_PopFPCW) 87 | C(Sys_PopFPCW): 88 | fldcw pushed_cw 89 | 90 | ret 91 | 92 | .globl C(Sys_SetFPCW) 93 | C(Sys_SetFPCW): 94 | fnstcw cw 95 | movl cw,%eax 96 | #ifdef USE_X86_ASM 97 | andb $0xF0,%ah 98 | orb $0x03,%ah // round mode, 64-bit precision 99 | #endif 100 | movl %eax,full_cw 101 | 102 | #ifdef USE_X86_ASM 103 | andb $0xF0,%ah 104 | orb $0x0C,%ah // chop mode, single precision 105 | #endif 106 | movl %eax,single_cw 107 | 108 | #ifdef USE_X86_ASM 109 | andb $0xF0,%ah 110 | orb $0x08,%ah // ceil mode, single precision 111 | #endif 112 | movl %eax,ceil_cw 113 | 114 | ret 115 | -------------------------------------------------------------------------------- /launcher/osx/SDLMain.m: -------------------------------------------------------------------------------- 1 | /* SDLMain.m - main entry point for our Cocoa-ized SDL app 2 | Initial Version: Darrell Walisser 3 | Non-NIB-Code & other changes: Max Horn 4 | 5 | Feel free to customize this file to suit your needs 6 | */ 7 | 8 | #if defined(SDL_FRAMEWORK) || defined(NO_SDL_CONFIG) 9 | #import 10 | #else 11 | #import "SDL.h" 12 | #endif 13 | #import "SDLMain.h" 14 | #import /* for MAXPATHLEN */ 15 | #import 16 | 17 | int gArgc; 18 | char **gArgv; 19 | BOOL gFinderLaunch; 20 | BOOL gCalledAppMainline = FALSE; 21 | 22 | /* The main class of the application, the application's delegate */ 23 | @implementation SDLMain 24 | 25 | /* Set the working directory to the .app's parent directory */ 26 | - (void) setupWorkingDirectory:(BOOL)shouldChdir 27 | { 28 | if (shouldChdir) 29 | { 30 | char parentdir[MAXPATHLEN]; 31 | CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); 32 | CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); 33 | if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) { 34 | assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ 35 | } 36 | CFRelease(url); 37 | CFRelease(url2); 38 | } 39 | 40 | } 41 | 42 | /* Called when the internal event loop has just started running */ 43 | - (void) applicationDidFinishLaunching: (NSNotification *) note 44 | { 45 | int status; 46 | 47 | /* Set the working directory to the .app's parent directory */ 48 | [self setupWorkingDirectory:gFinderLaunch]; 49 | 50 | /* Hand off to main application code */ 51 | gCalledAppMainline = TRUE; 52 | status = SDL_main (gArgc, gArgv); 53 | 54 | /* We're done, thank you for playing */ 55 | exit(status); 56 | } 57 | @end 58 | 59 | #ifdef main 60 | # undef main 61 | #endif 62 | 63 | /* Main entry point to executable - should *not* be SDL_main! */ 64 | int main(int argc, char **argv) 65 | { 66 | /* Copy the arguments into a global variable */ 67 | /* This is passed if we are launched by double-clicking */ 68 | if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { 69 | gArgv = (char **) SDL_malloc(sizeof (char *) * 2); 70 | gArgv[0] = argv[0]; 71 | gArgv[1] = NULL; 72 | gArgc = 1; 73 | gFinderLaunch = TRUE; 74 | } else { 75 | int i; 76 | gArgc = argc; 77 | gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); 78 | for (i = 0; i <= argc; i++) 79 | gArgv[i] = argv[i]; 80 | gFinderLaunch = NO; 81 | } 82 | 83 | NSApplicationMain(argc, (const char**)argv); 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /QW/client/pmove.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CLIENT_PMOVE_H 22 | #define CLIENT_PMOVE_H 23 | 24 | #include "model.h" 25 | #include "protocol.h" 26 | 27 | #ifndef GLQUAKE 28 | #include "d_iface.h" 29 | #endif 30 | 31 | #define MAX_PHYSENTS 32 32 | typedef struct { 33 | vec3_t origin; 34 | const brushmodel_t *brushmodel; 35 | vec3_t mins, maxs; // only for non-bsp models 36 | #ifdef SERVERONLY 37 | int entitynum; // for server to identify 38 | #endif 39 | } physent_t; 40 | 41 | typedef struct { 42 | // player state 43 | vec3_t origin; 44 | vec3_t angles; 45 | vec3_t velocity; 46 | int oldbuttons; 47 | float waterjumptime; 48 | qboolean dead; 49 | int spectator; 50 | 51 | const physent_t *onground; 52 | int watertype; 53 | int waterlevel; 54 | 55 | // input 56 | const usercmd_t *cmd; 57 | 58 | // results 59 | #ifdef SERVERONLY 60 | int numtouch; 61 | const physent_t *touch[MAX_PHYSENTS]; 62 | #endif 63 | } playermove_t; 64 | 65 | typedef struct { 66 | int numphysent; 67 | physent_t physents[MAX_PHYSENTS]; 68 | } physent_stack_t; 69 | 70 | typedef struct { 71 | float gravity; 72 | float stopspeed; 73 | float maxspeed; 74 | float spectatormaxspeed; 75 | float accelerate; 76 | float airaccelerate; 77 | float wateraccelerate; 78 | float friction; 79 | float waterfriction; 80 | float entgravity; 81 | } movevars_t; 82 | 83 | extern movevars_t movevars; 84 | extern const vec3_t player_mins; 85 | extern const vec3_t player_maxs; 86 | 87 | void PlayerMove(playermove_t *pmove, const physent_stack_t *pestack); 88 | 89 | int PM_PointContents(const vec3_t point, const physent_stack_t *pestack); 90 | qboolean PM_TestPlayerPosition(const vec3_t point, const physent_stack_t *pestack); 91 | 92 | /* Returns the physent that the trace hit, NULL otherwise */ 93 | const physent_t *PM_PlayerMove(const vec3_t start, const vec3_t stop, 94 | const physent_stack_t *pestack, trace_t *trace); 95 | 96 | #endif /* CLIENT_PMOVE_H */ 97 | -------------------------------------------------------------------------------- /QW/server/newnet.txt: -------------------------------------------------------------------------------- 1 | registered clients will auto-kick unregistered clients 2 | 3 | central clearingghouse for active servers 4 | 5 | server logon messages 6 | 7 | problem with reconnect to same server out of order packets 8 | 9 | acknowledge all command line parameters 10 | 11 | annoying pause on intermission screen 12 | 13 | seperate accept/reject list for server packets and client packets 14 | 15 | server compile time should be part of connect message and status 16 | 17 | allocate new cvars during file parse 18 | 19 | remote console should be able to do cvar setting/reading 20 | 21 | make punchangle a client side operation 22 | 23 | remove sys_printf 24 | remove host_client 25 | 26 | packet filter list 27 | client move by test final pos and test 1/16 down 28 | simulate world first, then clients, clients explicitly sim weapon projectiles 29 | allow remote locations to subscribe to console output 30 | 31 | 32 | 33 | client zombie state? 34 | seperate command ques for client and server? 35 | worry about partial connection during level change 36 | worry about zombie state for if(!state) constructs 37 | 38 | make sound/ and models/ implicit in data types 39 | 40 | int sequence 41 | int reliable_sequence; 42 | bit reliable_payload; 43 | 44 | consumption 45 | renewable resources 46 | depletable resources 47 | rate of extraction 48 | 49 | 50 | how can you influence other characters 51 | how can you communicate 52 | 53 | 54 | login 55 | logoff 56 | disconnection 57 | 58 | client to server 59 | ---------------- 60 | last good received server time 61 | milliseconds since last move frame 62 | angles 63 | movement 64 | buttonstates 65 | impulse 66 | 67 | 68 | server to client 69 | ---------------- 70 | last movemessage received 71 | origin 72 | velocity 73 | 74 | 75 | build movement 76 | send movement packet to server 77 | set player position to last known good 78 | execute all unaknowledged movement packets 79 | 80 | 81 | needs to know all things that can effect movement 82 | 83 | movement context 84 | ---------------- 85 | origin 86 | velocity 87 | size 88 | 89 | run move command (context, move) 90 | 91 | 92 | 93 | #define MAX_MOVEMESSAGES 64 94 | 95 | typedef struct 96 | { 97 | double time; // client time when sent 98 | byte milliseconds; 99 | } movemessage_t; 100 | 101 | int ack_movemessage; 102 | int current_movemessage; 103 | 104 | movemessage_t movemessages[MAX_MOVEMESSAGES]; 105 | 106 | void CL_Frame (void) 107 | { 108 | get all pending server messages 109 | 110 | latency = cl.time - movemessage[last].time; 111 | 112 | movetime = cl.time - cl.oldtime; 113 | get movemessage 114 | 115 | send packet to server 116 | } 117 | 118 | 119 | 120 | 121 | does not adress interpolating other object's movement 122 | -------------------------------------------------------------------------------- /include/asm_i386.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef ASM_I386_H 22 | #define ASM_I386_H 23 | 24 | #ifdef ELF 25 | #define C(label) label 26 | #else 27 | #define C(label) _##label 28 | #endif 29 | 30 | // 31 | // !!! note that this file must match the corresponding C structures at all 32 | // times !!! 33 | // 34 | 35 | // plane_t structure 36 | // !!! if this is changed, it must be changed in model.h too !!! 37 | // !!! if the size of this is changed, the array lookup in Mod_HullPointContents 38 | // must be changed too !!! 39 | #define pl_normal 0 40 | #define pl_dist 12 41 | #define pl_type 16 42 | #define pl_signbits 17 43 | #define pl_pad 18 44 | #define pl_size 20 45 | 46 | // hull_t structure 47 | // !!! if this is changed, it must be changed in model.h too !!! 48 | #define hu_clipnodes 0 49 | #define hu_planes 4 50 | #define hu_firstclipnode 8 51 | #define hu_lastclipnode 12 52 | #define hu_clip_mins 16 53 | #define hu_clip_maxs 28 54 | #define hu_size 40 55 | 56 | // mclipnode_t structure 57 | // !!! if this is changed, it must be changed in bspfile.h too !!! 58 | #define cn_planenum 0 59 | #define cn_children 4 60 | #define cn_size 12 61 | 62 | // sfxcache_t structure 63 | // !!! if this is changed, it much be changed in sound.h too !!! 64 | #define sfxc_length 0 65 | #define sfxc_loopstart 4 66 | #define sfxc_speed 8 67 | #define sfxc_width 12 68 | #define sfxc_stereo 16 69 | #define sfxc_data 20 70 | 71 | // channel_t structure 72 | // !!! if this is changed, it much be changed in sound.h too !!! 73 | #define ch_sfx 0 74 | #define ch_leftvol 4 75 | #define ch_rightvol 8 76 | #define ch_end 12 77 | #define ch_pos 16 78 | #define ch_looping 20 79 | #define ch_entnum 24 80 | #define ch_entchannel 28 81 | #define ch_origin 32 82 | #define ch_dist_mult 44 83 | #define ch_master_vol 48 84 | #define ch_size 52 85 | 86 | // portable_samplepair_t structure 87 | // !!! if this is changed, it much be changed in sound.h too !!! 88 | #define psp_left 0 89 | #define psp_right 4 90 | #define psp_size 8 91 | 92 | #endif /* ASM_I386_H */ 93 | -------------------------------------------------------------------------------- /NQ/net_bsd.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "net.h" 22 | #include "net_dgrm.h" 23 | #include "net_loop.h" 24 | #include "net_udp.h" 25 | 26 | net_driver_t net_drivers[] = { 27 | { 28 | .name = "Loopback", 29 | .initialized = false, 30 | .Init = Loop_Init, 31 | .Listen = Loop_Listen, 32 | .SearchForHosts = Loop_SearchForHosts, 33 | .Connect = Loop_Connect, 34 | .CheckNewConnections = Loop_CheckNewConnections, 35 | .QGetMessage = Loop_GetMessage, 36 | .QSendMessage = Loop_SendMessage, 37 | .SendUnreliableMessage = Loop_SendUnreliableMessage, 38 | .CanSendMessage = Loop_CanSendMessage, 39 | .CanSendUnreliableMessage = Loop_CanSendUnreliableMessage, 40 | .Close = Loop_Close, 41 | .Shutdown = Loop_Shutdown 42 | }, { 43 | .name = "Datagram", 44 | .initialized = false, 45 | .Init = Datagram_Init, 46 | .Listen = Datagram_Listen, 47 | .SearchForHosts = Datagram_SearchForHosts, 48 | .Connect = Datagram_Connect, 49 | .CheckNewConnections = Datagram_CheckNewConnections, 50 | .QGetMessage = Datagram_GetMessage, 51 | .QSendMessage = Datagram_SendMessage, 52 | .SendUnreliableMessage = Datagram_SendUnreliableMessage, 53 | .CanSendMessage = Datagram_CanSendMessage, 54 | .CanSendUnreliableMessage = Datagram_CanSendUnreliableMessage, 55 | .Close = Datagram_Close, 56 | .Shutdown = Datagram_Shutdown 57 | } 58 | }; 59 | 60 | int net_numdrivers = 2; 61 | 62 | net_landriver_t net_landrivers[] = { 63 | { 64 | .name = "UDP", 65 | .initialized = false, 66 | .controlSock = 0, 67 | .Init = UDP_Init, 68 | .Shutdown = UDP_Shutdown, 69 | .Listen = UDP_Listen, 70 | .OpenSocket = UDP_OpenSocket, 71 | .CloseSocket = UDP_CloseSocket, 72 | .CheckNewConnections = UDP_CheckNewConnections, 73 | .Read = UDP_Read, 74 | .Write = UDP_Write, 75 | .Broadcast = UDP_Broadcast, 76 | .GetSocketAddr = UDP_GetSocketAddr, 77 | .GetNameFromAddr = UDP_GetNameFromAddr, 78 | .GetAddrFromName = UDP_GetAddrFromName, 79 | .GetDefaultMTU = UDP_GetDefaultMTU 80 | } 81 | }; 82 | 83 | int net_numlandrivers = 1; 84 | -------------------------------------------------------------------------------- /NQ/chase.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // chase.c -- chase camera code 21 | 22 | #include "client.h" 23 | #include "quakedef.h" 24 | #include "world.h" 25 | 26 | cvar_t chase_back = { "chase_back", "100" }; 27 | cvar_t chase_up = { "chase_up", "16" }; 28 | cvar_t chase_right = { "chase_right", "0" }; 29 | cvar_t chase_active = { "chase_active", "0" }; 30 | 31 | vec3_t chase_pos; 32 | vec3_t chase_angles; 33 | 34 | vec3_t chase_dest; 35 | vec3_t chase_dest_angles; 36 | 37 | 38 | void 39 | Chase_Init(void) 40 | { 41 | Cvar_RegisterVariable(&chase_back); 42 | Cvar_RegisterVariable(&chase_up); 43 | Cvar_RegisterVariable(&chase_right); 44 | Cvar_RegisterVariable(&chase_active); 45 | } 46 | 47 | void 48 | Chase_Reset(void) 49 | { 50 | // for respawning and teleporting 51 | // start position 12 units behind head 52 | } 53 | 54 | void 55 | TraceLine(vec3_t start, vec3_t end, vec3_t impact) 56 | { 57 | trace_t trace; 58 | 59 | memset(&trace, 0, sizeof(trace)); 60 | Mod_TraceHull(cl.worldmodel->hulls, 0, start, end, &trace); 61 | 62 | VectorCopy(trace.endpos, impact); 63 | } 64 | 65 | void 66 | Chase_Update(void) 67 | { 68 | int i; 69 | float dist; 70 | vec3_t forward, up, right; 71 | vec3_t dest, stop; 72 | 73 | 74 | // if can't see player, reset 75 | AngleVectors(cl.viewangles, forward, right, up); 76 | 77 | // calc exact destination 78 | for (i = 0; i < 3; i++) 79 | chase_dest[i] = r_refdef.vieworg[i] 80 | - forward[i] * chase_back.value - right[i] * chase_right.value; 81 | chase_dest[2] = r_refdef.vieworg[2] + chase_up.value; 82 | 83 | // find the spot the player is looking at 84 | VectorMA(r_refdef.vieworg, 4096, forward, dest); 85 | TraceLine(r_refdef.vieworg, dest, stop); 86 | 87 | // calculate pitch to look at the same spot from camera 88 | VectorSubtract(stop, r_refdef.vieworg, stop); 89 | dist = DotProduct(stop, forward); 90 | if (dist < 1) 91 | dist = 1; 92 | r_refdef.viewangles[PITCH] = -atan(stop[2] / dist) / M_PI * 180; 93 | 94 | // move towards destination 95 | VectorCopy(chase_dest, r_refdef.vieworg); 96 | } 97 | -------------------------------------------------------------------------------- /NQ/net_win.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "net.h" 22 | #include "net_dgrm.h" 23 | #include "net_loop.h" 24 | #include "net_wins.h" 25 | 26 | #include "quakedef.h" 27 | 28 | net_driver_t net_drivers[] = { 29 | { 30 | .name = "Loopback", 31 | .initialized = false, 32 | .Init = Loop_Init, 33 | .Listen = Loop_Listen, 34 | .SearchForHosts = Loop_SearchForHosts, 35 | .Connect = Loop_Connect, 36 | .CheckNewConnections = Loop_CheckNewConnections, 37 | .QGetMessage = Loop_GetMessage, 38 | .QSendMessage = Loop_SendMessage, 39 | .SendUnreliableMessage = Loop_SendUnreliableMessage, 40 | .CanSendMessage = Loop_CanSendMessage, 41 | .CanSendUnreliableMessage = Loop_CanSendUnreliableMessage, 42 | .Close = Loop_Close, 43 | .Shutdown = Loop_Shutdown 44 | }, { 45 | .name = "Datagram", 46 | .initialized = false, 47 | .Init = Datagram_Init, 48 | .Listen = Datagram_Listen, 49 | .SearchForHosts = Datagram_SearchForHosts, 50 | .Connect = Datagram_Connect, 51 | .CheckNewConnections = Datagram_CheckNewConnections, 52 | .QGetMessage = Datagram_GetMessage, 53 | .QSendMessage = Datagram_SendMessage, 54 | .SendUnreliableMessage = Datagram_SendUnreliableMessage, 55 | .CanSendMessage = Datagram_CanSendMessage, 56 | .CanSendUnreliableMessage = Datagram_CanSendUnreliableMessage, 57 | .Close = Datagram_Close, 58 | .Shutdown = Datagram_Shutdown 59 | } 60 | }; 61 | 62 | int net_numdrivers = 2; 63 | 64 | net_landriver_t net_landrivers[] = { 65 | { 66 | .name = "Winsock TCPIP", 67 | .initialized = false, 68 | .controlSock = 0, 69 | .Init = WINS_Init, 70 | .Shutdown = WINS_Shutdown, 71 | .Listen = WINS_Listen, 72 | .OpenSocket = WINS_OpenSocket, 73 | .CloseSocket = WINS_CloseSocket, 74 | .CheckNewConnections = WINS_CheckNewConnections, 75 | .Read = WINS_Read, 76 | .Write = WINS_Write, 77 | .Broadcast = WINS_Broadcast, 78 | .GetSocketAddr = WINS_GetSocketAddr, 79 | .GetNameFromAddr = WINS_GetNameFromAddr, 80 | .GetAddrFromName = WINS_GetAddrFromName, 81 | .GetDefaultMTU = WINS_GetDefaultMTU 82 | } 83 | }; 84 | 85 | int net_numlandrivers = 1; 86 | -------------------------------------------------------------------------------- /common/d_modech.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // d_modech.c: called when mode has just changed 21 | 22 | #include "quakedef.h" 23 | #include "d_local.h" 24 | #include "render.h" 25 | #include "sys.h" 26 | 27 | int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle; 28 | 29 | int d_y_aspect_shift, d_pix_min, d_pix_max, d_pix_shift; 30 | 31 | int d_scantable[MAXHEIGHT]; 32 | short *zspantable[MAXHEIGHT]; 33 | 34 | /* 35 | ================ 36 | D_Patch 37 | ================ 38 | */ 39 | void 40 | D_Patch(void) 41 | { 42 | #ifdef USE_X86_ASM 43 | static qboolean protectset8 = false; 44 | if (!protectset8) { 45 | Sys_MakeCodeWriteable(D_PolysetAff8Start, D_PolysetAff8End); 46 | protectset8 = true; 47 | } 48 | #endif /* USE_X86_ASM */ 49 | } 50 | 51 | 52 | /* 53 | ================ 54 | D_ViewChanged 55 | ================ 56 | */ 57 | void 58 | D_ViewChanged(void) 59 | { 60 | int rowbytes; 61 | 62 | if (r_dowarp) 63 | rowbytes = WARP_WIDTH; 64 | else 65 | rowbytes = vid.rowbytes; 66 | 67 | scale_for_mip = xscale; 68 | if (yscale > xscale) 69 | scale_for_mip = yscale; 70 | 71 | d_zrowbytes = vid.width * 2; 72 | d_zwidth = vid.width; 73 | 74 | d_pix_min = r_refdef.vrect.width / 320; 75 | if (d_pix_min < 1) 76 | d_pix_min = 1; 77 | 78 | d_pix_max = (int)((float)r_refdef.vrect.width / (320.0 / 4.0) + 0.5); 79 | d_pix_shift = 8 - (int)((float)r_refdef.vrect.width / 320.0 + 0.5); 80 | if (d_pix_max < 1) 81 | d_pix_max = 1; 82 | 83 | if (pixelAspect > 1.4) 84 | d_y_aspect_shift = 1; 85 | else 86 | d_y_aspect_shift = 0; 87 | 88 | d_vrectx = r_refdef.vrect.x; 89 | d_vrecty = r_refdef.vrect.y; 90 | d_vrectright_particle = r_refdef.vrectright - d_pix_max; 91 | d_vrectbottom_particle = 92 | r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift); 93 | 94 | { 95 | int i; 96 | 97 | for (i = 0; i < vid.height; i++) { 98 | d_scantable[i] = i * rowbytes; 99 | zspantable[i] = d_pzbuffer + i * d_zwidth; 100 | } 101 | } 102 | 103 | D_Patch(); 104 | } 105 | -------------------------------------------------------------------------------- /NQ/dosisms.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef DOSISMS_H 22 | #define DOSISMS_H 23 | 24 | // 25 | // dosisms.h: I'd call it dos.h, but the name's taken 26 | // 27 | 28 | int dos_lockmem(void *addr, int size); 29 | int dos_unlockmem(void *addr, int size); 30 | 31 | typedef union { 32 | struct { 33 | unsigned long edi; 34 | unsigned long esi; 35 | unsigned long ebp; 36 | unsigned long res; 37 | unsigned long ebx; 38 | unsigned long edx; 39 | unsigned long ecx; 40 | unsigned long eax; 41 | } d; 42 | struct { 43 | unsigned short di, di_hi; 44 | unsigned short si, si_hi; 45 | unsigned short bp, bp_hi; 46 | unsigned short res, res_hi; 47 | unsigned short bx, bx_hi; 48 | unsigned short dx, dx_hi; 49 | unsigned short cx, cx_hi; 50 | unsigned short ax, ax_hi; 51 | unsigned short flags; 52 | unsigned short es; 53 | unsigned short ds; 54 | unsigned short fs; 55 | unsigned short gs; 56 | unsigned short ip; 57 | unsigned short cs; 58 | unsigned short sp; 59 | unsigned short ss; 60 | } x; 61 | struct { 62 | unsigned char edi[4]; 63 | unsigned char esi[4]; 64 | unsigned char ebp[4]; 65 | unsigned char res[4]; 66 | unsigned char bl, bh, ebx_b2, ebx_b3; 67 | unsigned char dl, dh, edx_b2, edx_b3; 68 | unsigned char cl, ch, ecx_b2, ecx_b3; 69 | unsigned char al, ah, eax_b2, eax_b3; 70 | } h; 71 | } regs_t; 72 | 73 | unsigned int ptr2real(void *ptr); 74 | void *real2ptr(unsigned int real); 75 | void *far2ptr(unsigned int farptr); 76 | unsigned int ptr2far(void *ptr); 77 | 78 | int dos_inportb(int port); 79 | int dos_inportw(int port); 80 | void dos_outportb(int port, int val); 81 | void dos_outportw(int port, int val); 82 | 83 | void dos_irqenable(void); 84 | void dos_irqdisable(void); 85 | void dos_registerintr(int intr, void (*handler) (void)); 86 | void dos_restoreintr(int intr); 87 | 88 | int dos_int86(int vec); 89 | 90 | void *dos_getmemory(int size); 91 | void dos_freememory(void *ptr); 92 | 93 | void dos_usleep(int usecs); 94 | 95 | int dos_getheapsize(void); 96 | 97 | extern regs_t regs; 98 | 99 | #endif /* DOSISMS_H */ 100 | -------------------------------------------------------------------------------- /QW/progs/server.qc: -------------------------------------------------------------------------------- 1 | 2 | void() monster_ogre = {remove(self);}; 3 | void() monster_demon1 = {remove(self);}; 4 | void() monster_shambler = {remove(self);}; 5 | void() monster_knight = {remove(self);}; 6 | void() monster_army = {remove(self);}; 7 | void() monster_wizard = {remove(self);}; 8 | void() monster_dog = {remove(self);}; 9 | void() monster_zombie = {remove(self);}; 10 | void() monster_boss = {remove(self);}; 11 | void() monster_tarbaby = {remove(self);}; 12 | void() monster_hell_knight = {remove(self);}; 13 | void() monster_fish = {remove(self);}; 14 | void() monster_shalrath = {remove(self);}; 15 | void() monster_enforcer = {remove(self);}; 16 | void() monster_oldone = {remove(self);}; 17 | void() event_lightning = {remove(self);}; 18 | 19 | /* 20 | ============================================================================== 21 | 22 | MOVETARGET CODE 23 | 24 | The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target. 25 | 26 | targetname 27 | must be present. The name of this movetarget. 28 | 29 | target 30 | the next spot to move to. If not present, stop here for good. 31 | 32 | pausetime 33 | The number of seconds to spend standing or bowing for path_stand or path_bow 34 | 35 | ============================================================================== 36 | */ 37 | 38 | /* 39 | ============= 40 | t_movetarget 41 | 42 | Something has bumped into a movetarget. If it is a monster 43 | moving towards it, change the next destination and continue. 44 | ============== 45 | */ 46 | void() t_movetarget = 47 | { 48 | local entity temp; 49 | 50 | if (other.movetarget != self) 51 | return; 52 | 53 | if (other.enemy) 54 | return; // fighting, not following a path 55 | 56 | temp = self; 57 | self = other; 58 | other = temp; 59 | 60 | if (self.classname == "monster_ogre") 61 | sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound 62 | 63 | //dprint ("t_movetarget\n"); 64 | self.goalentity = self.movetarget = find (world, targetname, other.target); 65 | self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); 66 | if (!self.movetarget) 67 | { 68 | self.pausetime = time + 999999; 69 | self.th_stand (); 70 | return; 71 | } 72 | }; 73 | 74 | 75 | 76 | void() movetarget_f = 77 | { 78 | if (!self.targetname) 79 | objerror ("monster_movetarget: no targetname"); 80 | 81 | self.solid = SOLID_TRIGGER; 82 | self.touch = t_movetarget; 83 | setsize (self, '-8 -8 -8', '8 8 8'); 84 | 85 | }; 86 | 87 | /*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8) 88 | Monsters will continue walking towards the next target corner. 89 | */ 90 | void() path_corner = 91 | { 92 | movetarget_f (); 93 | }; 94 | 95 | 96 | 97 | //============================================================================ 98 | -------------------------------------------------------------------------------- /common/gl_extensions.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | Copyright (C) 2013 Kevin Shanahan 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | 14 | See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, write to the Free Software 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | 20 | */ 21 | 22 | #include 23 | 24 | #include "console.h" 25 | #include "cvar.h" 26 | #include "glquake.h" 27 | #include "qtypes.h" 28 | 29 | qboolean gl_npotable; 30 | cvar_t gl_npot = { "gl_npot", "1", false }; 31 | 32 | static qboolean 33 | GL_ExtensionCheck(const char *extension) 34 | { 35 | int length = strlen(extension); 36 | const char *search = (const char *)glGetString(GL_EXTENSIONS); 37 | 38 | while ((search = strstr(search, extension))) { 39 | if (!search[length] || search[length] == ' ') 40 | return true; 41 | search += length; 42 | } 43 | 44 | return false; 45 | } 46 | 47 | void 48 | GL_ExtensionCheck_NPoT(void) 49 | { 50 | gl_npotable = false; 51 | if (COM_CheckParm("-nonpot")) 52 | return; 53 | if (!GL_ExtensionCheck("GL_ARB_texture_non_power_of_two")) 54 | return; 55 | 56 | Con_DPrintf("Non-power-of-two textures available.\n"); 57 | gl_npotable = true; 58 | } 59 | 60 | void 61 | GL_ExtensionCheck_MultiTexture() 62 | { 63 | gl_mtexable = false; 64 | if (COM_CheckParm("-nomtex")) 65 | return; 66 | if (!GL_ExtensionCheck("GL_ARB_multitexture")) 67 | return; 68 | 69 | Con_Printf("ARB multitexture extensions found.\n"); 70 | 71 | /* Check how many texture units there actually are */ 72 | glGetIntegerv(GL_MAX_TEXTURE_UNITS, &gl_num_texture_units); 73 | if (gl_num_texture_units < 2) { 74 | Con_Printf("Only %i texture units, multitexture disabled.\n", gl_num_texture_units); 75 | return; 76 | } 77 | 78 | /* Retrieve function pointers for multitexture methods */ 79 | qglMultiTexCoord2fARB = (lpMultiTexFUNC)GL_GetProcAddress("glMultiTexCoord2fARB"); 80 | qglActiveTextureARB = (lpActiveTextureFUNC)GL_GetProcAddress("glActiveTextureARB"); 81 | qglClientActiveTexture = (lpClientStateFUNC)GL_GetProcAddress("glClientActiveTexture"); 82 | 83 | if (!qglMultiTexCoord2fARB || !qglActiveTextureARB || !qglClientActiveTexture) { 84 | Con_Printf("ARB Multitexture symbols not found, disabled.\n"); 85 | return; 86 | } 87 | 88 | Con_Printf("Multitexture enabled. %i texture units available.\n", 89 | gl_num_texture_units); 90 | 91 | gl_mtexable = true; 92 | } 93 | -------------------------------------------------------------------------------- /readme-id.txt: -------------------------------------------------------------------------------- 1 | 2 | This is the complete source code for winquake, glquake, quakeworld, and 3 | glquakeworld. 4 | 5 | The projects have been tested with visual C++ 6.0, but masm is also required 6 | to build the assembly language files. It is possible to change a #define and 7 | build with only C code, but the software rendering versions lose almost half 8 | its speed. The OpenGL versions will not be effected very much. The 9 | gas2masm tool was created to allow us to use the same source for the dos, 10 | linux, and windows versions, but I don't really recommend anyone mess 11 | with the asm code. 12 | 13 | The original dos version of Quake should also be buildable from these 14 | sources, but we didn't bother trying. 15 | 16 | The code is all licensed under the terms of the GPL (gnu public license). 17 | You should read the entire license, but the gist of it is that you can do 18 | anything you want with the code, including sell your new version. The catch 19 | is that if you distribute new binary versions, you are required to make the 20 | entire source code available for free to everyone. 21 | 22 | Our previous code releases have been under licenses that preclude 23 | commercial exploitation, but have no clause forcing sharing of source code. 24 | There have been some unfortunate losses to the community as a result of 25 | mod teams keeping their sources closed (and sometimes losing them). If 26 | you are going to publicly release modified versions of this code, you must 27 | also make source code available. I would encourage teams to even go a step 28 | farther and investigate using public CVS servers for development where 29 | possible. 30 | 31 | The primary intent of this release is for entertainment and educational 32 | purposes, but the GPL does allow commercial exploitation if you obey the 33 | full license. If you want to do something commercial and you just can't bear 34 | to have your source changes released, we could still negotiate a separate 35 | license agreement (for $$$), but I would encourage you to just live with the 36 | GPL. 37 | 38 | All of the Quake data files remain copyrighted and licensed under the 39 | original terms, so you cannot redistribute data from the original game, but if 40 | you do a true total conversion, you can create a standalone game based on 41 | this code. 42 | 43 | I will see about having the license changed on the shareware episode of 44 | quake to allow it to be duplicated more freely (for linux distributions, for 45 | example), but I can't give a timeframe for it. You can still download one of 46 | the original quake demos and use that data with the code, but there are 47 | restrictions on the redistribution of the demo data. 48 | 49 | If you never actually bought a complete version of Quake, you might want 50 | to rummage around in a local software bargain bin for one of the originals, 51 | or perhaps find a copy of the "Quake: the offering" boxed set with both 52 | mission packs. 53 | 54 | Thanks to Dave "Zoid" Kirsh and Robert Duffy for doing the grunt work of 55 | building this release. 56 | 57 | John Carmack 58 | Id Software 59 | 60 | 61 | -------------------------------------------------------------------------------- /NQ/progdefs-id1.h: -------------------------------------------------------------------------------- 1 | 2 | /* file generated by qcc, do not modify */ 3 | 4 | typedef struct 5 | { int pad[28]; 6 | int self; 7 | int other; 8 | int world; 9 | float time; 10 | float frametime; 11 | float force_retouch; 12 | string_t mapname; 13 | float deathmatch; 14 | float coop; 15 | float teamplay; 16 | float serverflags; 17 | float total_secrets; 18 | float total_monsters; 19 | float found_secrets; 20 | float killed_monsters; 21 | float parm1; 22 | float parm2; 23 | float parm3; 24 | float parm4; 25 | float parm5; 26 | float parm6; 27 | float parm7; 28 | float parm8; 29 | float parm9; 30 | float parm10; 31 | float parm11; 32 | float parm12; 33 | float parm13; 34 | float parm14; 35 | float parm15; 36 | float parm16; 37 | vec3_t v_forward; 38 | vec3_t v_up; 39 | vec3_t v_right; 40 | float trace_allsolid; 41 | float trace_startsolid; 42 | float trace_fraction; 43 | vec3_t trace_endpos; 44 | vec3_t trace_plane_normal; 45 | float trace_plane_dist; 46 | int trace_ent; 47 | float trace_inopen; 48 | float trace_inwater; 49 | int msg_entity; 50 | func_t main; 51 | func_t StartFrame; 52 | func_t PlayerPreThink; 53 | func_t PlayerPostThink; 54 | func_t ClientKill; 55 | func_t ClientConnect; 56 | func_t PutClientInServer; 57 | func_t ClientDisconnect; 58 | func_t SetNewParms; 59 | func_t SetChangeParms; 60 | } globalvars_t; 61 | 62 | typedef struct 63 | { 64 | float modelindex; 65 | vec3_t absmin; 66 | vec3_t absmax; 67 | float ltime; 68 | float movetype; 69 | float solid; 70 | vec3_t origin; 71 | vec3_t oldorigin; 72 | vec3_t velocity; 73 | vec3_t angles; 74 | vec3_t avelocity; 75 | vec3_t punchangle; 76 | string_t classname; 77 | string_t model; 78 | float frame; 79 | float skin; 80 | float effects; 81 | vec3_t mins; 82 | vec3_t maxs; 83 | vec3_t size; 84 | func_t touch; 85 | func_t use; 86 | func_t think; 87 | func_t blocked; 88 | float nextthink; 89 | int groundentity; 90 | float health; 91 | float frags; 92 | float weapon; 93 | string_t weaponmodel; 94 | float weaponframe; 95 | float currentammo; 96 | float ammo_shells; 97 | float ammo_nails; 98 | float ammo_rockets; 99 | float ammo_cells; 100 | float items; 101 | float takedamage; 102 | int chain; 103 | float deadflag; 104 | vec3_t view_ofs; 105 | float button0; 106 | float button1; 107 | float button2; 108 | float impulse; 109 | float fixangle; 110 | vec3_t v_angle; 111 | float idealpitch; 112 | string_t netname; 113 | int enemy; 114 | float flags; 115 | float colormap; 116 | float team; 117 | float max_health; 118 | float teleport_time; 119 | float armortype; 120 | float armorvalue; 121 | float waterlevel; 122 | float watertype; 123 | float ideal_yaw; 124 | float yaw_speed; 125 | int aiment; 126 | int goalentity; 127 | float spawnflags; 128 | string_t target; 129 | string_t targetname; 130 | float dmg_take; 131 | float dmg_save; 132 | int dmg_inflictor; 133 | int owner; 134 | vec3_t movedir; 135 | string_t message; 136 | float sounds; 137 | string_t noise; 138 | string_t noise1; 139 | string_t noise2; 140 | string_t noise3; 141 | } entvars_t; 142 | 143 | #define PROGHEADER_CRC 5927 144 | -------------------------------------------------------------------------------- /include/d_ifacea.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef D_IFACEA_H 22 | #define D_IFACEA_H 23 | 24 | // 25 | // d_ifacea.h 26 | // 27 | // Include file for asm driver interface. 28 | // 29 | 30 | // 31 | // !!! note that this file must match the corresponding C structures in 32 | // d_iface.h at all times !!! 33 | // 34 | 35 | // !!! if this is changed, it must be changed in r_shared.h too !!! 36 | #define ALIAS_ONSEAM 0x0020 37 | 38 | // !!! if this is changed, it must be changed in d_iface.h too !!! 39 | #define TURB_TEX_SIZE 64 // base turbulent texture size 40 | #define TURB_TEX_SHIFT 6 41 | 42 | // !!! if this is changed, it must be changed in d_iface.h too !!! 43 | #define TURB_CYCLE 128 44 | 45 | // !!! if this is changed, it must be changed in r_shared.h too !!! 46 | #define MAXHEIGHT 1200 47 | 48 | // !!! if this is changed, it must be changed in quakedef.h too !!! 49 | #define CACHE_SIZE 32 // used to align key data structures 50 | 51 | // particle_t structure 52 | // !!! if this is changed, it must be changed in d_iface.h too !!! 53 | // driver-usable fields 54 | #define pt_org 0 55 | #define pt_color 12 56 | // drivers never touch the following fields 57 | #define pt_next 16 58 | #define pt_vel 20 59 | #define pt_ramp 32 60 | #define pt_die 36 61 | #define pt_type 40 62 | #define pt_size 44 63 | 64 | #define PARTICLE_Z_CLIP 8.0 65 | 66 | // finalvert_t structure 67 | // !!! if this is changed, it must be changed in d_iface.h too !!! 68 | #define fv_v 0 // !!! if this is moved, cases where the !!! 69 | // !!! address of this field is pushed in !!! 70 | // !!! d_polysa.s must be changed !!! 71 | #define fv_flags 24 72 | #define fv_reserved 28 73 | #define fv_size 32 74 | #define fv_shift 5 75 | 76 | // stvert_t structure 77 | // !!! if this is changed, it must be changed in modelgen.h too !!! 78 | #define stv_onseam 0 79 | #define stv_s 4 80 | #define stv_t 8 81 | #define stv_size 12 82 | 83 | 84 | // trivertx_t structure 85 | // !!! if this is changed, it must be changed in modelgen.h too !!! 86 | #define tv_v 0 87 | #define tv_lightnormalindex 3 88 | #define tv_size 4 89 | 90 | // affinetridesc_t structure 91 | // !!! if this is changed, it must be changed in d_iface.h too !!! 92 | #define atd_pskin 0 93 | #define atd_skinwidth 4 94 | #define atd_skinheight 8 95 | #define atd_ptriangles 12 96 | #define atd_pfinalverts 16 97 | #define atd_numtriangles 20 98 | #define atd_drawtype 24 99 | #define atd_seamfixupX16 28 100 | #define atd_size 32 101 | 102 | #endif /* D_IFACEA_H */ 103 | -------------------------------------------------------------------------------- /include/world.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef WORLD_H 22 | #define WORLD_H 23 | 24 | #include "mathlib.h" 25 | #include "progs.h" 26 | #include "qtypes.h" 27 | 28 | typedef enum { 29 | MOVE_NORMAL = 0, 30 | MOVE_NOMONSTERS = 1, 31 | MOVE_MISSILE = 2, 32 | } movetype_t; 33 | 34 | 35 | void SV_ClearWorld(void); 36 | 37 | // called after the world model has been loaded, before linking any entities 38 | 39 | void SV_UnlinkEdict(edict_t *ent); 40 | 41 | // call before removing an entity, and before trying to move one, 42 | // so it doesn't clip against itself 43 | // flags ent->v.modified 44 | 45 | void SV_LinkEdict(edict_t *ent, qboolean touch_triggers); 46 | 47 | // Needs to be called any time an entity changes origin, mins, maxs, or solid 48 | // flags ent->v.modified 49 | // sets ent->v.absmin and ent->v.absmax 50 | // if touchtriggers, calls prog functions for the intersected triggers 51 | 52 | int SV_PointContents(const vec3_t point); 53 | 54 | // returns the CONTENTS_* value from the world at the given point. 55 | // does not check any entities at all 56 | 57 | edict_t *SV_TestEntityPosition(const edict_t *ent); 58 | 59 | /* 60 | * SV_Move 61 | * - mins and maxs are reletive 62 | * - if the entire move stays in a solid volume, trace.allsolid will be set 63 | * - if the starting point is in a solid, it will be allowed to move out 64 | * to an open area 65 | * - MOVE_NOMONSTERS is used for line of sight or edge testing, where monsters 66 | * shouldn't be considered solid objects 67 | * - passedict is explicitly excluded from clipping checks (normally NULL) 68 | */ 69 | const edict_t *SV_TraceMove(const vec3_t start, 70 | const vec3_t mins, const vec3_t maxs, 71 | const vec3_t end, 72 | const movetype_t type, const edict_t *passedict, 73 | trace_t *trace); 74 | 75 | static inline const edict_t * 76 | SV_TraceMoveEntity(const edict_t *entity, const vec3_t start, const vec3_t end, 77 | movetype_t type, trace_t *trace) 78 | { 79 | return SV_TraceMove(start, entity->v.mins, entity->v.maxs, end, type, 80 | entity, trace); 81 | } 82 | 83 | static inline const edict_t * 84 | SV_TraceLine(const vec3_t start, const vec3_t end, movetype_t type, 85 | const edict_t *passedict, trace_t *trace) 86 | { 87 | return SV_TraceMove(start, vec3_origin, vec3_origin, end, type, passedict, 88 | trace); 89 | } 90 | 91 | #if defined(QW_HACK) && defined(SERVERONLY) 92 | #include "pmove.h" 93 | void SV_AddLinksToPhysents(const edict_t *player, const vec3_t mins, 94 | const vec3_t maxs, physent_stack_t *pestack); 95 | #endif 96 | 97 | #endif /* WORLD_H */ 98 | -------------------------------------------------------------------------------- /common/sys_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // sys_null.h -- null system driver to aid porting efforts 21 | 22 | #include "quakedef.h" 23 | #include "errno.h" 24 | 25 | /* 26 | =============================================================================== 27 | 28 | FILE IO 29 | 30 | =============================================================================== 31 | */ 32 | 33 | int 34 | Sys_FileTime(char *path) 35 | { 36 | FILE *f; 37 | 38 | f = fopen(path, "rb"); 39 | if (f) { 40 | fclose(f); 41 | return 1; 42 | } 43 | 44 | return -1; 45 | } 46 | 47 | void 48 | Sys_mkdir(char *path) 49 | { 50 | } 51 | 52 | 53 | /* 54 | =============================================================================== 55 | 56 | SYSTEM IO 57 | 58 | =============================================================================== 59 | */ 60 | 61 | void 62 | Sys_MakeCodeWriteable(void *start_addr, void *end_addr) 63 | { 64 | } 65 | 66 | void 67 | Sys_DebugLog(const char *file, const char *fmt, ...) 68 | { 69 | } 70 | 71 | void 72 | Sys_Error(const char *error, ...) 73 | { 74 | va_list argptr; 75 | 76 | printf("Sys_Error: "); 77 | va_start(argptr, error); 78 | vprintf(error, argptr); 79 | va_end(argptr); 80 | printf("\n"); 81 | 82 | exit(1); 83 | } 84 | 85 | void 86 | Sys_Printf(const char *fmt, ...) 87 | { 88 | va_list argptr; 89 | 90 | va_start(argptr, fmt); 91 | vprintf(fmt, argptr); 92 | va_end(argptr); 93 | } 94 | 95 | void 96 | Sys_Quit(void) 97 | { 98 | exit(0); 99 | } 100 | 101 | double 102 | Sys_DoubleTime(void) 103 | { 104 | static double t; 105 | 106 | t += 0.1; 107 | 108 | return t; 109 | } 110 | 111 | char * 112 | Sys_ConsoleInput(void) 113 | { 114 | return NULL; 115 | } 116 | 117 | void 118 | Sys_Sleep(void) 119 | { 120 | } 121 | 122 | void 123 | Sys_SendKeyEvents(void) 124 | { 125 | } 126 | 127 | void 128 | Sys_HighFPPrecision(void) 129 | { 130 | } 131 | 132 | void 133 | Sys_LowFPPrecision(void) 134 | { 135 | } 136 | 137 | //============================================================================= 138 | 139 | void 140 | main(int argc, char **argv) 141 | { 142 | quakeparms_t parms; 143 | 144 | parms.memsize = 8 * 1024 * 1024; 145 | parms.membase = malloc(parms.memsize); 146 | parms.basedir = "."; 147 | 148 | COM_InitArgv(argc, argv); 149 | 150 | parms.argc = com_argc; 151 | parms.argv = com_argv; 152 | 153 | printf("Host_Init\n"); 154 | Host_Init(&parms); 155 | while (1) { 156 | Host_Frame(0.1); 157 | } 158 | 159 | return 0; 160 | } 161 | -------------------------------------------------------------------------------- /QW/client/gl_ngraph.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // gl_ngraph.c 21 | 22 | #include "client.h" 23 | #include "draw.h" 24 | #include "glquake.h" 25 | #include "menu.h" 26 | #include "quakedef.h" 27 | #include "sbar.h" 28 | 29 | #define NET_GRAPHHEIGHT 32 30 | static byte netgraph_pixels[NET_GRAPHHEIGHT][NET_TIMINGS]; 31 | static GLuint netgraphtexture; 32 | 33 | void 34 | R_ResetNetGraphTexture() 35 | { 36 | netgraphtexture = 0; 37 | } 38 | 39 | static void 40 | R_LineGraph(int x, int h) 41 | { 42 | int i; 43 | byte color; 44 | 45 | if (h == 10000) 46 | color = 0x6f; // yellow 47 | else if (h == 9999) 48 | color = 0x4f; // red 49 | else if (h == 9998) 50 | color = 0xd0; // blue 51 | else 52 | color = 0xfe; // white 53 | 54 | if (h > NET_GRAPHHEIGHT) 55 | h = NET_GRAPHHEIGHT; 56 | 57 | for (i = 0; i < h; i++) { 58 | netgraph_pixels[NET_GRAPHHEIGHT - 1 - i][x] = (i & 1) ? 0xff : color; 59 | } 60 | for (; i < NET_GRAPHHEIGHT; i++) { 61 | netgraph_pixels[NET_GRAPHHEIGHT - 1 - i][x] = 0xff; 62 | } 63 | } 64 | 65 | /* 66 | ============== 67 | R_NetGraph 68 | ============== 69 | */ 70 | void 71 | R_NetGraph(void) 72 | { 73 | int i, time_index, x, y, loss_percent; 74 | char message[80]; 75 | 76 | loss_percent = CL_CalcNet(); 77 | for (i = 0; i < NET_TIMINGS; i++) { 78 | time_index = (cls.netchan.outgoing_sequence - i) & NET_TIMINGSMASK; 79 | R_LineGraph(NET_TIMINGS - 1 - i, packet_latency[time_index]); 80 | } 81 | 82 | x = -((vid.width - 320) >> 1); 83 | y = vid.height - sb_lines - 24 - NET_GRAPHHEIGHT - 1; 84 | 85 | M_DrawTextBox(x, y, NET_TIMINGS / 8, NET_GRAPHHEIGHT / 8 + 1); 86 | y += 8; 87 | 88 | qsnprintf(message, sizeof(message), "%3i%% packet loss", loss_percent); 89 | Draw_String(8, y, message); 90 | y += 8; 91 | 92 | // now load the netgraph texture into gl and draw it 93 | qpic8_t netgraph = { 94 | .width = NET_TIMINGS, 95 | .height = NET_GRAPHHEIGHT, 96 | .pixels = &netgraph_pixels[0][0], 97 | }; 98 | if (!netgraphtexture) { 99 | netgraphtexture = GL_AllocTexture8("@netgraph", &netgraph, TEXTURE_TYPE_HUD); 100 | } 101 | GL_Bind(netgraphtexture); 102 | GL_Upload8(&netgraph, TEXTURE_TYPE_HUD); 103 | 104 | x = 8; 105 | glColor3f(1, 1, 1); 106 | glBegin(GL_QUADS); 107 | glTexCoord2f(0, 0); 108 | glVertex2f(x, y); 109 | glTexCoord2f(1, 0); 110 | glVertex2f(x + NET_TIMINGS, y); 111 | glTexCoord2f(1, 1); 112 | glVertex2f(x + NET_TIMINGS, y + NET_GRAPHHEIGHT); 113 | glTexCoord2f(0, 1); 114 | glVertex2f(x, y + NET_GRAPHHEIGHT); 115 | glEnd(); 116 | } 117 | -------------------------------------------------------------------------------- /include/spritegn.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef SPRITEGN_H 22 | #define SPRITEGN_H 23 | 24 | // 25 | // spritegn.h: header file for sprite generation program 26 | // 27 | 28 | // ********************************************************** 29 | // * This file must be identical in the spritegen directory * 30 | // * and in the Quake directory, because it's used to * 31 | // * pass data from one to the other via .spr files. * 32 | // ********************************************************** 33 | 34 | //------------------------------------------------------- 35 | // This program generates .spr sprite package files. 36 | // The format of the files is as follows: 37 | // 38 | // dsprite_t file header structure 39 | // 40 | // 41 | // dspriteframe_t frame header structure 42 | // sprite bitmap 43 | // 44 | // dspriteframe_t frame header structure 45 | // sprite bitmap 46 | // 47 | //------------------------------------------------------- 48 | 49 | #ifdef INCLUDELIBS 50 | 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | #include "cmdlib.h" 57 | #include "scriplib.h" 58 | #include "dictlib.h" 59 | #include "trilib.h" 60 | #include "lbmlib.h" 61 | #include "mathlib.h" 62 | 63 | #endif 64 | 65 | #define SPRITE_VERSION 1 66 | 67 | // must match definition in modelgen.h 68 | #ifndef SYNCTYPE_T 69 | #define SYNCTYPE_T 70 | typedef enum { ST_SYNC = 0, ST_RAND } synctype_t; 71 | #endif 72 | 73 | // TODO: shorten these? 74 | typedef struct { 75 | int ident; 76 | int version; 77 | int type; 78 | float boundingradius; 79 | int width; 80 | int height; 81 | int numframes; 82 | float beamlength; 83 | synctype_t synctype; 84 | } dsprite_t; 85 | 86 | #define SPR_VP_PARALLEL_UPRIGHT 0 87 | #define SPR_FACING_UPRIGHT 1 88 | #define SPR_VP_PARALLEL 2 89 | #define SPR_ORIENTED 3 90 | #define SPR_VP_PARALLEL_ORIENTED 4 91 | 92 | typedef struct { 93 | int origin[2]; 94 | int width; 95 | int height; 96 | } dspriteframe_t; 97 | 98 | typedef struct { 99 | int numframes; 100 | } dspritegroup_t; 101 | 102 | typedef struct { 103 | float interval; 104 | } dspriteinterval_t; 105 | 106 | typedef enum { SPR_SINGLE = 0, SPR_GROUP } spriteframetype_t; 107 | 108 | typedef struct { 109 | spriteframetype_t type; 110 | } dspriteframetype_t; 111 | 112 | #define IDSPRITEHEADER (('P'<<24)+('S'<<16)+('D'<<8)+'I') 113 | // little-endian "IDSP" 114 | 115 | #endif /* SPRITEGN_H */ 116 | -------------------------------------------------------------------------------- /common/modela.S: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // modela.s 22 | // x86 assembly-language hull testing stuff 23 | // 24 | 25 | #include "asm_i386.h" 26 | #include "quakeasm.h" 27 | 28 | .data 29 | 30 | Ltemp: .long 0 31 | 32 | .text 33 | 34 | //---------------------------------------------------------------------- 35 | // hull-point test 36 | //---------------------------------------------------------------------- 37 | 38 | #define hull 4+8 // because only partially pushed 39 | #define num 8+4 // because only partially pushed 40 | #define p 12+12 // because only partially pushed 41 | 42 | .align 4 43 | .globl C(Mod_HullPointContents) 44 | C(Mod_HullPointContents): 45 | pushl %edi // preserve register variables 46 | movl num(%esp),%eax 47 | testl %eax,%eax 48 | js Lhquickout 49 | 50 | // float d; 51 | // mclipnode_t *node; 52 | // mplane_t *plane; 53 | 54 | pushl %ebx 55 | movl hull(%esp),%ebx 56 | 57 | pushl %ebp 58 | movl p(%esp),%edx 59 | 60 | movl hu_clipnodes(%ebx),%edi 61 | movl hu_planes(%ebx),%ebp 62 | 63 | subl %ebx,%ebx 64 | pushl %esi 65 | 66 | // %ebx: 0 67 | // %eax: num 68 | // %edx: p 69 | // %edi: hull->clipnodes 70 | // %ebp: hull->planes 71 | 72 | // while (num >= 0) 73 | // { 74 | 75 | Lhloop: 76 | 77 | // node = hull->clipnodes + num; 78 | // plane = hull->planes + node->planenum; 79 | // !!! if the size of mclipnode_t changes, the scaling of %eax needs to be 80 | // changed !!! 81 | leal (%eax,%eax,2),%eax 82 | movl cn_planenum(%edi,%eax,4),%ecx 83 | movl cn_children+4(%edi,%eax,4),%esi 84 | movl cn_children(%edi,%eax,4),%eax 85 | leal (%ecx,%ecx,4),%ecx 86 | 87 | // if (plane->type < 3) 88 | // d = p[plane->type] - plane->dist; 89 | movb pl_type(%ebp,%ecx,4),%bl 90 | cmpb $3,%bl 91 | jb Lnodot 92 | 93 | // else 94 | // d = DotProduct (plane->normal, p) - plane->dist; 95 | flds pl_normal(%ebp,%ecx,4) 96 | fmuls 0(%edx) 97 | flds pl_normal+4(%ebp,%ecx,4) 98 | fmuls 4(%edx) 99 | flds pl_normal+8(%ebp,%ecx,4) 100 | fmuls 8(%edx) 101 | fxch %st(1) 102 | faddp %st(0),%st(2) 103 | faddp %st(0),%st(1) 104 | fsubs pl_dist(%ebp,%ecx,4) 105 | jmp Lsub 106 | 107 | Lnodot: 108 | flds pl_dist(%ebp,%ecx,4) 109 | fsubrs (%edx,%ebx,4) 110 | 111 | Lsub: 112 | // if (d < 0) 113 | // num = node->children[1]; 114 | // else 115 | // num = node->children[0]; 116 | fstps Ltemp 117 | movl Ltemp,%ecx 118 | sarl $31,%ecx 119 | andl %ecx,%esi 120 | xorl $0xFFFFFFFF,%ecx 121 | andl %ecx,%eax 122 | orl %esi,%eax 123 | jns Lhloop 124 | 125 | // return num; 126 | Lhdone: 127 | popl %esi 128 | popl %ebp 129 | popl %ebx // restore register variables 130 | 131 | Lhquickout: 132 | popl %edi 133 | 134 | ret 135 | -------------------------------------------------------------------------------- /QW/progs/progdefs.h: -------------------------------------------------------------------------------- 1 | 2 | /* file generated by qcc, do not modify */ 3 | 4 | typedef struct { 5 | int pad[28]; 6 | int self; 7 | int other; 8 | int world; 9 | float time; 10 | float frametime; 11 | int newmis; 12 | float force_retouch; 13 | string_t mapname; 14 | float serverflags; 15 | float total_secrets; 16 | float total_monsters; 17 | float found_secrets; 18 | float killed_monsters; 19 | float parm1; 20 | float parm2; 21 | float parm3; 22 | float parm4; 23 | float parm5; 24 | float parm6; 25 | float parm7; 26 | float parm8; 27 | float parm9; 28 | float parm10; 29 | float parm11; 30 | float parm12; 31 | float parm13; 32 | float parm14; 33 | float parm15; 34 | float parm16; 35 | vec3_t v_forward; 36 | vec3_t v_up; 37 | vec3_t v_right; 38 | float trace_allsolid; 39 | float trace_startsolid; 40 | float trace_fraction; 41 | vec3_t trace_endpos; 42 | vec3_t trace_plane_normal; 43 | float trace_plane_dist; 44 | int trace_ent; 45 | float trace_inopen; 46 | float trace_inwater; 47 | int msg_entity; 48 | func_t main; 49 | func_t StartFrame; 50 | func_t PlayerPreThink; 51 | func_t PlayerPostThink; 52 | func_t ClientKill; 53 | func_t ClientConnect; 54 | func_t PutClientInServer; 55 | func_t ClientDisconnect; 56 | func_t SetNewParms; 57 | func_t SetChangeParms; 58 | } globalvars_t; 59 | 60 | typedef struct { 61 | float modelindex; 62 | vec3_t absmin; 63 | vec3_t absmax; 64 | float ltime; 65 | float lastruntime; 66 | float movetype; 67 | float solid; 68 | vec3_t origin; 69 | vec3_t oldorigin; 70 | vec3_t velocity; 71 | vec3_t angles; 72 | vec3_t avelocity; 73 | string_t classname; 74 | string_t model; 75 | float frame; 76 | float skin; 77 | float effects; 78 | vec3_t mins; 79 | vec3_t maxs; 80 | vec3_t size; 81 | func_t touch; 82 | func_t use; 83 | func_t think; 84 | func_t blocked; 85 | float nextthink; 86 | int groundentity; 87 | float health; 88 | float frags; 89 | float weapon; 90 | string_t weaponmodel; 91 | float weaponframe; 92 | float currentammo; 93 | float ammo_shells; 94 | float ammo_nails; 95 | float ammo_rockets; 96 | float ammo_cells; 97 | float items; 98 | float takedamage; 99 | int chain; 100 | float deadflag; 101 | vec3_t view_ofs; 102 | float button0; 103 | float button1; 104 | float button2; 105 | float impulse; 106 | float fixangle; 107 | vec3_t v_angle; 108 | string_t netname; 109 | int enemy; 110 | float flags; 111 | float colormap; 112 | float team; 113 | float max_health; 114 | float teleport_time; 115 | float armortype; 116 | float armorvalue; 117 | float waterlevel; 118 | float watertype; 119 | float ideal_yaw; 120 | float yaw_speed; 121 | int aiment; 122 | int goalentity; 123 | float spawnflags; 124 | string_t target; 125 | string_t targetname; 126 | float dmg_take; 127 | float dmg_save; 128 | int dmg_inflictor; 129 | int owner; 130 | vec3_t movedir; 131 | string_t message; 132 | float sounds; 133 | string_t noise; 134 | string_t noise1; 135 | string_t noise2; 136 | string_t noise3; 137 | } entvars_t; 138 | 139 | #define PROGHEADER_CRC 54730 140 | -------------------------------------------------------------------------------- /include/progdefs-qw.h: -------------------------------------------------------------------------------- 1 | 2 | /* file generated by qcc, do not modify */ 3 | 4 | typedef struct { 5 | int pad[28]; 6 | int self; 7 | int other; 8 | int world; 9 | float time; 10 | float frametime; 11 | int newmis; 12 | float force_retouch; 13 | string_t mapname; 14 | float serverflags; 15 | float total_secrets; 16 | float total_monsters; 17 | float found_secrets; 18 | float killed_monsters; 19 | float parm1; 20 | float parm2; 21 | float parm3; 22 | float parm4; 23 | float parm5; 24 | float parm6; 25 | float parm7; 26 | float parm8; 27 | float parm9; 28 | float parm10; 29 | float parm11; 30 | float parm12; 31 | float parm13; 32 | float parm14; 33 | float parm15; 34 | float parm16; 35 | vec3_t v_forward; 36 | vec3_t v_up; 37 | vec3_t v_right; 38 | float trace_allsolid; 39 | float trace_startsolid; 40 | float trace_fraction; 41 | vec3_t trace_endpos; 42 | vec3_t trace_plane_normal; 43 | float trace_plane_dist; 44 | int trace_ent; 45 | float trace_inopen; 46 | float trace_inwater; 47 | int msg_entity; 48 | func_t main; 49 | func_t StartFrame; 50 | func_t PlayerPreThink; 51 | func_t PlayerPostThink; 52 | func_t ClientKill; 53 | func_t ClientConnect; 54 | func_t PutClientInServer; 55 | func_t ClientDisconnect; 56 | func_t SetNewParms; 57 | func_t SetChangeParms; 58 | } globalvars_t; 59 | 60 | typedef struct { 61 | float modelindex; 62 | vec3_t absmin; 63 | vec3_t absmax; 64 | float ltime; 65 | float lastruntime; 66 | float movetype; 67 | float solid; 68 | vec3_t origin; 69 | vec3_t oldorigin; 70 | vec3_t velocity; 71 | vec3_t angles; 72 | vec3_t avelocity; 73 | string_t classname; 74 | string_t model; 75 | float frame; 76 | float skin; 77 | float effects; 78 | vec3_t mins; 79 | vec3_t maxs; 80 | vec3_t size; 81 | func_t touch; 82 | func_t use; 83 | func_t think; 84 | func_t blocked; 85 | float nextthink; 86 | int groundentity; 87 | float health; 88 | float frags; 89 | float weapon; 90 | string_t weaponmodel; 91 | float weaponframe; 92 | float currentammo; 93 | float ammo_shells; 94 | float ammo_nails; 95 | float ammo_rockets; 96 | float ammo_cells; 97 | float items; 98 | float takedamage; 99 | int chain; 100 | float deadflag; 101 | vec3_t view_ofs; 102 | float button0; 103 | float button1; 104 | float button2; 105 | float impulse; 106 | float fixangle; 107 | vec3_t v_angle; 108 | string_t netname; 109 | int enemy; 110 | float flags; 111 | float colormap; 112 | float team; 113 | float max_health; 114 | float teleport_time; 115 | float armortype; 116 | float armorvalue; 117 | float waterlevel; 118 | float watertype; 119 | float ideal_yaw; 120 | float yaw_speed; 121 | int aiment; 122 | int goalentity; 123 | float spawnflags; 124 | string_t target; 125 | string_t targetname; 126 | float dmg_take; 127 | float dmg_save; 128 | int dmg_inflictor; 129 | int owner; 130 | vec3_t movedir; 131 | string_t message; 132 | float sounds; 133 | string_t noise; 134 | string_t noise1; 135 | string_t noise2; 136 | string_t noise3; 137 | } entvars_t; 138 | 139 | #define PROGHEADER_CRC 54730 140 | -------------------------------------------------------------------------------- /QW/client/quakedef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CLIENT_QUAKEDEF_H 22 | #define CLIENT_QUAKEDEF_H 23 | 24 | // quakedef.h -- primary header for client 25 | 26 | //define PARANOID // speed sapping error checking 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include "qtypes.h" 37 | #include "cvar.h" 38 | 39 | //============================================================================= 40 | 41 | // the host system specifies the base of the directory tree, the 42 | // command line parms passed to the program, and the amount of memory 43 | // available for the program to use 44 | 45 | typedef struct { 46 | const char *basedir; 47 | int argc; 48 | const char **argv; 49 | void *membase; 50 | int memsize; 51 | } quakeparms_t; 52 | 53 | 54 | //============================================================================= 55 | 56 | #define MINIMUM_MEMORY 0x550000 57 | 58 | extern qboolean noclip_anglehack; 59 | 60 | // 61 | // host 62 | // 63 | extern quakeparms_t host_parms; 64 | 65 | extern cvar_t sys_ticrate; 66 | extern cvar_t sys_nostdout; 67 | extern cvar_t developer; 68 | 69 | extern cvar_t password; 70 | 71 | extern qboolean host_initialized; // true if into command execution 72 | extern double host_frametime; 73 | extern byte *host_basepal; 74 | extern byte *host_colormap; 75 | extern byte **host_transtables; 76 | extern int host_framecount; // incremented every frame, never reset 77 | extern double realtime; // not bounded in any way, changed at 78 | // start of every frame, never reset 79 | 80 | void Host_ServerFrame(void); 81 | void Host_InitCommands(void); 82 | void Host_Init(quakeparms_t *parms); 83 | void Host_Shutdown(void); 84 | void Host_Error(const char *error, ...) 85 | __attribute__((noreturn, format(printf,1,2))); 86 | void Host_EndGame(const char *message, ...) 87 | __attribute__((noreturn, format(printf,1,2))); 88 | qboolean Host_SimulationTime(float time); 89 | void Host_Frame(float time); 90 | void Host_Quit_f(void); 91 | void Host_ShutdownServer(qboolean crash); 92 | 93 | extern qboolean msg_suppress_1; // suppresses resolution and cache size console 94 | 95 | // output and fullscreen DIB focus gain/loss 96 | 97 | // 98 | // Hacks - FIXME - well, "hacks" says it all really... 99 | // 100 | extern cvar_t r_lockfrustum; // FIXME - with rendering stuff please... 101 | extern cvar_t r_lockpvs; // FIXME - with rendering stuff please... 102 | extern cvar_t r_drawflat; // FIXME - with rendering stuff please... 103 | 104 | #endif /* CLIENT_QUAKEDEF_H */ 105 | -------------------------------------------------------------------------------- /include/block8.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | /* *INDENT-OFF* */ 22 | 23 | LEnter16_8: 24 | movb (%esi),%al 25 | movb (%esi,%ebx,),%cl 26 | movb %dh,%ah 27 | addl %ebp,%edx 28 | movb %dh,%ch 29 | leal (%esi,%ebx,2),%esi 30 | movb 0x12345678(%eax),%al 31 | LBPatch0: 32 | addl %ebp,%edx 33 | movb %al,(%edi) 34 | movb 0x12345678(%ecx),%cl 35 | LBPatch1: 36 | movb %cl,1(%edi) 37 | addl $0x2,%edi 38 | 39 | movb (%esi),%al 40 | movb (%esi,%ebx,),%cl 41 | movb %dh,%ah 42 | addl %ebp,%edx 43 | movb %dh,%ch 44 | leal (%esi,%ebx,2),%esi 45 | movb 0x12345678(%eax),%al 46 | LBPatch2: 47 | addl %ebp,%edx 48 | movb %al,(%edi) 49 | movb 0x12345678(%ecx),%cl 50 | LBPatch3: 51 | movb %cl,1(%edi) 52 | addl $0x2,%edi 53 | 54 | movb (%esi),%al 55 | movb (%esi,%ebx,),%cl 56 | movb %dh,%ah 57 | addl %ebp,%edx 58 | movb %dh,%ch 59 | leal (%esi,%ebx,2),%esi 60 | movb 0x12345678(%eax),%al 61 | LBPatch4: 62 | addl %ebp,%edx 63 | movb %al,(%edi) 64 | movb 0x12345678(%ecx),%cl 65 | LBPatch5: 66 | movb %cl,1(%edi) 67 | addl $0x2,%edi 68 | 69 | movb (%esi),%al 70 | movb (%esi,%ebx,),%cl 71 | movb %dh,%ah 72 | addl %ebp,%edx 73 | movb %dh,%ch 74 | leal (%esi,%ebx,2),%esi 75 | movb 0x12345678(%eax),%al 76 | LBPatch6: 77 | addl %ebp,%edx 78 | movb %al,(%edi) 79 | movb 0x12345678(%ecx),%cl 80 | LBPatch7: 81 | movb %cl,1(%edi) 82 | addl $0x2,%edi 83 | 84 | LEnter8_8: 85 | movb (%esi),%al 86 | movb (%esi,%ebx,),%cl 87 | movb %dh,%ah 88 | addl %ebp,%edx 89 | movb %dh,%ch 90 | leal (%esi,%ebx,2),%esi 91 | movb 0x12345678(%eax),%al 92 | LBPatch8: 93 | addl %ebp,%edx 94 | movb %al,(%edi) 95 | movb 0x12345678(%ecx),%cl 96 | LBPatch9: 97 | movb %cl,1(%edi) 98 | addl $0x2,%edi 99 | 100 | movb (%esi),%al 101 | movb (%esi,%ebx,),%cl 102 | movb %dh,%ah 103 | addl %ebp,%edx 104 | movb %dh,%ch 105 | leal (%esi,%ebx,2),%esi 106 | movb 0x12345678(%eax),%al 107 | LBPatch10: 108 | addl %ebp,%edx 109 | movb %al,(%edi) 110 | movb 0x12345678(%ecx),%cl 111 | LBPatch11: 112 | movb %cl,1(%edi) 113 | addl $0x2,%edi 114 | 115 | LEnter4_8: 116 | movb (%esi),%al 117 | movb (%esi,%ebx,),%cl 118 | movb %dh,%ah 119 | addl %ebp,%edx 120 | movb %dh,%ch 121 | leal (%esi,%ebx,2),%esi 122 | movb 0x12345678(%eax),%al 123 | LBPatch12: 124 | addl %ebp,%edx 125 | movb %al,(%edi) 126 | movb 0x12345678(%ecx),%cl 127 | LBPatch13: 128 | movb %cl,1(%edi) 129 | addl $0x2,%edi 130 | 131 | LEnter2_8: 132 | movb (%esi),%al 133 | movb (%esi,%ebx,),%cl 134 | movb %dh,%ah 135 | addl %ebp,%edx 136 | movb %dh,%ch 137 | leal (%esi,%ebx,2),%esi 138 | movb 0x12345678(%eax),%al 139 | LBPatch14: 140 | addl %ebp,%edx 141 | movb %al,(%edi) 142 | movb 0x12345678(%ecx),%cl 143 | LBPatch15: 144 | movb %cl,1(%edi) 145 | addl $0x2,%edi 146 | 147 | -------------------------------------------------------------------------------- /include/gl_warp_sin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // gl_warp_sin.h 22 | // Precalulated table of sin values for use in gl_warp.c 23 | 24 | /* *INDENT-OFF* */ 25 | 26 | 0.00000, 0.19633, 0.39254, 0.58852, 0.78414, 0.97929, 1.17384, 1.36770, 27 | 1.56072, 1.75281, 1.94384, 2.13370, 2.32228, 2.50945, 2.69512, 2.87916, 28 | 3.06147, 3.24193, 3.42044, 3.59689, 3.77117, 3.94319, 4.11282, 4.27998, 29 | 4.44456, 4.60647, 4.76559, 4.92185, 5.07515, 5.22538, 5.37247, 5.51632, 30 | 5.65685, 5.79398, 5.92761, 6.05767, 6.18408, 6.30677, 6.42566, 6.54068, 31 | 6.65176, 6.75883, 6.86183, 6.96070, 7.05537, 7.14579, 7.23191, 7.31368, 32 | 7.39104, 7.46394, 7.53235, 7.59623, 7.65552, 7.71021, 7.76025, 7.80562, 33 | 7.84628, 7.88222, 7.91341, 7.93984, 7.96148, 7.97832, 7.99036, 7.99759, 34 | 8.00000, 7.99759, 7.99036, 7.97832, 7.96148, 7.93984, 7.91341, 7.88222, 35 | 7.84628, 7.80562, 7.76025, 7.71021, 7.65552, 7.59623, 7.53235, 7.46394, 36 | 7.39104, 7.31368, 7.23191, 7.14579, 7.05537, 6.96070, 6.86183, 6.75883, 37 | 6.65176, 6.54068, 6.42566, 6.30677, 6.18408, 6.05767, 5.92761, 5.79398, 38 | 5.65685, 5.51632, 5.37247, 5.22538, 5.07515, 4.92185, 4.76559, 4.60647, 39 | 4.44456, 4.27998, 4.11282, 3.94319, 3.77117, 3.59689, 3.42044, 3.24193, 40 | 3.06147, 2.87916, 2.69512, 2.50945, 2.32228, 2.13370, 1.94384, 1.75281, 41 | 1.56072, 1.36770, 1.17384, 0.97929, 0.78414, 0.58852, 0.39254, 0.19633, 42 | 0.00000, -0.19633, -0.39254, -0.58852, -0.78414, -0.97929, -1.17384, -1.36770, 43 | -1.56072, -1.75281, -1.94384, -2.13370, -2.32228, -2.50945, -2.69512, -2.87916, 44 | -3.06147, -3.24193, -3.42044, -3.59689, -3.77117, -3.94319, -4.11282, -4.27998, 45 | -4.44456, -4.60647, -4.76559, -4.92185, -5.07515, -5.22538, -5.37247, -5.51632, 46 | -5.65685, -5.79398, -5.92761, -6.05767, -6.18408, -6.30677, -6.42566, -6.54068, 47 | -6.65176, -6.75883, -6.86183, -6.96070, -7.05537, -7.14579, -7.23191, -7.31368, 48 | -7.39104, -7.46394, -7.53235, -7.59623, -7.65552, -7.71021, -7.76025, -7.80562, 49 | -7.84628, -7.88222, -7.91341, -7.93984, -7.96148, -7.97832, -7.99036, -7.99759, 50 | -8.00000, -7.99759, -7.99036, -7.97832, -7.96148, -7.93984, -7.91341, -7.88222, 51 | -7.84628, -7.80562, -7.76025, -7.71021, -7.65552, -7.59623, -7.53235, -7.46394, 52 | -7.39104, -7.31368, -7.23191, -7.14579, -7.05537, -6.96070, -6.86183, -6.75883, 53 | -6.65176, -6.54068, -6.42566, -6.30677, -6.18408, -6.05767, -5.92761, -5.79398, 54 | -5.65685, -5.51632, -5.37247, -5.22538, -5.07515, -4.92185, -4.76559, -4.60647, 55 | -4.44456, -4.27998, -4.11282, -3.94319, -3.77117, -3.59689, -3.42044, -3.24193, 56 | -3.06147, -2.87916, -2.69512, -2.50945, -2.32228, -2.13370, -1.94384, -1.75281, 57 | -1.56072, -1.36770, -1.17384, -0.97929, -0.78414, -0.58852, -0.39254, -0.19633 58 | 59 | /* *INDENT-ON* */ 60 | -------------------------------------------------------------------------------- /include/block16.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | /* *INDENT-OFF* */ 22 | 23 | LEnter16_16: 24 | movb (%esi),%al 25 | movb (%esi,%ebx,),%cl 26 | movb %dh,%ah 27 | addl %ebp,%edx 28 | movb %dh,%ch 29 | leal (%esi,%ebx,2),%esi 30 | movw 0x12345678(,%eax,2),%ax 31 | LBPatch0: 32 | addl %ebp,%edx 33 | movw %ax,(%edi) 34 | movw 0x12345678(,%ecx,2),%cx 35 | LBPatch1: 36 | movw %cx,2(%edi) 37 | addl $0x4,%edi 38 | 39 | movb (%esi),%al 40 | movb (%esi,%ebx,),%cl 41 | movb %dh,%ah 42 | addl %ebp,%edx 43 | movb %dh,%ch 44 | leal (%esi,%ebx,2),%esi 45 | movw 0x12345678(,%eax,2),%ax 46 | LBPatch2: 47 | addl %ebp,%edx 48 | movw %ax,(%edi) 49 | movw 0x12345678(,%ecx,2),%cx 50 | LBPatch3: 51 | movw %cx,2(%edi) 52 | addl $0x4,%edi 53 | 54 | movb (%esi),%al 55 | movb (%esi,%ebx,),%cl 56 | movb %dh,%ah 57 | addl %ebp,%edx 58 | movb %dh,%ch 59 | leal (%esi,%ebx,2),%esi 60 | movw 0x12345678(,%eax,2),%ax 61 | LBPatch4: 62 | addl %ebp,%edx 63 | movw %ax,(%edi) 64 | movw 0x12345678(,%ecx,2),%cx 65 | LBPatch5: 66 | movw %cx,2(%edi) 67 | addl $0x4,%edi 68 | 69 | movb (%esi),%al 70 | movb (%esi,%ebx,),%cl 71 | movb %dh,%ah 72 | addl %ebp,%edx 73 | movb %dh,%ch 74 | leal (%esi,%ebx,2),%esi 75 | movw 0x12345678(,%eax,2),%ax 76 | LBPatch6: 77 | addl %ebp,%edx 78 | movw %ax,(%edi) 79 | movw 0x12345678(,%ecx,2),%cx 80 | LBPatch7: 81 | movw %cx,2(%edi) 82 | addl $0x4,%edi 83 | 84 | LEnter8_16: 85 | movb (%esi),%al 86 | movb (%esi,%ebx,),%cl 87 | movb %dh,%ah 88 | addl %ebp,%edx 89 | movb %dh,%ch 90 | leal (%esi,%ebx,2),%esi 91 | movw 0x12345678(,%eax,2),%ax 92 | LBPatch8: 93 | addl %ebp,%edx 94 | movw %ax,(%edi) 95 | movw 0x12345678(,%ecx,2),%cx 96 | LBPatch9: 97 | movw %cx,2(%edi) 98 | addl $0x4,%edi 99 | 100 | movb (%esi),%al 101 | movb (%esi,%ebx,),%cl 102 | movb %dh,%ah 103 | addl %ebp,%edx 104 | movb %dh,%ch 105 | leal (%esi,%ebx,2),%esi 106 | movw 0x12345678(,%eax,2),%ax 107 | LBPatch10: 108 | addl %ebp,%edx 109 | movw %ax,(%edi) 110 | movw 0x12345678(,%ecx,2),%cx 111 | LBPatch11: 112 | movw %cx,2(%edi) 113 | addl $0x4,%edi 114 | 115 | LEnter4_16: 116 | movb (%esi),%al 117 | movb (%esi,%ebx,),%cl 118 | movb %dh,%ah 119 | addl %ebp,%edx 120 | movb %dh,%ch 121 | leal (%esi,%ebx,2),%esi 122 | movw 0x12345678(,%eax,2),%ax 123 | LBPatch12: 124 | addl %ebp,%edx 125 | movw %ax,(%edi) 126 | movw 0x12345678(,%ecx,2),%cx 127 | LBPatch13: 128 | movw %cx,2(%edi) 129 | addl $0x4,%edi 130 | 131 | LEnter2_16: 132 | movb (%esi),%al 133 | movb (%esi,%ebx,),%cl 134 | movb %dh,%ah 135 | addl %ebp,%edx 136 | movb %dh,%ch 137 | leal (%esi,%ebx,2),%esi 138 | movw 0x12345678(,%eax,2),%ax 139 | LBPatch14: 140 | addl %ebp,%edx 141 | movw %ax,(%edi) 142 | movw 0x12345678(,%ecx,2),%cx 143 | LBPatch15: 144 | movw %cx,2(%edi) 145 | addl $0x4,%edi 146 | -------------------------------------------------------------------------------- /QW/progs/buttons.qc: -------------------------------------------------------------------------------- 1 | // button and multiple button 2 | 3 | void() button_wait; 4 | void() button_return; 5 | 6 | void() button_wait = 7 | { 8 | self.state = STATE_TOP; 9 | self.nextthink = self.ltime + self.wait; 10 | self.think = button_return; 11 | activator = self.enemy; 12 | SUB_UseTargets(); 13 | self.frame = 1; // use alternate textures 14 | }; 15 | 16 | void() button_done = 17 | { 18 | self.state = STATE_BOTTOM; 19 | }; 20 | 21 | void() button_return = 22 | { 23 | self.state = STATE_DOWN; 24 | SUB_CalcMove (self.pos1, self.speed, button_done); 25 | self.frame = 0; // use normal textures 26 | if (self.health) 27 | self.takedamage = DAMAGE_YES; // can be shot again 28 | }; 29 | 30 | 31 | void() button_blocked = 32 | { // do nothing, just don't ome all the way back out 33 | }; 34 | 35 | 36 | void() button_fire = 37 | { 38 | if (self.state == STATE_UP || self.state == STATE_TOP) 39 | return; 40 | 41 | sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); 42 | 43 | self.state = STATE_UP; 44 | SUB_CalcMove (self.pos2, self.speed, button_wait); 45 | }; 46 | 47 | 48 | void() button_use = 49 | { 50 | self.enemy = activator; 51 | button_fire (); 52 | }; 53 | 54 | void() button_touch = 55 | { 56 | if (other.classname != "player") 57 | return; 58 | self.enemy = other; 59 | button_fire (); 60 | }; 61 | 62 | void() button_killed = 63 | { 64 | self.enemy = damage_attacker; 65 | self.health = self.max_health; 66 | self.takedamage = DAMAGE_NO; // wil be reset upon return 67 | button_fire (); 68 | }; 69 | 70 | 71 | /*QUAKED func_button (0 .5 .8) ? 72 | When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. 73 | 74 | "angle" determines the opening direction 75 | "target" all entities with a matching targetname will be used 76 | "speed" override the default 40 speed 77 | "wait" override the default 1 second wait (-1 = never return) 78 | "lip" override the default 4 pixel lip remaining at end of move 79 | "health" if set, the button must be killed instead of touched 80 | "sounds" 81 | 0) steam metal 82 | 1) wooden clunk 83 | 2) metallic click 84 | 3) in-out 85 | */ 86 | void() func_button = 87 | { 88 | local float gtemp, ftemp; 89 | 90 | if (self.sounds == 0) 91 | { 92 | precache_sound ("buttons/airbut1.wav"); 93 | self.noise = "buttons/airbut1.wav"; 94 | } 95 | if (self.sounds == 1) 96 | { 97 | precache_sound ("buttons/switch21.wav"); 98 | self.noise = "buttons/switch21.wav"; 99 | } 100 | if (self.sounds == 2) 101 | { 102 | precache_sound ("buttons/switch02.wav"); 103 | self.noise = "buttons/switch02.wav"; 104 | } 105 | if (self.sounds == 3) 106 | { 107 | precache_sound ("buttons/switch04.wav"); 108 | self.noise = "buttons/switch04.wav"; 109 | } 110 | 111 | SetMovedir (); 112 | 113 | self.movetype = MOVETYPE_PUSH; 114 | self.solid = SOLID_BSP; 115 | setmodel (self, self.model); 116 | 117 | self.blocked = button_blocked; 118 | self.use = button_use; 119 | 120 | if (self.health) 121 | { 122 | self.max_health = self.health; 123 | self.th_die = button_killed; 124 | self.takedamage = DAMAGE_YES; 125 | } 126 | else 127 | self.touch = button_touch; 128 | 129 | if (!self.speed) 130 | self.speed = 40; 131 | if (!self.wait) 132 | self.wait = 1; 133 | if (!self.lip) 134 | self.lip = 4; 135 | 136 | self.state = STATE_BOTTOM; 137 | 138 | self.pos1 = self.origin; 139 | self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); 140 | }; 141 | 142 | -------------------------------------------------------------------------------- /include/modelgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef MODELGEN_H 22 | #define MODELGEN_H 23 | 24 | // 25 | // modelgen.h: header file for model generation program 26 | // 27 | 28 | #include "mathlib.h" 29 | #include "qtypes.h" 30 | 31 | // ********************************************************* 32 | // * This file must be identical in the modelgen directory * 33 | // * and in the Quake directory, because it's used to * 34 | // * pass data from one to the other via model files. * 35 | // ********************************************************* 36 | 37 | #define ALIAS_VERSION 6 38 | #define ALIAS_ONSEAM 0x0020 39 | 40 | // must match definition in spritegn.h 41 | #ifndef SYNCTYPE_T 42 | #define SYNCTYPE_T 43 | typedef enum { ST_SYNC = 0, ST_RAND } synctype_t; 44 | #endif 45 | 46 | typedef enum { ALIAS_SINGLE = 0, ALIAS_GROUP } aliasframetype_t; 47 | 48 | typedef enum { ALIAS_SKIN_SINGLE = 0, ALIAS_SKIN_GROUP } aliasskintype_t; 49 | 50 | typedef struct { 51 | int ident; 52 | int version; 53 | vec3_t scale; 54 | vec3_t scale_origin; 55 | float boundingradius; 56 | vec3_t eyeposition; 57 | int numskins; 58 | int skinwidth; 59 | int skinheight; 60 | int numverts; 61 | int numtris; 62 | int numframes; 63 | synctype_t synctype; 64 | int flags; 65 | float size; 66 | } mdl_t; 67 | 68 | // TODO: could be shorts 69 | 70 | typedef struct { 71 | int onseam; 72 | int s; 73 | int t; 74 | } stvert_t; 75 | 76 | typedef struct dtriangle_s { 77 | int facesfront; 78 | int vertindex[3]; 79 | } dtriangle_t; 80 | 81 | #define DT_FACES_FRONT 0x0010 82 | 83 | // This mirrors trivert_t in trilib.h, is present so Quake knows how to 84 | // load this data 85 | 86 | typedef struct { 87 | byte v[3]; 88 | byte lightnormalindex; 89 | } trivertx_t; 90 | 91 | typedef struct { 92 | trivertx_t bboxmin; // lightnormal isn't used 93 | trivertx_t bboxmax; // lightnormal isn't used 94 | char name[16]; // frame name from grabbing 95 | trivertx_t verts[0]; // frame verticies (mdl_t->numverts) 96 | } daliasframe_t; 97 | 98 | typedef struct { 99 | float interval; 100 | } daliasinterval_t; 101 | 102 | typedef struct { 103 | int numframes; 104 | trivertx_t bboxmin; // lightnormal isn't used 105 | trivertx_t bboxmax; // lightnormal isn't used 106 | daliasinterval_t intervals[0]; // daliasgroup_t->numframes 107 | } daliasgroup_t; 108 | 109 | typedef struct { 110 | int numskins; 111 | } daliasskingroup_t; 112 | 113 | typedef struct { 114 | float interval; 115 | } daliasskininterval_t; 116 | 117 | typedef struct { 118 | aliasframetype_t type; 119 | } daliasframetype_t; 120 | 121 | typedef struct { 122 | aliasskintype_t type; 123 | } daliasskintype_t; 124 | 125 | /* little-endian "IDPO" */ 126 | #define IDPOLYHEADER (('O'<<24)+('P'<<16)+('D'<<8)+'I') 127 | 128 | #endif /* MODELGEN_H */ 129 | -------------------------------------------------------------------------------- /common/d_sky.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // d_sky.c 21 | 22 | #include "quakedef.h" 23 | #include "r_local.h" 24 | #include "d_local.h" 25 | 26 | #define SKY_SPAN_SHIFT 5 27 | #define SKY_SPAN_MAX (1 << SKY_SPAN_SHIFT) 28 | 29 | 30 | /* 31 | ================= 32 | D_Sky_uv_To_st 33 | ================= 34 | */ 35 | static void 36 | D_Sky_uv_To_st(int u, int v, fixed16_t *s, fixed16_t *t) 37 | { 38 | float wu, wv, temp; 39 | vec3_t end; 40 | 41 | if (r_refdef.vrect.width >= r_refdef.vrect.height) 42 | temp = (float)r_refdef.vrect.width; 43 | else 44 | temp = (float)r_refdef.vrect.height; 45 | 46 | wu = 8192.0 * (float)(u - ((int)vid.width >> 1)) / temp; 47 | wv = 8192.0 * (float)(((int)vid.height >> 1) - v) / temp; 48 | 49 | end[0] = 4096 * vpn[0] + wu * vright[0] + wv * vup[0]; 50 | end[1] = 4096 * vpn[1] + wu * vright[1] + wv * vup[1]; 51 | end[2] = 4096 * vpn[2] + wu * vright[2] + wv * vup[2]; 52 | end[2] *= 3; 53 | VectorNormalize(end); 54 | 55 | temp = skytime * skyspeed; // TODO: add D_SetupFrame & set this there 56 | *s = (int)((temp + 6 * (SKYSIZE / 2 - 1) * end[0]) * 0x10000); 57 | *t = (int)((temp + 6 * (SKYSIZE / 2 - 1) * end[1]) * 0x10000); 58 | } 59 | 60 | 61 | /* 62 | ================= 63 | D_DrawSkyScans8 64 | ================= 65 | */ 66 | void 67 | D_DrawSkyScans8(espan_t *pspan) 68 | { 69 | int count, spancount, u, v; 70 | unsigned char *pdest; 71 | fixed16_t s, t, snext, tnext, sstep, tstep; 72 | int spancountminus1; 73 | 74 | sstep = 0; // keep compiler happy 75 | tstep = 0; // ditto 76 | 77 | do { 78 | pdest = (unsigned char *)((byte *)d_viewbuffer + 79 | (screenwidth * pspan->v) + pspan->u); 80 | 81 | count = pspan->count; 82 | 83 | // calculate the initial s & t 84 | u = pspan->u; 85 | v = pspan->v; 86 | D_Sky_uv_To_st(u, v, &s, &t); 87 | 88 | do { 89 | if (count >= SKY_SPAN_MAX) 90 | spancount = SKY_SPAN_MAX; 91 | else 92 | spancount = count; 93 | 94 | count -= spancount; 95 | 96 | if (count) { 97 | u += spancount; 98 | 99 | // calculate s and t at far end of span, 100 | // calculate s and t steps across span by shifting 101 | D_Sky_uv_To_st(u, v, &snext, &tnext); 102 | 103 | sstep = (snext - s) >> SKY_SPAN_SHIFT; 104 | tstep = (tnext - t) >> SKY_SPAN_SHIFT; 105 | } else { 106 | // calculate s and t at last pixel in span, 107 | // calculate s and t steps across span by division 108 | spancountminus1 = (float)(spancount - 1); 109 | 110 | if (spancountminus1 > 0) { 111 | u += spancountminus1; 112 | D_Sky_uv_To_st(u, v, &snext, &tnext); 113 | 114 | sstep = (snext - s) / spancountminus1; 115 | tstep = (tnext - t) / spancountminus1; 116 | } 117 | } 118 | 119 | do { 120 | *pdest++ = r_skysource[((t & R_SKY_TMASK) >> 8) + 121 | ((s & R_SKY_SMASK) >> 16)]; 122 | s += sstep; 123 | t += tstep; 124 | } while (--spancount > 0); 125 | 126 | s = snext; 127 | t = tnext; 128 | 129 | } while (count > 0); 130 | 131 | } while ((pspan = pspan->pnext) != NULL); 132 | } 133 | -------------------------------------------------------------------------------- /NQ/docs/README.X11: -------------------------------------------------------------------------------- 1 | 2 | README for Linux SVGALib Quake 3 | ------------------------------ 4 | 5 | Requirements: 6 | 7 | - X11R5 later, only tested with XFree86, should work with most X Servers 8 | - libc 5.2.18 or later (5.0.9 will not work, /lib/libc.so.5.2.18) 9 | - CD-ROM for CDAudio 10 | - Soundcard capable of mmap'd buffers. USSLite 3.5.4 was used to build squake 11 | with. Works fine on SoundBlaster 16 and Gravis Ultrasound MAX. 12 | - SVGALib supported mouse (usually if it works with X, it'll work with 13 | squake). 14 | - Kernel 2.0.24 or later 15 | - untested with 2.1 kernels, your mileage may vary 16 | 17 | This is a windowed version that is generic for X11. It runs in a window 18 | and can be resized. You can specify a starting window size with: 19 | -width 20 | -height 21 | -winsize 22 | Default is 320x200. It works in 16bit modes, but it's slower (twice as many 23 | bytes to copy). 24 | 25 | No other video modes are supported (just runs windowed). Mouse is read, but 26 | not "grabbed" by default. Go to the Options menu and turn on Use Mouse to grab 27 | the mouse and use it in the game. If you want to move the mouse out of 28 | QWCL, you have to turn Use Mouse off. 29 | 30 | Full sound support is included. The default sound rate is 16-bit stereo, 31 | 11KHz. You can change this in the options section below. 32 | 33 | New Command Line Options for Linux SVGAlib Quake 34 | ------------------------------------------------ 35 | 36 | -mem 37 | Specify memory in megabytes to allocate (default is 8MB, which should be fine 38 | for most needs). 39 | 40 | -nostdout 41 | Don't do any output to stdout 42 | 43 | -cddev 44 | CD device, default is /dev/cdrom 45 | 46 | -sndbits <8 or 16> 47 | Set sound bit sample size. Default is 16 if supported. 48 | 49 | -sndspeed 50 | Set sound speed. Usual values are 8000, 11025, 22051 and 44100. 51 | Default is 11025. 52 | 53 | -sndmono 54 | Set mono sound 55 | 56 | -sndstereo 57 | Set stereo sound (default if supported) 58 | 59 | Installation 60 | ------------ 61 | 62 | Boot DOS (I know, but you need it to run the Quake install program) and 63 | install Quake from your Quake CD to a DOS parition. 64 | 65 | Boot Linux and make a directory for Quake. Copy everything from the DOS Quake 66 | directory into it. i.e.: 67 | (cd /dos/quake; tar cf - .) | (cd ~/quake; tar xf -) 68 | 69 | Quake for X11 does not need to be setuid root. Sound can fail if /dev/dsp is 70 | not mode 666. 71 | 72 | Quake may segfault if it tries to initialize your sound card and their isn't 73 | one. Same with the CDROM. If it dies, try it with -nosound and/or 74 | -nocdaudio. If you have a sound card it died on and you know it is 75 | supported by USSLite (the driver that comes with the Linux kernel), let me 76 | know and I'll take a look at it. 77 | 78 | It should work with SCSI CDROMs, but is untested. 79 | 80 | Full TCP/IP network support is in, including listen and dedicated server 81 | modes. 82 | 83 | All of the options described in TECHINFO.TXT and MANUAL.TXT from the Quake 84 | distribution will work, 'cept for stuff with vid modes and stuff. 85 | 86 | End Notes 87 | --------- 88 | 89 | Linux Quake is *NOT* an officially supported product. Mail about it 90 | will be deleted. Do not email id about this product. If you are having 91 | technical difficultly, you can email me, but make sure you have the correct 92 | kernel, libc, svgalib and other software versions before you email me. 93 | 94 | Dave 'Zoid' Kirsch 95 | zoid@idsoftware.com 96 | Official Quake Unix Port Administrator 97 | 98 | Acks 99 | ---- 100 | 101 | Greg Alexander for initial work in SVGALib 102 | support. 103 | Dave Taylor for basic Linux support. 104 | id Software for Quake and making me port it. :) 105 | 106 | Lots of people on #linux, #quake for testing. 107 | 108 | -------------------------------------------------------------------------------- /common/d_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // d_init.c: rasterization driver initialization 21 | 22 | #include "quakedef.h" 23 | #include "d_local.h" 24 | 25 | #define NUM_MIPS 4 26 | 27 | static cvar_t d_subdiv16 = { "d_subdiv16", "1" }; 28 | static cvar_t d_mipcap = { "d_mipcap", "0" }; 29 | static cvar_t d_mipscale = { "d_mipscale", "1" }; 30 | 31 | surfcache_t *d_initial_rover; 32 | qboolean d_roverwrapped; 33 | int d_minmip; 34 | float d_scalemip[NUM_MIPS - 1]; 35 | 36 | static float basemip[NUM_MIPS - 1] = { 1.0, 0.5 * 0.8, 0.25 * 0.8 }; 37 | 38 | void (*D_DrawSpans)(espan_t *pspan); 39 | 40 | /* 41 | =============== 42 | D_Init 43 | =============== 44 | */ 45 | void 46 | D_Init(void) 47 | { 48 | 49 | r_skydirect = 1; 50 | 51 | Cvar_RegisterVariable(&d_subdiv16); 52 | Cvar_RegisterVariable(&d_mipcap); 53 | Cvar_RegisterVariable(&d_mipscale); 54 | 55 | r_recursiveaffinetriangles = true; 56 | r_pixbytes = 1; 57 | r_aliasuvscale = 1.0; 58 | } 59 | 60 | 61 | /* 62 | =============== 63 | D_CopyRects 64 | 65 | this function is only required if the CPU doesn't have direct access to the 66 | back buffer, and there's some driver interface function that the driver 67 | doesn't support and requires Quake to do in software (such as drawing the 68 | console); Quake will then draw into wherever the driver points vid.buffer 69 | and will call this function before swapping buffers 70 | =============== 71 | */ 72 | void 73 | D_CopyRects(vrect_t *prects, int transparent) { } 74 | 75 | 76 | /* 77 | =============== 78 | D_EnableBackBufferAccess 79 | =============== 80 | */ 81 | void 82 | D_EnableBackBufferAccess(void) 83 | { 84 | VID_LockBuffer(); 85 | } 86 | 87 | 88 | /* 89 | =============== 90 | D_TurnZOn 91 | =============== 92 | */ 93 | void 94 | D_TurnZOn(void) 95 | { 96 | // not needed for software version 97 | } 98 | 99 | 100 | /* 101 | =============== 102 | D_DisableBackBufferAccess 103 | =============== 104 | */ 105 | void 106 | D_DisableBackBufferAccess(void) 107 | { 108 | VID_UnlockBuffer(); 109 | } 110 | 111 | 112 | /* 113 | =============== 114 | D_SetupFrame 115 | =============== 116 | */ 117 | void 118 | D_SetupFrame(void) 119 | { 120 | int i; 121 | 122 | if (r_dowarp) 123 | d_viewbuffer = r_warpbuffer; 124 | else 125 | d_viewbuffer = (void *)(byte *)vid.buffer; 126 | 127 | if (r_dowarp) 128 | screenwidth = WARP_WIDTH; 129 | else 130 | screenwidth = vid.rowbytes; 131 | 132 | d_roverwrapped = false; 133 | d_initial_rover = sc_rover; 134 | 135 | d_minmip = d_mipcap.value; 136 | if (d_minmip > 3) 137 | d_minmip = 3; 138 | else if (d_minmip < 0) 139 | d_minmip = 0; 140 | 141 | for (i = 0; i < (NUM_MIPS - 1); i++) 142 | d_scalemip[i] = basemip[i] * d_mipscale.value; 143 | 144 | #ifdef USE_X86_ASM 145 | if (d_subdiv16.value) 146 | D_DrawSpans = D_DrawSpans16; 147 | else 148 | D_DrawSpans = D_DrawSpans8; 149 | #else 150 | D_DrawSpans = D_DrawSpans8; 151 | #endif 152 | } 153 | 154 | 155 | /* 156 | =============== 157 | D_UpdateRects 158 | 159 | the software driver draws these directly to the vid buffer 160 | =============== 161 | */ 162 | void 163 | D_UpdateRects(vrect_t *prect) { } 164 | -------------------------------------------------------------------------------- /include/d_local.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef D_LOCAL_H 22 | #define D_LOCAL_H 23 | 24 | // d_local.h: private rasterization driver defs 25 | 26 | #include "bspfile.h" 27 | #include "r_shared.h" 28 | 29 | // 30 | // TODO: fine-tune this; it's based on providing some coverage even if there 31 | // is a 2k-wide scan, with subdivision every 8, for 256 spans of 12 bytes each 32 | // 33 | #define SCANBUFFERPAD 0x1000 34 | 35 | #define R_SKY_SMASK 0x007F0000 36 | #define R_SKY_TMASK 0x007F0000 37 | 38 | #define DS_SPAN_LIST_END -128 39 | 40 | #define SURFCACHE_SIZE_AT_320X200 600*1024 41 | 42 | typedef struct surfcache_s { 43 | struct surfcache_s *next; 44 | struct surfcache_s **owner; // NULL is an empty chunk of memory 45 | int lightadj[MAXLIGHTMAPS]; // checked for strobe flush 46 | int dlight; 47 | int size; // including header 48 | unsigned width; 49 | unsigned height; // DEBUG only needed for debug 50 | float mipscale; 51 | struct texture_s *texture; // checked for animating textures 52 | byte data[4]; // width*height elements 53 | } surfcache_t; 54 | 55 | // !!! if this is changed, it must be changed in asm_draw.h too !!! 56 | typedef struct sspan_s { 57 | int u, v, count; 58 | } sspan_t; 59 | 60 | extern float scale_for_mip; 61 | 62 | extern qboolean d_roverwrapped; 63 | extern surfcache_t *sc_rover; 64 | extern surfcache_t *d_initial_rover; 65 | 66 | extern float d_sdivzstepu, d_tdivzstepu, d_zistepu; 67 | extern float d_sdivzstepv, d_tdivzstepv, d_zistepv; 68 | extern float d_sdivzorigin, d_tdivzorigin, d_ziorigin; 69 | 70 | extern fixed16_t sadjust, tadjust; 71 | extern fixed16_t bbextents, bbextentt; 72 | 73 | void D_DrawSpans8(espan_t *pspans); 74 | void D_DrawSpans8_Translucent(espan_t *pspans); 75 | void D_DrawSpans8_Fence(espan_t *pspans); 76 | void D_DrawSpans8_Fence_Translucent(espan_t *pspans); 77 | void D_DrawSpans16(espan_t *pspans); 78 | extern void (*D_DrawSpans)(espan_t *pspan); 79 | 80 | void D_DrawZSpans(espan_t *pspans); 81 | void D_SpriteDrawSpans(sspan_t * pspan); 82 | 83 | void Turbulent8(espan_t *pspan); 84 | void D_DrawTurbulent8Span(); 85 | void D_DrawTurbulent8Span_NonStd(); 86 | void D_DrawTurbulentTranslucent8Span(); 87 | void D_DrawTurbulentTranslucent8Span_NonStd(); 88 | 89 | void D_DrawSkyScans8(espan_t *pspan); 90 | void D_DrawSkyScans16(espan_t *pspan); 91 | 92 | void R_ShowSubDiv(void); 93 | extern void (*prealspandrawer) (void); 94 | surfcache_t *D_CacheSurface(const entity_t *e, msurface_t *surface, 95 | int miplevel); 96 | 97 | #ifdef USE_X86_ASM 98 | void D_PolysetAff8Start(void); 99 | void D_PolysetAff8End(void); 100 | void D_PolysetDrawSpans8_Translucent(); 101 | #endif 102 | 103 | extern short *d_pzbuffer; 104 | extern unsigned int d_zrowbytes, d_zwidth; 105 | extern const byte *r_transtable; 106 | extern void (*D_DrawTurbSpanFunc)(void); 107 | 108 | extern int *d_pscantable; 109 | extern int d_scantable[MAXHEIGHT]; 110 | 111 | extern int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle; 112 | 113 | extern int d_y_aspect_shift, d_pix_min, d_pix_max, d_pix_shift; 114 | 115 | extern pixel_t *d_viewbuffer; 116 | 117 | extern short *zspantable[MAXHEIGHT]; 118 | 119 | extern int d_minmip; 120 | extern float d_scalemip[3]; 121 | 122 | #endif /* D_LOCAL_H */ 123 | --------------------------------------------------------------------------------