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:
|
2023-08-22 22:02:25 +00:00
|
|
|
Blitter_Null()
|
|
|
|
{
|
|
|
|
this->SetScreenDepth(0);
|
2023-08-22 22:10:52 +00:00
|
|
|
this->SetNoSpriteDataRequired(true);
|
2023-08-22 22:02:25 +00:00
|
|
|
}
|
|
|
|
|
2019-03-03 22:25:13 +00:00
|
|
|
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override {};
|
|
|
|
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override {};
|
2023-12-20 20:38:21 +00:00
|
|
|
Sprite *Encode(const SpriteLoader::SpriteCollection &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 {};
|
2022-05-18 23:08:15 +00:00
|
|
|
void SetPixel32(void *video, int x, int y, uint8 colour, uint32 colour32) override {};
|
2019-03-03 22:25:13 +00:00
|
|
|
void DrawRect(void *video, int width, int height, uint8 colour) override {};
|
2023-01-17 22:18:02 +00:00
|
|
|
void DrawRectAt(void *video, int x, int y, int width, int height, uint8 colour) override {};
|
2019-03-03 22:25:13 +00:00
|
|
|
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 {};
|
2020-10-01 22:11:15 +00:00
|
|
|
void SetRect(void *video, int x, int y, const uint8 *colours, uint lines, uint width, uint pitch) override {};
|
|
|
|
void SetRect32(void *video, int x, int y, const uint32 *colours, uint lines, uint width, uint pitch) override {};
|
2019-03-03 22:25:13 +00:00
|
|
|
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 {};
|
2020-02-09 00:34:47 +00:00
|
|
|
void ScrollBuffer(void *video, int left, int top, int width, int height, int scroll_x, int scroll_y) override {};
|
2023-01-02 20:30:02 +00:00
|
|
|
size_t BufferSize(uint width, uint height) override { return 0; };
|
2019-03-03 22:25:13 +00:00
|
|
|
void PaletteAnimate(const Palette &palette) override { };
|
|
|
|
Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };
|
|
|
|
|
|
|
|
const char *GetName() override { return "null"; }
|
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 */
|