mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-31 10:45:16 +01:00
add ride initialisation
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
<ClCompile Include="..\src\park.c" />
|
||||
<ClCompile Include="..\src\peep.c" />
|
||||
<ClCompile Include="..\src\rct2.c" />
|
||||
<ClCompile Include="..\src\ride.c" />
|
||||
<ClCompile Include="..\src\scenario.c" />
|
||||
<ClCompile Include="..\src\strings.c" />
|
||||
<ClCompile Include="..\src\title.c" />
|
||||
|
||||
@@ -146,6 +146,9 @@
|
||||
<ClCompile Include="..\src\park.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ride.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\openrct2.exe">
|
||||
|
||||
@@ -96,6 +96,7 @@
|
||||
#define RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED 0x013587F8
|
||||
|
||||
#define RCT2_ADDRESS_RIDE_LIST 0x013628F8
|
||||
#define RCT2_ADDRESS_RIDE_MEASUREMENTS 0x0138B60C
|
||||
|
||||
#define RCT2_ADDRESS_NEWS_ITEM_LIST 0x013CA754
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "news_item.h"
|
||||
#include "osinterface.h"
|
||||
#include "rct2.h"
|
||||
#include "ride.h"
|
||||
#include "scenario.h"
|
||||
#include "title.h"
|
||||
#include "viewport.h"
|
||||
@@ -114,7 +115,7 @@ void rct2_init()
|
||||
RCT2_CALLPROC_EBPSAFE(0x00667104);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C4209);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006ACA89); // init_rides
|
||||
ride_init_all();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F083); // window guest list init vars a
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD3A4);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AB4C); // init_map();
|
||||
|
||||
49
src/ride.c
Normal file
49
src/ride.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "ride.h"
|
||||
|
||||
#define GET_RIDE(x) (&(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[x]))
|
||||
#define GET_RIDE_MEASUREMENT(x) (&(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_MEASUREMENTS, rct_ride_measurement)[x]))
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006ACA89
|
||||
*/
|
||||
void ride_init_all()
|
||||
{
|
||||
int i;
|
||||
rct_ride *ride;
|
||||
rct_ride_measurement *ride_measurement;
|
||||
|
||||
for (i = 0; i < MAX_RIDES; i++) {
|
||||
ride = GET_RIDE(i);
|
||||
ride->type = RIDE_TYPE_NULL;
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x0138B590, sint8) = 0;
|
||||
RCT2_GLOBAL(0x0138B591, sint8) = 0;
|
||||
|
||||
for (i = 0; i < MAX_RIDE_MEASUREMENTS; i++) {
|
||||
ride_measurement = GET_RIDE_MEASUREMENT(i);
|
||||
ride_measurement->var_00 = 0xFF;
|
||||
}
|
||||
}
|
||||
14
src/ride.h
14
src/ride.h
@@ -54,8 +54,22 @@ typedef struct {
|
||||
uint8 pad_19A[0xC6];
|
||||
} rct_ride;
|
||||
|
||||
/**
|
||||
* Ride measurement structure.
|
||||
* size: 0x04B0C
|
||||
*/
|
||||
typedef struct {
|
||||
uint8 var_00;
|
||||
uint8 pad_01[0x4B0B];
|
||||
} rct_ride_measurement;
|
||||
|
||||
enum {
|
||||
RIDE_TYPE_NULL = (uint8)-1
|
||||
};
|
||||
|
||||
#define MAX_RIDES 256
|
||||
#define MAX_RIDE_MEASUREMENTS 8
|
||||
|
||||
void ride_init_all();
|
||||
|
||||
#endif
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "gfx.h"
|
||||
#include "news_item.h"
|
||||
#include "rct2.h"
|
||||
#include "ride.h"
|
||||
#include "intro.h"
|
||||
#include "viewport.h"
|
||||
|
||||
@@ -48,7 +49,7 @@ void title_load()
|
||||
RCT2_CALLPROC_EBPSAFE(0x00667104);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C4209);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069EB13);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006ACA89);
|
||||
ride_init_all();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068F083);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD3A4);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068AB4C);
|
||||
|
||||
@@ -42,9 +42,8 @@ void window_dispatch_update_all()
|
||||
|
||||
RCT2_GLOBAL(0x01423604, sint32)++;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_NOT_SHOWN_TICKS, sint16)++;
|
||||
for (w = RCT2_LAST_WINDOW; w >= RCT2_FIRST_WINDOW; w--) {
|
||||
for (w = RCT2_LAST_WINDOW; w >= RCT2_FIRST_WINDOW; w--)
|
||||
RCT2_CALLPROC_X(w->event_handlers[WE_UPDATE], 0, 0, 0, 0, w, 0, 0);
|
||||
}
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006EE411);
|
||||
}
|
||||
@@ -282,7 +281,7 @@ void window_invalidate_by_id(uint16 cls, rct_windownumber number)
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidates the specified window.
|
||||
* Initialises scroll widgets to their virtual size.
|
||||
* rct2: 0x006EAEB8
|
||||
*
|
||||
* @param window The window (esi).
|
||||
|
||||
Reference in New Issue
Block a user