From b825e584f30151ce4c7540a4ad8383cd3ee34304 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 17 Apr 2018 03:55:36 +0300 Subject: [PATCH] Replace GL_TEXTURE by XASH_TEXTURE because it's used internally by GL.h --- engine/client/gl_alias.c | 16 ++++++++-------- engine/client/gl_backend.c | 4 ++-- engine/client/gl_decals.c | 2 +- engine/client/gl_draw.c | 6 +++--- engine/client/gl_image.c | 2 +- engine/client/gl_rpart.c | 2 +- engine/client/gl_rsurf.c | 24 ++++++++++++------------ engine/client/gl_sprite.c | 8 ++++---- engine/client/gl_studio.c | 18 +++++++++--------- engine/client/gl_warp.c | 8 ++++---- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/engine/client/gl_alias.c b/engine/client/gl_alias.c index cefd8e78..a4a0a97a 100644 --- a/engine/client/gl_alias.c +++ b/engine/client/gl_alias.c @@ -1074,8 +1074,8 @@ void GL_DrawAliasFrame( aliashdr_t *paliashdr ) // texture coordinates come from the draw list if( GL_Support( GL_ARB_MULTITEXTURE ) && glState.activeTMU > 0 ) { - GL_MultiTexCoord2f( GL_TEXTURE0, ((float *)order)[0], ((float *)order)[1] ); - GL_MultiTexCoord2f( GL_TEXTURE1, ((float *)order)[0], ((float *)order)[1] ); + GL_MultiTexCoord2f( XASH_TEXTURE0, ((float *)order)[0], ((float *)order)[1] ); + GL_MultiTexCoord2f( XASH_TEXTURE1, ((float *)order)[0], ((float *)order)[1] ); } else { @@ -1290,7 +1290,7 @@ static void R_AliasDrawAbsBBox( cl_entity_t *e, const vec3_t absmin, const vec3_ p[i][2] = ( i & 4 ) ? absmin[2] : absmax[2]; } - GL_Bind( GL_TEXTURE0, tr.whiteTexture ); + GL_Bind( XASH_TEXTURE0, tr.whiteTexture ); TriColor4f( 0.5f, 0.5f, 1.0f, 0.5f ); TriRenderMode( kRenderTransAdd ); pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); @@ -1440,16 +1440,16 @@ void R_DrawAliasModel( cl_entity_t *e ) if( m_fDoRemap ) pinfo = CL_GetRemapInfoForEntity( e ); if( r_lightmap->value && !r_fullbright->value ) - GL_Bind( GL_TEXTURE0, tr.whiteTexture ); + GL_Bind( XASH_TEXTURE0, tr.whiteTexture ); else if( pinfo != NULL && pinfo->textures[skin] != 0 ) - GL_Bind( GL_TEXTURE0, pinfo->textures[skin] ); // FIXME: allow remapping for skingroups someday - else GL_Bind( GL_TEXTURE0, m_pAliasHeader->gl_texturenum[skin][anim] ); + GL_Bind( XASH_TEXTURE0, pinfo->textures[skin] ); // FIXME: allow remapping for skingroups someday + else GL_Bind( XASH_TEXTURE0, m_pAliasHeader->gl_texturenum[skin][anim] ); pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); if( GL_Support( GL_ARB_MULTITEXTURE ) && m_pAliasHeader->fb_texturenum[skin][anim] ) { - GL_Bind( GL_TEXTURE1, m_pAliasHeader->fb_texturenum[skin][anim] ); + GL_Bind( XASH_TEXTURE1, m_pAliasHeader->fb_texturenum[skin][anim] ); pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD ); } @@ -1494,4 +1494,4 @@ void R_DrawAliasModel( cl_entity_t *e ) VectorCopy( angles, e->angles ); } -//================================================================================== \ No newline at end of file +//================================================================================== diff --git a/engine/client/gl_backend.c b/engine/client/gl_backend.c index aa510248..2ba36a7d 100644 --- a/engine/client/gl_backend.c +++ b/engine/client/gl_backend.c @@ -679,7 +679,7 @@ rebuild_page: y = k / base_w * h; pglColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - GL_Bind( GL_TEXTURE0, i ); // NOTE: don't use image->texnum here, because skybox has a 'wrong' indexes + GL_Bind( XASH_TEXTURE0, i ); // NOTE: don't use image->texnum here, because skybox has a 'wrong' indexes if( FBitSet( image->flags, TF_DEPTHMAP ) && !FBitSet( image->flags, TF_NOCOMPARE )) pglTexParameteri( image->target, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE ); @@ -718,4 +718,4 @@ rebuild_page: CL_DrawCenterPrint (); pglFinish(); -} \ No newline at end of file +} diff --git a/engine/client/gl_decals.c b/engine/client/gl_decals.c index d65ef267..d30ddd3d 100644 --- a/engine/client/gl_decals.c +++ b/engine/client/gl_decals.c @@ -891,7 +891,7 @@ void DrawSingleDecal( decal_t *pDecal, msurface_t *fa ) v = R_DecalSetupVerts( pDecal, fa, pDecal->texture, &numVerts ); if( !numVerts ) return; - GL_Bind( GL_TEXTURE0, pDecal->texture ); + GL_Bind( XASH_TEXTURE0, pDecal->texture ); pglBegin( GL_POLYGON ); diff --git a/engine/client/gl_draw.c b/engine/client/gl_draw.c index 2b93d6de..6de3492b 100644 --- a/engine/client/gl_draw.c +++ b/engine/client/gl_draw.c @@ -66,7 +66,7 @@ R_DrawStretchPic */ void R_DrawStretchPic( float x, float y, float w, float h, float s1, float t1, float s2, float t2, int texnum ) { - GL_Bind( GL_TEXTURE0, texnum ); + GL_Bind( XASH_TEXTURE0, texnum ); pglBegin( GL_QUADS ); pglTexCoord2f( s1, t1 ); @@ -98,7 +98,7 @@ void R_DrawTileClear( int x, int y, int w, int h ) GL_SetRenderMode( kRenderNormal ); pglColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); - GL_Bind( GL_TEXTURE0, cls.tileImage ); + GL_Bind( XASH_TEXTURE0, cls.tileImage ); glt = R_GetTexture( cls.tileImage ); tw = glt->srcWidth; @@ -156,7 +156,7 @@ void R_DrawStretchRaw( float x, float y, float w, float h, int cols, int rows, c pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); tex = R_GetTexture( tr.cinTexture ); - GL_Bind( GL_TEXTURE0, tr.cinTexture ); + GL_Bind( XASH_TEXTURE0, tr.cinTexture ); if( cols == tex->width && rows == tex->height ) { diff --git a/engine/client/gl_image.c b/engine/client/gl_image.c index f1161d90..be1b873d 100644 --- a/engine/client/gl_image.c +++ b/engine/client/gl_image.c @@ -253,7 +253,7 @@ static void GL_UpdateTextureParams( int iTexture ) if( !tex->texnum ) return; // free slot - GL_Bind( GL_TEXTURE0, iTexture ); + GL_Bind( XASH_TEXTURE0, iTexture ); // set texture anisotropy if available if( GL_Support( GL_ANISOTROPY_EXT ) && ( tex->numMips > 1 ) && !FBitSet( tex->flags, TF_DEPTHMAP )) diff --git a/engine/client/gl_rpart.c b/engine/client/gl_rpart.c index 44552b80..3721cadd 100644 --- a/engine/client/gl_rpart.c +++ b/engine/client/gl_rpart.c @@ -380,7 +380,7 @@ void CL_DrawParticles( double frametime ) pglDisable( GL_ALPHA_TEST ); pglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - GL_Bind( GL_TEXTURE0, tr.particleTexture ); + GL_Bind( XASH_TEXTURE0, tr.particleTexture ); pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); pglDepthMask( GL_FALSE ); diff --git a/engine/client/gl_rsurf.c b/engine/client/gl_rsurf.c index 7f02ee62..f0c1f7d4 100644 --- a/engine/client/gl_rsurf.c +++ b/engine/client/gl_rsurf.c @@ -41,7 +41,7 @@ static qboolean draw_details = false; static msurface_t *skychain = NULL; static gllightmapstate_t gl_lms; -static void LM_UploadBlock( int lightmapnum ); +static void LM_UploadBlock( qboolean dynamic ); byte *Mod_GetCurrentVis( void ) { @@ -625,8 +625,8 @@ static void LM_UploadBlock( qboolean dynamic ) } if( host.features & ENGINE_LARGE_LIGHTMAPS ) - GL_Bind( GL_TEXTURE0, tr.dlightTexture2 ); - else GL_Bind( GL_TEXTURE0, tr.dlightTexture ); + GL_Bind( XASH_TEXTURE0, tr.dlightTexture2 ); + else GL_Bind( XASH_TEXTURE0, tr.dlightTexture ); pglTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, BLOCK_SIZE, height, GL_RGBA, GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer ); } @@ -864,7 +864,7 @@ void R_BlendLightmaps( void ) { if( gl_lms.lightmap_surfaces[i] ) { - GL_Bind( GL_TEXTURE0, tr.lightmapTextures[i] ); + GL_Bind( XASH_TEXTURE0, tr.lightmapTextures[i] ); for( surf = gl_lms.lightmap_surfaces[i]; surf != NULL; surf = surf->info->lightmapchain ) { @@ -879,8 +879,8 @@ void R_BlendLightmaps( void ) LM_InitBlock(); if( host.features & ENGINE_LARGE_LIGHTMAPS ) - GL_Bind( GL_TEXTURE0, tr.dlightTexture2 ); - else GL_Bind( GL_TEXTURE0, tr.dlightTexture ); + GL_Bind( XASH_TEXTURE0, tr.dlightTexture2 ); + else GL_Bind( XASH_TEXTURE0, tr.dlightTexture ); newsurf = gl_lms.dynamic_surfaces; @@ -985,7 +985,7 @@ void R_RenderFullbrights( void ) es = fullbright_surfaces[i]; if( !es ) continue; - GL_Bind( GL_TEXTURE0, i ); + GL_Bind( XASH_TEXTURE0, i ); for( p = es; p; p = p->lumachain ) DrawGLPoly( p->surf->polys, 0.0f, 0.0f ); @@ -1030,7 +1030,7 @@ void R_RenderDetails( void ) es = detail_surfaces[i]; if( !es ) continue; - GL_Bind( GL_TEXTURE0, i ); + GL_Bind( XASH_TEXTURE0, i ); for( p = es; p; p = p->detailchain ) { @@ -1071,7 +1071,7 @@ void R_RenderBrushPoly( msurface_t *fa, int cull_type ) t = R_TextureAnimation( fa ); - GL_Bind( GL_TEXTURE0, t->gl_texturenum ); + GL_Bind( XASH_TEXTURE0, t->gl_texturenum ); if( FBitSet( fa->flags, SURF_DRAWTURB )) { @@ -1164,7 +1164,7 @@ dynamic: R_BuildLightMap( fa, temp, smax * 4, true ); R_SetCacheState( fa ); - GL_Bind( GL_TEXTURE0, tr.lightmapTextures[fa->lightmaptexturenum] ); + GL_Bind( XASH_TEXTURE0, tr.lightmapTextures[fa->lightmaptexturenum] ); pglTexSubImage2D( GL_TEXTURE_2D, 0, fa->light_s, fa->light_t, smax, tmax, GL_RGBA, GL_UNSIGNED_BYTE, temp ); @@ -1347,7 +1347,7 @@ void R_DrawWaterSurfaces( void ) continue; // set modulate mode explicitly - GL_Bind( GL_TEXTURE0, t->gl_texturenum ); + GL_Bind( XASH_TEXTURE0, t->gl_texturenum ); for( ; s; s = s->texturechain ) EmitWaterPolys( s, false ); @@ -2187,4 +2187,4 @@ void GL_InitRandomTable( void ) } COM_SetRandomSeed( 0 ); -} \ No newline at end of file +} diff --git a/engine/client/gl_sprite.c b/engine/client/gl_sprite.c index b52c9033..5eaccc93 100644 --- a/engine/client/gl_sprite.c +++ b/engine/client/gl_sprite.c @@ -1031,7 +1031,7 @@ void R_DrawSpriteModel( cl_entity_t *e ) { // draw the single non-lerped frame pglColor4f( color[0], color[1], color[2], tr.blend ); - GL_Bind( GL_TEXTURE0, frame->gl_texturenum ); + GL_Bind( XASH_TEXTURE0, frame->gl_texturenum ); R_DrawSpriteQuad( frame, origin, v_right, v_up, scale ); } else @@ -1043,14 +1043,14 @@ void R_DrawSpriteModel( cl_entity_t *e ) if( ilerp != 0.0f ) { pglColor4f( color[0], color[1], color[2], tr.blend * ilerp ); - GL_Bind( GL_TEXTURE0, oldframe->gl_texturenum ); + GL_Bind( XASH_TEXTURE0, oldframe->gl_texturenum ); R_DrawSpriteQuad( oldframe, origin, v_right, v_up, scale ); } if( lerp != 0.0f ) { pglColor4f( color[0], color[1], color[2], tr.blend * lerp ); - GL_Bind( GL_TEXTURE0, frame->gl_texturenum ); + GL_Bind( XASH_TEXTURE0, frame->gl_texturenum ); R_DrawSpriteQuad( frame, origin, v_right, v_up, scale ); } } @@ -1067,7 +1067,7 @@ void R_DrawSpriteModel( cl_entity_t *e ) pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); pglColor4f( color2[0], color2[1], color2[2], tr.blend ); - GL_Bind( GL_TEXTURE0, tr.whiteTexture ); + GL_Bind( XASH_TEXTURE0, tr.whiteTexture ); R_DrawSpriteQuad( frame, origin, v_right, v_up, scale ); pglAlphaFunc( GL_GREATER, 0.0f ); pglDepthFunc( GL_LEQUAL ); diff --git a/engine/client/gl_studio.c b/engine/client/gl_studio.c index 0f164033..24fed9ac 100644 --- a/engine/client/gl_studio.c +++ b/engine/client/gl_studio.c @@ -729,7 +729,7 @@ void *R_StudioGetAnim( studiohdr_t *m_pStudioHeader, model_t *m_pSubModel, mstud mstudioseqgroup_t *pseqgroup; cache_user_t *paSequences; size_t filesize; - byte *buf; + byte *buf; pseqgroup = (mstudioseqgroup_t *)((byte *)m_pStudioHeader + m_pStudioHeader->seqgroupindex) + pseqdesc->seqgroup; if( pseqdesc->seqgroup == 0 ) @@ -2058,8 +2058,8 @@ static void R_StudioSetupSkin( studiohdr_t *ptexturehdr, int index ) if( !ptexture ) ptexture = (mstudiotexture_t *)((byte *)ptexturehdr + ptexturehdr->textureindex); // fallback if( r_lightmap->value && !r_fullbright->value ) - GL_Bind( GL_TEXTURE0, tr.whiteTexture ); - else GL_Bind( GL_TEXTURE0, ptexture[index].index ); + GL_Bind( XASH_TEXTURE0, tr.whiteTexture ); + else GL_Bind( XASH_TEXTURE0, ptexture[index].index ); } /* @@ -2163,7 +2163,7 @@ R_StudioDrawNormalMesh generic path =============== */ -static _inline void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t ) +_inline void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t ) { float *lv; int i; @@ -2199,7 +2199,7 @@ R_StudioDrawNormalMesh generic path =============== */ -static _inline void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms ) +_inline void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms ) { float *lv; int i; @@ -2234,7 +2234,7 @@ R_StudioDrawNormalMesh generic path =============== */ -static _inline void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale ) +_inline void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale ) { float *lv, *av; int i, idx; @@ -2465,7 +2465,7 @@ static void R_StudioDrawHulls( void ) alpha = 0.5f; else alpha = 1.0f; - GL_Bind( GL_TEXTURE0, tr.whiteTexture ); + GL_Bind( XASH_TEXTURE0, tr.whiteTexture ); pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); for( i = 0; i < m_pStudioHeader->numhitboxes; i++ ) @@ -2522,7 +2522,7 @@ static void R_StudioDrawAbsBBox( void ) if( !R_StudioComputeBBox( p )) return; - GL_Bind( GL_TEXTURE0, tr.whiteTexture ); + GL_Bind( XASH_TEXTURE0, tr.whiteTexture ); TriColor4f( 0.5f, 0.5f, 1.0f, 0.5f ); TriRenderMode( kRenderTransAdd ); @@ -3936,4 +3936,4 @@ void CL_InitStudioAPI( void ) // because we need Draw our StudioModels // just restore pointer to builtin function pStudioDraw = &gStudioDraw; -} \ No newline at end of file +} diff --git a/engine/client/gl_warp.c b/engine/client/gl_warp.c index 413619cf..650b91f5 100644 --- a/engine/client/gl_warp.c +++ b/engine/client/gl_warp.c @@ -382,8 +382,8 @@ void R_DrawSkyBox( void ) continue; if( tr.skyboxTextures[r_skyTexOrder[i]] ) - GL_Bind( GL_TEXTURE0, tr.skyboxTextures[r_skyTexOrder[i]] ); - else GL_Bind( GL_TEXTURE0, tr.skyTexture ); // stub + GL_Bind( XASH_TEXTURE0, tr.skyboxTextures[r_skyTexOrder[i]] ); + else GL_Bind( XASH_TEXTURE0, tr.skyTexture ); // stub pglBegin( GL_QUADS ); MakeSkyVec( RI.skyMins[0][i], RI.skyMins[1][i], i ); @@ -521,7 +521,7 @@ void R_CloudDrawPoly( glpoly_t *p ) int i; GL_SetRenderMode( kRenderNormal ); - GL_Bind( GL_TEXTURE0, tr.solidskyTexture ); + GL_Bind( XASH_TEXTURE0, tr.solidskyTexture ); pglBegin( GL_QUADS ); for( i = 0, v = p->verts[0]; i < 4; i++, v += VERTEXSIZE ) @@ -533,7 +533,7 @@ void R_CloudDrawPoly( glpoly_t *p ) pglEnd(); GL_SetRenderMode( kRenderTransTexture ); - GL_Bind( GL_TEXTURE0, tr.alphaskyTexture ); + GL_Bind( XASH_TEXTURE0, tr.alphaskyTexture ); pglBegin( GL_QUADS ); for( i = 0, v = p->verts[0]; i < 4; i++, v += VERTEXSIZE )