Browse Source

Fixed screenshot distortion bug

Thomas Buck 10 years ago
parent
commit
965a9ef47d
4 changed files with 11 additions and 5 deletions
  1. 1
    0
      ChangeLog.md
  2. 0
    5
      TODO.md
  3. 5
    0
      src/system/WindowGLFW.cpp
  4. 5
    0
      src/system/WindowSDL.cpp

+ 1
- 0
ChangeLog.md View File

@@ -8,6 +8,7 @@
8 8
     * Added support for Room Sprites displaying.
9 9
     * Can now toggle display of Room geometry, models and sprites.
10 10
     * Room list is now displayed in reverse. This _fixes_ some transparency issues.
11
+    * Fixed a bug that sometimes caused distorted Screenshots.
11 12
 
12 13
     [ 20140111 ]
13 14
     * Enabled back face culling --> triangles now oriented correctly

+ 0
- 5
TODO.md View File

@@ -6,11 +6,6 @@
6 6
 * Don’t depend on setup: no data or config files should be necessary
7 7
 * Be able to change configuration from within OpenRaider
8 8
 
9
-## Bugs
10
-
11
-* Screenshots are sometimes distorted?
12
-    * Seems to happen if OpenRaider.ini sets a resolution larger than the window can be
13
-
14 9
 ## Cmake
15 10
 
16 11
 * Support SSE with other compilers than Clang (src/CMakeLists.txt)

+ 5
- 0
src/system/WindowGLFW.cpp View File

@@ -51,6 +51,11 @@ int WindowGLFW::initialize() {
51 51
     glfwSetMouseButtonCallback(window, WindowGLFW::buttonCallback);
52 52
     glfwSetScrollCallback(window, WindowGLFW::scrollCallback);
53 53
 
54
+    int w = size.x, h = size.y;
55
+    glfwGetWindowSize(window, &w, &h);
56
+    size.x = w;
57
+    size.y = h;
58
+
54 59
     return 0;
55 60
 }
56 61
 

+ 5
- 0
src/system/WindowSDL.cpp View File

@@ -55,6 +55,11 @@ int WindowSDL::initialize() {
55 55
         return -3;
56 56
     }
57 57
 
58
+    int w = size.x, h = size.y;
59
+    SDL_GetWindowSize(window, &w, &h);
60
+    size.x = w;
61
+    size.y = h;
62
+
58 63
     context = SDL_GL_CreateContext(window);
59 64
     if (!context) {
60 65
         Log::get(LOG_ERROR) << "SDL_GL_CreateContext Error: " << SDL_GetError() << Log::endl;

Loading…
Cancel
Save