Commit Graph

15 Commits

Author SHA1 Message Date
Ozkan Sezer 51301e043c gl_model.h (model_t): Added a path_id member to store the
information about the game directory from where the model is
loaded.
gl_model.c (Mod_LoadModel): Send the path_id member of the
model to FS_Load* function, instead of NULL.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@371 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:55:26 +00:00
Ozkan Sezer c583b5b541 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@370 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 21:45:16 +00:00
Ozkan Sezer 4ccfbc0ec1 Mod_LoadLighting: free the allocated hunk memory in case of broken or
unsupported lit file.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@360 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-12-31 09:05:44 +00:00
Ozkan Sezer 906df3f650 const correctness changes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@300 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-29 02:22:55 +00:00
Ozkan Sezer 66ec5d11dc gl_model.c (Mod_LoadAliasModel, Mod_LoadSpriteModel): add some enum casts
to make things more compatible with C++.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@299 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-24 10:41:41 +00:00
Ozkan Sezer a7d57b4b51 * renamed Length() to VectorLength() for consistency with its friends.
* mathlib.c: Removed the unnecessary sqrt() prototype.
(VectorLength): Made it to just return sqrt(DotProduct(arg,arg))
(VectorNormalize): Calculate the length as sqrt(DotProduct(arg,arg)).
* mathlib.h (CLAMP): Renamed the macro arguments from min and max to
_minval and _maxval.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@248 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-01 19:22:46 +00:00
Ozkan Sezer ea4bad07b8 * gl_model.c (Mod_LoadFaces): Do not call GL_SubdivideSurface() in dedicated
servers, otherwise we segfault in SubdividePolygon() at the BoundPoly() call.
This is a workaround, the actual problem is yet to be looked into.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@185 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-19 14:16:05 +00:00
Ozkan Sezer b2b771b19f gl_model.c (Mod_LoadTextures): Don't use "min" or "max" as a var name.
net_dgrm.c (Net_Test_f): Likewise.
pr_cmds.c (SetMinMaxSize, PF_setsize): Likewise.
pr_exec.c (PR_Profile_f): Likewise.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@178 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-01 12:10:49 +00:00
Ozkan Sezer c24d592580 host_cmd.c, console.c, gl_draw.c, image.c, gl_model.c, r_sprite.c, cl_parse.c,
gl_warp.c, host.c, gl_mesh.c, gl_sky.c, gl_texmgr.c, cvar.c, sv_main.c, cvar.h,
gl_screen.c, r_brush.c, gl_vidsdl.c, zone.c, cl_main.c, cmd.c, snd_dma.c,
snd_mem.c, common.c, sv_phys.c: Added explicit casts to eliminate -Wc++-compat
warnings.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@170 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-05-31 07:42:36 +00:00
Ozkan Sezer 53746a85c9 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@154 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 16:30:40 +00:00
Ozkan Sezer 0baa28dbee gl_model.c (Mod_LoadTextures): If lump->filelen == 0, initialize m to NULL
in order to avoid a bogus compiler warning.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 13:47:19 +00:00
Ozkan Sezer 18080769da gl_model.c (Mod_LoadModel): buf needn't be an unsigned int pointer, made
it into a byte pointer, extracted the mod type from the header by bit shifts.
also removed the unnecessary void pointer variable.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@69 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-20 00:20:08 +00:00
Ozkan Sezer f9928b24ac 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@34 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 21:26:11 +00:00
Ozkan Sezer 68fc38c3a6 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: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
Ozkan Sezer db613ab35d initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00