1 /* $Id$ */ |
|
2 |
|
3 /** @file 32bpp.hpp */ |
|
4 |
|
5 #ifndef RENDERER_32BPP_HPP |
|
6 #define RENDERER_32BPP_HPP |
|
7 |
|
8 #include "renderer.hpp" |
|
9 |
|
10 class Renderer_32bpp : public Renderer { |
|
11 public: |
|
12 /* virtual */ void *MoveTo(const void *video, int x, int y); |
|
13 /* virtual */ void SetPixel(void *video, int x, int y, uint8 color); |
|
14 /* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color); |
|
15 /* virtual */ void SetHorizontalLine(void *video, int width, uint8 color); |
|
16 /* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height, int src_pitch); |
|
17 /* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height, int dst_pitch); |
|
18 /* virtual */ void MoveBuffer(void *video_dst, const void *video_src, int width, int height); |
|
19 /* virtual */ int BufferSize(int width, int height); |
|
20 |
|
21 static inline uint32 LookupColourInPalette(uint8 index) { |
|
22 #define ARGB(a, r, g, b) ((((a) << 24) & 0xFF000000) | (((r) << 16) & 0x00FF0000) | (((g) << 8) & 0x0000FF00) | ((b) & 0x000000FF)) |
|
23 if (index == 0) return 0x00000000; |
|
24 return ARGB(0xFF, _cur_palette[index].r, _cur_palette[index].g, _cur_palette[index].b); |
|
25 } |
|
26 }; |
|
27 |
|
28 class FRenderer_32bpp: public RendererFactory<FRenderer_32bpp> { |
|
29 public: |
|
30 /* virtual */ const char *GetName() { return "32bpp"; } |
|
31 |
|
32 /* virtual */ Renderer *CreateInstance() { return new Renderer_32bpp(); } |
|
33 }; |
|
34 |
|
35 #endif /* RENDERER_32BPP_HPP */ |
|