OpenTTD Source 20241224-master-gee860a5c8e
32bpp_anim_sse2.hpp
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef BLITTER_32BPP_SSE2_ANIM_HPP
11#define BLITTER_32BPP_SSE2_ANIM_HPP
12
13#ifdef WITH_SSE
14
15#ifndef SSE_VERSION
16#define SSE_VERSION 2
17#endif
18
19#ifndef SSE_TARGET
20#define SSE_TARGET "sse2"
21#endif
22
23#ifndef FULL_ANIMATION
24#define FULL_ANIMATION 1
25#endif
26
27#include "32bpp_anim.hpp"
28#include "32bpp_sse2.hpp"
29
31class Blitter_32bppSSE2_Anim : public Blitter_32bppAnim {
32public:
33 void PaletteAnimate(const Palette &palette) override;
34 std::string_view GetName() override { return "32bpp-sse2-anim"; }
35};
36
38class FBlitter_32bppSSE2_Anim : public BlitterFactory {
39public:
40 FBlitter_32bppSSE2_Anim() : BlitterFactory("32bpp-sse2-anim", "32bpp partially SSE2 Animation Blitter (palette animation)", HasCPUIDFlag(1, 3, 26)) {}
41 Blitter *CreateInstance() override { return new Blitter_32bppSSE2_Anim(); }
42};
43
44#endif /* WITH_SSE */
45#endif /* BLITTER_32BPP_ANIM_HPP */
A 32 bpp blitter with animation support.
SSE2 32 bpp blitter.
The base factory, keeping track of all blitters.
Definition factory.hpp:21
virtual Blitter * CreateInstance()=0
Create an instance of this Blitter-class.
The optimised 32 bpp blitter with palette animation.
std::string_view GetName() override
Get the name of the blitter, the same as the Factory-instance returns.
void PaletteAnimate(const Palette &palette) override
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to...
How all blitters should look like.
Definition base.hpp:29
bool HasCPUIDFlag(uint type, uint index, uint bit)
Check whether the current CPU has the given flag.
Definition cpu.cpp:84
Information about the currently used palette.
Definition gfx_type.h:328