Commit Graph

20 Commits

Author SHA1 Message Date
sezero c243f20067 made COM_FindFile to accept both file and handle as NULL. Added
COM_FileExists as a new helper procedure which calls COM_FindFile
with both file and handle parameters as NULL.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@373 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-05 18:01:15 +00:00
sezero 8dde04f7b5 common.c (searchpath_t): Added new member `path_id', an unsigned
int identifier assigned to the game directory. Remember that main
<install_dir>/game1 and the unix <userdir>/game1 have the same id.
The id starts as 1 for the first data1 directory. For every new
directory, the value is the left-shifted version of the previous
one.  Made COM_FindFile() to accept a path_id pointer argument
and storing the id in it if it isn't NULL. Made COM_OpenFile(),
COM_FOpenFile() and all COM_Load* functions to accept a path_id
pointer argument similarly. Adjusted callers accordingly.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@370 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:45:16 +00:00
sezero 82c069c4d3 common.c, common.h: Added LOADFILE_* defines for use with COM_LoadFile,
for easier reading. Added COM_LoadZoneFile(), COM_LoadMallocFile() and
COM_LoadBufFile() from uhexen2. Added comments after their prototypes
in common.h.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@361 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 10:29:38 +00:00
sezero 22e2f5aca8 backports from uHexen2 tree:
* common.c, common.h: Added new structure fshandle_t. Added new procedures
  FS_fread, FS_fseek, FS_ftell, FS_rewind, FS_feof, FS_ferror and FS_fclose.
  The new FS_*() stdio replacements are necessary if one is to perform non-
  sequential reads on files reopened on pak files because bookkeeping about
  file start/end positions is needed. Allocating and filling in the fshandle_t
  structure is the users' responsibility when the file is initially opened.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@353 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 16:50:15 +00:00
sezero 82ccf48171 added file_from_pak as a new flobal, made COM_FindFile() to set it properly.
from quakeworld sources.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@352 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-30 16:35:16 +00:00
sezero 49286c1eb2 added q_snprintf and q_vsnprintf from uhexen2. always use our wrapper
versions to ensure consistent behavior accross platforms.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@319 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-31 14:09:00 +00:00
sezero 2d5f1285e9 more fixes for deprecated conversion from string constant to char*:
handle the -safe command line switch using a new global safemode,
check for safemode in the related driver init functions and remove
the safeargvs & co from common.c and COM_InitArgv().


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@307 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 12:55:41 +00:00
sezero 205cabbdc2 const correctness changes.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@300 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 02:22:55 +00:00
sezero a441851f2b MS Visual Studio support:
* Quake/console.c, net_udp.c: replace snprintf by q_snprintf.
* Quake/common.h: Define q_snprintf as _snprintf for windows and as
snprintf for all others. Likewise for q_vsnprintf. Disable several
MSVC warnings. Define fmin and fmax as min and max macros for MSVC.
* Windows/quakespasm.vcproj, quakespasm.sln: Add Visual Studio 2005
project files.
* Windows/SDL_x64.zip: Add SDL x64 import libraries for MSVC.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@281 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-20 02:25:22 +00:00
sezero 78cbc8cc5f added q_stdinc.h, adapted from uhexen2, to tidy up several includes and
macros in one place.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@277 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-14 20:55:39 +00:00
sezero 94d3702026 common.h: tweak the qboolean and NULL definitions for __cplusplus. from uhexen2.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@176 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 12:10:25 +00:00
sezero 414c89ad55 Constified Con_DebugLog, Con_Print, Con_Printf, Con_Warning, Con_DPrintf,
Con_DPrintf2, Con_SafePrintf, Con_CenterPrintf, Con_LogCenterPrint,
Con_NotifyBox, PL_ErrorDialog, PR_RunError, Host_EndGame, Host_Error,
SV_ClientPrintf, SV_BroadcastPrintf, Host_ClientCommands, Sys_DebugLog,
Sys_Error, Sys_Printf, BOPS_Error and va. Added noreturn attribute to
Sys_Error, Sys_Quit, BOPS_Error, PR_RunError, Host_EndGame and Host_Error.
Added format printf attribute to Con_DebugLog, Con_Printf, Con_Warning,
Con_DPrintf, Con_DPrintf2, Con_SafePrintf, Con_CenterPrintf, PL_ErrorDialog,
PR_RunError, Host_EndGame, Host_Error, SV_ClientPrintf, SV_BroadcastPrintf,
Host_ClientCommands, Sys_DebugLog, Sys_Error, Sys_Printf and va. Adjusted
Host_Status_f and NET_Ban_f for the new attributes. Fixed broken format
strings in Con_Dump_f, Mod_LoadTexinfo, PR_AllocStringSlots and FloorDivMod.
Defined __attribute__ macros in quakedef.h so that we don't break non-gcc
compilers.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@154 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 16:30:40 +00:00
sezero a273ebcd3c common.c (com_basedir): added new global char array.
(COM_InitFilesystem): used global com_basedir instead of the automatic
basedir variable.
common.h (com_basedir): added extern.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@95 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-03-01 11:55:13 +00:00
sezero 1f4fbfe833 bspfile.h, cdaudio.h, client.h, cmd.h, common.h, console.h, crc.h, cvar.h,
d_ifacea.h, draw.h, gl_texmgr.h, glquake.h, image.h, input.h, keys.h, mathlib.h,
menu.h, modelgen.h, net.h, net_dgrm.h, net_loop.h, net_sdlnet.h, net_udp.h,
net_wins.h, platform.h, pr_comp.h, progdefs.h, progs.h, protocol.h, quakedef.h,
render.h, resource.h, sbar.h, screen.h, server.h, sound.h, spritegn.h, sys.h,
vid.h, view.h, wad.h, world.h, zone.h: added include guards to the headers.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@84 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-21 00:01:08 +00:00
sezero 5c82cc37e1 common.c, common.h: added check for '-fitz' command line switch which, if true,
makes quakespasm to run in fitzquake mode and disable custom quakespasm hacks.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@47 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-18 11:45:18 +00:00
sezero 090b386b6d 64 bit compatibility effort, 2/nn: type correctness work in common.h,
gl_draw.c, gl_model.c, gl_sky.c, gl_texmgr.c, gl_texmgr.h, r_alias.c,
r_brush.c, r_part.c, r_world.c, snd_mem.c.  next step will be server
side (progs) work which is actually the heart of the problems.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@34 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 21:26:11 +00:00
sezero b52d0d48c0 64 bit compatibility effort, 1/nn: type correctness work in common.c,
common.h, gl_vidsdl.c, mathlib.h, zone.c, zone.h. added Z_Realloc as a
new function (will be used later.) next step will be type correctness
work in opengl stuff.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@33 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 21:22:20 +00:00
sezero c8619f57c1 common.c, common.h: constified the replacement string library functions.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@27 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 13:02:22 +00:00
sezero 572e94ecdb chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h:  Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.


git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
sezero c5c4e96d44 initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00