2007-06-12 20:24:12 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file null.hpp The blitter that doesn't blit. */
|
2007-06-12 20:24:12 +00:00
|
|
|
|
|
|
|
#ifndef BLITTER_NULL_HPP
|
|
|
|
#define BLITTER_NULL_HPP
|
|
|
|
|
2007-06-17 20:30:28 +00:00
|
|
|
#include "factory.hpp"
|
2007-06-12 20:24:12 +00:00
|
|
|
|
2011-05-01 10:15:33 +00:00
|
|
|
/** Blitter that does nothing. */
|
2007-06-12 20:24:12 +00:00
|
|
|
class Blitter_Null : public Blitter {
|
|
|
|
public:
|
2019-03-03 22:25:13 +00:00
|
|
|
uint8 GetScreenDepth() override { return 0; }
|
|
|
|
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override {};
|
|
|
|
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override {};
|
|
|
|
Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override;
|
2019-04-10 21:07:06 +00:00
|
|
|
void *MoveTo(void *video, int x, int y) override { return nullptr; };
|
2019-03-03 22:25:13 +00:00
|
|
|
void SetPixel(void *video, int x, int y, uint8 colour) override {};
|
|
|
|
void DrawRect(void *video, int width, int height, uint8 colour) override {};
|
|
|
|
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override {};
|
|
|
|
void CopyFromBuffer(void *video, const void *src, int width, int height) override {};
|
|
|
|
void CopyToBuffer(const void *video, void *dst, int width, int height) override {};
|
|
|
|
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override {};
|
|
|
|
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override {};
|
|
|
|
int BufferSize(int width, int height) override { return 0; };
|
|
|
|
void PaletteAnimate(const Palette &palette) override { };
|
|
|
|
Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };
|
|
|
|
|
|
|
|
const char *GetName() override { return "null"; }
|
|
|
|
int GetBytesPerPixel() override { return 0; }
|
2007-06-12 20:24:12 +00:00
|
|
|
};
|
|
|
|
|
2013-01-08 22:46:42 +00:00
|
|
|
/** Factory for the blitter that does nothing. */
|
2014-01-02 22:41:58 +00:00
|
|
|
class FBlitter_Null : public BlitterFactory {
|
2007-06-12 20:24:12 +00:00
|
|
|
public:
|
2014-01-02 22:41:58 +00:00
|
|
|
FBlitter_Null() : BlitterFactory("null", "Null Blitter (does nothing)") {}
|
2019-03-03 22:25:13 +00:00
|
|
|
Blitter *CreateInstance() override { return new Blitter_Null(); }
|
2007-06-12 20:24:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BLITTER_NULL_HPP */
|