...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>
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>
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>
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>
Have the helper struct do the renderer specific alias model skin
processing. Will probably want to relocate the code to a more appropraite
place later, but just get the factoring done for now.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Create a model loader structure which can be used to pass callbacks down
from the renderer code. This will allow us to have the render do some
processing on the loaded data at appropriate points and let us make the
actual loading code generic.
In the first instance, pass down the aliashdr_t padding value required by
the renderer.
Note that to remove a circular dependency introduced in the headers, I had
to stop including render.h in model.h/gl_model.h and that change
propogated some more changes to includes across the tree...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Update comment in the Makefile - one aspect fixed... now to tackle the
duplication between model.c and gl_model.c...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Removes visibility of the areadnode_t structure from world.h and makes
sv_areanodes private again. pmove_mins and pmove_maxs no longer need to
be globals in sv_user.c either.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>