OpenTTD

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