1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

remove unnecessary functions

This commit is contained in:
Ted John
2016-07-09 15:36:48 +01:00
parent ce878723d7
commit 4de1f2912a
6 changed files with 3 additions and 76 deletions

View File

@@ -364,9 +364,8 @@ static int editor_read_s6(const char *path)
}
SDL_RWclose(rw);
if (!load_success){
if (!load_success) {
log_error("failed to load all entries.");
set_load_objects_fail_reason();
return 0;
}

View File

@@ -107,7 +107,6 @@ assert_struct_size(rct_object_filters, 3);
extern const rct_object_entry_group object_entry_groups[];
void object_list_load();
void set_load_objects_fail_reason();
bool object_read_and_load_entries(SDL_RWops* rw);
bool object_load_entries(rct_object_entry* entries);
int object_load_packed(SDL_RWops* rw);

View File

@@ -15,22 +15,12 @@
#pragma endregion
#include "addresses.h"
#include "config.h"
#include "game.h"
#include "localisation/localisation.h"
#include "object.h"
#include "object_list.h"
#include "object/ObjectRepository.h"
#include "platform/platform.h"
#include "rct1.h"
#include "ride/track.h"
#include "ride/track_design.h"
#include "util/sawyercoding.h"
#include "util/util.h"
#include "world/entrance.h"
#include "world/footpath.h"
#include "world/scenery.h"
#include "world/water.h"
// 98DA00
int object_entry_group_counts[] = {
@@ -126,54 +116,6 @@ void object_create_identifier_name(char* string_buffer, const rct_object_entry*
*string_buffer++ = '\0';
}
/**
*
* rct2: 0x675827
*/
void set_load_objects_fail_reason()
{
return;
rct_object_entry *object;
memcpy(&object, gCommonFormatArgs, sizeof(rct_object_entry*));
int expansion = (object->flags & 0xFF) >> 4;
if (expansion == 0 ||
expansion == 8 ||
RCT2_GLOBAL(RCT2_ADDRESS_EXPANSION_FLAGS, uint16) & (1 << expansion)
) {
char* string_buffer = RCT2_ADDRESS(0x9BC677, char);
format_string(string_buffer, STR_MISSING_OBJECT_DATA_ID, 0);
object_create_identifier_name(string_buffer, object);
gErrorType = ERROR_TYPE_FILE_LOAD;
gErrorStringId = STR_PLACEHOLDER;
return;
}
rct_string_id expansionNameId;
switch(expansion) {
case 1: // Wacky Worlds
expansionNameId = STR_OBJECT_FILTER_WW;
break;
case 2: // Time Twister
expansionNameId = STR_OBJECT_FILTER_TT;
break;
default:
gErrorType = ERROR_TYPE_FILE_LOAD;
gErrorStringId = STR_REQUIRES_AN_ADDON_PACK;
return;
}
char* string_buffer = RCT2_ADDRESS(0x9BC677, char);
format_string(string_buffer, STR_REQUIRES_THE_FOLLOWING_ADDON_PACK, &expansionNameId);
gErrorType = ERROR_TYPE_FILE_LOAD;
gErrorStringId = STR_PLACEHOLDER;
}
/**
*
* rct2: 0x006AA0C6
@@ -213,15 +155,6 @@ int find_object_in_entry_group(const rct_object_entry* entry, uint8* entry_type,
return 1;
}
void object_list_init()
{
for (uint8 objectType = 0; objectType < OBJECT_ENTRY_GROUP_COUNT; objectType++) {
for (size_t i = 0; i < (size_t)object_entry_group_counts[objectType]; i++) {
object_entry_groups[objectType].chunks[i] = (void*)-1;
}
}
}
void get_type_entry_index(size_t index, uint8 * outObjectType, uint8 * outEntryIndex)
{
uint8 objectType = OBJECT_TYPE_RIDE;

View File

@@ -33,7 +33,6 @@
#define gStexEntries RCT2_ADDRESS(RCT2_ADDRESS_SCENARIO_TEXT_ENTRIES, rct_stex_entry*)
#endif
void object_list_init();
void get_type_entry_index(size_t index, uint8 * outObjectType, uint8 * outEntryIndex);
const rct_object_entry * get_loaded_object_entry(size_t index);
void * get_loaded_object_chunk(size_t index);

View File

@@ -222,8 +222,6 @@ bool openrct2_initialise()
audio_populate_devices();
}
object_list_init();
if (!language_open(gConfigGeneral.language)) {
log_error("Failed to open configured language...");

View File

@@ -409,7 +409,6 @@ extern "C"
}
catch (ObjectLoadException)
{
set_load_objects_fail_reason();
}
catch (Exception)
{
@@ -442,7 +441,8 @@ extern "C"
}
catch (ObjectLoadException)
{
set_load_objects_fail_reason();
gErrorType = ERROR_TYPE_FILE_LOAD;
gErrorStringId = STR_GAME_SAVE_FAILED;
}
catch (IOException)
{
@@ -475,7 +475,6 @@ extern "C"
}
catch (ObjectLoadException)
{
set_load_objects_fail_reason();
}
catch (Exception)
{