UE1 models now handle frame index -1 properly.

This commit is contained in:
Marisa the Magician 2022-08-24 18:11:09 +02:00 committed by Christoph Oelckers
parent f27acfa6b2
commit 8c0ad50db3

View file

@ -232,7 +232,7 @@ int FUE1Model::FindFrame( const char *name, bool nodefault )
void FUE1Model::RenderFrame( FModelRenderer *renderer, FGameTexture *skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids) void FUE1Model::RenderFrame( FModelRenderer *renderer, FGameTexture *skin, int frame, int frame2, double inter, int translation, const FTextureID* surfaceskinids)
{ {
// the moment of magic // the moment of magic
if ( (frame >= numFrames) || (frame2 >= numFrames) ) return; if ( (frame < 0) || (frame2 < 0) || (frame >= numFrames) || (frame2 >= numFrames) ) return;
renderer->SetInterpolation(inter); renderer->SetInterpolation(inter);
int vsize, fsize = 0, vofs = 0; int vsize, fsize = 0, vofs = 0;
for ( int i=0; i<numGroups; i++ ) fsize += groups[i].numPolys*3; for ( int i=0; i<numGroups; i++ ) fsize += groups[i].numPolys*3;