diff --git a/r_context.c b/r_context.c index da1fe085..38aff2bc 100644 --- a/r_context.c +++ b/r_context.c @@ -309,26 +309,26 @@ void GAME_EXPORT R_ProcessEntData( qboolean allocate ) // stubs -void GAME_EXPORT GL_SetTexCoordArrayMode() +void GAME_EXPORT GL_SetTexCoordArrayMode( void ) { } -void GAME_EXPORT GL_InitExtensions() +void GAME_EXPORT GL_InitExtensions( void ) { } -void GAME_EXPORT GL_ClearExtensions() +void GAME_EXPORT GL_ClearExtensions( void ) { } -void GAME_EXPORT GL_BackendStartFrame() +void GAME_EXPORT GL_BackendStartFrame( void ) { } -void GAME_EXPORT GL_BackendEndFrame() +void GAME_EXPORT GL_BackendEndFrame( void ) { } @@ -341,12 +341,12 @@ void GAME_EXPORT GL_SetRenderMode(int mode) /// maybe, setup block drawing function pointers here } -void GAME_EXPORT R_ShowTextures() +void GAME_EXPORT R_ShowTextures( void ) { // textures undone too } -void GAME_EXPORT R_ShowTree() +void GAME_EXPORT R_ShowTree( void ) { // do we really need this here??? } @@ -392,7 +392,7 @@ void GAME_EXPORT GL_LoadTexMatrixExt(const float *glmatrix) } -void GAME_EXPORT GL_LoadIdentityTexMatrix() +void GAME_EXPORT GL_LoadIdentityTexMatrix( void ) { } @@ -412,7 +412,7 @@ void GAME_EXPORT GL_TextureTarget(uint target) } -void GAME_EXPORT GL_BuildLightmaps() +void GAME_EXPORT GL_BuildLightmaps( void ) { CL_RunLightStyles(); } @@ -427,7 +427,7 @@ qboolean GAME_EXPORT R_SpeedsMessage(char *out, size_t size) return false; } -byte *GAME_EXPORT Mod_GetCurrentVis() +byte *GAME_EXPORT Mod_GetCurrentVis( void ) { return NULL; } diff --git a/r_glblit.c b/r_glblit.c index a73cac59..1f0ccc59 100644 --- a/r_glblit.c +++ b/r_glblit.c @@ -129,7 +129,7 @@ void R_BuildScreenMap( void ) #define FOR_EACH_COLOR(x) for( r##x = 0; r##x < BIT(3); r##x++ ) for( g##x = 0; g##x < BIT(3); g##x++ ) for( b##x = 0; b##x < BIT(2); b##x++ ) -void R_BuildBlendMaps() +void R_BuildBlendMaps( void ) { unsigned int r1, g1, b1; unsigned int r2, g2, b2; @@ -176,6 +176,7 @@ void R_BuildBlendMaps() uint color = i << 3; uint m = color >> 8; uint j = color & 0xff; + unsigned short index1 = i; r1 = ((m >> (8 - 3) )<< 2 ) & MASK(5); g1 = ((m >> (8 - 3 - 3)) << 3) & MASK(6); @@ -185,7 +186,6 @@ void R_BuildBlendMaps() b1 |= MOVE_BIT(j, 6, 2) | MOVE_BIT(j, 3, 1) | MOVE_BIT(j, 0, 0); - unsigned short index1 = i; for( j = 0; j < 32; j++) { unsigned int index2 = j << 13; @@ -208,6 +208,7 @@ void R_BuildBlendMaps() uint color = i << 6 | BIT(5) | BIT(4) | BIT(3); uint m = color >> 8; uint j = color & 0xff; + unsigned short index1 = i; r1 = ((m >> (8 - 3) )<< 2 ) & MASK(5); g1 = ((m >> (8 - 3 - 3)) << 3) & MASK(6); @@ -217,7 +218,6 @@ void R_BuildBlendMaps() b1 |= MOVE_BIT(j, 6, 2) | MOVE_BIT(j, 3, 1) | MOVE_BIT(j, 0, 0); - unsigned short index1 = i; FOR_EACH_COLOR(2) { unsigned int index2 = (r2 << (2 + 3) | g2 << 2 | b2) << 10; @@ -254,9 +254,9 @@ void R_BuildBlendMaps() #endif } -void R_AllocScreen(); +void R_AllocScreen( void ); -void R_InitBlit() +void R_InitBlit(void) { /*LOAD(glBegin); @@ -296,7 +296,7 @@ void R_InitBlit() R_AllocScreen(); } -void R_AllocScreen() +void R_AllocScreen( void ) { if( gpGlobals->width < 320 ) gpGlobals->width = 320; @@ -319,7 +319,7 @@ void R_AllocScreen() vid.buffer = Mem_Malloc( r_temppool, vid.width * vid.height*sizeof( pixel_t ) ); } -void R_BlitScreen() +void R_BlitScreen( void ) { //memset( vid.buffer, 10, vid.width * vid.height ); int u, v; diff --git a/r_main.c b/r_main.c index 538cdc66..493914c5 100644 --- a/r_main.c +++ b/r_main.c @@ -208,7 +208,7 @@ static int R_TransEntityCompare( const cl_entity_t **a, const cl_entity_t **b ) rendermode2 = R_GetEntityRenderMode( ent2 ); // sort by distance - if( ent1->model && ent1->model->type != mod_brush || rendermode1 != kRenderTransAlpha ) + if( ( ent1->model && ent1->model->type != mod_brush ) || rendermode1 != kRenderTransAlpha ) { VectorAverage( ent1->model->mins, ent1->model->maxs, org ); VectorAdd( ent1->origin, org, org ); @@ -217,7 +217,7 @@ static int R_TransEntityCompare( const cl_entity_t **a, const cl_entity_t **b ) } else dist1 = 1000000000; - if( ent1->model && ent2->model->type != mod_brush || rendermode2 != kRenderTransAlpha ) + if( ( ent1->model && ent2->model->type != mod_brush ) || rendermode2 != kRenderTransAlpha ) { VectorAverage( ent2->model->mins, ent2->model->maxs, org ); VectorAdd( ent2->origin, org, org ); @@ -795,6 +795,10 @@ static image_t *R_RecursiveFindWaterTexture( const mnode_t *node, const mnode_t return NULL; } +extern void R_PolysetFillSpans8 ( void * ); +extern void R_PolysetDrawSpansConstant8_33( void *pspanpackage); +extern void R_PolysetDrawSpans8_33( void *pspanpackage); + /* ============= R_DrawEntitiesOnList @@ -802,16 +806,13 @@ R_DrawEntitiesOnList */ void R_DrawEntitiesOnList( void ) { + extern void (*d_pdrawspans)(void *); int i; //extern int d_aflatcolor; //d_aflatcolor = 0; tr.blend = 1.0f; // GL_CheckForErrors(); //RI.currententity = gEngfuncs.GetEntityByIndex(0); - extern void (*d_pdrawspans)(void *); - extern void R_PolysetFillSpans8 ( void * ); - extern void R_PolysetDrawSpansConstant8_33( void *pspanpackage); - extern void R_PolysetDrawSpans8_33( void *pspanpackage); d_pdrawspans = R_PolysetFillSpans8; GL_SetRenderMode(kRenderNormal); // first draw solid entities @@ -1826,9 +1827,10 @@ R_NewMap void GAME_EXPORT R_NewMap (void) { int i; - r_viewcluster = -1; model_t *world = WORLDMODEL; + r_viewcluster = -1; + tr.draw_list->num_solid_entities = 0; tr.draw_list->num_trans_entities = 0; tr.draw_list->num_beam_entities = 0; @@ -1921,7 +1923,7 @@ void R_InitTurb (void) -qboolean GAME_EXPORT R_Init() +qboolean GAME_EXPORT R_Init( void ) { gl_emboss_scale = gEngfuncs.Cvar_Get( "gl_emboss_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "fake bumpmapping scale" ); vid_gamma = gEngfuncs.pfnGetCvarPointer( "gamma", 0 ); @@ -1995,7 +1997,7 @@ qboolean GAME_EXPORT R_Init() return true; } -void GAME_EXPORT R_Shutdown() +void GAME_EXPORT R_Shutdown( void ) { R_ShutdownImages(); gEngfuncs.R_Free_Video(); diff --git a/r_studio.c b/r_studio.c index 7a153302..d51e6947 100644 --- a/r_studio.c +++ b/r_studio.c @@ -1124,7 +1124,7 @@ void R_StudioBuildNormalTable( void ) pmesh = (mstudiomesh_t *)((byte *)m_pStudioHeader + m_pSubModel->meshindex) + j; ptricmds = (short *)((byte *)m_pStudioHeader + pmesh->triindex); - while( i = *( ptricmds++ )) + while(( i = *( ptricmds++ ))) { if( i < 0 ) i = -i; @@ -1172,7 +1172,7 @@ void R_StudioGenerateNormals( void ) pmesh = (mstudiomesh_t *)((byte *)m_pStudioHeader + m_pSubModel->meshindex) + j; ptricmds = (short *)((byte *)m_pStudioHeader + pmesh->triindex); - while( i = *( ptricmds++ )) + while(( i = *( ptricmds++ ))) { if( i < 0 ) { @@ -1939,7 +1939,7 @@ _inline void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, floa float *lv; int i; - while( i = *( ptricmds++ )) + while(( i = *( ptricmds++ ))) { if( i < 0 ) { @@ -1972,7 +1972,7 @@ _inline void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms ) float *lv; int i; - while( i = *( ptricmds++ )) + while(( i = *( ptricmds++ ))) { if( i < 0 ) { @@ -2006,7 +2006,7 @@ _inline void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, floa qboolean glowShell = (scale > 0.0f) ? true : false; vec3_t vert; - while( i = *( ptricmds++ )) + while(( i = *( ptricmds++ ))) { if( i < 0 ) { @@ -2746,7 +2746,7 @@ static void R_StudioDrawPointsShadow( void ) r_stats.c_studio_polys += pmesh->numtris; - while( i = *( ptricmds++ )) + while(( i = *( ptricmds++ ))) { if( i < 0 ) {