Changeset - r26442:20d4cd2e950d
[Not reviewed]
master
0 2 0
glx22 - 2 years ago 2022-09-27 18:06:57
glx@openttd.org
Fix: don't use animated SSE4 Draw() when animation is disabled
2 files changed with 9 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/blitter/32bpp_anim_sse4.cpp
Show inline comments
 
@@ -367,6 +367,12 @@ IGNORE_UNINITIALIZED_WARNING_STOP
 
 */
 
void Blitter_32bppSSE4_Anim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
 
{
 
	if (_screen_disable_anim) {
 
		/* This means our output is not to the screen, so we can't be doing any animation stuff, so use our parent Draw() */
 
		Blitter_32bppSSE4::Draw(bp, mode, zoom);
 
		return;
 
	}
 

	
 
	const Blitter_32bppSSE_Base::SpriteFlags sprite_flags = ((const Blitter_32bppSSE_Base::SpriteData *) bp->sprite)->flags;
 
	switch (mode) {
 
		default: {
src/blitter/32bpp_anim_sse4.hpp
Show inline comments
 
@@ -32,7 +32,7 @@
 
#define MARGIN_NORMAL_THRESHOLD 4
 

	
 
/** The SSE4 32 bpp blitter with palette animation. */
 
class Blitter_32bppSSE4_Anim FINAL : public Blitter_32bppSSE2_Anim, public Blitter_32bppSSE_Base {
 
class Blitter_32bppSSE4_Anim FINAL : public Blitter_32bppSSE2_Anim, public Blitter_32bppSSE4 {
 
private:
 

	
 
public:
 
@@ -43,13 +43,14 @@ public:
 
		return Blitter_32bppSSE_Base::Encode(sprite, allocator);
 
	}
 
	const char *GetName() override { return "32bpp-sse4-anim"; }
 
	using Blitter_32bppSSE2_Anim::LookupColourInPalette;
 
};
 

	
 
/** Factory for the SSE4 32 bpp blitter (with palette animation). */
 
class FBlitter_32bppSSE4_Anim: public BlitterFactory {
 
public:
 
	FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "32bpp SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {}
 
	Blitter *CreateInstance() override { return new Blitter_32bppSSE4_Anim(); }
 
	Blitter *CreateInstance() override { return static_cast<Blitter_32bppSSE2_Anim *>(new Blitter_32bppSSE4_Anim()); }
 
};
 

	
 
#endif /* WITH_SSE */
0 comments (0 inline, 0 general)