Skip to content

Commit

Permalink
vk: brush: improve animated surfaces detection
Browse files Browse the repository at this point in the history
Explicitly check that there are at least two different textures in an
animation sequence.

Fixes #555
  • Loading branch information
w23 committed Sep 8, 2023
1 parent 48b7fcb commit 26a4fff
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ref/vk/vk_brush.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,16 @@ static qboolean isSurfaceAnimated( const msurface_t *s, const struct texture_s *
if( base->name[0] == '-' )
return false;

return true;
// It is not an animation if all textures are the same
const texture_t *prev = base;
base = base->anim_next;
while (base && base != prev) {
if (prev->gl_texturenum != base->gl_texturenum)
return true;
base = base->anim_next;
}

return false;
}

typedef enum {
Expand Down

0 comments on commit 26a4fff

Please sign in to comment.