mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge branch 'research-update'
This commit is contained in:
commit
99d2b1a325
|
@ -357,7 +357,6 @@
|
||||||
<Filter>Source\Management</Filter>
|
<Filter>Source\Management</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
|
||||||
<ClCompile Include="..\src\windows\staff_list.c">
|
<ClCompile Include="..\src\windows\staff_list.c">
|
||||||
<Filter>Source\Windows</Filter>
|
<Filter>Source\Windows</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -369,9 +368,6 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
<ClCompile Include="..\lib\libspeex\resample.c">
|
|
||||||
<Filter>Libraries\lodepng</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
<ClCompile Include="..\lib\libspeex\resample.c">
|
<ClCompile Include="..\lib\libspeex\resample.c">
|
||||||
<Filter>Libraries\libspeex</Filter>
|
<Filter>Libraries\libspeex</Filter>
|
||||||
|
@ -393,6 +389,17 @@
|
||||||
<Filter>Libraries\libspeex</Filter>
|
<Filter>Libraries\libspeex</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
|
<ClCompile Include="..\lib\libspeex\resample.c">
|
||||||
|
<Filter>Libraries\lodepng</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
|
<ClCompile Include="..\lib\libspeex\resample.c">
|
||||||
|
<Filter>Libraries\libspeex</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\src\management\award.h">
|
<ClInclude Include="..\src\management\award.h">
|
||||||
|
|
|
@ -297,7 +297,9 @@
|
||||||
#define RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES 0x01357CF2
|
#define RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES 0x01357CF2
|
||||||
#define RCT2_ADDRESS_RESEARH_PROGRESS_STAGE 0x01357CF3
|
#define RCT2_ADDRESS_RESEARH_PROGRESS_STAGE 0x01357CF3
|
||||||
|
|
||||||
|
#define RCT2_ADDRESS_NEXT_RESEARCH_ITEM 0x013580E0
|
||||||
#define RCT2_ADDRESS_RESEARH_PROGRESS 0x013580E4
|
#define RCT2_ADDRESS_RESEARH_PROGRESS 0x013580E4
|
||||||
|
#define RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY 0x013580E6
|
||||||
#define RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY 0x013580E7
|
#define RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_DAY 0x013580E7
|
||||||
#define RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH 0x013580E8
|
#define RCT2_ADDRESS_NEXT_RESEARCH_EXPECTED_MONTH 0x013580E8
|
||||||
|
|
||||||
|
@ -307,6 +309,8 @@
|
||||||
|
|
||||||
#define RCT2_TOTAL_RIDE_VALUE 0x013580EE
|
#define RCT2_TOTAL_RIDE_VALUE 0x013580EE
|
||||||
|
|
||||||
|
#define RCT2_RESEARCH_ITEMS 0x01358844
|
||||||
|
|
||||||
#define RCT2_ADDRESS_SCENARIO_NAME 0x0135920A
|
#define RCT2_ADDRESS_SCENARIO_NAME 0x0135920A
|
||||||
#define RCT2_ADDRESS_SCENARIO_DETAILS 0x0135924A
|
#define RCT2_ADDRESS_SCENARIO_DETAILS 0x0135924A
|
||||||
|
|
||||||
|
|
|
@ -507,6 +507,7 @@ 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_align_tabs( rct_window *w, uint8 start_tab_id, uint8 end_tab_id );
|
||||||
|
|
||||||
void window_new_ride_init_vars();
|
void window_new_ride_init_vars();
|
||||||
|
void window_new_ride_focus(ride_list_item rideItem);
|
||||||
|
|
||||||
void window_staff_list_init_vars();
|
void window_staff_list_init_vars();
|
||||||
|
|
||||||
|
|
|
@ -282,9 +282,8 @@ void news_item_add_to_queue(uint8 type, rct_string_id string_id, uint32 assoc)
|
||||||
* rct2: 0x0066EBE6
|
* rct2: 0x0066EBE6
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
void news_item_open_subject(int type, int subject) {
|
void news_item_open_subject(int type, int subject)
|
||||||
|
{
|
||||||
int eax;
|
|
||||||
rct_peep* peep;
|
rct_peep* peep;
|
||||||
rct_window* window;
|
rct_window* window;
|
||||||
|
|
||||||
|
@ -301,14 +300,15 @@ void news_item_open_subject(int type, int subject) {
|
||||||
window_finances_open();
|
window_finances_open();
|
||||||
break;
|
break;
|
||||||
case NEWS_ITEM_RESEARCH:
|
case NEWS_ITEM_RESEARCH:
|
||||||
|
|
||||||
if (subject >= 0x10000) {
|
if (subject >= 0x10000) {
|
||||||
// Open ride list window
|
// Open ride list window
|
||||||
RCT2_CALLPROC_EBPSAFE(0x006B3CFF);
|
window_new_ride_open();
|
||||||
eax = (subject & 0xFF00) >> 8;
|
|
||||||
eax += (subject & 0xFF) << 8;
|
|
||||||
// Switch to right tab and scroll to ride location
|
// Switch to right tab and scroll to ride location
|
||||||
RCT2_CALLPROC_X(0x006B3EBA, eax, 0, subject, 0, 0, 0, 0);
|
ride_list_item rideItem;
|
||||||
|
rideItem.type = subject >> 8;
|
||||||
|
rideItem.entry_index = subject & 0xFF;
|
||||||
|
window_new_ride_focus(rideItem);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,13 +322,12 @@ void news_item_open_subject(int type, int subject) {
|
||||||
RCT2_CALLPROC_X(0x006E1172, (subject & 0xFFFF), 0, subject, 0, 0, 0, 0);
|
RCT2_CALLPROC_X(0x006E1172, (subject & 0xFFFF), 0, subject, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
||||||
// Open scenery window
|
window_scenery_open();
|
||||||
RCT2_CALLPROC_EBPSAFE(0x006E0FEF);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch to new scenery tab
|
// Switch to new scenery tab
|
||||||
RCT2_CALLPROC_X(0x006E1172, (subject & 0xFFFF), 0, subject, 0, 0, 0, 0);
|
RCT2_CALLPROC_X(0x006E1172, (subject & 0xFFFF), 0, subject, 0, 0, 0, 0);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case NEWS_ITEM_PEEPS:
|
case NEWS_ITEM_PEEPS:
|
||||||
// Open guest list to right tab
|
// Open guest list to right tab
|
||||||
|
|
|
@ -21,18 +21,29 @@
|
||||||
#include "../addresses.h"
|
#include "../addresses.h"
|
||||||
#include "../interface/window.h"
|
#include "../interface/window.h"
|
||||||
#include "../localisation/date.h"
|
#include "../localisation/date.h"
|
||||||
|
#include "../world/scenery.h"
|
||||||
|
#include "news_item.h"
|
||||||
#include "research.h"
|
#include "research.h"
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
sint32 var_0;
|
|
||||||
uint8 category;
|
|
||||||
} rct_research_item;
|
|
||||||
|
|
||||||
const int _researchRate[] = { 0, 160, 250, 400 };
|
const int _researchRate[] = { 0, 160, 250, 400 };
|
||||||
|
|
||||||
|
// 0x01358844[500]
|
||||||
|
extern rct_research_item *gResearchItems = (rct_research_item*)RCT2_RESEARCH_ITEMS;
|
||||||
|
|
||||||
// 0x00EE787C
|
// 0x00EE787C
|
||||||
uint8 gResearchUncompletedCategories;
|
uint8 gResearchUncompletedCategories;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* rct2: 0x006671AD, part of 0x00667132
|
||||||
|
*/
|
||||||
|
void research_reset_items()
|
||||||
|
{
|
||||||
|
gResearchItems[0].entryIndex = RESEARCHED_ITEMS_SEPERATOR;
|
||||||
|
gResearchItems[1].entryIndex = RESEARCHED_ITEMS_END;
|
||||||
|
gResearchItems[2].entryIndex = -3;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* rct2: 0x00684BAE
|
* rct2: 0x00684BAE
|
||||||
|
@ -40,11 +51,11 @@ uint8 gResearchUncompletedCategories;
|
||||||
void research_update_uncompleted_types()
|
void research_update_uncompleted_types()
|
||||||
{
|
{
|
||||||
int uncompletedResearchTypes = 0;
|
int uncompletedResearchTypes = 0;
|
||||||
rct_research_item *researchItem = (rct_research_item*)0x001358844;
|
rct_research_item *researchItem = gResearchItems;
|
||||||
while (researchItem->var_0 != -1)
|
while (researchItem->entryIndex != -1)
|
||||||
researchItem++;
|
researchItem++;
|
||||||
researchItem++;
|
researchItem++;
|
||||||
for (; researchItem->var_0 != -2; researchItem++)
|
for (; researchItem->entryIndex != -2; researchItem++)
|
||||||
uncompletedResearchTypes |= (1 << researchItem->category);
|
uncompletedResearchTypes |= (1 << researchItem->category);
|
||||||
|
|
||||||
gResearchUncompletedCategories = uncompletedResearchTypes;
|
gResearchUncompletedCategories = uncompletedResearchTypes;
|
||||||
|
@ -82,6 +93,129 @@ static void research_calculate_expected_date()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void research_invalidate_related_windows()
|
||||||
|
{
|
||||||
|
window_invalidate_by_id(WC_CONSTRUCT_RIDE, 0);
|
||||||
|
window_invalidate_by_id(WC_RESEARCH, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* rct2: 0x00684BE5
|
||||||
|
*/
|
||||||
|
static void research_next_design()
|
||||||
|
{
|
||||||
|
rct_research_item *firstUnresearchedItem, *researchItem, tmp;
|
||||||
|
int ignoreActiveResearchTypes;
|
||||||
|
int activeResearchTypes = RCT2_GLOBAL(RCT2_ADDRESS_ACTIVE_RESEARCH_TYPES, uint16);
|
||||||
|
|
||||||
|
// Skip already researched items
|
||||||
|
firstUnresearchedItem = gResearchItems;
|
||||||
|
while (firstUnresearchedItem->entryIndex != RESEARCHED_ITEMS_SEPERATOR)
|
||||||
|
firstUnresearchedItem++;
|
||||||
|
|
||||||
|
ignoreActiveResearchTypes = 0;
|
||||||
|
researchItem = firstUnresearchedItem;
|
||||||
|
for (;;) {
|
||||||
|
researchItem++;
|
||||||
|
if (researchItem->entryIndex == RESEARCHED_ITEMS_END) {
|
||||||
|
if (!ignoreActiveResearchTypes) {
|
||||||
|
ignoreActiveResearchTypes = 1;
|
||||||
|
researchItem = firstUnresearchedItem;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
|
||||||
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = RESEARCH_STAGE_INITIAL_RESEARCH;
|
||||||
|
research_invalidate_related_windows();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (ignoreActiveResearchTypes || (activeResearchTypes & (1 << researchItem->category))) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32) = researchItem->entryIndex;
|
||||||
|
RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8) = researchItem->category;
|
||||||
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
|
||||||
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = RESEARCH_STAGE_DESIGNING;
|
||||||
|
|
||||||
|
// Bubble research item up until it is above the researched items seperator
|
||||||
|
do {
|
||||||
|
tmp = *researchItem;
|
||||||
|
*researchItem = *(researchItem - 1);
|
||||||
|
*(researchItem - 1) = tmp;
|
||||||
|
researchItem--;
|
||||||
|
} while ((researchItem + 1)->entryIndex != RESEARCHED_ITEMS_SEPERATOR);
|
||||||
|
|
||||||
|
research_invalidate_related_windows();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* rct2: 0x006848D4
|
||||||
|
*/
|
||||||
|
void research_finish_item(sint32 entryIndex)
|
||||||
|
{
|
||||||
|
int i, ebx, ecx, rideEntryIndex, subSceneryEntryIndex;
|
||||||
|
rct_ride_type *rideEntry, *rideEntry2;
|
||||||
|
rct_scenery_set_entry *scenerySetEntry;
|
||||||
|
|
||||||
|
RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, sint32) = entryIndex;
|
||||||
|
research_invalidate_related_windows();
|
||||||
|
if (entryIndex >= 0x10000) {
|
||||||
|
// Ride
|
||||||
|
ecx = (entryIndex >> 8) & 0xFF;
|
||||||
|
rideEntryIndex = entryIndex & 0xFF;
|
||||||
|
rideEntry = GET_RIDE_ENTRY(rideEntryIndex);
|
||||||
|
RCT2_ADDRESS(0x01357404, uint32)[ecx >> 5] |= (1 << (ecx & 0x1F));
|
||||||
|
RCT2_ADDRESS(0x01357444, uint32)[ecx] = RCT2_ADDRESS(0x0097C468, uint32)[ecx];
|
||||||
|
RCT2_ADDRESS(0x01357644, uint32)[ecx] = RCT2_ADDRESS(0x0097C5D4, uint32)[ecx];
|
||||||
|
if (RCT2_GLOBAL(0x0097D4F2 + (ecx * 8), uint16) & 8) {
|
||||||
|
ebx = RCT2_GLOBAL(0x0097D4F5 + (ecx * 8), uint8);
|
||||||
|
RCT2_ADDRESS(0x01357444, uint32)[ebx] = RCT2_ADDRESS(0x0097C468, uint32)[ebx];
|
||||||
|
RCT2_ADDRESS(0x01357644, uint32)[ebx] = RCT2_ADDRESS(0x0097C5D4, uint32)[ebx];
|
||||||
|
}
|
||||||
|
RCT2_ADDRESS(0x001357424, uint32)[rideEntryIndex >> 5] |= 1 << (rideEntryIndex & 0x1F);
|
||||||
|
if (!(rideEntry->var_008 & 0x2000)) {
|
||||||
|
for (i = 0; i < 128; i++) {
|
||||||
|
rideEntry2 = GET_RIDE_ENTRY(i);
|
||||||
|
if (rideEntry2 == (rct_ride_type*)-1)
|
||||||
|
continue;
|
||||||
|
if (rideEntry2->var_008 & 0x2000)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (rideEntry2->var_00C == ecx || rideEntry2->var_00D == ecx || rideEntry2->var_00E == ecx)
|
||||||
|
RCT2_ADDRESS(0x001357424, uint32)[i >> 5] |= 1 << (i & 0x1F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// I don't think 0x009AC06C is ever not 0, so probably redundant
|
||||||
|
if (RCT2_GLOBAL(0x009AC06C, uint8) == 0) {
|
||||||
|
RCT2_GLOBAL(0x013CE952, rct_string_id) = rideEntry->var_008 & 0x1000 ?
|
||||||
|
rideEntry->name : ecx + 2;
|
||||||
|
news_item_add_to_queue(NEWS_ITEM_RESEARCH, 2249, entryIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
research_invalidate_related_windows();
|
||||||
|
} else {
|
||||||
|
// Scenery
|
||||||
|
scenerySetEntry = g_scenerySetEntries[entryIndex & 0xFFFF];
|
||||||
|
for (i = 0; i < scenerySetEntry->entry_count; i++) {
|
||||||
|
subSceneryEntryIndex = scenerySetEntry->scenery_entries[i];
|
||||||
|
RCT2_ADDRESS(0x01357BD0, sint32)[subSceneryEntryIndex >> 5] |= 1 << (subSceneryEntryIndex & 0x1F);
|
||||||
|
}
|
||||||
|
|
||||||
|
// I don't think 0x009AC06C is ever not 0, so probably redundant
|
||||||
|
if (RCT2_GLOBAL(0x009AC06C, uint8) == 0) {
|
||||||
|
RCT2_GLOBAL(0x013CE952, rct_string_id) = scenerySetEntry->name;
|
||||||
|
news_item_add_to_queue(NEWS_ITEM_RESEARCH, 2250, entryIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
research_invalidate_related_windows();
|
||||||
|
init_scenery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* rct2: 0x00684C7A
|
* rct2: 0x00684C7A
|
||||||
|
@ -106,24 +240,22 @@ void research_update()
|
||||||
} else {
|
} else {
|
||||||
switch (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8)) {
|
switch (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8)) {
|
||||||
case RESEARCH_STAGE_INITIAL_RESEARCH:
|
case RESEARCH_STAGE_INITIAL_RESEARCH:
|
||||||
RCT2_CALLPROC_EBPSAFE(0x00684BE5);
|
research_next_design();
|
||||||
research_calculate_expected_date();
|
research_calculate_expected_date();
|
||||||
break;
|
break;
|
||||||
case RESEARCH_STAGE_DESIGNING:
|
case RESEARCH_STAGE_DESIGNING:
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = RESEARCH_STAGE_COMPLETING_DESIGN;
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = RESEARCH_STAGE_COMPLETING_DESIGN;
|
||||||
research_calculate_expected_date();
|
research_calculate_expected_date();
|
||||||
window_invalidate_by_id(WC_CONSTRUCT_RIDE, 0);
|
research_invalidate_related_windows();
|
||||||
window_invalidate_by_id(WC_RESEARCH, 0);
|
|
||||||
break;
|
break;
|
||||||
case RESEARCH_STAGE_COMPLETING_DESIGN:
|
case RESEARCH_STAGE_COMPLETING_DESIGN:
|
||||||
RCT2_CALLPROC_X(0x006848D4, RCT2_GLOBAL(0x013580E0, uint32), 0, 0, 0, 0, 0, 0);
|
research_finish_item(RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, sint32));
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
|
||||||
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = 0;
|
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = 0;
|
||||||
research_calculate_expected_date();
|
research_calculate_expected_date();
|
||||||
research_update_uncompleted_types();
|
research_update_uncompleted_types();
|
||||||
window_invalidate_by_id(WC_CONSTRUCT_RIDE, 0);
|
research_invalidate_related_windows();
|
||||||
window_invalidate_by_id(WC_RESEARCH, 0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,15 @@
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
// Bit 16 (0: scenery entry, 1: ride entry)
|
||||||
|
sint32 entryIndex;
|
||||||
|
uint8 category;
|
||||||
|
} rct_research_item;
|
||||||
|
|
||||||
|
#define RESEARCHED_ITEMS_SEPERATOR -1
|
||||||
|
#define RESEARCHED_ITEMS_END -2
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
RESEARCH_FUNDING_NONE,
|
RESEARCH_FUNDING_NONE,
|
||||||
RESEARCH_FUNDING_MINIMUM,
|
RESEARCH_FUNDING_MINIMUM,
|
||||||
|
@ -37,8 +46,10 @@ enum {
|
||||||
RESEARCH_STAGE_UNKNOWN
|
RESEARCH_STAGE_UNKNOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern rct_research_item *gResearchItems;
|
||||||
extern uint8 gResearchUncompletedCategories;
|
extern uint8 gResearchUncompletedCategories;
|
||||||
|
|
||||||
|
void research_reset_items();
|
||||||
void research_update_uncompleted_types();
|
void research_update_uncompleted_types();
|
||||||
void research_update();
|
void research_update();
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ typedef struct {
|
||||||
uint32 var_008;
|
uint32 var_008;
|
||||||
uint8 var_00C;
|
uint8 var_00C;
|
||||||
uint8 var_00D;
|
uint8 var_00D;
|
||||||
uint8 pad_00E;
|
uint8 var_00E;
|
||||||
uint8 var_00F;
|
uint8 var_00F;
|
||||||
uint8 var_010;
|
uint8 var_010;
|
||||||
uint8 var_011;
|
uint8 var_011;
|
||||||
|
|
|
@ -176,14 +176,15 @@ typedef struct {
|
||||||
uint8 guests_in_park_history[32];
|
uint8 guests_in_park_history[32];
|
||||||
|
|
||||||
// SC6[10]
|
// SC6[10]
|
||||||
uint16 word_01357CF2;
|
uint8 active_research_types;
|
||||||
uint32 word_01357CF4;
|
uint8 research_progress_stage;
|
||||||
|
uint32 dword_01357CF4;
|
||||||
uint8 byte_01357CF8[1000];
|
uint8 byte_01357CF8[1000];
|
||||||
uint32 dword_013580E0[32];
|
uint32 dword_013580E0;
|
||||||
uint16 word_013580E4[16];
|
uint16 research_progress;
|
||||||
uint8 byte_013580E6;
|
uint8 next_research_category;
|
||||||
uint8 byte_013580E7;
|
uint8 next_research_expected_day;
|
||||||
uint8 byte_013580E8;
|
uint8 next_research_expected_month;
|
||||||
uint8 byte_013580E9;
|
uint8 byte_013580E9;
|
||||||
uint16 park_size;
|
uint16 park_size;
|
||||||
uint16 guest_generation_probability;
|
uint16 guest_generation_probability;
|
||||||
|
|
|
@ -260,7 +260,6 @@ static void window_game_top_toolbar_mouseup()
|
||||||
if (!tool_set(w, WIDX_SCENERY, 0)) {
|
if (!tool_set(w, WIDX_SCENERY, 0)) {
|
||||||
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
RCT2_GLOBAL(0x009DE518, uint32) |= (1 << 6);
|
||||||
window_scenery_open();
|
window_scenery_open();
|
||||||
//RCT2_CALLPROC_EBPSAFE(0x006E0FEF);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WIDX_PATH:
|
case WIDX_PATH:
|
||||||
|
|
|
@ -242,6 +242,7 @@ static void* window_new_ride_events[] = {
|
||||||
const int window_new_ride_tab_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 };
|
const int window_new_ride_tab_animation_loops[] = { 20, 32, 10, 72, 24, 28, 16 };
|
||||||
const int window_new_ride_tab_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
const int window_new_ride_tab_animation_divisor[] = { 4, 8, 2, 4, 4, 4, 2 };
|
||||||
|
|
||||||
|
static void window_new_ride_set_page(rct_window *w, int page);
|
||||||
static void window_new_ride_refresh_widget_sizing(rct_window *w);
|
static void window_new_ride_refresh_widget_sizing(rct_window *w);
|
||||||
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, int x, int y);
|
static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window *w, int x, int y);
|
||||||
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width);
|
static void window_new_ride_paint_ride_information(rct_window *w, rct_drawpixelinfo *dpi, ride_list_item item, int x, int y, int width);
|
||||||
|
@ -428,6 +429,52 @@ void window_new_ride_open()
|
||||||
window_new_ride_scroll_to_focused_ride(w);
|
window_new_ride_scroll_to_focused_ride(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* rct2: 0x006B3EBA
|
||||||
|
*/
|
||||||
|
void window_new_ride_focus(ride_list_item rideItem)
|
||||||
|
{
|
||||||
|
rct_window *w;
|
||||||
|
rct_ride_type *rideType;
|
||||||
|
|
||||||
|
w = window_find_by_id(WC_CONSTRUCT_RIDE, 0);
|
||||||
|
if (w == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
rideType = GET_RIDE_ENTRY(rideItem.entry_index);
|
||||||
|
window_new_ride_set_page(w, rideType->category[0]);
|
||||||
|
|
||||||
|
ride_list_item *listItem = (ride_list_item*)0x00F43523;
|
||||||
|
while (listItem->type != RIDE_TYPE_NULL) {
|
||||||
|
if (listItem->type == rideItem.type && listItem->entry_index == rideItem.type) {
|
||||||
|
RCT2_GLOBAL(0x00F43825, uint8) = rideItem.type;
|
||||||
|
RCT2_GLOBAL(0x00F43826, uint8) = rideItem.entry_index;
|
||||||
|
w->new_ride.highlighted_ride_id = (rideItem.entry_index << 8) | rideItem.type;
|
||||||
|
window_new_ride_scroll_to_focused_ride(w);
|
||||||
|
}
|
||||||
|
listItem++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void window_new_ride_set_page(rct_window *w, int page)
|
||||||
|
{
|
||||||
|
_window_new_ride_current_tab = page;
|
||||||
|
w->frame_no = 0;
|
||||||
|
w->new_ride.highlighted_ride_id = -1;
|
||||||
|
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(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);
|
||||||
|
}
|
||||||
|
|
||||||
|
window_new_ride_refresh_widget_sizing(w);
|
||||||
|
window_invalidate(w);
|
||||||
|
window_new_ride_scroll_to_focused_ride(w);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* rct2: 0x006B3DF1
|
* rct2: 0x006B3DF1
|
||||||
|
@ -550,26 +597,8 @@ static void window_new_ride_mouseup()
|
||||||
*/
|
*/
|
||||||
static void window_new_ride_mousedown(int widgetIndex, rct_window *w, rct_widget *widget)
|
static void window_new_ride_mousedown(int widgetIndex, rct_window *w, rct_widget *widget)
|
||||||
{
|
{
|
||||||
int page;
|
if (widgetIndex >= WIDX_TAB_1 && widgetIndex <= WIDX_TAB_7)
|
||||||
if (widgetIndex < WIDX_TAB_1 || widgetIndex > WIDX_TAB_7)
|
window_new_ride_set_page(w, widgetIndex - WIDX_TAB_1);
|
||||||
return;
|
|
||||||
|
|
||||||
page = widgetIndex - WIDX_TAB_1;
|
|
||||||
|
|
||||||
_window_new_ride_current_tab = page;
|
|
||||||
w->frame_no = 0;
|
|
||||||
w->new_ride.highlighted_ride_id = -1;
|
|
||||||
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(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);
|
|
||||||
}
|
|
||||||
|
|
||||||
window_new_ride_refresh_widget_sizing(w);
|
|
||||||
window_invalidate(w);
|
|
||||||
window_new_ride_scroll_to_focused_ride(w);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -735,9 +764,9 @@ static void window_new_ride_paint()
|
||||||
// Research type
|
// Research type
|
||||||
rct_string_id stringId = STR_RESEARCH_UNKNOWN;
|
rct_string_id stringId = STR_RESEARCH_UNKNOWN;
|
||||||
if (RCT2_GLOBAL(0x01357CF3, uint8) != 0) {
|
if (RCT2_GLOBAL(0x01357CF3, uint8) != 0) {
|
||||||
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(0x013580E6, uint8);
|
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8);
|
||||||
if (RCT2_GLOBAL(0x01357CF3, uint8) != 1) {
|
if (RCT2_GLOBAL(0x01357CF3, uint8) != 1) {
|
||||||
uint32 typeId = RCT2_GLOBAL(0x013580E0, uint32);
|
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
|
||||||
if (typeId >= 0x10000) {
|
if (typeId >= 0x10000) {
|
||||||
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
||||||
stringId = rideEntry->var_008 & 0x1000 ?
|
stringId = rideEntry->var_008 & 0x1000 ?
|
||||||
|
@ -773,16 +802,20 @@ static void window_new_ride_paint()
|
||||||
y = w->y + window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
|
y = w->y + window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_GROUP].top + 12;
|
||||||
|
|
||||||
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_LAST_RESEARCHED_ITEM_SUBJECT, uint32);
|
||||||
|
int lastDevelopmentFormat;
|
||||||
if (typeId != 0xFFFFFFFF) {
|
if (typeId != 0xFFFFFFFF) {
|
||||||
if (typeId >= 0x10000) {
|
if (typeId >= 0x10000) {
|
||||||
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
||||||
stringId = rideEntry->var_008 & 0x1000 ?
|
stringId = rideEntry->var_008 & 0x1000 ?
|
||||||
rideEntry->name :
|
rideEntry->name :
|
||||||
(typeId & 0xFF00) + 2;
|
((typeId >> 8) & 0xFF) + 2;
|
||||||
|
|
||||||
|
lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL;
|
||||||
} else {
|
} else {
|
||||||
stringId = g_scenerySetEntries[typeId]->name;
|
stringId = g_scenerySetEntries[typeId]->name;
|
||||||
|
lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL;
|
||||||
}
|
}
|
||||||
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, STR_RESEARCH_RIDE_LABEL, 0);
|
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, 266, lastDevelopmentFormat, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,8 @@ static void* window_research_page_events[] = {
|
||||||
static uint32 window_research_page_enabled_widgets[] = {
|
static uint32 window_research_page_enabled_widgets[] = {
|
||||||
(1 << WIDX_CLOSE) |
|
(1 << WIDX_CLOSE) |
|
||||||
(1 << WIDX_TAB_1) |
|
(1 << WIDX_TAB_1) |
|
||||||
(1 << WIDX_TAB_2),
|
(1 << WIDX_TAB_2) |
|
||||||
|
(1 << WIDX_LAST_DEVELOPMENT_BUTTON),
|
||||||
|
|
||||||
(1 << WIDX_CLOSE) |
|
(1 << WIDX_CLOSE) |
|
||||||
(1 << WIDX_TAB_1) |
|
(1 << WIDX_TAB_1) |
|
||||||
|
@ -341,9 +342,9 @@ static void window_research_development_paint()
|
||||||
// Research type
|
// Research type
|
||||||
stringId = STR_RESEARCH_UNKNOWN;
|
stringId = STR_RESEARCH_UNKNOWN;
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 0) {
|
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 0) {
|
||||||
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(0x013580E6, uint8);
|
stringId = STR_TRANSPORT_RIDE + RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_CATEGORY, uint8);
|
||||||
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 1) {
|
if (RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) != 1) {
|
||||||
uint32 typeId = RCT2_GLOBAL(0x013580E0, uint32);
|
uint32 typeId = RCT2_GLOBAL(RCT2_ADDRESS_NEXT_RESEARCH_ITEM, uint32);
|
||||||
if (typeId >= 0x10000) {
|
if (typeId >= 0x10000) {
|
||||||
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
rct_ride_type *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, rct_ride_type*);
|
||||||
stringId = rideEntry->var_008 & 0x1000 ?
|
stringId = rideEntry->var_008 & 0x1000 ?
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include "../management/finance.h"
|
#include "../management/finance.h"
|
||||||
#include "../management/marketing.h"
|
#include "../management/marketing.h"
|
||||||
#include "../management/news_item.h"
|
#include "../management/news_item.h"
|
||||||
|
#include "../management/research.h"
|
||||||
#include "../peep/peep.h"
|
#include "../peep/peep.h"
|
||||||
#include "../ride/ride.h"
|
#include "../ride/ride.h"
|
||||||
#include "../scenario.h"
|
#include "../scenario.h"
|
||||||
|
@ -76,9 +77,7 @@ void park_init()
|
||||||
for (i = 0; i < 20; i++)
|
for (i = 0; i < 20; i++)
|
||||||
RCT2_ADDRESS(0x01358102, uint8)[i] = 0;
|
RCT2_ADDRESS(0x01358102, uint8)[i] = 0;
|
||||||
|
|
||||||
RCT2_GLOBAL(0x01358844, uint32) = 0xFFFFFFFF;
|
research_reset_items();
|
||||||
RCT2_GLOBAL(0x01358849, uint32) = 0xFFFFFFFE;
|
|
||||||
RCT2_GLOBAL(0x0135884E, uint32) = 0xFFFFFFFD;
|
|
||||||
finance_init();
|
finance_init();
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
|
|
|
@ -126,4 +126,6 @@ typedef struct {
|
||||||
#define g_pathBitSceneryEntries RCT2_ADDRESS(RCT2_ADDRESS_PATH_BIT_SCENERY_ENTRIES, rct_scenery_entry*)
|
#define g_pathBitSceneryEntries RCT2_ADDRESS(RCT2_ADDRESS_PATH_BIT_SCENERY_ENTRIES, rct_scenery_entry*)
|
||||||
#define g_scenerySetEntries RCT2_ADDRESS(RCT2_ADDRESS_SCENERY_SET_ENTRIES, rct_scenery_set_entry*)
|
#define g_scenerySetEntries RCT2_ADDRESS(RCT2_ADDRESS_SCENERY_SET_ENTRIES, rct_scenery_set_entry*)
|
||||||
|
|
||||||
|
void init_scenery();
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue