|
@@ -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
|
|