1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 17:24:47 +01:00

remove lots of old object code

This commit is contained in:
Ted John
2016-07-02 18:01:51 +01:00
parent 2cade7dd13
commit a47c039f22
10 changed files with 81 additions and 1658 deletions

View File

@@ -17,16 +17,17 @@
#include "../addresses.h"
#include "../cursors.h"
#include "../input.h"
#include "../interface/themes.h"
#include "../interface/widget.h"
#include "../interface/window.h"
#include "../localisation/localisation.h"
#include "../management/research.h"
#include "../object.h"
#include "../world/scenery.h"
#include "../interface/themes.h"
#include "../object/ObjectRepository.h"
#include "../rct1.h"
#include "../util/util.h"
#include "../sprites.h"
#include "../util/util.h"
#include "../world/scenery.h"
#pragma region Widgets
@@ -772,9 +773,6 @@ static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo
return;
// Preview image
x = w->x + ((widget->left + widget->right) / 2) + 1;
y = w->y + ((widget->top + widget->bottom) / 2) + 1;
int objectEntryType = 7;
int eax = researchItem->entryIndex & 0xFFFFFF;
if (eax >= 0x10000)
@@ -785,7 +783,19 @@ static void window_editor_inventions_list_paint(rct_window *w, rct_drawpixelinfo
if (chunk == NULL || chunk == (void*)0xFFFFFFFF)
return;
object_paint(objectEntryType, chunk, dpi, x, y);
// Draw preview
widget = &w->widgets[WIDX_PREVIEW];
void * object = object_repository_get_loaded_object(objectEntryType, researchItem->entryIndex & 0xFF);
if (object != NULL) {
rct_drawpixelinfo clipDPI;
x = w->x + widget->left + 1;
y = w->y + widget->top + 1;
int width = widget->right - widget->left;
int height = widget->bottom - widget->top;
if (clip_drawpixelinfo(&clipDPI, dpi, x, y, width, height)) {
object_draw_preview(object, &clipDPI);
}
}
// Item name
x = w->x + ((widget->left + widget->right) / 2) + 1;

View File

@@ -733,9 +733,11 @@ static void window_editor_object_selection_close(rct_window *w)
unload_unselected_objects();
editor_load_selected_objects();
reset_loaded_objects();
object_free_scenario_text();
editor_object_flags_free();
object_delete(_loadedObject);
_loadedObject = NULL;
if (gScreenFlags & SCREEN_FLAGS_EDITOR) {
research_populate_list_random();
}
@@ -793,7 +795,6 @@ static void window_editor_object_selection_mouseup(rct_window *w, int widgetInde
w->selected_list_item = -1;
w->object_entry = (rct_object_entry *) 0xFFFFFFFF;
w->scrolls[0].v_top = 0;
object_free_scenario_text();
window_invalidate(w);
break;
case WIDX_FILTER_RIDE_TAB_TRANSPORT:
@@ -813,7 +814,6 @@ static void window_editor_object_selection_mouseup(rct_window *w, int widgetInde
w->selected_list_item = -1;
w->object_entry = (rct_object_entry *) 0xFFFFFFFF;
w->scrolls[0].v_top = 0;
object_free_scenario_text();
window_invalidate(w);
break;
@@ -825,7 +825,6 @@ static void window_editor_object_selection_mouseup(rct_window *w, int widgetInde
case WIDX_INSTALL_TRACK:
if (w->selected_list_item != -1) {
w->selected_list_item = -1;
object_free_scenario_text();
}
window_invalidate(w);
@@ -1035,10 +1034,8 @@ static void window_editor_object_selection_scroll_mouseover(rct_window *w, int s
if (selectedObject != w->selected_list_item) {
w->selected_list_item = selectedObject;
if (_loadedObject != NULL) {
object_delete(_loadedObject);
_loadedObject = NULL;
}
object_delete(_loadedObject);
_loadedObject = NULL;
list_item * listItem = &_listItems[selectedObject];
if (selectedObject == -1) {
@@ -1468,7 +1465,6 @@ static void window_editor_object_set_page(rct_window *w, int page)
w->selected_list_item = -1;
w->object_entry = (rct_object_entry *)0xFFFFFFFF;
w->scrolls[0].v_top = 0;
object_free_scenario_text();
if (page == WINDOW_OBJECT_SELECTION_PAGE_RIDE_VEHICLES_ATTRACTIONS) {
_listSortType = RIDE_SORT_TYPE;