mirror of https://github.com/OpenRCT2/OpenRCT2.git
Revert "Merge pull request #3897 from janisozaur/rebase-no-rct2"
This reverts commit22c0cc92e6
, reversing changes made to7b421c8052
.
This commit is contained in:
parent
fbd4c8be49
commit
dfa482b1b5
|
@ -411,9 +411,6 @@ static void PrintVersion()
|
|||
openrct2_write_full_version_info(buffer, sizeof(buffer));
|
||||
Console::WriteLine(buffer);
|
||||
Console::WriteFormat("%s (%s)", OPENRCT2_PLATFORM, OPENRCT2_ARCHITECTURE);
|
||||
#if NO_RCT2
|
||||
Console::Write(" (NO_RCT2)");
|
||||
#endif
|
||||
Console::WriteLine();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
|
||||
#if defined(__i386__) || defined(_M_IX86)
|
||||
#define PLATFORM_X86
|
||||
#else
|
||||
#define NO_RCT2 1
|
||||
#endif
|
||||
|
||||
#if defined(__LP64__) || defined(_WIN64)
|
||||
|
|
34
src/config.c
34
src/config.c
|
@ -331,6 +331,8 @@ static void config_write_enum(SDL_RWops *file, uint8 type, value_union *value, c
|
|||
static void utf8_skip_whitespace(utf8 **outch);
|
||||
static void utf8_skip_non_whitespace(utf8 **outch);
|
||||
|
||||
void config_apply_to_old_addresses();
|
||||
|
||||
static int rwopsreadc(SDL_RWops *file)
|
||||
{
|
||||
int c = 0;
|
||||
|
@ -464,6 +466,7 @@ bool config_open_default()
|
|||
|
||||
config_get_default_path(path);
|
||||
if (config_open(path)) {
|
||||
config_apply_to_old_addresses();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -476,6 +479,7 @@ bool config_save_default()
|
|||
|
||||
config_get_default_path(path);
|
||||
if (config_save(path)) {
|
||||
config_apply_to_old_addresses();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -940,6 +944,36 @@ bool config_find_or_browse_install_directory()
|
|||
return true;
|
||||
}
|
||||
|
||||
#pragma region Obsolete
|
||||
|
||||
/**
|
||||
* Any code not implemented in OpenRCT2 will still uses the old configuration option addresses. This function copies all the
|
||||
* OpenRCT2 configuration options to those addresses until the process is no longer necessary.
|
||||
*/
|
||||
void config_apply_to_old_addresses()
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_EDGE_SCROLLING, sint8) = gConfigGeneral.edge_scrolling;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CURRENCY, sint8) = gConfigGeneral.currency_format;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_METRIC, sint8) = gConfigGeneral.measurement_format;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_TEMPERATURE, sint8) = gConfigGeneral.temperature_format;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_CONSTRUCTION_MARKER, uint8) = gConfigGeneral.construction_marker_colour;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, sint16) = get_height_marker_offset();
|
||||
|
||||
int configFlags = 0;
|
||||
if (gConfigGeneral.always_show_gridlines)
|
||||
configFlags |= CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES;
|
||||
if (!gConfigGeneral.landscape_smoothing)
|
||||
configFlags |= CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE;
|
||||
if (gConfigGeneral.show_height_as_units)
|
||||
configFlags |= CONFIG_FLAG_SHOW_HEIGHT_AS_UNITS;
|
||||
if (gConfigGeneral.save_plugin_data)
|
||||
configFlags |= CONFIG_FLAG_SAVE_PLUGIN_DATA;
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) = configFlags;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Shortcuts
|
||||
|
||||
#define SHIFT 0x100
|
||||
|
|
|
@ -144,7 +144,7 @@ void load_palette(){
|
|||
|
||||
uint32 palette = 0x5FC;
|
||||
|
||||
if ((uintptr_t)water_type != (uint32)-1){
|
||||
if ((sint32)water_type != -1){
|
||||
palette = water_type->image_id;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,9 +24,8 @@
|
|||
#ifndef NO_RCT2
|
||||
#pragma pack(push, 1)
|
||||
#endif
|
||||
|
||||
// Size: 0x10 or more
|
||||
typedef struct {
|
||||
// Size: 0x10
|
||||
typedef struct rct_g1_element {
|
||||
uint8* offset; // 0x00
|
||||
sint16 width; // 0x04
|
||||
sint16 height; // 0x06
|
||||
|
@ -58,19 +57,7 @@ typedef struct rct_drawpixelinfo {
|
|||
assert_struct_size(rct_drawpixelinfo, 0x10);
|
||||
#endif
|
||||
|
||||
// Size: 0x10
|
||||
typedef struct rct_g1_element_32bit {
|
||||
uint32 offset; // 0x00 note: uint32 always!
|
||||
sint16 width; // 0x04
|
||||
sint16 height; // 0x06
|
||||
sint16 x_offset; // 0x08
|
||||
sint16 y_offset; // 0x0A
|
||||
uint16 flags; // 0x0C
|
||||
uint16 zoomed_offset; // 0x0E
|
||||
} rct_g1_element_32bit;
|
||||
assert_struct_size(rct_g1_element_32bit, 0x10);
|
||||
|
||||
enum{
|
||||
enum {
|
||||
G1_FLAG_BMP = (1 << 0), //No invisible sections
|
||||
G1_FLAG_RLE_COMPRESSION = (1<<2),
|
||||
};
|
||||
|
|
|
@ -31,25 +31,6 @@ rct_gx g2;
|
|||
rct_g1_element *g1Elements = (rct_g1_element*)RCT2_ADDRESS_G1_ELEMENTS;
|
||||
#endif
|
||||
|
||||
static void read_and_convert_gxdat(SDL_RWops *file, size_t count, rct_g1_element *elements)
|
||||
{
|
||||
rct_g1_element_32bit *g1Elements32 = calloc(count, sizeof(rct_g1_element_32bit));
|
||||
SDL_RWread(file, g1Elements32, count * sizeof(rct_g1_element_32bit), 1);
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
/* Double cast to silence compiler warning about casting to
|
||||
* pointer from integer of mismatched length.
|
||||
*/
|
||||
elements[i].offset = (uint8*)(uintptr_t)g1Elements32[i].offset;
|
||||
elements[i].width = g1Elements32[i].width;
|
||||
elements[i].height = g1Elements32[i].height;
|
||||
elements[i].x_offset = g1Elements32[i].x_offset;
|
||||
elements[i].y_offset = g1Elements32[i].y_offset;
|
||||
elements[i].flags = g1Elements32[i].flags;
|
||||
elements[i].zoomed_offset = g1Elements32[i].zoomed_offset;
|
||||
}
|
||||
free(g1Elements32);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00678998
|
||||
|
@ -71,6 +52,20 @@ int gfx_load_g1()
|
|||
* pointers to however long our machine wants them.
|
||||
*/
|
||||
|
||||
#pragma pack(push, 1)
|
||||
// Size: 0x10
|
||||
typedef struct {
|
||||
uint32 offset; // 0x00 note: uint32 always!
|
||||
sint16 width; // 0x04
|
||||
sint16 height; // 0x06
|
||||
sint16 x_offset; // 0x08
|
||||
sint16 y_offset; // 0x0A
|
||||
uint16 flags; // 0x0C
|
||||
uint16 zoomed_offset; // 0x0E
|
||||
} rct_g1_element_32bit;
|
||||
assert_struct_size(rct_g1_element_32bit, 0x10);
|
||||
#pragma pack(pop)
|
||||
|
||||
/* number of elements is stored in g1.dat, but because the entry
|
||||
* headers are static, this can't be variable until made into a
|
||||
* dynamic array.
|
||||
|
@ -82,7 +77,18 @@ int gfx_load_g1()
|
|||
g1Elements = calloc(324206, sizeof(rct_g1_element));
|
||||
#endif
|
||||
|
||||
read_and_convert_gxdat(file, header.num_entries, g1Elements);
|
||||
rct_g1_element_32bit *g1Elements32 = calloc(324206, sizeof(rct_g1_element_32bit));
|
||||
SDL_RWread(file, g1Elements32, header.num_entries * sizeof(rct_g1_element_32bit), 1);
|
||||
for (uint32 i = 0; i < header.num_entries; i++) {
|
||||
g1Elements[i].offset = (uint8*)g1Elements32[i].offset;
|
||||
g1Elements[i].width = g1Elements32[i].width;
|
||||
g1Elements[i].height = g1Elements32[i].height;
|
||||
g1Elements[i].x_offset = g1Elements32[i].x_offset;
|
||||
g1Elements[i].y_offset = g1Elements32[i].y_offset;
|
||||
g1Elements[i].flags = g1Elements32[i].flags;
|
||||
g1Elements[i].zoomed_offset = g1Elements32[i].zoomed_offset;
|
||||
}
|
||||
free(g1Elements32);
|
||||
|
||||
// Read element data
|
||||
_g1Buffer = malloc(header.total_size);
|
||||
|
@ -91,9 +97,8 @@ int gfx_load_g1()
|
|||
SDL_RWclose(file);
|
||||
|
||||
// Fix entry data offsets
|
||||
for (i = 0; i < header.num_entries; i++) {
|
||||
for (i = 0; i < header.num_entries; i++)
|
||||
g1Elements[i].offset += (uintptr_t)_g1Buffer;
|
||||
}
|
||||
|
||||
// Successful
|
||||
return 1;
|
||||
|
@ -136,8 +141,7 @@ int gfx_load_g2()
|
|||
if (SDL_RWread(file, &g2.header, 8, 1) == 1) {
|
||||
// Read element headers
|
||||
g2.elements = malloc(g2.header.num_entries * sizeof(rct_g1_element));
|
||||
|
||||
read_and_convert_gxdat(file, g2.header.num_entries, g2.elements);
|
||||
SDL_RWread(file, g2.elements, g2.header.num_entries * sizeof(rct_g1_element), 1);
|
||||
|
||||
// Read element data
|
||||
g2.data = malloc(g2.header.total_size);
|
||||
|
|
|
@ -783,7 +783,7 @@ bool game_load_save(const utf8 *path)
|
|||
log_verbose("loading saved game, %s", path);
|
||||
|
||||
safe_strcpy((char*)0x0141EF68, path, MAX_PATH);
|
||||
safe_strcpy((char*)gRCT2AddressSavedGamesPath2, path, MAX_PATH);
|
||||
safe_strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, path, MAX_PATH);
|
||||
|
||||
safe_strcpy(gScenarioSavePath, path, MAX_PATH);
|
||||
|
||||
|
|
|
@ -893,7 +893,7 @@ static int cc_load_object(const utf8 **argv, int argc) {
|
|||
if (argc > 0) {
|
||||
utf8 path[MAX_PATH];
|
||||
|
||||
substitute_path(path, gRCT2AddressObjectDataPath, argv[0]);
|
||||
substitute_path(path, RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char), argv[0]);
|
||||
strcat(path, ".DAT\0");
|
||||
|
||||
rct_object_entry entry;
|
||||
|
|
1407
src/object.c
1407
src/object.c
File diff suppressed because it is too large
Load Diff
|
@ -106,7 +106,6 @@ extern uint32 gInstalledObjectsCount;
|
|||
extern rct_object_entry *gInstalledObjects;
|
||||
extern uint32 gNumInstalledRCT2Objects;
|
||||
extern uint32 gNumInstalledCustomObjects;
|
||||
extern uint32 gTotalNoImages;
|
||||
|
||||
extern void *gLastLoadedObjectChunkData;
|
||||
|
||||
|
@ -140,11 +139,10 @@ char *object_get_name(rct_object_entry *entry);
|
|||
|
||||
rct_object_filters *get_object_filter(int index);
|
||||
|
||||
uint8* object_load(int type, void *objectEntry, uint32 entryIndex, int *chunkSize);
|
||||
bool object_load(int type, void *objectEntry, uint32 entryIndex);
|
||||
void object_unload(int type, void *objectEntry);
|
||||
bool object_test(int type, void *objectEntry);
|
||||
void object_paint(int type, void *objectEntry, rct_drawpixelinfo *dpi, sint32 x, sint32 y);
|
||||
rct_string_id object_desc(int type, void *objectEntry);
|
||||
void object_reset(int type, void *objectEntry, uint32 entryIndex);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -230,13 +230,13 @@ void reset_loaded_objects()
|
|||
{
|
||||
reset_type_to_ride_entry_index_map();
|
||||
|
||||
gTotalNoImages = 0xF26E;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_NO_IMAGES, uint32) = 0xF26E;
|
||||
|
||||
for (int type = 0; type < 11; ++type){
|
||||
for (int j = 0; j < object_entry_group_counts[type]; j++){
|
||||
uint8* chunk = object_entry_groups[type].chunks[j];
|
||||
if (chunk != (uint8*)-1)
|
||||
object_reset(type, chunk, j);
|
||||
object_load(type, chunk, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ static int object_list_query_directory(int *outTotalFiles, uint64 *outTotalFileS
|
|||
fileDateModifiedChecksum = 0;
|
||||
|
||||
// Enumerate through each object in the directory
|
||||
enumFileHandle = platform_enumerate_files_begin(gRCT2AddressObjectDataPath);
|
||||
enumFileHandle = platform_enumerate_files_begin(RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char));
|
||||
if (enumFileHandle == INVALID_HANDLE)
|
||||
return 0;
|
||||
|
||||
|
@ -320,7 +320,7 @@ void object_list_load()
|
|||
_installedObjectFilters = NULL;
|
||||
}
|
||||
|
||||
enumFileHandle = platform_enumerate_files_begin(gRCT2AddressObjectDataPath);
|
||||
enumFileHandle = platform_enumerate_files_begin(RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char));
|
||||
if (enumFileHandle != INVALID_HANDLE) {
|
||||
size_t installedObjectsCapacity = 4096;
|
||||
while (platform_enumerate_files_next(enumFileHandle, &enumFileInfo)) {
|
||||
|
@ -337,7 +337,7 @@ void object_list_load()
|
|||
}
|
||||
|
||||
char path[MAX_PATH];
|
||||
substitute_path(path, gRCT2AddressObjectDataPath, enumFileInfo.path);
|
||||
substitute_path(path, RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char), enumFileInfo.path);
|
||||
|
||||
rct_object_entry entry;
|
||||
if (object_load_entry(path, &entry)) {
|
||||
|
@ -786,7 +786,7 @@ static uint32 install_object_entry(rct_object_entry* entry, rct_object_entry* in
|
|||
*((uint16*)(installed_entry_pointer + 9)) = 0;
|
||||
*((uint32*)(installed_entry_pointer + 11)) = 0;
|
||||
|
||||
gTotalNoImages = 0xF26E;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_NO_IMAGES, uint32) = 0xF26E;
|
||||
|
||||
gInstalledObjectsCount++;
|
||||
|
||||
|
@ -839,7 +839,7 @@ static uint32 install_object_entry(rct_object_entry* entry, rct_object_entry* in
|
|||
|
||||
// This is deceptive. Due to setting the total no images earlier to 0xF26E
|
||||
// this is actually the no_images in this entry.
|
||||
*((uint32*)installed_entry_pointer) = gTotalNoImages - 0xF26E;
|
||||
*((uint32*)installed_entry_pointer) = RCT2_GLOBAL(RCT2_ADDRESS_TOTAL_NO_IMAGES, uint32) - 0xF26E;
|
||||
installed_entry_pointer += 4;
|
||||
|
||||
uint8* esi = RCT2_ADDRESS(0x00F42BDB, uint8);
|
||||
|
|
|
@ -166,10 +166,10 @@ static void openrct2_copy_original_user_files_over()
|
|||
utf8 path[MAX_PATH];
|
||||
|
||||
platform_get_user_directory(path, "save");
|
||||
openrct2_copy_files_over((utf8*)gRCT2AddressSavedGamesPath, path, ".sv6");
|
||||
openrct2_copy_files_over((utf8*)RCT2_ADDRESS_SAVED_GAMES_PATH, path, ".sv6");
|
||||
|
||||
platform_get_user_directory(path, "landscape");
|
||||
openrct2_copy_files_over((utf8*)gRCT2AddressLandscapesPath, path, ".sc6");
|
||||
openrct2_copy_files_over((utf8*)RCT2_ADDRESS_LANDSCAPES_PATH, path, ".sc6");
|
||||
}
|
||||
|
||||
bool openrct2_initialise()
|
||||
|
@ -571,7 +571,6 @@ bool openrct2_setup_rct2_segment()
|
|||
}
|
||||
#endif // defined(__unix__)
|
||||
|
||||
#if !defined(NO_RCT2) && !defined(__WINDOWS__)
|
||||
// Check that the expected data is at various addresses.
|
||||
// Start at 0x9a6000, which is start of .data, to skip the region containing addresses to DLL
|
||||
// calls, which can be changed by windows/wine loader.
|
||||
|
@ -584,7 +583,6 @@ bool openrct2_setup_rct2_segment()
|
|||
log_warning("c2 = %u, expected %u, match %d", c2, exp_c2, c2 == exp_c2);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
15
src/rct1.c
15
src/rct1.c
|
@ -78,11 +78,7 @@ bool rct1_read_sv4(const char *path, rct1_s4 *s4)
|
|||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only to be used when loading 32 bit items from files, otherwise use
|
||||
* rideTypeShouldLoseSeparateFlag.
|
||||
*/
|
||||
bool rideTypeShouldLoseSeparateFlagByRideType(uint8 ride_type[3])
|
||||
bool rideTypeShouldLoseSeparateFlag(rct_ride_entry *rideEntry)
|
||||
{
|
||||
if (!gConfigInterface.select_by_track_type) {
|
||||
return false;
|
||||
|
@ -90,21 +86,16 @@ bool rideTypeShouldLoseSeparateFlagByRideType(uint8 ride_type[3])
|
|||
|
||||
bool remove_flag = true;
|
||||
for (int j = 0; j < 3; j++) {
|
||||
if (ride_type_has_flag(ride_type[j], RIDE_TYPE_FLAG_FLAT_RIDE)) {
|
||||
if (ride_type_has_flag(rideEntry->ride_type[j], RIDE_TYPE_FLAG_FLAT_RIDE)) {
|
||||
remove_flag = false;
|
||||
}
|
||||
if (ride_type[j] == RIDE_TYPE_MAZE || ride_type[j] == RIDE_TYPE_MINI_GOLF) {
|
||||
if (rideEntry->ride_type[j] == RIDE_TYPE_MAZE || rideEntry->ride_type[j] == RIDE_TYPE_MINI_GOLF) {
|
||||
remove_flag = false;
|
||||
}
|
||||
}
|
||||
return remove_flag;
|
||||
}
|
||||
|
||||
bool rideTypeShouldLoseSeparateFlag(rct_ride_entry *rideEntry)
|
||||
{
|
||||
return rideTypeShouldLoseSeparateFlagByRideType(rideEntry->ride_type);
|
||||
}
|
||||
|
||||
const uint8 gRideCategories[] = {
|
||||
2, // Spiral Roller coaster
|
||||
2, // Stand Up Coaster
|
||||
|
|
|
@ -746,7 +746,6 @@ void rct1_import_s4(rct1_s4 *s4);
|
|||
void rct1_fix_landscape();
|
||||
int vehicle_preference_compare(uint8 rideType, const char * a, const char * b);
|
||||
bool rideTypeShouldLoseSeparateFlag(rct_ride_entry *rideEntry);
|
||||
bool rideTypeShouldLoseSeparateFlagByRideType(uint8 ride_type[3]);
|
||||
|
||||
bool rct1_load_saved_game(const char *path);
|
||||
bool rct1_load_scenario(const char *path);
|
||||
|
|
60
src/rct2.c
60
src/rct2.c
|
@ -114,13 +114,6 @@ uint8 gSavePromptMode;
|
|||
sint32 gScreenWidth;
|
||||
sint32 gScreenHeight;
|
||||
|
||||
char gRCT2AddressSavedGamesPath[MAX_PATH];
|
||||
char gRCT2AddressSavedGamesPath2[MAX_PATH];
|
||||
char gRCT2AddressScenariosPath[MAX_PATH];
|
||||
char gRCT2AddressLandscapesPath[MAX_PATH];
|
||||
char gRCT2AddressObjectDataPath[MAX_PATH];
|
||||
char gRCT2AddressTracksPath[MAX_PATH];
|
||||
|
||||
typedef struct tm tm_t;
|
||||
|
||||
void print_launch_information();
|
||||
|
@ -220,36 +213,41 @@ int rct2_init_directories()
|
|||
|
||||
char separator[] = {platform_get_path_separator(), 0};
|
||||
|
||||
char gRCT2AddressAppPath[MAX_PATH] = { 0 };
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH, char), gConfigGeneral.game_path);
|
||||
|
||||
strcpy(gRCT2AddressAppPath, gConfigGeneral.game_path);
|
||||
strcat(gRCT2AddressAppPath, separator);
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH_SLASH, char), RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH, char));
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH_SLASH, char), separator);
|
||||
|
||||
strcpy(gRCT2AddressSavedGamesPath, gRCT2AddressAppPath);
|
||||
strcat(gRCT2AddressSavedGamesPath, "Saved Games");
|
||||
strcat(gRCT2AddressSavedGamesPath, separator);
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_SAVED_GAMES_PATH, char), RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH, char));
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_SAVED_GAMES_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_SAVED_GAMES_PATH, char), "Saved Games");
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_SAVED_GAMES_PATH, char), separator);
|
||||
|
||||
strcpy(gRCT2AddressScenariosPath, gRCT2AddressAppPath);
|
||||
strcat(gRCT2AddressScenariosPath, "Scenarios");
|
||||
strcat(gRCT2AddressScenariosPath, separator);
|
||||
strcat(gRCT2AddressScenariosPath, "*.SC6");
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_SCENARIOS_PATH, char), RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH, char));
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_SCENARIOS_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_SCENARIOS_PATH, char), "Scenarios");
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_SCENARIOS_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_SCENARIOS_PATH, char), "*.SC6");
|
||||
|
||||
strcpy(gRCT2AddressLandscapesPath, gRCT2AddressAppPath);
|
||||
strcat(gRCT2AddressLandscapesPath, "Landscapes");
|
||||
strcat(gRCT2AddressLandscapesPath, separator);
|
||||
strcat(gRCT2AddressLandscapesPath, "*.SC6");
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_LANDSCAPES_PATH, char), RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH, char));
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_LANDSCAPES_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_LANDSCAPES_PATH, char), "Landscapes");
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_LANDSCAPES_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_LANDSCAPES_PATH, char), "*.SC6");
|
||||
|
||||
strcpy(gRCT2AddressObjectDataPath, gRCT2AddressAppPath);
|
||||
strcat(gRCT2AddressObjectDataPath, "ObjData");
|
||||
strcat(gRCT2AddressObjectDataPath, separator);
|
||||
strcat(gRCT2AddressObjectDataPath, "*.DAT");
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char), RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH, char));
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char), "ObjData");
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_OBJECT_DATA_PATH, char), "*.DAT");
|
||||
|
||||
strcpy(gRCT2AddressTracksPath, gRCT2AddressAppPath);
|
||||
strcat(gRCT2AddressTracksPath, "Tracks");
|
||||
strcat(gRCT2AddressTracksPath, separator);
|
||||
strcat(gRCT2AddressTracksPath, "*.TD?");
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), RCT2_ADDRESS(RCT2_ADDRESS_APP_PATH, char));
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), "Tracks");
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), separator);
|
||||
strcat(RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), "*.TD?");
|
||||
|
||||
strcpy(gRCT2AddressSavedGamesPath2, gRCT2AddressSavedGamesPath);
|
||||
strcpy(RCT2_ADDRESS(RCT2_ADDRESS_SAVED_GAMES_PATH_2, char), RCT2_ADDRESS(RCT2_ADDRESS_SAVED_GAMES_PATH, char));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -353,7 +351,7 @@ bool rct2_open_file(const char *path)
|
|||
extension++;
|
||||
|
||||
if (_stricmp(extension, "sv6") == 0) {
|
||||
strcpy((char*)gRCT2AddressSavedGamesPath2, path);
|
||||
strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, path);
|
||||
game_load_save(path);
|
||||
gFirstTimeSave = 0;
|
||||
return true;
|
||||
|
|
|
@ -279,13 +279,6 @@ extern uint8 gSavePromptMode;
|
|||
extern sint32 gScreenWidth;
|
||||
extern sint32 gScreenHeight;
|
||||
|
||||
extern char gRCT2AddressSavedGamesPath[];
|
||||
extern char gRCT2AddressSavedGamesPath2[];
|
||||
extern char gRCT2AddressScenariosPath[];
|
||||
extern char gRCT2AddressLandscapesPath[];
|
||||
extern char gRCT2AddressObjectDataPath[];
|
||||
extern char gRCT2AddressTracksPath[];
|
||||
|
||||
int rct2_init();
|
||||
void rct2_dispose();
|
||||
void rct2_update();
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "../management/news_item.h"
|
||||
#include "../network/network.h"
|
||||
#include "../object_list.h"
|
||||
#include "../openrct2.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct1.h"
|
||||
|
@ -252,12 +251,14 @@ rct_ride_entry *get_ride_entry_by_ride(rct_ride *ride)
|
|||
* rct2: 0x006DED68
|
||||
*/
|
||||
void reset_type_to_ride_entry_index_map(){
|
||||
memset(gTypeToRideEntryIndexMap, 0xFF, 91);
|
||||
uint8* typeToRideEntryIndexMap = RCT2_ADDRESS(0x009E32F8, uint8);
|
||||
memset(typeToRideEntryIndexMap, 0xFF, 91);
|
||||
}
|
||||
|
||||
uint8 *get_ride_entry_indices_for_ride_type(uint8 rideType)
|
||||
{
|
||||
uint8 *entryIndexList = gTypeToRideEntryIndexMap;
|
||||
uint8 *typeToRideEntryIndexMap = (uint8*)0x009E32F8;
|
||||
uint8 *entryIndexList = typeToRideEntryIndexMap;
|
||||
while (rideType > 0) {
|
||||
do {
|
||||
entryIndexList++;
|
||||
|
@ -6923,10 +6924,8 @@ void set_vehicle_type_image_max_sizes(rct_ride_entry_vehicle* vehicle_type, int
|
|||
.zoom_level = 0
|
||||
};
|
||||
|
||||
if (!gOpenRCT2Headless) {
|
||||
for (int i = 0; i < num_images; ++i){
|
||||
gfx_draw_sprite_software(&dpi, vehicle_type->base_image_id + i, 0, 0, 0);
|
||||
}
|
||||
for (int i = 0; i < num_images; ++i){
|
||||
gfx_draw_sprite_software(&dpi, vehicle_type->base_image_id + i, 0, 0, 0);
|
||||
}
|
||||
int al = -1;
|
||||
for (int i = 99; i != 0; --i){
|
||||
|
|
|
@ -122,7 +122,9 @@ typedef struct rct_ride_entry {
|
|||
uint8 shop_item; // 0x1C0
|
||||
uint8 shop_item_secondary; // 0x1C1
|
||||
} rct_ride_entry;
|
||||
// FIXME: unpack
|
||||
#ifdef PLATFORM_32BIT
|
||||
assert_struct_size(rct_ride_entry, 0x1c2);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Ride structure.
|
||||
|
|
|
@ -77,7 +77,9 @@ typedef struct rct_ride_entry_vehicle {
|
|||
uint8 special_frames; // 0x60 , 0x7A
|
||||
sint8* peep_loading_positions; // 0x61 , 0x7B
|
||||
} rct_ride_entry_vehicle;
|
||||
// FIXME: unpack
|
||||
#ifdef PLATFORM_32BIT
|
||||
assert_struct_size(rct_ride_entry_vehicle, 0x65);
|
||||
#endif
|
||||
|
||||
typedef struct rct_vehicle {
|
||||
uint8 sprite_identifier; // 0x00
|
||||
|
|
|
@ -66,21 +66,6 @@ char gScenarioSavePath[MAX_PATH];
|
|||
int gFirstTimeSave = 1;
|
||||
uint32 gLastAutoSaveTick = 0;
|
||||
|
||||
#if defined(NO_RCT2)
|
||||
uint32 gScenarioTicks;
|
||||
#endif
|
||||
uint32 gScenarioSrand0;
|
||||
uint32 gScenarioSrand1;
|
||||
|
||||
uint8 gScenarioObjectiveType;
|
||||
uint8 gScenarioObjectiveYear;
|
||||
uint16 gScenarioObjectiveNumGuests;
|
||||
money32 gScenarioObjectiveCurrency;
|
||||
|
||||
uint16 gScenarioParkRatingWarningDays;
|
||||
money32 gScenarioCompletedCompanyValue;
|
||||
money32 gScenarioCompanyValueRecord;
|
||||
|
||||
static int scenario_create_ducks();
|
||||
static void scenario_objective_check();
|
||||
|
||||
|
@ -244,9 +229,9 @@ void scenario_begin()
|
|||
strncat(gScenarioSavePath, parkName, sizeof(gScenarioSavePath) - strlen(gScenarioSavePath) - 1);
|
||||
strncat(gScenarioSavePath, ".sv6", sizeof(gScenarioSavePath) - strlen(gScenarioSavePath) - 1);
|
||||
|
||||
strcpy(gRCT2AddressSavedGamesPath2, gRCT2AddressSavedGamesPath);
|
||||
strcpy(gRCT2AddressSavedGamesPath2 + strlen(gRCT2AddressSavedGamesPath2), gScenarioSavePath);
|
||||
strcat(gRCT2AddressSavedGamesPath2, ".SV6");
|
||||
strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, (char*)RCT2_ADDRESS_SAVED_GAMES_PATH);
|
||||
strcpy((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2 + strlen((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2), gScenarioSavePath);
|
||||
strcat((char*)RCT2_ADDRESS_SAVED_GAMES_PATH_2, ".SV6");
|
||||
|
||||
memset((void*)0x001357848, 0, 56);
|
||||
gCurrentExpenditure = 0;
|
||||
|
@ -299,7 +284,7 @@ void scenario_end()
|
|||
|
||||
void scenario_set_filename(const char *value)
|
||||
{
|
||||
substitute_path(_scenarioPath, gRCT2AddressScenariosPath, value);
|
||||
substitute_path(_scenarioPath, RCT2_ADDRESS(RCT2_ADDRESS_SCENARIOS_PATH, char), value);
|
||||
_scenarioFileName = path_get_filename(_scenarioPath);
|
||||
}
|
||||
|
||||
|
|
|
@ -427,22 +427,18 @@ typedef struct source_desc {
|
|||
|
||||
extern const rct_string_id ScenarioCategoryStringIds[SCENARIO_CATEGORY_COUNT];
|
||||
|
||||
#if defined(NO_RCT2)
|
||||
extern uint32 gScenarioTicks;
|
||||
#else
|
||||
#define gScenarioTicks RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TICKS, uint32)
|
||||
#endif
|
||||
extern uint32 gScenarioSrand0;
|
||||
extern uint32 gScenarioSrand1;
|
||||
#define gScenarioSrand0 RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_SRAND_0, uint32)
|
||||
#define gScenarioSrand1 RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_SRAND_1, uint32)
|
||||
|
||||
extern uint8 gScenarioObjectiveType;
|
||||
extern uint8 gScenarioObjectiveYear;
|
||||
extern uint16 gScenarioObjectiveNumGuests;
|
||||
extern money32 gScenarioObjectiveCurrency;
|
||||
#define gScenarioObjectiveType RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_TYPE, uint8)
|
||||
#define gScenarioObjectiveYear RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_YEAR, uint8)
|
||||
#define gScenarioObjectiveNumGuests RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_NUM_GUESTS, uint16)
|
||||
#define gScenarioObjectiveCurrency RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_CURRENCY, money32)
|
||||
|
||||
extern uint16 gScenarioParkRatingWarningDays;
|
||||
extern money32 gScenarioCompletedCompanyValue;
|
||||
extern money32 gScenarioCompanyValueRecord;
|
||||
#define gScenarioParkRatingWarningDays RCT2_GLOBAL(RCT2_ADDRESS_PARK_RATING_WARNING_DAYS, uint16)
|
||||
#define gScenarioCompletedCompanyValue RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, money32)
|
||||
#define gScenarioCompanyValueRecord RCT2_GLOBAL(RCT2_ADDRESS_COMPANY_VALUE_RECORD, money32)
|
||||
|
||||
// Scenario list
|
||||
extern int gScenarioListCount;
|
||||
|
|
|
@ -237,7 +237,7 @@ rct_window *window_loadsave_open(int type, char *defaultName)
|
|||
}
|
||||
*/
|
||||
|
||||
safe_strcpy(path, gRCT2AddressTracksPath, MAX_PATH);
|
||||
safe_strcpy(path, RCT2_ADDRESS(RCT2_ADDRESS_TRACKS_PATH, char), MAX_PATH);
|
||||
ch = strchr(path, '*');
|
||||
if (ch != NULL)
|
||||
*ch = 0;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "../object.h"
|
||||
#include "../world/map.h"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct rct_small_scenery_entry {
|
||||
uint32 flags; // 0x06
|
||||
uint8 height; // 0x0A
|
||||
|
@ -33,6 +34,7 @@ typedef struct rct_small_scenery_entry {
|
|||
uint16 var_18;
|
||||
uint8 scenery_tab_id; // 0x1A
|
||||
} rct_small_scenery_entry;
|
||||
assert_struct_size(rct_small_scenery_entry, 21);
|
||||
|
||||
typedef enum {
|
||||
SMALL_SCENERY_FLAG_FULL_TILE = (1 << 0), // 0x1
|
||||
|
@ -65,7 +67,6 @@ typedef enum {
|
|||
SMALL_SCENERY_FLAG27 = (1 << 27), // 0x8000000
|
||||
} SMALL_SCENERY_FLAGS;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct rct_large_scenery_tile {
|
||||
sint16 x_offset;
|
||||
sint16 y_offset;
|
||||
|
@ -103,7 +104,9 @@ typedef struct rct_large_scenery_entry {
|
|||
rct_large_scenery_text* text; // 0x12
|
||||
uint32 text_image; // 0x16
|
||||
} rct_large_scenery_entry;
|
||||
// FIXME: unpack
|
||||
#ifdef PLATFORM_32BIT
|
||||
assert_struct_size(rct_large_scenery_entry, 20);
|
||||
#endif
|
||||
|
||||
typedef struct rct_wall_scenery_entry {
|
||||
uint8 tool_id; // 0x06
|
||||
|
@ -159,7 +162,9 @@ typedef struct rct_scenery_entry {
|
|||
rct_banner_scenery_entry banner;
|
||||
};
|
||||
} rct_scenery_entry;
|
||||
// FIXME: unpack?
|
||||
#ifdef PLATFORM_32BIT
|
||||
assert_struct_size(rct_scenery_entry, 6 + 21);
|
||||
#endif
|
||||
|
||||
typedef struct rct_scenery_set_entry {
|
||||
rct_string_id name; // 0x00
|
||||
|
|
Loading…
Reference in New Issue