summaryrefslogtreecommitdiff
path: root/src/video/win32_v.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-16 16:43:42 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-22 22:16:07 +0100
commit200be7d20cf736db309c70f7eae35268d812f706 (patch)
treea8f018899017f7cddd8c3fdecee478f5d18fb470 /src/video/win32_v.cpp
parent01ef44fa4ff800c03994d904a8eef445f1871b32 (diff)
downloadopenttd-200be7d20cf736db309c70f7eae35268d812f706.tar.xz
Add: [OpenGL] Support for a separate animation buffer that stores the palette values of the screen in addition to the colour buffer.
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r--src/video/win32_v.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index f5c6d3cc7..a9342d5f4 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -1545,14 +1545,19 @@ bool VideoDriver_Win32OpenGL::AllocateBackingStore(int w, int h, bool force)
void *VideoDriver_Win32OpenGL::GetVideoPointer()
{
+ if (BlitterFactory::GetCurrentBlitter()->NeedsAnimationBuffer()) {
+ this->anim_buffer = OpenGLBackend::Get()->GetAnimBuffer();
+ }
return OpenGLBackend::Get()->GetVideoBuffer();
}
void VideoDriver_Win32OpenGL::ReleaseVideoPointer()
{
+ if (this->anim_buffer != nullptr) OpenGLBackend::Get()->ReleaseAnimBuffer(this->dirty_rect);
OpenGLBackend::Get()->ReleaseVideoBuffer(this->dirty_rect);
this->dirty_rect = {};
_screen.dst_ptr = nullptr;
+ this->anim_buffer = nullptr;
}
void VideoDriver_Win32OpenGL::Paint()