Changeset - r22567:c7f225c92a0b
[Not reviewed]
master
0 2 0
frosch - 7 years ago 2017-03-11 12:52:26
frosch@openttd.org
(svn r27774) -Fix [FS#5889]: Enabling palette animation for 32bpp blitters while paused skipped initialisation of the palette and resulted in black windows.
-Revert (r23978): No SDL-specific fix required anymore. The new fix applies to all backends.
2 files changed with 3 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/blitter/32bpp_anim.hpp
Show inline comments
 
@@ -18,25 +18,27 @@
 
class Blitter_32bppAnim : public Blitter_32bppOptimized {
 
protected:
 
	uint16 *anim_buf;    ///< In this buffer we keep track of the 8bpp indexes so we can do palette animation
 
	int anim_buf_width;  ///< The width of the animation buffer.
 
	int anim_buf_height; ///< The height of the animation buffer.
 
	Palette palette;     ///< The current palette.
 

	
 
public:
 
	Blitter_32bppAnim() :
 
		anim_buf(NULL),
 
		anim_buf_width(0),
 
		anim_buf_height(0)
 
	{}
 
	{
 
		this->palette = _cur_palette;
 
	}
 

	
 
	~Blitter_32bppAnim();
 

	
 
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
 
	/* virtual */ void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal);
 
	/* virtual */ void SetPixel(void *video, int x, int y, uint8 colour);
 
	/* virtual */ void DrawRect(void *video, int width, int height, uint8 colour);
 
	/* 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(const Palette &palette);
src/video/sdl_v.cpp
Show inline comments
 
@@ -395,37 +395,24 @@ bool VideoDriver_SDL::CreateMainSurface(
 
	_screen.dst_ptr = newscreen->pixels;
 
	_sdl_screen = newscreen;
 

	
 
	/* When in full screen, we will always have the mouse cursor
 
	 * within the window, even though SDL does not give us the
 
	 * appropriate event to know this. */
 
	if (_fullscreen) _cursor.in_window = true;
 

	
 
	Blitter *blitter = BlitterFactory::GetCurrentBlitter();
 
	blitter->PostResize();
 

	
 
	InitPalette();
 
	switch (blitter->UsePaletteAnimation()) {
 
		case Blitter::PALETTE_ANIMATION_NONE:
 
		case Blitter::PALETTE_ANIMATION_VIDEO_BACKEND:
 
			UpdatePalette();
 
			break;
 

	
 
		case Blitter::PALETTE_ANIMATION_BLITTER:
 
			if (VideoDriver::GetInstance() != NULL) blitter->PaletteAnimate(_local_palette);
 
			break;
 

	
 
		default:
 
			NOT_REACHED();
 
	}
 

	
 
	seprintf(caption, lastof(caption), "OpenTTD %s", _openttd_revision);
 
	SDL_CALL SDL_WM_SetCaption(caption, caption);
 

	
 
	GameSizeChanged();
 

	
 
	return true;
 
}
 

	
 
bool VideoDriver_SDL::ClaimMousePointer()
 
{
 
	SDL_CALL SDL_ShowCursor(0);
0 comments (0 inline, 0 general)