...which is a lot! This ended up touching a lot of code, especially
when it spread to Cmd_Argv, etc. Mostly just propogating the correct
const qualifiers on pointers, but in some cases it was appropriate to
copy the buffer to e.g. lowercase filename in SV_BeginDownload_f or
re-write parts of functions where the buffer modifications was not
strictly needed (e.g. the *Say* functions).
I guess of note is that I now accept a const pointer into Z_Free,
which shouldn't be a problem since it doesn't modify the data pointed
to at all, just marks it as free.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Make as many arguments to functions in common.h as possible const so
the compiler knows we shouldn't be modifying some buffers/strings
passed down here.
Also fixed (but not tested) the COM_BlockSequenceCheckByte function in
QW/common/common.c which has been #if 0'd for a while. Probably won't
keep it around, but fixed for completeness.
I skipped COM_Parse in this patch, will be constified in the following
patch.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Add a comment why the BOX_ON_PLANE_SIDE macro won't help performance here since
I think this isn't the first time I've gone to change this and then realised
and changed it back.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Wrap the vector macros that don't return a value in do {} while (0)
and fix a couple of missing semicolons detected in the process.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Purely renames - rename scoreboard_t to player_info_t (as it is the less
sophisticated equivalent of the same thing in QW) and rename cl.scores to
cl.players.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Ok, so cl.viewent does not get copied to cl_visedicts, so we can do a
straight address comparison on the pointer instead.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Only ever called from CL_ParseStatic, which pulls from cl_static_entities,
so would never be either r_worldentity and/or cl_entities[0].
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Pass over the source and make as many references to entities as possible
const. This makes it much more obvious where we are actually making
modifications to the entity_t structure.
Mostly trivial, the only place where I did something other than add the
keyword "const" was in R_DrawBrushModel where we were working around the
reversed pitch bug.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
QW was saving the whole visedicts list to scan for origins of objects
during the previous frame so that particle trails can be placed correctly
behind rockets, grenades, etc.
Save the origins and keynums in a simpler struct and remove the double
buffering of the cl_visedicts array.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Previous logic was wrong, as the full screen is only drawn with viewsize
120. This was causing the status bar to be overdrawn.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
oldscr_viewsize was a duplicated check for changes in the scr_viewsize
cvar. Remove it and make the check consistent across all screen.c files.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Ported the code from the software renderer with minimal changes. Didn't
bother to fix GL shadows at this point.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Rename modelorg to bmodelorg and move it to gl_rsurf.c where it is used
for the R_RecursiveWorldNode function. Make it static and add a comment
about it's intended use.
Now it's obvious that the modelorg global in gl_rmain was acutally
set but never used for GL alias model rendering.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Interpolate position and orientation of alias models as well, makes the
animation interpolation much more effective. Took some hints from
fitzquake, but ended up implementing a bit differently.
Still a few glitches (fitzquake has some good workarounds) so keep off by
default for now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Making this hack even uglier, we may need to ignore the lerp info of the
entity_t structure since we write to this in the cl_visedicts array.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>