OpenTTD
32bpp_anim.hpp
Go to the documentation of this file.
1 /* $Id: 32bpp_anim.hpp 26214 2014-01-02 23:52:13Z rubidium $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef BLITTER_32BPP_ANIM_HPP
13 #define BLITTER_32BPP_ANIM_HPP
14 
15 #include "32bpp_optimized.hpp"
16 
19 protected:
20  uint16 *anim_buf;
24 
25 public:
27  anim_buf(NULL),
28  anim_buf_width(0),
30  {}
31 
32  /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
33  /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
34  /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
35  /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
36  /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
37  /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
38  /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
39  /* virtual */ int BufferSize(int width, int height);
40  /* virtual */ void PaletteAnimate(const Palette &palette);
42 
43  /* virtual */ const char *GetName() { return "32bpp-anim"; }
44  /* virtual */ int GetBytesPerPixel() { return 6; }
45  /* virtual */ void PostResize();
46 
50  inline Colour LookupColourInPalette(uint index)
51  {
52  return this->palette.palette[index];
53  }
54 
55  template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
56 };
57 
60 public:
61  FBlitter_32bppAnim() : BlitterFactory("32bpp-anim", "32bpp Animation Blitter (palette animation)") {}
62  /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
63 };
64 
65 #endif /* BLITTER_32BPP_ANIM_HPP */