equal
deleted
inserted
replaced
2 #include "../zoom.hpp" |
2 #include "../zoom.hpp" |
3 #include "../gfx.h" |
3 #include "../gfx.h" |
4 #include "8bpp_slow.hpp" |
4 #include "8bpp_slow.hpp" |
5 |
5 |
6 static FBlitter_8bppSimple iFBlitter_8bppSimple; |
6 static FBlitter_8bppSimple iFBlitter_8bppSimple; |
7 |
|
8 extern void* AllocSprite(size_t); |
|
9 |
7 |
10 void Blitter_8bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) |
8 void Blitter_8bppSimple::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) |
11 { |
9 { |
12 const byte *src, *src_line; |
10 const byte *src, *src_line; |
13 Pixel8 *dst, *dst_line; |
11 Pixel8 *dst, *dst_line; |
44 src += ScaleByZoom(1, zoom); |
42 src += ScaleByZoom(1, zoom); |
45 } |
43 } |
46 } |
44 } |
47 } |
45 } |
48 |
46 |
49 Sprite *Blitter_8bppSimple::Encode(SpriteLoader::Sprite *sprite) |
47 Sprite *Blitter_8bppSimple::Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator) |
50 { |
48 { |
51 Sprite *dest_sprite; |
49 Sprite *dest_sprite; |
52 dest_sprite = (Sprite *)AllocSprite(sizeof(*dest_sprite) + sprite->height * sprite->width); |
50 dest_sprite = (Sprite *)allocator(sizeof(*dest_sprite) + sprite->height * sprite->width);; |
53 |
51 |
54 dest_sprite->height = sprite->height; |
52 dest_sprite->height = sprite->height; |
55 dest_sprite->width = sprite->width; |
53 dest_sprite->width = sprite->width; |
56 dest_sprite->x_offs = sprite->x_offs; |
54 dest_sprite->x_offs = sprite->x_offs; |
57 dest_sprite->y_offs = sprite->y_offs; |
55 dest_sprite->y_offs = sprite->y_offs; |