mirror of https://github.com/OpenTTD/OpenTTD
Fix: don't use animated SSE4 Draw() when animation is disabled
parent
c7505539af
commit
da1a0d042e
|
@ -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: {
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue