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 32bpp_simple.hpp Simple 32 bpp blitter. */
|
2007-06-13 10:31:40 +00:00
|
|
|
|
|
|
|
#ifndef BLITTER_32BPP_SIMPLE_HPP
|
|
|
|
#define BLITTER_32BPP_SIMPLE_HPP
|
|
|
|
|
2007-06-17 20:30:28 +00:00
|
|
|
#include "32bpp_base.hpp"
|
|
|
|
#include "factory.hpp"
|
2007-06-13 10:31:40 +00:00
|
|
|
|
2011-05-01 10:15:33 +00:00
|
|
|
/** The most trivial 32 bpp blitter (without palette animation). */
|
2007-06-17 20:30:28 +00:00
|
|
|
class Blitter_32bppSimple : public Blitter_32bppBase {
|
2011-12-24 23:33:45 +00:00
|
|
|
struct Pixel {
|
|
|
|
uint8 r; ///< Red-channel
|
|
|
|
uint8 g; ///< Green-channel
|
|
|
|
uint8 b; ///< Blue-channel
|
|
|
|
uint8 a; ///< Alpha-channel
|
|
|
|
uint8 m; ///< Remap-channel
|
|
|
|
uint8 v; ///< Brightness-channel
|
|
|
|
};
|
2007-06-13 10:31:40 +00:00
|
|
|
public:
|
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;
|
2007-06-21 13:56:59 +00:00
|
|
|
|
2019-03-03 22:25:13 +00:00
|
|
|
const char *GetName() override { return "32bpp-simple"; }
|
2007-06-13 10:31:40 +00:00
|
|
|
};
|
|
|
|
|
2011-05-01 10:15:33 +00:00
|
|
|
/** Factory for the simple 32 bpp blitter. */
|
2014-01-02 22:41:58 +00:00
|
|
|
class FBlitter_32bppSimple : public BlitterFactory {
|
2007-06-13 10:31:40 +00:00
|
|
|
public:
|
2014-01-02 22:41:58 +00:00
|
|
|
FBlitter_32bppSimple() : BlitterFactory("32bpp-simple", "32bpp Simple Blitter (no palette animation)") {}
|
2019-03-03 22:25:13 +00:00
|
|
|
Blitter *CreateInstance() override { return new Blitter_32bppSimple(); }
|
2007-06-13 10:31:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BLITTER_32BPP_SIMPLE_HPP */
|