# null.hpp

Go to the documentation of this file.

    00001 /* $Id: null.hpp 18907 2010-01-23 22:37:14Z alberth $ */
    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_NULL_HPP
    00013 #define BLITTER_NULL_HPP
    00014
    00015 #include "base.hpp"
    00016 #include "factory.hpp"
    00017
    00018 class Blitter_Null : public Blitter {
    00019 public:
    00020   /* virtual */ uint8 GetScreenDepth() { return 0; }
    00021   /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) {};
    00022   /* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) {};
    00023   /* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
    00024   /* virtual */ void *MoveTo(const void *video, int x, int y) { return NULL; };
    00025   /* virtual */ void SetPixel(void *video, int x, int y, uint8 colour) {};
    00026   /* virtual */ void DrawRect(void *video, int width, int height, uint8 colour) {};
    00027   /* virtual */ void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour) {};
    00028   /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height) {};
    00029   /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height) {};
    00030   /* virtual */ void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) {};
    00031   /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) {};
    00032   /* virtual */ int BufferSize(int width, int height) { return 0; };
    00033   /* virtual */ void PaletteAnimate(uint start, uint count) { };
    00034   /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_NONE; };
    00035
    00036   /* virtual */ const char *GetName() { return "null"; }
    00037   /* virtual */ int GetBytesPerPixel() { return 0; }
    00038 };
    00039
    00040 class FBlitter_Null: public BlitterFactory<FBlitter_Null> {
    00041 public:
    00042   /* virtual */ const char *GetName() { return "null"; }
    00043   /* virtual */ const char *GetDescription() { return "Null Blitter (does nothing)"; }
    00044   /* virtual */ Blitter *CreateInstance() { return new Blitter_Null(); }
    00045 };
    00046
    00047 #endif /* BLITTER_NULL_HPP */