2009-08-21 22:21:05 +02: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 17:11:33 +02:00
|
|
|
/** @file null.hpp The blitter that doesn't blit. */
|
2007-06-12 22:24:12 +02:00
|
|
|
|
|
|
|
#ifndef BLITTER_NULL_HPP
|
|
|
|
#define BLITTER_NULL_HPP
|
|
|
|
|
2007-06-17 22:30:28 +02:00
|
|
|
#include "factory.hpp"
|
2007-06-12 22:24:12 +02:00
|
|
|
|
2011-05-01 12:15:33 +02:00
|
|
|
/** Blitter that does nothing. */
|
2007-06-12 22:24:12 +02:00
|
|
|
class Blitter_Null : public Blitter {
|
|
|
|
public:
|
2023-05-08 19:01:06 +02:00
|
|
|
uint8_t GetScreenDepth() override { return 0; }
|
2023-09-16 22:20:53 +02:00
|
|
|
void Draw(Blitter::BlitterParams *, BlitterMode, ZoomLevel) override {};
|
|
|
|
void DrawColourMappingRect(void *, int, int, PaletteID) override {};
|
2023-12-20 21:38:21 +01:00
|
|
|
Sprite *Encode(const SpriteLoader::SpriteCollection &sprite, AllocatorProc *allocator) override;
|
2023-09-16 22:20:53 +02:00
|
|
|
void *MoveTo(void *, int, int) override { return nullptr; };
|
|
|
|
void SetPixel(void *, int, int, uint8_t) override {};
|
|
|
|
void DrawRect(void *, int, int, uint8_t) override {};
|
|
|
|
void DrawLine(void *, int, int, int, int, int, int, uint8_t, int, int) override {};
|
|
|
|
void CopyFromBuffer(void *, const void *, int, int) override {};
|
|
|
|
void CopyToBuffer(const void *, void *, int, int) override {};
|
|
|
|
void CopyImageToBuffer(const void *, void *, int, int, int) override {};
|
|
|
|
void ScrollBuffer(void *, int &, int &, int &, int &, int, int) override {};
|
|
|
|
size_t BufferSize(uint, uint) override { return 0; };
|
|
|
|
void PaletteAnimate(const Palette &) override { };
|
2019-03-03 23:25:13 +01:00
|
|
|
Blitter::PaletteAnimation UsePaletteAnimation() override { return Blitter::PALETTE_ANIMATION_NONE; };
|
|
|
|
|
2024-04-10 00:35:50 +02:00
|
|
|
std::string_view GetName() override { return "null"; }
|
2007-06-12 22:24:12 +02:00
|
|
|
};
|
|
|
|
|
2013-01-08 23:46:42 +01:00
|
|
|
/** Factory for the blitter that does nothing. */
|
2014-01-02 23:41:58 +01:00
|
|
|
class FBlitter_Null : public BlitterFactory {
|
2007-06-12 22:24:12 +02:00
|
|
|
public:
|
2014-01-02 23:41:58 +01:00
|
|
|
FBlitter_Null() : BlitterFactory("null", "Null Blitter (does nothing)") {}
|
2019-03-03 23:25:13 +01:00
|
|
|
Blitter *CreateInstance() override { return new Blitter_Null(); }
|
2007-06-12 22:24:12 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BLITTER_NULL_HPP */
|