Browse Source

Reenabled some warnings

Thomas Buck 10 years ago
parent
commit
afda40b282
12 changed files with 40 additions and 71 deletions
  1. 1
    0
      ChangeLog
  2. 4
    5
      Makefile
  3. 3
    3
      include/TombRaider1.h
  4. 0
    2
      src/Camera.cpp
  5. 4
    4
      src/Mesh.cpp
  6. 3
    1
      src/Network.cpp
  7. 12
    14
      src/OpenRaider.cpp
  8. 1
    1
      src/Render.cpp
  9. 6
    33
      src/TombRaider.cpp
  10. 0
    1
      src/World.cpp
  11. 4
    5
      test/GLString.cpp
  12. 2
    2
      test/TombRaider.cpp

+ 1
- 0
ChangeLog View File

@@ -12,6 +12,7 @@
12 12
 	* The menu map list can now be stepped per folder with the
13 13
 	  right and left arrows.
14 14
 	* Methods wrapping printf-style functions now get compiler warnings
15
+	* Reenabled some warnings and fixed them
15 16
 
16 17
 	[ 20140216 ]
17 18
 	* Removed the FastCard option. Not necessary on todays hardware?!

+ 4
- 5
Makefile View File

@@ -79,11 +79,10 @@ INSTALL_INCLUDE=$(DESTDIR)/usr/include
79 79
 ###############################################################
80 80
 CC=gcc
81 81
 WARNINGS=-Weverything -Wno-padded -Wno-packed
82
-WARNINGS+=-Wno-documentation-unknown-command
83
-WARNINGS+=-Wno-covered-switch-default -Wno-global-constructors
84
-WARNINGS+=-Wno-exit-time-destructors -Wno-c++98-compat-pedantic
85
-WARNINGS+=-Wno-disabled-macro-expansion -Wno-missing-variable-declarations
86
-WARNINGS+=-Wno-missing-prototypes -Wno-pedantic
82
+WARNINGS+=-Wno-global-constructors -Wno-exit-time-destructors
83
+WARNINGS+=-Wno-documentation-unknown-command -Wno-c++98-compat-pedantic
84
+WARNINGS+=-Wno-missing-prototypes -Wno-missing-variable-declarations
85
+WARNINGS+=-Wno-disabled-macro-expansion
87 86
 
88 87
 WARNINGS+=-Wno-shorten-64-to-32 -Wno-sign-conversion
89 88
 

+ 3
- 3
include/TombRaider1.h View File

@@ -155,7 +155,7 @@ public:
155 155
         RaptorState_JumpBite  = 4,
156 156
         RaptorState_Bellowing = 6,
157 157
         RaptorState_RunBellow = 7,
158
-        RaptorState_Biting    = 8,
158
+        RaptorState_Biting    = 8
159 159
     };
160 160
 
