]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
some const fixes and type fixes found by gcc -combine
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Jun 2008 13:14:54 +0000 (13:14 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Jun 2008 13:14:54 +0000 (13:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8321 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
csprogs.c
gl_rsurf.c
glquake.h
host_cmd.c
model_shared.h
progsvm.h
r_shadow.c
r_shadow.h
render.h
screen.h

index dad5df859ad278dcd313698e4d9624663bdc89c2..52d93d4564ffb6d0ad339be4a4c88c9f65a9e9ac 100644 (file)
@@ -90,7 +90,7 @@ Called for important messages that should stay in the center of the screen
 for a few moments
 ==============
 */
-void SCR_CenterPrint(char *str)
+void SCR_CenterPrint(const char *str)
 {
        strlcpy (scr_centerstring, str, sizeof (scr_centerstring));
        scr_centertime_off = scr_centertime.value;
index cfc47d6e754c964605b38e62110677e099a230b0..39dbc6ff664cd1adc5c4bf54dd76141cd107a4f6 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -415,7 +415,7 @@ void CL_VM_Parse_CenterPrint (const char *msg)
        int restorevm_tempstringsbuf_cursize;
        if(!cl.csqc_loaded)
        {
-               SCR_CenterPrint((char*)msg);
+               SCR_CenterPrint(msg);
                return;
        }
        CSQC_BEGIN
@@ -429,7 +429,7 @@ void CL_VM_Parse_CenterPrint (const char *msg)
                vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize;
        }
        else
-               SCR_CenterPrint((char*)msg);
+               SCR_CenterPrint(msg);
        CSQC_END
 }
 
index 223e15cde8eff9a0d2a2bab63c9cd0becf69a872..586219e5bbf87b7e82a9572b7cf48de2cc0155bb 100644 (file)
@@ -977,7 +977,7 @@ void R_Q1BSP_CompileShadowVolume(entity_render_t *ent, vec3_t relativelightorigi
 
 extern cvar_t r_polygonoffset_submodel_factor;
 extern cvar_t r_polygonoffset_submodel_offset;
-void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const vec3_t lightmins, const vec3_t lightmaxs)
+void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const vec3_t lightmins, const vec3_t lightmaxs)
 {
        dp_model_t *model = ent->model;
        msurface_t *surface;
@@ -1030,7 +1030,7 @@ static void R_Q1BSP_DrawLight_TransparentCallback(const entity_render_t *ent, co
        msurface_t *surface;
        // note: in practice this never actually receives batches), oh well
        R_Shadow_RenderMode_Begin();
-       R_Shadow_RenderMode_ActiveLight((rtlight_t *)rtlight);
+       R_Shadow_RenderMode_ActiveLight(rtlight);
        R_Shadow_RenderMode_Lighting(false, true);
        R_Shadow_SetupEntityLight(ent);
        for (i = 0;i < numsurfaces;i = j)
index 5cd68abf734bee638104bc3596fb8fe3ee31ae60..5acbc4469a6e02126c2f9918ff75793c211d006a 100644 (file)
--- a/glquake.h
+++ b/glquake.h
@@ -42,6 +42,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #endif
 
 #ifndef GL_PROJECTION
+#include <stddef.h>
+
 typedef unsigned int GLenum;
 typedef unsigned char GLboolean;
 typedef unsigned int GLbitfield;
@@ -69,9 +71,9 @@ typedef double GLdouble;
 // double precision float in [0,1]
 typedef double GLclampd;
 // int whose size is the same as a pointer (?)
-typedef size_t GLintptrARB;
+typedef ptrdiff_t GLintptrARB;
 // int whose size is the same as a pointer (?)
-typedef size_t GLsizeiptrARB;
+typedef ptrdiff_t GLsizeiptrARB;
 
 #define GL_MODELVIEW                           0x1700
 #define GL_PROJECTION                          0x1701
@@ -609,7 +611,7 @@ extern int gl_support_shader_objects;
 // 1-byte character string
 typedef char GLcharARB;
 // 4-byte integer handle to a shader object or program object
-typedef int GLhandleARB;
+typedef unsigned int GLhandleARB;
 #endif
 extern void (GLAPIENTRY *qglDeleteObjectARB)(GLhandleARB obj);
 extern GLhandleARB (GLAPIENTRY *qglGetHandleARB)(GLenum pname);
index 1768dbc44d244c8cb25b1f45216f3e160b24ccb8..fc3db1b90efc5199bdab0daf471aed4fb2942aa6 100644 (file)
@@ -525,7 +525,10 @@ void Host_Savegame_f (void)
 
        PRVM_ED_WriteGlobals (f);
        for (i=0 ; i<prog->num_edicts ; i++)
+       {
+               Con_Printf("edict %d...\n", i);
                PRVM_ED_Write (f, PRVM_EDICT_NUM(i));
+       }
 
        SV_VM_End();
 
index 1f171ca382cbd8df991e64c4fa50117ab1e172bd..035cfe4bcac7414a98cded731d4619cf6f71ed4a 100644 (file)
@@ -860,7 +860,7 @@ typedef struct model_s
        // compile a shadow volume for the model based on light source
        void(*CompileShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
        // draw a shadow volume for the model based on light source
-       void(*DrawShadowVolume)(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
+       void(*DrawShadowVolume)(struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
        // draw the lighting on a model (through stencil)
        void(*DrawLight)(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
        // trace a box against this model
@@ -966,7 +966,7 @@ void R_Q1BSP_DrawDepth(struct entity_render_s *ent);
 void R_Q1BSP_DrawDebug(struct entity_render_s *ent);
 void R_Q1BSP_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs);
 void R_Q1BSP_CompileShadowVolume(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
-void R_Q1BSP_DrawShadowVolume(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
+void R_Q1BSP_DrawShadowVolume(struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
 void R_Q1BSP_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
 
 // alias models
index e88fb09292a29451a81cfc8cc814953dce25af7d..cf200b197129e8566597254b551c94912657b181 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -250,6 +250,7 @@ typedef struct prvm_prog_globaloffsets_s
        int dmg_origin; // csqc
        int sb_showscores; // csqc
        int drawfont; // csqc / menu
+       int require_spawnfunc_prefix; // ssqc
 }
 prvm_prog_globaloffsets_t;
 
index 576e4b0ebcc4dbc81e46d37b995536a38f73d6c4..0091ada67abbe8c956cf1593c111063d49ab09f4 100644 (file)
@@ -1051,7 +1051,7 @@ void R_Shadow_RenderMode_Begin(void)
                r_shadow_lightingrendermode = R_SHADOW_RENDERMODE_LIGHT_VERTEX;
 }
 
-void R_Shadow_RenderMode_ActiveLight(rtlight_t *rtlight)
+void R_Shadow_RenderMode_ActiveLight(const rtlight_t *rtlight)
 {
        rsurface.rtlight = rtlight;
 }
index 2a33e8c7f9476b15382e87e362c844ad4da71102..592521e10a414eab9dbcc06b69ec006ff5ea1f76 100644 (file)
@@ -41,7 +41,7 @@ void R_Shadow_VolumeFromList(int numverts, int numtris, const float *invertex3f,
 void R_Shadow_MarkVolumeFromBox(int firsttriangle, int numtris, const float *invertex3f, const int *elements, const vec3_t projectorigin, const vec3_t projectdirection, const vec3_t lightmins, const vec3_t lightmaxs, const vec3_t surfacemins, const vec3_t surfacemaxs);
 void R_Shadow_RenderLighting(int firstvertex, int numvertices, int firsttriangle, int numtriangles, const int *element3i, const unsigned short *element3s, int element3i_bufferobject, int element3s_bufferobject);
 void R_Shadow_RenderMode_Begin(void);
-void R_Shadow_RenderMode_ActiveLight(rtlight_t *rtlight);
+void R_Shadow_RenderMode_ActiveLight(const rtlight_t *rtlight);
 void R_Shadow_RenderMode_Reset(void);
 void R_Shadow_RenderMode_StencilShadowVolumes(qboolean clearstencil);
 void R_Shadow_RenderMode_Lighting(qboolean stenciltest, qboolean transparent);
index c267399d28c2b416f5702843faec0f3277a55f19..bc43037674e04463fd97535c9a9ce2b9923164d7 100644 (file)
--- a/render.h
+++ b/render.h
@@ -316,7 +316,7 @@ typedef struct rsurfacestate_s
 
        // rtlight rendering
        // light currently being rendered
-       rtlight_t *rtlight;
+       const rtlight_t *rtlight;
        // current light's cull box (copied out of an rtlight or calculated by GetLightInfo)
        vec3_t rtlight_cullmins;
        vec3_t rtlight_cullmaxs;
index 3ee9d0de76d9cc153f57ae344fc2dfe8f77677f4..5feeed446261456f563dfdf88b0f65d66222e689 100644 (file)
--- a/screen.h
+++ b/screen.h
@@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 void CL_Screen_Init (void);
 void CL_UpdateScreen (void);
-void SCR_CenterPrint(char *str);
+void SCR_CenterPrint(const char *str);
 
 void SCR_BeginLoadingPlaque (void);