Integrate gTypeToRideEntryIndexMap

This commit is contained in:
Michał Janiszewski 2016-06-24 22:57:40 +02:00
parent b1eb071b64
commit 6c28df8250
2 changed files with 4 additions and 6 deletions

View File

@ -732,7 +732,7 @@ static bool object_type_ride_load(void *objectEntry, uint32 entryIndex)
continue;
}
uint8 *typeToRideEntryIndexMap = RCT2_ADDRESS(0x009E32F8, uint8);
uint8 *typeToRideEntryIndexMap = gTypeToRideEntryIndexMap;
while (dl >= 0) {
if (*typeToRideEntryIndexMap++ == 0xFF) {
dl--;
@ -741,7 +741,7 @@ static bool object_type_ride_load(void *objectEntry, uint32 entryIndex)
typeToRideEntryIndexMap--;
uint8 previous_entry = entryIndex;
while (typeToRideEntryIndexMap < RCT2_ADDRESS(0x9E34E4, uint8)){
while (typeToRideEntryIndexMap < gTypeToRideEntryIndexMap + countof(gTypeToRideEntryIndexMap)){
uint8 backup_entry = *typeToRideEntryIndexMap;
*typeToRideEntryIndexMap++ = previous_entry;
previous_entry = backup_entry;

View File

@ -251,14 +251,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++;