Browse Source

Fixed wireframe background color

Thomas Buck 9 years ago
parent
commit
65be6f0114
5 changed files with 14 additions and 14 deletions
  1. 3
    0
      ChangeLog.md
  2. 9
    11
      src/Render.cpp
  3. 0
    1
      src/TextureManager.cpp
  4. 1
    1
      src/Window.cpp
  5. 1
    1
      src/loader/LoaderTR2.cpp

+ 3
- 0
ChangeLog.md View File

2
 
2
 
3
 ## OpenRaider (0.1.3) xythobuz <xythobuz@xythobuz.de>
3
 ## OpenRaider (0.1.3) xythobuz <xythobuz@xythobuz.de>
4
 
4
 
5
+    [ 20141116 ]
6
+    * Fixed background color of wireframe mode
7
+
5
     [ 20141110 ]
8
     [ 20141110 ]
6
     * Added [Binspector](https://github.com/binspector/binspector) binary file format template
9
     * Added [Binspector](https://github.com/binspector/binspector) binary file format template
7
       that can be used to parse and analyze TR2 and TR3 script files.
10
       that can be used to parse and analyze TR2 and TR3 script files.

+ 9
- 11
src/Render.cpp View File

167
             break;
167
             break;
168
         case Render::modeSolid:
168
         case Render::modeSolid:
169
         case Render::modeWireframe:
169
         case Render::modeWireframe:
170
-            glClearColor(PURPLE[0] * 256.0f, PURPLE[1] * 256.0f,
171
-                         PURPLE[2] * 256.0f, PURPLE[3] * 256.0f);
170
+            glClearColor(PURPLE[0] / 256.0f, PURPLE[1] / 256.0f,
171
+                    PURPLE[2] / 256.0f, PURPLE[3] / 256.0f);
172
             glDisable(GL_TEXTURE_2D);
172
             glDisable(GL_TEXTURE_2D);
173
             break;
173
             break;
174
         default:
174
         default:
178
                 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
178
                 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
179
             }
179
             }
180
 
180
 
181
-            glClearColor(BLACK[0], BLACK[1], BLACK[2], BLACK[3]);
181
+            glClearColor(BLACK[0] / 256.0f, BLACK[1] / 256.0f,
182
+                    BLACK[2] / 256.0f, BLACK[3] / 256.0f);
182
 
183
 
183
             glEnable(GL_TEXTURE_2D);
184
             glEnable(GL_TEXTURE_2D);
184
     }
185
     }
378
 }
379
 }
379
 
380
 
380
 void Render::newRoomRenderList(int index) {
381
 void Render::newRoomRenderList(int index) {
382
+    assert(index >= 0);
383
+
381
     static int currentRoomId = -1;
384
     static int currentRoomId = -1;
382
 
385
 
383
-    if (index == -1) { // -1 is error, so draw room 0, for the hell of it
384
-        mRoomRenderList.clear();
385
-        mRoomRenderList.push_back(&getWorld().getRoom(0));
386
-    } else {
387
-        // Update room render list if needed
388
-        if (currentRoomId != index) {
389
-            buildRoomRenderList(getWorld().getRoom(index));
390
-        }
386
+    // Update room render list if needed
387
+    if (currentRoomId != index) {
388
+        buildRoomRenderList(getWorld().getRoom(index));
391
     }
389
     }
392
 
390
 
393
     currentRoomId = index;
391
     currentRoomId = index;

+ 0
- 1
src/TextureManager.cpp View File

157
     }
157
     }
158
 
158
 
159
     glColor3ubv(WHITE);
159
     glColor3ubv(WHITE);
160
-    glClearColor(0.0, 0.0, 0.0, 0.0);
161
     glEnable(GL_DEPTH_TEST);
160
     glEnable(GL_DEPTH_TEST);
162
     glShadeModel(GL_SMOOTH);
161
     glShadeModel(GL_SMOOTH);
163
 
162
 

+ 1
- 1
src/Window.cpp View File

40
     //glCullFace(GL_FRONT);
40
     //glCullFace(GL_FRONT);
41
 
41
 
42
     // Set background to black
42
     // Set background to black
43
-    glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
43
+    glClearColor(BLACK[0] / 256.0f, BLACK[1] / 256.0f, BLACK[2] / 256.0f, BLACK[3] / 256.0f);
44
 
44
 
45
     // Disable lighting
45
     // Disable lighting
46
     glDisable(GL_LIGHTING);
46
     glDisable(GL_LIGHTING);

+ 1
- 1
src/loader/LoaderTR2.cpp View File

387
         uint16_t mesh = file.readU16(); // Offset into MeshPointers[]
387
         uint16_t mesh = file.readU16(); // Offset into MeshPointers[]
388
 
388
 
389
         // tr2_vertex BoundingBox[2][2];
389
         // tr2_vertex BoundingBox[2][2];
390
-        // // First index is which one, second index is opposite corners
390
+        // First index is which one, second index is opposite corners
391
         int16_t x11 = file.read16();
391
         int16_t x11 = file.read16();
392
         int16_t y11 = file.read16();
392
         int16_t y11 = file.read16();
393
         int16_t z11 = file.read16();
393
         int16_t z11 = file.read16();

Loading…
Cancel
Save