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 8bpp_simple.hpp Simple (and slow) 8 bpp blitter. */
|
2007-06-11 13:50:49 +02:00
|
|
|
|
|
|
|
#ifndef BLITTER_8BPP_SIMPLE_HPP
|
|
|
|
#define BLITTER_8BPP_SIMPLE_HPP
|
|
|
|
|
2007-06-17 22:30:28 +02:00
|
|
|
#include "8bpp_base.hpp"
|
|
|
|
#include "factory.hpp"
|
2007-06-11 13:50:49 +02:00
|
|
|
|
2011-05-01 12:15:33 +02:00
|
|
|
/** Most trivial 8bpp blitter. */
|
2024-01-31 21:03:17 +01:00
|
|
|
class Blitter_8bppSimple final : public Blitter_8bppBase {
|
2007-06-11 13:50:49 +02:00
|
|
|
public:
|
2019-03-03 23:25:13 +01:00
|
|
|
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override;
|
2023-12-20 21:38:21 +01:00
|
|
|
Sprite *Encode(const SpriteLoader::SpriteCollection &sprite, AllocatorProc *allocator) override;
|
2007-06-21 15:56:59 +02:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
const char *GetName() override { return "8bpp-simple"; }
|
2007-06-11 13:50:49 +02:00
|
|
|
};
|
|
|
|
|
2011-05-01 12:15:33 +02:00
|
|
|
/** Factory for the most trivial 8bpp blitter. */
|
2014-01-02 23:41:58 +01:00
|
|
|
class FBlitter_8bppSimple : public BlitterFactory {
|
2007-06-11 13:50:49 +02:00
|
|
|
public:
|
2014-01-02 23:41:58 +01:00
|
|
|
FBlitter_8bppSimple() : BlitterFactory("8bpp-simple", "8bpp Simple Blitter (relative slow, but never wrong)") {}
|
2019-03-03 23:25:13 +01:00
|
|
|
Blitter *CreateInstance() override { return new Blitter_8bppSimple(); }
|
2007-06-11 13:50:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BLITTER_8BPP_SIMPLE_HPP */
|