Browse Source

Fixed screenshot distortion bug

Thomas Buck 9 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
     * Added support for Room Sprites displaying.
8
     * Added support for Room Sprites displaying.
9
     * Can now toggle display of Room geometry, models and sprites.
9
     * Can now toggle display of Room geometry, models and sprites.
10
     * Room list is now displayed in reverse. This _fixes_ some transparency issues.
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
     [ 20140111 ]
13
     [ 20140111 ]
13
     * Enabled back face culling --> triangles now oriented correctly
14
     * Enabled back face culling --> triangles now oriented correctly

+ 0
- 5
TODO.md View File

6
 * Don’t depend on setup: no data or config files should be necessary
6
 * Don’t depend on setup: no data or config files should be necessary
7
 * Be able to change configuration from within OpenRaider
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
 ## Cmake
9
 ## Cmake
15
 
10
 
16
 * Support SSE with other compilers than Clang (src/CMakeLists.txt)
11
 * Support SSE with other compilers than Clang (src/CMakeLists.txt)

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

51
     glfwSetMouseButtonCallback(window, WindowGLFW::buttonCallback);
51
     glfwSetMouseButtonCallback(window, WindowGLFW::buttonCallback);
52
     glfwSetScrollCallback(window, WindowGLFW::scrollCallback);
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
     return 0;
59
     return 0;
55
 }
60
 }
56
 
61
 

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

55
         return -3;
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
     context = SDL_GL_CreateContext(window);
63
     context = SDL_GL_CreateContext(window);
59
     if (!context) {
64
     if (!context) {
60
         Log::get(LOG_ERROR) << "SDL_GL_CreateContext Error: " << SDL_GetError() << Log::endl;
65
         Log::get(LOG_ERROR) << "SDL_GL_CreateContext Error: " << SDL_GetError() << Log::endl;

Loading…
Cancel
Save