Browse Source

Fix sprite loading

pull/2/head
mittorn 6 years ago
parent
commit
31ab710485
  1. 3
      engine/common/mod_sprite.c
  2. 12
      ref_gl/gl_sprite.c

3
engine/common/mod_sprite.c

@ -34,7 +34,6 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui @@ -34,7 +34,6 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
dsprite_q1_t *pinq1;
dsprite_hl_t *pinhl;
dsprite_t *pin;
short *numi = NULL;
msprite_t *psprite;
int i, size;
@ -80,7 +79,6 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui @@ -80,7 +79,6 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
mod->maxs[0] = mod->maxs[1] = pinq1->bounds[0] * 0.5f;
mod->mins[2] = -pinq1->bounds[1] * 0.5f;
mod->maxs[2] = pinq1->bounds[1] * 0.5f;
numi = NULL;
}
else if( i == SPRITE_VERSION_HL )
{
@ -100,7 +98,6 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui @@ -100,7 +98,6 @@ void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, ui
mod->maxs[0] = mod->maxs[1] = pinhl->bounds[0] * 0.5f;
mod->mins[2] = -pinhl->bounds[1] * 0.5f;
mod->maxs[2] = pinhl->bounds[1] * 0.5f;
numi = (short *)(pinhl + 1);
}
if( Host_IsDedicated() )

12
ref_gl/gl_sprite.c

@ -144,13 +144,19 @@ load sprite model @@ -144,13 +144,19 @@ load sprite model
*/
void Mod_LoadSpriteModel( model_t *mod, const void *buffer, qboolean *loaded, uint texFlags )
{
dsprite_q1_t *pinq1;
dsprite_hl_t *pinhl;
dsprite_t *pin;
short *numi = NULL;
dframetype_t *pframetype;
msprite_t *psprite;
int i, size;
int i;
pin = buffer;
psprite = mod->cache.data;
if( pin->version == SPRITE_VERSION_Q1 || pin->version == SPRITE_VERSION_32 )
numi = NULL;
else if( pin->version == SPRITE_VERSION_HL )
numi = (short *)(buffer + sizeof( dsprite_hl_t ));
r_texFlags = texFlags;
sprite_version = pin->version;

Loading…
Cancel
Save