src/blitter/32bpp_base.hpp
branchgamebalance
changeset 9913 e79cd19772dd
child 9629 66dde6412125
equal deleted inserted replaced
9912:1ac8aac92385 9913:e79cd19772dd
       
     1 /* $Id$ */
       
     2 
       
     3 /** @file 32bpp_base.hpp */
       
     4 
       
     5 #ifndef BLITTER_32BPP_BASE_HPP
       
     6 #define BLITTER_32BPP_BASE_HPP
       
     7 
       
     8 #include "base.hpp"
       
     9 
       
    10 class Blitter_32bppBase : public Blitter {
       
    11 public:
       
    12 	/* virtual */ uint8 GetScreenDepth() { return 32; }
       
    13 //	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
       
    14 //	/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
       
    15 //	/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator);
       
    16 	/* virtual */ void *MoveTo(const void *video, int x, int y);
       
    17 	/* virtual */ void SetPixel(void *video, int x, int y, uint8 color);
       
    18 	/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color);
       
    19 	/* virtual */ void SetHorizontalLine(void *video, int width, uint8 color);
       
    20 	/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height, int src_pitch);
       
    21 	/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height, int dst_pitch);
       
    22 	/* virtual */ void MoveBuffer(void *video_dst, const void *video_src, int width, int height);
       
    23 	/* virtual */ int BufferSize(int width, int height);
       
    24 
       
    25 	static inline uint32 LookupColourInPalette(uint8 index) {
       
    26 		#define ARGB(a, r, g, b) ((((a) << 24) & 0xFF000000) | (((r) << 16) & 0x00FF0000) | (((g) << 8) & 0x0000FF00) | ((b) & 0x000000FF))
       
    27 		if (index == 0) return 0x00000000;
       
    28 		return ARGB(0xFF, _cur_palette[index].r, _cur_palette[index].g, _cur_palette[index].b);
       
    29 	}
       
    30 };
       
    31 
       
    32 #endif /* BLITTER_32BPP_BASE_HPP */