From 2d545767eff0796681848c6d0da8703a65faab5e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 12 Aug 2020 01:32:05 +0200 Subject: [PATCH] - completely clear all texture data when setting a frame size. SMK tries to draw a texture from it before the first frame has been rendered. This ensures that it gets a fully black frame. Fixes #167. --- source/common/textures/animtexture.cpp | 1 + source/core/screenjob.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/source/common/textures/animtexture.cpp b/source/common/textures/animtexture.cpp index 75dbb0111..c54cd5d81 100644 --- a/source/common/textures/animtexture.cpp +++ b/source/common/textures/animtexture.cpp @@ -47,6 +47,7 @@ void AnimTexture::SetFrameSize(int format, int width, int height) FTexture::SetSize(width, height); Image.Resize(width * height * (format == Paletted ? 1 : 3)); memset(Image.Data(), 0, Image.Size()); + CleanHardwareTextures(); pixelformat = format; } diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index 4a5bda4f5..45fca0ac6 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -315,6 +315,7 @@ public: { Smacker_Close(hSMK); soundEngine->StopAllChannels(); + animtex.Clean(); } };