/** * * rct2: 0x0066DC0F */ static void load_landscape() { if (open_landscape_file_dialog() == 0) { gfx_invalidate_screen(); } else { // Set default filename char *esi = (char*)0x0141EF67; while (1) { esi++; if (*esi == '.') break; if (*esi != 0) continue; strcpy(esi, ".SC6"); break; } strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, (char*)0x0141EF68); RCT2_CALLPROC_EBPSAFE(0x006758C0); // landscape_load if (1) { gfx_invalidate_screen(); rct2_endupdate(); } else { RCT2_GLOBAL(0x009DEA66, uint16) = 0; rct2_endupdate(); } } }
/** * * rct2: 0x0066C9EA */ static void window_game_top_toolbar_dropdown() { short widgetIndex, dropdownIndex; __asm mov widgetIndex, dx __asm mov dropdownIndex, ax if (widgetIndex == WIDX_FILE_MENU) { switch (dropdownIndex) { case 0: // load game game_do_command(0, 1, 0, 0, 5, 0, 0); break; case 1: // save game tool_cancel(); { int eax, ebx, ecx, edx, esi, edi, ebp; RCT2_CALLFUNC_X(0x006750E9, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp); if (eax == 0) { gfx_invalidate_screen(); break; } char *src = (char*)0x0141EF67; do { src++; } while (*src != '.' && *src != '\0'); strcpy(src, ".SV6"); strcpy(RCT2_ADDRESS_SAVED_GAMES_PATH_2, 0x0141EF68); eax = 0; if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & 8) eax |= 1; RCT2_CALLPROC_X(0x006754F5, eax, 0, 0, 0, 0, 0, 0); // check success? game_do_command(0, 1047, 0, -1, 0, 0, 0); gfx_invalidate_screen(); } break; case 3: // about window_about_open(); break; case 4: // options window_options_open(); //RCT2_CALLPROC_EBPSAFE(0x006BAC5B); break; case 5: // screenshot RCT2_GLOBAL(RCT2_ADDRESS_SCREENSHOT_COUNTDOWN, sint8) = 10; break; case 7: // quit game game_do_command(0, 1, 0, 0, 5, 1, 0); break; } } else if (widgetIndex == WIDX_VIEW_MENU) { RCT2_CALLPROC_X(0x0066CF8A, dropdownIndex, 0, 0, 0, 0, 0, 0); } }
/** * * rct2: 0x0068E8DA */ void title_load() { if (RCT2_GLOBAL(0x009DEA6E, uint8) & 1) RCT2_CALLPROC_X(0x00667C15, 0, 1, 0, 0, 0, 0, 0); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TITLE_DEMO; reset_park_entrances(); reset_saved_strings(); RCT2_CALLPROC_EBPSAFE(0x0069EB13); ride_init_all(); window_guest_list_init_vars_a(); RCT2_CALLPROC_EBPSAFE(0x006BD3A4); map_init(); park_init(); date_reset(); RCT2_CALLPROC_X(0x006C45ED, 0, 0, 0, 0, 0, 0, 0); RCT2_CALLPROC_EBPSAFE(0x006DFEE4); window_new_ride_init_vars(); window_guest_list_init_vars_b(); window_staff_init_vars(); RCT2_CALLPROC_EBPSAFE(0x0068AFFD); RCT2_CALLPROC_EBPSAFE(0x0069EBE4); viewport_init_all(); news_item_init_queue(); title_create_windows(); title_init_showcase(); gfx_invalidate_screen(); RCT2_GLOBAL(0x009DEA66, uint16) = 0; }
/** * * rct2: 0x00672957 */ void trackdesigner_load() { rct_window *mainWindow; RCT2_CALLPROC_EBPSAFE(0x006A9CE8); map_init(); set_all_land_owned(); RCT2_CALLPROC_EBPSAFE(0x006B9CB0); RCT2_CALLPROC_EBPSAFE(0x00667104); RCT2_CALLPROC_EBPSAFE(0x006C4209); RCT2_CALLPROC_EBPSAFE(0x0069EB13); ride_init_all(); RCT2_CALLPROC_EBPSAFE(0x0068F083); // window_guest_list_init_vars_a RCT2_CALLPROC_EBPSAFE(0x006BD3A4); park_init(); RCT2_CALLPROC_EBPSAFE(0x0069DEFB); date_reset(); RCT2_CALLPROC_EBPSAFE(0x0068F050); // window_guest_list_init_vars_b RCT2_CALLPROC_EBPSAFE(0x006BD39C); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TRACK_DESIGNER; RCT2_GLOBAL(0x0141F570, uint8) = 0; RCT2_CALLPROC_EBPSAFE(0x006ACA58); viewport_init_all(); news_item_init_queue(); RCT2_CALLPROC_EBPSAFE(0x0066EF38); // window_main_editor_create mainWindow = window_get_main(); window_scroll_to_location(mainWindow, 2400, 2400, 112); mainWindow->flags &= ~0x08; RCT2_CALLPROC_EBPSAFE(0x006837E3); gfx_invalidate_screen(); RCT2_GLOBAL(0x009DEA66, sint16) = 0; rct2_endupdate(); }
static void cheat_remove_litter() { rct_litter* litter; uint16 spriteIndex, nextSpriteIndex; for (spriteIndex = RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_START_LITTER, uint16); spriteIndex != SPRITE_INDEX_NULL; spriteIndex = nextSpriteIndex) { litter = &(g_sprite_list[spriteIndex].litter); nextSpriteIndex = litter->next; sprite_remove((rct_sprite*)litter); } map_element_iterator it; rct_scenery_entry *sceneryEntry; map_element_iterator_begin(&it); do { if (map_element_get_type(it.element) != MAP_ELEMENT_TYPE_PATH) continue; if (!footpath_element_has_path_scenery(it.element)) continue; sceneryEntry = g_pathBitSceneryEntries[footpath_element_get_path_scenery_index(it.element)]; if(sceneryEntry->path_bit.var_06 & (1 << 0)) it.element->properties.path.addition_status = 0xFF; } while (map_element_iterator_next(&it)); gfx_invalidate_screen(); }
/** * * rct2: 0x0068E8DA */ void title_load() { if (RCT2_GLOBAL(0x009DEA6E, uint8) & 1) RCT2_CALLPROC_X(0x00667C15, 0, 1, 0, 0, 0, 0, 0);//Game pause toggle RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TITLE_DEMO; reset_park_entrances(); user_string_clear_all(); reset_sprite_list(); ride_init_all(); window_guest_list_init_vars_a(); sub_6BD3A4(); // RCT2_CALLPROC_EBPSAFE(0x006BD3A4); map_init(); park_init(); date_reset(); climate_reset(CLIMATE_COOL_AND_WET); RCT2_CALLPROC_EBPSAFE(0x006DFEE4); window_new_ride_init_vars(); window_guest_list_init_vars_b(); window_staff_list_init_vars(); map_update_tile_pointers(); //RCT2_CALLPROC_EBPSAFE(0x0068AFFD); reset_0x69EBE4();// RCT2_CALLPROC_EBPSAFE(0x0069EBE4); viewport_init_all(); news_item_init_queue(); title_create_windows(); title_init_showcase(); gfx_invalidate_screen(); RCT2_GLOBAL(0x009DEA66, uint16) = 0; }
/** * * rct2: 0x0068E8DA */ void title_load() { if (RCT2_GLOBAL(0x009DEA6E, uint8) & 1) RCT2_CALLPROC_X(0x00667C15, 0, 1, 0, 0, 0, 0, 0); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TITLE_DEMO; RCT2_CALLPROC_EBPSAFE(0x00667104); RCT2_CALLPROC_EBPSAFE(0x006C4209); RCT2_CALLPROC_EBPSAFE(0x0069EB13); ride_init_all(); RCT2_CALLPROC_EBPSAFE(0x0068F083); // window_guest_list_init_vars_a RCT2_CALLPROC_EBPSAFE(0x006BD3A4); map_init(); park_init(); date_reset(); RCT2_CALLPROC_X(0x006C45ED, 0, 0, 0, 0, 0, 0, 0); RCT2_CALLPROC_EBPSAFE(0x006DFEE4); RCT2_CALLPROC_EBPSAFE(0x006ACA58); RCT2_CALLPROC_EBPSAFE(0x0068F050); // window_guest_list_init_vars_b RCT2_CALLPROC_EBPSAFE(0x006BD39C); RCT2_CALLPROC_EBPSAFE(0x0068AFFD); RCT2_CALLPROC_EBPSAFE(0x0069EBE4); viewport_init_all(); news_item_init_queue(); title_create_windows(); title_init_showcase(); gfx_invalidate_screen(); RCT2_GLOBAL(0x009DEA66, uint16) = 0; }
/** * * rct2: 0x006729FD */ void trackmanager_load() { rct_window *mainWindow; object_unload_all(); map_init(); set_all_land_owned(); RCT2_CALLPROC_EBPSAFE(0x006B9CB0); reset_park_entrances(); reset_saved_strings(); reset_sprite_list(); ride_init_all(); window_guest_list_init_vars_a(); sub_6BD3A4(); park_init(); finance_init(); date_reset(); window_guest_list_init_vars_b(); window_staff_list_init_vars(); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TRACK_MANAGER; RCT2_GLOBAL(0x0141F570, uint8) = 0; window_new_ride_init_vars(); viewport_init_all(); news_item_init_queue(); RCT2_CALLPROC_EBPSAFE(0x0066EF38); // window_main_editor_create mainWindow = window_get_main(); window_scroll_to_location(mainWindow, 2400, 2400, 112); mainWindow->flags &= ~WF_SCROLLING_TO_LOCATION; RCT2_CALLPROC_EBPSAFE(0x006837E3); gfx_invalidate_screen(); RCT2_GLOBAL(0x009DEA66, sint16) = 0; rct2_endupdate(); }
static void cheat_remove_litter() { rct_litter* litter; uint16 spriteIndex, nextSpriteIndex; for (spriteIndex = gSpriteListHead[SPRITE_LIST_LITTER]; spriteIndex != SPRITE_INDEX_NULL; spriteIndex = nextSpriteIndex) { litter = &(get_sprite(spriteIndex)->litter); nextSpriteIndex = litter->next; sprite_remove((rct_sprite*)litter); } tile_element_iterator it; rct_scenery_entry *sceneryEntry; tile_element_iterator_begin(&it); do { if (tile_element_get_type(it.element) != TILE_ELEMENT_TYPE_PATH) continue; if (!footpath_element_has_path_scenery(it.element)) continue; sceneryEntry = get_footpath_item_entry(footpath_element_get_path_scenery_index(it.element)); if (sceneryEntry->path_bit.flags & PATH_BIT_FLAG_IS_BIN) it.element->properties.path.addition_status = 0xFF; } while (tile_element_iterator_next(&it)); gfx_invalidate_screen(); }
/** * * rct2: 0x0066F62C */ void window_editor_bottom_toolbar_jump_back_to_landscape_editor() { window_close_all(); sub_6DFED0(); scenery_set_default_placement_configuration(); g_editor_step = EDITOR_STEP_LANDSCAPE_EDITOR; window_map_open(); gfx_invalidate_screen(); }
/** * * rct2: 0x0066F7C0 */ void window_editor_bottom_toolbar_jump_forward_to_save_scenario() { rct_s6_info *s6Info = (rct_s6_info*)0x0141F570; int parkFlagsBackup, success; char path[256]; if (!scenario_prepare_for_save()) { window_error_open(STR_UNABLE_TO_SAVE_SCENARIO_FILE, RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id)); gfx_invalidate_screen(); return; } window_close_all(); window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO, s6Info->name); return; if (!show_save_scenario_dialog(path)) { gfx_invalidate_screen(); return; } // s6Info->editor_step = 255; // Ensure path has .SC6 extension path_set_extension(path, ".SC6"); // Save the scenario parkFlagsBackup = RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32); RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) &= ~PARK_FLAGS_18; SDL_RWops* rw = SDL_RWFromFile(path, "wb+"); if (rw != NULL) { success = scenario_save(rw, gConfigGeneral.save_plugin_data ? 3 : 2); SDL_RWclose(rw); } RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) = parkFlagsBackup; if (success) { title_load(); } else { window_error_open(STR_SCENARIO_SAVE_FAILED, -1); s6Info->editor_step = EDITOR_STEP_OBJECTIVE_SELECTION; } }
/** * * rct2: 0x0066F6B0 */ void window_editor_bottom_toolbar_jump_forward_from_object_selection() { if (!window_editor_bottom_toolbar_check_object_selection()) return; if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) { reset_researched_ride_types_and_entries(); window_new_ride_open(); gS6Info.editor_step = EDITOR_STEP_ROLLERCOASTER_DESIGNER; gfx_invalidate_screen(); } else { reset_researched_scenery_items(); scenery_set_default_placement_configuration(); gS6Info.editor_step = EDITOR_STEP_LANDSCAPE_EDITOR; window_map_open(); gfx_invalidate_screen(); } }
static void window_debug_paint_mouseup(rct_window * w, rct_widgetindex widgetIndex) { switch (widgetIndex) { case WIDX_TOGGLE_OLD_DRAWING: gUseOriginalRidePaint = !gUseOriginalRidePaint; gfx_invalidate_screen(); break; case WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS: gShowSupportSegmentHeights = !gShowSupportSegmentHeights; gfx_invalidate_screen(); break; case WIDX_TOGGLE_SHOW_BOUND_BOXES: gPaintBoundingBoxes = !gPaintBoundingBoxes; gfx_invalidate_screen(); break; } }
/** * * rct2: 0x0066F758 */ void window_editor_bottom_toolbar_jump_forward_to_invention_list_set_up() { if (editor_check_park()) { window_close_all(); window_editor_inventions_list_open(); g_editor_step = EDITOR_STEP_INVENTIONS_LIST_SET_UP; } else { window_error_open(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, uint16)); } gfx_invalidate_screen(); }
/** * * rct2: 0x0066F7C0 */ void window_editor_bottom_toolbar_jump_forward_to_save_scenario() { if (!scenario_prepare_for_save()) { window_error_open(STR_UNABLE_TO_SAVE_SCENARIO_FILE, gGameCommandErrorText); gfx_invalidate_screen(); return; } window_close_all(); window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO, gS6Info.name); }
/** * * rct2: 0x0066F758 */ void window_editor_bottom_toolbar_jump_forward_to_invention_list_set_up() { if (editor_check_park()) { window_close_all(); window_editor_inventions_list_open(); gS6Info.editor_step = EDITOR_STEP_INVENTIONS_LIST_SET_UP; } else { window_error_open(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, gGameCommandErrorText); } gfx_invalidate_screen(); }
static void track_design_save_callback(sint32 result, const utf8 * path) { free(_trackDesign->track_elements); free(_trackDesign->entrance_elements); free(_trackDesign->scenery_elements); free(_trackDesign); if (result == MODAL_RESULT_OK) { track_repository_scan(); } gfx_invalidate_screen(); }
static void osinterface_resize(int width, int height) { rct_drawpixelinfo *screenDPI; int newScreenBufferSize; void *newScreenBuffer; if (_surface != NULL) SDL_FreeSurface(_surface); if (_palette != NULL) SDL_FreePalette(_palette); _surface = SDL_CreateRGBSurface(0, width, height, 8, 0, 0, 0, 0); _palette = SDL_AllocPalette(256); SDL_SetSurfacePalette(_surface, _palette); newScreenBufferSize = _surface->pitch * _surface->h; newScreenBuffer = malloc(newScreenBufferSize); if (_screenBuffer == NULL) { memset(newScreenBuffer, 0, newScreenBufferSize); } else { memcpy(newScreenBuffer, _screenBuffer, min(_screenBufferSize, newScreenBufferSize)); if (newScreenBufferSize - _screenBufferSize > 0) memset((uint8*)newScreenBuffer + _screenBufferSize, 0, newScreenBufferSize - _screenBufferSize); free(_screenBuffer); } _screenBuffer = newScreenBuffer; _screenBufferSize = newScreenBufferSize; RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, sint16) = width; RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_HEIGHT, sint16) = height; screenDPI = RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo); screenDPI->bits = _screenBuffer; screenDPI->x = 0; screenDPI->y = 0; screenDPI->width = width; screenDPI->height = height; screenDPI->pitch = _surface->pitch - _surface->w; RCT2_GLOBAL(0x009ABDF0, uint8) = 6; RCT2_GLOBAL(0x009ABDF1, uint8) = 3; RCT2_GLOBAL(0x009ABDF2, uint8) = 1; RCT2_GLOBAL(RCT2_ADDRESS_DIRTY_BLOCK_WIDTH, sint16) = 64; RCT2_GLOBAL(RCT2_ADDRESS_DIRTY_BLOCK_HEIGHT, sint16) = 8; RCT2_GLOBAL(RCT2_ADDRESS_DIRTY_BLOCK_COLUMNS, sint32) = (width >> 6) + 1; RCT2_GLOBAL(RCT2_ADDRESS_DIRTY_BLOCK_ROWS, sint32) = (height >> 3) + 1; RCT2_CALLPROC_EBPSAFE(0x0066B905); // resize_gui() gfx_invalidate_screen(); }
/** * * rct2: 0x0066F7C0 */ void window_editor_bottom_toolbar_jump_forward_to_save_scenario() { rct_s6_info *s6Info = (rct_s6_info*)0x0141F570; if (!scenario_prepare_for_save()) { window_error_open(STR_UNABLE_TO_SAVE_SCENARIO_FILE, RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TEXT, rct_string_id)); gfx_invalidate_screen(); return; } window_close_all(); window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO, s6Info->name); }
static void cheat_water_plants() { map_element_iterator it; map_element_iterator_begin(&it); do { if (map_element_get_type(it.element) == MAP_ELEMENT_TYPE_SCENERY) { it.element->properties.scenery.age = 0; } } while (map_element_iterator_next(&it)); gfx_invalidate_screen(); }
/** * * rct2: 0x0066F6B0 */ void window_editor_bottom_toolbar_jump_forward_from_object_selection() { if (!window_editor_bottom_toolbar_check_object_selection()) return; if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TRACK_DESIGNER) { sub_66F6E3(); } else { sub_6DFED0(); scenery_set_default_placement_configuration(); RCT2_GLOBAL(0x00141F570, uint8) = 1; window_map_open(); gfx_invalidate_screen(); } }
void platform_refresh_video(bool recreate_window) { if (recreate_window) { context_recreate_window(); } else { drawing_engine_dispose(); drawing_engine_init(); drawing_engine_resize(); } drawing_engine_set_palette(gPalette); gfx_invalidate_screen(); }
/** * * rct2: 0x006D303D */ void track_design_save_select_nearby_scenery(sint32 rideIndex) { rct_map_element *mapElement; for (sint32 y = 0; y < 256; y++) { for (sint32 x = 0; x < 256; x++) { mapElement = map_get_first_element_at(x, y); do { if (track_design_save_should_select_scenery_around(rideIndex, mapElement)) { track_design_save_select_nearby_scenery_for_tile(rideIndex, x, y); break; } } while (!map_element_is_last_for_tile(mapElement++)); } } gfx_invalidate_screen(); }
static void cheat_fix_vandalism() { map_element_iterator it; map_element_iterator_begin(&it); do { if (map_element_get_type(it.element) != MAP_ELEMENT_TYPE_PATH) continue; if (!footpath_element_has_path_scenery(it.element)) continue; it.element->flags &= ~MAP_ELEMENT_FLAG_BROKEN; } while (map_element_iterator_next(&it)); gfx_invalidate_screen(); }
/** * * rct2: 0x006D303D */ void track_design_save_select_nearby_scenery(sint32 rideIndex) { rct_tile_element *tileElement; for (sint32 y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { for (sint32 x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { tileElement = map_get_first_element_at(x, y); do { if (track_design_save_should_select_scenery_around(rideIndex, tileElement)) { track_design_save_select_nearby_scenery_for_tile(rideIndex, x, y); break; } } while (!(tileElement++)->IsLastForTile()); } } gfx_invalidate_screen(); }
/** * * rct2: 0x0068E8DA */ void title_load() { log_verbose("loading title"); if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) & 1) pause_toggle(); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) = SCREEN_FLAGS_TITLE_DEMO; reset_park_entrances(); user_string_clear_all(); reset_sprite_list(); ride_init_all(); window_guest_list_init_vars_a(); staff_reset_modes(); map_init(150); park_init(); date_reset(); climate_reset(CLIMATE_COOL_AND_WET); scenery_set_default_placement_configuration(); window_new_ride_init_vars(); window_guest_list_init_vars_b(); window_staff_list_init_vars(); map_update_tile_pointers(); reset_0x69EBE4(); stop_ride_music(); stop_crowd_sound(); //stop_other_sounds(); viewport_init_all(); news_item_init_queue(); title_create_windows(); title_init_showcase(); gfx_invalidate_screen(); RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_AGE, uint16) = 0; #ifndef DISABLE_NETWORK network_close(); #endif if (gOpenRCT2ShowChangelog) { gOpenRCT2ShowChangelog = false; window_changelog_open(); } log_verbose("loading title finished"); }
/** * * rct2: 0x0066F6E3 */ static void sub_66F6E3() { RCT2_GLOBAL(0x01357404, uint32) = 0xFFFFFFFF; RCT2_GLOBAL(0x01357408, uint32) = 0xFFFFFFFF; RCT2_GLOBAL(0x0135740C, uint32) = 0xFFFFFFFF; RCT2_GLOBAL(0x01357410, uint32) = 0xFFFFFFFF; for (int i = 0; i < 128; i++) { RCT2_ADDRESS(0x01357444, uint32)[i] = RCT2_ADDRESS(0x0097C468, uint32)[i]; RCT2_ADDRESS(0x01357644, uint32)[i] = RCT2_ADDRESS(0x0097C5D4, uint32)[i]; } for (int i = 0; i < 8; i++) { RCT2_ADDRESS(0x01357424, uint32)[i] = 0xFFFFFFFF; } window_new_ride_open(); RCT2_GLOBAL(0x0141F570, uint8) = 6; gfx_invalidate_screen(); }
static void LoadTheme(UITheme * theme) { if (CurrentTheme == theme) { return; } if (CurrentTheme != nullptr) { if (!(CurrentTheme->Flags & UITHEME_FLAG_PREDEFINED)) { delete CurrentTheme; } } CurrentTheme = theme; CurrentThemePath.clear(); gfx_invalidate_screen(); }
void LoadTheme(UITheme * theme) { if (CurrentTheme == theme) { return; } if (CurrentTheme != nullptr) { if (!(CurrentTheme->Flags & UITHEME_FLAG_PREDEFINED)) { delete CurrentTheme; } } CurrentTheme = theme; String::DiscardUse(&CurrentThemePath, nullptr); gfx_invalidate_screen(); }
static void window_mapgen_base_mouseup(rct_window *w, int widgetIndex) { mapgen_settings mapgenSettings; switch (widgetIndex) { case WIDX_CLOSE: window_close(w); break; case WIDX_TAB_1: case WIDX_TAB_2: case WIDX_TAB_3: window_mapgen_set_page(w, widgetIndex - WIDX_TAB_1); break; case WIDX_GENERATE: mapgenSettings.mapSize = _mapSize; mapgenSettings.height = _baseHeight + 2; mapgenSettings.waterLevel = _waterLevel + 2; mapgenSettings.floor = _floorTexture; mapgenSettings.wall = _wallTexture; mapgen_generate_blank(&mapgenSettings); gfx_invalidate_screen(); break; case WIDX_MAP_SIZE: ((uint16*)TextInputDescriptionArgs)[0] = MINIMUM_MAP_SIZE_PRACTICAL; ((uint16*)TextInputDescriptionArgs)[1] = MAXIMUM_MAP_SIZE_PRACTICAL; // Practical map size is 2 lower than the technical map size window_text_input_open(w, WIDX_MAP_SIZE, 5130, 5131, 5182, _mapSize - 2, 4); break; case WIDX_BASE_HEIGHT: ((uint16*)TextInputDescriptionArgs)[0] = (BASESIZE_MIN - 12) / 2; ((uint16*)TextInputDescriptionArgs)[1] = (BASESIZE_MAX - 12) / 2; window_text_input_open(w, WIDX_BASE_HEIGHT, 5183, 5184, 5182, (_baseHeight - 12) / 2, 3); break; case WIDX_WATER_LEVEL: ((uint16*)TextInputDescriptionArgs)[0] = (WATERLEVEL_MIN - 12) / 2; ((uint16*)TextInputDescriptionArgs)[1] = (WATERLEVEL_MAX - 12) / 2; window_text_input_open(w, WIDX_WATER_LEVEL, 5185, 5186, 5182, (_waterLevel - 12) / 2, 3); break; } }