Browse Source

ref_soft: lowmemory: prevent redefines

pull/2/head
mittorn 5 years ago
parent
commit
d4efb55492
  1. 2
      r_local.h
  2. 13
      r_studio.c

2
r_local.h

@ -64,6 +64,8 @@ extern byte *r_temppool;
#define MAX_DECAL_SURFS 4096 #define MAX_DECAL_SURFS 4096
#if XASH_LOW_MEMORY #if XASH_LOW_MEMORY
#undef MAX_TEXTURES
#undef MAX_DECAL_SURFS
#define MAX_TEXTURES 1024 #define MAX_TEXTURES 1024
#define MAX_DECAL_SURFS 256 #define MAX_DECAL_SURFS 256
#endif #endif

13
r_studio.c

@ -57,6 +57,7 @@ typedef struct sortedmesh_s
} sortedmesh_t; } sortedmesh_t;
#if XASH_LOW_MEMORY #if XASH_LOW_MEMORY
#undef MAXSTUDIOVERTS
#define MAXSTUDIOVERTS 1024 #define MAXSTUDIOVERTS 1024
#endif #endif
@ -3527,7 +3528,7 @@ static void R_StudioLoadTexture( model_t *mod, studiohdr_t *phdr, mstudiotexture
int flags = 0; int flags = 0;
char texname[128], name[128], mdlname[128]; char texname[128], name[128], mdlname[128];
texture_t *tx = NULL; texture_t *tx = NULL;
if( ptexture->flags & STUDIO_NF_NORMALMAP ) if( ptexture->flags & STUDIO_NF_NORMALMAP )
flags |= (TF_NORMALMAP); flags |= (TF_NORMALMAP);
@ -3551,17 +3552,17 @@ static void R_StudioLoadTexture( model_t *mod, studiohdr_t *phdr, mstudiotexture
tx->anim_min = PLATE_HUE_START; // topcolor start tx->anim_min = PLATE_HUE_START; // topcolor start
tx->anim_max = PLATE_HUE_END; // topcolor end tx->anim_max = PLATE_HUE_END; // topcolor end
// bottomcolor start always equal is (topcolor end + 1) // bottomcolor start always equal is (topcolor end + 1)
tx->anim_total = SUIT_HUE_END;// bottomcolor end tx->anim_total = SUIT_HUE_END;// bottomcolor end
} }
else else
{ {
Q_strncpy( tx->name, "DM_User", sizeof( tx->name )); // custom remapped Q_strncpy( tx->name, "DM_User", sizeof( tx->name )); // custom remapped
Q_strncpy( val, ptexture->name + 7, 4 ); Q_strncpy( val, ptexture->name + 7, 4 );
tx->anim_min = bound( 0, Q_atoi( val ), 255 ); // topcolor start tx->anim_min = bound( 0, Q_atoi( val ), 255 ); // topcolor start
Q_strncpy( val, ptexture->name + 11, 4 ); Q_strncpy( val, ptexture->name + 11, 4 );
tx->anim_max = bound( 0, Q_atoi( val ), 255 ); // topcolor end tx->anim_max = bound( 0, Q_atoi( val ), 255 ); // topcolor end
// bottomcolor start always equal is (topcolor end + 1) // bottomcolor start always equal is (topcolor end + 1)
Q_strncpy( val, ptexture->name + 15, 4 ); Q_strncpy( val, ptexture->name + 15, 4 );
tx->anim_total = bound( 0, Q_atoi( val ), 255 ); // bottomcolor end tx->anim_total = bound( 0, Q_atoi( val ), 255 ); // bottomcolor end
} }
@ -3603,7 +3604,7 @@ static void R_StudioLoadTexture( model_t *mod, studiohdr_t *phdr, mstudiotexture
} }
else if( tx ) else if( tx )
{ {
// duplicate texnum for easy acess // duplicate texnum for easy acess
tx->gl_texturenum = ptexture->index; tx->gl_texturenum = ptexture->index;
} }
} }

Loading…
Cancel
Save