Quellcode durchsuchen

Fixed wireframe background color

Thomas Buck vor 9 Jahren
Ursprung
Commit
65be6f0114
5 geänderte Dateien mit 14 neuen und 14 gelöschten Zeilen
  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 Datei anzeigen

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

+ 9
- 11
src/Render.cpp Datei anzeigen

@@ -167,8 +167,8 @@ void Render::setMode(int n) {
167 167
             break;
168 168
         case Render::modeSolid:
169 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 172
             glDisable(GL_TEXTURE_2D);
173 173
             break;
174 174
         default:
@@ -178,7 +178,8 @@ void Render::setMode(int n) {
178 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 184
             glEnable(GL_TEXTURE_2D);
184 185
     }
@@ -378,16 +379,13 @@ void Render::drawLoadScreen() {
378 379
 }
379 380
 
380 381
 void Render::newRoomRenderList(int index) {
382
+    assert(index >= 0);
383
+
381 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 391
     currentRoomId = index;

+ 0
- 1
src/TextureManager.cpp Datei anzeigen

@@ -157,7 +157,6 @@ int TextureManager::loadBufferSlot(unsigned char* image,
157 157
     }
158 158
 
159 159
     glColor3ubv(WHITE);
160
-    glClearColor(0.0, 0.0, 0.0, 0.0);
161 160
     glEnable(GL_DEPTH_TEST);
162 161
     glShadeModel(GL_SMOOTH);
163 162
 

+ 1
- 1
src/Window.cpp Datei anzeigen

@@ -40,7 +40,7 @@ int Window::initializeGL() {
40 40
     //glCullFace(GL_FRONT);
41 41
 
42 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 45
     // Disable lighting
46 46
     glDisable(GL_LIGHTING);

+ 1
- 1
src/loader/LoaderTR2.cpp Datei anzeigen

@@ -387,7 +387,7 @@ void LoaderTR2::loadStaticMeshes() {
387 387
         uint16_t mesh = file.readU16(); // Offset into MeshPointers[]
388 388
 
389 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 391
         int16_t x11 = file.read16();
392 392
         int16_t y11 = file.read16();
393 393
         int16_t z11 = file.read16();

Laden…
Abbrechen
Speichern