# 32bpp_anim.hpp

Go to the documentation of this file.

    00001 /* $Id: 32bpp_anim.hpp 18809 2010-01-15 16:41:15Z 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_ANIM_HPP
    00013 #define BLITTER_32BPP_ANIM_HPP
    00014
    00015 #include "32bpp_optimized.hpp"
    00016
    00017 class Blitter_32bppAnim : public Blitter_32bppOptimized {
    00018 private:
    00019   uint8 *anim_buf;
    00020   int anim_buf_width;
    00021   int anim_buf_height;
    00022
    00023 public:
    00024   Blitter_32bppAnim() :
    00025     anim_buf(NULL),
    00026     anim_buf_width(0),
    00027     anim_buf_height(0)
    00028   {}
    00029
    00030   /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
    00031   /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, int pal);
    00032   /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
    00033   /* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 colour);
    00034   /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
    00035   /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
    00036   /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
    00037   /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
    00038   /* virtual */ int BufferSize(int width, int height);
    00039   /* virtual */ void PaletteAnimate(uint start, uint count);
    00040   /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
    00041
    00042   /* virtual */ const char *GetName() { return "32bpp-anim"; }
    00043   /* virtual */ int GetBytesPerPixel() { return 5; }
    00044   /* virtual */ void PostResize();
    00045
    00046   template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
    00047 };
    00048
    00049 class FBlitter_32bppAnim: public BlitterFactory<FBlitter_32bppAnim> {
    00050 public:
    00051   /* virtual */ const char *GetName() { return "32bpp-anim"; }
    00052   /* virtual */ const char *GetDescription() { return "32bpp Animation Blitter (palette animation)"; }
    00053   /* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
    00054 };
    00055
    00056 #endif /* BLITTER_32BPP_ANIM_HPP */