mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #6065 from IntelOrca/refactor/remove-rct2.c
Move remaining functions out rct2.c
This commit is contained in:
commit
6699d0885b
|
@ -227,7 +227,6 @@
|
|||
F76C86C11EC4E88400FA49E2 /* interop.c in Sources */ = {isa = PBXBuildFile; fileRef = F76C847B1EC4E7CC00FA49E2 /* interop.c */; };
|
||||
F76C86C31EC4E88400FA49E2 /* S6Exporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C847D1EC4E7CC00FA49E2 /* S6Exporter.cpp */; };
|
||||
F76C86C51EC4E88400FA49E2 /* S6Importer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F76C847F1EC4E7CC00FA49E2 /* S6Importer.cpp */; };
|
||||
F76C86C61EC4E88400FA49E2 /* rct2.c in Sources */ = {isa = PBXBuildFile; fileRef = F76C84801EC4E7CC00FA49E2 /* rct2.c */; };
|
||||
F76C86C81EC4E88400FA49E2 /* cable_lift.c in Sources */ = {isa = PBXBuildFile; fileRef = F76C84841EC4E7CC00FA49E2 /* cable_lift.c */; };
|
||||
F76C86CA1EC4E88400FA49E2 /* air_powered_vertical_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = F76C84871EC4E7CC00FA49E2 /* air_powered_vertical_coaster.c */; };
|
||||
F76C86CB1EC4E88400FA49E2 /* bobsleigh_coaster.c in Sources */ = {isa = PBXBuildFile; fileRef = F76C84881EC4E7CC00FA49E2 /* bobsleigh_coaster.c */; };
|
||||
|
@ -1069,7 +1068,6 @@
|
|||
F76C847D1EC4E7CC00FA49E2 /* S6Exporter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = S6Exporter.cpp; sourceTree = "<group>"; };
|
||||
F76C847E1EC4E7CC00FA49E2 /* S6Exporter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S6Exporter.h; sourceTree = "<group>"; };
|
||||
F76C847F1EC4E7CC00FA49E2 /* S6Importer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = S6Importer.cpp; sourceTree = "<group>"; };
|
||||
F76C84801EC4E7CC00FA49E2 /* rct2.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = rct2.c; sourceTree = "<group>"; };
|
||||
F76C84811EC4E7CC00FA49E2 /* rct2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = rct2.h; sourceTree = "<group>"; };
|
||||
F76C84841EC4E7CC00FA49E2 /* cable_lift.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = cable_lift.c; sourceTree = "<group>"; };
|
||||
F76C84851EC4E7CC00FA49E2 /* cable_lift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cable_lift.h; sourceTree = "<group>"; };
|
||||
|
@ -1362,7 +1360,6 @@
|
|||
F7D7747E1EC61E5100BE6EBC /* UiContext.macOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UiContext.macOS.mm; sourceTree = "<group>"; usesTabs = 0; };
|
||||
F7D774841EC66CD700BE6EBC /* OpenRCT2-cli */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "OpenRCT2-cli"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F7FFCDA91F02FD8E0078BFFB /* object_load_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = object_load_error.c; sourceTree = "<group>"; };
|
||||
F7FFCDAB1F02FEC00078BFFB /* park_load_result_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = park_load_result_types.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -1785,7 +1782,6 @@
|
|||
F76C84371EC4E7CC00FA49E2 /* object_list.h */,
|
||||
F76C84381EC4E7CC00FA49E2 /* OpenRCT2.cpp */,
|
||||
F76C84391EC4E7CC00FA49E2 /* OpenRCT2.h */,
|
||||
F7FFCDAB1F02FEC00078BFFB /* park_load_result_types.h */,
|
||||
F76C84511EC4E7CC00FA49E2 /* ParkImporter.cpp */,
|
||||
F76C84521EC4E7CC00FA49E2 /* ParkImporter.h */,
|
||||
F76C84641EC4E7CC00FA49E2 /* PlatformEnvironment.cpp */,
|
||||
|
@ -1793,7 +1789,6 @@
|
|||
F76C846A1EC4E7CC00FA49E2 /* rct1.c */,
|
||||
F76C846B1EC4E7CC00FA49E2 /* rct1.h */,
|
||||
F76C84751EC4E7CC00FA49E2 /* rct12.h */,
|
||||
F76C84801EC4E7CC00FA49E2 /* rct2.c */,
|
||||
F76C84811EC4E7CC00FA49E2 /* rct2.h */,
|
||||
F76C84FA1EC4E7CD00FA49E2 /* sprites.h */,
|
||||
F76C850B1EC4E7CD00FA49E2 /* Version.cpp */,
|
||||
|
@ -3186,7 +3181,6 @@
|
|||
F76C86C11EC4E88400FA49E2 /* interop.c in Sources */,
|
||||
F76C86C31EC4E88400FA49E2 /* S6Exporter.cpp in Sources */,
|
||||
F76C86C51EC4E88400FA49E2 /* S6Importer.cpp in Sources */,
|
||||
F76C86C61EC4E88400FA49E2 /* rct2.c in Sources */,
|
||||
F76C86C81EC4E88400FA49E2 /* cable_lift.c in Sources */,
|
||||
F76C86CA1EC4E88400FA49E2 /* air_powered_vertical_coaster.c in Sources */,
|
||||
F76C86CB1EC4E88400FA49E2 /* bobsleigh_coaster.c in Sources */,
|
||||
|
|
|
@ -283,7 +283,7 @@ public:
|
|||
{
|
||||
switch (e.type) {
|
||||
case SDL_QUIT:
|
||||
rct2_quit();
|
||||
context_quit();
|
||||
break;
|
||||
case SDL_WINDOWEVENT:
|
||||
// HACK: Fix #2158, OpenRCT2 does not draw if it does not think that the window is
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include <SDL.h>
|
||||
#include <speex/speex_resampler.h>
|
||||
#include <list>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/core/Guard.hpp>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
#include <openrct2/core/Memory.hpp>
|
||||
|
@ -35,7 +36,6 @@ extern "C"
|
|||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/platform/platform.h>
|
||||
#include <openrct2/rct2.h>
|
||||
}
|
||||
|
||||
namespace OpenRCT2 { namespace Audio
|
||||
|
@ -207,7 +207,7 @@ namespace OpenRCT2 { namespace Audio
|
|||
IAudioSource * source = _musicSources[pathId];
|
||||
if (source == nullptr)
|
||||
{
|
||||
const utf8 * path = get_file_path((sint32)pathId);
|
||||
const utf8 * path = context_get_path_legacy((sint32)pathId);
|
||||
source = AudioSource::CreateMemoryFromWAV(path, &_format);
|
||||
if (source == nullptr)
|
||||
{
|
||||
|
@ -238,7 +238,7 @@ namespace OpenRCT2 { namespace Audio
|
|||
private:
|
||||
void LoadAllSounds()
|
||||
{
|
||||
const utf8 * css1Path = get_file_path(PATH_ID_CSS1);
|
||||
const utf8 * css1Path = context_get_path_legacy(PATH_ID_CSS1);
|
||||
for (size_t i = 0; i < Util::CountOf(_css1Sources); i++)
|
||||
{
|
||||
auto source = AudioSource::CreateMemoryFromCSS1(css1Path, i, &_format);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <openrct2/interface/Screenshot.h>
|
||||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2/network/network.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/platform/platform.h>
|
||||
#include <openrct2/ride/track.h>
|
||||
#include <openrct2/ride/track_paint.h>
|
||||
|
|
|
@ -63,7 +63,6 @@ extern "C"
|
|||
#include "object_list.h"
|
||||
#include "platform/platform.h"
|
||||
#include "rct1.h"
|
||||
#include "rct2.h"
|
||||
#include "rct2/interop.h"
|
||||
#include "util/util.h"
|
||||
}
|
||||
|
@ -167,6 +166,87 @@ namespace OpenRCT2
|
|||
_finished = true;
|
||||
}
|
||||
|
||||
void Quit() override
|
||||
{
|
||||
gSavePromptMode = PM_QUIT;
|
||||
window_save_prompt_open();
|
||||
}
|
||||
|
||||
std::string GetPathLegacy(sint32 pathId) override
|
||||
{
|
||||
static const char * const LegacyFileNames[PATH_ID_END] =
|
||||
{
|
||||
nullptr,
|
||||
nullptr,
|
||||
"css1.dat",
|
||||
"css2.dat",
|
||||
"css4.dat",
|
||||
"css5.dat",
|
||||
"css6.dat",
|
||||
"css7.dat",
|
||||
"css8.dat",
|
||||
"css9.dat",
|
||||
"css11.dat",
|
||||
"css12.dat",
|
||||
"css13.dat",
|
||||
"css14.dat",
|
||||
"css15.dat",
|
||||
"css3.dat",
|
||||
"css17.dat",
|
||||
"css18.dat",
|
||||
"css19.dat",
|
||||
"css20.dat",
|
||||
"css21.dat",
|
||||
"css22.dat",
|
||||
nullptr,
|
||||
"css23.dat",
|
||||
"css24.dat",
|
||||
"css25.dat",
|
||||
"css26.dat",
|
||||
"css27.dat",
|
||||
"css28.dat",
|
||||
"css29.dat",
|
||||
"css30.dat",
|
||||
"css31.dat",
|
||||
"css32.dat",
|
||||
"css33.dat",
|
||||
"css34.dat",
|
||||
"css35.dat",
|
||||
"css36.dat",
|
||||
"css37.dat",
|
||||
"css38.dat",
|
||||
"CUSTOM1.WAV",
|
||||
"CUSTOM2.WAV",
|
||||
"css39.dat",
|
||||
"css40.dat",
|
||||
"css41.dat",
|
||||
nullptr,
|
||||
"css42.dat",
|
||||
"css43.dat",
|
||||
"css44.dat",
|
||||
"css45.dat",
|
||||
"css46.dat",
|
||||
"css50.dat"
|
||||
};
|
||||
|
||||
std::string result;
|
||||
if (pathId == PATH_ID_CSS50)
|
||||
{
|
||||
auto dataPath = _env->GetDirectoryPath(DIRBASE::RCT1, DIRID::DATA);
|
||||
result = Path::Combine(dataPath, "css17.dat");
|
||||
}
|
||||
else if (pathId >= 0 && pathId < PATH_ID_END)
|
||||
{
|
||||
auto fileName = LegacyFileNames[pathId];
|
||||
if (fileName != nullptr)
|
||||
{
|
||||
auto dataPath = _env->GetDirectoryPath(DIRBASE::RCT2, DIRID::DATA);
|
||||
result = Path::Combine(dataPath, fileName);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Initialise() final override
|
||||
{
|
||||
if (_initialised)
|
||||
|
@ -212,11 +292,12 @@ namespace OpenRCT2
|
|||
}
|
||||
}
|
||||
|
||||
if (!rct2_init_directories())
|
||||
auto rct2InstallPath = GetOrPromptRCT2Path();
|
||||
if (rct2InstallPath.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_env->SetBasePath(DIRBASE::RCT2, gRCT2AddressAppPath);
|
||||
_env->SetBasePath(DIRBASE::RCT2, rct2InstallPath);
|
||||
|
||||
if (!gOpenRCT2Headless)
|
||||
{
|
||||
|
@ -296,6 +377,32 @@ namespace OpenRCT2
|
|||
}
|
||||
|
||||
private:
|
||||
std::string GetOrPromptRCT2Path()
|
||||
{
|
||||
auto result = std::string();
|
||||
if (String::IsNullOrEmpty(gCustomRCT2DataPath))
|
||||
{
|
||||
// Check install directory
|
||||
if (gConfigGeneral.rct2_path == nullptr || !platform_original_game_data_exists(gConfigGeneral.rct2_path))
|
||||
{
|
||||
log_verbose("install directory does not exist or invalid directory selected, %s", gConfigGeneral.rct2_path);
|
||||
if (!config_find_or_browse_install_directory())
|
||||
{
|
||||
utf8 path[MAX_PATH];
|
||||
config_get_default_path(path, sizeof(path));
|
||||
Console::Error::WriteLine("An RCT2 install directory must be specified! Please edit \"game_path\" in %s.\n", path);
|
||||
return std::string();
|
||||
}
|
||||
}
|
||||
result = std::string(gConfigGeneral.rct2_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = std::string(gCustomRCT2DataPath);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool LoadBaseGraphics()
|
||||
{
|
||||
if (!gfx_load_g1(_env))
|
||||
|
@ -856,6 +963,19 @@ extern "C"
|
|||
return GetContext()->GetUiContext()->ReadBMP(outPixels, outWidth, outHeight, std::string(path));
|
||||
}
|
||||
|
||||
void context_quit()
|
||||
{
|
||||
GetContext()->Quit();
|
||||
}
|
||||
|
||||
const utf8 * context_get_path_legacy(sint32 pathId)
|
||||
{
|
||||
static utf8 result[MAX_PATH];
|
||||
auto path = GetContext()->GetPathLegacy(pathId);
|
||||
String::Set(result, sizeof(result), path.c_str());
|
||||
return result;
|
||||
}
|
||||
|
||||
bool platform_open_common_file_dialog(utf8 * outFilename, file_dialog_desc * desc, size_t outSize)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -98,6 +98,12 @@ namespace OpenRCT2
|
|||
virtual bool Initialise() abstract;
|
||||
virtual void Open(const std::string &path) abstract;
|
||||
virtual void Finish() abstract;
|
||||
virtual void Quit() abstract;
|
||||
|
||||
/**
|
||||
* This is deprecated, use IPlatformEnvironment.
|
||||
*/
|
||||
virtual std::string GetPathLegacy(sint32 pathId) abstract;
|
||||
};
|
||||
|
||||
IContext * CreateContext();
|
||||
|
@ -119,6 +125,65 @@ enum
|
|||
GAME_UPDATE_MAX_THRESHOLD = GAME_UPDATE_TIME_MS * GAME_MAX_UPDATES,
|
||||
};
|
||||
|
||||
/**
|
||||
* Legacy get_file_path IDs.
|
||||
* Remove when context_get_path_legacy is removed.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
PATH_ID_G1,
|
||||
PATH_ID_PLUGIN,
|
||||
PATH_ID_CSS1,
|
||||
PATH_ID_CSS2,
|
||||
PATH_ID_CSS4,
|
||||
PATH_ID_CSS5,
|
||||
PATH_ID_CSS6,
|
||||
PATH_ID_CSS7,
|
||||
PATH_ID_CSS8,
|
||||
PATH_ID_CSS9,
|
||||
PATH_ID_CSS11,
|
||||
PATH_ID_CSS12,
|
||||
PATH_ID_CSS13,
|
||||
PATH_ID_CSS14,
|
||||
PATH_ID_CSS15,
|
||||
PATH_ID_CSS3,
|
||||
PATH_ID_CSS17,
|
||||
PATH_ID_CSS18,
|
||||
PATH_ID_CSS19,
|
||||
PATH_ID_CSS20,
|
||||
PATH_ID_CSS21,
|
||||
PATH_ID_CSS22,
|
||||
PATH_ID_SCORES,
|
||||
PATH_ID_CSS23,
|
||||
PATH_ID_CSS24,
|
||||
PATH_ID_CSS25,
|
||||
PATH_ID_CSS26,
|
||||
PATH_ID_CSS27,
|
||||
PATH_ID_CSS28,
|
||||
PATH_ID_CSS29,
|
||||
PATH_ID_CSS30,
|
||||
PATH_ID_CSS31,
|
||||
PATH_ID_CSS32,
|
||||
PATH_ID_CSS33,
|
||||
PATH_ID_CSS34,
|
||||
PATH_ID_CSS35,
|
||||
PATH_ID_CSS36,
|
||||
PATH_ID_CSS37,
|
||||
PATH_ID_CSS38,
|
||||
PATH_ID_CUSTOM1,
|
||||
PATH_ID_CUSTOM2,
|
||||
PATH_ID_CSS39,
|
||||
PATH_ID_CSS40,
|
||||
PATH_ID_CSS41,
|
||||
PATH_ID_SIXFLAGS_MAGICMOUNTAIN,
|
||||
PATH_ID_CSS42,
|
||||
PATH_ID_CSS43,
|
||||
PATH_ID_CSS44,
|
||||
PATH_ID_CSS45,
|
||||
PATH_ID_CSS46,
|
||||
PATH_ID_CSS50,
|
||||
PATH_ID_END,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
|
@ -147,6 +212,8 @@ extern "C"
|
|||
rct_window * context_open_window(rct_windowclass wc);
|
||||
void context_input_handle_keyboard(bool isTitle);
|
||||
bool context_read_bmp(void * * outPixels, uint32 * outWidth, uint32 * outHeight, const utf8 * path);
|
||||
void context_quit();
|
||||
const utf8 * context_get_path_legacy(sint32 pathId);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#pragma endregion
|
||||
|
||||
#include "core/FileStream.hpp"
|
||||
#include "core/Path.hpp"
|
||||
#include "FileClassifier.h"
|
||||
#include "rct12/SawyerChunkReader.h"
|
||||
|
||||
|
@ -151,3 +152,19 @@ static bool TryClassifyAsTD4_TD6(IStream * stream, ClassifiedFile * result)
|
|||
|
||||
return success;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
uint32 get_file_extension_type(const utf8 * path)
|
||||
{
|
||||
auto extension = Path::GetExtension(path);
|
||||
if (String::Equals(extension, ".dat", true)) return FILE_EXTENSION_DAT;
|
||||
if (String::Equals(extension, ".sc4", true)) return FILE_EXTENSION_SC4;
|
||||
if (String::Equals(extension, ".sv4", true)) return FILE_EXTENSION_SV4;
|
||||
if (String::Equals(extension, ".td4", true)) return FILE_EXTENSION_TD4;
|
||||
if (String::Equals(extension, ".sc6", true)) return FILE_EXTENSION_SC6;
|
||||
if (String::Equals(extension, ".sv6", true)) return FILE_EXTENSION_SV6;
|
||||
if (String::Equals(extension, ".td6", true)) return FILE_EXTENSION_TD6;
|
||||
return FILE_EXTENSION_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,24 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "common.h"
|
||||
|
||||
enum
|
||||
{
|
||||
FILE_EXTENSION_UNKNOWN,
|
||||
FILE_EXTENSION_DAT,
|
||||
FILE_EXTENSION_SC4,
|
||||
FILE_EXTENSION_SV4,
|
||||
FILE_EXTENSION_TD4,
|
||||
FILE_EXTENSION_SC6,
|
||||
FILE_EXTENSION_SV6,
|
||||
FILE_EXTENSION_TD6,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <string>
|
||||
|
||||
interface IStream;
|
||||
|
||||
enum class FILE_TYPE
|
||||
|
@ -38,3 +53,15 @@ struct ClassifiedFile
|
|||
|
||||
bool TryClassifyFile(const std::string &path, ClassifiedFile * result);
|
||||
bool TryClassifyFile(IStream * stream, ClassifiedFile * result);
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
uint32 get_file_extension_type(const utf8 * path);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@ extern "C"
|
|||
{
|
||||
#include "audio/audio.h"
|
||||
#include "platform/platform.h"
|
||||
#include "rct2.h"
|
||||
}
|
||||
|
||||
extern "C"
|
||||
|
@ -47,4 +46,9 @@ extern "C"
|
|||
// OpenSSL's message digest context used for calculating sprite checksums
|
||||
EVP_MD_CTX * gHashCTX = nullptr;
|
||||
#endif // DISABLE_NETWORK
|
||||
|
||||
uint32 gCurrentDrawCount = 0;
|
||||
uint8 gScreenFlags;
|
||||
uint32 gScreenAge;
|
||||
uint8 gSavePromptMode;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,18 @@ enum STARTUP_ACTION
|
|||
STARTUP_ACTION_EDIT
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
// Although this is labeled a flag it actually means when
|
||||
// zero the screen is in playing mode.
|
||||
SCREEN_FLAGS_PLAYING = 0,
|
||||
SCREEN_FLAGS_TITLE_DEMO = 1,
|
||||
SCREEN_FLAGS_SCENARIO_EDITOR = 2,
|
||||
SCREEN_FLAGS_TRACK_DESIGNER = 4,
|
||||
SCREEN_FLAGS_TRACK_MANAGER = 8,
|
||||
SCREEN_FLAGS_EDITOR = (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER),
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
|
@ -67,6 +79,11 @@ extern "C"
|
|||
extern char* gNetworkStartAddress;
|
||||
#endif
|
||||
|
||||
extern uint32 gCurrentDrawCount;
|
||||
extern uint8 gScreenFlags;
|
||||
extern uint32 gScreenAge;
|
||||
extern uint8 gSavePromptMode;
|
||||
|
||||
void openrct2_write_full_version_info(utf8 * buffer, size_t bufferSize);
|
||||
void openrct2_finish();
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
extern "C"
|
||||
{
|
||||
#include "platform/platform.h"
|
||||
#include "rct2.h"
|
||||
}
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
|
|
@ -23,11 +23,6 @@
|
|||
#include "AudioMixer.h"
|
||||
#include "AudioSource.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "../rct2.h"
|
||||
}
|
||||
|
||||
using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::Audio;
|
||||
|
||||
|
@ -143,7 +138,7 @@ void * Mixer_Play_Music(sint32 pathId, sint32 loop, sint32 streaming)
|
|||
{
|
||||
if (streaming)
|
||||
{
|
||||
const utf8 * path = get_file_path(pathId);
|
||||
const utf8 * path = context_get_path_legacy(pathId);
|
||||
|
||||
IAudioContext * audioContext = GetContext()->GetAudioContext();
|
||||
IAudioSource * source = audioContext->CreateStreamFromWAV(path);
|
||||
|
|
|
@ -359,7 +359,7 @@ void audio_init_ride_sounds_and_info()
|
|||
for (size_t m = 0; m < Util::CountOf(gRideMusicInfoList); m++)
|
||||
{
|
||||
rct_ride_music_info *rideMusicInfo = gRideMusicInfoList[m];
|
||||
const utf8 *path = get_file_path(rideMusicInfo->path_id);
|
||||
const utf8 * path = context_get_path_legacy(rideMusicInfo->path_id);
|
||||
if (File::Exists(path))
|
||||
{
|
||||
try
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "../core/Exception.hpp"
|
||||
#include "../core/Guard.hpp"
|
||||
#include "../core/Path.hpp"
|
||||
#include "../FileClassifier.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../rct2/S6Exporter.h"
|
||||
#include "CommandLine.hpp"
|
||||
|
@ -29,7 +30,6 @@ extern "C"
|
|||
#include "../game.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct2.h"
|
||||
}
|
||||
|
||||
static void WriteConvertFromAndToMessage(uint32 sourceFileType, uint32 destinationFileType);
|
||||
|
|
|
@ -31,7 +31,6 @@ extern "C"
|
|||
#include "../drawing/drawing.h"
|
||||
#include "../localisation/string_ids.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
}
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
|
|
@ -21,7 +21,6 @@ extern "C"
|
|||
{
|
||||
#endif
|
||||
|
||||
#include "../rct2.h"
|
||||
#include "drawing.h"
|
||||
|
||||
extern rct_string_id DrawingEngineStringIds[3];
|
||||
|
|
|
@ -33,7 +33,6 @@ extern "C"
|
|||
#include "../interface/window.h"
|
||||
#include "../intro.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "drawing.h"
|
||||
#include "lightfx.h"
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "../object.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../world/water.h"
|
||||
#include "drawing.h"
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include "../common.h"
|
||||
#include "../game.h"
|
||||
#include "../rct2.h"
|
||||
#include "../interface/viewport.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../paint/map_element/map_element.h"
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#include FT_FREETYPE_H
|
||||
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "ttf.h"
|
||||
|
||||
static bool _ttfInitialised = false;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "audio/audio.h"
|
||||
#include "drawing/drawing.h"
|
||||
#include "editor.h"
|
||||
#include "FileClassifier.h"
|
||||
#include "game.h"
|
||||
#include "interface/viewport.h"
|
||||
#include "interface/window.h"
|
||||
|
@ -27,6 +28,7 @@
|
|||
#include "network/network.h"
|
||||
#include "object.h"
|
||||
#include "object/ObjectManager.h"
|
||||
#include "OpenRCT2.h"
|
||||
#include "peep/staff.h"
|
||||
#include "platform/platform.h"
|
||||
#include "rct1.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#define _EDITOR_H_
|
||||
|
||||
#include "object.h"
|
||||
#include "rct2.h"
|
||||
|
||||
typedef enum {
|
||||
EDITOR_STEP_OBJECT_SELECTION, // 0
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "config/Config.h"
|
||||
#include "Context.h"
|
||||
#include "editor.h"
|
||||
#include "FileClassifier.h"
|
||||
#include "game.h"
|
||||
#include "input.h"
|
||||
#include "interface/Screenshot.h"
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#include "world/sprite.h"
|
||||
#include "world/scenery.h"
|
||||
#include "OpenRCT2.h"
|
||||
#include "rct2.h"
|
||||
|
||||
typedef struct rct_mouse_data {
|
||||
uint32 x;
|
||||
|
|
|
@ -30,7 +30,6 @@ extern "C"
|
|||
#include "../intro.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../util/util.h"
|
||||
#include "../windows/error.h"
|
||||
#include "viewport.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../network/network.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../util/util.h"
|
||||
#include "chat.h"
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
#include "../object.h"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../object/ObjectRepository.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../util/sawyercoding.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "../paint/paint.h"
|
||||
#include "../paint/supports.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../ride/track_data.h"
|
||||
#include "../world/banner.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "../game.h"
|
||||
#include "../input.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../ride/track.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "../interface/themes.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../localisation/string_ids.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../world/map.h"
|
||||
#include "../world/sprite.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "Context.h"
|
||||
#include "drawing/drawing.h"
|
||||
#include "intro.h"
|
||||
#include "rct2.h"
|
||||
#include "sprites.h"
|
||||
|
||||
#define BACKROUND_COLOUR_DARK PALETTE_INDEX_10
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "../interface/window.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../util/util.h"
|
||||
#include "../world/sprite.h"
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../localisation/string_ids.h"
|
||||
#include "../management/finance.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../scenario/scenario.h"
|
||||
#include "../rct1.h"
|
||||
#include "../ride/ride.h"
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <vector>
|
||||
#include "../core/Math.hpp"
|
||||
#include "../core/String.hpp"
|
||||
#include "../OpenRCT2.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
@ -43,7 +44,6 @@ extern "C"
|
|||
#include "../management/news_item.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../util/util.h"
|
||||
#include "../world/sprite.h"
|
||||
#include "http.h"
|
||||
|
|
|
@ -48,7 +48,6 @@ extern "C"
|
|||
#include "../object.h"
|
||||
#include "../object_list.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../util/sawyercoding.h"
|
||||
#include "../util/util.h"
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "../config/Config.h"
|
||||
#include "../drawing/IDrawingEngine.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../title/TitleScreen.h"
|
||||
#include "../ui/UiContext.h"
|
||||
#include "Painter.h"
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
#include "../../cheats.h"
|
||||
#include "../../config/Config.h"
|
||||
#include "../../interface/viewport.h"
|
||||
#include "../../OpenRCT2.h"
|
||||
#include "../../peep/staff.h"
|
||||
#include "../../rct2.h"
|
||||
#include "../../sprites.h"
|
||||
#include "map_element.h"
|
||||
#include "surface.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "../management/news_item.h"
|
||||
#include "../network/network.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../ride/station.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "management/news_item.h"
|
||||
#include "management/research.h"
|
||||
#include "rct12.h"
|
||||
#include "rct2.h"
|
||||
#include "ride/ride.h"
|
||||
#include "world/banner.h"
|
||||
#include "world/map.h"
|
||||
|
|
|
@ -1,150 +0,0 @@
|
|||
#pragma region Copyright (c) 2014-2017 OpenRCT2 Developers
|
||||
/*****************************************************************************
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
|
||||
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* A full copy of the GNU General Public License can be found in licence.txt
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#pragma warning(disable : 4996) // GetVersionExA deprecated
|
||||
|
||||
#include <time.h>
|
||||
#include "audio/audio.h"
|
||||
#include "config/Config.h"
|
||||
#include "Context.h"
|
||||
#include "OpenRCT2.h"
|
||||
#include "platform/platform.h"
|
||||
#include "util/util.h"
|
||||
|
||||
// rct2: 0x0097F67C
|
||||
static const char * const RCT2FilePaths[PATH_ID_END] = {
|
||||
"Data" PATH_SEPARATOR "g1.dat",
|
||||
"Data" PATH_SEPARATOR "plugin.dat",
|
||||
"Data" PATH_SEPARATOR "css1.dat",
|
||||
"Data" PATH_SEPARATOR "css2.dat",
|
||||
"Data" PATH_SEPARATOR "css4.dat",
|
||||
"Data" PATH_SEPARATOR "css5.dat",
|
||||
"Data" PATH_SEPARATOR "css6.dat",
|
||||
"Data" PATH_SEPARATOR "css7.dat",
|
||||
"Data" PATH_SEPARATOR "css8.dat",
|
||||
"Data" PATH_SEPARATOR "css9.dat",
|
||||
"Data" PATH_SEPARATOR "css11.dat",
|
||||
"Data" PATH_SEPARATOR "css12.dat",
|
||||
"Data" PATH_SEPARATOR "css13.dat",
|
||||
"Data" PATH_SEPARATOR "css14.dat",
|
||||
"Data" PATH_SEPARATOR "css15.dat",
|
||||
"Data" PATH_SEPARATOR "css3.dat",
|
||||
"Data" PATH_SEPARATOR "css17.dat",
|
||||
"Data" PATH_SEPARATOR "css18.dat",
|
||||
"Data" PATH_SEPARATOR "css19.dat",
|
||||
"Data" PATH_SEPARATOR "css20.dat",
|
||||
"Data" PATH_SEPARATOR "css21.dat",
|
||||
"Data" PATH_SEPARATOR "css22.dat",
|
||||
"Saved Games" PATH_SEPARATOR "scores.dat",
|
||||
"Data" PATH_SEPARATOR "css23.dat",
|
||||
"Data" PATH_SEPARATOR "css24.dat",
|
||||
"Data" PATH_SEPARATOR "css25.dat",
|
||||
"Data" PATH_SEPARATOR "css26.dat",
|
||||
"Data" PATH_SEPARATOR "css27.dat",
|
||||
"Data" PATH_SEPARATOR "css28.dat",
|
||||
"Data" PATH_SEPARATOR "css29.dat",
|
||||
"Data" PATH_SEPARATOR "css30.dat",
|
||||
"Data" PATH_SEPARATOR "css31.dat",
|
||||
"Data" PATH_SEPARATOR "css32.dat",
|
||||
"Data" PATH_SEPARATOR "css33.dat",
|
||||
"Data" PATH_SEPARATOR "css34.dat",
|
||||
"Data" PATH_SEPARATOR "css35.dat",
|
||||
"Data" PATH_SEPARATOR "css36.dat",
|
||||
"Data" PATH_SEPARATOR "css37.dat",
|
||||
"Data" PATH_SEPARATOR "css38.dat",
|
||||
"Data" PATH_SEPARATOR "CUSTOM1.WAV",
|
||||
"Data" PATH_SEPARATOR "CUSTOM2.WAV",
|
||||
"Data" PATH_SEPARATOR "css39.dat",
|
||||
"Data" PATH_SEPARATOR "css40.dat",
|
||||
"Data" PATH_SEPARATOR "css41.dat",
|
||||
"Scenarios" PATH_SEPARATOR "Six Flags Magic Mountain.SC6",
|
||||
"Data" PATH_SEPARATOR "css42.dat",
|
||||
"Data" PATH_SEPARATOR "css43.dat",
|
||||
"Data" PATH_SEPARATOR "css44.dat",
|
||||
"Data" PATH_SEPARATOR "css45.dat",
|
||||
"Data" PATH_SEPARATOR "css46.dat",
|
||||
"Data" PATH_SEPARATOR "css50.dat"
|
||||
};
|
||||
|
||||
uint32 gCurrentDrawCount = 0;
|
||||
|
||||
uint8 gScreenFlags;
|
||||
uint32 gScreenAge;
|
||||
uint8 gSavePromptMode;
|
||||
|
||||
char gRCT2AddressAppPath[MAX_PATH];
|
||||
|
||||
void rct2_quit()
|
||||
{
|
||||
gSavePromptMode = PM_QUIT;
|
||||
window_save_prompt_open();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00683499
|
||||
*/
|
||||
sint32 rct2_init_directories()
|
||||
{
|
||||
if (str_is_null_or_empty(gCustomRCT2DataPath)) {
|
||||
// check install directory
|
||||
if (gConfigGeneral.rct2_path == NULL || !platform_original_game_data_exists(gConfigGeneral.rct2_path)) {
|
||||
log_verbose("install directory does not exist or invalid directory selected, %s", gConfigGeneral.rct2_path);
|
||||
if (!config_find_or_browse_install_directory()) {
|
||||
utf8 path[MAX_PATH];
|
||||
config_get_default_path(path, sizeof(path));
|
||||
fprintf(stderr, "An RCT2 install directory must be specified! Please edit \"game_path\" in %s.\n", path);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
safe_strcpy(gRCT2AddressAppPath, gConfigGeneral.rct2_path, sizeof(gRCT2AddressAppPath));
|
||||
} else {
|
||||
safe_strcpy(gRCT2AddressAppPath, gCustomRCT2DataPath, sizeof(gRCT2AddressAppPath));
|
||||
}
|
||||
path_end_with_separator(gRCT2AddressAppPath, sizeof(gRCT2AddressAppPath));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00674E6C
|
||||
*/
|
||||
const utf8 *get_file_path(sint32 pathId)
|
||||
{
|
||||
static utf8 path[MAX_PATH];
|
||||
if (pathId == PATH_ID_CSS50 && !str_is_null_or_empty(gConfigGeneral.rct1_path)) {
|
||||
safe_strcpy(path, gConfigGeneral.rct1_path, sizeof(path));
|
||||
safe_strcat_path(path, RCT2FilePaths[PATH_ID_CSS17], sizeof(path));
|
||||
} else {
|
||||
safe_strcpy(path, gRCT2AddressAppPath, sizeof(path));
|
||||
safe_strcat_path(path, RCT2FilePaths[pathId], sizeof(path));
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
uint32 get_file_extension_type(const utf8 *path)
|
||||
{
|
||||
const utf8 *extension = path_get_extension(path);
|
||||
if (strcicmp(extension, ".dat") == 0) return FILE_EXTENSION_DAT;
|
||||
if (strcicmp(extension, ".sc4") == 0) return FILE_EXTENSION_SC4;
|
||||
if (strcicmp(extension, ".sv4") == 0) return FILE_EXTENSION_SV4;
|
||||
if (strcicmp(extension, ".td4") == 0) return FILE_EXTENSION_TD4;
|
||||
if (strcicmp(extension, ".sc6") == 0) return FILE_EXTENSION_SC6;
|
||||
if (strcicmp(extension, ".sv6") == 0) return FILE_EXTENSION_SV6;
|
||||
if (strcicmp(extension, ".td6") == 0) return FILE_EXTENSION_TD6;
|
||||
return FILE_EXTENSION_UNKNOWN;
|
||||
}
|
|
@ -76,104 +76,4 @@ assert_struct_size(rct_scores_entry, 0x02B0);
|
|||
|
||||
#pragma pack(pop)
|
||||
|
||||
enum {
|
||||
// Although this is labeled a flag it actually means when
|
||||
// zero the screen is in playing mode.
|
||||
SCREEN_FLAGS_PLAYING = 0,
|
||||
SCREEN_FLAGS_TITLE_DEMO = 1,
|
||||
SCREEN_FLAGS_SCENARIO_EDITOR = 2,
|
||||
SCREEN_FLAGS_TRACK_DESIGNER = 4,
|
||||
SCREEN_FLAGS_TRACK_MANAGER = 8,
|
||||
};
|
||||
|
||||
#define SCREEN_FLAGS_EDITOR (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)
|
||||
|
||||
enum {
|
||||
PATH_ID_G1,
|
||||
PATH_ID_PLUGIN,
|
||||
PATH_ID_CSS1,
|
||||
PATH_ID_CSS2,
|
||||
PATH_ID_CSS4,
|
||||
PATH_ID_CSS5,
|
||||
PATH_ID_CSS6,
|
||||
PATH_ID_CSS7,
|
||||
PATH_ID_CSS8,
|
||||
PATH_ID_CSS9,
|
||||
PATH_ID_CSS11,
|
||||
PATH_ID_CSS12,
|
||||
PATH_ID_CSS13,
|
||||
PATH_ID_CSS14,
|
||||
PATH_ID_CSS15,
|
||||
PATH_ID_CSS3,
|
||||
PATH_ID_CSS17,
|
||||
PATH_ID_CSS18,
|
||||
PATH_ID_CSS19,
|
||||
PATH_ID_CSS20,
|
||||
PATH_ID_CSS21,
|
||||
PATH_ID_CSS22,
|
||||
PATH_ID_SCORES,
|
||||
PATH_ID_CSS23,
|
||||
PATH_ID_CSS24,
|
||||
PATH_ID_CSS25,
|
||||
PATH_ID_CSS26,
|
||||
PATH_ID_CSS27,
|
||||
PATH_ID_CSS28,
|
||||
PATH_ID_CSS29,
|
||||
PATH_ID_CSS30,
|
||||
PATH_ID_CSS31,
|
||||
PATH_ID_CSS32,
|
||||
PATH_ID_CSS33,
|
||||
PATH_ID_CSS34,
|
||||
PATH_ID_CSS35,
|
||||
PATH_ID_CSS36,
|
||||
PATH_ID_CSS37,
|
||||
PATH_ID_CSS38,
|
||||
PATH_ID_CUSTOM1,
|
||||
PATH_ID_CUSTOM2,
|
||||
PATH_ID_CSS39,
|
||||
PATH_ID_CSS40,
|
||||
PATH_ID_CSS41,
|
||||
PATH_ID_SIXFLAGS_MAGICMOUNTAIN,
|
||||
PATH_ID_CSS42,
|
||||
PATH_ID_CSS43,
|
||||
PATH_ID_CSS44,
|
||||
PATH_ID_CSS45,
|
||||
PATH_ID_CSS46,
|
||||
PATH_ID_CSS50,
|
||||
PATH_ID_END
|
||||
};
|
||||
|
||||
enum {
|
||||
FILE_EXTENSION_UNKNOWN,
|
||||
FILE_EXTENSION_DAT,
|
||||
FILE_EXTENSION_SC4,
|
||||
FILE_EXTENSION_SV4,
|
||||
FILE_EXTENSION_TD4,
|
||||
FILE_EXTENSION_SC6,
|
||||
FILE_EXTENSION_SV6,
|
||||
FILE_EXTENSION_TD6,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint32 gCurrentDrawCount;
|
||||
|
||||
extern uint8 gScreenFlags;
|
||||
extern uint32 gScreenAge;
|
||||
extern uint8 gSavePromptMode;
|
||||
|
||||
extern char gRCT2AddressAppPath[];
|
||||
|
||||
sint32 rct2_init_directories();
|
||||
const char *get_file_path(sint32 pathId);
|
||||
void rct2_quit();
|
||||
|
||||
uint32 get_file_extension_type(const utf8 *path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -42,7 +42,6 @@ extern "C"
|
|||
#include "../object.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_ratings.h"
|
||||
#include "../ride/track_data.h"
|
||||
|
|
|
@ -42,7 +42,6 @@ extern "C"
|
|||
#include "../management/research.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_ratings.h"
|
||||
#include "../scenario/scenario.h"
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
|
||||
extern "C"
|
||||
{
|
||||
#include "../rct2.h"
|
||||
#include "track_design.h"
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#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"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "../cheats.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../world/map.h"
|
||||
#include "ride.h"
|
||||
#include "ride_data.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "../network/network.h"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../object/ObjectRepository.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct1.h"
|
||||
#include "../rct1/Tables.h"
|
||||
#include "../util/sawyercoding.h"
|
||||
|
|
|
@ -35,7 +35,6 @@ extern "C"
|
|||
#include "../config/Config.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "scenario.h"
|
||||
}
|
||||
|
||||
|
@ -595,13 +594,6 @@ private:
|
|||
Console::Error::WriteLine("Unable to save highscores to '%s'", path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
static utf8 * GetRCT2Directory(utf8 * buffer, size_t bufferSize)
|
||||
{
|
||||
String::Set(buffer, bufferSize, gRCT2AddressAppPath);
|
||||
Path::Append(buffer, bufferSize, "Scenarios");
|
||||
return buffer;
|
||||
}
|
||||
};
|
||||
|
||||
static ScenarioRepository * _scenarioRepository;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "../audio/audio.h"
|
||||
#include "../cheats.h"
|
||||
#include "../config/Config.h"
|
||||
#include "../FileClassifier.h"
|
||||
#include "../game.h"
|
||||
#include "../interface/viewport.h"
|
||||
#include "../localisation/date.h"
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "../core/Math.hpp"
|
||||
#include "../core/Path.hpp"
|
||||
#include "../core/String.hpp"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../scenario/ScenarioRepository.h"
|
||||
#include "../scenario/ScenarioSources.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../util/util.h"
|
||||
#include "../world/footpath.h"
|
||||
#include "../world/map.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/map.h"
|
||||
#include "../world/scenery.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../paint/map_element/map_element.h"
|
||||
#include "../paint/paint.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/track_paint.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/map.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../scenario/scenario.h"
|
||||
#include "../sprites.h"
|
||||
#include "dropdown.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "../interface/viewport.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../ride/track_data.h"
|
||||
#include "../util/util.h"
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "../object.h"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../object/ObjectRepository.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct1.h"
|
||||
#include "../sprites.h"
|
||||
#include "../util/util.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "../interface/viewport.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../rct2.h"
|
||||
#include "../world/footpath.h"
|
||||
|
||||
static void window_editor_main_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "../object_list.h"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../object/ObjectRepository.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct1.h"
|
||||
#include "../ride/ride.h"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "../interface/window.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../scenario/scenario.h"
|
||||
#include "../sprites.h"
|
||||
#include "../util/util.h"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../management/finance.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../sprites.h"
|
||||
#include "dropdown.h"
|
||||
#include "error.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "error.h"
|
||||
|
||||
bool gDisableErrorWindowSound = false;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "../interface/viewport.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/footpath.h"
|
||||
#include "dropdown.h"
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../management/finance.h"
|
||||
#include "../management/news_item.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/Climate.h"
|
||||
#include "../world/park.h"
|
||||
|
|
|
@ -20,13 +20,10 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/map.h"
|
||||
#include "dropdown.h"
|
||||
|
||||
|
||||
|
||||
enum WINDOW_LAND_WIDGET_IDX {
|
||||
WIDX_BACKGROUND,
|
||||
WIDX_TITLE,
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/map.h"
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "../interface/viewport.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../rct2.h"
|
||||
#include "../world/footpath.h"
|
||||
|
||||
rct_widget window_main_widgets[] = {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/entrance.h"
|
||||
#include "../world/footpath.h"
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "../management/research.h"
|
||||
#include "../network/network.h"
|
||||
#include "../object.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct1.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_data.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../network/network.h"
|
||||
#include "../platform/platform.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../title/TitleScreen.h"
|
||||
#include "../title/TitleSequence.h"
|
||||
|
@ -1426,7 +1425,7 @@ static void window_options_dropdown(rct_window *w, rct_widgetindex widgetIndex,
|
|||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_TITLE_MUSIC_DROPDOWN:
|
||||
if ((dropdownIndex == 1 || dropdownIndex == 3) && !platform_file_exists(get_file_path(PATH_ID_CSS50))) {
|
||||
if ((dropdownIndex == 1 || dropdownIndex == 3) && !platform_file_exists(context_get_path_legacy(PATH_ID_CSS50))) {
|
||||
window_error_open(STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND, STR_OPTIONS_MUSIC_ERR_CSS50_NOT_FOUND_HINT);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "../interface/window.h"
|
||||
#include "../management/award.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../scenario/scenario.h"
|
||||
#include "../sprites.h"
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
#include "../network/network.h"
|
||||
#include "../object/ObjectManager.h"
|
||||
#include "../object/ObjectRepository.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct1.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../ride/RideGroupManager.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
|
||||
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../rct2.h"
|
||||
#include "../world/map.h"
|
||||
#include "../world/scenery.h"
|
||||
#include "../world/sprite.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../util/util.h"
|
||||
#include "../world/footpath.h"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../title/TitleScreen.h"
|
||||
#include "../title/TitleSequence.h"
|
||||
|
|
|
@ -16,12 +16,14 @@
|
|||
|
||||
#include "../config/Config.h"
|
||||
#include "../drawing/drawing.h"
|
||||
#include "../FileClassifier.h"
|
||||
#include "../game.h"
|
||||
#include "../input.h"
|
||||
#include "../interface/viewport.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../peep/staff.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../intro.h"
|
||||
#include "../rct2.h"
|
||||
|
||||
enum WINDOW_TITLE_EXIT_WIDGET_IDX {
|
||||
WIDX_EXIT,
|
||||
|
@ -98,7 +97,7 @@ static void window_title_exit_mouseup(rct_window *w, rct_widgetindex widgetIndex
|
|||
|
||||
switch (widgetIndex) {
|
||||
case WIDX_EXIT:
|
||||
rct2_quit();
|
||||
context_quit();
|
||||
//game_do_command(0, 1, 0, 0, 5, 3, 0);
|
||||
break;
|
||||
};
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../rct2.h"
|
||||
|
||||
enum WINDOW_TITLE_OPTIONS_WIDGET_IDX {
|
||||
WIDX_OPTIONS,
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "../input.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../rct2.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
enum {
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../network/network.h"
|
||||
#include "../network/twitch.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../scenario/scenario.h"
|
||||
|
@ -585,7 +586,7 @@ static void window_top_toolbar_dropdown(rct_window *w, rct_widgetindex widgetInd
|
|||
game_do_command(0, 1, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 1, 0);
|
||||
break;
|
||||
case DDIDX_EXIT_OPENRCT2:
|
||||
rct2_quit();
|
||||
context_quit();
|
||||
break;
|
||||
#ifndef DISABLE_TWITCH
|
||||
case DDIDX_ENABLE_TWITCH:
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct1.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/track.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/track.h"
|
||||
#include "../ride/track_design.h"
|
||||
#include "../ride/TrackDesignRepository.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "../interface/viewport.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../paint/paint.h"
|
||||
#include "../rct2.h"
|
||||
|
||||
enum WINDOW_VIEW_CLIPPING_WIDGET_IDX {
|
||||
WIDX_BACKGROUND,
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "../interface/widget.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../rct2.h"
|
||||
#include "../sprites.h"
|
||||
#include "../world/map.h"
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "../config/Config.h"
|
||||
#include "../core/Math.hpp"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "Climate.h"
|
||||
|
||||
extern "C"
|
||||
|
@ -27,7 +28,6 @@ extern "C"
|
|||
#include "../game.h"
|
||||
#include "../interface/window.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../rct2.h"
|
||||
#include "../scenario/scenario.h"
|
||||
#include "../sprites.h"
|
||||
#include "../util/util.h"
|
||||
|
|
|
@ -15,9 +15,7 @@
|
|||
#pragma endregion
|
||||
|
||||
#include "../network/network.h"
|
||||
|
||||
#include "../rct2.h"
|
||||
#include "../network/network.h"
|
||||
#include "../OpenRCT2.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../rct2.h"
|
||||
#include "../network/network.h"
|
||||
#include "../OpenRCT2.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "../localisation/localisation.h"
|
||||
#include "../network/network.h"
|
||||
#include "../object_list.h"
|
||||
#include "../rct2.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ride/station.h"
|
||||
#include "../ride/track.h"
|
||||
#include "../ride/track_data.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "../management/finance.h"
|
||||
#include "../network/network.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../ride/track.h"
|
||||
#include "../ride/track_data.h"
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#include "../management/news_item.h"
|
||||
#include "../management/research.h"
|
||||
#include "../network/network.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../peep/peep.h"
|
||||
#include "../peep/staff.h"
|
||||
#include "../rct2.h"
|
||||
#include "../ride/ride.h"
|
||||
#include "../ride/ride_data.h"
|
||||
#include "../scenario/scenario.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "../common.h"
|
||||
#include "../network/network.h"
|
||||
#include "../OpenRCT2.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue