mirror of https://github.com/OpenRCT2/OpenRCT2.git
Integrate gTypeToRideEntryIndexMap
This commit is contained in:
parent
39aaf85182
commit
cb4b9ba1c3
|
@ -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--;
|
||||
|
|
|
@ -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++;
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue