File diff r25013:4c02a1340d93 → r25014:e1f1bf3a062e
src/video/win32_v.cpp
Show inline comments
 
@@ -861,18 +861,22 @@ bool VideoDriver_Win32Base::PollEvent()
 

	
 
	return true;
 
}
 

	
 
void VideoDriver_Win32Base::MainLoop()
 
{
 
	this->StartGameThread();
 

	
 
	for (;;) {
 
		if (_exit_game) break;
 

	
 
		this->Tick();
 
		this->SleepTillNextTick();
 
	}
 

	
 
	this->StopGameThread();
 
}
 

	
 
void VideoDriver_Win32Base::ClientSizeChanged(int w, int h, bool force)
 
{
 
	/* Allocate backing store of the new size. */
 
	if (this->AllocateBackingStore(w, h, force)) {
 
@@ -992,12 +996,14 @@ const char *VideoDriver_Win32GDI::Start(
 
	this->MakePalette();
 
	this->AllocateBackingStore(_cur_resolution.width, _cur_resolution.height);
 
	this->MakeWindow(_fullscreen);
 

	
 
	MarkWholeScreenDirty();
 

	
 
	this->is_game_threaded = !GetDriverParamBool(param, "no_threads") && !GetDriverParamBool(param, "no_thread");
 

	
 
	return nullptr;
 
}
 

	
 
void VideoDriver_Win32GDI::Stop()
 
{
 
	DeleteObject(this->gdi_palette);
 
@@ -1112,19 +1118,13 @@ void VideoDriver_Win32GDI::Paint()
 
		switch (blitter->UsePaletteAnimation()) {
 
			case Blitter::PALETTE_ANIMATION_VIDEO_BACKEND:
 
				this->UpdatePalette(dc2, _local_palette.first_dirty, _local_palette.count_dirty);
 
				break;
 

	
 
			case Blitter::PALETTE_ANIMATION_BLITTER: {
 
				bool need_buf = _screen.dst_ptr == nullptr;
 
				if (need_buf) _screen.dst_ptr = this->GetVideoPointer();
 
				blitter->PaletteAnimate(_local_palette);
 
				if (need_buf) {
 
					this->ReleaseVideoPointer();
 
					_screen.dst_ptr = nullptr;
 
				}
 
				break;
 
			}
 

	
 
			case Blitter::PALETTE_ANIMATION_NONE:
 
				break;
 

	
 
@@ -1288,12 +1288,14 @@ const char *VideoDriver_Win32OpenGL::Sta
 
	}
 

	
 
	this->ClientSizeChanged(this->width, this->height, true);
 

	
 
	MarkWholeScreenDirty();
 

	
 
	this->is_game_threaded = !GetDriverParamBool(param, "no_threads") && !GetDriverParamBool(param, "no_thread");
 

	
 
	return nullptr;
 
}
 

	
 
void VideoDriver_Win32OpenGL::Stop()
 
{
 
	this->DestroyContext();
 
@@ -1368,12 +1370,17 @@ bool VideoDriver_Win32OpenGL::AfterBlitt
 
{
 
	assert(BlitterFactory::GetCurrentBlitter()->GetScreenDepth() != 0);
 
	this->ClientSizeChanged(this->width, this->height, true);
 
	return true;
 
}
 

	
 
void VideoDriver_Win32OpenGL::PopulateSystemSprites()
 
{
 
	OpenGLBackend::Get()->PopulateCursorCache();
 
}
 

	
 
void VideoDriver_Win32OpenGL::ClearSystemSprites()
 
{
 
	OpenGLBackend::Get()->ClearCursorCache();
 
}
 

	
 
bool VideoDriver_Win32OpenGL::AllocateBackingStore(int w, int h, bool force)