OpenTTD Source: src/blitter/8bpp_base.hpp Source File

OpenTTD Source 12.0-beta1

8bpp_base.hpp
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
7
10 #ifndef BLITTER_8BPP_BASE_HPP
11 #define BLITTER_8BPP_BASE_HPP
12
13 #include "base.hpp"
14
16 class Blitter_8bppBase : public Blitter {
17 public:
18 uint8 GetScreenDepth() override { return 8; }
19 void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override;
20 void *MoveTo(void *video, int x, int y) override;
21 void SetPixel(void *video, int x, int y, uint8 colour) override;
22 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;
23 void DrawRect(void *video, int width, int height, uint8 colour) override;
24 void CopyFromBuffer(void *video, const void *src, int width, int height) override;
25 void CopyToBuffer(const void *video, void *dst, int width, int height) override;
26 void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
27 void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override;
28 int BufferSize(int width, int height) override;
29 void PaletteAnimate(const Palette &palette) override;
30 Blitter::PaletteAnimation UsePaletteAnimation() override;
31 int GetBytesPerPixel() override { return 1; }
32 };
33
34 #endif /* BLITTER_8BPP_BASE_HPP */
Blitter_8bppBase::CopyToBuffer
void CopyToBuffer(const void *video, void *dst, int width, int height) override
Copy from the screen to a buffer.
Definition: 8bpp_base.cpp:64
Blitter
How all blitters should look like.
Definition: base.hpp:28
Blitter_8bppBase::UsePaletteAnimation
Blitter::PaletteAnimation UsePaletteAnimation() override
Check if the blitter uses palette animation at all.
Definition: 8bpp_base.cpp:157
Blitter_8bppBase::GetBytesPerPixel
int GetBytesPerPixel() override
Get how many bytes are needed to store a pixel.
Definition: 8bpp_base.hpp:31
Blitter_8bppBase::DrawLine
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
Draw a line with a given colour.
Definition: 8bpp_base.cpp:37
Blitter_8bppBase::PaletteAnimate
void PaletteAnimate(const Palette &palette) override
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to...
Definition: 8bpp_base.cpp:152
Blitter_8bppBase
Base for all 8bpp blitters.
Definition: 8bpp_base.hpp:16
Blitter::PaletteAnimation
PaletteAnimation
Types of palette animation.
Definition: base.hpp:49
Blitter_8bppBase::CopyImageToBuffer
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override
Copy from the screen to a buffer in a palette format for 8bpp and RGBA format for 32bpp.
Definition: 8bpp_base.cpp:76
Blitter_8bppBase::ScrollBuffer
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override
Scroll the videobuffer some 'x' and 'y' value.
Definition: 8bpp_base.cpp:88
Blitter_8bppBase::BufferSize
int BufferSize(int width, int height) override
Calculate how much memory there is needed for an image of this size in the video-buffer.
Definition: 8bpp_base.cpp:147
Blitter_8bppBase::SetPixel
void SetPixel(void *video, int x, int y, uint8 colour) override
Draw a pixel with a given colour on the video-buffer.
Definition: 8bpp_base.cpp:32
PaletteID
uint32 PaletteID
The number of the palette.
Definition: gfx_type.h:18
base.hpp
Blitter_8bppBase::DrawRect
void DrawRect(void *video, int width, int height, uint8 colour) override
Make a single horizontal line in a single colour on the video-buffer.
Definition: 8bpp_base.cpp:44
Blitter_8bppBase::MoveTo
void * MoveTo(void *video, int x, int y) override
Move the destination pointer the requested amount x and y, keeping in mind any pitch and bpp of the r...
Definition: 8bpp_base.cpp:27
Palette
Information about the currently used palette.
Definition: gfx_type.h:313
Blitter_8bppBase::CopyFromBuffer
void CopyFromBuffer(void *video, const void *src, int width, int height) override
Copy from a buffer to the screen.
Definition: 8bpp_base.cpp:52
Blitter_8bppBase::DrawColourMappingRect
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override
Draw a colourtable to the screen.
Definition: 8bpp_base.cpp:17
Blitter_8bppBase::GetScreenDepth
uint8 GetScreenDepth() override
Get the screen depth this blitter works for.
Definition: 8bpp_base.hpp:18