32bpp_anim_sse4.hpp

00001 /* $Id: 32bpp_anim_sse4.hpp 26221 2014-01-03 17:55:40Z rubidium $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef BLITTER_32BPP_SSE4_ANIM_HPP
00013 #define BLITTER_32BPP_SSE4_ANIM_HPP
00014 
00015 #ifdef WITH_SSE
00016 
00017 #include "32bpp_anim.hpp"
00018 #include "32bpp_sse4.hpp"
00019 
00020 #undef MARGIN_NORMAL_THRESHOLD
00021 #define MARGIN_NORMAL_THRESHOLD 4
00022 
00024 class Blitter_32bppSSE4_Anim FINAL : public Blitter_32bppAnim, public Blitter_32bppSSE_Base {
00025 private:
00026 
00027 public:
00028   template <BlitterMode mode, Blitter_32bppSSE_Base::ReadMode read_mode, Blitter_32bppSSE_Base::BlockType bt_last>
00029   /* virtual */ void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
00030   /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
00031   /* virtual */ Colour AdjustBrightness(Colour colour, uint8 brightness);
00032   /* virtual */ Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) {
00033     return Blitter_32bppSSE_Base::Encode(sprite, allocator);
00034   }
00035 
00036   /* virtual */ const char *GetName() { return "32bpp-sse4-anim"; }
00037 };
00038 
00040 class FBlitter_32bppSSE4_Anim: public BlitterFactory {
00041 public:
00042   FBlitter_32bppSSE4_Anim() : BlitterFactory("32bpp-sse4-anim", "SSE4 Blitter (palette animation)", HasCPUIDFlag(1, 2, 19)) {}
00043   /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppSSE4_Anim(); }
00044 };
00045 
00046 #endif /* WITH_SSE */
00047 #endif /* BLITTER_32BPP_SSE4_ANIM_HPP */