forked from rosebudai/OpenRCT2-Web
Merge branch 'master' into ride-window
This commit is contained in:
commit
53ac0b971b
42 files changed
+2484
-242
No files matched your search
+1
-1
@@ -55,6 +55,6 @@ set_target_properties(${PROJECT} PROPERTIES PREFIX "")
|
||||
TARGET_LINK_LIBRARIES(${PROJECT} ${SDL2_LIBRARIES})
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(${PROJECT} winmm.lib -limm32 -lversion)
|
||||
target_link_libraries(${PROJECT} winmm.lib -limm32 -lversion -ldsound)
|
||||
endif (WIN32)
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>winmm.lib;sdl2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>winmm.lib;sdl2.lib;Dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
@@ -224,7 +224,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>winmm.lib;sdl2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>winmm.lib;sdl2.lib;Dsound.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y "$(ProjectDir)\..\Data\Language\*.*" "$(TargetDir)\Data\Language\"</Command>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#define RCT2_CALLFUNC_3(address, returnType, a1, a2, a3, v1, v2, v3) (((returnType(*)(a1, a2, a3))(address))(v1, v2, v3))
|
||||
#define RCT2_CALLFUNC_4(address, returnType, a1, a2, a3, a4, v1, v2, v3, v4) (((returnType(*)(a1, a2, a3, a4))(address))(v1, v2, v3, v4))
|
||||
#define RCT2_CALLFUNC_5(address, returnType, a1, a2, a3, a4, a5, v1, v2, v3, v4, v5) (((returnType(*)(a1, a2, a3, a4, a5))(address))(v1, v2, v3, v4, v5))
|
||||
#define RCT2_CALLFUNC_6(address, returnType, a1, a2, a3, a4, a5, a6, v1, v2, v3, v4, v5, v6) (((returnType(*)(a1, a2, a3, a4, a5, a6))(address))(v1, v2, v3, v4, v5, v6))
|
||||
|
||||
#define RCT2_CALLPROC_1(address, a1, v1) RCT2_CALLFUNC_1(address, void, a1, v1)
|
||||
#define RCT2_CALLPROC_2(address, a1, a2, v1, v2) RCT2_CALLFUNC_2(address, void, a1, a2, v1, v2)
|
||||
@@ -106,6 +107,10 @@
|
||||
|
||||
#define RCT2_ADDRESS_INSTALLED_OBJECT_LIST 0x009ADAE8
|
||||
|
||||
#define RCT2_ADDRESS_CURRENT_SOUND_DEVICE 0x009AF280
|
||||
|
||||
#define RCT2_ADDRESS_VEHICLE_SOUND_LIST 0x009AF288
|
||||
|
||||
#define RCT2_ADDRESS_CURENT_CURSOR 0x009DE51C
|
||||
#define RCT2_ADDRESS_INPUT_STATE 0x009DE51D
|
||||
#define RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS 0x009DE51F
|
||||
@@ -157,11 +162,17 @@
|
||||
#define RCT2_ADDRESS_DSOUND_BUFFERS 0x009E1AB0
|
||||
#define RCT2_ADDRESS_NUM_DSOUND_DEVICES 0x009E2B88
|
||||
#define RCT2_ADDRESS_DSOUND_DEVICES 0x009E2B8C
|
||||
#define RCT2_ADDRESS_SOUND_INFO_LIST_MAPPING 0x009E2B94
|
||||
#define RCT2_ADDRESS_SOUNDLIST_BEGIN 0x009E2B98
|
||||
#define RCT2_ADDRESS_SOUNDLIST_END 0x009E2B9C
|
||||
#define RCT2_ADDRESS_DIRECTSOUND 0x009E2BA0
|
||||
#define RCT2_ADDRESS_DSOUND_DEVICES_COUNTER 0x009E2BAC
|
||||
|
||||
#define RCT2_ADDRESS_CMDLINE 0x009E2D98
|
||||
|
||||
#define RCT2_ADDRESS_MOUSE_READ_INDEX 0x009E2DE8
|
||||
#define RCT2_ADDRESS_MOUSE_WRITE_INDEX 0x009E2DE4
|
||||
|
||||
#define RCT2_ADDRESS_LAND_RAISE_COST 0x009E2E1C
|
||||
#define RCT2_ADDRESS_LAND_LOWER_COST 0x009E2E20
|
||||
#define RCT2_ADDRESS_SELECTED_TERRAIN_EDGE 0x009E2E24
|
||||
@@ -225,6 +236,7 @@
|
||||
#define RCT2_ADDRESS_OBJECTIVE_CURRENCY 0x013580FC
|
||||
#define RCT2_ADDRESS_OBJECTIVE_NUM_GUESTS 0x01358100
|
||||
#define RCT2_ADDRESS_BALANCE_HISTORY 0x0135812C
|
||||
#define RCT2_ADDRESS_CURRENT_EXPENDITURE 0x0135832C
|
||||
#define RCT2_ADDRESS_CURRENT_PROFIT 0x01358330
|
||||
#define RCT2_ADDRESS_WEEKLY_PROFIT_HISTORY 0x0135833C
|
||||
#define RCT2_ADDRESS_CURRENT_PARK_VALUE 0x0135853C
|
||||
@@ -310,7 +322,9 @@
|
||||
|
||||
#define RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER 0x0141ED68
|
||||
|
||||
#define RCT2_ADDRESS_AUDIO_INFO 0x01425B40
|
||||
|
||||
#define RCT2_ADDRESS_SOUND_CHANNEL_LIST 0x014262E0
|
||||
|
||||
#define RCT2_ADDRESS_WATER_RAISE_COST 0x0141F738
|
||||
#define RCT2_ADDRESS_WATER_LOWER_COST 0x0141F73C
|
||||
@@ -395,6 +409,8 @@
|
||||
#define RCT2_ADDRESS_SCREEN_CAP_BPP 0x01423C10
|
||||
#define RCT2_ADDRESS_SCREEN_CAP_RASTER_STRETCH 0x01423C14
|
||||
|
||||
#define RCT2_ADDRESS_INPUT_QUEUE 0x01424340
|
||||
|
||||
static void RCT2_CALLPROC_EBPSAFE(int address)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
|
||||
+1298
-20
File diff suppressed because it is too large.
Load diff
+86
-5
@@ -21,6 +21,8 @@
|
||||
#ifndef _AUDIO_H_
|
||||
#define _AUDIO_H_
|
||||
|
||||
#include "rct2.h"
|
||||
|
||||
typedef struct {
|
||||
char name[256];
|
||||
} audio_device;
|
||||
@@ -31,7 +33,7 @@ extern audio_device *gAudioDevices;
|
||||
void audio_init();
|
||||
void audio_quit();
|
||||
void audio_get_devices();
|
||||
|
||||
void audio_init2(int device);
|
||||
|
||||
#include <dsound.h>
|
||||
|
||||
@@ -55,10 +57,76 @@ typedef struct rct_sound {
|
||||
struct rct_sound* next;
|
||||
} rct_sound;
|
||||
|
||||
void get_dsound_devices();
|
||||
int sound_prepare(int sound_id, rct_sound *sound, int var_8, int var_c);
|
||||
void sound_play_panned(int sound_id, int x);
|
||||
typedef struct {
|
||||
uint16 var_0;
|
||||
uint16 channels;
|
||||
uint32 samples;
|
||||
uint32 var_8;
|
||||
uint16 bytes;
|
||||
uint16 bits;
|
||||
uint16 var_E;
|
||||
} rct_audio_info;
|
||||
|
||||
typedef struct {
|
||||
uint32 var_0;
|
||||
uint32 var_4;
|
||||
char filename[0x108]; // 0x8
|
||||
uint32 var_110;
|
||||
uint32 var_114;
|
||||
uint32 var_118;
|
||||
HGLOBAL hmem; // 0x11C
|
||||
HMMIO hmmio; // 0x120
|
||||
MMCKINFO mmckinfo1; // 0x124
|
||||
MMCKINFO mmckinfo2; // 0x138
|
||||
LPDIRECTSOUNDBUFFER dsbuffer; // 0x14C
|
||||
uint32 var_150;
|
||||
uint32 playpos; // 0x154
|
||||
uint32 var_158;
|
||||
uint32 var_15C;
|
||||
uint32 var_160;
|
||||
uint32 var_164;
|
||||
uint32 var_168;
|
||||
} rct_sound_channel;
|
||||
|
||||
typedef struct {
|
||||
uint32 size;
|
||||
WAVEFORMATEX format;
|
||||
char* data;
|
||||
} rct_sound_info;
|
||||
|
||||
typedef struct {
|
||||
uint16 id;
|
||||
uint16 var_2;
|
||||
rct_sound sound1; // 0x04
|
||||
uint16 var_18;
|
||||
uint8 pad_1A[0x06];
|
||||
rct_sound sound2; // 0x20
|
||||
uint16 var_34;
|
||||
uint8 pad_36[0x06];
|
||||
} rct_vehicle_sound;
|
||||
|
||||
typedef struct {
|
||||
uint16 id;
|
||||
rct_sound sound;
|
||||
} rct_other_sound;
|
||||
|
||||
int get_dsound_devices();
|
||||
int dsound_create_primary_buffer(int a, int device, int channels, int samples, int bits);
|
||||
void audio_timefunc(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2, int channel);
|
||||
int audio_release();
|
||||
MMRESULT mmio_read(HMMIO hmmio, uint32 size, char* buffer, LPMMCKINFO mmckinfo, int* read);
|
||||
MMRESULT mmio_seek(HMMIO* hmmio, LPMMCKINFO mmckinfo1, LPMMCKINFO mmckinfo2, int offset);
|
||||
MMRESULT mmio_open(char* filename, HMMIO* hmmio, HGLOBAL* hmem, LPMMCKINFO mmckinfo);
|
||||
int sub_40153B(int channel);
|
||||
int sub_4015E7(int channel);
|
||||
int audio_remove_timer();
|
||||
void audio_close();
|
||||
LPVOID map_file(LPCSTR lpFileName, DWORD dwCreationDisposition, DWORD dwNumberOfBytesToMap);
|
||||
int unmap_sound_info();
|
||||
int sound_prepare(int sound_id, rct_sound *sound, int channels, int software);
|
||||
int sound_play_panned(int sound_id, int x);
|
||||
int sound_play(rct_sound* sound, int looping, int volume, int pan, int frequency);
|
||||
int sound_is_playing(rct_sound* sound);
|
||||
int sound_set_frequency(rct_sound* sound, int frequency);
|
||||
int sound_set_pan(rct_sound* sound, int pan);
|
||||
int sound_set_volume(rct_sound* sound, int volume);
|
||||
@@ -66,9 +134,22 @@ int sound_channel_play(int channel, int a2, int volume, int pan, int frequency);
|
||||
int sound_channel_set_frequency(int channel, int frequency);
|
||||
int sound_channel_set_pan(int channel, int pan);
|
||||
int sound_channel_set_volume(int channel, int volume);
|
||||
void sound_stop(rct_sound *sound);
|
||||
int sound_channel_load_file(int channel, char* filename, int offset);
|
||||
void sound_channel_free(HMMIO* hmmio, HGLOBAL* hmem);
|
||||
int sound_stop(rct_sound *sound);
|
||||
int sound_stop_all();
|
||||
int unmap_file(LPCVOID base);
|
||||
int sound_channel_stop(int channel);
|
||||
rct_sound* sound_add(rct_sound* sound);
|
||||
rct_sound* sound_remove(rct_sound* sound);
|
||||
rct_sound* sound_begin();
|
||||
rct_sound* sound_next(rct_sound* sound);
|
||||
void pause_sounds();
|
||||
void stop_other_sounds();
|
||||
void stop_vehicle_sounds();
|
||||
void stop_ride_music();
|
||||
void stop_peep_sounds();
|
||||
void stop_title_music();
|
||||
void unpause_sounds();
|
||||
|
||||
// 0x009AF59C probably does the same job
|
||||
|
||||
+2
-2
@@ -155,7 +155,7 @@ static int award_is_deserved_best_value(int awardType, int activeAwardTypes)
|
||||
return 0;
|
||||
if (activeAwardTypes & (1 << PARK_AWARD_MOST_DISAPPOINTING))
|
||||
return 0;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & (PARK_FLAGS_11 | PARK_FLAGS_PARK_FREE_ENTRY))
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & (PARK_FLAGS_NO_MONEY | PARK_FLAGS_PARK_FREE_ENTRY))
|
||||
return 0;
|
||||
if (RCT2_GLOBAL(RCT2_TOTAL_RIDE_VALUE, money16) < MONEY(10, 00))
|
||||
return 0;
|
||||
@@ -205,7 +205,7 @@ static int award_is_deserved_worse_value(int awardType, int activeAwardTypes)
|
||||
{
|
||||
if (activeAwardTypes & (1 << PARK_AWARD_BEST_VALUE))
|
||||
return 0;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)
|
||||
return 0;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, money16) == MONEY(0, 00))
|
||||
return 0;
|
||||
|
||||
+4
-4
@@ -186,7 +186,7 @@ static void climate_determine_future_weather()
|
||||
*/
|
||||
void climate_update_sound()
|
||||
{
|
||||
if (RCT2_GLOBAL(0x009AF280, uint32) == 0xFFFFFFFF)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, uint32) == 0xFFFFFFFF)
|
||||
return;
|
||||
if (RCT2_GLOBAL(0x009AF59C, uint8) != 0)
|
||||
return;
|
||||
@@ -210,13 +210,13 @@ static void climate_update_rain_sound()
|
||||
} else {
|
||||
// Increase rain sound
|
||||
_rainVolume = min(-1400, _rainVolume + 80);
|
||||
RCT2_CALLPROC_2(0x00404F0D, rct_sound*, int, &_rainSoundInstance, _rainVolume);
|
||||
sound_set_volume(&_rainSoundInstance, _rainVolume);
|
||||
}
|
||||
} else if (_rainVolume != 1) {
|
||||
// Decrease rain sound
|
||||
_rainVolume -= 80;
|
||||
if (_rainVolume > -4000) {
|
||||
RCT2_CALLPROC_2(0x00404F0D, rct_sound*, int, &_rainSoundInstance, _rainVolume);
|
||||
sound_set_volume(&_rainSoundInstance, _rainVolume);
|
||||
} else {
|
||||
sound_stop(&_rainSoundInstance);
|
||||
_rainVolume = 1;
|
||||
@@ -248,7 +248,7 @@ static void climate_update_thunder_sound()
|
||||
if (_thunderStatus[i] == THUNDER_STATUS_NULL)
|
||||
continue;
|
||||
|
||||
if (!RCT2_CALLFUNC_1(0x00404E53, int, rct_sound*, &_thunderSoundInstance[i])) {
|
||||
if (!sound_is_playing(&_thunderSoundInstance[i])) {
|
||||
sound_stop(&_thunderSoundInstance[i]);
|
||||
_thunderStatus[i] = THUNDER_STATUS_NULL;
|
||||
}
|
||||
|
||||
+59
-8
@@ -57,7 +57,7 @@ void finance_payment(money32 amount, rct_expenditure_type type)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32) = ENCRYPT_MONEY(new_money);
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_EXPENDITURE_TABLE, money32)[type] -= amount;
|
||||
if (RCT2_ADDRESS(0x00988E60, uint32)[type] & 1)
|
||||
RCT2_GLOBAL(0x0135832C, money32) -= amount;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, money32) -= amount; // Cumulative amount of money spent this day
|
||||
|
||||
|
||||
RCT2_GLOBAL(0x009A9804, uint32) |= 1; // money diry flag
|
||||
@@ -74,7 +74,7 @@ void finance_pay_wages()
|
||||
rct_peep* peep;
|
||||
uint16 spriteIndex;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)
|
||||
return;
|
||||
|
||||
FOR_ALL_STAFF(spriteIndex, peep)
|
||||
@@ -89,7 +89,7 @@ void finance_pay_research()
|
||||
{
|
||||
uint8 level;
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)
|
||||
return;
|
||||
|
||||
level = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8);
|
||||
@@ -106,7 +106,7 @@ void finance_pay_interest()
|
||||
sint16 current_interest = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_INTEREST_RATE, sint16);
|
||||
money32 tempcost = (current_loan * 5 * current_interest) >> 14; // (5 * interest) / 2^14 is pretty close to
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)
|
||||
return;
|
||||
|
||||
finance_payment(tempcost, RCT_EXPENDITURE_TYPE_INTEREST);
|
||||
@@ -127,7 +127,7 @@ void finance_pay_ride_upkeep()
|
||||
ride->var_196 = 25855; // durability?
|
||||
|
||||
}
|
||||
if (ride->status != RIDE_STATUS_CLOSED && !(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800)) {
|
||||
if (ride->status != RIDE_STATUS_CLOSED && !(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) {
|
||||
sint16 upkeep = ride->upkeep_cost;
|
||||
if (upkeep != -1) {
|
||||
ride->var_154 -= upkeep;
|
||||
@@ -158,11 +158,10 @@ void finance_init() {
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_EXPENDITURE_TABLE, money32)[i] = 0;
|
||||
}
|
||||
|
||||
RCT2_GLOBAL(0x0135832C, uint32) = 0;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, uint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 0;
|
||||
|
||||
RCT2_GLOBAL(0x01358334, uint32) = 0;
|
||||
RCT2_GLOBAL(0x01358334, money32) = 0;
|
||||
RCT2_GLOBAL(0x01358338, uint16) = 0;
|
||||
|
||||
RCT2_GLOBAL(0x013573DC, money32) = MONEY(10000,00); // Cheat detection
|
||||
@@ -185,6 +184,58 @@ void finance_init() {
|
||||
sub_69E869();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069E79A
|
||||
*/
|
||||
void finance_update_daily_profit()
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 7 * RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, money32);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, money32) = 0; // Reset daily expenditure
|
||||
|
||||
money32 current_profit = 0;
|
||||
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
// Staff costs
|
||||
uint16 sprite_index;
|
||||
rct_peep *peep;
|
||||
|
||||
FOR_ALL_STAFF(sprite_index, peep) {
|
||||
uint8 staff_type = peep->staff_type;
|
||||
current_profit -= wage_table[peep->staff_type];
|
||||
}
|
||||
|
||||
// Research costs
|
||||
uint8 level = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8);
|
||||
current_profit -= research_cost_table[level];
|
||||
|
||||
// Loan costs
|
||||
money32 current_loan = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_LOAN, money32);
|
||||
current_profit -= current_loan / 600;
|
||||
|
||||
// Ride costs
|
||||
rct_ride *ride;
|
||||
int i;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
if (ride->status != RIDE_STATUS_CLOSED && ride->upkeep_cost != -1) {
|
||||
current_profit -= 2 * ride->upkeep_cost;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is not equivalent to / 4 due to rounding of negative numbers
|
||||
current_profit = current_profit >> 2;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) += current_profit;
|
||||
|
||||
// These are related to weekly profit graph
|
||||
RCT2_GLOBAL(0x1358334, money32) += RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32);
|
||||
RCT2_GLOBAL(0x1358338, uint16) += 1;
|
||||
|
||||
window_invalidate_by_id(WC_FINANCES, 0);
|
||||
}
|
||||
|
||||
void sub_69E869()
|
||||
{
|
||||
// This subroutine is loan related and is used for cheat detection
|
||||
|
||||
@@ -41,6 +41,7 @@ void finance_pay_interest();
|
||||
void finance_pay_ride_upkeep();
|
||||
void finance_reset_history();
|
||||
void finance_init();
|
||||
void finance_update_daily_profit();
|
||||
void sub_69E869();
|
||||
|
||||
#endif
|
||||
+4
-1
@@ -29,6 +29,7 @@
|
||||
#include "news_item.h"
|
||||
#include "object.h"
|
||||
#include "osinterface.h"
|
||||
#include "park.h"
|
||||
#include "peep.h"
|
||||
#include "sawyercoding.h"
|
||||
#include "scenario.h"
|
||||
@@ -388,6 +389,8 @@ void game_logic_update()
|
||||
news_item_update_current();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0067009A); // scenario editor opening of windows for a phase
|
||||
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BB991); // removes other sounds that are no longer playing, this is normally called somewhere in rct2_init
|
||||
|
||||
// Update windows
|
||||
window_dispatch_update_all();
|
||||
|
||||
@@ -940,7 +943,7 @@ static uint32 game_do_command_table[58] = {
|
||||
0x006666E7,
|
||||
0x00666A63,
|
||||
0x006CD8CE,
|
||||
0x00669E30,
|
||||
(uint32)game_command_set_park_entrance_fee,
|
||||
(uint32)game_command_update_staff_colour, // 40
|
||||
0x006E519A,
|
||||
0x006E5597,
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ enum GAME_COMMAND {
|
||||
GAME_COMMAND_HIRE_NEW_STAFF_MEMBER, // 29
|
||||
GAME_COMMAND_30,
|
||||
GAME_COMMAND_31,
|
||||
GAME_COMMAND_32,
|
||||
GAME_COMMAND_SET_STAFF_ORDER,
|
||||
GAME_COMMAND_33,
|
||||
GAME_COMMAND_SET_PARK_OPEN, // 34
|
||||
GAME_COMMAND_35,
|
||||
|
||||
@@ -2276,7 +2276,7 @@ rct_drawpixelinfo* clip_drawpixelinfo(rct_drawpixelinfo* dpi, int left, int widt
|
||||
}
|
||||
|
||||
int stickOutWidth = newDrawPixelInfo->x + newDrawPixelInfo->width - right;
|
||||
if (stickOutWidth < 0) {
|
||||
if (stickOutWidth > 0) {
|
||||
newDrawPixelInfo->width -= stickOutWidth;
|
||||
newDrawPixelInfo->pitch += stickOutWidth;
|
||||
}
|
||||
@@ -2290,7 +2290,7 @@ rct_drawpixelinfo* clip_drawpixelinfo(rct_drawpixelinfo* dpi, int left, int widt
|
||||
}
|
||||
|
||||
int bp = newDrawPixelInfo->y + newDrawPixelInfo->height - bottom;
|
||||
if (bp < 0) {
|
||||
if (bp > 0) {
|
||||
newDrawPixelInfo->height -= bp;
|
||||
}
|
||||
|
||||
|
||||
+53
-13
@@ -36,6 +36,13 @@
|
||||
|
||||
POINT _dragPosition;
|
||||
|
||||
typedef struct {
|
||||
uint32 x, y;
|
||||
uint32 state; //1 = LeftDown 2 = LeftUp 3 = RightDown 4 = RightUp
|
||||
} rct_mouse_data;
|
||||
|
||||
rct_mouse_data* mouse_buffer = RCT2_ADDRESS(RCT2_ADDRESS_INPUT_QUEUE, rct_mouse_data);
|
||||
|
||||
static void game_get_next_input(int *x, int *y, int *state);
|
||||
static void input_mouseover(int x, int y, rct_window *w, int widgetIndex);
|
||||
static void input_mouseover_widget_check(rct_windowclass windowClass, rct_windownumber windowNumber, int widgetIndex);
|
||||
@@ -43,6 +50,7 @@ static void input_mouseover_widget_flatbutton_invalidate();
|
||||
void process_mouse_over(int x, int y);
|
||||
void sub_6ED801(int x, int y);
|
||||
void invalidate_scroll();
|
||||
static rct_mouse_data* get_mouse_input();
|
||||
|
||||
#pragma region Scroll bar input
|
||||
|
||||
@@ -522,11 +530,8 @@ static void input_leftmousedown(int x, int y, rct_window *w, int widgetIndex)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// comment check as it disables the rotate station/building button in construction window
|
||||
// if (!widget_is_enabled(w, widgetIndex))
|
||||
// break;
|
||||
if (widget_is_disabled(w, widgetIndex))
|
||||
break;
|
||||
if (!widget_is_enabled(w, widgetIndex))
|
||||
break;
|
||||
|
||||
sound_play_panned(SOUND_CLICK_1, w->x + (widget->left + widget->right) / 2);
|
||||
|
||||
@@ -1298,7 +1303,7 @@ void handle_shortcut_command(int shortcutIndex)
|
||||
break;
|
||||
case SHORTCUT_SHOW_FINANCIAL_INFORMATION:
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 0x0C))
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800))
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY))
|
||||
window_finances_open();
|
||||
break;
|
||||
case SHORTCUT_SHOW_RESEARCH_INFORMATION:
|
||||
@@ -1557,18 +1562,17 @@ void game_handle_input()
|
||||
*/
|
||||
static void game_get_next_input(int *x, int *y, int *state)
|
||||
{
|
||||
int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
RCT2_CALLFUNC_X(0x00407074, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
if (eax == 0) {
|
||||
rct_mouse_data* eax = get_mouse_input();
|
||||
if (eax == NULL) {
|
||||
*x = gCursorState.x;
|
||||
*y = gCursorState.y;
|
||||
*state = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
*x = RCT2_GLOBAL(eax + 0, sint32);
|
||||
*y = RCT2_GLOBAL(eax + 4, sint32);
|
||||
*state = RCT2_GLOBAL(eax + 8, sint32);
|
||||
*x = eax->x;
|
||||
*y = eax->y;
|
||||
*state = eax->state;
|
||||
|
||||
//int eax, ebx, ecx, edx, esi, edi, ebp;
|
||||
//RCT2_CALLFUNC_X(0x006E83C7, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
||||
@@ -1762,4 +1766,40 @@ void invalidate_scroll()
|
||||
wind->scrolls[scroll_id / sizeof(rct_scroll)].flags &= 0xFF11;
|
||||
|
||||
window_invalidate_by_id(RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, uint8), RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWNUMBER, uint16));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rct2: 0x00406C96
|
||||
*/
|
||||
void store_mouse_input(int state)
|
||||
{
|
||||
uint32 write_index = RCT2_GLOBAL(RCT2_ADDRESS_MOUSE_WRITE_INDEX, uint32);
|
||||
uint32 next_write_index = (write_index + 1) % 64;
|
||||
|
||||
// check if the queue is full
|
||||
if (next_write_index == RCT2_GLOBAL(RCT2_ADDRESS_MOUSE_READ_INDEX, uint32))
|
||||
return;
|
||||
|
||||
rct_mouse_data* item = &mouse_buffer[write_index];
|
||||
item->x = RCT2_GLOBAL(0x01424318, uint32);
|
||||
item->y = RCT2_GLOBAL(0x0142431C, uint32);
|
||||
item->state = state;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MOUSE_WRITE_INDEX, uint32) = next_write_index;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* rct2: 0x00407074
|
||||
*/
|
||||
static rct_mouse_data* get_mouse_input()
|
||||
{
|
||||
uint32 read_index = RCT2_GLOBAL(RCT2_ADDRESS_MOUSE_READ_INDEX, uint32);
|
||||
|
||||
// check if that location has been written to yet
|
||||
if (read_index == RCT2_GLOBAL(RCT2_ADDRESS_MOUSE_WRITE_INDEX, uint32))
|
||||
return NULL;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MOUSE_READ_INDEX, uint32) = (read_index + 1) % 64;
|
||||
return &mouse_buffer[read_index];
|
||||
}
|
||||
@@ -24,4 +24,6 @@
|
||||
void game_handle_input();
|
||||
void game_handle_keyboard_input();
|
||||
|
||||
void store_mouse_input(int state);
|
||||
|
||||
#endif
|
||||
+3
-3
@@ -80,7 +80,7 @@ void intro_update()
|
||||
|
||||
// Chain lift sound
|
||||
_sound_playing_flag = 0;
|
||||
if (RCT2_GLOBAL(0x009AF280, sint32) != -1) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, sint32) != -1) {
|
||||
// Prepare and play the sound
|
||||
if (sound_prepare(SOUND_LIFT_7, &_prepared_sound, 0, 1))
|
||||
if (sound_play(&_prepared_sound, 1, 0, 0, 0))
|
||||
@@ -157,7 +157,7 @@ void intro_update()
|
||||
}
|
||||
|
||||
// Play the track friction sound
|
||||
if (RCT2_GLOBAL(0x009AF280, sint32) != -1) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, sint32) != -1) {
|
||||
// Prepare and play the sound
|
||||
if (sound_prepare(SOUND_TRACK_FRICTION_3, &_prepared_sound, 1, 1))
|
||||
if (sound_play(&_prepared_sound, 1, -800, 0, 0x3A98))
|
||||
@@ -188,7 +188,7 @@ void intro_update()
|
||||
}
|
||||
|
||||
// Play long peep scream sound
|
||||
if (RCT2_GLOBAL(0x009AF280, sint32) != -1)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, sint32) != -1)
|
||||
if (sound_prepare(SOUND_SCREAM_1, &_prepared_sound, 0, 1))
|
||||
if (sound_play(&_prepared_sound, 0, 0, 0, 0))
|
||||
_sound_playing_flag = 1;
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ void news_item_add_to_queue(uint8 type, rct_string_id string_id, uint32 assoc)
|
||||
newsItem->assoc = assoc;
|
||||
newsItem->ticks = 0;
|
||||
newsItem->month_year = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16);
|
||||
newsItem->day = (days_in_month[(newsItem->month_year & 7)] * RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16)) >> 16;
|
||||
newsItem->day = ((days_in_month[(newsItem->month_year & 7)] * RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16)) >> 16) + 1;
|
||||
|
||||
format_string((char*)0x0141EF68, string_id, (void*)0x013CE952); // overflows possible?
|
||||
newsItem->colour = ((char*)0x0141EF68)[0];
|
||||
|
||||
+8
-27
@@ -28,6 +28,7 @@
|
||||
#include "addresses.h"
|
||||
#include "config.h"
|
||||
#include "gfx.h"
|
||||
#include "input.h"
|
||||
#include "osinterface.h"
|
||||
#include "screenshot.h"
|
||||
#include "window.h"
|
||||
@@ -44,7 +45,6 @@ unsigned int gLastKeyPressed;
|
||||
static void osinterface_create_window();
|
||||
static void osinterface_close_window();
|
||||
static void osinterface_resize(int width, int height);
|
||||
static void sub_406C96(int actionType);
|
||||
|
||||
static SDL_Window *_window;
|
||||
static SDL_Surface *_surface;
|
||||
@@ -350,7 +350,7 @@ void osinterface_process_messages()
|
||||
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
||||
switch (e.button.button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
sub_406C96(1); //RCT2_CALLPROC_1(0x00406C96, int, 1);
|
||||
store_mouse_input(1);
|
||||
gCursorState.left = CURSOR_PRESSED;
|
||||
gCursorState.old = 1;
|
||||
break;
|
||||
@@ -358,7 +358,7 @@ void osinterface_process_messages()
|
||||
gCursorState.middle = CURSOR_PRESSED;
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
sub_406C96(3); //RCT2_CALLPROC_1(0x00406C96, int, 3);
|
||||
store_mouse_input(3);
|
||||
gCursorState.right = CURSOR_PRESSED;
|
||||
gCursorState.old = 2;
|
||||
break;
|
||||
@@ -369,7 +369,7 @@ void osinterface_process_messages()
|
||||
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
||||
switch (e.button.button) {
|
||||
case SDL_BUTTON_LEFT:
|
||||
sub_406C96(2); //RCT2_CALLPROC_1(0x00406C96, int, 2);
|
||||
store_mouse_input(2);
|
||||
gCursorState.left = CURSOR_RELEASED;
|
||||
gCursorState.old = 3;
|
||||
break;
|
||||
@@ -377,7 +377,7 @@ void osinterface_process_messages()
|
||||
gCursorState.middle = CURSOR_RELEASED;
|
||||
break;
|
||||
case SDL_BUTTON_RIGHT:
|
||||
sub_406C96(4); //RCT2_CALLPROC_1(0x00406C96, int, 4);
|
||||
store_mouse_input(4);
|
||||
gCursorState.right = CURSOR_RELEASED;
|
||||
gCursorState.old = 4;
|
||||
break;
|
||||
@@ -452,6 +452,7 @@ int osinterface_open_common_file_dialog(int type, char *title, char *filename, c
|
||||
OPENFILENAME openFileName;
|
||||
BOOL result;
|
||||
int tmp;
|
||||
DWORD commonFlags;
|
||||
|
||||
// Get directory path from given filename
|
||||
strcpy(initialDirectory, filename);
|
||||
@@ -488,7 +489,7 @@ int osinterface_open_common_file_dialog(int type, char *title, char *filename, c
|
||||
RCT2_GLOBAL(0x009E2C74, uint32) = 1;
|
||||
|
||||
// Open dialog
|
||||
DWORD commonFlags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
|
||||
commonFlags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
|
||||
if (type == 0) {
|
||||
openFileName.Flags = commonFlags | OFN_CREATEPROMPT | OFN_OVERWRITEPROMPT;
|
||||
result = GetSaveFileName(&openFileName);
|
||||
@@ -596,24 +597,4 @@ int osinterface_ensure_directory_exists(const char *path)
|
||||
char osinterface_get_path_separator()
|
||||
{
|
||||
return '\\';
|
||||
}
|
||||
|
||||
void sub_406C96(int actionType)
|
||||
{
|
||||
int eax = RCT2_GLOBAL(0x009E2DE4, uint32);
|
||||
int ecx = eax + 1;
|
||||
ecx &= 0x3F; //Array of 64 point structs, loop around buffer?
|
||||
if (ecx != RCT2_GLOBAL(0x009E2DE8, uint32)) {
|
||||
int edx = RCT2_GLOBAL(0x01424318, uint32); // X
|
||||
//eax is a struct index here. Mutliplied by then and then 4 for the struct with 3 4 byte fields
|
||||
//Struct is {int x, int y, int actionType}
|
||||
eax = eax + eax*2;
|
||||
eax = 0x01424340 + eax * 4; //get base of struct, address is base of array
|
||||
*((uint32*)eax) = edx;
|
||||
edx = RCT2_GLOBAL(0x0142431C, uint32); // Y
|
||||
*((uint32*)eax + 1) = edx;
|
||||
edx = actionType;
|
||||
*((uint32*)eax + 2) = edx;
|
||||
RCT2_GLOBAL(0x009E2DE4, uint32) = ecx;
|
||||
}
|
||||
}
|
||||
}
|
||||
+39
-3
@@ -90,7 +90,7 @@ void park_init()
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, money16) = MONEY(10, 00);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PEEP_SPAWNS, sint16) = -1;
|
||||
RCT2_GLOBAL(0x013573F8, sint16) = -1;
|
||||
RCT2_GLOBAL(0x01357CF2, uint16) = 127;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES, uint16) = 127;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RESEARCH_LEVEL, uint8) = 2;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_CASH, uint16) = MONEY(50,00); // Cash per guest (average)
|
||||
@@ -103,7 +103,7 @@ void park_init()
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_LAND_COST, uint16) = MONEY(90, 00);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONSTRUCTION_RIGHTS_COST, uint16) = MONEY(40,00);
|
||||
RCT2_GLOBAL(0x01358774, uint16) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) = PARK_FLAGS_11 | PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) = PARK_FLAGS_NO_MONEY | PARK_FLAGS_SHOW_REAL_GUEST_NAMES;
|
||||
park_reset_history();
|
||||
finance_reset_history();
|
||||
award_reset();
|
||||
@@ -427,7 +427,7 @@ static int park_calculate_guest_generation_probability()
|
||||
probability /= 4;
|
||||
|
||||
// Check if money is enabled
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)) {
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) {
|
||||
// Penalty for overpriced entrance fee relative to total ride value
|
||||
money16 entranceFee = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, money16);
|
||||
if (entranceFee > totalRideValue) {
|
||||
@@ -581,4 +581,40 @@ uint8 calculate_guest_initial_happiness(uint8 percentage) {
|
||||
void park_update_histories()
|
||||
{
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066A231);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00669E30
|
||||
*/
|
||||
void game_command_set_park_entrance_fee()
|
||||
{
|
||||
uint8 _bl;
|
||||
uint16 new_fee;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__asm mov _bl, bl
|
||||
#else
|
||||
__asm__("mov %[_bl], bl " : [_bl] "+m" (_bl));
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__asm mov new_fee, di
|
||||
#else
|
||||
__asm__("mov %[new_fee], di " : [new_fee] "+m" (new_fee));
|
||||
#endif
|
||||
|
||||
RCT2_GLOBAL(0x0141F56C, uint8) = 0x10;
|
||||
|
||||
if (_bl & 1){
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16) = new_fee;
|
||||
|
||||
window_invalidate_by_id(WC_PARK_INFORMATION, 0);
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__asm mov ebx, 0
|
||||
#else
|
||||
__asm__("mov ebx, 0 ");
|
||||
#endif
|
||||
}
|
||||
+4
-2
@@ -35,11 +35,11 @@ enum {
|
||||
PARK_FLAGS_PREF_LESS_INTENSE_RIDES = (1 << 6),
|
||||
PARK_FLAGS_FORBID_MARKETING_CAMPAIGN = (1 << 7),
|
||||
PARK_FLAGS_PREF_MORE_INTENSE_RIDES = (1 << 8),
|
||||
PARK_FLAGS_11 = (1 << 11), // appears to be a copy of PARK_FLAGS_NO_MONEY
|
||||
PARK_FLAGS_NO_MONEY = (1 << 11),
|
||||
PARK_FLAGS_DIFFICULT_GUEST_GENERATION = (1 << 12),
|
||||
PARK_FLAGS_PARK_FREE_ENTRY = (1 << 13),
|
||||
PARK_FLAGS_DIFFICULT_PARK_RATING = (1 << 14),
|
||||
PARK_FLAGS_NO_MONEY = (1 << 17),
|
||||
PARK_FLAGS_NO_MONEY_SCENARIO = (1 << 17), // equivalent to PARK_FLAGS_NO_MONEY, but used in scenario editor
|
||||
PARK_FLAGS_18 = (1 << 18)
|
||||
};
|
||||
|
||||
@@ -59,4 +59,6 @@ void park_update_histories();
|
||||
|
||||
uint8 calculate_guest_initial_happiness(uint8 percentage);
|
||||
|
||||
void game_command_set_park_entrance_fee();
|
||||
|
||||
#endif
|
||||
+38
@@ -542,6 +542,44 @@ void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argum
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* rct2: 0x00698342
|
||||
* thought.item (eax)
|
||||
* thought.type (ebx)
|
||||
* argument_1 (esi & ebx)
|
||||
* argument_2 (esi+2)
|
||||
*/
|
||||
void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2){
|
||||
int esi = 0x9AC86C;
|
||||
|
||||
if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 1){
|
||||
rct_ride* ride = &g_ride_list[thought.item];
|
||||
esi = (int)(&(ride->var_04A));
|
||||
}
|
||||
else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 2){
|
||||
if (thought.item < 0x20){
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM_START;
|
||||
}
|
||||
else{
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM2_START;
|
||||
}
|
||||
}
|
||||
else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 4){
|
||||
if (thought.item < 0x20){
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM_SINGULAR_START;
|
||||
}
|
||||
else
|
||||
{
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM2_SINGULAR_START;
|
||||
}
|
||||
}
|
||||
else{
|
||||
esi = 0x9AC864; //No thought?
|
||||
}
|
||||
*argument_1 = ((thought.type + STR_THOUGHT_START) & 0xFFFF) | (*((uint16*)esi) << 16);
|
||||
*argument_2 = *((uint32*)(esi + 2)); //Always 0 apart from on rides?
|
||||
}
|
||||
|
||||
/**
|
||||
* rct2: 0x00698827
|
||||
* returns 1 on pickup (CF not set)
|
||||
|
||||
@@ -444,5 +444,6 @@ void peep_update_crowd_noise();
|
||||
void peep_applause();
|
||||
rct_peep *peep_generate(int x, int y, int z);
|
||||
void get_arguments_from_action(rct_peep* peep, uint32 *argument_1, uint32* argument_2);
|
||||
void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2);
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -84,7 +84,7 @@ __declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInsta
|
||||
|
||||
audio_init();
|
||||
audio_get_devices();
|
||||
RCT2_CALLPROC(0x0040502E); // get_dsound_devices()
|
||||
get_dsound_devices();
|
||||
config_init();
|
||||
language_open(gGeneral_config.language);
|
||||
rct2_init();
|
||||
|
||||
+8
-8
@@ -139,10 +139,10 @@ void scenario_load(const char *path)
|
||||
sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_CURRENT_PARK_RATING);
|
||||
|
||||
// Read ?
|
||||
sawyercoding_read_chunk(file, (uint8*)0x01357CF2);
|
||||
sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES);
|
||||
|
||||
// Read ?
|
||||
sawyercoding_read_chunk(file, (uint8*)0x0135832C);
|
||||
sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_CURRENT_EXPENDITURE);
|
||||
|
||||
// Read ?
|
||||
sawyercoding_read_chunk(file, (uint8*)RCT2_ADDRESS_CURRENT_PARK_VALUE);
|
||||
@@ -226,8 +226,8 @@ void scenario_load_and_play(const rct_scenario_basic *scenario)
|
||||
|
||||
RCT2_GLOBAL(0x009DEB7C, sint16) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) &= 0xFFFFF7FF;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) & 0x20000)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) |= 0x800;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) & PARK_FLAGS_NO_MONEY_SCENARIO)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) |= PARK_FLAGS_NO_MONEY;
|
||||
RCT2_CALLPROC_EBPSAFE(0x00684AC3);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
news_item_init_queue();
|
||||
@@ -279,9 +279,9 @@ void scenario_load_and_play(const rct_scenario_basic *scenario)
|
||||
strcat((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, ".SV6");
|
||||
|
||||
memset((void*)0x001357848, 0, 56);
|
||||
RCT2_GLOBAL(0x0135832C, uint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, sint32) = 0;
|
||||
RCT2_GLOBAL(0x01358334, uint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_EXPENDITURE, uint32) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PROFIT, money32) = 0;
|
||||
RCT2_GLOBAL(0x01358334, money32) = 0;
|
||||
RCT2_GLOBAL(0x01358338, uint16) = 0;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, uint32) = 0x80000000;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_ADMISSIONS, uint32) = 0;
|
||||
@@ -577,7 +577,7 @@ void scenario_update()
|
||||
|
||||
if ((current_days_in_month * next_month_tick) >> 16 != (current_days_in_month * month_tick) >> 16) {
|
||||
// daily checks
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069E79A); // daily profit update
|
||||
finance_update_daily_profit(); // daily profit update
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069C35E); // some kind of peeps days_visited update loop
|
||||
get_local_time();
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066A13C); // objective 6 dragging
|
||||
|
||||
+2
-2
@@ -204,8 +204,8 @@ typedef struct {
|
||||
money32 balance_history[128];
|
||||
|
||||
// SC6[11]
|
||||
uint32 dword_0135832C;
|
||||
uint32 current_profit;
|
||||
money32 current_expenditure;
|
||||
money32 current_profit;
|
||||
uint32 dword_01358334;
|
||||
uint16 word_01358338;
|
||||
uint8 pad_0135833A[2];
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "addresses.h"
|
||||
#include "audio.h"
|
||||
#include "config.h"
|
||||
#include "climate.h"
|
||||
#include "date.h"
|
||||
@@ -309,7 +310,7 @@ static void title_play_music()
|
||||
|
||||
if (!(RCT2_GLOBAL(0x009AF284, uint32) & 1) || !(RCT2_GLOBAL(0x009AF59D, uint8) & 1)) {
|
||||
if (RCT2_GLOBAL(0x009AF600, uint8) != 0)
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BD0BD); // stop music
|
||||
stop_title_music();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -280,7 +280,7 @@ void viewport_update_position(rct_window *window)
|
||||
if (window->viewport_target_sprite != -1){
|
||||
rct_sprite* sprite = &g_sprite_list[window->viewport_target_sprite];
|
||||
|
||||
int height = map_element_height(sprite->unknown.x, sprite->unknown.y) - 16;
|
||||
int height = map_element_height(0xFFFF & sprite->unknown.x, 0xFFFF & sprite->unknown.y) - 16;
|
||||
int underground = sprite->unknown.z < height;
|
||||
|
||||
RCT2_CALLPROC_X(0x6E7A15, sprite->unknown.x, sprite->unknown.y, sprite->unknown.z, underground, (int)window, (int)viewport, 0);
|
||||
|
||||
+2
-2
@@ -946,12 +946,12 @@ static void widget_draw_image(rct_drawpixelinfo *dpi, rct_window *w, int widgetI
|
||||
|
||||
int widget_is_enabled(rct_window *w, int widgetIndex)
|
||||
{
|
||||
return w->enabled_widgets & (1LL << widgetIndex);
|
||||
return (w->enabled_widgets & (1LL << widgetIndex)) ? 1 : 0;
|
||||
}
|
||||
|
||||
int widget_is_disabled(rct_window *w, int widgetIndex)
|
||||
{
|
||||
return w->disabled_widgets & (1LL << widgetIndex);
|
||||
return (w->disabled_widgets & (1LL << widgetIndex)) ? 1 : 0;
|
||||
}
|
||||
|
||||
int widget_is_pressed(rct_window *w, int widgetIndex)
|
||||
|
||||
+18
-3
@@ -1150,7 +1150,7 @@ void window_draw_widgets(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
if ((w->flags & WF_TRANSPARENT) && !(w->flags & WF_5))
|
||||
gfx_fill_rect(dpi, w->x, w->y, w->x + w->width - 1, w->y + w->height - 1, 0x2000000 | 51);
|
||||
|
||||
//some code missing here? Between 006EB18C and 006EB260
|
||||
//todo: some code missing here? Between 006EB18C and 006EB260
|
||||
|
||||
widgetIndex = 0;
|
||||
for (widget = w->widgets; widget->type != WWT_LAST; widget++) {
|
||||
@@ -1162,7 +1162,7 @@ void window_draw_widgets(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
widgetIndex++;
|
||||
}
|
||||
|
||||
//something missing here too? Between 006EC32B and 006EC369
|
||||
//todo: something missing here too? Between 006EC32B and 006EC369
|
||||
|
||||
if (w->flags & WF_WHITE_BORDER_MASK) {
|
||||
gfx_fill_rect_inset(dpi, w->x, w->y, w->x + w->width - 1, w->y + w->height - 1, 2, 0x10);
|
||||
@@ -1495,4 +1495,19 @@ void RCT2_CALLPROC_WE_MOUSE_DOWN(int address, int widgetIndex, rct_window*w, rc
|
||||
" :[address] "+m" (address), [w] "+m" (w), [widget] "+m" (widget), [widgetIndex] "+m" (widgetIndex): : "eax", "esi", "edx", "edi"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Based on rct2: 0x6987ED and another version from window_park */
|
||||
void window_align_tabs( rct_window *w, uint8 start_tab_id, uint8 end_tab_id )
|
||||
{
|
||||
int x = w->widgets[start_tab_id].left;
|
||||
int tab_width = w->widgets[start_tab_id].right - w->widgets[start_tab_id].left;
|
||||
|
||||
for (int i = start_tab_id; i < end_tab_id; ++i){
|
||||
if ( !(w->disabled_widgets & (1LL << i)) ){
|
||||
w->widgets[i].left = x;
|
||||
w->widgets[i].right = x + tab_width;
|
||||
x += tab_width + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -203,7 +203,7 @@ typedef struct rct_window {
|
||||
sint16 page; // 0x48A
|
||||
sint16 var_48C;
|
||||
sint16 frame_no; // 0x48E updated every tic for motion in windows sprites
|
||||
uint16 list_information_type; // 0x490 0 for none
|
||||
uint16 list_information_type; // 0x490 0 for none, Used as current position of marquee in window_peep
|
||||
sint16 var_492;
|
||||
uint32 var_494;
|
||||
uint8 var_498[0x14];
|
||||
@@ -340,6 +340,7 @@ enum {
|
||||
WC_PEEP = 23,
|
||||
WC_GUEST_LIST = 24,
|
||||
WC_STAFF_LIST = 25,
|
||||
WC_FIRE_PROMPT = 26,
|
||||
WC_PARK_INFORMATION = 27,
|
||||
WC_FINANCES = 28,
|
||||
WC_TITLE_MENU = 29,
|
||||
@@ -460,6 +461,8 @@ void window_guest_list_init_vars_a();
|
||||
void window_guest_list_init_vars_b();
|
||||
void window_bubble_list_item(rct_window* w, int item_position);
|
||||
|
||||
void window_align_tabs( rct_window *w, uint8 start_tab_id, uint8 end_tab_id );
|
||||
|
||||
void window_new_ride_init_vars();
|
||||
|
||||
void window_staff_init_vars();
|
||||
|
||||
+3
-3
@@ -125,10 +125,10 @@ static void window_about_mouseup()
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_MUSIC_CREDITS:
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066D4EC);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066D55B);
|
||||
break;
|
||||
case WIDX_PUBLISHER_CREDITS:
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066D55B);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066D4EC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -193,4 +193,4 @@ static void window_about_paint()
|
||||
|
||||
// Licence
|
||||
gfx_draw_string_left(dpi, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, 0, 0, w->x + 157, w->y + 257);
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ static void window_game_bottom_toolbar_mouseup()
|
||||
switch (widgetIndex) {
|
||||
case WIDX_LEFT_OUTSET:
|
||||
case WIDX_MONEY:
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800))
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY))
|
||||
window_finances_open();
|
||||
break;
|
||||
case WIDX_GUESTS:
|
||||
@@ -316,7 +316,7 @@ static void window_game_bottom_toolbar_invalidate()
|
||||
}
|
||||
|
||||
// Hide money if there is no money
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & 0x800) {
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) {
|
||||
window_game_bottom_toolbar_widgets[WIDX_MONEY].type = WWT_EMPTY;
|
||||
window_game_bottom_toolbar_widgets[WIDX_GUESTS].top = 1;
|
||||
window_game_bottom_toolbar_widgets[WIDX_GUESTS].bottom = 17;
|
||||
@@ -399,7 +399,7 @@ static void window_game_bottom_toolbar_draw_left_panel(rct_drawpixelinfo *dpi, r
|
||||
y = window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top + w->y + 4;
|
||||
|
||||
// Draw money
|
||||
if (!(RCT2_GLOBAL(0x0013573E4, uint32) & 0x800)) {
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) {
|
||||
RCT2_GLOBAL(0x013CE952, int) = DECRYPT_MONEY(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONEY_ENCRYPTED, sint32));
|
||||
gfx_draw_string_centred(
|
||||
dpi,
|
||||
|
||||
@@ -170,6 +170,7 @@ void window_game_top_toolbar_open()
|
||||
(1 << WIDX_RIDES) |
|
||||
(1 << WIDX_PARK) |
|
||||
(1 << WIDX_STAFF) |
|
||||
(1 << WIDX_GUESTS) |
|
||||
(1 << WIDX_CLEAR_SCENERY) |
|
||||
(1ULL << WIDX_FASTFORWARD) |
|
||||
(1ULL << WIDX_RESEARCH);
|
||||
|
||||
+1
-39
@@ -135,7 +135,7 @@ static void window_guest_list_find_groups();
|
||||
static int get_guest_face_sprite_small(rct_peep *peep);
|
||||
static int get_guest_face_sprite_large(rct_peep *peep);
|
||||
static void get_arguments_from_peep(rct_peep *peep, uint32 *argument_1, uint32* argument_2);
|
||||
void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2);
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006992E3
|
||||
@@ -730,44 +730,6 @@ static int window_guest_list_is_peep_in_filter(rct_peep* peep)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* rct2: 0x00698342
|
||||
* thought.item (eax)
|
||||
* thought.type (ebx)
|
||||
* argument_1 (esi & ebx)
|
||||
* argument_2 (esi+2)
|
||||
*/
|
||||
void get_arguments_from_thought(rct_peep_thought thought, uint32* argument_1, uint32* argument_2){
|
||||
int esi = 0x9AC86C;
|
||||
|
||||
if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 1){
|
||||
rct_ride* ride = &g_ride_list[thought.item];
|
||||
esi = (int)(&(ride->var_04A));
|
||||
}
|
||||
else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 2){
|
||||
if (thought.item < 0x20){
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM_START;
|
||||
}
|
||||
else{
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM2_START;
|
||||
}
|
||||
}
|
||||
else if ((RCT2_ADDRESS(0x981DB1, uint16)[thought.type] & 0xFF) & 4){
|
||||
if (thought.item < 0x20){
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM_SINGULAR_START;
|
||||
}
|
||||
else
|
||||
{
|
||||
RCT2_GLOBAL(0x9AC86C, uint16) = thought.item + STR_ITEM2_SINGULAR_START;
|
||||
}
|
||||
}
|
||||
else{
|
||||
esi = 0x9AC864; //No thought?
|
||||
}
|
||||
*argument_1 = ((thought.type + STR_THOUGHT_START) & 0xFFFF) | (*((uint16*)esi) << 16);
|
||||
*argument_2 = *((uint32*)(esi+2)); //Always 0 apart from on rides?
|
||||
}
|
||||
|
||||
/**
|
||||
* rct2:0x0069B7EA
|
||||
* Calculates a hash value (arguments) for comparing peep actions/thoughts
|
||||
|
||||
@@ -174,7 +174,7 @@ void window_new_campaign_open(sint16 campaignType)
|
||||
numApplicableRides = 0;
|
||||
window_new_campaign_rides[0] = 255;
|
||||
FOR_ALL_RIDES(i, ride) {
|
||||
if (!(RCT2_GLOBAL(0x0097CF40 + (ride->type * 8), uint32) & 0x03820000))
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_RIDE_FLAGS + (ride->type * 8), uint32) & 0x03820000))
|
||||
window_new_campaign_rides[numApplicableRides++] = i;
|
||||
}
|
||||
window_new_campaign_rides[numApplicableRides] = 255;
|
||||
|
||||
+10
-10
@@ -29,7 +29,7 @@
|
||||
#include "widget.h"
|
||||
#include "window.h"
|
||||
|
||||
#define _window_new_ride_current_tab RCT2_GLOBAL(0x00F43824, uint8)
|
||||
#define _window_new_ride_current_tab RCT2_GLOBAL(RCT2_ADDRESS_WINDOW_RIDE_LIST_SELECTED_TAB, uint8)
|
||||
|
||||
typedef struct {
|
||||
uint8 type;
|
||||
@@ -374,7 +374,7 @@ static void window_new_ride_scroll_to_focused_ride(rct_window *w)
|
||||
|
||||
// Find row index of the focused ride type
|
||||
rct_widget *listWidget = &window_new_ride_widgets[WIDX_RIDE_LIST];
|
||||
int focusRideType = RCT2_ADDRESS(0x00F43825, uint16)[_window_new_ride_current_tab];
|
||||
int focusRideType = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, uint16)[_window_new_ride_current_tab];
|
||||
int count = 0, row = 0;
|
||||
ride_list_item *listItem = (ride_list_item*)0x00F43523;
|
||||
while (listItem->type != 255 || listItem->entry_index != 255) {
|
||||
@@ -436,7 +436,7 @@ void window_new_ride_open()
|
||||
|
||||
window_new_ride_populate_list();
|
||||
|
||||
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(0x00F43825, sint16)[_window_new_ride_current_tab];
|
||||
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, sint16)[_window_new_ride_current_tab];
|
||||
if (w->new_ride.highlighted_ride_id == -1)
|
||||
w->new_ride.highlighted_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
|
||||
@@ -468,7 +468,7 @@ static void window_new_ride_refresh_widget_sizing(rct_window *w)
|
||||
window_new_ride_widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].type = WWT_GROUPBOX;
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].type = WWT_GROUPBOX;
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11))
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY))
|
||||
window_new_ride_widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WWT_FLATBTN;
|
||||
|
||||
width = 300;
|
||||
@@ -579,7 +579,7 @@ static void window_new_ride_mousedown(int widgetIndex, rct_window *w, rct_widget
|
||||
w->new_ride.selected_ride_countdown = -1;
|
||||
window_new_ride_populate_list();
|
||||
if (page < WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(0x00F43825, sint16)[page];
|
||||
w->new_ride.highlighted_ride_id = RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, sint16)[page];
|
||||
if (w->new_ride.highlighted_ride_id == -1)
|
||||
w->new_ride.highlighted_ride_id = RCT2_GLOBAL(0x00F43523, sint16);
|
||||
}
|
||||
@@ -654,7 +654,7 @@ static void window_new_ride_scrollmousedown()
|
||||
if (item.type == 255 && item.entry_index == 255)
|
||||
return;
|
||||
|
||||
RCT2_ADDRESS(0x00F43825, ride_list_item)[_window_new_ride_current_tab] = item;
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, ride_list_item)[_window_new_ride_current_tab] = item;
|
||||
w->new_ride.selected_ride_id = *((sint16*)&item);
|
||||
|
||||
sound_play_panned(SOUND_CLICK_1, w->x + (w->width / 2));
|
||||
@@ -683,7 +683,7 @@ static void window_new_ride_scrollmouseover()
|
||||
return;
|
||||
|
||||
w->new_ride.highlighted_ride_id = *((sint16*)&item);
|
||||
RCT2_ADDRESS(0x00F43825, ride_list_item)[_window_new_ride_current_tab] = item;
|
||||
RCT2_ADDRESS(RCT2_ADDRESS_WINDOW_RIDE_LIST_HIGHLIGHTED_ITEM, ride_list_item)[_window_new_ride_current_tab] = item;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ static void window_new_ride_invalidate()
|
||||
|
||||
if (_window_new_ride_current_tab == WINDOW_NEW_RIDE_PAGE_RESEARCH) {
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
|
||||
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
|
||||
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = typeId >= 0x10000 ? 5189 : 5191;
|
||||
@@ -790,7 +790,7 @@ static void window_new_ride_paint()
|
||||
x = w->x + 10;
|
||||
y = w->y + window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
|
||||
|
||||
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
if (typeId >= 0x10000) {
|
||||
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
||||
@@ -944,7 +944,7 @@ static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixeli
|
||||
}
|
||||
|
||||
// Price
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)) {
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) {
|
||||
// Get price of ride
|
||||
int unk2 = RCT2_GLOBAL(0x0097CC68 + (item.type * 2), uint8);
|
||||
money32 price = RCT2_GLOBAL(0x0097DD78 + (item.type * 4), uint16);
|
||||
|
||||
@@ -230,6 +230,8 @@ void window_options_open()
|
||||
(1ULL << WIDX_MUSIC_DROPDOWN) |
|
||||
(1ULL << WIDX_SOUND_QUALITY) |
|
||||
(1ULL << WIDX_SOUND_QUALITY_DROPDOWN) |
|
||||
(1ULL << WIDX_LANGUAGE) |
|
||||
(1ULL << WIDX_LANGUAGE_DROPDOWN) |
|
||||
(1ULL << WIDX_CURRENCY) |
|
||||
(1ULL << WIDX_CURRENCY_DROPDOWN) |
|
||||
(1ULL << WIDX_DISTANCE) |
|
||||
@@ -379,7 +381,7 @@ static void window_options_mousedown(int widgetIndex, rct_window*w, rct_widget*
|
||||
|
||||
window_options_show_dropdown(w, widget, gAudioDeviceCount);
|
||||
|
||||
gDropdownItemsChecked |= (1 << RCT2_GLOBAL(0x9AF280, uint32));
|
||||
gDropdownItemsChecked |= (1 << RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, uint32));
|
||||
break;
|
||||
case WIDX_HEIGHT_LABELS_DROPDOWN:
|
||||
gDropdownItemsFormat[0] = 1142;
|
||||
@@ -500,13 +502,15 @@ static void window_options_dropdown()
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_SOUND_DROPDOWN:
|
||||
#ifdef _MSC_VER
|
||||
audio_init2(dropdownIndex);
|
||||
/*#ifdef _MSC_VER
|
||||
__asm movzx ax, dropdownIndex
|
||||
#else
|
||||
__asm__ ( "movzx ax, %[dropdownIndex] " : : [dropdownIndex] "g" ((char)dropdownIndex) );
|
||||
#endif
|
||||
// the switch replaces ax value
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BA9B5); // part of init audio
|
||||
RCT2_CALLPROC_EBPSAFE(0x006BA9B5); // part of init audio*/
|
||||
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_HEIGHT_LABELS_DROPDOWN:
|
||||
@@ -670,7 +674,7 @@ static void window_options_invalidate()
|
||||
window_options_widgets[WIDX_HEIGHT_LABELS_DROPDOWN].type = WWT_DROPDOWN_BUTTON;
|
||||
break;
|
||||
case WINDOW_OPTIONS_PAGE_AUDIO:
|
||||
currentSoundDevice = RCT2_GLOBAL(0x009AF280, sint32);
|
||||
currentSoundDevice = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_SOUND_DEVICE, sint32);
|
||||
|
||||
// sound devices
|
||||
if (currentSoundDevice == -1 || gAudioDeviceCount == 0) {
|
||||
|
||||
+20
-25
@@ -576,9 +576,9 @@ static uint32 window_park_page_enabled_widgets[] = {
|
||||
static void window_park_init_viewport(rct_window *w);
|
||||
static void window_park_set_page(rct_window *w, int page);
|
||||
static void window_park_anchor_border_widgets(rct_window *w);
|
||||
static void window_park_align_tabs(rct_window *w);
|
||||
static void window_park_set_pressed_tab(rct_window *w);
|
||||
static void window_park_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
|
||||
static void window_park_set_disabled_tabs(rct_window *w);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -598,7 +598,7 @@ rct_window *window_park_open()
|
||||
w->list_information_type = -1;
|
||||
w->var_48C = -1;
|
||||
w->var_492 = 0;
|
||||
RCT2_CALLPROC_X(0x00667F8B, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
window_park_set_disabled_tabs(w);
|
||||
w->colours[0] = 1;
|
||||
w->colours[1] = 19;
|
||||
w->colours[2] = 19;
|
||||
@@ -606,6 +606,16 @@ rct_window *window_park_open()
|
||||
return w;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00667F8B
|
||||
*/
|
||||
void window_park_set_disabled_tabs(rct_window *w)
|
||||
{
|
||||
// Disable price tab if money is disabled
|
||||
w->disabled_widgets = (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY) ? (1 << WIDX_TAB_4) : 0;
|
||||
}
|
||||
|
||||
#pragma region Entrance page
|
||||
|
||||
/**
|
||||
@@ -916,7 +926,7 @@ static void window_park_entrance_invalidate()
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_TYPE, uint8) == OBJECTIVE_GUESTS_AND_RATING)
|
||||
w->disabled_widgets |= (1 << WIDX_OPEN_OR_CLOSE);
|
||||
|
||||
window_park_align_tabs(w);
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
window_park_anchor_border_widgets(w);
|
||||
|
||||
// Anchor entrance page specific widgets
|
||||
@@ -1149,7 +1159,7 @@ static void window_park_rating_invalidate()
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = RCT2_GLOBAL(0x013573D4, uint16);
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint32) = RCT2_GLOBAL(0x013573D8, uint32);
|
||||
|
||||
window_park_align_tabs(w);
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
window_park_anchor_border_widgets(w);
|
||||
}
|
||||
|
||||
@@ -1284,7 +1294,7 @@ static void window_park_guests_invalidate()
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = RCT2_GLOBAL(0x013573D4, uint16);
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint32) = RCT2_GLOBAL(0x013573D8, uint32);
|
||||
|
||||
window_park_align_tabs(w);
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
window_park_anchor_border_widgets(w);
|
||||
}
|
||||
|
||||
@@ -1434,7 +1444,7 @@ static void window_park_price_invalidate()
|
||||
RCT2_GLOBAL(0x013CE952 + 6, uint32) = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16);
|
||||
window_park_price_widgets[WIDX_PRICE].image = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16) == 0 ? STR_FREE : 1429;
|
||||
|
||||
window_park_align_tabs(w);
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
window_park_anchor_border_widgets(w);
|
||||
}
|
||||
|
||||
@@ -1543,7 +1553,7 @@ static void window_park_stats_invalidate()
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = RCT2_GLOBAL(0x013573D4, uint16);
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint32) = RCT2_GLOBAL(0x013573D8, uint32);
|
||||
|
||||
window_park_align_tabs(w);
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
window_park_anchor_border_widgets(w);
|
||||
}
|
||||
|
||||
@@ -1705,7 +1715,7 @@ static void window_park_objective_invalidate()
|
||||
else
|
||||
window_park_objective_widgets[WIDX_ENTER_NAME].type = WWT_EMPTY;
|
||||
|
||||
window_park_align_tabs(w);
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
window_park_anchor_border_widgets(w);
|
||||
}
|
||||
|
||||
@@ -1852,7 +1862,7 @@ static void window_park_awards_invalidate()
|
||||
RCT2_GLOBAL(0x013CE952, uint16) = RCT2_GLOBAL(0x013573D4, uint16);
|
||||
RCT2_GLOBAL(0x013CE952 + 2, uint32) = RCT2_GLOBAL(0x013573D8, uint32);
|
||||
|
||||
window_park_align_tabs(w);
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_7);
|
||||
window_park_anchor_border_widgets(w);
|
||||
}
|
||||
|
||||
@@ -1925,7 +1935,7 @@ static void window_park_set_page(rct_window *w, int page)
|
||||
w->var_020 = RCT2_GLOBAL(0x0097BAE0 + (page * 4), uint32);
|
||||
w->event_handlers = window_park_page_events[page];
|
||||
w->widgets = window_park_page_widgets[page];
|
||||
RCT2_CALLPROC_X(0x00667F8B, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
window_park_set_disabled_tabs(w);
|
||||
window_invalidate(w);
|
||||
|
||||
RCT2_CALLPROC_X(w->event_handlers[WE_RESIZE], 0, 0, 0, 0, (int)w, 0, 0);
|
||||
@@ -1945,21 +1955,6 @@ static void window_park_anchor_border_widgets(rct_window *w)
|
||||
w->widgets[WIDX_CLOSE].right = w->width - 3;
|
||||
}
|
||||
|
||||
static void window_park_align_tabs(rct_window *w)
|
||||
{
|
||||
int i, x, tab_width;
|
||||
|
||||
x = w->widgets[WIDX_TAB_1].left;
|
||||
tab_width = w->widgets[WIDX_TAB_1].right - w->widgets[WIDX_TAB_1].left;
|
||||
for (i = 0; i < 7; i++) {
|
||||
if (w->disabled_widgets & (1LL << (WIDX_TAB_1 + i)))
|
||||
continue;
|
||||
w->widgets[WIDX_TAB_1 + i].left = x;
|
||||
w->widgets[WIDX_TAB_1 + i].right = x + tab_width;
|
||||
x += tab_width + 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void window_park_set_pressed_tab(rct_window *w)
|
||||
{
|
||||
int i;
|
||||
|
||||
+406
-22
@@ -58,7 +58,9 @@ enum WINDOW_PEEP_WIDGET_IDX {
|
||||
WIDX_PICKUP,
|
||||
WIDX_RENAME,
|
||||
WIDX_LOCATE,
|
||||
WIDX_TRACK
|
||||
WIDX_TRACK,
|
||||
|
||||
WIDX_RIDE_SCROLL = 10
|
||||
};
|
||||
|
||||
void window_peep_emptysub(){};
|
||||
@@ -77,21 +79,92 @@ rct_widget window_peep_overview_widgets[] = {
|
||||
{ WWT_12, 1, 3, 166, 45, 56, 0x0FFFFFFFF, STR_NONE}, // Label Thought marquee
|
||||
{ WWT_VIEWPORT, 1, 3, 166, 57, 143, 0x0FFFFFFFF, STR_NONE }, // Viewport
|
||||
{ WWT_12, 1, 3, 166, 144, 154, 0x0FFFFFFFF, STR_NONE}, // Label Action
|
||||
{ WWT_FLATBTN, 1, 167, 190, 45, 68, SPR_RENAME, 1706}, // Pickup Button
|
||||
{ WWT_FLATBTN, 1, 167, 190, 69, 92, 0x1430, 1055}, // Rename Button
|
||||
{ WWT_FLATBTN, 1, 167, 190, 45, 68, 0x1436, 1706}, // Pickup Button
|
||||
{ WWT_FLATBTN, 1, 167, 190, 69, 92, SPR_RENAME, 1055}, // Rename Button
|
||||
{ WWT_FLATBTN, 1, 167, 190, 93, 116, SPR_LOCATE, STR_LOCATE_SUBJECT_TIP},// Locate Button
|
||||
{ WWT_FLATBTN, 1, 167, 190, 117, 140, SPR_TRACK_PEEP, 1930}, // Track Button
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
rct_widget window_peep_stats_widgets[] = {
|
||||
{WWT_FRAME, 0, 0, 191, 0, 156, -1, STR_NONE},
|
||||
{WWT_CAPTION, 0, 1, 190, 1, 14, 865, STR_WINDOW_TITLE_TIP},
|
||||
{WWT_CLOSEBOX, 0, 179, 189, 2, 13, 824, STR_CLOSE_WINDOW_TIP},
|
||||
{WWT_RESIZE, 1, 0, 191, 43, 156, -1, STR_NONE},
|
||||
{WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 1938},
|
||||
{WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 1940},
|
||||
{WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 1941},
|
||||
{WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 1942},
|
||||
{WWT_TAB, 1, 127, 157, 17, 43, 0x2000144E, 1943},
|
||||
{WWT_TAB, 1, 158, 188, 17, 43, 0x2000144E, 1944},
|
||||
{WIDGETS_END},
|
||||
};
|
||||
|
||||
rct_widget window_peep_rides_widgets[] = {
|
||||
{WWT_FRAME, 0, 0, 191, 0, 156, -1, STR_NONE},
|
||||
{WWT_CAPTION, 0, 1, 190, 1, 14, 865, STR_WINDOW_TITLE_TIP},
|
||||
{WWT_CLOSEBOX, 0, 179, 189, 2, 13, 824, STR_CLOSE_WINDOW_TIP},
|
||||
{WWT_RESIZE, 1, 0, 191, 43, 156, -1, STR_NONE},
|
||||
{WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 1938},
|
||||
{WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 1940},
|
||||
{WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 1941},
|
||||
{WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 1942},
|
||||
{WWT_TAB, 1, 127, 157, 17, 43, 0x2000144E, 1943},
|
||||
{WWT_TAB, 1, 158, 188, 17, 43, 0x2000144E, 1944},
|
||||
{WWT_SCROLL, 1, 3, 188, 57, 143, 2, STR_NONE},
|
||||
{WIDGETS_END},
|
||||
};
|
||||
|
||||
rct_widget window_peep_finance_widgets[] = {
|
||||
{WWT_FRAME, 0, 0, 191, 0, 156, -1, STR_NONE},
|
||||
{WWT_CAPTION, 0, 1, 190, 1, 14, 865, STR_WINDOW_TITLE_TIP},
|
||||
{WWT_CLOSEBOX, 0, 179, 189, 2, 13, 824, STR_CLOSE_WINDOW_TIP},
|
||||
{WWT_RESIZE, 1, 0, 191, 43, 156, -1, STR_NONE},
|
||||
{WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 1938},
|
||||
{WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 1940},
|
||||
{WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 1941},
|
||||
{WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 1942},
|
||||
{WWT_TAB, 1, 127, 157, 17, 43, 0x2000144E, 1943},
|
||||
{WWT_TAB, 1, 158, 188, 17, 43, 0x2000144E, 1944},
|
||||
{WIDGETS_END},
|
||||
};
|
||||
|
||||
rct_widget window_peep_thoughts_widgets[] = {
|
||||
{WWT_FRAME, 0, 0, 191, 0, 156, -1, STR_NONE},
|
||||
{WWT_CAPTION, 0, 1, 190, 1, 14, 865, STR_WINDOW_TITLE_TIP},
|
||||
{WWT_CLOSEBOX, 0, 179, 189, 2, 13, 824, STR_CLOSE_WINDOW_TIP},
|
||||
{WWT_RESIZE, 1, 0, 191, 43, 156, -1, STR_NONE},
|
||||
{WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 1938},
|
||||
{WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 1940},
|
||||
{WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 1941},
|
||||
{WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 1942},
|
||||
{WWT_TAB, 1, 127, 157, 17, 43, 0x2000144E, 1943},
|
||||
{WWT_TAB, 1, 158, 188, 17, 43, 0x2000144E, 1944},
|
||||
{WIDGETS_END},
|
||||
};
|
||||
|
||||
rct_widget window_peep_inventory_widgets[] = {
|
||||
{WWT_FRAME, 0, 0, 191, 0, 156, -1, STR_NONE},
|
||||
{WWT_CAPTION, 0, 1, 190, 1, 14, 865, STR_WINDOW_TITLE_TIP},
|
||||
{WWT_CLOSEBOX, 0, 179, 189, 2, 13, 824, STR_CLOSE_WINDOW_TIP},
|
||||
{WWT_RESIZE, 1, 0, 191, 43, 156, -1, STR_NONE},
|
||||
{WWT_TAB, 1, 3, 33, 17, 43, 0x2000144E, 1938},
|
||||
{WWT_TAB, 1, 34, 64, 17, 43, 0x2000144E, 1940},
|
||||
{WWT_TAB, 1, 65, 95, 17, 43, 0x2000144E, 1941},
|
||||
{WWT_TAB, 1, 96, 126, 17, 43, 0x2000144E, 1942},
|
||||
{WWT_TAB, 1, 127, 157, 17, 43, 0x2000144E, 1943},
|
||||
{WWT_TAB, 1, 158, 188, 17, 43, 0x2000144E, 1944},
|
||||
{WIDGETS_END},
|
||||
};
|
||||
|
||||
//0x981D0C
|
||||
rct_widget *window_peep_page_widgets[] = {
|
||||
window_peep_overview_widgets,
|
||||
(rct_widget *)0x9AC45C,
|
||||
(rct_widget *)0x9ac500,
|
||||
(rct_widget *)0x9ac5b4,
|
||||
(rct_widget *)0x9ac658,
|
||||
(rct_widget *)0x9ac6FC
|
||||
window_peep_stats_widgets,
|
||||
window_peep_rides_widgets,
|
||||
window_peep_finance_widgets,
|
||||
window_peep_thoughts_widgets,
|
||||
window_peep_inventory_widgets
|
||||
};
|
||||
|
||||
void window_peep_set_page(rct_window* w, int page);
|
||||
@@ -102,6 +175,8 @@ void window_peep_close();
|
||||
void window_peep_resize();
|
||||
void window_peep_overview_mouse_up();
|
||||
void window_peep_overview_paint();
|
||||
void window_peep_overview_invalidate();
|
||||
void window_peep_overview_viewport_init_wrapper();
|
||||
|
||||
static void* window_peep_overview_events[] = {
|
||||
window_peep_close,
|
||||
@@ -124,24 +199,179 @@ static void* window_peep_overview_events[] = {
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*)0x696A6A,
|
||||
(void*)0x697076,
|
||||
window_peep_overview_viewport_init_wrapper,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*)0x696749, //Invalidate
|
||||
window_peep_overview_invalidate, //Invalidate
|
||||
window_peep_overview_paint, //Paint
|
||||
(void*)0x69707C
|
||||
window_peep_emptysub
|
||||
};
|
||||
|
||||
static void* window_peep_stats_events[] = {
|
||||
window_peep_emptysub,
|
||||
(void*) 0x0069744F, //mouse_up
|
||||
(void*) 0x00697488, //resize
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x006974ED,
|
||||
(void*) 0x0069746A,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x0069707D, //invalidate
|
||||
(void*) 0x0069711D, //paint
|
||||
window_peep_emptysub
|
||||
};
|
||||
|
||||
static void* window_peep_rides_events[] = {
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697795, //mouse_up
|
||||
(void*) 0x006978F4, //resize
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697959,
|
||||
(void*) 0x006977B0,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x0069784E,
|
||||
(void*) 0x006978CC,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x0069789C,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697844,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x0069757A, //invalidate
|
||||
(void*) 0x00697637, //paint
|
||||
(void*) 0x006976FC
|
||||
};
|
||||
|
||||
static void* window_peep_finance_events[] = {
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697BDD, //mouse_up
|
||||
(void*) 0x00697C16, //resize
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697C7B,
|
||||
(void*) 0x00697BF8,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697968, //invalidate
|
||||
(void*) 0x00697A08, //paint
|
||||
window_peep_emptysub
|
||||
};
|
||||
|
||||
static void* window_peep_thoughts_events[] = {
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697E18, //mouse_up
|
||||
(void*) 0x00697E33, //resize
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697ED2,
|
||||
(void*) 0x00697EB4,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697C8A, //invalidate
|
||||
(void*) 0x00697D2A, //paint
|
||||
window_peep_emptysub
|
||||
};
|
||||
|
||||
static void* window_peep_inventory_events[] = {
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00698279, //mouse_up
|
||||
(void*) 0x00698294, //resize
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00698333,
|
||||
(void*) 0x00698315,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
window_peep_emptysub,
|
||||
(void*) 0x00697EE1, //invalidate
|
||||
(void*) 0x00697F81, //paint
|
||||
window_peep_emptysub
|
||||
};
|
||||
|
||||
//0x981D24
|
||||
void* window_peep_page_events[] = {
|
||||
window_peep_overview_events,
|
||||
(void*)0x982468,
|
||||
(void*)0x9824d8,
|
||||
(void*)0x982548,
|
||||
(void*)0x9825b8,
|
||||
(void*)0x982628
|
||||
window_peep_stats_events,
|
||||
window_peep_rides_events,
|
||||
window_peep_finance_events,
|
||||
window_peep_thoughts_events,
|
||||
window_peep_inventory_events
|
||||
};
|
||||
|
||||
//0x981D3C
|
||||
@@ -172,8 +402,8 @@ uint32 window_peep_page_enabled_widgets[] = {
|
||||
(1 << WIDX_TAB_3) |
|
||||
(1 << WIDX_TAB_4) |
|
||||
(1 << WIDX_TAB_5) |
|
||||
(1 << WIDX_TAB_6), //|
|
||||
//(1 << WIDX_?),
|
||||
(1 << WIDX_TAB_6) |
|
||||
(1 << WIDX_RIDE_SCROLL),
|
||||
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
@@ -270,7 +500,7 @@ void window_peep_disable_widgets(rct_window* w){
|
||||
if (!(w->disabled_widgets & (1 << WIDX_PICKUP)))
|
||||
window_invalidate(w);
|
||||
}
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11){
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY){
|
||||
disabled_widgets |= (1 << WIDX_TAB_4); //Disable finance tab if no money
|
||||
}
|
||||
w->disabled_widgets = disabled_widgets;
|
||||
@@ -340,7 +570,6 @@ void window_peep_overview_mouse_up(){
|
||||
window_peep_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
break;
|
||||
case WIDX_PICKUP:
|
||||
//696ba6
|
||||
if (!peep_can_be_picked_up(peep)) {
|
||||
return;
|
||||
}
|
||||
@@ -360,7 +589,6 @@ void window_peep_overview_mouse_up(){
|
||||
RCT2_CALLPROC_X(0x0069A42F, 0, 0, 0, 0, (int)peep, 0, 0);
|
||||
break;
|
||||
case WIDX_RENAME:
|
||||
//696e4d
|
||||
window_show_textinput(w, (int)widgetIndex, 0x5AC, 0x5AD, peep->name_string_idx);
|
||||
break;
|
||||
case WIDX_LOCATE:
|
||||
@@ -415,6 +643,13 @@ void window_peep_set_page(rct_window* w, int page){
|
||||
if (listen && w->viewport) w->viewport->flags |= VIEWPORT_FLAG_SOUND_ON;
|
||||
}
|
||||
|
||||
void window_peep_overview_viewport_init_wrapper(){
|
||||
rct_window* w;
|
||||
window_get_register(w);
|
||||
|
||||
window_peep_viewport_init(w);
|
||||
}
|
||||
|
||||
/* rct2: 0x0069883C */
|
||||
void window_peep_viewport_init(rct_window* w){
|
||||
if (w->page != WINDOW_PEEP_OVERVIEW) return;
|
||||
@@ -534,7 +769,156 @@ void window_peep_overview_paint(){
|
||||
//69861f
|
||||
//69869b
|
||||
//698661
|
||||
|
||||
// Draw the viewport no sound sprite
|
||||
if (w->viewport){
|
||||
window_draw_viewport(dpi, w);
|
||||
rct_viewport* viewport = w->viewport;
|
||||
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON){
|
||||
gfx_draw_sprite(dpi, SPR_HEARING_VIEWPORT, w->x + 2, w->y + 2, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the centered label
|
||||
uint32 argument1, argument2;
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
get_arguments_from_action(peep, &argument1, &argument2);
|
||||
RCT2_GLOBAL(0x13CE952, uint32) = argument1;
|
||||
RCT2_GLOBAL(0x13CE952 + 4, uint32) = argument2;
|
||||
rct_widget* widget = &w->widgets[WIDX_ACTION_LBL];
|
||||
int x = (widget->left + widget->right) / 2 + w->x;
|
||||
int y = w->y + widget->top - 1;
|
||||
int width = widget->right - widget->left;
|
||||
gfx_draw_string_centred_clipped(dpi, 1191, (void*)0x13CE952, 0, x, y, width);
|
||||
|
||||
// Draw the marquee thought
|
||||
widget = &w->widgets[WIDX_MARQUEE];
|
||||
width = widget->right - widget->left - 3;
|
||||
int left = widget->left + 2 + w->x;
|
||||
int top = widget->top + w->y;
|
||||
int height = widget->bottom - widget->top;
|
||||
rct_drawpixelinfo* dpi_marquee = clip_drawpixelinfo(dpi, left, width, top, height);
|
||||
|
||||
if (!dpi_marquee)return;
|
||||
int i = 0;
|
||||
for (; i < PEEP_MAX_THOUGHTS; ++i){
|
||||
if (peep->thoughts[i].type == PEEP_THOUGHT_TYPE_NONE){
|
||||
w->list_information_type = 0;
|
||||
return;
|
||||
}
|
||||
if (peep->thoughts[i].var_2 == 1){ // If a fresh thought
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == PEEP_MAX_THOUGHTS){
|
||||
w->list_information_type = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
get_arguments_from_thought(peep->thoughts[i], &argument1, &argument2);
|
||||
|
||||
RCT2_GLOBAL(0x13CE952, uint32) = argument1;
|
||||
RCT2_GLOBAL(0x13CE952 + 4, uint32) = argument2;
|
||||
RCT2_GLOBAL(0x13CE952 + 8, uint16) = 0;
|
||||
|
||||
x = widget->right - widget->left - w->list_information_type;
|
||||
gfx_draw_string_left(dpi_marquee, 1193, (void*)0x13CE952, 0, x, 0);
|
||||
}
|
||||
|
||||
/* rct2: 0x696749*/
|
||||
void window_peep_overview_invalidate(){
|
||||
rct_window* w;
|
||||
window_get_register(w);
|
||||
|
||||
if (window_peep_page_widgets[w->page] != w->widgets){
|
||||
w->widgets = window_peep_page_widgets[w->page];
|
||||
window_init_scroll_widgets(w);
|
||||
}
|
||||
|
||||
w->pressed_widgets &= ~(WIDX_TAB_1 | WIDX_TAB_2 |WIDX_TAB_3 |WIDX_TAB_4 |WIDX_TAB_5 |WIDX_TAB_6);
|
||||
w->pressed_widgets |= 1ULL << (w->page + WIDX_TAB_1);
|
||||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
RCT2_GLOBAL(0x13CE952,uint16) = peep->name_string_idx;
|
||||
RCT2_GLOBAL(0x13CE954,uint32) = peep->id;
|
||||
|
||||
w->pressed_widgets &= ~(1<<WIDX_TRACK);
|
||||
if (peep->flags & 0x8){
|
||||
w->pressed_widgets |= (1<<WIDX_TRACK);
|
||||
}
|
||||
|
||||
window_peep_overview_widgets[WIDX_BACKGROUND].right = w->width - 1;
|
||||
window_peep_overview_widgets[WIDX_BACKGROUND].bottom = w->height - 1;
|
||||
|
||||
window_peep_overview_widgets[WIDX_PAGE_BACKGROUND].right =w->width - 1;
|
||||
window_peep_overview_widgets[WIDX_PAGE_BACKGROUND].bottom = w->height - 1;
|
||||
|
||||
window_peep_overview_widgets[WIDX_TITLE].right = w->width - 2;
|
||||
|
||||
window_peep_overview_widgets[WIDX_CLOSE].left = w->width - 13;
|
||||
window_peep_overview_widgets[WIDX_CLOSE].right = w->width - 3;
|
||||
|
||||
window_peep_overview_widgets[WIDX_VIEWPORT].right = w->width - 26;
|
||||
window_peep_overview_widgets[WIDX_VIEWPORT].bottom = w->height - 14;
|
||||
|
||||
window_peep_overview_widgets[WIDX_ACTION_LBL].top = w->height - 12;
|
||||
window_peep_overview_widgets[WIDX_ACTION_LBL].bottom = w->height - 3;
|
||||
window_peep_overview_widgets[WIDX_ACTION_LBL].right = w->width - 24;
|
||||
|
||||
window_peep_overview_widgets[WIDX_MARQUEE].right = w->width - 24;
|
||||
|
||||
window_peep_overview_widgets[WIDX_PICKUP].right = w->width - 2;
|
||||
window_peep_overview_widgets[WIDX_RENAME].right = w->width - 2;
|
||||
window_peep_overview_widgets[WIDX_LOCATE].right = w->width - 2;
|
||||
window_peep_overview_widgets[WIDX_TRACK].right = w->width - 2;
|
||||
|
||||
window_peep_overview_widgets[WIDX_PICKUP].left = w->width - 25;
|
||||
window_peep_overview_widgets[WIDX_RENAME].left = w->width - 25;
|
||||
window_peep_overview_widgets[WIDX_LOCATE].left = w->width - 25;
|
||||
window_peep_overview_widgets[WIDX_TRACK].left = w->width - 25;
|
||||
|
||||
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_6);
|
||||
}
|
||||
|
||||
void window_peep_overview_tab_paint( rct_window* w, rct_drawpixelinfo* dpi){
|
||||
|
||||
if ( w->disabled_widgets & (1ULL<<WIDX_TAB_1) )return;
|
||||
|
||||
//ax
|
||||
int x = w->widgets[WIDX_TAB_1].left + 1 + w->x;
|
||||
//cx
|
||||
int y = w->widgets[WIDX_TAB_1].top + 1 + w->y;
|
||||
//bx
|
||||
int width = w->widgets[WIDX_TAB_1].right - 1 - w->widgets[WIDX_TAB_1].left;
|
||||
//dx
|
||||
int height = w->widgets[WIDX_TAB_1].bottom - 1 - w->widgets[WIDX_TAB_1].top;
|
||||
|
||||
if (w->page == WINDOW_PEEP_OVERVIEW){
|
||||
height++;
|
||||
}
|
||||
|
||||
rct_drawpixelinfo* cliped_dpi = clip_drawpixelinfo( dpi, x, width, y, height );
|
||||
|
||||
if (!cliped_dpi) return;
|
||||
|
||||
int cx = 14;
|
||||
int dx = 20;
|
||||
|
||||
//ebp
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
|
||||
if (peep->type == 1 && peep->staff_type == 3)
|
||||
dx++;
|
||||
int eax = RCT2_GLOBAL(peep->sprite_type*8 + 0x982708, uint32);
|
||||
int ebx = *(uint32*)eax;
|
||||
ebx++;
|
||||
eax = 0;
|
||||
|
||||
if (w->page == WINDOW_PEEP_OVERVIEW){
|
||||
int ax = *((uint16*)w + 496 / 2);
|
||||
ax &= ~((1<<0)|(1<<1));
|
||||
}
|
||||
ebx += eax;
|
||||
//698474
|
||||
}
|
||||
@@ -310,7 +310,7 @@ static void window_research_development_invalidate()
|
||||
window_research_set_pressed_tab(w);
|
||||
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_EMPTY;
|
||||
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
|
||||
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = typeId >= 0x10000 ? 5189 : 5191;
|
||||
@@ -377,7 +377,7 @@ static void window_research_development_paint()
|
||||
x = w->x + 10;
|
||||
y = w->y + window_research_development_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
|
||||
|
||||
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
|
||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||
int lastDevelopmentFormat;
|
||||
if (typeId != 0xFFFFFFFF) {
|
||||
if (typeId >= 0x10000) {
|
||||
|
||||
+2
-1
@@ -304,6 +304,7 @@ rct_window *window_ride_open(int rideIndex)
|
||||
ebx++;
|
||||
}
|
||||
RCT2_GLOBAL((int)w + 496, uint16) = ebx;
|
||||
return w;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -635,4 +636,4 @@ static void window_ride_music_paint()
|
||||
window_draw_widgets(w, dpi);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
+1
-1
@@ -565,7 +565,7 @@ void window_staff_paint() {
|
||||
rct2_free(sprite_dpi);
|
||||
}
|
||||
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_11)) {
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)) {
|
||||
RCT2_GLOBAL(0x013CE952, uint32) = RCT2_ADDRESS(0x00992A00, uint16)[selectedTab];
|
||||
gfx_draw_string_left(dpi, 1858, (void*)0x013CE952, 0, w->x + 0xA5, w->y + 0x20);
|
||||
}
|
||||
|
||||
+363
-17
@@ -50,7 +50,14 @@ enum WINDOW_STAFF_PEEP_WIDGET_IDX {
|
||||
WIDX_PATROL,
|
||||
WIDX_RENAME,
|
||||
WIDX_LOCATE,
|
||||
WIDX_FIRE
|
||||
WIDX_FIRE,
|
||||
|
||||
WIDX_CHECKBOX_1 = 0x8,
|
||||
WIDX_CHECKBOX_2,
|
||||
WIDX_CHECKBOX_3,
|
||||
WIDX_CHECKBOX_4,
|
||||
|
||||
WIDX_COSTUME = 0xD,
|
||||
};
|
||||
|
||||
void window_staff_peep_emptysub(){};
|
||||
@@ -83,18 +90,29 @@ rct_widget *window_staff_peep_page_widgets[] = {
|
||||
void window_staff_peep_set_page(rct_window* w, int page);
|
||||
void window_staff_peep_disable_widgets(rct_window* w);
|
||||
|
||||
void window_staff_peep_close();
|
||||
void window_staff_peep_mouse_up();
|
||||
void window_staff_peep_overview_close();
|
||||
void window_staff_peep_overview_mouseup();
|
||||
void window_staff_peep_overview_resize();
|
||||
void window_staff_peep_overview_mousedown(int widgetIndex, rct_window* w, rct_widget* widget);
|
||||
void window_staff_peep_overview_dropdown();
|
||||
void window_staff_peep_overview_update(rct_window* w);
|
||||
|
||||
void window_staff_peep_orders_mouseup();
|
||||
void window_staff_peep_orders_update(rct_window* w);
|
||||
|
||||
void window_staff_peep_stats_mouseup();
|
||||
void window_staff_peep_stats_resize();
|
||||
void window_staff_peep_stats_update(rct_window* w);
|
||||
|
||||
// 0x992AEC
|
||||
static void* window_staff_peep_overview_events[] = {
|
||||
window_staff_peep_close,
|
||||
window_staff_peep_mouse_up,
|
||||
(void*)0x6BE558,
|
||||
(void*)0x6BDF98,
|
||||
(void*)0x6BDFA3,
|
||||
window_staff_peep_overview_close,
|
||||
window_staff_peep_overview_mouseup,
|
||||
window_staff_peep_overview_resize,
|
||||
window_staff_peep_overview_mousedown,
|
||||
window_staff_peep_overview_dropdown,
|
||||
window_staff_peep_emptysub,
|
||||
(void*)0x6BE602,
|
||||
window_staff_peep_overview_update,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
(void*)0x6BDFD8,
|
||||
@@ -115,13 +133,77 @@ static void* window_staff_peep_overview_events[] = {
|
||||
window_staff_peep_emptysub,
|
||||
(void*)0x6BDD91, //Invalidate
|
||||
(void*)0x6BDEAF, //Paint
|
||||
(void*)0x6BE62A
|
||||
window_staff_peep_emptysub
|
||||
};
|
||||
|
||||
// 0x992B5C
|
||||
static void* window_staff_peep_orders_events[] = {
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_orders_mouseup,
|
||||
window_staff_peep_stats_resize,
|
||||
(void*)0x6BE802,
|
||||
(void*)0x6BE809,
|
||||
(void*)0x6BE9DA,
|
||||
window_staff_peep_orders_update,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
(void*)0x6BE62B, //Invalidate
|
||||
(void*)0x6BE7C6, //Paint
|
||||
window_staff_peep_emptysub
|
||||
};
|
||||
|
||||
// 0x992BCC
|
||||
static void* window_staff_peep_stats_events[] = {
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_stats_mouseup,
|
||||
window_staff_peep_stats_resize,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
(void*)0x6BEC80,
|
||||
window_staff_peep_stats_update,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
window_staff_peep_emptysub,
|
||||
(void*)0x6BE9E9, //Invalidate
|
||||
(void*)0x6BEA86, //Paint
|
||||
window_staff_peep_emptysub
|
||||
};
|
||||
|
||||
void* window_staff_peep_page_events[] = {
|
||||
window_staff_peep_overview_events,
|
||||
(void*)0x992B5C,
|
||||
(void*)0x992BCC
|
||||
window_staff_peep_orders_events,
|
||||
window_staff_peep_stats_events
|
||||
};
|
||||
|
||||
uint32 window_staff_peep_page_enabled_widgets[] = {
|
||||
@@ -138,7 +220,12 @@ uint32 window_staff_peep_page_enabled_widgets[] = {
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
(1 << WIDX_TAB_2) |
|
||||
(1 << WIDX_TAB_3),
|
||||
(1 << WIDX_TAB_3) |
|
||||
(1 << WIDX_CHECKBOX_1) |
|
||||
(1 << WIDX_CHECKBOX_2) |
|
||||
(1 << WIDX_CHECKBOX_3) |
|
||||
(1 << WIDX_CHECKBOX_4) |
|
||||
(1 << WIDX_COSTUME),
|
||||
|
||||
(1 << WIDX_CLOSE) |
|
||||
(1 << WIDX_TAB_1) |
|
||||
@@ -248,7 +335,7 @@ void window_staff_peep_disable_widgets(rct_window* w)
|
||||
* Same as window_peep_close.
|
||||
* rct2: 0x006BDFF8
|
||||
*/
|
||||
void window_staff_peep_close()
|
||||
void window_staff_peep_overview_close()
|
||||
{
|
||||
rct_window* w;
|
||||
|
||||
@@ -264,7 +351,28 @@ void window_staff_peep_close()
|
||||
/** rct2: 0x6C0A77 */
|
||||
void window_staff_peep_fire(rct_window* w)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x6C0A77, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
// Check if the confirm window already exists.
|
||||
if (window_bring_to_front_by_id(0x1A, w->number)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find center of the screen.
|
||||
int screen_height = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, sint16);
|
||||
int screen_width = RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16);
|
||||
int x = screen_width/2 - 100;
|
||||
int y = screen_height/2 - 50;
|
||||
|
||||
rct_window* window_prompt = window_create(x, y, 200, 100, (uint32*)0x992C3C, 0x1A, 0);
|
||||
window_prompt->widgets = (rct_widget*)0x9AFB4C;
|
||||
window_prompt->enabled_widgets |= 0x4;
|
||||
window_prompt->enabled_widgets |= 0x8;
|
||||
window_prompt->enabled_widgets |= 0x10;
|
||||
|
||||
window_init_scroll_widgets(window_prompt);
|
||||
|
||||
window_prompt->flags |= 0x10;
|
||||
window_prompt->number = w->number;
|
||||
window_prompt->colours[0] = 0x9A;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,7 +424,7 @@ void window_staff_peep_set_page(rct_window* w, int page)
|
||||
}
|
||||
|
||||
/** rct2: 0x006BDF55 */
|
||||
void window_staff_peep_mouse_up()
|
||||
void window_staff_peep_overview_mouseup()
|
||||
{
|
||||
short widgetIndex;
|
||||
rct_window* w;
|
||||
@@ -324,7 +432,6 @@ void window_staff_peep_mouse_up()
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
switch (widgetIndex) {
|
||||
|
||||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
break;
|
||||
@@ -360,4 +467,243 @@ void window_staff_peep_mouse_up()
|
||||
window_show_textinput(w, (int)widgetIndex, 0xBA1, 0xBA2, peep->name_string_idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** rct2: 0x006BE558 */
|
||||
void window_staff_peep_overview_resize()
|
||||
{
|
||||
rct_window* w;
|
||||
window_get_register(w);
|
||||
|
||||
window_staff_peep_disable_widgets(w);
|
||||
|
||||
w->min_width = 190;
|
||||
w->max_width = 500;
|
||||
w->min_height = 180;
|
||||
w->max_height = 450;
|
||||
|
||||
if (w->width < w->min_width) {
|
||||
w->width = w->min_width;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
if (w->width > w->max_width) {
|
||||
window_invalidate(w);
|
||||
w->width = w->max_width;
|
||||
}
|
||||
|
||||
if (w->height < w->min_height) {
|
||||
w->height = w->min_height;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
if (w->height > w->max_height) {
|
||||
window_invalidate(w);
|
||||
w->height = w->max_height;
|
||||
}
|
||||
|
||||
rct_viewport* viewport = w->viewport;
|
||||
|
||||
if (viewport) {
|
||||
int new_width = w->width - 30;
|
||||
int new_height = w->height - 62;
|
||||
|
||||
// Update the viewport size
|
||||
if (viewport->width != new_width || viewport->height != new_height) {
|
||||
viewport->width = new_width;
|
||||
viewport->height = new_height;
|
||||
viewport->view_width = new_width << viewport->zoom;
|
||||
viewport->view_height = new_height << viewport->zoom;
|
||||
}
|
||||
}
|
||||
|
||||
RCT2_CALLPROC_X(0x006BEDA3, 0, 0, 0, 0, (int)w, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the dropdown of patrol button.
|
||||
* rct2: 0x006BDF98
|
||||
*/
|
||||
void window_staff_peep_overview_mousedown(int widgetIndex, rct_window* w, rct_widget* widget)
|
||||
{
|
||||
if (widgetIndex != WIDX_PATROL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Dropdown names
|
||||
gDropdownItemsFormat[0] = 0xD75;
|
||||
gDropdownItemsFormat[1] = 0xD76;
|
||||
|
||||
int x = widget->left + w->x;
|
||||
int y = widget->top + w->y;;
|
||||
int extray = widget->bottom - widget->top + 1;
|
||||
window_dropdown_show_text(x, y, extray, w->colours[1], 0, 2);
|
||||
RCT2_GLOBAL(0x009DEBA2, sint16) = 0;
|
||||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
// Disable clear patrol area if no area is set.
|
||||
if (!(RCT2_ADDRESS(0x013CA672, uint8)[peep->var_C5] & 2)) {
|
||||
RCT2_GLOBAL(0x009DED34, sint32) |= 1 << 1;
|
||||
}
|
||||
}
|
||||
|
||||
/** rct2: 0x006BDFA3 */
|
||||
void window_staff_peep_overview_dropdown()
|
||||
{
|
||||
short widgetIndex, dropdownIndex;
|
||||
rct_window* w;
|
||||
|
||||
window_dropdown_get_registers(w, widgetIndex, dropdownIndex);
|
||||
|
||||
if (widgetIndex != WIDX_PATROL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear patrol
|
||||
if (dropdownIndex == 1) {
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
int edi = peep->var_C5;
|
||||
int ebx = edi << 9;
|
||||
|
||||
for (int i = 0; i < 128; i++)
|
||||
{
|
||||
RCT2_GLOBAL(0x13B0E72 + ebx + i * 4, uint32) = 0;
|
||||
}
|
||||
RCT2_GLOBAL(0x13CA672 + edi, uint16) &= 0xFD; // bug??
|
||||
|
||||
window_invalidate(w);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006C0C3F);
|
||||
}
|
||||
else {
|
||||
if (!tool_set(w, widgetIndex, 22)) {
|
||||
show_gridlines();
|
||||
RCT2_GLOBAL(0x009DEA50, sint16) = w->number;
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the animation frame of the tab icon.
|
||||
* rct2: 0x6BE602
|
||||
*/
|
||||
void window_staff_peep_overview_update(rct_window* w)
|
||||
{
|
||||
int var_496 = RCT2_GLOBAL((int)w + 0x496, uint16);
|
||||
var_496++;
|
||||
if (var_496 >= 24) {
|
||||
var_496 = 0;
|
||||
}
|
||||
RCT2_GLOBAL((int)w + 0x496, uint16) = var_496;
|
||||
window_invalidate_by_id(0x497, w->number);
|
||||
}
|
||||
|
||||
/** rct2: 0x006BE814 */
|
||||
void window_staff_peep_set_order(rct_window* w, int order_id)
|
||||
{
|
||||
int eax = 1 << order_id;
|
||||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
|
||||
int ax = peep->var_C6 ^ eax;
|
||||
int flags = (ax << 8) | 1;
|
||||
|
||||
game_do_command(peep->x, flags, peep->y, w->number, GAME_COMMAND_SET_STAFF_ORDER, (int)peep, 0);
|
||||
}
|
||||
|
||||
/** rct2: 0x006BE7DB */
|
||||
void window_staff_peep_orders_mouseup()
|
||||
{
|
||||
short widgetIndex;
|
||||
rct_window* w;
|
||||
window_widget_get_registers(w, widgetIndex);
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_TAB_1:
|
||||
case WIDX_TAB_2:
|
||||
case WIDX_TAB_3:
|
||||
window_staff_peep_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
break;
|
||||
case WIDX_CHECKBOX_1:
|
||||
case WIDX_CHECKBOX_2:
|
||||
case WIDX_CHECKBOX_3:
|
||||
case WIDX_CHECKBOX_4:
|
||||
window_staff_peep_set_order(w, widgetIndex - WIDX_CHECKBOX_1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** rct2: 0x006BE960 */
|
||||
void window_staff_peep_orders_update(rct_window* w)
|
||||
{
|
||||
w->frame_no++;
|
||||
window_invalidate_by_id(0x597, w->number);
|
||||
}
|
||||
|
||||
/** rct2: 0x006BEBCF */
|
||||
void window_staff_peep_stats_mouseup()
|
||||
{
|
||||
short widgetIndex;
|
||||
rct_window* w;
|
||||
window_widget_get_registers(w, widgetIndex);
|
||||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_CLOSE:
|
||||
window_close(w);
|
||||
break;
|
||||
case WIDX_TAB_1:
|
||||
case WIDX_TAB_2:
|
||||
case WIDX_TAB_3:
|
||||
window_staff_peep_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** rct2: 0x006BEC1B and rct2: 0x006BE975 */
|
||||
void window_staff_peep_stats_resize()
|
||||
{
|
||||
rct_window* w;
|
||||
window_get_register(w);
|
||||
|
||||
w->min_width = 190;
|
||||
w->max_width = 190;
|
||||
w->min_height = 119;
|
||||
w->max_height = 119;
|
||||
|
||||
if (w->width < w->min_width) {
|
||||
w->width = w->min_width;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
if (w->width > w->max_width) {
|
||||
window_invalidate(w);
|
||||
w->width = w->max_width;
|
||||
}
|
||||
|
||||
if (w->height < w->min_height) {
|
||||
w->height = w->min_height;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
if (w->height > w->max_height) {
|
||||
window_invalidate(w);
|
||||
w->height = w->max_height;
|
||||
}
|
||||
}
|
||||
|
||||
/** rct2: 0x006BEBEA */
|
||||
void window_staff_peep_stats_update(rct_window* w)
|
||||
{
|
||||
w->frame_no++;
|
||||
window_invalidate_by_id(0x697, w->number);
|
||||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
if (peep->var_45 & 0x10) {
|
||||
peep->var_45 &= 0xEF;
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user