mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 15:24:30 +01:00
implement scenery_set_default_placement_configuration
This commit is contained in:
@@ -198,7 +198,6 @@
|
||||
<ClInclude Include="..\src\util\util.h" />
|
||||
<ClInclude Include="..\src\windows\dropdown.h" />
|
||||
<ClInclude Include="..\src\windows\error.h" />
|
||||
<ClInclude Include="..\src\windows\scenery.h" />
|
||||
<ClInclude Include="..\src\windows\tooltip.h" />
|
||||
<ClInclude Include="..\src\world\banner.h" />
|
||||
<ClInclude Include="..\src\world\climate.h" />
|
||||
|
||||
@@ -357,7 +357,6 @@
|
||||
<ClCompile Include="..\src\windows\ride_construction.c">
|
||||
<Filter>Source\Windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\src\interface\keyboard_shortcut.c">
|
||||
<Filter>Source\Interface</Filter>
|
||||
</ClCompile>
|
||||
@@ -386,7 +385,7 @@
|
||||
<ClCompile Include="..\src\localisation\user.c">
|
||||
<Filter>Source\Localisation</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\libspeex\resample.c;..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\lib\lodepng\lodepng.c" />
|
||||
<ClCompile Include="..\src\windows\editor_inventions_list.c">
|
||||
<Filter>Source\Windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -486,9 +485,6 @@
|
||||
<ClInclude Include="..\src\windows\error.h">
|
||||
<Filter>Source\Windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\windows\scenery.h">
|
||||
<Filter>Source\Windows</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\windows\tooltip.h">
|
||||
<Filter>Source\Windows</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "world/climate.h"
|
||||
#include "world/map.h"
|
||||
#include "world/park.h"
|
||||
#include "world/scenery.h"
|
||||
#include "world/sprite.h"
|
||||
|
||||
static void set_all_land_owned();
|
||||
@@ -196,7 +197,7 @@ void editor_convert_save_to_scenario()
|
||||
|
||||
window_invalidate(w);
|
||||
sub_69E9A7();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
window_new_ride_init_vars();
|
||||
RCT2_GLOBAL(0x009DEB7C, uint16) = 0;
|
||||
load_palette();
|
||||
@@ -566,7 +567,7 @@ static void sub_6A2B62()
|
||||
|
||||
window_invalidate(w);
|
||||
sub_69E9A7();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
window_new_ride_init_vars();
|
||||
RCT2_GLOBAL(0x009DEB7C, uint16) = 0;
|
||||
load_palette();
|
||||
@@ -953,7 +954,7 @@ static int editor_read_s6(const char *path)
|
||||
|
||||
window_invalidate(w);
|
||||
sub_69E9A7();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
window_new_ride_init_vars();
|
||||
RCT2_GLOBAL(0x009DEB7C, uint16) = 0;
|
||||
load_palette();
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "world/climate.h"
|
||||
#include "world/map_animation.h"
|
||||
#include "world/park.h"
|
||||
#include "world/scenery.h"
|
||||
#include "world/sprite.h"
|
||||
#include "world/water.h"
|
||||
|
||||
@@ -691,7 +692,7 @@ int game_load_save(const char *path)
|
||||
window_invalidate(mainWindow);
|
||||
|
||||
sub_69E9A7();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
window_new_ride_init_vars();
|
||||
RCT2_GLOBAL(0x009DEB7C, uint16) = 0;
|
||||
if (RCT2_GLOBAL(0x0013587C4, uint32) == 0) // this check is not in scenario play
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "world/map.h"
|
||||
#include "world/park.h"
|
||||
#include "world/climate.h"
|
||||
#include "world/scenery.h"
|
||||
#include "world/sprite.h"
|
||||
|
||||
typedef struct tm tm_t;
|
||||
@@ -109,7 +110,7 @@ int rct2_init()
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066B5C0); // 0x0066B5C0 (part of 0x0066B3E8) screen_game_create_windows()
|
||||
date_reset();
|
||||
climate_reset(CLIMATE_COOL_AND_WET);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
window_new_ride_init_vars();
|
||||
window_guest_list_init_vars_b();
|
||||
window_staff_list_init_vars();
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "util/util.h"
|
||||
#include "world/map.h"
|
||||
#include "world/park.h"
|
||||
#include "world/scenery.h"
|
||||
#include "world/sprite.h"
|
||||
#include "world/water.h"
|
||||
|
||||
@@ -258,7 +259,7 @@ int scenario_load_and_play_from_path(const char *path)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) & PARK_FLAGS_NO_MONEY_SCENARIO)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, sint32) |= PARK_FLAGS_NO_MONEY;
|
||||
sub_684AC3();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
news_item_init_queue();
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_TYPE, uint8) != OBJECTIVE_NONE)
|
||||
window_park_objective_open();
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "world/climate.h"
|
||||
#include "world/map.h"
|
||||
#include "world/park.h"
|
||||
#include "world/scenery.h"
|
||||
#include "world/sprite.h"
|
||||
|
||||
static const int gOldMusic = 0;
|
||||
@@ -107,7 +108,7 @@ void title_load()
|
||||
park_init();
|
||||
date_reset();
|
||||
climate_reset(CLIMATE_COOL_AND_WET);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
window_new_ride_init_vars();
|
||||
window_guest_list_init_vars_b();
|
||||
window_staff_list_init_vars();
|
||||
@@ -206,7 +207,7 @@ static void title_update_showcase()
|
||||
sub_69E9A7();
|
||||
window_new_ride_init_vars();
|
||||
sub_684AC3();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
news_item_init_queue();
|
||||
gfx_invalidate_screen();
|
||||
RCT2_GLOBAL(0x009DEA66, sint16) = 0;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "../platform/platform.h"
|
||||
#include "../title.h"
|
||||
#include "../util/util.h"
|
||||
#include "../world/scenery.h"
|
||||
#include "error.h"
|
||||
|
||||
enum {
|
||||
@@ -167,7 +168,7 @@ void window_editor_bottom_toolbar_jump_back_to_object_selection() {
|
||||
void window_editor_bottom_toolbar_jump_back_to_landscape_editor() {
|
||||
window_close_all();
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFED0);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
g_editor_step = EDITOR_STEP_LANDSCAPE_EDITOR;
|
||||
window_map_open();
|
||||
gfx_invalidate_screen();
|
||||
@@ -228,7 +229,7 @@ void window_editor_bottom_toolbar_jump_forward_from_object_selection()
|
||||
RCT2_CALLPROC_EBPSAFE(0x0066F6E3);
|
||||
} else {
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFED0);
|
||||
RCT2_CALLPROC_EBPSAFE(0x006DFEE4);
|
||||
scenery_set_default_placement_configuration();
|
||||
RCT2_GLOBAL(0x00141F570, uint8) = 1;
|
||||
window_map_open();
|
||||
gfx_invalidate_screen();
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "../interface/viewport.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../sprites.h"
|
||||
#include "../windows/scenery.h"
|
||||
#include "../world/scenery.h"
|
||||
|
||||
|
||||
enum WINDOW_MAP_WIDGET_IDX {
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include "../interface/viewport.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../sprites.h"
|
||||
#include "../windows/scenery.h"
|
||||
#include "../world/mapgen.h"
|
||||
#include "../world/scenery.h"
|
||||
#include "dropdown.h"
|
||||
|
||||
enum {
|
||||
|
||||
@@ -32,7 +32,11 @@
|
||||
#include "../world/scenery.h"
|
||||
#include "../world/sprite.h"
|
||||
#include "dropdown.h"
|
||||
#include "scenery.h"
|
||||
|
||||
#define WINDOW_SCENERY_WIDTH 634
|
||||
#define WINDOW_SCENERY_HEIGHT 142
|
||||
#define SCENERY_BUTTON_WIDTH 66
|
||||
#define SCENERY_BUTTON_HEIGHT 80
|
||||
|
||||
enum {
|
||||
WINDOW_SCENERY_TAB_1,
|
||||
@@ -174,7 +178,10 @@ static rct_widget window_scenery_widgets[] = {
|
||||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
static sint16 window_scenery_tab_entries[0x14][SCENERY_ENTRIES_BY_TAB + 1];
|
||||
// rct2: 0x00F64F2C
|
||||
sint16 window_scenery_tab_entries[20][SCENERY_ENTRIES_BY_TAB + 1];
|
||||
|
||||
void window_scenery_update_scroll(rct_window *w);
|
||||
|
||||
/**
|
||||
* Was part of 0x006DFA00
|
||||
@@ -221,7 +228,8 @@ void init_scenery_entry(rct_scenery_entry *sceneryEntry, int index, uint8 scener
|
||||
*
|
||||
* rct2: 0x006DFA00
|
||||
*/
|
||||
void init_scenery() {
|
||||
void init_scenery()
|
||||
{
|
||||
bool enabledScenerySets[0x14] = { false };
|
||||
|
||||
for (int scenerySetIndex = 0; scenerySetIndex < 0x14; scenerySetIndex++) {
|
||||
@@ -367,6 +375,37 @@ void init_scenery() {
|
||||
window_invalidate_by_class(WC_SCENERY);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006DFEE4
|
||||
*/
|
||||
void scenery_set_default_placement_configuration()
|
||||
{
|
||||
window_scenery_rotation = 3;
|
||||
window_scenery_primary_colour = 26;
|
||||
window_scenery_secondary_colour = 18;
|
||||
window_scenery_tertiary_colour = 24;
|
||||
init_scenery();
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
window_scenery_selected_scenery_by_tab[i] = -1;
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (window_scenery_tab_entries[i][0] != -1) {
|
||||
window_scenery_active_tab_index = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
rct_widget *tabWidget = &window_scenery_widgets[WIDX_SCENERY_TAB_1 + i];
|
||||
if (tabWidget->type != WWT_EMPTY) {
|
||||
window_scenery_active_tab_index = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E0FEF
|
||||
@@ -416,7 +455,7 @@ void window_scenery_open()
|
||||
(1 << WIDX_SCENERY_BUILD_CLUSTER_BUTTON);
|
||||
|
||||
window_init_scroll_widgets(window);
|
||||
RCT2_CALLPROC_X(0x006E1EB4, 0, 0, 0, 0, (int)window, 0, 0);
|
||||
window_scenery_update_scroll(window);
|
||||
show_gridlines();
|
||||
window_scenery_rotation = 3;
|
||||
RCT2_GLOBAL(0x00F64F12, uint8) = 0;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Dániel Tar
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _WINDOW_SCENERY_H_
|
||||
#define _WINDOW_SCENERY_H_
|
||||
|
||||
#define WINDOW_SCENERY_WIDTH 0x27A
|
||||
#define WINDOW_SCENERY_HEIGHT 0x8E
|
||||
#define SCENERY_BUTTON_WIDTH 66
|
||||
#define SCENERY_BUTTON_HEIGHT 80
|
||||
#define SCENERY_ENTRIES_BY_TAB 128
|
||||
|
||||
#define window_scenery_active_tab_index RCT2_GLOBAL(0x00F64EDC, uint8)
|
||||
#define window_scenery_selected_scenery_by_tab RCT2_ADDRESS(0x00F64EDD, sint16)
|
||||
#define window_scenery_is_build_cluster_tool_on RCT2_GLOBAL(0x00F64F1A, uint8)
|
||||
#define window_scenery_is_repaint_scenery_tool_on RCT2_GLOBAL(0x00F64F19, uint8)
|
||||
#define window_scenery_rotation RCT2_GLOBAL(0x00F64F05, uint8)
|
||||
#define window_scenery_primary_colour RCT2_GLOBAL(0x00F64F06, uint8)
|
||||
#define window_scenery_secondary_colour RCT2_GLOBAL(0x00F64F07, uint8)
|
||||
#define window_scenery_tertiary_colour RCT2_GLOBAL(0x00F64F08, uint8)
|
||||
|
||||
#endif
|
||||
@@ -1318,9 +1318,8 @@ void window_staff_options_mousedown(int widgetIndex, rct_window* w, rct_widget*
|
||||
init_scenery();
|
||||
|
||||
int ebx = 0;
|
||||
for (int i = 0; i < 19;++i){
|
||||
sint16* ebp = RCT2_ADDRESS(0xF64F2C, sint16*)[i];
|
||||
if (*ebp != -1){
|
||||
for (int i = 0; i < 19; i++) {
|
||||
if (window_scenery_tab_entries[i][0] != -1) {
|
||||
rct_scenery_set_entry* scenery_entry = g_scenerySetEntries[i];
|
||||
ebx |= scenery_entry->var_10A;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include "../interface/window.h"
|
||||
#include "../interface/viewport.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../world/scenery.h"
|
||||
#include "dropdown.h"
|
||||
#include "scenery.h"
|
||||
|
||||
enum {
|
||||
WIDX_PAUSE,
|
||||
|
||||
@@ -135,6 +135,8 @@ enum {
|
||||
PATH_BIT_FLAG_JUMPING_FOUNTAIN_SNOW = 1 << 5
|
||||
};
|
||||
|
||||
#define SCENERY_ENTRIES_BY_TAB 128
|
||||
|
||||
#define g_smallSceneryEntries ((rct_scenery_entry**)object_entry_groups[OBJECT_TYPE_SMALL_SCENERY].chunks)
|
||||
#define g_largeSceneryEntries ((rct_scenery_entry**)object_entry_groups[OBJECT_TYPE_LARGE_SCENERY].chunks)
|
||||
#define g_wallSceneryEntries ((rct_scenery_entry**)object_entry_groups[OBJECT_TYPE_WALLS].chunks)
|
||||
@@ -142,8 +144,20 @@ enum {
|
||||
#define g_pathBitSceneryEntries ((rct_scenery_entry**)object_entry_groups[OBJECT_TYPE_PATH_BITS].chunks)
|
||||
#define g_scenerySetEntries ((rct_scenery_set_entry**)object_entry_groups[OBJECT_TYPE_SCENERY_SETS].chunks)
|
||||
|
||||
#define window_scenery_active_tab_index RCT2_GLOBAL(0x00F64EDC, uint8)
|
||||
#define window_scenery_selected_scenery_by_tab RCT2_ADDRESS(0x00F64EDD, sint16)
|
||||
#define window_scenery_is_build_cluster_tool_on RCT2_GLOBAL(0x00F64F1A, uint8)
|
||||
#define window_scenery_is_repaint_scenery_tool_on RCT2_GLOBAL(0x00F64F19, uint8)
|
||||
#define window_scenery_rotation RCT2_GLOBAL(0x00F64F05, uint8)
|
||||
#define window_scenery_primary_colour RCT2_GLOBAL(0x00F64F06, uint8)
|
||||
#define window_scenery_secondary_colour RCT2_GLOBAL(0x00F64F07, uint8)
|
||||
#define window_scenery_tertiary_colour RCT2_GLOBAL(0x00F64F08, uint8)
|
||||
|
||||
extern sint16 window_scenery_tab_entries[20][SCENERY_ENTRIES_BY_TAB + 1];
|
||||
|
||||
void init_scenery();
|
||||
void scenery_update_tile(int x, int y);
|
||||
void scenery_update_age(int x, int y, rct_map_element *mapElement);
|
||||
void scenery_set_default_placement_configuration();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user