src/blitter/32bpp_anim.cpp
author truelight
Sun, 09 Sep 2007 23:57:47 +0000
changeset 8051 ec4e97b7b70c
parent 8050 8c907fdd9d37
child 8052 3056e53dfe42
permissions -rw-r--r--
(svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     1
#include "../stdafx.h"
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     2
#include "../zoom.hpp"
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     3
#include "../gfx.h"
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     4
#include "../debug.h"
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     5
#include "../table/sprites.h"
7666
a5fccd76176a (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents: 7634
diff changeset
     6
#include "../video/video_driver.hpp"
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     7
#include "32bpp_anim.hpp"
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     8
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     9
static FBlitter_32bppAnim iFBlitter_32bppAnim;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    10
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    11
void Blitter_32bppAnim::Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    12
{
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    13
	const SpriteLoader::CommonPixel *src, *src_line;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    14
	uint32 *dst, *dst_line;
8050
8c907fdd9d37 (svn r11079) -Fix: dirty fix to allow big-screenshots with 32bpp-anim
truelight
parents: 8049
diff changeset
    15
	uint8 *anim, *anim_line, *anim_end;
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    16
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    17
	if (_screen.width != this->anim_buf_width || _screen.height != this->anim_buf_height) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    18
		/* The size of the screen changed; we can assume we can wipe all data from our buffer */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    19
		free(this->anim_buf);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    20
		this->anim_buf = CallocT<uint8>(_screen.width * _screen.height);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    21
		this->anim_buf_width = _screen.width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    22
		this->anim_buf_height = _screen.height;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    23
	}
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    24
	anim_end = this->anim_buf + this->anim_buf_height * this->anim_buf_width - 1;
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    25
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    26
	/* Find where to start reading in the source sprite */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    27
	src_line = (const SpriteLoader::CommonPixel *)bp->sprite + (bp->skip_top * bp->sprite_width + bp->skip_left) * ScaleByZoom(1, zoom);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    28
	dst_line = (uint32 *)bp->dst + bp->top * bp->pitch + bp->left;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    29
	anim_line = this->anim_buf + ((uint32 *)bp->dst - (uint32 *)_screen.dst_ptr) + bp->top * this->anim_buf_width + bp->left;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    30
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    31
	for (int y = 0; y < bp->height; y++) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    32
		dst = dst_line;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    33
		dst_line += bp->pitch;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    34
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    35
		src = src_line;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    36
		src_line += bp->sprite_width * ScaleByZoom(1, zoom);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    37
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    38
		anim = anim_line;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    39
		anim_line += this->anim_buf_width;
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    40
		/* Don't allow values of 'anim' greater than 'anim_end' to avoid buffer overflows.
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    41
		 *  This only happens when we are doing a big-screenshot, so it should be relative safe */
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    42
		if (anim >= anim_end || anim < this->anim_buf) anim = anim_end;
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    43
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    44
		for (int x = 0; x < bp->width; x++) {
8049
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    45
			if (src->a == 0) {
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    46
				/* src->r is 'misused' here to indicate how much more pixels are following with an alpha of 0 */
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    47
				int skip = UnScaleByZoom(src->r, zoom);
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    48
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    49
				dst  += skip;
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    50
				/* Make sure the anim-buffer is cleared */
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    51
				if (anim < anim_end - skip) {
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    52
					memset(anim, 0, skip);
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    53
					anim += skip;
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    54
				}
8049
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    55
				x    += skip - 1;
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    56
				src  += ScaleByZoom(1, zoom) * skip;
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    57
				continue;
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    58
			}
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    59
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    60
			switch (mode) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    61
				case BM_COLOUR_REMAP:
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    62
					/* In case the m-channel is zero, do not remap this pixel in any way */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    63
					if (src->m == 0) {
8049
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    64
						*dst = ComposeColourRGBA(src->r, src->g, src->b, src->a, *dst);
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    65
						*anim = 0;
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    66
					} else {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    67
						if (bp->remap[src->m] != 0) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    68
							*dst = ComposeColourPA(this->LookupColourInPalette(bp->remap[src->m]), src->a, *dst);
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    69
							*anim = bp->remap[src->m];
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    70
						}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    71
					}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    72
					break;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    73
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    74
				case BM_TRANSPARENT:
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    75
					/* TODO -- We make an assumption here that the remap in fact is transparency, not some color.
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    76
					 *  This is never a problem with the code we produce, but newgrfs can make it fail... or at least:
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    77
					 *  we produce a result the newgrf maker didn't expect ;) */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    78
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    79
					/* Make the current color a bit more black, so it looks like this image is transparent */
8049
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    80
					*dst = MakeTransparent(*dst, 192);
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    81
					*anim = bp->remap[*anim];
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    82
					break;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    83
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    84
				default:
8049
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    85
					/* Above 217 is palette animation */
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    86
					if (src->m >= 217) *dst = ComposeColourPA(this->LookupColourInPalette(src->m), src->a, *dst);
00faaf0c0b52 (svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents: 8048
diff changeset
    87
					else               *dst = ComposeColourRGBA(src->r, src->g, src->b, src->a, *dst);
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    88
					*anim = src->m;
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    89
					break;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    90
			}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    91
			dst++;
8051
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    92
			/* Don't increase the anim buffer anymore if we tend to run out of the buffer...
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    93
			 *  This only happens when we are doing a big-screenshot, so it should be relative safe */
ec4e97b7b70c (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;)
truelight
parents: 8050
diff changeset
    94
			if (anim < anim_end) anim++;
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    95
			src += ScaleByZoom(1, zoom);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    96
		}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    97
	}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    98
}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    99
7481
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   100
void Blitter_32bppAnim::DrawColorMappingRect(void *dst, int width, int height, int pal)
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   101
{
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   102
	uint32 *udst = (uint32 *)dst;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   103
	uint8 *anim;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   104
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   105
	anim = this->anim_buf + ((uint32 *)dst - (uint32 *)_screen.dst_ptr);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   106
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   107
	if (pal == PALETTE_TO_TRANSPARENT) {
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   108
		do {
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   109
			for (int i = 0; i != width; i++) {
8048
7547093f21e6 (svn r11076) -Fix: MakeTransparent of 32bpp blitter used 0..100; using 0..255 makes it much faster (frosch)
truelight
parents: 7666
diff changeset
   110
				*udst = MakeTransparent(*udst, 154);
7481
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   111
				*anim = 0;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   112
				udst++;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   113
				anim++;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   114
			}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   115
			udst = udst - width + _screen.pitch;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   116
			anim = anim - width + this->anim_buf_width;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   117
		} while (--height);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   118
		return;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   119
	}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   120
	if (pal == PALETTE_TO_STRUCT_GREY) {
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   121
		do {
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   122
			for (int i = 0; i != width; i++) {
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   123
				*udst = MakeGrey(*udst);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   124
				*anim = 0;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   125
				udst++;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   126
				anim++;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   127
			}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   128
			udst = udst - width + _screen.pitch;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   129
			anim = anim - width + this->anim_buf_width;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   130
		} while (--height);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   131
		return;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   132
	}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   133
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   134
	DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this color table ('%d')", pal);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   135
}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   136
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   137
void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 color)
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   138
{
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   139
	*((uint32 *)video + x + y * _screen.pitch) = LookupColourInPalette(color);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   140
	/* Set the color in the anim-buffer too */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   141
	this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   142
}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   143
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   144
void Blitter_32bppAnim::SetPixelIfEmpty(void *video, int x, int y, uint8 color)
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   145
{
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   146
	uint32 *dst = (uint32 *)video + x + y * _screen.pitch;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   147
	if (*dst == 0) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   148
		*dst = LookupColourInPalette(color);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   149
		/* Set the color in the anim-buffer too */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   150
		this->anim_buf[((uint32 *)video - (uint32 *)_screen.dst_ptr) + x + y * this->anim_buf_width] = color;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   151
	}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   152
}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   153
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   154
void Blitter_32bppAnim::DrawRect(void *video, int width, int height, uint8 color)
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   155
{
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   156
	uint32 color32 = LookupColourInPalette(color);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   157
	uint8 *anim_line;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   158
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   159
	anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   160
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   161
	do {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   162
		uint32 *dst = (uint32 *)video;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   163
		uint8 *anim = anim_line;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   164
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   165
		for (int i = width; i > 0; i--) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   166
			*dst = color32;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   167
			/* Set the color in the anim-buffer too */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   168
			*anim = color;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   169
			dst++;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   170
			anim++;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   171
		}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   172
		video = (uint32 *)video + _screen.pitch;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   173
		anim_line += this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   174
	} while (--height);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   175
}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   176
7481
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   177
void Blitter_32bppAnim::CopyFromBuffer(void *video, const void *src, int width, int height)
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   178
{
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   179
	assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   180
	uint32 *dst = (uint32 *)video;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   181
	uint32 *usrc = (uint32 *)src;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   182
	uint8 *anim_line;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   183
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   184
	anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   185
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   186
	for (; height > 0; height--) {
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   187
		memcpy(dst, usrc, width * sizeof(uint32));
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   188
		usrc += width;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   189
		dst += _screen.pitch;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   190
		/* Copy back the anim-buffer */
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   191
		memcpy(anim_line, usrc, width * sizeof(uint8));
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   192
		usrc = (uint32 *)((uint8 *)usrc + width);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   193
		anim_line += this->anim_buf_width;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   194
	}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   195
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   196
	/* We update the palette (or the pixels that do animation) immediatly, to avoid graphical glitches */
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   197
	this->PaletteAnimate(217, _use_dos_palette ? 38 : 28);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   198
}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   199
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   200
void Blitter_32bppAnim::CopyToBuffer(const void *video, void *dst, int width, int height)
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   201
{
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   202
	assert(video >= _screen.dst_ptr && video <= (uint32 *)_screen.dst_ptr + _screen.width + _screen.height * _screen.pitch);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   203
	uint32 *udst = (uint32 *)dst;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   204
	uint32 *src = (uint32 *)video;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   205
	uint8 *anim_line;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   206
7482
ec4c1ff22d83 (svn r10242) -Fix: avoid a segfault if you move your mouse at startup with 32bpp-anim
truelight
parents: 7481
diff changeset
   207
	if (this->anim_buf == NULL) return;
ec4c1ff22d83 (svn r10242) -Fix: avoid a segfault if you move your mouse at startup with 32bpp-anim
truelight
parents: 7481
diff changeset
   208
7481
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   209
	anim_line = ((uint32 *)video - (uint32 *)_screen.dst_ptr) + this->anim_buf;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   210
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   211
	for (; height > 0; height--) {
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   212
		memcpy(udst, src, width * sizeof(uint32));
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   213
		src += _screen.pitch;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   214
		udst += width;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   215
		/* Copy the anim-buffer */
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   216
		memcpy(udst, anim_line, width * sizeof(uint8));
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   217
		udst = (uint32 *)((uint8 *)udst + width);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   218
		anim_line += this->anim_buf_width;
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   219
	}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   220
}
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7475
diff changeset
   221
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   222
void Blitter_32bppAnim::ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   223
{
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   224
	uint8 *dst, *src;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   225
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   226
	/* We need to scroll the anim-buffer too */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   227
	if (scroll_y > 0) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   228
		dst = this->anim_buf + left + (top + height - 1) * this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   229
		src = dst - scroll_y * this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   230
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   231
		/* Adjust left & width */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   232
		if (scroll_x >= 0) dst += scroll_x;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   233
		else               src -= scroll_x;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   234
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   235
		uint tw = width + (scroll_x >= 0 ? -scroll_x : scroll_x);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   236
		uint th = height - scroll_y;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   237
		for (; th > 0; th--) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   238
			memcpy(dst, src, tw * sizeof(uint8));
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   239
			src -= this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   240
			dst -= this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   241
		}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   242
	} else {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   243
		/* Calculate pointers */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   244
		dst = this->anim_buf + left + top * this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   245
		src = dst - scroll_y * this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   246
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   247
		/* Adjust left & width */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   248
		if (scroll_x >= 0) dst += scroll_x;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   249
		else               src -= scroll_x;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   250
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   251
		/* the y-displacement may be 0 therefore we have to use memmove,
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   252
		 * because source and destination may overlap */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   253
		uint tw = width + (scroll_x >= 0 ? -scroll_x : scroll_x);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   254
		uint th = height + scroll_y;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   255
		for (; th > 0; th--) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   256
			memmove(dst, src, tw * sizeof(uint8));
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   257
			src += this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   258
			dst += this->anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   259
		}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   260
	}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   261
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   262
	Blitter_32bppBase::ScrollBuffer(video, left, top, width, height, scroll_x, scroll_y);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   263
}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   264
7484
cdf0450632a1 (svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
truelight
parents: 7482
diff changeset
   265
int Blitter_32bppAnim::BufferSize(int width, int height)
cdf0450632a1 (svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
truelight
parents: 7482
diff changeset
   266
{
cdf0450632a1 (svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
truelight
parents: 7482
diff changeset
   267
	return width * height * (sizeof(uint32) + sizeof(uint8));
cdf0450632a1 (svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
truelight
parents: 7482
diff changeset
   268
}
cdf0450632a1 (svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
truelight
parents: 7482
diff changeset
   269
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   270
void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   271
{
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   272
	uint8 *anim = this->anim_buf;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   273
7475
7a7a5b807fcb (svn r10235) -Fix: the 32bpp-anim blitter repainted pixel color 0, which is transparency and therefor should never be repainted (spotted by Rubidium)
truelight
parents: 7467
diff changeset
   274
	/* Never repaint the transparency pixel */
7a7a5b807fcb (svn r10235) -Fix: the 32bpp-anim blitter repainted pixel color 0, which is transparency and therefor should never be repainted (spotted by Rubidium)
truelight
parents: 7467
diff changeset
   275
	if (start == 0) start++;
7a7a5b807fcb (svn r10235) -Fix: the 32bpp-anim blitter repainted pixel color 0, which is transparency and therefor should never be repainted (spotted by Rubidium)
truelight
parents: 7467
diff changeset
   276
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   277
	/* Let's walk the anim buffer and try to find the pixels */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   278
	for (int y = 0; y < this->anim_buf_height; y++) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   279
		for (int x = 0; x < this->anim_buf_width; x++) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   280
			if (*anim >= start && *anim <= start + count) {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   281
				/* Update this pixel */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   282
				this->SetPixel(_screen.dst_ptr, x, y, *anim);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   283
			}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   284
			anim++;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   285
		}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   286
	}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   287
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   288
	/* Make sure the backend redraws the whole screen */
7666
a5fccd76176a (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model.
peter1138
parents: 7634
diff changeset
   289
	_video_driver->MakeDirty(0, 0, _screen.width, _screen.height);
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   290
}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   291
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   292
Blitter::PaletteAnimation Blitter_32bppAnim::UsePaletteAnimation()
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   293
{
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   294
	return Blitter::PALETTE_ANIMATION_BLITTER;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
   295
}