X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=model_sprite.c;h=2dd746957207d11f89d58cc0f028bce9cac2b8c1;hb=e5550cfc25f16584de466e54dad75de1c9a2837d;hp=33117f6803a15fc13c5645c3155c8754a90af84b;hpb=157c3faf9c34d5baf6ffb94d27d2b50fc1266c50;p=xonotic%2Fdarkplaces.git diff --git a/model_sprite.c b/model_sprite.c index 33117f68..2dd74695 100644 --- a/model_sprite.c +++ b/model_sprite.c @@ -75,8 +75,8 @@ static void Mod_SpriteSetupTexture(texture_t *texture, skinframe_t *skinframe, q else if (skinframe->hasalpha) texture->basematerialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_BLENDED | MATERIALFLAG_NOSHADOW; texture->currentmaterialflags = texture->basematerialflags; - texture->numskinframes = 1; - texture->currentskinframe = texture->skinframes[0] = skinframe; + texture->materialshaderpass = texture->shaderpasses[0] = Mod_CreateShaderPass(skinframe); + texture->currentskinframe = skinframe; texture->surfaceflags = 0; texture->supercontents = SUPERCONTENTS_SOLID; if (!(texture->basematerialflags & MATERIALFLAG_BLENDED)) @@ -371,6 +371,9 @@ 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); + // 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); } @@ -479,5 +482,8 @@ void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend) loadmodel->radius = modelradius; loadmodel->radius2 = modelradius * modelradius; + // 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); }