X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=model_sprite.c;h=9b8bab23b1aa03a115afd0efef6e0ffa7fbddf8e;hb=d5ccbaeeea3eee8b06360487a538fb365b5f4746;hp=9fa98ccaf2621dd10884ff8faaf82afd35255645;hpb=b2ceb93109e9c9aa188fe8cb22dde6b4d169807f;p=xonotic%2Fdarkplaces.git diff --git a/model_sprite.c b/model_sprite.c index 9fa98cca..9b8bab23 100644 --- a/model_sprite.c +++ b/model_sprite.c @@ -67,6 +67,7 @@ static void Mod_SpriteSetupTexture(texture_t *texture, skinframe_t *skinframe, q texture->specularscalemod = 1; texture->specularpowermod = 1; texture->basematerialflags = MATERIALFLAG_WALL; + texture->basealpha = 1.0f; if (fullbright) texture->basematerialflags |= MATERIALFLAG_FULLBRIGHT; if (additive) @@ -80,6 +81,9 @@ static void Mod_SpriteSetupTexture(texture_t *texture, skinframe_t *skinframe, q texture->supercontents = SUPERCONTENTS_SOLID; if (!(texture->basematerialflags & MATERIALFLAG_BLENDED)) texture->supercontents |= SUPERCONTENTS_OPAQUE; + texture->transparentsort = TRANSPARENTSORT_DISTANCE; + // WHEN ADDING DEFAULTS HERE, REMEMBER TO PUT DEFAULTS IN ALL LOADERS + // JUST GREP FOR "specularscalemod = 1". } extern cvar_t gl_texturecompression_sprites; @@ -259,7 +263,6 @@ static void Mod_Sprite_SharedSetup(const unsigned char *datapointer, int version loadmodel->radius2 = modelradius * modelradius; } -extern void R_Model_Sprite_Draw(entity_render_t *ent); void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend) { int version; @@ -368,7 +371,10 @@ void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend) Host_Error("Mod_IDSP_Load: %s has wrong version number (%i). Only %i (quake), %i (HalfLife), and %i (sprite32) supported", loadmodel->name, version, SPRITE_VERSION, SPRITEHL_VERSION, SPRITE32_VERSION); - loadmodel->surfmesh.isanimated = loadmodel->numframes > 1 || loadmodel->animscenes[0].framecount > 1; + // TODO: Note that isanimated only means whether vertices change due to + // the animation. This may happen due to sprframe parameters changing. + // Mere texture chanegs OTOH shouldn't require isanimated to be 1. + loadmodel->surfmesh.isanimated = loadmodel->numframes > 1 || (loadmodel->animscenes && loadmodel->animscenes[0].framecount > 1); } @@ -476,5 +482,8 @@ void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->radius = modelradius; loadmodel->radius2 = modelradius * modelradius; - loadmodel->surfmesh.isanimated = loadmodel->numframes > 1 || loadmodel->animscenes[0].framecount > 1; + // TODO: Note that isanimated only means whether vertices change due to + // the animation. This may happen due to sprframe parameters changing. + // Mere texture chanegs OTOH shouldn't require isanimated to be 1. + loadmodel->surfmesh.isanimated = loadmodel->numframes > 1 || (loadmodel->animscenes && loadmodel->animscenes[0].framecount > 1); }