mirror of https://github.com/OpenRCT2/OpenRCT2.git
implement editor_fix_rct1_scenery, editor_rct1_reset_research and research_remove_non_separate_vehicle_types
This commit is contained in:
parent
1c1445d14f
commit
4d11def81d
62
src/editor.c
62
src/editor.c
|
@ -53,6 +53,8 @@ static int editor_read_s4(rct1_s4 *data);
|
|||
static int editor_read_s6(const char *path);
|
||||
|
||||
static void editor_load_rct1_default_objects();
|
||||
static void editor_fix_rct1_scenery();
|
||||
static void editor_rct1_reset_research();
|
||||
|
||||
typedef struct {
|
||||
const rct_object_entry* entries;
|
||||
|
@ -165,7 +167,6 @@ void editor_convert_save_to_scenario()
|
|||
rct_stex_entry* stex = g_stexEntries[0];
|
||||
if ((int)stex != 0xFFFFFFFF) {
|
||||
object_unload(0, &object_entry_groups[OBJECT_TYPE_SCENARIO_TEXT].entries[0]);
|
||||
//RCT2_CALLPROC_EBPSAFE(0x006A9FC0);
|
||||
reset_loaded_objects();
|
||||
|
||||
format_string(s6Info->details, STR_NO_DETAILS_YET, NULL);
|
||||
|
@ -475,12 +476,12 @@ static void sub_6A2B62()
|
|||
editor_load_rct1_default_objects();
|
||||
reset_loaded_objects();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A2730);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A2956);
|
||||
editor_fix_rct1_scenery();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A29B9);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006A2A68);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069F509);
|
||||
editor_rct1_reset_research();
|
||||
RCT2_CALLPROC_EBPSAFE(0x00685675);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068585B);
|
||||
research_remove_non_separate_vehicle_types();
|
||||
|
||||
climate_reset(RCT2_GLOBAL(RCT2_ADDRESS_CLIMATE, uint8));
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
|
@ -609,6 +610,53 @@ static void editor_load_rct1_default_objects()
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006A2956
|
||||
*/
|
||||
static void editor_fix_rct1_scenery()
|
||||
{
|
||||
rct_map_element *element;
|
||||
map_element_iterator it;
|
||||
|
||||
map_element_iterator_begin(&it);
|
||||
while (map_element_iterator_next(&it)) {
|
||||
element = it.element;
|
||||
|
||||
if (map_element_get_type(element) != MAP_ELEMENT_TYPE_SCENERY)
|
||||
continue;
|
||||
|
||||
switch (element->properties.scenery.type) {
|
||||
case 157: // TGE1 (Geometric Sculpture)
|
||||
case 162: // TGE2 (Geometric Sculpture)
|
||||
case 168: // TGE3 (Geometric Sculpture)
|
||||
case 170: // TGE4 (Geometric Sculpture)
|
||||
case 171: // TGE5 (Geometric Sculpture)
|
||||
element->properties.scenery.colour_2 = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069F509
|
||||
*/
|
||||
static void editor_rct1_reset_research()
|
||||
{
|
||||
rct_research_item *researchItem;
|
||||
|
||||
researchItem = gResearchItems;
|
||||
researchItem->entryIndex = RESEARCHED_ITEMS_SEPERATOR;
|
||||
researchItem++;
|
||||
researchItem->entryIndex = RESEARCHED_ITEMS_END;
|
||||
researchItem++;
|
||||
researchItem->entryIndex = RESEARCHED_ITEMS_END_2;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS_STAGE, uint8) = 0;
|
||||
RCT2_GLOBAL(0x01357CF4, sint32) = -1;
|
||||
news_item_init_queue();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006A2B02
|
||||
|
@ -870,7 +918,7 @@ static int editor_read_s6(const char *path)
|
|||
// Check expansion pack
|
||||
// RCT2_CALLPROC_EBPSAFE(0x006757E6);
|
||||
|
||||
reset_loaded_objects();//RCT2_CALLPROC_EBPSAFE(0x006A9FC0);
|
||||
reset_loaded_objects();
|
||||
map_update_tile_pointers();
|
||||
map_remove_all_rides();
|
||||
|
||||
|
@ -900,7 +948,7 @@ static int editor_read_s6(const char *path)
|
|||
RCT2_GLOBAL(0x013573FE, uint16) = 0;
|
||||
if (s6Header->type != S6_TYPE_SCENARIO) {
|
||||
RCT2_CALLPROC_EBPSAFE(0x00685675);
|
||||
RCT2_CALLPROC_EBPSAFE(0x0068585B);
|
||||
research_remove_non_separate_vehicle_types();
|
||||
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_NO_MONEY)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) |= PARK_FLAGS_NO_MONEY_SCENARIO;
|
||||
|
@ -949,7 +997,7 @@ static int editor_read_s6(const char *path)
|
|||
rct_stex_entry* stex = g_stexEntries[0];
|
||||
if ((int)stex != 0xFFFFFFFF) {
|
||||
object_unload(0, &object_entry_groups[OBJECT_TYPE_SCENARIO_TEXT].entries[0]);
|
||||
reset_loaded_objects();//RCT2_CALLPROC_EBPSAFE(0x006A9FC0);
|
||||
reset_loaded_objects();
|
||||
|
||||
format_string(s6Info->details, STR_NO_DETAILS_YET, NULL);
|
||||
s6Info->name[0] = 0;
|
||||
|
|
|
@ -326,6 +326,54 @@ void sub_684AC3(){
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_RESEARH_PROGRESS, uint16) = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0068585B
|
||||
*/
|
||||
void research_remove_non_separate_vehicle_types()
|
||||
{
|
||||
rct_research_item *researchItem, *researchItem2;
|
||||
|
||||
researchItem = gResearchItems;
|
||||
while ((researchItem + 1)->entryIndex != RESEARCHED_ITEMS_END) {
|
||||
researchItem++;
|
||||
}
|
||||
|
||||
do {
|
||||
loopBeginning:
|
||||
if (
|
||||
researchItem != gResearchItems &&
|
||||
researchItem->entryIndex != RESEARCHED_ITEMS_SEPERATOR &&
|
||||
researchItem->entryIndex != RESEARCHED_ITEMS_END &&
|
||||
researchItem->entryIndex >= 0x10000
|
||||
) {
|
||||
rct_ride_type *rideEntry = GET_RIDE_ENTRY(researchItem->entryIndex & 0xFF);
|
||||
if (!(rideEntry->var_008 & 0x3000)) {
|
||||
// Check if ride type already exists further up for a vehicle type that isn't displayed as a ride
|
||||
researchItem2 = researchItem - 1;
|
||||
do {
|
||||
if (
|
||||
researchItem2->entryIndex != RESEARCHED_ITEMS_SEPERATOR &&
|
||||
researchItem2->entryIndex >= 0x10000
|
||||
) {
|
||||
rideEntry = GET_RIDE_ENTRY(researchItem2->entryIndex & 0xFF);
|
||||
if (!(rideEntry->var_008 & 0x3000)) {
|
||||
if (((researchItem->entryIndex >> 8) & 0xFF) == ((researchItem2->entryIndex >> 8) & 0xFF)) {
|
||||
// Remove item
|
||||
researchItem2 = researchItem;
|
||||
do {
|
||||
*researchItem2 = *(researchItem2 + 1);
|
||||
} while ((researchItem2++)->entryIndex != RESEARCHED_ITEMS_END);
|
||||
goto loopBeginning;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while ((researchItem2--) != gResearchItems);
|
||||
}
|
||||
}
|
||||
} while ((researchItem--) != gResearchItems);
|
||||
}
|
||||
|
||||
void research_set_funding(int amount)
|
||||
{
|
||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY, 0, amount, GAME_COMMAND_SET_RESEARCH_FUNDING, 0, 0);
|
||||
|
|
|
@ -55,6 +55,7 @@ void research_reset_items();
|
|||
void research_update_uncompleted_types();
|
||||
void research_update();
|
||||
void sub_684AC3();
|
||||
void research_remove_non_separate_vehicle_types();
|
||||
|
||||
void research_set_funding(int amount);
|
||||
void research_set_priority(int activeCategories);
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../management/research.h"
|
||||
#include "../object.h"
|
||||
#include "../ride/track.h"
|
||||
#include "../scenario.h"
|
||||
|
@ -256,7 +257,7 @@ static void window_editor_object_selection_close()
|
|||
object_free_scenario_text();
|
||||
RCT2_CALLPROC_EBPSAFE(0x6AB316);
|
||||
RCT2_CALLPROC_EBPSAFE(0x685675);
|
||||
RCT2_CALLPROC_EBPSAFE(0x68585B);
|
||||
research_remove_non_separate_vehicle_types();
|
||||
window_new_ride_init_vars();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue