From 905ec1104e60ed9bb2d6f3b5964e7b9a3307249e Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Mon, 2 Aug 2010 03:17:12 +0000 Subject: OPENGL: Save last fullscreen mode size to config file. svn-id: r51604 --- backends/graphics/openglsdl/openglsdl-graphics.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'backends/graphics/openglsdl') diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index ff9132a8d1..8aeae8117f 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -47,7 +47,12 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager() // Get desktop resolution const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo(); if (videoInfo->current_w > 0 && videoInfo->current_h > 0) - _desktopAspectRatio = videoInfo->current_w * 10000 / videoInfo->current_h; + _desktopAspectRatio = videoInfo->current_w * 10000 / videoInfo->current_h; + + if (ConfMan.hasKey("last_fullscreen_mode_width") && ConfMan.hasKey("last_fullscreen_mode_height")) { + _lastFullscreenModeWidth = ConfMan.getInt("last_fullscreen_mode_width"); + _lastFullscreenModeHeight = ConfMan.getInt("last_fullscreen_mode_height"); + } } OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() { @@ -360,6 +365,8 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() { if (_videoMode.fullscreen) { _lastFullscreenModeWidth = _videoMode.hardwareWidth; _lastFullscreenModeHeight = _videoMode.hardwareHeight; + ConfMan.setInt("last_fullscreen_mode_width", _lastFullscreenModeWidth); + ConfMan.setInt("last_fullscreen_mode_height", _lastFullscreenModeHeight); } // Call and return parent implementation of this method -- cgit v1.2.3