aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2016-03-05 01:20:48 +0100
committerJohannes Schickel2016-03-16 20:29:31 +0100
commitb7a269947f9b5e40e4baa36d763e5c04551f584c (patch)
treee9e0384f89286a24332c1029543c9e2b2fd4648e
parent17b1124a5aa294d39cf3a3c6fc6561f835affe2d (diff)
downloadscummvm-rg350-b7a269947f9b5e40e4baa36d763e5c04551f584c.tar.gz
scummvm-rg350-b7a269947f9b5e40e4baa36d763e5c04551f584c.tar.bz2
scummvm-rg350-b7a269947f9b5e40e4baa36d763e5c04551f584c.zip
OPENGL: Flag texture dirty on allocation.
-rw-r--r--backends/graphics/opengl/texture.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
index 5252b5a32d..8b94549971 100644
--- a/backends/graphics/opengl/texture.cpp
+++ b/backends/graphics/opengl/texture.cpp
@@ -266,6 +266,12 @@ void Texture::allocate(uint width, uint height) {
// Create a sub-buffer for raw access.
_userPixelData = _textureData.getSubArea(Common::Rect(width, height));
+
+ // The whole texture is dirty after we changed the size. This fixes
+ // multiple texture size changes without any actual update in between.
+ // Without this we might try to write a too big texture into the GL
+ // texture.
+ flagDirty();
}
void Texture::updateGLTexture() {
@@ -561,6 +567,12 @@ void TextureCLUT8GPU::allocate(uint width, uint height) {
_clut8Vertices[6] = width;
_clut8Vertices[7] = height;
+
+ // The whole texture is dirty after we changed the size. This fixes
+ // multiple texture size changes without any actual update in between.
+ // Without this we might try to write a too big texture into the GL
+ // texture.
+ flagDirty();
}
Graphics::PixelFormat TextureCLUT8GPU::getFormat() const {