aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Bénony2015-12-11 14:41:30 +0100
committerVincent Bénony2016-01-06 16:17:38 +0100
commit71b2fa9b49f2f492448c2b2f351fceaa8ff4d34f (patch)
treecb030b35993061aaa7af2f42e3d0aa0aafd1ab29
parentc99456ecff9ae645385ea5a8aa423d0115dce08e (diff)
downloadscummvm-rg350-71b2fa9b49f2f492448c2b2f351fceaa8ff4d34f.tar.gz
scummvm-rg350-71b2fa9b49f2f492448c2b2f351fceaa8ff4d34f.tar.bz2
scummvm-rg350-71b2fa9b49f2f492448c2b2f351fceaa8ff4d34f.zip
IOS: Fixes an issue with the mouse pointer when returning from Sam&Max
-rw-r--r--backends/platform/ios7/ios7_video.mm10
1 files changed, 4 insertions, 6 deletions
diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm
index 300ab044a7..3a3feafcf8 100644
--- a/backends/platform/ios7/ios7_video.mm
+++ b/backends/platform/ios7/ios7_video.mm
@@ -304,6 +304,8 @@ uint getSizeNextPOT(uint size) {
glEnableVertexAttribArray(_positionSlot);
glEnableVertexAttribArray(_textureCoordSlot);
+
+ glUniform1i(_textureSlot, 0); printOpenGLError();
}
- (void)deleteShaders {
@@ -610,12 +612,11 @@ uint getSizeNextPOT(uint size) {
- (void)updateMouseCursor {
[self updateMouseCursorScaling];
- _mouseCoords[1].u = _mouseCoords[3].u = _videoContext.mouseWidth / (GLfloat)_videoContext.mouseTexture.w;
- _mouseCoords[2].v = _mouseCoords[3].v = _videoContext.mouseHeight / (GLfloat)_videoContext.mouseTexture.h;
+ _mouseCoords[1].u = _mouseCoords[3].u = (_videoContext.mouseWidth - 1) / (GLfloat)_videoContext.mouseTexture.w;
+ _mouseCoords[2].v = _mouseCoords[3].v = (_videoContext.mouseHeight - 1) / (GLfloat)_videoContext.mouseTexture.h;
[self setFilterModeForTexture:_mouseCursorTexture];
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _videoContext.mouseTexture.w, _videoContext.mouseTexture.h, 0, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, _videoContext.mouseTexture.getPixels()); printOpenGLError();
- glUniform1i(_textureSlot, 0); printOpenGLError();
}
- (void)updateMainSurface {
@@ -624,7 +625,6 @@ uint getSizeNextPOT(uint size) {
glVertexAttribPointer(_textureCoordSlot, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), (GLvoid *) (sizeof(GLfloat) * 2));
[self setFilterModeForTexture:_screenTexture];
- glUniform1i(_textureSlot, 0); printOpenGLError();
// Unfortunately we have to update the whole texture every frame, since glTexSubImage2D is actually slower in all cases
// due to the iPhone internals having to convert the whole texture back from its internal format when used.
@@ -669,7 +669,6 @@ uint getSizeNextPOT(uint size) {
glVertexAttribPointer(_textureCoordSlot, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), (GLvoid *) (sizeof(GLfloat) * 2));
[self setFilterModeForTexture:_overlayTexture];
- glUniform1i(_textureSlot, 0); printOpenGLError();
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _videoContext.overlayTexture.w, _videoContext.overlayTexture.h, 0, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, _videoContext.overlayTexture.getPixels()); printOpenGLError();
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); printOpenGLError();
@@ -681,7 +680,6 @@ uint getSizeNextPOT(uint size) {
glVertexAttribPointer(_textureCoordSlot, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), (GLvoid *) (sizeof(GLfloat) * 2));
glBindTexture(GL_TEXTURE_2D, _mouseCursorTexture); printOpenGLError();
- glUniform1i(_textureSlot, 0); printOpenGLError();
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); printOpenGLError();
}