From 602d3034a97517ecdaabde14a8b4928ddb3b9303 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:37 +0100 Subject: OPENGL: Release old texture name before creating a new one. This prevents any texture name leaks (and thus memory leaks) on recreateInternalTexture calls. --- backends/graphics/opengl/texture.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp index 8f17ed7eeb..dff483dc0d 100644 --- a/backends/graphics/opengl/texture.cpp +++ b/backends/graphics/opengl/texture.cpp @@ -65,6 +65,9 @@ void Texture::releaseInternalTexture() { } void Texture::recreateInternalTexture() { + // Release old texture name in case it exists. + releaseInternalTexture(); + // Get a new texture name. GLCALL(glGenTextures(1, &_glTexture)); -- cgit v1.2.3 From 8be41e4f2ce353a97a2d41bee78cc99ca12b619a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:37 +0100 Subject: OPENGL: Add notification function about context destruction. --- backends/graphics/opengl/opengl-graphics.cpp | 20 ++++++++++++++++++++ backends/graphics/opengl/opengl-graphics.h | 8 ++++++++ 2 files changed, 28 insertions(+) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index a97f680f15..3b92acc505 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -881,6 +881,26 @@ void OpenGLGraphicsManager::notifyContextChange(const Graphics::PixelFormat &def #endif } +void OpenGLGraphicsManager::notifyContextDestroy() { + if (_gameScreen) { + _gameScreen->releaseInternalTexture(); + } + + if (_overlay) { + _overlay->releaseInternalTexture(); + } + + if (_cursor) { + _cursor->releaseInternalTexture(); + } + +#ifdef USE_OSD + if (_osd) { + _osd->releaseInternalTexture(); + } +#endif +} + void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) { if (_overlayVisible) { // It might be confusing that we actually have to handle something diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 93c0c5bc83..8d53dbe062 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -136,6 +136,14 @@ protected: */ void notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha); + /** + * Notify the manager that the OpenGL context is about to be destroyed. + * This will free up/reset internal OpenGL related state and *must* be + * called whenever a context might be created again after destroying a + * context. + */ + void notifyContextDestroy(); + /** * Adjust the physical mouse coordinates according to the currently visible screen. */ -- cgit v1.2.3 From b5ca9f5f108ffd46a514656630c7ea9824a035ce Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:37 +0100 Subject: OPENGLSDL: Notify OpenGL manager about context destruction. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'backends/graphics') diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 3f9fc1fbd5..70190b4c63 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -308,6 +308,14 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { flags |= SDL_RESIZABLE; } + if (_hwScreen) { + // When a video mode has been setup already we notify the manager that + // the context is about to be destroyed. + // We do this because on Windows SDL_SetVideoMode can destroy and + // recreate the OpenGL context. + notifyContextDestroy(); + } + _hwScreen = SDL_SetVideoMode(width, height, 32, flags); if (!_hwScreen) { -- cgit v1.2.3 From 006356848407065bbe26488cffe0b0a927fdbb9a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:37 +0100 Subject: OPENGL: Rename notifyContextChange to notifyContextCreate. --- backends/graphics/opengl/opengl-graphics.cpp | 2 +- backends/graphics/opengl/opengl-graphics.h | 4 ++-- backends/graphics/openglsdl/openglsdl-graphics.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 3b92acc505..adae8cdd0a 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -816,7 +816,7 @@ void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) { ++_screenChangeID; } -void OpenGLGraphicsManager::notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha) { +void OpenGLGraphicsManager::notifyContextCreate(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha) { // Initialize all extensions. initializeGLExtensions(); diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 8d53dbe062..0512a65746 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -127,14 +127,14 @@ protected: /** * Notify the manager of a OpenGL context change. This should be the first - * thing to call when you create an OpenGL (ES) context! + * thing to call after you created an OpenGL (ES) context! * * @param defaultFormat The new default format for the game screen * (this is used for the CLUT8 game screens). * @param defaultFromatAlpha The new default format with an alpha channel * (this is used for the overlay and cursor). */ - void notifyContextChange(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha); + void notifyContextCreate(const Graphics::PixelFormat &defaultFormat, const Graphics::PixelFormat &defaultFormatAlpha); /** * Notify the manager that the OpenGL context is about to be destroyed. diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 70190b4c63..6df67d0c1d 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -328,7 +328,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { if (_hwScreen) { const Graphics::PixelFormat rgba8888 = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); - notifyContextChange(rgba8888, rgba8888); + notifyContextCreate(rgba8888, rgba8888); setActualScreenSize(_hwScreen->w, _hwScreen->h); } -- cgit v1.2.3 From 1f4638fe823d87ca6b45a79779aff9712e06ec58 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:38 +0100 Subject: OPENGL: Refactor texture instantiation. --- backends/graphics/opengl/opengl-graphics.cpp | 77 ++++++++++++++-------------- backends/graphics/opengl/opengl-graphics.h | 8 +++ 2 files changed, 47 insertions(+), 38 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index adae8cdd0a..c60069f6df 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -265,21 +265,15 @@ OSystem::TransactionError OpenGLGraphicsManager::endGFXTransaction() { delete _gameScreen; _gameScreen = nullptr; - GLenum glIntFormat, glFormat, glType; #ifdef USE_RGB_COLOR - if (_currentState.gameFormat.bytesPerPixel == 1) { + _gameScreen = createTexture(_currentState.gameFormat); +#else + _gameScreen = createTexture(Graphics::PixelFormat::createFormatCLUT8()); #endif - const bool supported = getGLPixelFormat(_defaultFormat, glIntFormat, glFormat, glType); - assert(supported); - _gameScreen = new TextureCLUT8(glIntFormat, glFormat, glType, _defaultFormat); + assert(_gameScreen); + if (_gameScreen->hasPalette()) { _gameScreen->setPalette(0, 255, _gamePalette); -#ifdef USE_RGB_COLOR - } else { - const bool supported = getGLPixelFormat(_currentState.gameFormat, glIntFormat, glFormat, glType); - assert(supported); - _gameScreen = new Texture(glIntFormat, glFormat, glType, _currentState.gameFormat); } -#endif _gameScreen->allocate(_currentState.gameWidth, _currentState.gameHeight); _gameScreen->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR); @@ -566,27 +560,19 @@ void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int GLenum glIntFormat, glFormat, glType; - if (inputFormat.bytesPerPixel == 1) { - // In case this is not supported this is a serious programming - // error and the assert a bit below will trigger! - const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType); - assert(supported); - _cursor = new TextureCLUT8(glIntFormat, glFormat, glType, _defaultFormatAlpha); + Graphics::PixelFormat textureFormat; + if (inputFormat.bytesPerPixel == 1 || (inputFormat.aBits() && getGLPixelFormat(inputFormat, glIntFormat, glFormat, glType))) { + // There is two cases when we can use the cursor format directly. + // The first is when it's CLUT8, here color key handling can + // always be applied because we use the alpha channel of + // _defaultFormatAlpha for that. + // The other is when the input format has alpha bits and + // furthermore is directly supported. + textureFormat = inputFormat; } else { - // Try to use the format specified as input directly. We can only - // do so when it actually has alpha bits. - if (inputFormat.aBits() != 0 && getGLPixelFormat(inputFormat, glIntFormat, glFormat, glType)) { - _cursor = new Texture(glIntFormat, glFormat, glType, inputFormat); - } - - // Otherwise fall back to the default alpha format. - if (!_cursor) { - const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType); - assert(supported); - _cursor = new Texture(glIntFormat, glFormat, glType, _defaultFormatAlpha); - } + textureFormat = _defaultFormatAlpha; } - + _cursor = createTexture(textureFormat); assert(_cursor); _cursor->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR); } @@ -778,10 +764,8 @@ void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) { delete _overlay; _overlay = nullptr; - GLenum glIntFormat, glFormat, glType; - const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType); - assert(supported); - _overlay = new Texture(glIntFormat, glFormat, glType, _defaultFormatAlpha); + _overlay = createTexture(_defaultFormatAlpha); + assert(_overlay); // We always filter the overlay with GL_LINEAR. This assures it's // readable in case it needs to be scaled and does not affect it // otherwise. @@ -795,10 +779,8 @@ void OpenGLGraphicsManager::setActualScreenSize(uint width, uint height) { delete _osd; _osd = nullptr; - GLenum glIntFormat, glFormat, glType; - const bool supported = getGLPixelFormat(_defaultFormatAlpha, glIntFormat, glFormat, glType); - assert(supported); - _osd = new Texture(glIntFormat, glFormat, glType, _defaultFormatAlpha); + _osd = createTexture(_defaultFormatAlpha); + assert(_osd); // We always filter the osd with GL_LINEAR. This assures it's // readable in case it needs to be scaled and does not affect it // otherwise. @@ -929,6 +911,25 @@ void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) { } } +Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &format) { + GLenum glIntFormat, glFormat, glType; + if (format.bytesPerPixel == 1) { + const bool supported = getGLPixelFormat(_defaultFormat, glIntFormat, glFormat, glType); + if (!supported) { + return nullptr; + } else { + return new TextureCLUT8(glIntFormat, glFormat, glType, _defaultFormat); + } + } else { + const bool supported = getGLPixelFormat(format, glIntFormat, glFormat, glType); + if (!supported) { + return nullptr; + } else { + return new Texture(glIntFormat, glFormat, glType, format); + } + } +} + bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const { if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888 glIntFormat = GL_RGBA; diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 0512a65746..5d80968089 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -171,6 +171,14 @@ protected: virtual void setInternalMousePosition(int x, int y) = 0; private: + /** + * Create a texture with the specified pixel format. + * + * @param format The pixel format the Texture object should accept as input. + * @return A pointer to the texture or nullptr on failure. + */ + Texture *createTexture(const Graphics::PixelFormat &format); + // // Transaction support // -- cgit v1.2.3 From 16898486fa28cb428183d94552f2c9884a718c9f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 11:07:38 +0100 Subject: OPENGL: Properly setup full game palette on video mode change if required. --- backends/graphics/opengl/opengl-graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index c60069f6df..3321689366 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -272,7 +272,7 @@ OSystem::TransactionError OpenGLGraphicsManager::endGFXTransaction() { #endif assert(_gameScreen); if (_gameScreen->hasPalette()) { - _gameScreen->setPalette(0, 255, _gamePalette); + _gameScreen->setPalette(0, 256, _gamePalette); } _gameScreen->allocate(_currentState.gameWidth, _currentState.gameHeight); -- cgit v1.2.3 From abcadb5d8728fdc18bf544d8b40418880fa1a145 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 11 Feb 2014 12:19:30 +0100 Subject: OPENGL: Fix cursor regression when defaultFormat doesn't have an alpha channel. --- backends/graphics/opengl/opengl-graphics.cpp | 9 +++++---- backends/graphics/opengl/opengl-graphics.h | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 3321689366..925b2c5a82 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -572,7 +572,7 @@ void OpenGLGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int } else { textureFormat = _defaultFormatAlpha; } - _cursor = createTexture(textureFormat); + _cursor = createTexture(textureFormat, true); assert(_cursor); _cursor->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR); } @@ -911,14 +911,15 @@ void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) { } } -Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &format) { +Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &format, bool wantAlpha) { GLenum glIntFormat, glFormat, glType; if (format.bytesPerPixel == 1) { - const bool supported = getGLPixelFormat(_defaultFormat, glIntFormat, glFormat, glType); + const Graphics::PixelFormat &virtFormat = wantAlpha ? _defaultFormatAlpha : _defaultFormat; + const bool supported = getGLPixelFormat(virtFormat, glIntFormat, glFormat, glType); if (!supported) { return nullptr; } else { - return new TextureCLUT8(glIntFormat, glFormat, glType, _defaultFormat); + return new TextureCLUT8(glIntFormat, glFormat, glType, virtFormat); } } else { const bool supported = getGLPixelFormat(format, glIntFormat, glFormat, glType); diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 5d80968089..6b13db8558 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -174,10 +174,13 @@ private: /** * Create a texture with the specified pixel format. * - * @param format The pixel format the Texture object should accept as input. + * @param format The pixel format the Texture object should accept as + * input. + * @param wantAlpha For CLUT8 textures this marks whether an alpha + * channel should be used. * @return A pointer to the texture or nullptr on failure. */ - Texture *createTexture(const Graphics::PixelFormat &format); + Texture *createTexture(const Graphics::PixelFormat &format, bool wantAlpha = false); // // Transaction support -- cgit v1.2.3 From ddc70ed9ee635ee71e08b7b3bce0211198f01be5 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 17:15:07 +0100 Subject: OPENGL: Properly use signed types for cursor hotspot. --- backends/graphics/opengl/opengl-graphics.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 6b13db8558..46fd687666 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -396,12 +396,12 @@ private: /** * The X offset for the cursor hotspot in unscaled coordinates. */ - uint _cursorHotspotX; + int _cursorHotspotX; /** * The Y offset for the cursor hotspot in unscaled coordinates. */ - uint _cursorHotspotY; + int _cursorHotspotY; /** * Recalculate the cursor scaling. Scaling is always done according to @@ -412,12 +412,12 @@ private: /** * The X offset for the cursor hotspot in scaled coordinates. */ - uint _cursorHotspotXScaled; + int _cursorHotspotXScaled; /** * The Y offset for the cursor hotspot in scaled coordinates. */ - uint _cursorHotspotYScaled; + int _cursorHotspotYScaled; /** * The width of the cursor scaled coordinates. -- cgit v1.2.3 From 49dcd36e72889b3edb67ce098af7cb854e499cb8 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 17:15:07 +0100 Subject: OPENGL: Use signed types for mouse coordinates. This adjusts for the fact that our event handling also uses signed coordinates. --- backends/graphics/opengl/opengl-graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 46fd687666..d16f92d148 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -386,12 +386,12 @@ private: /** * X coordinate of the cursor in phyiscal coordinates. */ - uint _cursorX; + int _cursorX; /** * Y coordinate of the cursor in physical coordinates. */ - uint _cursorY; + int _cursorY; /** * The X offset for the cursor hotspot in unscaled coordinates. -- cgit v1.2.3 From 1709486859db9c38f5e4287e3e7fa817f76c1ee7 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 17:15:07 +0100 Subject: OPENGL: Use GLfloat for draw cooridnates in Texture. --- backends/graphics/opengl/texture.cpp | 14 +++++++------- backends/graphics/opengl/texture.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp index dff483dc0d..7b0b22d630 100644 --- a/backends/graphics/opengl/texture.cpp +++ b/backends/graphics/opengl/texture.cpp @@ -166,7 +166,7 @@ void Texture::fill(uint32 color) { flagDirty(); } -void Texture::draw(GLuint x, GLuint y, GLuint w, GLuint h) { +void Texture::draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h) { // Only do any processing when the Texture is initialized. if (!_textureData.getPixels()) { return; @@ -190,13 +190,13 @@ void Texture::draw(GLuint x, GLuint y, GLuint w, GLuint h) { GLCALL(glTexCoordPointer(2, GL_FLOAT, 0, texcoords)); // Calculate the screen rect where the texture will be drawn. - const GLshort vertices[4*2] = { - (GLshort)x, (GLshort)y, - (GLshort)(x + w), (GLshort)y, - (GLshort)x, (GLshort)(y + h), - (GLshort)(x + w), (GLshort)(y + h) + const GLfloat vertices[4*2] = { + x, y, + x + w, y, + x, y + h, + x + w, y + h }; - GLCALL(glVertexPointer(2, GL_SHORT, 0, vertices)); + GLCALL(glVertexPointer(2, GL_FLOAT, 0, vertices)); // Draw the texture to the screen buffer. GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)); diff --git a/backends/graphics/opengl/texture.h b/backends/graphics/opengl/texture.h index e28d980de4..ad70833544 100644 --- a/backends/graphics/opengl/texture.h +++ b/backends/graphics/opengl/texture.h @@ -79,7 +79,7 @@ public: void fill(uint32 color); - void draw(GLuint x, GLuint y, GLuint w, GLuint h); + void draw(GLfloat x, GLfloat y, GLfloat w, GLfloat h); void flagDirty() { _allDirty = true; } bool isDirty() const { return _allDirty || !_dirtyArea.isEmpty(); } -- cgit v1.2.3 From 6576dd758bfaf078abfb430d4b9c99b7047e4308 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 17:15:07 +0100 Subject: OPENGL: Simplify shake offset application. --- backends/graphics/opengl/opengl-graphics.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 925b2c5a82..a0651f2eb1 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -353,15 +353,7 @@ void OpenGLGraphicsManager::updateScreen() { const GLfloat shakeOffset = _gameScreenShakeOffset * (GLfloat)_displayHeight / _gameScreen->getHeight(); // First step: Draw the (virtual) game screen. - glPushMatrix(); - - // Adjust game screen shake position - GLCALL(glTranslatef(0, shakeOffset, 0)); - - // Draw the game screen - _gameScreen->draw(_displayX, _displayY, _displayWidth, _displayHeight); - - glPopMatrix(); + _gameScreen->draw(_displayX, _displayY + shakeOffset, _displayWidth, _displayHeight); // Second step: Draw the overlay if visible. if (_overlayVisible) { @@ -370,18 +362,12 @@ void OpenGLGraphicsManager::updateScreen() { // Third step: Draw the cursor if visible. if (_cursorVisible && _cursor) { - glPushMatrix(); - // Adjust game screen shake position, but only when the overlay is not // visible. - if (!_overlayVisible) { - GLCALL(glTranslatef(0, shakeOffset, 0)); - } + const GLfloat cursorOffset = _overlayVisible ? 0 : shakeOffset; - _cursor->draw(_cursorX - _cursorHotspotXScaled, _cursorY - _cursorHotspotYScaled, + _cursor->draw(_cursorX - _cursorHotspotXScaled, _cursorY - _cursorHotspotYScaled + cursorOffset, _cursorWidthScaled, _cursorHeightScaled); - - glPopMatrix(); } #ifdef USE_OSD -- cgit v1.2.3 From ac5907a8046cd7ab66e43ac7e7e2d39863984917 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 17:15:07 +0100 Subject: OPENGL: Use frac_t for cursor scaling. --- backends/graphics/opengl/opengl-graphics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index a0651f2eb1..dfba14abe6 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -1072,14 +1072,14 @@ void OpenGLGraphicsManager::recalculateCursorScaling() { // In case scaling is actually enabled we will scale the cursor according // to the game screen. if (!_cursorDontScale) { - const uint screenScaleFactorX = _displayWidth * 10000 / _gameScreen->getWidth(); - const uint screenScaleFactorY = _displayHeight * 10000 / _gameScreen->getHeight(); + const frac_t screenScaleFactorX = intToFrac(_displayWidth) / _gameScreen->getWidth(); + const frac_t screenScaleFactorY = intToFrac(_displayHeight) / _gameScreen->getHeight(); - _cursorHotspotXScaled = (_cursorHotspotXScaled * screenScaleFactorX) / 10000; - _cursorWidthScaled = (_cursorWidthScaled * screenScaleFactorX) / 10000; + _cursorHotspotXScaled = fracToInt(_cursorHotspotXScaled * screenScaleFactorX); + _cursorWidthScaled = fracToInt(_cursorWidthScaled * screenScaleFactorX); - _cursorHotspotYScaled = (_cursorHotspotYScaled * screenScaleFactorY) / 10000; - _cursorHeightScaled = (_cursorHeightScaled * screenScaleFactorY) / 10000; + _cursorHotspotYScaled = fracToInt(_cursorHotspotYScaled * screenScaleFactorY); + _cursorHeightScaled = fracToInt(_cursorHeightScaled * screenScaleFactorY); } } -- cgit v1.2.3 From 2cab30ee80a7611945ac5e9260c63d6b86f658cf Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 18:06:29 +0100 Subject: OPENGL: Move RGBA8888 (logical layout) to OpenGL specific formats. The reason here is that GL_UNSIGNED_INT_8_8_8_8 is not supported by the GLES standard. Thus we cannot use it outside OpenGL specific code paths. --- backends/graphics/opengl/opengl-graphics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index dfba14abe6..d7d37a2025 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -918,12 +918,7 @@ Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &forma } bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const { - if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888 - glIntFormat = GL_RGBA; - glFormat = GL_RGBA; - glType = GL_UNSIGNED_INT_8_8_8_8; - return true; - } else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565 + if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565 glIntFormat = GL_RGB; glFormat = GL_RGB; glType = GL_UNSIGNED_SHORT_5_6_5; @@ -939,6 +934,11 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF glType = GL_UNSIGNED_SHORT_4_4_4_4; return true; #ifndef USE_GLES + } else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888 + glIntFormat = GL_RGBA; + glFormat = GL_RGBA; + glType = GL_UNSIGNED_INT_8_8_8_8; + return true; } else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555 // GL_BGRA does not exist in every GLES implementation so should not be configured if // USE_GLES is set. -- cgit v1.2.3 From 5d78542ab8c6a76e266a453b8590bf6bbd70b631 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 18:06:29 +0100 Subject: OPENGL: Always support RGBA8888 (memory layout). --- backends/graphics/opengl/opengl-graphics.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index d7d37a2025..0a034128fe 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -918,7 +918,16 @@ Texture *OpenGLGraphicsManager::createTexture(const Graphics::PixelFormat &forma } bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelFormat, GLenum &glIntFormat, GLenum &glFormat, GLenum &glType) const { - if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565 +#ifdef SCUMM_LITTLE_ENDIAN + if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888 +#else + if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888 +#endif + glIntFormat = GL_RGBA; + glFormat = GL_RGBA; + glType = GL_UNSIGNED_BYTE; + return true; + } else if (pixelFormat == Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)) { // RGB565 glIntFormat = GL_RGB; glFormat = GL_RGB; glType = GL_UNSIGNED_SHORT_5_6_5; @@ -934,11 +943,13 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF glType = GL_UNSIGNED_SHORT_4_4_4_4; return true; #ifndef USE_GLES +#ifdef SCUMM_LITTLE_ENDIAN } else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)) { // RGBA8888 glIntFormat = GL_RGBA; glFormat = GL_RGBA; glType = GL_UNSIGNED_INT_8_8_8_8; return true; +#endif } else if (pixelFormat == Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)) { // RGB555 // GL_BGRA does not exist in every GLES implementation so should not be configured if // USE_GLES is set. @@ -956,11 +967,13 @@ bool OpenGLGraphicsManager::getGLPixelFormat(const Graphics::PixelFormat &pixelF glFormat = GL_BGRA; glType = GL_UNSIGNED_SHORT_4_4_4_4_REV; return true; +#ifdef SCUMM_BIG_ENDIAN } else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)) { // ABGR8888 glIntFormat = GL_RGBA; glFormat = GL_RGBA; glType = GL_UNSIGNED_INT_8_8_8_8_REV; return true; +#endif } else if (pixelFormat == Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0)) { // BGRA8888 glIntFormat = GL_RGBA; glFormat = GL_BGRA; -- cgit v1.2.3 From 5883f4cc3fe5861c314afedb00c692f31f1a1124 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 12 Feb 2014 18:06:29 +0100 Subject: OPENGL/SDL: Default to RGBA8888 (memory layout). This makes sure the default mode also works for OpenGL ES contexts. --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'backends/graphics') diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index 6df67d0c1d..9540a19e9e 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -158,8 +158,18 @@ void OpenGLSdlGraphicsManager::resetGraphicsScale() { Common::List OpenGLSdlGraphicsManager::getSupportedFormats() const { Common::List formats; + // Our default mode is (memory layout wise) RGBA8888 which is a different + // logical layout depending on the endianness. We chose this mode because + // it is the only 32bit color mode we can safely assume to be present in + // OpenGL and OpenGL ES implementations. Thus, we need to supply different + // logical formats based on endianness. +#ifdef SCUMM_LITTLE_ENDIAN + // ABGR8888 + formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)); +#else // RGBA8888 formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)); +#endif // RGB565 formats.push_back(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)); // RGBA5551 @@ -168,6 +178,13 @@ Common::List OpenGLSdlGraphicsManager::getSupportedFormat formats.push_back(Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0)); #ifndef USE_GLES +#ifdef SCUMM_LITTLE_ENDIAN + // RGBA8888 + formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)); +#else + // ABGR8888 + formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)); +#endif // ARGB8888, this should not be here, but Sword25 requires it. :-/ formats.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24)); @@ -327,7 +344,17 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) { } if (_hwScreen) { - const Graphics::PixelFormat rgba8888 = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); + // This is pretty confusing since RGBA8888 talks about the memory + // layout here. This is a different logical layout depending on + // whether we run on little endian or big endian. However, we can + // only safely assume that RGBA8888 in memory layout is supported. + // Thus, we chose this one. + const Graphics::PixelFormat rgba8888 = +#ifdef SCUMM_LITTLE_ENDIAN + Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24); +#else + Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); +#endif notifyContextCreate(rgba8888, rgba8888); setActualScreenSize(_hwScreen->w, _hwScreen->h); } -- cgit v1.2.3 From 121687d2ed7811c6805a11b17e295d7e9517b9c6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:18 +0100 Subject: BACKENDS: Make GPL headers consistent in themselves. --- backends/graphics/default-palette.h | 4 ++-- backends/graphics/graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/default-palette.h b/backends/graphics/default-palette.h index 8f3fcb2db1..a66e1862b7 100644 --- a/backends/graphics/default-palette.h +++ b/backends/graphics/default-palette.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h index 24397228e6..3671b9f0b9 100644 --- a/backends/graphics/graphics.h +++ b/backends/graphics/graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 7803ce2fa40d55fec3814306eabf2b91473d3d16 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:19 +0100 Subject: DINGUX: Make GPL headers consistent in themselves. --- backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 4 ++-- backends/graphics/dinguxsdl/dinguxsdl-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index bd87c9fafd..343efa4da6 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h index ecdd01d166..fc70e721cf 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 96564e95b4293b460685168d089be51d4a52490e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:20 +0100 Subject: GPH: Make GPL headers consistent in themselves. --- backends/graphics/gph/gph-graphics.cpp | 4 ++-- backends/graphics/gph/gph-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index 92553564bf..247e5ed490 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h index f1f3d18b41..4a68ea6eed 100644 --- a/backends/graphics/gph/gph-graphics.h +++ b/backends/graphics/gph/gph-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 872b5fdf415b72685b2db2910924defd618f28c9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:22 +0100 Subject: LINUXMOTO: Make GPL headers consistent in themselves. --- backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp | 4 ++-- backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp index a005d74919..22b271ae1a 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h index ee2a566d71..8760c5004d 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 4f34f44fbf1e08c95c68b7902ff815aebe3a30f4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:22 +0100 Subject: MAEMO: Make GPL headers consistent in themselves. --- backends/graphics/maemosdl/maemosdl-graphics.cpp | 4 ++-- backends/graphics/maemosdl/maemosdl-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/maemosdl/maemosdl-graphics.cpp b/backends/graphics/maemosdl/maemosdl-graphics.cpp index 527ef82b9d..07d6d32d3a 100644 --- a/backends/graphics/maemosdl/maemosdl-graphics.cpp +++ b/backends/graphics/maemosdl/maemosdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/maemosdl/maemosdl-graphics.h b/backends/graphics/maemosdl/maemosdl-graphics.h index 81064d2d5f..c255e94653 100644 --- a/backends/graphics/maemosdl/maemosdl-graphics.h +++ b/backends/graphics/maemosdl/maemosdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 56528d9201d9da2b422d4421641ce92bc27e3db8 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:23 +0100 Subject: NULL: Make GPL headers consistent in themselves. --- backends/graphics/null/null-graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/null/null-graphics.h b/backends/graphics/null/null-graphics.h index 276be7d3fa..67306c29f3 100644 --- a/backends/graphics/null/null-graphics.h +++ b/backends/graphics/null/null-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From cc2f3e23a4b21b562240c747cedaae4d77d8d9e5 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:23 +0100 Subject: OPENPANDORA: Make GPL headers consistent in themselves. --- backends/graphics/openpandora/op-graphics.cpp | 4 ++-- backends/graphics/openpandora/op-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp index f371081fde..1ded1614de 100644 --- a/backends/graphics/openpandora/op-graphics.cpp +++ b/backends/graphics/openpandora/op-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h index 2e3d63e3ad..8b498d632b 100644 --- a/backends/graphics/openpandora/op-graphics.h +++ b/backends/graphics/openpandora/op-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From a3d012357ef54972f4814d0995cef3815e6a7b4b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:24 +0100 Subject: SAMSUNGTV: Make GPL headers consistent in themselves. --- backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp | 4 ++-- backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp index 95e0875f55..3603d8a861 100644 --- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp +++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h index 2d0ff636f4..15ba3dca48 100644 --- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h +++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 63304ee9ec4bf37cc96949f32f5c8dd53a6d3cc4 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:24 +0100 Subject: SDL: Make GPL headers consistent in themselves. --- backends/graphics/sdl/sdl-graphics.cpp | 4 ++-- backends/graphics/sdl/sdl-graphics.h | 4 ++-- backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 4 ++-- backends/graphics/surfacesdl/surfacesdl-graphics.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 40b97b267b..b5e49fa397 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h index 3791961cfa..3ef540708a 100644 --- a/backends/graphics/sdl/sdl-graphics.h +++ b/backends/graphics/sdl/sdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index b3af08e2e8..7f3c99fcea 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h index 22b7780675..49bd66b3e5 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.h +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 1b5c324811c06b1128883ada7763f1f14c85afd8 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:25 +0100 Subject: SYMBIAN: Make GPL headers consistent in themselves. --- backends/graphics/symbiansdl/symbiansdl-graphics.cpp | 4 ++-- backends/graphics/symbiansdl/symbiansdl-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp index 5fe8b19887..e339fecd1c 100644 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp +++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h index 73e810a629..f514db286c 100644 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.h +++ b/backends/graphics/symbiansdl/symbiansdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 224cec46a7d8de2c2744c492e42e4cbdf9a8272a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:27 +0100 Subject: WINCE: Make GPL headers consistent in themselves. --- backends/graphics/wincesdl/wincesdl-graphics.cpp | 4 ++-- backends/graphics/wincesdl/wincesdl-graphics.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'backends/graphics') diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp index f075f8cf8a..8e4685dbd8 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.cpp +++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h index 2897ca5f40..50b422c10d 100644 --- a/backends/graphics/wincesdl/wincesdl-graphics.h +++ b/backends/graphics/wincesdl/wincesdl-graphics.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From da57eeeeb2548bd872b8b8fe7f3be040382b3b9b Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Tue, 25 Feb 2014 00:09:16 +0100 Subject: OPENGL: Fix building with --disable-16bit --- backends/graphics/opengl/opengl-graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/graphics') diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 0a034128fe..cbd06e9161 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -278,11 +278,15 @@ OSystem::TransactionError OpenGLGraphicsManager::endGFXTransaction() { _gameScreen->allocate(_currentState.gameWidth, _currentState.gameHeight); _gameScreen->enableLinearFiltering(_currentState.graphicsMode == GFX_LINEAR); // We fill the screen to all black or index 0 for CLUT8. +#ifdef USE_RGB_COLOR if (_currentState.gameFormat.bytesPerPixel == 1) { _gameScreen->fill(0); } else { _gameScreen->fill(_gameScreen->getSurface()->format.RGBToColor(0, 0, 0)); } +#else + _gameScreen->fill(0); +#endif } // Update our display area and cursor scaling. This makes sure we pick up -- cgit v1.2.3