Remove uses of 0x009BC677 buffer

This commit is contained in:
Ted John 2016-09-05 23:00:17 +01:00
parent 1e65c7e940
commit 248424e6ad
5 changed files with 34 additions and 37 deletions

View File

@ -18,7 +18,7 @@
#include "../common.h"
#if __cplusplus
#ifdef __cplusplus
#include "../core/List.hpp"

View File

@ -14,7 +14,6 @@
*****************************************************************************/
#pragma endregion
#include "../addresses.h"
#include "../audio/audio.h"
#include "../config.h"
#include "../game.h"
@ -1230,7 +1229,6 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
rct_object_entry *highlightedEntry;
rct_string_id stringId;
uint8 source;
char *stringBuffer;
/*if (w->selected_tab == WINDOW_OBJECT_SELECTION_PAGE_RIDE_VEHICLES_ATTRACTIONS) {
gfx_fill_rect_inset(dpi,
@ -1345,23 +1343,23 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
x = w->x + (widget->left + widget->right) / 2 + 1;
y = w->y + widget->bottom + 3;
width = w->width - w->widgets[WIDX_LIST].right - 6;
RCT2_GLOBAL(0x009BC677, uint8) = 14;
stringId = STR_PLACEHOLDER;
stringBuffer = (char*)language_get_string(STR_PLACEHOLDER) + 1;
strcpy(stringBuffer, listItem->repositoryItem->Name);
gfx_draw_string_centred_clipped(dpi, stringId, NULL, 0, x, y, width);
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, listItem->repositoryItem->Name);
gfx_draw_string_centred_clipped(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, 0, x, y, width);
// Draw description of object
strcpy(stringBuffer, object_get_description(_loadedObject));
if (stringId != STR_NONE) {
const char *description = object_get_description(_loadedObject);
if (description != NULL) {
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, description);
x = w->x + w->widgets[WIDX_LIST].right + 4;
y += 15;
int width = w->x + w->width - x - 4;
if (type == OBJECT_TYPE_SCENARIO_TEXT) {
gfx_draw_string_left_wrapped(dpi, &stringId, x, y, width, STR_OBJECT_SELECTION_DESCRIPTION_SCENARIO_TEXT, 0);
gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, width, STR_OBJECT_SELECTION_DESCRIPTION_SCENARIO_TEXT, 0);
} else {
gfx_draw_string_left_wrapped(dpi, &stringId, x, y + 5, width, STR_BLACK_STRING, 0);
gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y + 5, width, STR_WINDOW_COLOUR_2_STRINGID, 0);
}
}
@ -1387,9 +1385,10 @@ static void window_editor_object_selection_paint(rct_window *w, rct_drawpixelinf
// gfx_draw_string_right(dpi, stringId, NULL, 2, w->x + w->width - 5, w->y + w->height - 3 - 12 - 14);
// Draw object dat name
stringId = STR_PLACEHOLDER;
strcpy(stringBuffer, path_get_filename(listItem->repositoryItem->Path));
gfx_draw_string_right(dpi, stringId, NULL, 0, w->x + w->width - 5, w->y + w->height - 3 - 12);
const char *path = path_get_filename(listItem->repositoryItem->Path);
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, path);
gfx_draw_string_right(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, 0, w->x + w->width - 5, w->y + w->height - 3 - 12);
}
/**
@ -1701,8 +1700,7 @@ static void window_editor_object_selection_manage_tracks()
uint8* ride_type_array = &ride_entry->ride_type[0];
int ride_type;
for (int i = 0; (ride_type = ride_type_array[i]) == 0xFF; i++);
RCT2_GLOBAL(0xF44158, uint8) = ride_type;
for (int i = 0; (ride_type = ride_type_array[i]) == 0xFF; i++) { }
ride_list_item item = { ride_type, entry_index };
// track_load_list(item);

View File

@ -424,12 +424,10 @@ static void window_editor_objective_options_main_mouseup(rct_window *w, int widg
window_text_input_open(w, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, gParkName, 0, 32);
break;
case WIDX_SCENARIO_NAME:
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), gS6Info->name, 64);
window_text_input_open(w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, STR_PLACEHOLDER, 0, 64);
window_text_input_raw_open(w, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, gS6Info->name, 64);
break;
case WIDX_DETAILS:
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), gS6Info->details, 256);
window_text_input_open(w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, STR_PLACEHOLDER, 0, 256);
window_text_input_raw_open(w, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, gS6Info->details, 256);
break;
}
}
@ -1018,11 +1016,12 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
if (stex != NULL) {
set_format_arg(0, rct_string_id, stex->scenario_name);
set_format_arg(2, uint32, gParkNameArgs);
} else {
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), gS6Info->name, 64);
set_format_arg(0, rct_string_id, STR_PLACEHOLDER);
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, gS6Info->name);
}
set_format_arg(2, uint32, gParkNameArgs);
gfx_draw_string_left_clipped(dpi, STR_WINDOW_SCENARIO_NAME, gCommonFormatArgs, 0, x, y, width);
// Scenario details label
@ -1037,11 +1036,11 @@ static void window_editor_objective_options_main_paint(rct_window *w, rct_drawpi
if (stex != NULL) {
set_format_arg(0, rct_string_id, stex->details);
set_format_arg(2, uint32, gParkNameArgs);
} else {
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), gS6Info->details, 256);
set_format_arg(0, rct_string_id, STR_PLACEHOLDER);
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, gS6Info->details);
}
set_format_arg(2, uint32, gParkNameArgs);
gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, width, STR_BLACK_STRING, 0);
// Scenario category label

View File

@ -1771,8 +1771,8 @@ static void window_park_objective_paint(rct_window *w, rct_drawpixelinfo *dpi)
// Scenario description
x = w->x + window_park_objective_widgets[WIDX_PAGE_BACKGROUND].left + 4;
y = w->y + window_park_objective_widgets[WIDX_PAGE_BACKGROUND].top + 7;
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), gScenarioDetails, 256);
set_format_arg(0, rct_string_id, STR_PLACEHOLDER);
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, gScenarioDetails);
y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, 222, STR_BLACK_STRING, 0);
y += 5;

View File

@ -416,14 +416,14 @@ static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi)
// Scenario name
x = w->x + window_scenarioselect_widgets[WIDX_SCENARIOLIST].right + 4;
y = w->y + window_scenarioselect_widgets[WIDX_TABCONTENT].top + 5;
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), scenario->name, 64);
set_format_arg(0, short, STR_PLACEHOLDER); // empty string
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, scenario->name);
gfx_draw_string_centred_clipped(dpi, STR_WINDOW_COLOUR_2_STRINGID, gCommonFormatArgs, 0, x + 85, y, 170);
y += 15;
// Scenario details
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), scenario->details, 256);
set_format_arg(0, rct_string_id, STR_PLACEHOLDER); // empty string
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, scenario->details);
y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, 170, STR_BLACK_STRING, 0) + 5;
// Scenario objective
@ -440,9 +440,9 @@ static void window_scenarioselect_paint(rct_window *w, rct_drawpixelinfo *dpi)
if (!str_is_null_or_empty(scenario->highscore->name)) {
completedByName = scenario->highscore->name;
}
safe_strcpy(RCT2_ADDRESS(0x009BC677, char), completedByName, 64);
set_format_arg(0, short, STR_PLACEHOLDER); // empty string
set_format_arg(2, int, scenario->highscore->company_value);
set_format_arg(0, rct_string_id, STR_STRING);
set_format_arg(2, const char *, completedByName);
set_format_arg(2 + sizeof(const char *), money32, scenario->highscore->company_value);
y += gfx_draw_string_left_wrapped(dpi, gCommonFormatArgs, x, y, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, 0);
}
}