161 161
     /*!
@@ -281,7 +281,7 @@ public:
281 281
         WingedNatlaState_Dying1    = 5, //!< "Dying" the first time
282 282
         WingedNatlaState_Spinning  = 7, //!< Spinning around in air
283 283
         WingedNatlaState_Standing2 = 8,
284
-        WingedNatlaState_Dying2    = 9, //!< Dying for real
284
+        WingedNatlaState_Dying2    = 9  //!< Dying for real
285 285
     };
286 286
 
287 287
     /*!
@@ -452,7 +452,7 @@ public:
452 452
     enum MotorboatStates {
453 453
         MotorboatState_StationaryInitial = 1,
454 454
         MotorboatState_Moving            = 2,
455
-        MotorboatState_StationaryFinal   = 3,
455
+        MotorboatState_StationaryFinal   = 3
456 456
     };
457 457
 
458 458
     /*!

+ 0
- 2
src/Camera.cpp View File

@@ -280,8 +280,6 @@ void Camera::command(enum camera_command cmd)
280 280
             if (--mTranslateDelta < 0.0f)
281 281
                 mTranslateDelta = 1.0f;
282 282
             break;
283
-        default:
284
-            ;
285 283
     }
286 284
 }
287 285
 

+ 4
- 4
src/Mesh.cpp View File

@@ -169,11 +169,11 @@ void Mesh::drawAlpha()
169 169
                 // Bind WHITE texture for solid colors
170 170
                 glBindTexture(GL_TEXTURE_2D, 0);
171 171
                 break;
172
-            default:
173 172
             case MeshModeTexture:
174 173
             case MeshModeMultiTexture:
175 174
                 // Bind texture id for textures
176 175
                 glBindTexture(GL_TEXTURE_2D, mQuads[i].texture+1);
176
+                break;
177 177
         }
178 178
 
179 179
         glBegin(GL_QUADS);
@@ -206,11 +206,11 @@ void Mesh::drawAlpha()
206 206
                 // Bind WHITE texture for solid colors
207 207
                 glBindTexture(GL_TEXTURE_2D, 0);
208 208
                 break;
209
-            default:
210 209
             case MeshModeTexture:
211 210
             case MeshModeMultiTexture:
212 211
                 // Bind texture id for textures
213 212
                 glBindTexture(GL_TEXTURE_2D, mTris[i].texture+1);
213
+                break;
214 214
         }
215 215
 
216 216
         glBegin(GL_TRIANGLES);
@@ -298,11 +298,11 @@ void Mesh::drawSolid()
298 298
 #else
299 299
             case MeshModeMultiTexture:
300 300
 #endif
301
-            default:
302 301
             case MeshModeTexture:
303 302
                 // Bind texture id for textures
304 303
                 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
305 304
                 glBindTexture(GL_TEXTURE_2D, mQuads[i].texture+1);
305
+                break;
306 306
         }
307 307
 
308 308
         glBegin(GL_QUADS);
@@ -359,11 +359,11 @@ void Mesh::drawSolid()
359 359
 #else
360 360
             case MeshModeMultiTexture:
361 361
 #endif
362
-            default:
363 362
             case MeshModeTexture:
364 363
                 // Bind texture id for textures
365 364
                 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
366 365
                 glBindTexture(GL_TEXTURE_2D, mTris[i].texture+1);
366
+                break;
367 367
         }
368 368
 
369 369
         glBegin(GL_TRIANGLES);

+ 3
- 1
src/Network.cpp View File

@@ -591,7 +591,9 @@ void Network::runClient()
591 591
 
592 592
             if (!f.data.send)
593 593
             {
594
-                const struct timespec tmp = {.tv_sec = 0, .tv_nsec = 20000};
594
+                struct timespec tmp;
595
+                tmp.tv_sec = 0;
596
+                tmp.tv_nsec = 20000;
595 597
                 nanosleep(&tmp, NULL);
596 598
                 continue;
597 599
             }

+ 12
- 14
src/OpenRaider.cpp View File

@@ -345,10 +345,10 @@ void OpenRaider::handleMouseMotionEvent(float x, float y)
345 345
                 case worldMoveType_noClipping:
346 346
                     eventAnimTest(TR_ANIAMTION_SWIM_R);
347 347
                     break;
348
-                default:
349 348
                 case worldMoveType_walk:
350 349
                 case worldMoveType_walkNoSwim:
351 350
                     eventAnimTest(TR_ANIAMTION_TURN_L); // TURN left always for now
351
+                    break;
352 352
             }
353 353
 
354 354
             LARA->moving = true;
@@ -368,10 +368,10 @@ void OpenRaider::handleMouseMotionEvent(float x, float y)
368 368
                 case worldMoveType_noClipping:
369 369
                     eventAnimTest(TR_ANIAMTION_SWIM_L);
370 370
                     break;
371
-                default:
372 371
                 case worldMoveType_walk:
373 372
                 case worldMoveType_walkNoSwim:
374 373
                     eventAnimTest(TR_ANIAMTION_TURN_L);
374
+                    break;
375 375
             }
376 376
 
377 377
             LARA->moving = true;
@@ -430,10 +430,10 @@ void OpenRaider::handleBoundKeyPressEvent(unsigned int key)
430 430
                     case worldMoveType_noClipping:
431 431
                         eventAnimTest(TR_ANIAMTION_SWIM);
432 432
                         break;
433
-                    default:
434 433
                     case worldMoveType_walk:
435 434
                     case worldMoveType_walkNoSwim:
436 435
                         eventAnimTest(TR_ANIAMTION_RUN);
436
+                        break;
437 437
                 }
438 438
             }
439 439
             else if (LARA)
@@ -445,10 +445,10 @@ void OpenRaider::handleBoundKeyPressEvent(unsigned int key)
445 445
                     case worldMoveType_noClipping:
446 446
                         eventAnimTest(TR_ANIAMTION_SWIM_IDLE);
447 447
                         break;
448
-                    default:
449 448
                     case worldMoveType_walk:
450 449
                     case worldMoveType_walkNoSwim:
451 450
                         eventAnimTest(TR_ANIAMTION_HIT_WALL_FRONT);
451
+                        break;
452 452
                 }
453 453
             }
454 454
             else
@@ -468,10 +468,10 @@ void OpenRaider::handleBoundKeyPressEvent(unsigned int key)
468 468
                     case worldMoveType_noClipping:
469 469
                         eventAnimTest(TR_ANIAMTION_SWIM);
470 470
                         break;
471
-                    default:
472 471
                     case worldMoveType_walk:
473 472
                     case worldMoveType_walkNoSwim:
474 473
                         eventAnimTest(TR_ANIAMTION_RUN);
474
+                        break;
475 475
                 }
476 476
             }
477 477
             break;
@@ -487,10 +487,10 @@ void OpenRaider::handleBoundKeyPressEvent(unsigned int key)
487 487
                     case worldMoveType_noClipping:
488 488
                         eventAnimTest(TR_ANIAMTION_SWIM);
489 489
                         break;
490
-                    default:
491 490
                     case worldMoveType_walk:
492 491
                     case worldMoveType_walkNoSwim:
493 492
                         eventAnimTest(TR_ANIAMTION_RUN);
493
+                        break;
494 494
                 }
495 495
             }
496 496
             else if (!LARA)
@@ -510,10 +510,10 @@ void OpenRaider::handleBoundKeyPressEvent(unsigned int key)
510 510
                     case worldMoveType_noClipping:
511 511
                         eventAnimTest(TR_ANIAMTION_SWIM);
512 512
                         break;
513
-                    default:
514 513
                     case worldMoveType_walk:
515 514
                     case worldMoveType_walkNoSwim:
516 515
                         eventAnimTest(TR_ANIAMTION_RUN);
516
+                        break;
517 517
                 }
518 518
             }
519 519
             else if (!LARA)
@@ -1114,12 +1114,11 @@ void OpenRaider::loadLevel(char *mapname)
1114 1114
 
1115 1115
                 m_tombraider.loadSFX(altSfx);
1116 1116
                 break;
1117
-            default:
1118 1117
             case TR_VERSION_1:
1119 1118
             case TR_VERSION_4:
1120 1119
             case TR_VERSION_5:
1121 1120
             case TR_VERSION_UNKNOWN:
1122
-                ;
1121
+                break;
1123 1122
         }
1124 1123
     }
1125 1124
 
@@ -1263,10 +1262,10 @@ void OpenRaider::gameFrame()
1263 1262
                     case worldMoveType_noClipping:
1264 1263
                         eventAnimTest(TR_ANIAMTION_SWIM_IDLE);
1265 1264
                         break;
1266
-                    default:
1267 1265
                     case worldMoveType_walk:
1268 1266
                     case worldMoveType_walkNoSwim:
1269 1267
                         eventAnimTest(TR_ANIAMTION_STAND);
1268
+                        break;
1270 1269
                 }
1271 1270
 
1272 1271
                 LARA->moving = false;
@@ -1572,12 +1571,11 @@ void OpenRaider::processMoveables()
1572 1571
                                 break;
1573 1572
                         }
1574 1573
                         break;
1575
-                    default:
1576 1574
                     case TR_VERSION_2:
1577 1575
                     case TR_VERSION_3:
1578 1576
                     case TR_VERSION_5:
1579 1577
                     case TR_VERSION_UNKNOWN:
1580
-                        ;
1578
+                        break;
1581 1579
                 }
1582 1580
         }
1583 1581
     }
@@ -1691,7 +1689,6 @@ void OpenRaider::processMoveable(int index, int i, int *ent,
1691 1689
                 // Only TR4 lara has 2 layer bone tags/meshes per bone frame
1692 1690
                 r_model->tr4Overlay = true;
1693 1691
                 break;
1694
-            default:
1695 1692
             case TR_VERSION_1:
1696 1693
             case TR_VERSION_2:
1697 1694
             case TR_VERSION_5:
@@ -1700,6 +1697,7 @@ void OpenRaider::processMoveable(int index, int i, int *ent,
1700 1697
                 sModel->setAnimation(TR_ANIAMTION_RUN);
1701 1698
                 sModel->setIdleAnimation(TR_ANIAMTION_STAND);
1702 1699
                 r_model->tr4Overlay = false;
1700
+                break;
1703 1701
         }
1704 1702
 
1705 1703
         r_model->ponytailId = 0;
@@ -1782,7 +1780,6 @@ void OpenRaider::processMoveable(int index, int i, int *ent,
1782 1780
                     print(true, "Found known ponytail\n");
1783 1781
                 }
1784 1782
                 break; // ?
1785
-            default:
1786 1783
             case TR_VERSION_1:
1787 1784
             case TR_VERSION_2:
1788 1785
             case TR_VERSION_3:
@@ -1804,6 +1801,7 @@ void OpenRaider::processMoveable(int index, int i, int *ent,
1804 1801
                     m_render.setFlags(Render::fRenderPonytail);
1805 1802
                     print(true, "Found ponytail?\n");
1806 1803
                 }
1804
+                break;
1807 1805
         }
1808 1806
     }
1809 1807
     else

+ 1
- 1
src/Render.cpp View File

@@ -743,10 +743,10 @@ void Render::Display()
743 743
             case worldMoveType_swim:
744 744
                 camOffsetH = 64.0f;
745 745
                 break;
746
-            default:
747 746
             case worldMoveType_walk:
748 747
             case worldMoveType_walkNoSwim:
749 748
                 camOffsetH = 512.0f;
749
+                break;
750 750
         }
751 751
 
752 752
         curPos[0] = LARA->pos[0];

+ 6
- 33
src/TombRaider.cpp View File

@@ -1951,7 +1951,6 @@ int TombRaider::Load(char *filename, void (*percent)(int))
1951 1951
         case TR_VERSION_3:
1952 1952
         case TR_VERSION_5:
1953 1953
         case TR_VERSION_UNKNOWN:
1954
-        default:
1955 1954
             //! \fixme (Endian) Read bit32 / int32_t
1956 1955
             Fread(&mNumSampleIndices, 4, 1, f);
1957 1956
             printDebug("Load", "mNumSampleIndices = %i", mNumSampleIndices);
@@ -2126,11 +2125,11 @@ void TombRaider::getColor(int index, float color[4])
2126 2125
         case TR_VERSION_4:
2127 2126
         case TR_VERSION_5:
2128 2127
         case TR_VERSION_UNKNOWN:
2129
-        default:
2130 2128
             color[0] = (float)(_palette16[index] & 0xff) / 256.0f;
2131 2129
             color[1] = (float)((_palette16[index] >> 8) & 0xff) / 256.0f;
2132 2130
             color[2] = (float)((_palette16[index] >> 16) & 0xff) / 256.0f;
2133 2131
             color[3] = 1.0;
2132
+            break;
2134 2133
     }
2135 2134
 }
2136 2135
 
@@ -2206,8 +2205,8 @@ void TombRaider::getMeshColoredRectangle(unsigned int meshIndex,
2206 2205
         case TR_VERSION_4:
2207 2206
         case TR_VERSION_5:
2208 2207
         case TR_VERSION_UNKNOWN:
2209
-        default:
2210 2208
             getColor((mMeshes[meshIndex].coloured_rectangles[faceIndex].texture>>8) & 0xff, color);
2209
+            break;
2211 2210
     }
2212 2211
 }
2213 2212
 
@@ -2237,9 +2236,9 @@ void TombRaider::getMeshColoredTriangle(unsigned int meshIndex,
2237 2236
         case TR_VERSION_4:
2238 2237
         case TR_VERSION_5:
2239 2238
         case TR_VERSION_UNKNOWN:
2240
-        default:
2241 2239
             getColor((mMeshes[meshIndex].coloured_triangles[faceIndex].texture>>8) & 0xff,
2242 2240
                     color);
2241
+            break;
2243 2242
     }
2244 2243
 }
2245 2244
 
@@ -2486,7 +2485,6 @@ void TombRaider::getMeshVertexArrays(unsigned int meshIndex,
2486 2485
                 case TR_VERSION_2:
2487 2486
                 case TR_VERSION_5:
2488 2487
                 case TR_VERSION_UNKNOWN:
2489
-                default:
2490 2488
                     colorValue = (1.0f - (colorValue / 8192.0f));
2491 2489
                     break;
2492 2490
             }
@@ -2515,7 +2513,6 @@ int TombRaider::getRoomBox(unsigned int roomIndex, unsigned int index,
2515 2513
     switch (getEngine())
2516 2514
     {
2517 2515
         case TR_VERSION_UNKNOWN:
2518
-        default:
2519 2516
             break;
2520 2517
 
2521 2518
         case TR_VERSION_1:
@@ -2552,7 +2549,6 @@ unsigned int TombRaider::getRoomBoxCount(unsigned int roomIndex)
2552 2549
     switch (getEngine())
2553 2550
     {
2554 2551
         case TR_VERSION_UNKNOWN:
2555
-        default:
2556 2552
             break;
2557 2553
         case TR_VERSION_1:
2558 2554
         case TR_VERSION_2:
@@ -2845,7 +2841,6 @@ unsigned int TombRaider::getRoomLightCount(unsigned int roomIndex)
2845 2841
         case TR_VERSION_2:
2846 2842
         case TR_VERSION_3:
2847 2843
         case TR_VERSION_4:
2848
-        default:
2849 2844
             return _rooms[roomIndex].num_lights;
2850 2845
     }
2851 2846
 
@@ -2865,7 +2860,6 @@ int TombRaider::getRoomModel(unsigned int roomIndex, unsigned int index,
2865 2860
     switch (getEngine())
2866 2861
     {
2867 2862
         case TR_VERSION_UNKNOWN:
2868
-        default:
2869 2863
             return -1;
2870 2864
         case TR_VERSION_5:
2871 2865
             count = NumStaticMeshes();
@@ -2921,7 +2915,6 @@ unsigned int TombRaider::getRoomModelCount(unsigned int roomIndex)
2921 2915
     switch (getEngine())
2922 2916
     {
2923 2917
         case TR_VERSION_UNKNOWN:
2924
-        default:
2925 2918
             break;
2926 2919
         case TR_VERSION_5:
2927 2920
             return mRoomsTR5[roomIndex].numStaticMeshes;
@@ -2946,7 +2939,6 @@ int TombRaider::getRoomPortal(unsigned int roomIndex, unsigned int index,
2946 2939
     switch (getEngine())
2947 2940
     {
2948 2941
         case TR_VERSION_UNKNOWN:
2949
-        default:
2950 2942
             break;
2951 2943
         case TR_VERSION_5:
2952 2944
             *adjoiningRoom = mRoomsTR5[roomIndex].doors[index].adjoining_room;
@@ -3004,7 +2996,6 @@ unsigned int TombRaider::getRoomPortalCount(unsigned int roomIndex)
3004 2996
     switch (getEngine())
3005 2997
     {
3006 2998
         case TR_VERSION_UNKNOWN:
3007
-        default:
3008 2999
             break;
3009 3000
         case TR_VERSION_5:
3010 3001
             return mRoomsTR5[roomIndex].numDoors;
@@ -3032,7 +3023,6 @@ void TombRaider::getRoomRectangle(unsigned int roomIndex,
3032 3023
     switch (getEngine())
3033 3024
     {
3034 3025
         case TR_VERSION_UNKNOWN:
3035
-        default:
3036 3026
             break;
3037 3027
         case TR_VERSION_5:
3038 3028
             for (i = 0, count = 0; i < mRoomsTR5[roomIndex].numLayers; ++i)
@@ -3105,7 +3095,6 @@ unsigned int TombRaider::getRoomRectangleCount(unsigned int roomIndex)
3105 3095
     switch (getEngine())
3106 3096
     {
3107 3097
         case TR_VERSION_UNKNOWN:
3108
-        default:
3109 3098
             break;
3110 3099
         case TR_VERSION_5:
3111 3100
             for (i = 0, count = 0; i < mRoomsTR5[roomIndex].numLayers; ++i)
@@ -3145,7 +3134,6 @@ int TombRaider::getRoomSector(unsigned int roomIndex, unsigned int index,
3145 3134
     switch (getEngine())
3146 3135
     {
3147 3136
         case TR_VERSION_UNKNOWN:
3148
-        default:
3149 3137
             break;
3150 3138
         case TR_VERSION_5:
3151 3139
             *floorDataIndex = mRoomsTR5[roomIndex].sectors[index].fd_index;
@@ -3213,7 +3201,6 @@ unsigned int TombRaider::getRoomSectorCount(unsigned int roomIndex,
3213 3201
     switch (getEngine())
3214 3202
     {
3215 3203
         case TR_VERSION_UNKNOWN:
3216
-        default:
3217 3204
             break;
3218 3205
         case TR_VERSION_5:
3219 3206
             // width of sector list
@@ -3389,7 +3376,6 @@ unsigned int TombRaider::getRoomSpriteCount(unsigned int roomIndex)
3389 3376
     switch (getEngine())
3390 3377
     {
3391 3378
         case TR_VERSION_UNKNOWN:
3392
-        default:
3393 3379
             break;
3394 3380
         case TR_VERSION_5:
3395 3381
             return 0; // No room sprites in TRC
@@ -3417,7 +3403,6 @@ void TombRaider::getRoomTriangle(unsigned int roomIndex,
3417 3403
     switch (getEngine())
3418 3404
     {
3419 3405
         case TR_VERSION_UNKNOWN:
3420
-        default:
3421 3406
             break;
3422 3407
         case TR_VERSION_5:
3423 3408
             for (i = 0, count = 0; i < mRoomsTR5[roomIndex].numLayers; ++i)
@@ -3495,7 +3480,6 @@ void TombRaider::getRoomTriangles(unsigned int index, int textureOffset,
3495 3480
     switch (getEngine())
3496 3481
     {
3497 3482
         case TR_VERSION_UNKNOWN:
3498
-        default:
3499 3483
             break;
3500 3484
         case TR_VERSION_5:
3501 3485
             for (i = 0, count = 0; i < mRoomsTR5[index].numLayers; ++i)
@@ -3566,7 +3550,6 @@ unsigned int TombRaider::getRoomTriangleCount(unsigned int roomIndex)
3566 3550
     switch (getEngine())
3567 3551
     {
3568 3552
         case TR_VERSION_UNKNOWN:
3569
-        default:
3570 3553
             break;
3571 3554
         case TR_VERSION_5:
3572 3555
             for (i = 0, count = 0; i < mRoomsTR5[roomIndex].numLayers; ++i)
@@ -3607,7 +3590,6 @@ void TombRaider::getRoomVertex(unsigned int roomIndex,unsigned int vertexIndex,
3607 3590
         case TR_VERSION_3:
3608 3591
         case TR_VERSION_4:
3609 3592
         case TR_VERSION_UNKNOWN:
3610
-        default:
3611 3593
             vertex = &_rooms[index].room_data.vertices[i].vertex;
3612 3594
 
3613 3595
             xyz[0] = vertex->x;
@@ -3641,7 +3623,6 @@ void TombRaider::getRoomVertex(unsigned int roomIndex,unsigned int vertexIndex,
3641 3623
                 case TR_VERSION_2:
3642 3624
                 case TR_VERSION_5: // Not really...
3643 3625
                 case TR_VERSION_UNKNOWN:
3644
-                default:
3645 3626
                     color_value = _rooms[index].room_data.vertices[i].lighting1;
3646 3627
                     color_value = (1.1f - (color_value / 8192.0f));
3647 3628
 
@@ -3690,7 +3671,6 @@ void TombRaider::getRoomVertexArrays(unsigned int roomIndex,
3690 3671
     switch (getEngine())
3691 3672
     {
3692 3673
         case TR_VERSION_UNKNOWN:
3693
-        default:
3694 3674
             break;
3695 3675
         case TR_VERSION_5:
3696 3676
             *vertexCount = count;
@@ -3758,7 +3738,6 @@ void TombRaider::getRoomVertexArrays(unsigned int roomIndex,
3758 3738
                     case TR_VERSION_2:
3759 3739
                     case TR_VERSION_5:
3760 3740
                     case TR_VERSION_UNKNOWN:
3761
-                    default:
3762 3741
                         color_value = _rooms[roomIndex].room_data.vertices[i].lighting1;
3763 3742
                         color_value = (1.1f - (color_value / 8192.0f));
3764 3743
                 }
@@ -3783,7 +3762,6 @@ void TombRaider::getRoomVertexArrays(unsigned int roomIndex,
3783 3762
                     case TR_VERSION_2:
3784 3763
                     case TR_VERSION_5:
3785 3764
                     case TR_VERSION_UNKNOWN:
3786
-                    default:
3787 3765
                         rgba[0] = color_value;
3788 3766
                         rgba[1] = color_value;
3789 3767
                         rgba[2] = color_value;
@@ -3819,7 +3797,6 @@ unsigned int TombRaider::getRoomVertexCount(unsigned int roomIndex)
3819 3797
     switch (getEngine())
3820 3798
     {
3821 3799
         case TR_VERSION_UNKNOWN:
3822
-        default:
3823 3800
             break;
3824 3801
         case TR_VERSION_5:
3825 3802
             for (i = 0, count = 0; i < mRoomsTR5[roomIndex].numLayers; ++i)
@@ -3865,7 +3842,6 @@ int TombRaider::getSkyModelId()
3865 3842
         case TR_VERSION_1:
3866 3843
         case TR_VERSION_5:
3867 3844
         case TR_VERSION_UNKNOWN:
3868
-        default:
3869 3845
             return -1;
3870 3846
     }
3871 3847
 
@@ -4063,8 +4039,7 @@ void TombRaider::getSoundSample(unsigned int index,
4063 4039
             getRiffDataTR4(index, bytes, data);
4064 4040
             break;
4065 4041
         case TR_VERSION_UNKNOWN:
4066
-        default:
4067
-            ;
4042
+            break;
4068 4043
     }
4069 4044
 }
4070 4045
 
@@ -4091,8 +4066,8 @@ unsigned int TombRaider::getSoundSamplesCount()
4091 4066
             count = mNumTR4Samples;
4092 4067
             break;
4093 4068
         case TR_VERSION_UNKNOWN:
4094
-        default:
4095 4069
             count = 0;
4070
+            break;
4096 4071
     }
4097 4072
 
4098 4073
     return count;
@@ -4117,7 +4092,6 @@ bool TombRaider::isRoomValid(int index)
4117 4092
     switch (getEngine())
4118 4093
     {
4119 4094
         case TR_VERSION_UNKNOWN:
4120
-        default:
4121 4095
             break;
4122 4096
         case TR_VERSION_5:
4123 4097
             if (index < _num_rooms &&
@@ -5068,8 +5042,7 @@ unsigned char *TombRaider::getTexTile(int texture)
5068 5042
             case TR_VERSION_2:
5069 5043
             case TR_VERSION_5:
5070 5044
             case TR_VERSION_UNKNOWN:
5071
-            default:
5072
-                ;
5045
+                break;
5073 5046
         }
5074 5047
     }
5075 5048
 

+ 0
- 1
src/World.cpp View File

@@ -421,7 +421,6 @@ void World::moveEntity(entity_t *e, char movement)
421 421
         case worldMoveType_noClipping:
422 422
         case worldMoveType_fly:
423 423
         case worldMoveType_swim:
424
-        default:
425 424
             pitch = e->angles[2];
426 425
             break;
427 426
     }

+ 4
- 5
test/GLString.cpp View File

@@ -101,7 +101,6 @@ void init_gl() {
101 101
 
102 102
 void init_text() {
103 103
     int i;
104
-    const char *errorText = "TEXT->glPrintf> ERROR code %i\n";
105 104
 
106 105
     // Mongoose 2002.01.01, Texture setup
107 106
     gTexture.reset();
@@ -113,20 +112,20 @@ void init_text() {
113 112
     TEXT->Init(4);
114 113
     i = TEXT->glPrintf(50, 50, "OpenRaider GLString");
115 114
     if (i) {
116
-        printf(errorText, i);
115
+        printf("TEXT->glPrintf> ERROR code %i\n", i);
117 116
     }
118 117
     i = TEXT->glPrintf(50, 100, "Unit Test by Mongoose");
119 118
     if (i) {
120
-        printf(errorText, i);
119
+        printf("TEXT->glPrintf> ERROR code %i\n", i);
121 120
     }
122 121
     TEXT->Scale(1.2f);
123 122
     i = TEXT->glPrintf(50, 150, "ported to SDL2 & TTF");
124 123
     if (i) {
125
-        printf(errorText, i);
124
+        printf("TEXT->glPrintf> ERROR code %i\n", i);
126 125
     }
127 126
     i = TEXT->glPrintf(50, 200, "by xythobuz");
128 127
     if (i) {
129
-        printf(errorText, i);
128
+        printf("TEXT->glPrintf> ERROR code %i\n", i);
130 129
     }
131 130
     TEXT->setActive(0, true);
132 131
     TEXT->setActive(1, true);

+ 2
- 2
test/TombRaider.cpp View File

@@ -351,7 +351,6 @@ void dump_mesh(TombRaider *tr, char *mapname, int index)
351 351
                 tr->getColor(meshes[index].coloured_triangles[i].texture
352 352
                         & 0xff, rgba);
353 353
                 break;
354
-            default:
355 354
             case TR_VERSION_UNKNOWN:
356 355
             case TR_VERSION_2:
357 356
             case TR_VERSION_3:
@@ -359,6 +358,7 @@ void dump_mesh(TombRaider *tr, char *mapname, int index)
359 358
             case TR_VERSION_5:
360 359
                 tr->getColor((meshes[index].coloured_triangles[i].texture>>8)
361 360
                         & 0xff, rgba);
361
+                break;
362 362
         }
363 363
 
364 364
         s = rgba[0];
@@ -408,7 +408,6 @@ void dump_mesh(TombRaider *tr, char *mapname, int index)
408 408
                 tr->getColor(meshes[index].coloured_rectangles[i].texture
409 409
                         & 0xff, rgba);
410 410
                 break;
411
-            default:
412 411
             case TR_VERSION_UNKNOWN:
413 412
             case TR_VERSION_2:
414 413
             case TR_VERSION_3:
@@ -416,6 +415,7 @@ void dump_mesh(TombRaider *tr, char *mapname, int index)
416 415
             case TR_VERSION_5:
417 416
                 tr->getColor((meshes[index].coloured_rectangles[i].texture>>8)
418 417
                         & 0xff, rgba);
418
+                break;
419 419
         }
420 420
 
421 421
         s = rgba[0];

Loading…
Cancel
Save