Changeset - r6988:8026972849a3
[Not reviewed]
master
0 3 0
truelight - 17 years ago 2007-06-21 13:31:41
truelight@openttd.org
(svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
3 files changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/blitter/32bpp_anim.cpp
Show inline comments
 
@@ -235,24 +235,29 @@ void Blitter_32bppAnim::ScrollBuffer(voi
 
		uint tw = width + (scroll_x >= 0 ? -scroll_x : scroll_x);
 
		uint th = height + scroll_y;
 
		for (; th > 0; th--) {
 
			memmove(dst, src, tw * sizeof(uint8));
 
			src += this->anim_buf_width;
 
			dst += this->anim_buf_width;
 
		}
 
	}
 

	
 
	Blitter_32bppBase::ScrollBuffer(video, left, top, width, height, scroll_x, scroll_y);
 
}
 

	
 
int Blitter_32bppAnim::BufferSize(int width, int height)
 
{
 
	return width * height * (sizeof(uint32) + sizeof(uint8));
 
}
 

	
 
void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
 
{
 
	uint8 *anim = this->anim_buf;
 

	
 
	/* Never repaint the transparency pixel */
 
	if (start == 0) start++;
 

	
 
	/* Let's walk the anim buffer and try to find the pixels */
 
	for (int y = 0; y < this->anim_buf_height; y++) {
 
		for (int x = 0; x < this->anim_buf_width; x++) {
 
			if (*anim >= start && *anim <= start + count) {
 
				/* Update this pixel */
src/blitter/32bpp_anim.hpp
Show inline comments
 
@@ -20,24 +20,25 @@ public:
 
		anim_buf_width(0),
 
		anim_buf_height(0)
 
	{}
 

	
 
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
 
	/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
 
	/* virtual */ void SetPixel(void *video, int x, int y, uint8 color);
 
	/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color);
 
	/* virtual */ void DrawRect(void *video, int width, int height, uint8 color);
 
	/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
 
	/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
 
	/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
 
	/* virtual */ int BufferSize(int width, int height);
 
	/* virtual */ void PaletteAnimate(uint start, uint count);
 
	/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
 
};
 

	
 
class FBlitter_32bppAnim: public BlitterFactory<FBlitter_32bppAnim> {
 
public:
 
	/* virtual */ const char *GetName() { return "32bpp-anim"; }
 
	/* virtual */ const char *GetDescription() { return "32bpp Animation Blitter (palette animation)"; }
 
	/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
 
};
 

	
 
#endif /* BLITTER_32BPP_ANIM_HPP */
src/texteff.cpp
Show inline comments
 
@@ -46,25 +46,25 @@ struct TextMessage {
 
};
 

	
 
static TextEffect _text_effect_list[MAX_TEXT_MESSAGES];
 
static TextMessage _textmsg_list[MAX_CHAT_MESSAGES];
 
TileIndex _animated_tile_list[MAX_ANIMATED_TILES];
 

	
 
static bool _textmessage_dirty = false;
 
static bool _textmessage_visible = false;
 

	
 
/* The chatbox grows from the bottom so the coordinates are pixels from
 
 * the left and pixels from the bottom. The height is the maximum height */
 
static const Oblong _textmsg_box = {10, 30, 500, 150};
 
static uint8 _textmessage_backup[150 * 500 * 5]; // (height * width)
 
static uint8 _textmessage_backup[150 * 500 * 6]; // (height * width)
 

	
 
static inline uint GetTextMessageCount()
 
{
 
	uint i;
 

	
 
	for (i = 0; i < MAX_CHAT_MESSAGES; i++) {
 
		if (_textmsg_list[i].message[0] == '\0') break;
 
	}
 

	
 
	return i;
 
}
 

	
0 comments (0 inline, 0 general)