Integrate gTypeToRideEntryIndexMap

This commit is contained in:
Michał Janiszewski 2016-06-19 22:57:45 +02:00
parent 39aaf85182
commit cb4b9ba1c3
3 changed files with 8 additions and 6 deletions

View File

@ -903,7 +903,7 @@ static uint8* object_type_ride_load(void *objectEntry, uint32 entryIndex, int *c
continue;
}
uint8 *typeToRideEntryIndexMap = RCT2_ADDRESS(0x009E32F8, uint8);
uint8 *typeToRideEntryIndexMap = gTypeToRideEntryIndexMap;
while (dl >= 0) {
if (*typeToRideEntryIndexMap++ == 0xFF) {
dl--;
@ -1275,7 +1275,7 @@ static void object_type_ride_reset(void *objectEntry, uint32 entryIndex)
continue;
}
uint8 *typeToRideEntryIndexMap = RCT2_ADDRESS(0x009E32F8, uint8);
uint8 *typeToRideEntryIndexMap = gTypeToRideEntryIndexMap;
while (dl >= 0) {
if (*typeToRideEntryIndexMap++ == 0xFF) {
dl--;

View File

@ -121,6 +121,8 @@ const uint8 gRideClassifications[255] = {
RIDE_CLASS_RIDE, RIDE_CLASS_RIDE, RIDE_CLASS_RIDE, RIDE_CLASS_RIDE
};
uint8 gTypeToRideEntryIndexMap[91];
#pragma endregion
static const int RideInspectionInterval[] = {
@ -250,14 +252,12 @@ rct_ride_entry *get_ride_entry_by_ride(rct_ride *ride)
* rct2: 0x006DED68
*/
void reset_type_to_ride_entry_index_map(){
uint8* typeToRideEntryIndexMap = RCT2_ADDRESS(0x009E32F8, uint8);
memset(typeToRideEntryIndexMap, 0xFF, 91);
memset(gTypeToRideEntryIndexMap, 0xFF, 91);
}
uint8 *get_ride_entry_indices_for_ride_type(uint8 rideType)
{
uint8 *typeToRideEntryIndexMap = (uint8*)0x009E32F8;
uint8 *entryIndexList = typeToRideEntryIndexMap;
uint8 *entryIndexList = gTypeToRideEntryIndexMap;
while (rideType > 0) {
do {
entryIndexList++;

View File

@ -369,6 +369,8 @@ assert_struct_size(track_begin_end, 36);
#pragma pack(pop)
extern uint8 gTypeToRideEntryIndexMap[];
enum {
RIDE_CLASS_RIDE,
RIDE_CLASS_SHOP_OR_STALL,