Browse Source

ref_soft: fix style errors

pull/2/head
Alibek Omarov 5 years ago
parent
commit
690a317f4f
  1. 20
      r_context.c
  2. 14
      r_glblit.c
  3. 20
      r_main.c
  4. 12
      r_studio.c

20
r_context.c

@ -309,26 +309,26 @@ void GAME_EXPORT R_ProcessEntData( qboolean allocate )
// stubs // 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 /// maybe, setup block drawing function pointers here
} }
void GAME_EXPORT R_ShowTextures() void GAME_EXPORT R_ShowTextures( void )
{ {
// textures undone too // textures undone too
} }
void GAME_EXPORT R_ShowTree() void GAME_EXPORT R_ShowTree( void )
{ {
// do we really need this here??? // 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(); CL_RunLightStyles();
} }
@ -427,7 +427,7 @@ qboolean GAME_EXPORT R_SpeedsMessage(char *out, size_t size)
return false; return false;
} }
byte *GAME_EXPORT Mod_GetCurrentVis() byte *GAME_EXPORT Mod_GetCurrentVis( void )
{ {
return NULL; return NULL;
} }

14
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++ ) #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 r1, g1, b1;
unsigned int r2, g2, b2; unsigned int r2, g2, b2;
@ -176,6 +176,7 @@ void R_BuildBlendMaps()
uint color = i << 3; uint color = i << 3;
uint m = color >> 8; uint m = color >> 8;
uint j = color & 0xff; uint j = color & 0xff;
unsigned short index1 = i;
r1 = ((m >> (8 - 3) )<< 2 ) & MASK(5); r1 = ((m >> (8 - 3) )<< 2 ) & MASK(5);
g1 = ((m >> (8 - 3 - 3)) << 3) & MASK(6); 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); 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++) for( j = 0; j < 32; j++)
{ {
unsigned int index2 = j << 13; unsigned int index2 = j << 13;
@ -208,6 +208,7 @@ void R_BuildBlendMaps()
uint color = i << 6 | BIT(5) | BIT(4) | BIT(3); uint color = i << 6 | BIT(5) | BIT(4) | BIT(3);
uint m = color >> 8; uint m = color >> 8;
uint j = color & 0xff; uint j = color & 0xff;
unsigned short index1 = i;
r1 = ((m >> (8 - 3) )<< 2 ) & MASK(5); r1 = ((m >> (8 - 3) )<< 2 ) & MASK(5);
g1 = ((m >> (8 - 3 - 3)) << 3) & MASK(6); 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); b1 |= MOVE_BIT(j, 6, 2) | MOVE_BIT(j, 3, 1) | MOVE_BIT(j, 0, 0);
unsigned short index1 = i;
FOR_EACH_COLOR(2) FOR_EACH_COLOR(2)
{ {
unsigned int index2 = (r2 << (2 + 3) | g2 << 2 | b2) << 10; unsigned int index2 = (r2 << (2 + 3) | g2 << 2 | b2) << 10;
@ -254,9 +254,9 @@ void R_BuildBlendMaps()
#endif #endif
} }
void R_AllocScreen(); void R_AllocScreen( void );
void R_InitBlit() void R_InitBlit(void)
{ {
/*LOAD(glBegin); /*LOAD(glBegin);
@ -296,7 +296,7 @@ void R_InitBlit()
R_AllocScreen(); R_AllocScreen();
} }
void R_AllocScreen() void R_AllocScreen( void )
{ {
if( gpGlobals->width < 320 ) if( gpGlobals->width < 320 )
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 ) ); 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 ); //memset( vid.buffer, 10, vid.width * vid.height );
int u, v; int u, v;

20
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 ); rendermode2 = R_GetEntityRenderMode( ent2 );
// sort by distance // 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 ); VectorAverage( ent1->model->mins, ent1->model->maxs, org );
VectorAdd( ent1->origin, org, 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; 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 ); VectorAverage( ent2->model->mins, ent2->model->maxs, org );
VectorAdd( ent2->origin, org, org ); VectorAdd( ent2->origin, org, org );
@ -795,6 +795,10 @@ static image_t *R_RecursiveFindWaterTexture( const mnode_t *node, const mnode_t
return NULL; return NULL;
} }
extern void R_PolysetFillSpans8 ( void * );
extern void R_PolysetDrawSpansConstant8_33( void *pspanpackage);
extern void R_PolysetDrawSpans8_33( void *pspanpackage);
/* /*
============= =============
R_DrawEntitiesOnList R_DrawEntitiesOnList
@ -802,16 +806,13 @@ R_DrawEntitiesOnList
*/ */
void R_DrawEntitiesOnList( void ) void R_DrawEntitiesOnList( void )
{ {
extern void (*d_pdrawspans)(void *);
int i; int i;
//extern int d_aflatcolor; //extern int d_aflatcolor;
//d_aflatcolor = 0; //d_aflatcolor = 0;
tr.blend = 1.0f; tr.blend = 1.0f;
// GL_CheckForErrors(); // GL_CheckForErrors();
//RI.currententity = gEngfuncs.GetEntityByIndex(0); //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; d_pdrawspans = R_PolysetFillSpans8;
GL_SetRenderMode(kRenderNormal); GL_SetRenderMode(kRenderNormal);
// first draw solid entities // first draw solid entities
@ -1826,9 +1827,10 @@ R_NewMap
void GAME_EXPORT R_NewMap (void) void GAME_EXPORT R_NewMap (void)
{ {
int i; int i;
r_viewcluster = -1;
model_t *world = WORLDMODEL; model_t *world = WORLDMODEL;
r_viewcluster = -1;
tr.draw_list->num_solid_entities = 0; tr.draw_list->num_solid_entities = 0;
tr.draw_list->num_trans_entities = 0; tr.draw_list->num_trans_entities = 0;
tr.draw_list->num_beam_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" ); gl_emboss_scale = gEngfuncs.Cvar_Get( "gl_emboss_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "fake bumpmapping scale" );
vid_gamma = gEngfuncs.pfnGetCvarPointer( "gamma", 0 ); vid_gamma = gEngfuncs.pfnGetCvarPointer( "gamma", 0 );
@ -1995,7 +1997,7 @@ qboolean GAME_EXPORT R_Init()
return true; return true;
} }
void GAME_EXPORT R_Shutdown() void GAME_EXPORT R_Shutdown( void )
{ {
R_ShutdownImages(); R_ShutdownImages();
gEngfuncs.R_Free_Video(); gEngfuncs.R_Free_Video();

12
r_studio.c

@ -1124,7 +1124,7 @@ void R_StudioBuildNormalTable( void )
pmesh = (mstudiomesh_t *)((byte *)m_pStudioHeader + m_pSubModel->meshindex) + j; pmesh = (mstudiomesh_t *)((byte *)m_pStudioHeader + m_pSubModel->meshindex) + j;
ptricmds = (short *)((byte *)m_pStudioHeader + pmesh->triindex); ptricmds = (short *)((byte *)m_pStudioHeader + pmesh->triindex);
while( i = *( ptricmds++ )) while(( i = *( ptricmds++ )))
{ {
if( i < 0 ) i = -i; if( i < 0 ) i = -i;
@ -1172,7 +1172,7 @@ void R_StudioGenerateNormals( void )
pmesh = (mstudiomesh_t *)((byte *)m_pStudioHeader + m_pSubModel->meshindex) + j; pmesh = (mstudiomesh_t *)((byte *)m_pStudioHeader + m_pSubModel->meshindex) + j;
ptricmds = (short *)((byte *)m_pStudioHeader + pmesh->triindex); ptricmds = (short *)((byte *)m_pStudioHeader + pmesh->triindex);
while( i = *( ptricmds++ )) while(( i = *( ptricmds++ )))
{ {
if( i < 0 ) if( i < 0 )
{ {
@ -1939,7 +1939,7 @@ _inline void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, floa
float *lv; float *lv;
int i; int i;
while( i = *( ptricmds++ )) while(( i = *( ptricmds++ )))
{ {
if( i < 0 ) if( i < 0 )
{ {
@ -1972,7 +1972,7 @@ _inline void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms )
float *lv; float *lv;
int i; int i;
while( i = *( ptricmds++ )) while(( i = *( ptricmds++ )))
{ {
if( i < 0 ) if( i < 0 )
{ {
@ -2006,7 +2006,7 @@ _inline void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, floa
qboolean glowShell = (scale > 0.0f) ? true : false; qboolean glowShell = (scale > 0.0f) ? true : false;
vec3_t vert; vec3_t vert;
while( i = *( ptricmds++ )) while(( i = *( ptricmds++ )))
{ {
if( i < 0 ) if( i < 0 )
{ {
@ -2746,7 +2746,7 @@ static void R_StudioDrawPointsShadow( void )
r_stats.c_studio_polys += pmesh->numtris; r_stats.c_studio_polys += pmesh->numtris;
while( i = *( ptricmds++ )) while(( i = *( ptricmds++ )))
{ {
if( i < 0 ) if( i < 0 )
{ {

Loading…
Cancel
Save