mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 03:53:07 +01:00
Add paint debug window
This commit is contained in:
@@ -41,7 +41,6 @@
|
||||
#include "console.h"
|
||||
#include "window.h"
|
||||
#include "viewport.h"
|
||||
#include "../paint/map_element/map_element.h"
|
||||
|
||||
#define CONSOLE_BUFFER_SIZE 8192
|
||||
#define CONSOLE_BUFFER_2_SIZE 256
|
||||
@@ -668,15 +667,9 @@ static int cc_get(const utf8 **argv, int argc)
|
||||
else if (strcmp(argv[0], "window_scale") == 0) {
|
||||
console_printf("window_scale %.3f", gConfigGeneral.window_scale);
|
||||
}
|
||||
else if (strcmp(argv[0], "paint_segments") == 0) {
|
||||
console_printf("paint_segments %d", gShowSupportSegmentHeights);
|
||||
}
|
||||
else if (strcmp(argv[0], "window_limit") == 0) {
|
||||
console_printf("window_limit %d", gConfigGeneral.window_limit);
|
||||
}
|
||||
else if (strcmp(argv[0], "paint_bounds") == 0) {
|
||||
console_printf("paint_bounds %d", gPaintBoundingBoxes);
|
||||
}
|
||||
else {
|
||||
console_writeline_warning("Invalid variable.");
|
||||
}
|
||||
@@ -845,20 +838,10 @@ static int cc_set(const utf8 **argv, int argc)
|
||||
platform_trigger_resize();
|
||||
console_execute_silent("get window_scale");
|
||||
}
|
||||
else if (strcmp(argv[0], "paint_segments") == 0 && invalidArguments(&invalidArgs, int_valid[0])) {
|
||||
gShowSupportSegmentHeights = (bool)(int_val[0]);
|
||||
gfx_invalidate_screen();
|
||||
console_execute_silent("get paint_segments");
|
||||
}
|
||||
else if (strcmp(argv[0], "window_limit") == 0 && invalidArguments(&invalidArgs, int_valid[0])) {
|
||||
window_set_window_limit(int_val[0]);
|
||||
console_execute_silent("get window_limit");
|
||||
}
|
||||
else if (strcmp(argv[0], "paint_bounds") == 0 && invalidArguments(&invalidArgs, int_valid[0])) {
|
||||
gPaintBoundingBoxes = (bool)(int_val[0]);
|
||||
gfx_invalidate_screen();
|
||||
console_execute_silent("get paint_bounds");
|
||||
}
|
||||
else if (invalidArgs) {
|
||||
console_writeline_error("Invalid arguments.");
|
||||
}
|
||||
@@ -1046,9 +1029,7 @@ utf8* console_variable_table[] = {
|
||||
"no_test_crashes",
|
||||
"location",
|
||||
"window_scale",
|
||||
"paint_segments",
|
||||
"window_limit",
|
||||
"paint_bounds",
|
||||
};
|
||||
utf8* console_window_table[] = {
|
||||
"object_selection",
|
||||
|
||||
@@ -547,9 +547,20 @@ static void shortcut_show_multiplayer()
|
||||
static void shortcut_orginal_painting_toggle()
|
||||
{
|
||||
gUseOriginalRidePaint = !gUseOriginalRidePaint;
|
||||
window_invalidate_by_class(WC_DEBUG_PAINT);
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
static void shortcut_debug_paint_toggle()
|
||||
{
|
||||
rct_window * window = window_find_by_class(WC_DEBUG_PAINT);
|
||||
if (window != NULL) {
|
||||
window_close(window);
|
||||
} else {
|
||||
window_debug_paint_open();
|
||||
}
|
||||
}
|
||||
|
||||
static const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
|
||||
shortcut_close_top_most_window,
|
||||
shortcut_close_all_floating_windows,
|
||||
@@ -601,6 +612,7 @@ static const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
|
||||
shortcut_windowed_mode_toggle,
|
||||
shortcut_show_multiplayer,
|
||||
shortcut_orginal_painting_toggle,
|
||||
shortcut_debug_paint_toggle,
|
||||
};
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -461,6 +461,7 @@ enum {
|
||||
WC_SERVER_LIST = 127,
|
||||
WC_SERVER_START = 128,
|
||||
WC_CUSTOM_CURRENCY_CONFIG = 129,
|
||||
WC_DEBUG_PAINT = 130,
|
||||
|
||||
// Only used for colour schemes
|
||||
WC_STAFF = 220,
|
||||
@@ -688,6 +689,7 @@ void window_text_input_raw_open(rct_window* call_w, int call_widget, rct_string_
|
||||
rct_window *window_mapgen_open();
|
||||
rct_window *window_loadsave_open(int type, char *defaultName);
|
||||
rct_window *window_changelog_open();
|
||||
void window_debug_paint_open();
|
||||
|
||||
void window_editor_main_open();
|
||||
void window_editor_bottom_toolbar_open();
|
||||
|
||||
Reference in New Issue
Block a user