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

+ 4
- 5
Makefile View File

79
 ###############################################################
79
 ###############################################################
80
 CC=gcc
80
 CC=gcc
81
 WARNINGS=-Weverything -Wno-padded -Wno-packed
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
 WARNINGS+=-Wno-shorten-64-to-32 -Wno-sign-conversion
87
 WARNINGS+=-Wno-shorten-64-to-32 -Wno-sign-conversion
89
 
88
 

+ 3
- 3
include/TombRaider1.h View File

155
         RaptorState_JumpBite  = 4,
155
         RaptorState_JumpBite  = 4,
156
         RaptorState_Bellowing = 6,
156
         RaptorState_Bellowing = 6,
157
         RaptorState_RunBellow = 7,
157
         RaptorState_RunBellow = 7,
158
-        RaptorState_Biting    = 8,
158
+        RaptorState_Biting    = 8
159
     };
159
     };
160
 
160
 
161
     /*!
161
     /*!
281
         WingedNatlaState_Dying1    = 5, //!< "Dying" the first time
281
         WingedNatlaState_Dying1    = 5, //!< "Dying" the first time
282
         WingedNatlaState_Spinning  = 7, //!< Spinning around in air
282
         WingedNatlaState_Spinning  = 7, //!< Spinning around in air
283
         WingedNatlaState_Standing2 = 8,
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
     enum MotorboatStates {
452
     enum MotorboatStates {
453
         MotorboatState_StationaryInitial = 1,
453
         MotorboatState_StationaryInitial = 1,
454
         MotorboatState_Moving            = 2,
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
             if (--mTranslateDelta < 0.0f)
280
             if (--mTranslateDelta < 0.0f)
281
                 mTranslateDelta = 1.0f;
281
                 mTranslateDelta = 1.0f;
282
             break;
282
             break;
283
-        default:
284
-            ;
285
     }
283
     }
286
 }
284
 }
287
 
285
 

+ 4
- 4
src/Mesh.cpp View File

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

+ 3
- 1
src/Network.cpp View File

591
 
591
 
592
             if (!f.data.send)
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
                 nanosleep(&tmp, NULL);
597
                 nanosleep(&tmp, NULL);
596
                 continue;
598
                 continue;
597
             }
599
             }

+ 12
- 14
src/OpenRaider.cpp View File

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

+ 1
- 1
src/Render.cpp View File

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

+ 6
- 33
src/TombRaider.cpp View File

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

+ 0
- 1
src/World.cpp View File

421
         case worldMoveType_noClipping:
421
         case worldMoveType_noClipping:
422
         case worldMoveType_fly:
422
         case worldMoveType_fly:
423
         case worldMoveType_swim:
423
         case worldMoveType_swim:
424
-        default:
425
             pitch = e->angles[2];
424
             pitch = e->angles[2];
426
             break;
425
             break;
427
     }
426
     }

+ 4
- 5
test/GLString.cpp View File

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

+ 2
- 2
test/TombRaider.cpp View File

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

Loading…
Cancel
Save