12 #include "../stdafx.h" 13 #include "../zoom_func.h" 16 #include "../safeguards.h" 23 const uint8 *src, *src_line;
24 uint8 *dst, *dst_line;
30 for (
int y = 0; y < bp->
height; y++) {
32 dst_line += bp->
pitch;
37 for (
int x = 0; x < bp->
width; x++) {
43 colour = bp->
remap[*src];
47 if (*src != 0) colour = bp->
remap[*dst];
51 if (*src != 0) *dst = 0;
58 if (colour != 0) *dst = colour;
68 dest_sprite = (
Sprite *)allocator(
sizeof(*dest_sprite) + (size_t)sprite->
height * (
size_t)sprite->
width);
76 for (
int i = 0; i < sprite->
height * sprite->
width; i++) {
int left
The left offset in the 'dst' in pixels to start drawing.
int sprite_width
Real width of the sprite.
int height
The height in pixels that needs to be drawn to dst.
Perform transparency colour remapping.
int skip_top
How much pixels of the source to skip on the top (based on zoom of dst)
Data structure describing a sprite.
int width
The width in pixels that needs to be drawn to dst.
static int ScaleByZoom(int value, ZoomLevel zoom)
Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) When shifting right...
Simple (and slow) 8 bpp blitter.
int skip_left
How much pixels of the source to skip on the left (based on zoom of dst)
int16 y_offs
Number of pixels to shift the sprite downwards.
Parameters related to blitting.
int pitch
The pitch of the destination buffer.
int16 x_offs
The x-offset of where the sprite will be drawn.
SpriteLoader::CommonPixel * data
The sprite itself.
Perform a crash remapping.
Structure for passing information from the sprite loader to the blitter.
static FBlitter_8bppSimple iFBlitter_8bppSimple
Instantiation of the simple 8bpp blitter factory.
Perform remapping to a completely blackened sprite.
Factory for the most trivial 8bpp blitter.
uint16 height
Height of the sprite.
uint16 width
Width of the sprite.
ZoomLevel
All zoom levels we know.
uint16 width
Width of the sprite.
int top
The top offset in the 'dst' in pixels to start drawing.
const byte * remap
XXX – Temporary storage for remap array.
const void * sprite
Pointer to the sprite how ever the encoder stored it.
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
Draw an image to the screen, given an amount of params defined above.
Perform a colour remapping.
uint16 height
Height of the sprite.
int16 x_offs
Number of pixels to shift the sprite to the right.
void * dst
Destination buffer.
int16 y_offs
The y-offset of where the sprite will be drawn.
BlitterMode
The modes of blitting we can do.
Sprite * Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
Convert a sprite from the loader to our own format.