Commit Graph

38 Commits

Author SHA1 Message Date
Eric Wasylishen d10512a72b Fence texture support on brush models, e.g. for rmqdemo2 e1m6rq.bsp. Based on Baker's implementation in Fitz Mark V. Consistent with Fitz Mark V, RMQEngine, FTEQW rendering.
Not implemented for world polys (afaik it's useless for world polys) but could be added if needed.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@970 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-19 02:20:12 +00:00
Ozkan Sezer b5e0d90e28 reset all models and set mod_numknown to 0 upon gamedir changes.
fixes issue described at:
http://celephais.net/board/view_thread.php?id=60452&start=825
also see http://forums.inside3d.com/viewtopic.php?f=12&t=5509


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@942 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-07-30 09:33:03 +00:00
Ozkan Sezer 34246dfc3b restore compilation with g++, some whitespace tidy-up.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@934 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-07-12 07:50:57 +00:00
Ozkan Sezer bfab14040b gl_model.c (CalcSurfaceExtents): fix a lighting glitch due to floating point precision. patch from Eric Wasylishen.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@908 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-04-28 06:10:12 +00:00
Ozkan Sezer 1eb360205b BSP2 support. patch kindly provided by Eric Wasylishen (see the patch
tracker entry #11 at http://sourceforge.net/p/quakespasm/patches/11/)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@881 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-12-25 09:10:28 +00:00
Ozkan Sezer 5e4849c61f replace all ctype.h functions/macros and strcasecmp/strncasecmp()
by locale-insensitive versions, new header q_ctype.h.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@868 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-09-25 17:01:40 +00:00
Ozkan Sezer b01498b8bd gl_model.c: change the 'ignored' messages from external lit and ent
files back to developer mode.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@841 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-10 11:29:02 +00:00
Ozkan Sezer a9f5180540 gl_model.c (Mod_LoadTexinfo): although the end result in memory
doesn't change, load the texinfo in a way consistent with the
layout of the vecs in the mtexinfo_t struct. from a recent commit
in tyr-quake git repo.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@786 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-11 09:55:55 +00:00
Ozkan Sezer dbdd675552 renamed model_t to qmodel_t in order to avoid conflicts on solaris.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@676 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-05-30 08:56:06 +00:00
Ozkan Sezer 19953bd399 silenced -Wsign-compare warnings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@575 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-29 19:06:08 +00:00
Ozkan Sezer 1928f2e1b8 * first shot at cvar flag system and cvar layer clean-ups :
- removed the archive and server members of cvar_t structure
  which are now represented by the CVAR_ARCHIVE, CVAR_NOTIFY
  and CVAR_SERVERINFO flags.
- added new Cvar_SetROM and Cvar_SetValueROM functions to 
  set vars marked as CVAR_ROM (read-only vars) programaticaly
- added Cvar_SetCallback() as a new function to assign (or
  remove) a callback function to a cvar.
- changed Cvar_RegisterVariable() to only accept a var pointer
  as in original quake
- moved notification handling from Cvar_Set() to callbacks.
- changed Cvar_Set() so that it doesn't reallocate the var's
  string buffer if nothing is changed, nor does it run the
  var's callback.
- changed the 'registered' and 'cmdline' cvars to be read-only
  so that the users can't change it using the console.  (and
  with 'registered' flagged as CVAR_ROM, the 'static_registered'
  thing is no longer required)
- added comment that sending cmdline upon CCREQ_RULE_INFO is
  evil...
- more to follow later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
Ozkan Sezer 5f0d6b07d1 finally nailed the SubdividePolygon() segfault when running as a dedicated
server: R_Init() isn't called for dedicated server therefore gl_subdivide_size
was used without being registered hence divisions by zero when using its value
member. Geez.. Moved its registration to Mod_Init() and we are good.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@565 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 17:37:30 +00:00
Ozkan Sezer fb2f45126e changed many strcpy and strncpy into q_strlcpy
and strcat and strncat into q_strlcat

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@560 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 13:15:31 +00:00
Ozkan Sezer 983af887bf changed many sprintf() calls into q_snprintf().
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@557 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 10:50:42 +00:00
Ozkan Sezer 07b572b642 better buffer size safety with COM_StripExtension, COM_FileBase and COM_DefaultExtension
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@554 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-27 08:04:02 +00:00
Ozkan Sezer 8625074bb4 gl_model.c (Mod_SetExtraFlags): Fixed r_nolerp_list.string parsing code
of fitzquake: the loop was able to go beyond the null terminator of the
cvar.  (Besides, it would technically yield a false positive because of
strncmp(), but much less likely..)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@517 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-14 14:21:12 +00:00
Ozkan Sezer b9ee5bef26 gl_model.c: Added new external_ents cvar for Mod_LoadEntities()
in parallel to the old QIP code.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@484 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-09-15 07:51:11 +00:00
Ozkan Sezer 09110d97b5 * Removed some useless memset calls onto newly hunk allocated memory.
Hunk_Alloc() already clears the memory before returning it.
* Some minor cleanups.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@465 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-07-05 06:28:42 +00:00
Ozkan Sezer e25c9d2716 gl_model.c (Mod_LoadEntities): Added support for loading external entity files.
Adding a cvar to control this option should follow later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@458 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-06-11 05:03:04 +00:00
Ozkan Sezer 305be5e835 * gl_model.c: relaxed searchpath requirements for external lit file
loading: they are now allowed from the same game directory as the
  map itself as well as from a searchpath with a higher priority.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@428 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-03-01 18:00:30 +00:00
Ozkan Sezer dbaa22dd78 * gl_model.c: changed the `ignored' messages from Con_DPrintf
to Con_Printf for external lit files.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@418 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-02-17 06:38:52 +00:00
Ozkan Sezer 945262b863 min/max macros: renamed them to q_min and q_max, moved them common.h.
removed the inline versions which only handled integers.  moved CLAMP
macro to common.h.  Adjusted all places for the renamed macros.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@386 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-10 10:35:40 +00:00
Ozkan Sezer db70c054fa gl_model.c (Mod_LoadLighting): Check the path_id of the lit file and
accept only if it is coming from the same game directory as for the map
itself.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@372 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-02 22:02:11 +00:00
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