mirror of https://github.com/OpenRCT2/OpenRCT2.git
Rename snake_case functions in openrct2/src folder
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
This commit is contained in:
parent
bf5f7e8e71
commit
6b7dc8fcdb
|
@ -64,7 +64,7 @@ int main(int argc, const char** argv)
|
|||
}
|
||||
catch (const SDLException& e)
|
||||
{
|
||||
log_warning("Failed to create audio context. Using dummy audio context. Error message was: %s", e.what());
|
||||
LOG_WARNING("Failed to create audio context. Using dummy audio context. Error message was: %s", e.what());
|
||||
audioContext = ToShared(CreateDummyAudioContext());
|
||||
}
|
||||
auto uiContext = ToShared(CreateUiContext(env));
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace OpenRCT2::Ui
|
|||
|
||||
void ShowMessageBox(SDL_Window* window, const std::string& message) override
|
||||
{
|
||||
log_verbose(message.c_str());
|
||||
LOG_VERBOSE(message.c_str());
|
||||
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_WARNING, "OpenRCT2", message.c_str(), window);
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ namespace OpenRCT2::Ui
|
|||
|
||||
std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) override
|
||||
{
|
||||
log_info(title.c_str());
|
||||
LOG_INFO(title.c_str());
|
||||
STUB();
|
||||
|
||||
return "/sdcard/rct2";
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace OpenRCT2::Ui
|
|||
|
||||
void ShowMessageBox(SDL_Window* window, const std::string& message) override
|
||||
{
|
||||
log_verbose(message.c_str());
|
||||
LOG_VERBOSE(message.c_str());
|
||||
|
||||
std::string executablePath;
|
||||
DIALOG_TYPE dtype = GetDialogApp(&executablePath);
|
||||
|
|
|
@ -221,7 +221,7 @@ namespace OpenRCT2::Ui
|
|||
SDL_VERSION(&wmInfo.version);
|
||||
if (SDL_GetWindowWMInfo(window, &wmInfo) != SDL_TRUE)
|
||||
{
|
||||
log_error("SDL_GetWindowWMInfo failed %s", SDL_GetError());
|
||||
LOG_ERROR("SDL_GetWindowWMInfo failed %s", SDL_GetError());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ public:
|
|||
|
||||
if (SDL_SetWindowFullscreen(_window, windowFlags))
|
||||
{
|
||||
log_fatal("SDL_SetWindowFullscreen %s", SDL_GetError());
|
||||
LOG_FATAL("SDL_SetWindowFullscreen %s", SDL_GetError());
|
||||
exit(1);
|
||||
|
||||
// TODO try another display mode rather than just exiting the game
|
||||
|
@ -725,7 +725,7 @@ private:
|
|||
{
|
||||
SDL_version version{};
|
||||
SDL_GetVersion(&version);
|
||||
log_verbose("SDL2 version: %d.%d.%d", version.major, version.minor, version.patch);
|
||||
LOG_VERBOSE("SDL2 version: %d.%d.%d", version.major, version.minor, version.patch);
|
||||
}
|
||||
|
||||
void CreateWindow(const ScreenCoordsXY& windowPos)
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace OpenRCT2::Ui
|
|||
private:
|
||||
static int32_t Execute(const std::string& command, std::string* output = nullptr)
|
||||
{
|
||||
log_verbose("executing \"%s\"...", command.c_str());
|
||||
LOG_VERBOSE("executing \"%s\"...", command.c_str());
|
||||
FILE* fpipe = popen(command.c_str(), "r");
|
||||
if (fpipe == nullptr)
|
||||
{
|
||||
|
|
|
@ -323,7 +323,7 @@ public:
|
|||
tlbrWindow->Invalidate();
|
||||
if (!ToolSet(*tlbrWindow, WC_TOP_TOOLBAR__WIDX_SCENERY, Tool::Arrow))
|
||||
{
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
window = WindowSceneryOpen();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
log_verbose("Unable to create audio source: %s", e.what());
|
||||
LOG_VERBOSE("Unable to create audio source: %s", e.what());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ namespace OpenRCT2::Audio
|
|||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
log_verbose("Unable to create audio source: %s", e.what());
|
||||
LOG_VERBOSE("Unable to create audio source: %s", e.what());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace OpenRCT2::Audio
|
|||
_decoder = FLAC__stream_decoder_new();
|
||||
if (_decoder == nullptr)
|
||||
{
|
||||
log_verbose("Could not create FLAC stream decoder");
|
||||
LOG_VERBOSE("Could not create FLAC stream decoder");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -69,13 +69,13 @@ namespace OpenRCT2::Audio
|
|||
FlacCallbackWrite, FlacCallbackMetadata, FlacCallbackError, this);
|
||||
if (status != FLAC__STREAM_DECODER_INIT_STATUS_OK)
|
||||
{
|
||||
log_verbose("Could not initialise FLAC stream");
|
||||
LOG_VERBOSE("Could not initialise FLAC stream");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!FLAC__stream_decoder_process_until_end_of_metadata(_decoder))
|
||||
{
|
||||
log_verbose("Could not read FLAC metadata");
|
||||
LOG_VERBOSE("Could not read FLAC metadata");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,14 +63,14 @@ namespace OpenRCT2::Audio
|
|||
_file.emplace();
|
||||
if (ov_open_callbacks(_rw, &*_file, NULL, 0, callbacks) < 0)
|
||||
{
|
||||
log_verbose("Could not open OGG/Vorbis stream");
|
||||
LOG_VERBOSE("Could not open OGG/Vorbis stream");
|
||||
return false;
|
||||
}
|
||||
|
||||
auto vi = ov_info(&*_file, -1);
|
||||
if (vi == nullptr)
|
||||
{
|
||||
log_verbose("Failed to get OGG/Vorbis info");
|
||||
LOG_VERBOSE("Failed to get OGG/Vorbis info");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public:
|
|||
int32_t result = SDL_GetRendererInfo(_sdlRenderer, &rendererInfo);
|
||||
if (result < 0)
|
||||
{
|
||||
log_warning("HWDisplayDrawingEngine::Resize error: %s", SDL_GetError());
|
||||
LOG_WARNING("HWDisplayDrawingEngine::Resize error: %s", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
uint32_t pixelFormat = SDL_PIXELFORMAT_UNKNOWN;
|
||||
|
@ -390,12 +390,12 @@ private:
|
|||
_pausedBeforeOverlay = gGamePaused & GAME_PAUSED_NORMAL;
|
||||
if (!_pausedBeforeOverlay)
|
||||
{
|
||||
pause_toggle();
|
||||
PauseToggle();
|
||||
}
|
||||
}
|
||||
else if (_overlayActive && !newOverlayActive && !_pausedBeforeOverlay)
|
||||
{
|
||||
pause_toggle();
|
||||
PauseToggle();
|
||||
}
|
||||
|
||||
_overlayActive = newOverlayActive;
|
||||
|
|
|
@ -64,13 +64,13 @@ public:
|
|||
|
||||
if (_surface == nullptr || _palette == nullptr || _RGBASurface == nullptr)
|
||||
{
|
||||
log_fatal("%p || %p || %p == nullptr %s", _surface, _palette, _RGBASurface, SDL_GetError());
|
||||
LOG_FATAL("%p || %p || %p == nullptr %s", _surface, _palette, _RGBASurface, SDL_GetError());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (SDL_SetSurfacePalette(_surface, _palette))
|
||||
{
|
||||
log_fatal("SDL_SetSurfacePalette failed %s", SDL_GetError());
|
||||
LOG_FATAL("SDL_SetSurfacePalette failed %s", SDL_GetError());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ private:
|
|||
{
|
||||
if (SDL_LockSurface(_surface) < 0)
|
||||
{
|
||||
log_error("locking failed %s", SDL_GetError());
|
||||
LOG_ERROR("locking failed %s", SDL_GetError());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ private:
|
|||
SDL_Surface* windowSurface = SDL_GetWindowSurface(_window);
|
||||
if (SDL_BlitSurface(_surface, nullptr, windowSurface, nullptr))
|
||||
{
|
||||
log_fatal("SDL_BlitSurface %s", SDL_GetError());
|
||||
LOG_FATAL("SDL_BlitSurface %s", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ private:
|
|||
// first blit to rgba surface to change the pixel format
|
||||
if (SDL_BlitSurface(_surface, nullptr, _RGBASurface, nullptr))
|
||||
{
|
||||
log_fatal("SDL_BlitSurface %s", SDL_GetError());
|
||||
LOG_FATAL("SDL_BlitSurface %s", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -144,13 +144,13 @@ private:
|
|||
// about blit configurations being incompatible.
|
||||
if (SDL_BlitScaled(_RGBASurface, nullptr, SDL_GetWindowSurface(_window), nullptr))
|
||||
{
|
||||
log_fatal("SDL_BlitScaled %s", SDL_GetError());
|
||||
LOG_FATAL("SDL_BlitScaled %s", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (SDL_UpdateWindowSurface(_window))
|
||||
{
|
||||
log_fatal("SDL_UpdateWindowSurface %s", SDL_GetError());
|
||||
LOG_FATAL("SDL_UpdateWindowSurface %s", SDL_GetError());
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ inline void CheckGLError()
|
|||
GLenum error = glGetError();
|
||||
while (error != GL_NO_ERROR)
|
||||
{
|
||||
log_error("OpenGL Error 0x%04X", error);
|
||||
LOG_ERROR("OpenGL Error 0x%04X", error);
|
||||
error = glGetError();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -334,7 +334,7 @@ AtlasTextureInfo TextureCache::AllocateImage(int32_t imageWidth, int32_t imageHe
|
|||
int32_t atlasSize = powf(2, static_cast<float>(Atlas::CalculateImageSizeOrder(imageWidth, imageHeight)));
|
||||
|
||||
# ifdef DEBUG
|
||||
log_verbose("new texture atlas #%d (size %d) allocated", atlasIndex, atlasSize);
|
||||
LOG_VERBOSE("new texture atlas #%d (size %d) allocated", atlasIndex, atlasSize);
|
||||
# endif
|
||||
|
||||
_atlases.emplace_back(atlasIndex, atlasSize);
|
||||
|
|
|
@ -122,7 +122,7 @@ void InputManager::HandleViewScrolling()
|
|||
// Mouse edge scrolling
|
||||
if (gConfigGeneral.EdgeScrolling)
|
||||
{
|
||||
if (input_get_state() != InputState::Normal)
|
||||
if (InputGetState() != InputState::Normal)
|
||||
return;
|
||||
|
||||
if (gInputPlaceObjectModifier & (PLACE_OBJECT_MODIFIER_SHIFT_Z | PLACE_OBJECT_MODIFIER_COPY_Z))
|
||||
|
|
|
@ -375,7 +375,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
|
|||
break;
|
||||
}
|
||||
|
||||
if (!input_test_flag(INPUT_FLAG_4))
|
||||
if (!InputTestFlag(INPUT_FLAG_4))
|
||||
break;
|
||||
|
||||
if (w->classification != _dragWidget.window_classification || w->number != _dragWidget.window_number
|
||||
|
@ -1044,7 +1044,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, rct_window* w, W
|
|||
w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
|
||||
if (w != nullptr)
|
||||
{
|
||||
input_set_flag(INPUT_FLAG_4, true);
|
||||
InputSetFlag(INPUT_FLAG_4, true);
|
||||
WindowEventToolDownCall(w, gCurrentToolWidget.widget_index, screenCoords);
|
||||
}
|
||||
}
|
||||
|
@ -1190,7 +1190,7 @@ void ProcessMouseTool(const ScreenCoordsXY& screenCoords)
|
|||
|
||||
if (w == nullptr)
|
||||
ToolCancel();
|
||||
else if (input_get_state() != InputState::ViewportRight)
|
||||
else if (InputGetState() != InputState::ViewportRight)
|
||||
WindowEventToolUpdateCall(w, gCurrentToolWidget.widget_index, screenCoords);
|
||||
}
|
||||
}
|
||||
|
@ -1488,7 +1488,7 @@ static void InputUpdateTooltip(rct_window* w, WidgetIndex widgetIndex, const Scr
|
|||
}
|
||||
else
|
||||
{
|
||||
reset_tooltip_not_shown();
|
||||
ResetTooltipNotShown();
|
||||
|
||||
if (w == nullptr || gTooltipWidget.window_classification != w->classification
|
||||
|| gTooltipWidget.window_number != w->number || gTooltipWidget.widget_index != widgetIndex
|
||||
|
|
|
@ -364,7 +364,7 @@ static void ShortcutReduceGameSpeed()
|
|||
return;
|
||||
|
||||
if (network_get_mode() == NETWORK_MODE_NONE)
|
||||
game_reduce_game_speed();
|
||||
GameReduceGameSpeed();
|
||||
}
|
||||
|
||||
static void ShortcutIncreaseGameSpeed()
|
||||
|
@ -373,7 +373,7 @@ static void ShortcutIncreaseGameSpeed()
|
|||
return;
|
||||
|
||||
if (network_get_mode() == NETWORK_MODE_NONE)
|
||||
game_increase_game_speed();
|
||||
GameIncreaseGameSpeed();
|
||||
}
|
||||
|
||||
static void ShortcutOpenCheatWindow()
|
||||
|
@ -424,7 +424,7 @@ static void ShortcutQuickSaveGame()
|
|||
if (gScreenFlags == SCREEN_FLAGS_PLAYING)
|
||||
{
|
||||
ToolCancel();
|
||||
save_game();
|
||||
SaveGame();
|
||||
}
|
||||
else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
|
@ -764,7 +764,7 @@ void ShortcutManager::RegisterDefaultShortcuts()
|
|||
{
|
||||
WindowClose(*window);
|
||||
}
|
||||
else if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
else if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
ToolCancel();
|
||||
}
|
||||
|
|
|
@ -404,7 +404,7 @@ bool UITheme::WriteToFile(const std::string& path) const
|
|||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
log_error("Unable to save %s: %s", path.c_str(), ex.what());
|
||||
LOG_ERROR("Unable to save %s: %s", path.c_str(), ex.what());
|
||||
result = false;
|
||||
}
|
||||
|
||||
|
@ -475,7 +475,7 @@ UITheme* UITheme::FromFile(const std::string& path)
|
|||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
log_error("Unable to read theme: %s", path.c_str());
|
||||
LOG_ERROR("Unable to read theme: %s", path.c_str());
|
||||
result = nullptr;
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -199,7 +199,7 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords)
|
|||
}
|
||||
case EntityType::Balloon:
|
||||
{
|
||||
if (game_is_not_paused())
|
||||
if (GameIsNotPaused())
|
||||
{
|
||||
auto balloonPress = BalloonPressAction(entity->sprite_index);
|
||||
GameActions::Execute(&balloonPress);
|
||||
|
@ -208,7 +208,7 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords)
|
|||
break;
|
||||
case EntityType::Duck:
|
||||
{
|
||||
if (game_is_not_paused())
|
||||
if (GameIsNotPaused())
|
||||
{
|
||||
auto duck = entity->As<Duck>();
|
||||
if (duck != nullptr)
|
||||
|
@ -444,7 +444,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor
|
|||
break;
|
||||
}
|
||||
|
||||
if (!(input_test_flag(INPUT_FLAG_6)) || !(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_6)) || !(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
{
|
||||
if (WindowFindByClass(WindowClass::RideConstruction) == nullptr && WindowFindByClass(WindowClass::Footpath) == nullptr)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ void WidgetDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex widgetIndex)
|
|||
const auto* widget = GetWidgetByIndex(w, widgetIndex);
|
||||
if (widget == nullptr)
|
||||
{
|
||||
log_error("Tried drawing an out-of-bounds widget index!");
|
||||
LOG_ERROR("Tried drawing an out-of-bounds widget index!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -883,9 +883,9 @@ bool WidgetIsPressed(const rct_window& w, WidgetIndex widgetIndex)
|
|||
}
|
||||
}
|
||||
|
||||
if (input_get_state() == InputState::WidgetPressed || input_get_state() == InputState::DropdownActive)
|
||||
if (InputGetState() == InputState::WidgetPressed || InputGetState() == InputState::DropdownActive)
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_WIDGET_PRESSED)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_WIDGET_PRESSED)))
|
||||
return false;
|
||||
if (gPressedWidget.window_classification != w.classification)
|
||||
return false;
|
||||
|
@ -911,7 +911,7 @@ bool WidgetIsHighlighted(const rct_window& w, WidgetIndex widgetIndex)
|
|||
|
||||
bool WidgetIsActiveTool(const rct_window& w, WidgetIndex widgetIndex)
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return false;
|
||||
if (gCurrentToolWidget.window_classification != w.classification)
|
||||
return false;
|
||||
|
@ -1051,7 +1051,7 @@ Widget* GetWidgetByIndex(const rct_window& w, WidgetIndex widgetIndex)
|
|||
index++;
|
||||
}
|
||||
|
||||
log_error("Widget index %i out of bounds for window class %u", widgetIndex, w.classification);
|
||||
LOG_ERROR("Widget index %i out of bounds for window class %u", widgetIndex, w.classification);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -521,7 +521,7 @@ void WindowAllWheelInput()
|
|||
return;
|
||||
|
||||
// Check window cursor is over
|
||||
if (!(input_test_flag(INPUT_FLAG_5)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_5)))
|
||||
{
|
||||
rct_window* w = WindowFindFromPoint(cursorState->position);
|
||||
if (w != nullptr)
|
||||
|
|
|
@ -267,7 +267,7 @@ namespace OpenRCT2::Scripting
|
|||
if (isScenario)
|
||||
scenario_begin();
|
||||
else
|
||||
game_load_init();
|
||||
GameLoadInit();
|
||||
gLoadKeepWindowsOpen = old;
|
||||
}
|
||||
catch (const std::exception&)
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace OpenRCT2::Scripting
|
|||
|
||||
std::shared_ptr<ScTool> tool_get() const
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
return std::make_shared<ScTool>(_scriptEngine.GetContext());
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace OpenRCT2::Title
|
|||
auto parkHandle = TitleSequenceGetParkHandle(*_sequence, saveIndex);
|
||||
if (parkHandle != nullptr)
|
||||
{
|
||||
game_notify_map_change();
|
||||
GameNotifyMapChange();
|
||||
loadSuccess = LoadParkFromStream(parkHandle->Stream.get(), parkHandle->HintPath);
|
||||
}
|
||||
if (!loadSuccess)
|
||||
|
@ -146,7 +146,7 @@ namespace OpenRCT2::Title
|
|||
throw std::out_of_range("Failed to load park; index out of range.");
|
||||
}
|
||||
|
||||
game_notify_map_changed();
|
||||
GameNotifyMapChanged();
|
||||
}
|
||||
else if (std::holds_alternative<LoadScenarioCommand>(currentCommand))
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ namespace OpenRCT2::Title
|
|||
auto scenario = GetScenarioRepository()->GetByInternalName(scenarioName);
|
||||
if (scenario != nullptr)
|
||||
{
|
||||
game_notify_map_change();
|
||||
GameNotifyMapChange();
|
||||
loadSuccess = LoadParkFromFile(scenario->path);
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ namespace OpenRCT2::Title
|
|||
throw std::domain_error(message);
|
||||
}
|
||||
|
||||
game_notify_map_changed();
|
||||
GameNotifyMapChanged();
|
||||
}
|
||||
|
||||
IncrementPosition();
|
||||
|
@ -281,7 +281,7 @@ namespace OpenRCT2::Title
|
|||
|
||||
bool LoadParkFromFile(const utf8* path)
|
||||
{
|
||||
log_verbose("TitleSequencePlayer::LoadParkFromFile(%s)", path);
|
||||
LOG_VERBOSE("TitleSequencePlayer::LoadParkFromFile(%s)", path);
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
|
@ -318,7 +318,7 @@ namespace OpenRCT2::Title
|
|||
*/
|
||||
bool LoadParkFromStream(OpenRCT2::IStream* stream, const std::string& hintPath)
|
||||
{
|
||||
log_verbose("TitleSequencePlayer::LoadParkFromStream(%s)", hintPath.c_str());
|
||||
LOG_VERBOSE("TitleSequencePlayer::LoadParkFromStream(%s)", hintPath.c_str());
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
|
@ -379,7 +379,7 @@ namespace OpenRCT2::Title
|
|||
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
||||
windowManager->SetMainView(gSavedView, gSavedViewZoom, gSavedViewRotation);
|
||||
ResetEntitySpatialIndices();
|
||||
reset_all_sprite_quadrant_placements();
|
||||
ResetAllSpriteQuadrantPlacements();
|
||||
auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES);
|
||||
ContextBroadcastIntent(&intent);
|
||||
ScenerySetDefaultPlacementConfiguration();
|
||||
|
|
|
@ -205,7 +205,7 @@ private:
|
|||
// Version info
|
||||
utf8 buffer[256];
|
||||
utf8* ch = buffer;
|
||||
openrct2_write_full_version_info(ch, sizeof(buffer) - (ch - buffer));
|
||||
OpenRCT2WriteFullVersionInfo(ch, sizeof(buffer) - (ch - buffer));
|
||||
auto ft = Formatter();
|
||||
ft.Add<const char*>(buffer);
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
return true;
|
||||
|
||||
default:
|
||||
log_error("Invalid personality for changelog window: %d", personality);
|
||||
LOG_ERROR("Invalid personality for changelog window: %d", personality);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
log_error("Cannot open URL: NewVersionInfo for ChangelogWindow is undefined!");
|
||||
LOG_ERROR("Cannot open URL: NewVersionInfo for ChangelogWindow is undefined!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ private:
|
|||
}
|
||||
else
|
||||
{
|
||||
log_error("ChangelogWindow: Could not process NewVersionInfo, result was undefined");
|
||||
LOG_ERROR("ChangelogWindow: Could not process NewVersionInfo, result was undefined");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -271,12 +271,12 @@ private:
|
|||
}
|
||||
catch (const std::bad_alloc&)
|
||||
{
|
||||
log_error("Unable to allocate memory for text file");
|
||||
LOG_ERROR("Unable to allocate memory for text file");
|
||||
return false;
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
log_error("Unable to read text file");
|
||||
LOG_ERROR("Unable to read text file");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
ResetDropdownFlags();
|
||||
gDropdownIsColour = false;
|
||||
gDropdownDefaultIndex = -1;
|
||||
input_set_state(InputState::DropdownActive);
|
||||
InputSetState(InputState::DropdownActive);
|
||||
}
|
||||
|
||||
void OnDraw(rct_drawpixelinfo& dpi) override
|
||||
|
@ -376,9 +376,9 @@ void WindowDropdownShowTextCustomWidth(
|
|||
const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t custom_height, uint8_t flags, size_t num_items,
|
||||
int32_t width)
|
||||
{
|
||||
input_set_flag(static_cast<INPUT_FLAGS>(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false);
|
||||
InputSetFlag(static_cast<INPUT_FLAGS>(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false);
|
||||
if (flags & Dropdown::Flag::StayOpen)
|
||||
input_set_flag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true);
|
||||
InputSetFlag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true);
|
||||
|
||||
WindowDropdownClose();
|
||||
|
||||
|
@ -408,9 +408,9 @@ void WindowDropdownShowImage(
|
|||
int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, int32_t numItems, int32_t itemWidth,
|
||||
int32_t itemHeight, int32_t numColumns)
|
||||
{
|
||||
input_set_flag(static_cast<INPUT_FLAGS>(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false);
|
||||
InputSetFlag(static_cast<INPUT_FLAGS>(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false);
|
||||
if (flags & Dropdown::Flag::StayOpen)
|
||||
input_set_flag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true);
|
||||
InputSetFlag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true);
|
||||
|
||||
// Close existing dropdown
|
||||
WindowDropdownClose();
|
||||
|
|
|
@ -205,7 +205,7 @@ private:
|
|||
if (!CheckObjectSelection())
|
||||
return;
|
||||
|
||||
finish_object_selection();
|
||||
FinishObjectSelection();
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
{
|
||||
ContextOpenWindow(WindowClass::ConstructRide);
|
||||
|
|
|
@ -265,7 +265,7 @@ public:
|
|||
InitWidgets();
|
||||
|
||||
sub_6AB211();
|
||||
reset_selected_object_count_and_size();
|
||||
ResetSelectedObjectCountAndSize();
|
||||
|
||||
widgets[WIDX_FILTER_TEXT_BOX].string = _filter_string;
|
||||
|
||||
|
@ -293,9 +293,9 @@ public:
|
|||
*/
|
||||
void OnClose() override
|
||||
{
|
||||
unload_unselected_objects();
|
||||
UnloadUnselectedObjects();
|
||||
EditorLoadSelectedObjects();
|
||||
editor_object_flags_free();
|
||||
EditorObjectFlagsFree();
|
||||
|
||||
if (_loadedObject != nullptr)
|
||||
_loadedObject->Unload();
|
||||
|
@ -356,12 +356,12 @@ public:
|
|||
WindowClose(*this);
|
||||
if (gScreenFlags & SCREEN_FLAGS_EDITOR)
|
||||
{
|
||||
finish_object_selection();
|
||||
FinishObjectSelection();
|
||||
}
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)
|
||||
{
|
||||
game_notify_map_change();
|
||||
game_unload_scripts();
|
||||
GameNotifyMapChange();
|
||||
GameUnloadScripts();
|
||||
title_load();
|
||||
}
|
||||
break;
|
||||
|
@ -594,7 +594,7 @@ public:
|
|||
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)
|
||||
{
|
||||
const auto objectSelectResult = window_editor_object_selection_select_object(
|
||||
const auto objectSelectResult = WindowEditorObjectSelectionSelectObject(
|
||||
0, INPUT_FLAG_EDITOR_OBJECT_SELECT, listItem->repositoryItem);
|
||||
if (!objectSelectResult.Successful)
|
||||
return;
|
||||
|
@ -614,7 +614,7 @@ public:
|
|||
inputFlags |= INPUT_FLAG_EDITOR_OBJECT_SELECT;
|
||||
|
||||
_gSceneryGroupPartialSelectError = std::nullopt;
|
||||
const auto objectSelectResult = window_editor_object_selection_select_object(0, inputFlags, listItem->repositoryItem);
|
||||
const auto objectSelectResult = WindowEditorObjectSelectionSelectObject(0, inputFlags, listItem->repositoryItem);
|
||||
if (!objectSelectResult.Successful)
|
||||
{
|
||||
StringId error_title = (inputFlags & INPUT_FLAG_EDITOR_OBJECT_SELECT) ? STR_UNABLE_TO_SELECT_THIS_OBJECT
|
||||
|
@ -1161,7 +1161,7 @@ private:
|
|||
sortFunc = VisibleListSortRideName;
|
||||
break;
|
||||
default:
|
||||
log_warning("Wrong sort type %d, leaving list as-is.", _listSortType);
|
||||
LOG_WARNING("Wrong sort type %d, leaving list as-is.", _listSortType);
|
||||
break;
|
||||
}
|
||||
if (sortFunc != nullptr)
|
||||
|
@ -1577,7 +1577,7 @@ void EditorLoadSelectedObjects()
|
|||
loadedObject = objManager.LoadObject(descriptor);
|
||||
if (loadedObject == nullptr)
|
||||
{
|
||||
log_error("Failed to load entry %s", std::string(descriptor.GetName()).c_str());
|
||||
LOG_ERROR("Failed to load entry %s", std::string(descriptor.GetName()).c_str());
|
||||
}
|
||||
else if (!(gScreenFlags & SCREEN_FLAGS_EDITOR))
|
||||
{
|
||||
|
|
|
@ -121,7 +121,7 @@ rct_window* WindowErrorOpen(std::string_view title, std::string_view message)
|
|||
buffer.append(message);
|
||||
}
|
||||
|
||||
log_verbose("show error, %s", buffer.c_str() + 1);
|
||||
LOG_VERBOSE("show error, %s", buffer.c_str() + 1);
|
||||
|
||||
// Don't do unnecessary work in headless. Also saves checking if cursor state is null.
|
||||
if (gOpenRCT2Headless)
|
||||
|
|
|
@ -173,7 +173,7 @@ public:
|
|||
ToolCancel();
|
||||
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND;
|
||||
ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
_footpathErrorOccured = false;
|
||||
WindowFootpathSetEnabledAndPressedWidgets();
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ public:
|
|||
// Check tool
|
||||
if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND)
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ public:
|
|||
}
|
||||
else if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL)
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ public:
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
|
||||
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND;
|
||||
ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
_footpathErrorOccured = false;
|
||||
WindowFootpathSetEnabledAndPressedWidgets();
|
||||
break;
|
||||
|
@ -314,7 +314,7 @@ public:
|
|||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
|
||||
_footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL;
|
||||
ToolSet(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
_footpathErrorOccured = false;
|
||||
WindowFootpathSetEnabledAndPressedWidgets();
|
||||
break;
|
||||
|
@ -1381,7 +1381,7 @@ public:
|
|||
void KeyboardShortcutDemolishCurrent()
|
||||
{
|
||||
if (IsWidgetDisabled(WIDX_REMOVE) || widgets[WIDX_REMOVE].type == WindowWidgetType::Empty
|
||||
|| (!gCheatsBuildInPauseMode && game_is_paused()))
|
||||
|| (!gCheatsBuildInPauseMode && GameIsPaused()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -465,7 +465,7 @@ static void WindowGameBottomToolbarDrawParkRating(
|
|||
bar_width = (factor * 114) / 255;
|
||||
GfxFillRectInset(
|
||||
dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, w->colours[1], INSET_RECT_F_30);
|
||||
if (!(colour & BAR_BLINK) || game_is_paused() || (gCurrentRealTimeTicks & 8))
|
||||
if (!(colour & BAR_BLINK) || GameIsPaused() || (gCurrentRealTimeTicks & 8))
|
||||
{
|
||||
if (bar_width > 2)
|
||||
{
|
||||
|
|
|
@ -193,7 +193,7 @@ public:
|
|||
|
||||
void OnClose() override
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number)
|
||||
ToolCancel();
|
||||
|
@ -478,7 +478,7 @@ private:
|
|||
|
||||
void SetPage(int32_t newPage)
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification)
|
||||
ToolCancel();
|
||||
|
@ -1042,7 +1042,7 @@ private:
|
|||
GfxFillRectInset(
|
||||
&dpi, { coords + ScreenCoordsXY{ 61, 1 }, coords + ScreenCoordsXY{ 61 + 121, 9 } }, colours[1], INSET_RECT_F_30);
|
||||
|
||||
if (!blinkFlag || game_is_paused() || (gCurrentRealTimeTicks & 8) == 0)
|
||||
if (!blinkFlag || GameIsPaused() || (gCurrentRealTimeTicks & 8) == 0)
|
||||
{
|
||||
value *= 118;
|
||||
value >>= 8;
|
||||
|
|
|
@ -372,7 +372,7 @@ private:
|
|||
auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK);
|
||||
if (!Platform::EnsureDirectoryExists(destPath.c_str()))
|
||||
{
|
||||
log_error("Unable to create directory '%s'", destPath.c_str());
|
||||
LOG_ERROR("Unable to create directory '%s'", destPath.c_str());
|
||||
ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {});
|
||||
return;
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ private:
|
|||
|
||||
if (File::Exists(destPath))
|
||||
{
|
||||
log_info("%s already exists, prompting user for a different track design name", destPath.c_str());
|
||||
LOG_INFO("%s already exists, prompting user for a different track design name", destPath.c_str());
|
||||
ContextShowError(STR_UNABLE_TO_INSTALL_THIS_TRACK_DESIGN, STR_NONE, {});
|
||||
WindowTextInputRawOpen(
|
||||
this, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME,
|
||||
|
@ -413,12 +413,12 @@ rct_window* WindowInstallTrackOpen(const utf8* path)
|
|||
object_manager_unload_all_objects();
|
||||
if (trackDesign->type == RIDE_TYPE_NULL)
|
||||
{
|
||||
log_error("Failed to load track (ride type null): %s", path);
|
||||
LOG_ERROR("Failed to load track (ride type null): %s", path);
|
||||
return nullptr;
|
||||
}
|
||||
if (object_manager_load_object(&trackDesign->vehicle_object.Entry) == nullptr)
|
||||
{
|
||||
log_error("Failed to load track (vehicle load fail): %s", path);
|
||||
LOG_ERROR("Failed to load track (vehicle load fail): %s", path);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
|
||||
ShowGridlines();
|
||||
ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
|
||||
ShowLandRights();
|
||||
|
||||
|
@ -391,7 +391,7 @@ private:
|
|||
|
||||
bool LandRightsToolIsActive()
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return false;
|
||||
if (gCurrentToolWidget.window_classification != WindowClass::LandRights)
|
||||
return false;
|
||||
|
|
|
@ -482,7 +482,7 @@ static u8string OpenSystemFileBrowser(bool isSave)
|
|||
{
|
||||
// When the given save type was given, Windows still interprets a filename with a dot in its name as a custom
|
||||
// extension, meaning files like "My Coaster v1.2" will not get the .td6 extension by default.
|
||||
if (isSave && get_file_extension_type(outPath) != fileType)
|
||||
if (isSave && GetFileExtensionType(outPath) != fileType)
|
||||
outPath = Path::WithExtension(outPath, extension);
|
||||
}
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ public:
|
|||
{
|
||||
_mapImageData.clear();
|
||||
_mapImageData.shrink_to_fit();
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == classification
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == classification
|
||||
&& gCurrentToolWidget.window_number == number)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -243,7 +243,7 @@ public:
|
|||
break;
|
||||
|
||||
gParkEntranceGhostExists = false;
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
|
||||
ShowGridlines();
|
||||
ShowLandRights();
|
||||
|
@ -815,7 +815,7 @@ public:
|
|||
if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode)
|
||||
{
|
||||
// scenario editor: build park entrance selected, show rotate button
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map
|
||||
&& gCurrentToolWidget.widget_index == WIDX_BUILD_PARK_ENTRANCE)
|
||||
{
|
||||
widgets[WIDX_ROTATE_90].type = WindowWidgetType::FlatBtn;
|
||||
|
@ -825,7 +825,7 @@ public:
|
|||
widgets[WIDX_SET_LAND_RIGHTS].type = WindowWidgetType::FlatBtn;
|
||||
|
||||
// If any tool is active
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map)
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map)
|
||||
{
|
||||
// if not in set land rights mode: show the default scenario editor buttons
|
||||
if (gCurrentToolWidget.widget_index != WIDX_SET_LAND_RIGHTS)
|
||||
|
|
|
@ -71,8 +71,8 @@ void WindowMapTooltipUpdateVisibility()
|
|||
|
||||
// Check for cursor movement
|
||||
_cursorHoldDuration++;
|
||||
if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || (input_test_flag(INPUT_FLAG_5))
|
||||
|| input_get_state() == InputState::ViewportRight)
|
||||
if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || (InputTestFlag(INPUT_FLAG_5))
|
||||
|| InputGetState() == InputState::ViewportRight)
|
||||
_cursorHoldDuration = 0;
|
||||
|
||||
_lastCursor = cursor;
|
||||
|
|
|
@ -241,7 +241,7 @@ public:
|
|||
case RideConstructionState::Front:
|
||||
case RideConstructionState::Back:
|
||||
case RideConstructionState::Selected:
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
&& gCurrentToolWidget.window_classification == WindowClass::RideConstruction)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -311,7 +311,7 @@ private:
|
|||
gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE : ENTRANCE_TYPE_RIDE_EXIT;
|
||||
gRideEntranceExitPlaceRideIndex = rideId;
|
||||
gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
|
||||
RideConstructionInvalidateCurrentTrack();
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ private:
|
|||
|
||||
auto& entry = _entries[_currentDownloadIndex];
|
||||
auto name = String::Trim(std::string(entry.GetName()));
|
||||
log_verbose("Downloading object: [%s]:", name.c_str());
|
||||
LOG_VERBOSE("Downloading object: [%s]:", name.c_str());
|
||||
_currentDownloadIndex++;
|
||||
UpdateProgress({ name, _lastDownloadSource, _currentDownloadIndex, _entries.size() });
|
||||
try
|
||||
|
|
|
@ -1225,7 +1225,7 @@ private:
|
|||
ContextShowError(STR_LANGUAGE_LOAD_FAILED, STR_NONE, {});
|
||||
}
|
||||
// report error to console regardless
|
||||
log_error("Failed to open language file.");
|
||||
LOG_ERROR("Failed to open language file.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -207,7 +207,7 @@ public:
|
|||
|
||||
void OnClose() override
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && classification == gCurrentToolWidget.window_classification
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && classification == gCurrentToolWidget.window_classification
|
||||
&& number == gCurrentToolWidget.window_number)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -1175,7 +1175,7 @@ private:
|
|||
#pragma region Common
|
||||
void SetPage(int32_t newPage)
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number)
|
||||
ToolCancel();
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ private:
|
|||
if (!ToolSet(*this, 0, Tool::WalkDown))
|
||||
{
|
||||
ShowGridlines();
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
SetPatrolAreaToRender(_staffId);
|
||||
GfxInvalidateScreen();
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ private:
|
|||
|
||||
bool PatrolAreaToolIsActive()
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return false;
|
||||
if (gCurrentToolWidget.window_classification != WindowClass::PatrolArea)
|
||||
return false;
|
||||
|
|
|
@ -1204,7 +1204,7 @@ rct_window* WindowRideMainOpen(const Ride& ride)
|
|||
w->ride.view = 0;
|
||||
}
|
||||
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number)
|
||||
{
|
||||
|
@ -1240,7 +1240,7 @@ static rct_window* WindowRideOpenStation(const Ride& ride, StationIndex stationI
|
|||
w->ride.var_482 = -1;
|
||||
}
|
||||
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification
|
||||
&& gCurrentToolWidget.window_number == w->number)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -1343,7 +1343,7 @@ rct_window* WindowRideOpenVehicle(Vehicle* vehicle)
|
|||
{
|
||||
w->Invalidate();
|
||||
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification
|
||||
&& gCurrentToolWidget.window_number == w->number)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -1410,7 +1410,7 @@ static void WindowRideSetPage(rct_window* w, int32_t page)
|
|||
{
|
||||
int32_t listen;
|
||||
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number)
|
||||
ToolCancel();
|
||||
|
||||
|
@ -3770,7 +3770,7 @@ static void WindowRideMaintenanceDrawBar(
|
|||
if (colour & BAR_BLINK)
|
||||
{
|
||||
colour &= ~BAR_BLINK;
|
||||
if (game_is_not_paused() && (gCurrentRealTimeTicks & 8))
|
||||
if (GameIsNotPaused() && (gCurrentRealTimeTicks & 8))
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4271,7 +4271,7 @@ static void WindowRideSetTrackColourScheme(rct_window* w, const ScreenCoordsXY&
|
|||
*/
|
||||
static void WindowRideColourClose(rct_window* w)
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return;
|
||||
|
||||
if (gCurrentToolWidget.window_classification != w->classification)
|
||||
|
@ -6236,7 +6236,7 @@ static void WindowRideGraphsScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
intensityThresholdNegative = -(RIDE_G_FORCES_RED_LATERAL / 8) + LateralGraphHeightOffset;
|
||||
break;
|
||||
default:
|
||||
log_error("Wrong graph type %d", listType);
|
||||
LOG_ERROR("Wrong graph type %d", listType);
|
||||
firstPoint = secondPoint = 0;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -909,7 +909,7 @@ public:
|
|||
case RideConstructionState::Front:
|
||||
case RideConstructionState::Back:
|
||||
case RideConstructionState::Selected:
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
&& gCurrentToolWidget.window_classification == WindowClass::RideConstruction)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -2422,7 +2422,7 @@ private:
|
|||
gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_ENTRANCE;
|
||||
gRideEntranceExitPlaceRideIndex = _currentRideIndex;
|
||||
gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
RideConstructionInvalidateCurrentTrack();
|
||||
if (_rideConstructionState != RideConstructionState::EntranceExit)
|
||||
{
|
||||
|
@ -2448,7 +2448,7 @@ private:
|
|||
gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_EXIT;
|
||||
gRideEntranceExitPlaceRideIndex = _currentRideIndex;
|
||||
gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
RideConstructionInvalidateCurrentTrack();
|
||||
if (_rideConstructionState != RideConstructionState::EntranceExit)
|
||||
{
|
||||
|
@ -3599,7 +3599,7 @@ void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords)
|
|||
if (w != nullptr)
|
||||
{
|
||||
ToolSet(*w, WIDX_CONSTRUCT, Tool::Crosshair);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
_trackPlaceCtrlState = false;
|
||||
_trackPlaceShiftState = false;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ static void WindowSavePromptCallback(int32_t result, const utf8* path)
|
|||
{
|
||||
if (result == MODAL_RESULT_OK)
|
||||
{
|
||||
game_load_or_quit_no_save_prompt();
|
||||
GameLoadOrQuitNoSavePrompt();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ public:
|
|||
switch (widgetIndex)
|
||||
{
|
||||
case WQIDX_OK:
|
||||
game_load_or_quit_no_save_prompt();
|
||||
GameLoadOrQuitNoSavePrompt();
|
||||
break;
|
||||
case WQIDX_CLOSE:
|
||||
case WQIDX_CANCEL:
|
||||
|
@ -164,7 +164,7 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
intent = create_save_game_as_intent();
|
||||
intent = CreateSaveGameAsIntent();
|
||||
}
|
||||
Close();
|
||||
intent->putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast<void*>(WindowSavePromptCallback));
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
break;
|
||||
}
|
||||
case WIDX_DONT_SAVE:
|
||||
game_load_or_quit_no_save_prompt();
|
||||
GameLoadOrQuitNoSavePrompt();
|
||||
return;
|
||||
case WIDX_CLOSE:
|
||||
case WIDX_CANCEL:
|
||||
|
@ -198,7 +198,7 @@ rct_window* WindowSavePromptOpen()
|
|||
// do not show save prompt if we're in the title demo and click on load game
|
||||
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
|
||||
{
|
||||
game_load_or_quit_no_save_prompt();
|
||||
GameLoadOrQuitNoSavePrompt();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ rct_window* WindowSavePromptOpen()
|
|||
|
||||
if (gScreenAge < 3840 && network_get_mode() == NETWORK_MODE_NONE)
|
||||
{
|
||||
game_load_or_quit_no_save_prompt();
|
||||
GameLoadOrQuitNoSavePrompt();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ rct_window* WindowSavePromptOpen()
|
|||
|
||||
if (EnumValue(prompt_mode) >= std::size(window_save_prompt_labels))
|
||||
{
|
||||
log_warning("Invalid save prompt mode %u", prompt_mode);
|
||||
LOG_WARNING("Invalid save prompt mode %u", prompt_mode);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -354,7 +354,7 @@ public:
|
|||
_hoverCounter++;
|
||||
if (_hoverCounter < 8)
|
||||
{
|
||||
if (input_get_state() != InputState::ScrollLeft)
|
||||
if (InputGetState() != InputState::ScrollLeft)
|
||||
{
|
||||
min_height = WINDOW_SCENERY_MIN_HEIGHT;
|
||||
max_height = WINDOW_SCENERY_MIN_HEIGHT;
|
||||
|
@ -379,7 +379,7 @@ public:
|
|||
else
|
||||
{
|
||||
_hoverCounter = 0;
|
||||
if (input_get_state() != InputState::ScrollLeft)
|
||||
if (InputGetState() != InputState::ScrollLeft)
|
||||
{
|
||||
min_height = WINDOW_SCENERY_MIN_HEIGHT;
|
||||
max_height = WINDOW_SCENERY_MIN_HEIGHT;
|
||||
|
|
|
@ -592,7 +592,7 @@ static void ServerListFetchServersCheck(rct_window* w)
|
|||
catch (const std::exception& e)
|
||||
{
|
||||
_statusText = STR_SERVER_LIST_NO_CONNECTION;
|
||||
log_warning("Unable to connect to master server: %s", e.what());
|
||||
LOG_WARNING("Unable to connect to master server: %s", e.what());
|
||||
}
|
||||
_fetchFuture = {};
|
||||
w->Invalidate();
|
||||
|
|
|
@ -281,7 +281,7 @@ private:
|
|||
char _password[33];
|
||||
static void ScenarioSelectCallback(const utf8* path)
|
||||
{
|
||||
game_notify_map_change();
|
||||
GameNotifyMapChange();
|
||||
if (GetContext()->LoadParkFromFile(path, false, true))
|
||||
{
|
||||
network_begin_server(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress);
|
||||
|
@ -292,7 +292,7 @@ private:
|
|||
{
|
||||
if (result == MODAL_RESULT_OK)
|
||||
{
|
||||
game_notify_map_change();
|
||||
GameNotifyMapChange();
|
||||
GetContext()->LoadParkFromFile(path);
|
||||
network_begin_server(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress);
|
||||
}
|
||||
|
|
|
@ -1062,7 +1062,7 @@ private:
|
|||
|
||||
void CancelTools()
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification)
|
||||
ToolCancel();
|
||||
|
|
|
@ -577,7 +577,7 @@ private:
|
|||
|
||||
void CancelTools()
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))
|
||||
{
|
||||
if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number)
|
||||
{
|
||||
|
|
|
@ -57,10 +57,10 @@ static Widget window_title_menu_widgets[] = {
|
|||
|
||||
static void WindowTitleMenuScenarioselectCallback(const utf8* path)
|
||||
{
|
||||
game_notify_map_change();
|
||||
GameNotifyMapChange();
|
||||
OpenRCT2::GetContext()->LoadParkFromFile(path, false, true);
|
||||
game_load_scripts();
|
||||
game_notify_map_changed();
|
||||
GameLoadScripts();
|
||||
GameNotifyMapChanged();
|
||||
}
|
||||
|
||||
static void InvokeCustomToolboxMenuItem(size_t index)
|
||||
|
|
|
@ -65,12 +65,12 @@ public:
|
|||
void OnOpen() override
|
||||
{
|
||||
widgets = window_tooltip_widgets;
|
||||
reset_tooltip_not_shown();
|
||||
ResetTooltipNotShown();
|
||||
}
|
||||
|
||||
void OnUpdate() override
|
||||
{
|
||||
reset_tooltip_not_shown();
|
||||
ResetTooltipNotShown();
|
||||
}
|
||||
|
||||
void OnDraw(rct_drawpixelinfo& dpi) override
|
||||
|
@ -128,8 +128,8 @@ void WindowTooltipReset(const ScreenCoordsXY& screenCoords)
|
|||
gTooltipCursor = screenCoords;
|
||||
gTooltipTimeout = 0;
|
||||
gTooltipWidget.window_classification = WindowClass::Null;
|
||||
input_set_state(InputState::Normal);
|
||||
input_set_flag(INPUT_FLAG_4, false);
|
||||
InputSetState(InputState::Normal);
|
||||
InputSetFlag(INPUT_FLAG_4, false);
|
||||
}
|
||||
|
||||
void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords)
|
||||
|
|
|
@ -384,7 +384,7 @@ static void WindowTopToolbarMouseup(rct_window* w, WidgetIndex widgetIndex)
|
|||
case WIDX_SCENERY:
|
||||
if (!ToolSet(*w, WIDX_SCENERY, Tool::Arrow))
|
||||
{
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
ContextOpenWindow(WindowClass::Scenery);
|
||||
}
|
||||
break;
|
||||
|
@ -576,7 +576,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int
|
|||
}
|
||||
case DDIDX_SAVE_GAME:
|
||||
ToolCancel();
|
||||
save_game();
|
||||
SaveGame();
|
||||
break;
|
||||
case DDIDX_SAVE_GAME_AS:
|
||||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
|
@ -589,7 +589,7 @@ static void WindowTopToolbarDropdown(rct_window* w, WidgetIndex widgetIndex, int
|
|||
else
|
||||
{
|
||||
ToolCancel();
|
||||
save_game_as();
|
||||
SaveGameAs();
|
||||
}
|
||||
break;
|
||||
case DDIDX_ABOUT:
|
||||
|
@ -848,7 +848,7 @@ static void WindowTopToolbarInvalidate(rct_window* w)
|
|||
const auto* mainWindow = WindowGetMain();
|
||||
if (mainWindow == nullptr || mainWindow->viewport == nullptr)
|
||||
{
|
||||
log_error("mainWindow or mainWindow->viewport is null!");
|
||||
LOG_ERROR("mainWindow or mainWindow->viewport is null!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3801,7 +3801,7 @@ static void ToggleFootpathWindow()
|
|||
*/
|
||||
static void ToggleLandWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
|
||||
{
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
|
||||
&& gCurrentToolWidget.widget_index == WIDX_LAND)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -3811,7 +3811,7 @@ static void ToggleLandWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
|
|||
_landToolBlocked = false;
|
||||
ShowGridlines();
|
||||
ToolSet(*topToolbar, widgetIndex, Tool::DigDown);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
ContextOpenWindow(WindowClass::Land);
|
||||
}
|
||||
}
|
||||
|
@ -3822,7 +3822,7 @@ static void ToggleLandWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
|
|||
*/
|
||||
static void ToggleClearSceneryWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
|
||||
{
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
|
||||
&& gCurrentToolWidget.widget_index == WIDX_CLEAR_SCENERY))
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -3831,7 +3831,7 @@ static void ToggleClearSceneryWindow(rct_window* topToolbar, WidgetIndex widgetI
|
|||
{
|
||||
ShowGridlines();
|
||||
ToolSet(*topToolbar, widgetIndex, Tool::Crosshair);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
ContextOpenWindow(WindowClass::ClearScenery);
|
||||
}
|
||||
}
|
||||
|
@ -3842,7 +3842,7 @@ static void ToggleClearSceneryWindow(rct_window* topToolbar, WidgetIndex widgetI
|
|||
*/
|
||||
static void ToggleWaterWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
|
||||
{
|
||||
if ((input_test_flag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
|
||||
if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar
|
||||
&& gCurrentToolWidget.widget_index == WIDX_WATER)
|
||||
{
|
||||
ToolCancel();
|
||||
|
@ -3852,7 +3852,7 @@ static void ToggleWaterWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
|
|||
_landToolBlocked = false;
|
||||
ShowGridlines();
|
||||
ToolSet(*topToolbar, widgetIndex, Tool::WaterDown);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
ContextOpenWindow(WindowClass::Water);
|
||||
}
|
||||
}
|
||||
|
@ -3863,7 +3863,7 @@ static void ToggleWaterWindow(rct_window* topToolbar, WidgetIndex widgetIndex)
|
|||
*/
|
||||
bool LandToolIsActive()
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return false;
|
||||
if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar)
|
||||
return false;
|
||||
|
@ -3878,7 +3878,7 @@ bool LandToolIsActive()
|
|||
*/
|
||||
bool ClearSceneryToolIsActive()
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return false;
|
||||
if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar)
|
||||
return false;
|
||||
|
@ -3893,7 +3893,7 @@ bool ClearSceneryToolIsActive()
|
|||
*/
|
||||
bool WaterToolIsActive()
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return false;
|
||||
if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar)
|
||||
return false;
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
widgets = window_track_place_widgets;
|
||||
WindowInitScrollWidgets(*this);
|
||||
ToolSet(*this, WIDX_PRICE, Tool::Crosshair);
|
||||
input_set_flag(INPUT_FLAG_6, true);
|
||||
InputSetFlag(INPUT_FLAG_6, true);
|
||||
WindowPushOthersRight(*this);
|
||||
ShowGridlines();
|
||||
_miniPreview.resize(TRACK_MINI_PREVIEW_SIZE);
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
|
||||
void OnUpdate() override
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (gCurrentToolWidget.window_classification != WindowClass::TrackDesignPlace)
|
||||
Close();
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public:
|
|||
mapZ = GetBaseZ(mapCoords);
|
||||
CoordsXYZD trackLoc = { mapCoords, mapZ, _currentTrackPieceDirection };
|
||||
|
||||
if (game_is_not_paused() || gCheatsBuildInPauseMode)
|
||||
if (GameIsNotPaused() || gCheatsBuildInPauseMode)
|
||||
{
|
||||
ClearProvisional();
|
||||
auto res = FindValidTrackDesignPlaceHeight(trackLoc, GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST);
|
||||
|
|
|
@ -388,7 +388,7 @@ private:
|
|||
|
||||
bool IsActive()
|
||||
{
|
||||
if (!(input_test_flag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)))
|
||||
return false;
|
||||
if (gCurrentToolWidget.window_classification != WindowClass::ViewClipping)
|
||||
return false;
|
||||
|
|
|
@ -127,7 +127,7 @@ void AssetPackManager::ClearAssetPacks()
|
|||
void AssetPackManager::AddAssetPack(const fs::path& path)
|
||||
{
|
||||
auto szPath = path.u8string();
|
||||
log_verbose("Scanning asset pack: %s", szPath.c_str());
|
||||
LOG_VERBOSE("Scanning asset pack: %s", szPath.c_str());
|
||||
try
|
||||
{
|
||||
auto ap = std::make_unique<AssetPack>(path);
|
||||
|
|
|
@ -263,7 +263,7 @@ static std::string PopStr(std::ostringstream& oss)
|
|||
return str;
|
||||
}
|
||||
|
||||
int32_t cmdline_for_sprite(const char** argv, int32_t argc)
|
||||
int32_t CmdLineForSprite(const char** argv, int32_t argc)
|
||||
{
|
||||
gOpenRCT2Headless = true;
|
||||
if (argc == 0)
|
||||
|
@ -603,7 +603,7 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc)
|
|||
|
||||
if (!spriteFile.Save(spriteFilePath))
|
||||
{
|
||||
log_error("Could not save sprite file, cancelling.");
|
||||
LOG_ERROR("Could not save sprite file, cancelling.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,5 +12,5 @@
|
|||
#include "common.h"
|
||||
#include "drawing/ImageImporter.h"
|
||||
|
||||
int32_t cmdline_for_sprite(const char** argv, int32_t argc);
|
||||
int32_t CmdLineForSprite(const char** argv, int32_t argc);
|
||||
extern OpenRCT2::Drawing::ImageImporter::ImportMode gSpriteMode;
|
||||
|
|
|
@ -353,14 +353,14 @@ namespace OpenRCT2
|
|||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
log_error("Failed to open configured language: %s", e.what());
|
||||
LOG_ERROR("Failed to open configured language: %s", e.what());
|
||||
try
|
||||
{
|
||||
_localisationService->OpenLanguage(LANGUAGE_ENGLISH_UK);
|
||||
}
|
||||
catch (const std::exception& eFallback)
|
||||
{
|
||||
log_fatal("Failed to open fallback language: %s", eFallback.what());
|
||||
LOG_FATAL("Failed to open fallback language: %s", eFallback.what());
|
||||
auto uiContext = GetContext()->GetUiContext();
|
||||
uiContext->ShowMessageBox("Failed to load language file!\nYour installation may be damaged.");
|
||||
return false;
|
||||
|
@ -369,7 +369,7 @@ namespace OpenRCT2
|
|||
|
||||
// TODO add configuration option to allow multiple instances
|
||||
// if (!gOpenRCT2Headless && !Platform::LockSingleInstance()) {
|
||||
// log_fatal("OpenRCT2 is already running.");
|
||||
// LOG_FATAL("OpenRCT2 is already running.");
|
||||
// return false;
|
||||
// } //This comment was relocated so it would stay where it was in relation to the following lines of code.
|
||||
|
||||
|
@ -473,7 +473,7 @@ namespace OpenRCT2
|
|||
LightFXInit();
|
||||
}
|
||||
|
||||
input_reset_place_obj_modifier();
|
||||
InputResetPlaceObjModifier();
|
||||
ViewportInitAll();
|
||||
|
||||
_gameState = std::make_unique<GameState>();
|
||||
|
@ -503,12 +503,12 @@ namespace OpenRCT2
|
|||
if (_drawingEngineType == DrawingEngine::Software)
|
||||
{
|
||||
_drawingEngineType = DrawingEngine::None;
|
||||
log_fatal("Unable to create a drawing engine.");
|
||||
LOG_FATAL("Unable to create a drawing engine.");
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error("Unable to create drawing engine. Falling back to software.");
|
||||
LOG_ERROR("Unable to create drawing engine. Falling back to software.");
|
||||
|
||||
// Fallback to software
|
||||
gConfigGeneral.DrawingEngine = DrawingEngine::Software;
|
||||
|
@ -529,14 +529,14 @@ namespace OpenRCT2
|
|||
if (_drawingEngineType == DrawingEngine::Software)
|
||||
{
|
||||
_drawingEngineType = DrawingEngine::None;
|
||||
log_error(ex.what());
|
||||
log_fatal("Unable to initialise a drawing engine.");
|
||||
LOG_ERROR(ex.what());
|
||||
LOG_FATAL("Unable to initialise a drawing engine.");
|
||||
exit(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error(ex.what());
|
||||
log_error("Unable to initialise drawing engine. Falling back to software.");
|
||||
LOG_ERROR(ex.what());
|
||||
LOG_ERROR("Unable to initialise drawing engine. Falling back to software.");
|
||||
|
||||
// Fallback to software
|
||||
gConfigGeneral.DrawingEngine = DrawingEngine::Software;
|
||||
|
@ -557,7 +557,7 @@ namespace OpenRCT2
|
|||
bool LoadParkFromFile(
|
||||
const std::string& path, bool loadTitleScreenOnFail = false, bool asScenario = false) final override
|
||||
{
|
||||
log_verbose("Context::LoadParkFromFile(%s)", path.c_str());
|
||||
LOG_VERBOSE("Context::LoadParkFromFile(%s)", path.c_str());
|
||||
|
||||
struct CrashAdditionalFileRegistration
|
||||
{
|
||||
|
@ -645,13 +645,13 @@ namespace OpenRCT2
|
|||
// so reload the title screen if that happens.
|
||||
loadTitleScreenFirstOnFail = true;
|
||||
|
||||
game_unload_scripts();
|
||||
GameUnloadScripts();
|
||||
_objectManager->LoadObjects(result.RequiredObjects);
|
||||
parkImporter->Import();
|
||||
gScenarioSavePath = path;
|
||||
gCurrentLoadedPath = path;
|
||||
gFirstTimeSaving = true;
|
||||
game_fix_save_vars();
|
||||
GameFixSaveVars();
|
||||
MapAnimationAutoCreate();
|
||||
EntityTweener::Get().Reset();
|
||||
gScreenAge = 0;
|
||||
|
@ -668,7 +668,7 @@ namespace OpenRCT2
|
|||
_network.Close();
|
||||
}
|
||||
#endif
|
||||
game_load_init();
|
||||
GameLoadInit();
|
||||
#ifndef DISABLE_NETWORK
|
||||
if (_network.GetMode() == NETWORK_MODE_SERVER)
|
||||
{
|
||||
|
@ -703,7 +703,7 @@ namespace OpenRCT2
|
|||
#ifdef USE_BREAKPAD
|
||||
if (_network.GetMode() == NETWORK_MODE_NONE)
|
||||
{
|
||||
start_silent_record();
|
||||
StartSilentRecord();
|
||||
}
|
||||
#endif
|
||||
if (result.SemiCompatibleVersion)
|
||||
|
@ -826,7 +826,7 @@ namespace OpenRCT2
|
|||
// Check install directory
|
||||
if (gConfigGeneral.RCT2Path.empty() || !Platform::OriginalGameDataExists(gConfigGeneral.RCT2Path))
|
||||
{
|
||||
log_verbose(
|
||||
LOG_VERBOSE(
|
||||
"install directory does not exist or invalid directory selected, %s", gConfigGeneral.RCT2Path.c_str());
|
||||
if (!ConfigFindOrBrowseInstallDirectory())
|
||||
{
|
||||
|
@ -865,7 +865,7 @@ namespace OpenRCT2
|
|||
if (!_versionCheckFuture.valid())
|
||||
{
|
||||
_versionCheckFuture = std::async(std::launch::async, [this] {
|
||||
_newVersionInfo = get_latest_version();
|
||||
_newVersionInfo = GetLatestVersion();
|
||||
if (!String::StartsWith(gVersionInfoTag, _newVersionInfo.tag))
|
||||
{
|
||||
_hasNewVersionInfo = true;
|
||||
|
@ -969,8 +969,8 @@ namespace OpenRCT2
|
|||
else
|
||||
#endif // DISABLE_NETWORK
|
||||
{
|
||||
game_load_scripts();
|
||||
game_notify_map_changed();
|
||||
GameLoadScripts();
|
||||
GameNotifyMapChanged();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1030,7 +1030,7 @@ namespace OpenRCT2
|
|||
{
|
||||
PROFILED_FUNCTION();
|
||||
|
||||
log_verbose("begin openrct2 loop");
|
||||
LOG_VERBOSE("begin openrct2 loop");
|
||||
_finished = false;
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
|
@ -1047,7 +1047,7 @@ namespace OpenRCT2
|
|||
},
|
||||
this, 0, 1);
|
||||
#endif // __EMSCRIPTEN__
|
||||
log_verbose("finish openrct2 loop");
|
||||
LOG_VERBOSE("finish openrct2 loop");
|
||||
}
|
||||
|
||||
void RunFrame()
|
||||
|
@ -1178,7 +1178,7 @@ namespace OpenRCT2
|
|||
// this to be 40Hz (25 ms). Refactor this once the UI is decoupled.
|
||||
gCurrentDeltaTime = static_cast<uint32_t>(GAME_UPDATE_TIME_MS * 1000.0f);
|
||||
|
||||
if (game_is_not_paused())
|
||||
if (GameIsNotPaused())
|
||||
{
|
||||
gPaletteEffectFrame += gCurrentDeltaTime;
|
||||
}
|
||||
|
@ -1187,7 +1187,7 @@ namespace OpenRCT2
|
|||
|
||||
if (gIntroState != IntroState::None)
|
||||
{
|
||||
intro_update();
|
||||
IntroUpdate();
|
||||
}
|
||||
else if ((gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) && !gOpenRCT2Headless)
|
||||
{
|
||||
|
@ -1242,7 +1242,7 @@ namespace OpenRCT2
|
|||
{
|
||||
auto path = _env->GetDirectoryPath(dirBase, dirId);
|
||||
if (!Platform::EnsureDirectoryExists(path.c_str()))
|
||||
log_error("Unable to create directory '%s'.", path.c_str());
|
||||
LOG_ERROR("Unable to create directory '%s'.", path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1264,7 +1264,7 @@ namespace OpenRCT2
|
|||
|
||||
void CopyOriginalUserFilesOver(const std::string& srcRoot, const std::string& dstRoot, const std::string& pattern)
|
||||
{
|
||||
log_verbose("CopyOriginalUserFilesOver('%s', '%s', '%s')", srcRoot.c_str(), dstRoot.c_str(), pattern.c_str());
|
||||
LOG_VERBOSE("CopyOriginalUserFilesOver('%s', '%s', '%s')", srcRoot.c_str(), dstRoot.c_str(), pattern.c_str());
|
||||
|
||||
auto scanPattern = Path::Combine(srcRoot, pattern);
|
||||
auto scanner = Path::ScanDirectory(scanPattern, true);
|
||||
|
@ -1377,12 +1377,12 @@ bool ContextLoadParkFromStream(void* stream)
|
|||
return GetContext()->LoadParkFromStream(static_cast<IStream*>(stream), "");
|
||||
}
|
||||
|
||||
void openrct2_write_full_version_info(utf8* buffer, size_t bufferSize)
|
||||
void OpenRCT2WriteFullVersionInfo(utf8* buffer, size_t bufferSize)
|
||||
{
|
||||
String::Set(buffer, bufferSize, gVersionInfoFull);
|
||||
}
|
||||
|
||||
void openrct2_finish()
|
||||
void OpenRCT2Finish()
|
||||
{
|
||||
GetContext()->Finish();
|
||||
}
|
||||
|
@ -1565,7 +1565,7 @@ bool ContextOpenCommonFileDialog(utf8* outFilename, OpenRCT2::Ui::FileDialogDesc
|
|||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
log_error(ex.what());
|
||||
LOG_ERROR(ex.what());
|
||||
outFilename[0] = '\0';
|
||||
return false;
|
||||
}
|
||||
|
@ -1579,7 +1579,7 @@ u8string ContextOpenCommonFileDialog(OpenRCT2::Ui::FileDialogDesc& desc)
|
|||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
log_error(ex.what());
|
||||
LOG_ERROR(ex.what());
|
||||
return u8string{};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ int _android_log_priority[static_cast<uint8_t>(DiagnosticLevel::Count)] = {
|
|||
ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO,
|
||||
};
|
||||
|
||||
void diagnostic_log(DiagnosticLevel diagnosticLevel, const char* format, ...)
|
||||
void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
@ -54,7 +54,7 @@ void diagnostic_log(DiagnosticLevel diagnosticLevel, const char* format, ...)
|
|||
va_end(args);
|
||||
}
|
||||
|
||||
void diagnostic_log_with_location(
|
||||
void DiagnosticLogWithLocation(
|
||||
DiagnosticLevel diagnosticLevel, const char* file, const char* function, int32_t line, const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
@ -76,7 +76,7 @@ static constexpr const char* _level_strings[] = {
|
|||
"FATAL", "ERROR", "WARNING", "VERBOSE", "INFO",
|
||||
};
|
||||
|
||||
static void diagnostic_print(DiagnosticLevel level, const std::string& prefix, const std::string& msg)
|
||||
static void DiagnosticPrint(DiagnosticLevel level, const std::string& prefix, const std::string& msg)
|
||||
{
|
||||
auto stream = diagnostic_get_stream(level);
|
||||
if (stream == stdout)
|
||||
|
@ -85,7 +85,7 @@ static void diagnostic_print(DiagnosticLevel level, const std::string& prefix, c
|
|||
Console::Error::WriteLine("%s%s", prefix.c_str(), msg.c_str());
|
||||
}
|
||||
|
||||
void diagnostic_log(DiagnosticLevel diagnosticLevel, const char* format, ...)
|
||||
void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
if (_log_levels[static_cast<uint8_t>(diagnosticLevel)])
|
||||
|
@ -98,11 +98,11 @@ void diagnostic_log(DiagnosticLevel diagnosticLevel, const char* format, ...)
|
|||
auto msg = String::Format_VA(format, args);
|
||||
va_end(args);
|
||||
|
||||
diagnostic_print(diagnosticLevel, prefix, msg);
|
||||
DiagnosticPrint(diagnosticLevel, prefix, msg);
|
||||
}
|
||||
}
|
||||
|
||||
void diagnostic_log_with_location(
|
||||
void DiagnosticLogWithLocation(
|
||||
DiagnosticLevel diagnosticLevel, const char* file, const char* function, int32_t line, const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
@ -125,7 +125,7 @@ void diagnostic_log_with_location(
|
|||
auto msg = String::Format_VA(format, args);
|
||||
va_end(args);
|
||||
|
||||
diagnostic_print(diagnosticLevel, prefix, msg);
|
||||
DiagnosticPrint(diagnosticLevel, prefix, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,20 +70,20 @@ enum class DiagnosticLevel
|
|||
|
||||
extern bool _log_levels[static_cast<uint8_t>(DiagnosticLevel::Count)];
|
||||
|
||||
void diagnostic_log(DiagnosticLevel diagnosticLevel, const char* format, ...);
|
||||
void diagnostic_log_with_location(
|
||||
void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...);
|
||||
void DiagnosticLogWithLocation(
|
||||
DiagnosticLevel diagnosticLevel, const char* file, const char* function, int32_t line, const char* format, ...);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# define diagnostic_log_macro(level, format, ...) \
|
||||
diagnostic_log_with_location(level, __FILE__, __FUNCTION__, __LINE__, format, ##__VA_ARGS__)
|
||||
# define DIAGNOSTIC_LOG_MACRO(level, format, ...) \
|
||||
DiagnosticLogWithLocation(level, __FILE__, __FUNCTION__, __LINE__, format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define diagnostic_log_macro(level, format, ...) \
|
||||
diagnostic_log_with_location(level, __FILE__, __func__, __LINE__, format, ##__VA_ARGS__)
|
||||
# define DIAGNOSTIC_LOG_MACRO(level, format, ...) \
|
||||
DiagnosticLogWithLocation(level, __FILE__, __func__, __LINE__, format, ##__VA_ARGS__)
|
||||
#endif // _MSC_VER
|
||||
|
||||
#define log_fatal(format, ...) diagnostic_log_macro(DiagnosticLevel::Fatal, format, ##__VA_ARGS__)
|
||||
#define log_error(format, ...) diagnostic_log_macro(DiagnosticLevel::Error, format, ##__VA_ARGS__)
|
||||
#define log_warning(format, ...) diagnostic_log_macro(DiagnosticLevel::Warning, format, ##__VA_ARGS__)
|
||||
#define log_verbose(format, ...) diagnostic_log(DiagnosticLevel::Verbose, format, ##__VA_ARGS__)
|
||||
#define log_info(format, ...) diagnostic_log_macro(DiagnosticLevel::Information, format, ##__VA_ARGS__)
|
||||
#define LOG_FATAL(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Fatal, format, ##__VA_ARGS__)
|
||||
#define LOG_ERROR(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Error, format, ##__VA_ARGS__)
|
||||
#define LOG_WARNING(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Warning, format, ##__VA_ARGS__)
|
||||
#define LOG_VERBOSE(format, ...) DiagnosticLog(DiagnosticLevel::Verbose, format, ##__VA_ARGS__)
|
||||
#define LOG_INFO(format, ...) DIAGNOSTIC_LOG_MACRO(DiagnosticLevel::Information, format, ##__VA_ARGS__)
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace Editor
|
|||
static bool ReadPark(const char* path);
|
||||
static void ClearMapForEditing(bool fromSave);
|
||||
|
||||
static void object_list_load()
|
||||
static void ObjectListLoad()
|
||||
{
|
||||
auto* context = GetContext();
|
||||
|
||||
|
@ -104,7 +104,7 @@ namespace Editor
|
|||
void Load()
|
||||
{
|
||||
OpenRCT2::Audio::StopAll();
|
||||
object_list_load();
|
||||
ObjectListLoad();
|
||||
OpenRCT2::GetContext()->GetGameState()->InitAll(DEFAULT_MAP_SIZE);
|
||||
gScreenFlags = SCREEN_FLAGS_SCENARIO_EDITOR;
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
|
@ -165,7 +165,7 @@ namespace Editor
|
|||
gScreenAge = 0;
|
||||
|
||||
object_manager_unload_all_objects();
|
||||
object_list_load();
|
||||
ObjectListLoad();
|
||||
OpenRCT2::GetContext()->GetGameState()->InitAll(DEFAULT_MAP_SIZE);
|
||||
SetAllLandOwned();
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
|
@ -186,7 +186,7 @@ namespace Editor
|
|||
gScreenAge = 0;
|
||||
|
||||
object_manager_unload_all_objects();
|
||||
object_list_load();
|
||||
ObjectListLoad();
|
||||
OpenRCT2::GetContext()->GetGameState()->InitAll(DEFAULT_MAP_SIZE);
|
||||
SetAllLandOwned();
|
||||
gEditorStep = EditorStep::ObjectSelection;
|
||||
|
@ -223,7 +223,7 @@ namespace Editor
|
|||
// after we have loaded a new park.
|
||||
WindowCloseAll();
|
||||
|
||||
auto extension = get_file_extension_type(path);
|
||||
auto extension = GetFileExtensionType(path);
|
||||
switch (extension)
|
||||
{
|
||||
case FileExtension::SC6:
|
||||
|
@ -417,7 +417,7 @@ namespace Editor
|
|||
auto windowManager = GetContext()->GetUiContext()->GetWindowManager();
|
||||
windowManager->SetMainView(gSavedView, gSavedViewZoom, gSavedViewRotation);
|
||||
|
||||
reset_all_sprite_quadrant_placements();
|
||||
ResetAllSpriteQuadrantPlacements();
|
||||
ScenerySetDefaultPlacementConfiguration();
|
||||
|
||||
windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_NEW_RIDES));
|
||||
|
@ -438,46 +438,46 @@ namespace Editor
|
|||
|
||||
if (!isTrackDesignerManager)
|
||||
{
|
||||
if (!editor_check_object_group_at_least_one_surface_selected(false))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSurfaceSelected(false))
|
||||
{
|
||||
return { ObjectType::FootpathSurface, STR_AT_LEAST_ONE_FOOTPATH_NON_QUEUE_SURFACE_OBJECT_MUST_BE_SELECTED };
|
||||
}
|
||||
if (!editor_check_object_group_at_least_one_surface_selected(true))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSurfaceSelected(true))
|
||||
{
|
||||
return { ObjectType::FootpathSurface, STR_AT_LEAST_ONE_FOOTPATH_QUEUE_SURFACE_OBJECT_MUST_BE_SELECTED };
|
||||
}
|
||||
if (!editor_check_object_group_at_least_one_selected(ObjectType::FootpathRailings))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSelected(ObjectType::FootpathRailings))
|
||||
{
|
||||
return { ObjectType::FootpathRailings, STR_AT_LEAST_ONE_FOOTPATH_RAILING_OBJECT_MUST_BE_SELECTED };
|
||||
}
|
||||
}
|
||||
|
||||
if (!editor_check_object_group_at_least_one_selected(ObjectType::Ride))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSelected(ObjectType::Ride))
|
||||
{
|
||||
return { ObjectType::Ride, STR_AT_LEAST_ONE_RIDE_OBJECT_MUST_BE_SELECTED };
|
||||
}
|
||||
if (!editor_check_object_group_at_least_one_selected(ObjectType::Station))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSelected(ObjectType::Station))
|
||||
{
|
||||
return { ObjectType::Station, STR_AT_LEAST_ONE_STATION_OBJECT_MUST_BE_SELECTED };
|
||||
}
|
||||
|
||||
if (!editor_check_object_group_at_least_one_selected(ObjectType::TerrainSurface))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSelected(ObjectType::TerrainSurface))
|
||||
{
|
||||
return { ObjectType::TerrainSurface, STR_AT_LEAST_ONE_TERRAIN_SURFACE_OBJECT_MUST_BE_SELECTED };
|
||||
}
|
||||
if (!editor_check_object_group_at_least_one_selected(ObjectType::TerrainEdge))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSelected(ObjectType::TerrainEdge))
|
||||
{
|
||||
return { ObjectType::TerrainEdge, STR_AT_LEAST_ONE_TERRAIN_EDGE_OBJECT_MUST_BE_SELECTED };
|
||||
}
|
||||
|
||||
if (!isTrackDesignerManager)
|
||||
{
|
||||
if (!editor_check_object_group_at_least_one_selected(ObjectType::ParkEntrance))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSelected(ObjectType::ParkEntrance))
|
||||
{
|
||||
return { ObjectType::ParkEntrance, STR_PARK_ENTRANCE_TYPE_MUST_BE_SELECTED };
|
||||
}
|
||||
|
||||
if (!editor_check_object_group_at_least_one_selected(ObjectType::Water))
|
||||
if (!EditorCheckObjectGroupAtLeastOneSelected(ObjectType::Water))
|
||||
{
|
||||
return { ObjectType::Water, STR_WATER_TYPE_MUST_BE_SELECTED };
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ namespace Editor
|
|||
}
|
||||
} // namespace Editor
|
||||
|
||||
void editor_open_windows_for_current_step()
|
||||
void EditorOpenWindowsForCurrentStep()
|
||||
{
|
||||
Editor::OpenWindowsForCurrentStep();
|
||||
}
|
||||
|
|
|
@ -47,4 +47,4 @@ enum class EditorStep : uint8_t
|
|||
|
||||
extern EditorStep gEditorStep;
|
||||
|
||||
void editor_open_windows_for_current_step();
|
||||
void EditorOpenWindowsForCurrentStep();
|
||||
|
|
|
@ -38,10 +38,10 @@ std::vector<uint8_t> _objectSelectionFlags;
|
|||
int32_t _numSelectedObjectsForType[EnumValue(ObjectType::Count)];
|
||||
static int32_t _numAvailableObjectsForType[EnumValue(ObjectType::Count)];
|
||||
|
||||
static void setup_in_use_selection_flags();
|
||||
static void setup_track_designer_objects();
|
||||
static void setup_track_manager_objects();
|
||||
static void window_editor_object_selection_select_default_objects();
|
||||
static void SetupInUseSelectionFlags();
|
||||
static void SetupTrackDesignerObjects();
|
||||
static void SetupTrackManagerObjects();
|
||||
static void WindowEditorObjectSelectionSelectDefaultObjects();
|
||||
static void SelectDesignerObjects();
|
||||
static void ReplaceSelectedWaterPalette(const ObjectRepositoryItem* item);
|
||||
|
||||
|
@ -53,7 +53,7 @@ static void ReplaceSelectedWaterPalette(const ObjectRepositoryItem* item);
|
|||
static constexpr ResultWithMessage ObjectSelectionError(bool isMasterObject, StringId message)
|
||||
{
|
||||
if (!isMasterObject)
|
||||
reset_selected_object_count_and_size();
|
||||
ResetSelectedObjectCountAndSize();
|
||||
|
||||
return { false, message };
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ static constexpr ResultWithMessage ObjectSelectionError(bool isMasterObject, Str
|
|||
*
|
||||
* rct2: 0x006ABCD1
|
||||
*/
|
||||
static void setup_track_manager_objects()
|
||||
static void SetupTrackManagerObjects()
|
||||
{
|
||||
int32_t numObjects = static_cast<int32_t>(object_repository_get_items_count());
|
||||
const ObjectRepositoryItem* items = object_repository_get_items();
|
||||
|
@ -90,7 +90,7 @@ static void setup_track_manager_objects()
|
|||
*
|
||||
* rct2: 0x006ABC1E
|
||||
*/
|
||||
static void setup_track_designer_objects()
|
||||
static void SetupTrackDesignerObjects()
|
||||
{
|
||||
int32_t numObjects = static_cast<int32_t>(object_repository_get_items_count());
|
||||
const ObjectRepositoryItem* items = object_repository_get_items();
|
||||
|
@ -122,7 +122,7 @@ static void setup_track_designer_objects()
|
|||
*
|
||||
* rct2: 0x006AA82B
|
||||
*/
|
||||
void setup_in_use_selection_flags()
|
||||
void SetupInUseSelectionFlags()
|
||||
{
|
||||
auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||
|
||||
|
@ -298,34 +298,34 @@ void sub_6AB211()
|
|||
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
{
|
||||
setup_track_designer_objects();
|
||||
SetupTrackDesignerObjects();
|
||||
}
|
||||
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)
|
||||
{
|
||||
setup_track_manager_objects();
|
||||
SetupTrackManagerObjects();
|
||||
}
|
||||
|
||||
setup_in_use_selection_flags();
|
||||
reset_selected_object_count_and_size();
|
||||
SetupInUseSelectionFlags();
|
||||
ResetSelectedObjectCountAndSize();
|
||||
|
||||
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)))
|
||||
{
|
||||
// To prevent it breaking in scenario mode.
|
||||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
window_editor_object_selection_select_default_objects();
|
||||
WindowEditorObjectSelectionSelectDefaultObjects();
|
||||
}
|
||||
}
|
||||
|
||||
reset_selected_object_count_and_size();
|
||||
ResetSelectedObjectCountAndSize();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006AB316
|
||||
*/
|
||||
void editor_object_flags_free()
|
||||
void EditorObjectFlagsFree()
|
||||
{
|
||||
_objectSelectionFlags.clear();
|
||||
_objectSelectionFlags.shrink_to_fit();
|
||||
|
@ -335,7 +335,7 @@ void editor_object_flags_free()
|
|||
*
|
||||
* rct2: 0x00685791
|
||||
*/
|
||||
static void remove_selected_objects_from_research(const ObjectEntryDescriptor& descriptor)
|
||||
static void RemoveSelectedObjectsFromResearch(const ObjectEntryDescriptor& descriptor)
|
||||
{
|
||||
auto& objManager = OpenRCT2::GetContext()->GetObjectManager();
|
||||
auto obj = objManager.GetLoadedObject(descriptor);
|
||||
|
@ -376,7 +376,7 @@ static void remove_selected_objects_from_research(const ObjectEntryDescriptor& d
|
|||
*
|
||||
* rct2: 0x006ABB66
|
||||
*/
|
||||
void unload_unselected_objects()
|
||||
void UnloadUnselectedObjects()
|
||||
{
|
||||
auto numItems = static_cast<int32_t>(object_repository_get_items_count());
|
||||
const auto* items = object_repository_get_items();
|
||||
|
@ -389,7 +389,7 @@ void unload_unselected_objects()
|
|||
auto descriptor = ObjectEntryDescriptor(items[i]);
|
||||
if (!IsIntransientObjectType(items[i].Type))
|
||||
{
|
||||
remove_selected_objects_from_research(descriptor);
|
||||
RemoveSelectedObjectsFromResearch(descriptor);
|
||||
objectsToUnload.push_back(descriptor);
|
||||
}
|
||||
}
|
||||
|
@ -401,13 +401,13 @@ void unload_unselected_objects()
|
|||
*
|
||||
* rct2: 0x006AA805
|
||||
*/
|
||||
static void window_editor_object_selection_select_default_objects()
|
||||
static void WindowEditorObjectSelectionSelectDefaultObjects()
|
||||
{
|
||||
if (_numSelectedObjectsForType[0] == 0)
|
||||
{
|
||||
for (auto defaultSelectedObject : DefaultSelectedObjects)
|
||||
{
|
||||
window_editor_object_selection_select_object(
|
||||
WindowEditorObjectSelectionSelectObject(
|
||||
0,
|
||||
INPUT_FLAG_EDITOR_OBJECT_SELECT | INPUT_FLAG_EDITOR_OBJECT_1
|
||||
| INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP,
|
||||
|
@ -422,7 +422,7 @@ static void SelectDesignerObjects()
|
|||
{
|
||||
for (auto designerSelectedObject : DesignerSelectedObjects)
|
||||
{
|
||||
window_editor_object_selection_select_object(
|
||||
WindowEditorObjectSelectionSelectObject(
|
||||
0,
|
||||
INPUT_FLAG_EDITOR_OBJECT_SELECT | INPUT_FLAG_EDITOR_OBJECT_1
|
||||
| INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP,
|
||||
|
@ -452,7 +452,7 @@ static void ReplaceSelectedWaterPalette(const ObjectRepositoryItem* item)
|
|||
}
|
||||
else
|
||||
{
|
||||
log_error("Failed to load selected palette %s", std::string(newPaletteEntry.GetName()).c_str());
|
||||
LOG_ERROR("Failed to load selected palette %s", std::string(newPaletteEntry.GetName()).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -460,7 +460,7 @@ static void ReplaceSelectedWaterPalette(const ObjectRepositoryItem* item)
|
|||
*
|
||||
* rct2: 0x006AA770
|
||||
*/
|
||||
void reset_selected_object_count_and_size()
|
||||
void ResetSelectedObjectCountAndSize()
|
||||
{
|
||||
for (auto& objectType : _numSelectedObjectsForType)
|
||||
{
|
||||
|
@ -479,7 +479,7 @@ void reset_selected_object_count_and_size()
|
|||
}
|
||||
}
|
||||
|
||||
void finish_object_selection()
|
||||
void FinishObjectSelection()
|
||||
{
|
||||
if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)
|
||||
{
|
||||
|
@ -501,7 +501,7 @@ void finish_object_selection()
|
|||
*
|
||||
* rct2: 0x006AB54F
|
||||
*/
|
||||
ResultWithMessage window_editor_object_selection_select_object(
|
||||
ResultWithMessage WindowEditorObjectSelectionSelectObject(
|
||||
uint8_t isMasterObject, int32_t flags, const ObjectRepositoryItem* item)
|
||||
{
|
||||
if (item == nullptr)
|
||||
|
@ -544,7 +544,7 @@ ResultWithMessage window_editor_object_selection_select_object(
|
|||
{
|
||||
for (const auto& sgEntry : item->SceneryGroupInfo.Entries)
|
||||
{
|
||||
window_editor_object_selection_select_object(++isMasterObject, flags, sgEntry);
|
||||
WindowEditorObjectSelectionSelectObject(++isMasterObject, flags, sgEntry);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -578,7 +578,7 @@ ResultWithMessage window_editor_object_selection_select_object(
|
|||
{
|
||||
for (const auto& sgEntry : item->SceneryGroupInfo.Entries)
|
||||
{
|
||||
const auto selectionResult = window_editor_object_selection_select_object(++isMasterObject, flags, sgEntry);
|
||||
const auto selectionResult = WindowEditorObjectSelectionSelectObject(++isMasterObject, flags, sgEntry);
|
||||
if (!selectionResult.Successful)
|
||||
{
|
||||
_gSceneryGroupPartialSelectError = selectionResult.Message;
|
||||
|
@ -611,15 +611,15 @@ ResultWithMessage window_editor_object_selection_select_object(
|
|||
return { true };
|
||||
}
|
||||
|
||||
ResultWithMessage window_editor_object_selection_select_object(
|
||||
ResultWithMessage WindowEditorObjectSelectionSelectObject(
|
||||
uint8_t isMasterObject, int32_t flags, const ObjectEntryDescriptor& descriptor)
|
||||
{
|
||||
auto& objectRepository = OpenRCT2::GetContext()->GetObjectRepository();
|
||||
const auto* item = objectRepository.FindObject(descriptor);
|
||||
return window_editor_object_selection_select_object(isMasterObject, flags, item);
|
||||
return WindowEditorObjectSelectionSelectObject(isMasterObject, flags, item);
|
||||
}
|
||||
|
||||
bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType)
|
||||
bool EditorCheckObjectGroupAtLeastOneSelected(ObjectType checkObjectType)
|
||||
{
|
||||
auto numObjects = std::min(object_repository_get_items_count(), _objectSelectionFlags.size());
|
||||
const ObjectRepositoryItem* items = object_repository_get_items();
|
||||
|
@ -635,7 +635,7 @@ bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool editor_check_object_group_at_least_one_surface_selected(bool queue)
|
||||
bool EditorCheckObjectGroupAtLeastOneSurfaceSelected(bool queue)
|
||||
{
|
||||
auto numObjects = std::min(object_repository_get_items_count(), _objectSelectionFlags.size());
|
||||
const auto* items = object_repository_get_items();
|
||||
|
@ -652,10 +652,10 @@ bool editor_check_object_group_at_least_one_surface_selected(bool queue)
|
|||
return false;
|
||||
}
|
||||
|
||||
int32_t editor_remove_unused_objects()
|
||||
int32_t EditorRemoveUnusedObjects()
|
||||
{
|
||||
sub_6AB211();
|
||||
setup_in_use_selection_flags();
|
||||
SetupInUseSelectionFlags();
|
||||
|
||||
int32_t numObjects = static_cast<int32_t>(object_repository_get_items_count());
|
||||
const ObjectRepositoryItem* items = object_repository_get_items();
|
||||
|
@ -682,8 +682,8 @@ int32_t editor_remove_unused_objects()
|
|||
}
|
||||
}
|
||||
}
|
||||
unload_unselected_objects();
|
||||
editor_object_flags_free();
|
||||
UnloadUnselectedObjects();
|
||||
EditorObjectFlagsFree();
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_REFRESH_SCENERY);
|
||||
ContextBroadcastIntent(&intent);
|
||||
|
|
|
@ -29,20 +29,20 @@ extern std::optional<StringId> _gSceneryGroupPartialSelectError;
|
|||
extern std::vector<uint8_t> _objectSelectionFlags;
|
||||
extern int32_t _numSelectedObjectsForType[EnumValue(ObjectType::Count)];
|
||||
|
||||
bool editor_check_object_group_at_least_one_selected(ObjectType checkObjectType);
|
||||
bool editor_check_object_group_at_least_one_surface_selected(bool queue);
|
||||
void editor_object_flags_free();
|
||||
void unload_unselected_objects();
|
||||
bool EditorCheckObjectGroupAtLeastOneSelected(ObjectType checkObjectType);
|
||||
bool EditorCheckObjectGroupAtLeastOneSurfaceSelected(bool queue);
|
||||
void EditorObjectFlagsFree();
|
||||
void UnloadUnselectedObjects();
|
||||
void sub_6AB211();
|
||||
void reset_selected_object_count_and_size();
|
||||
void finish_object_selection();
|
||||
ResultWithMessage window_editor_object_selection_select_object(
|
||||
void ResetSelectedObjectCountAndSize();
|
||||
void FinishObjectSelection();
|
||||
ResultWithMessage WindowEditorObjectSelectionSelectObject(
|
||||
uint8_t isMasterObject, int32_t flags, const ObjectRepositoryItem* item);
|
||||
ResultWithMessage window_editor_object_selection_select_object(
|
||||
ResultWithMessage WindowEditorObjectSelectionSelectObject(
|
||||
uint8_t isMasterObject, int32_t flags, const ObjectEntryDescriptor& entry);
|
||||
|
||||
/**
|
||||
* Removes all unused objects from the object selection.
|
||||
* @return The number of removed objects.
|
||||
*/
|
||||
int32_t editor_remove_unused_objects();
|
||||
int32_t EditorRemoveUnusedObjects();
|
||||
|
|
|
@ -88,7 +88,7 @@ static bool TryClassifyAsPark(OpenRCT2::IStream* stream, ClassifiedFileInfo* res
|
|||
catch (const std::exception& e)
|
||||
{
|
||||
success = false;
|
||||
log_verbose(e.what());
|
||||
LOG_VERBOSE(e.what());
|
||||
}
|
||||
stream->SetPosition(originalPosition);
|
||||
return success;
|
||||
|
@ -116,7 +116,7 @@ static bool TryClassifyAsS6(OpenRCT2::IStream* stream, ClassifiedFileInfo* resul
|
|||
catch (const std::exception& e)
|
||||
{
|
||||
// Exceptions are likely to occur if file is not S6 format
|
||||
log_verbose(e.what());
|
||||
LOG_VERBOSE(e.what());
|
||||
}
|
||||
stream->SetPosition(originalPosition);
|
||||
return success;
|
||||
|
@ -194,7 +194,7 @@ static bool TryClassifyAsTD4_TD6(OpenRCT2::IStream* stream, ClassifiedFileInfo*
|
|||
return success;
|
||||
}
|
||||
|
||||
FileExtension get_file_extension_type(u8string_view path)
|
||||
FileExtension GetFileExtensionType(u8string_view path)
|
||||
{
|
||||
auto extension = Path::GetExtension(path);
|
||||
if (String::Equals(extension, ".dat", true) || String::Equals(extension, ".pob", true))
|
||||
|
|
|
@ -52,4 +52,4 @@ struct ClassifiedFileInfo
|
|||
bool TryClassifyFile(const std::string& path, ClassifiedFileInfo* result);
|
||||
bool TryClassifyFile(OpenRCT2::IStream* stream, ClassifiedFileInfo* result);
|
||||
|
||||
FileExtension get_file_extension_type(u8string_view path);
|
||||
FileExtension GetFileExtensionType(u8string_view path);
|
||||
|
|
|
@ -94,13 +94,13 @@ static bool _mapChangedExpected;
|
|||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
void game_reset_speed()
|
||||
void GameResetSpeed()
|
||||
{
|
||||
gGameSpeed = 1;
|
||||
WindowInvalidateByClass(WindowClass::TopToolbar);
|
||||
}
|
||||
|
||||
void game_increase_game_speed()
|
||||
void GameIncreaseGameSpeed()
|
||||
{
|
||||
gGameSpeed = std::min(gConfigGeneral.DebuggingTools ? 5 : 4, gGameSpeed + 1);
|
||||
if (gGameSpeed == 5)
|
||||
|
@ -108,7 +108,7 @@ void game_increase_game_speed()
|
|||
WindowInvalidateByClass(WindowClass::TopToolbar);
|
||||
}
|
||||
|
||||
void game_reduce_game_speed()
|
||||
void GameReduceGameSpeed()
|
||||
{
|
||||
gGameSpeed = std::max(1, gGameSpeed - 1);
|
||||
if (gGameSpeed == 7)
|
||||
|
@ -120,7 +120,7 @@ void game_reduce_game_speed()
|
|||
*
|
||||
* rct2: 0x0066B5C0 (part of 0x0066B3E8)
|
||||
*/
|
||||
void game_create_windows()
|
||||
void GameCreateWindows()
|
||||
{
|
||||
ContextOpenWindow(WindowClass::MainWindow);
|
||||
ContextOpenWindow(WindowClass::TopToolbar);
|
||||
|
@ -146,7 +146,7 @@ enum
|
|||
*
|
||||
* rct2: 0x006838BD
|
||||
*/
|
||||
void update_palette_effects()
|
||||
void UpdatePaletteEffects()
|
||||
{
|
||||
auto water_type = static_cast<rct_water_type*>(object_entry_get_chunk(ObjectType::Water, 0));
|
||||
|
||||
|
@ -299,7 +299,7 @@ void update_palette_effects()
|
|||
}
|
||||
}
|
||||
|
||||
void pause_toggle()
|
||||
void PauseToggle()
|
||||
{
|
||||
gGamePaused ^= GAME_PAUSED_NORMAL;
|
||||
WindowInvalidateByClass(WindowClass::TopToolbar);
|
||||
|
@ -309,12 +309,12 @@ void pause_toggle()
|
|||
}
|
||||
}
|
||||
|
||||
bool game_is_paused()
|
||||
bool GameIsPaused()
|
||||
{
|
||||
return gGamePaused != 0;
|
||||
}
|
||||
|
||||
bool game_is_not_paused()
|
||||
bool GameIsNotPaused()
|
||||
{
|
||||
return gGamePaused == 0;
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ bool game_is_not_paused()
|
|||
*
|
||||
* rct2: 0x0066DC0F
|
||||
*/
|
||||
static void load_landscape()
|
||||
static void LoadLandscape()
|
||||
{
|
||||
auto intent = Intent(WindowClass::Loadsave);
|
||||
intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE);
|
||||
|
@ -341,7 +341,7 @@ void RCT2StringToUTF8Self(char* buffer, size_t length)
|
|||
|
||||
// OpenRCT2 workaround to recalculate some values which are saved redundantly in the save to fix corrupted files.
|
||||
// For example recalculate guest count by looking at all the guests instead of trusting the value in the file.
|
||||
void game_fix_save_vars()
|
||||
void GameFixSaveVars()
|
||||
{
|
||||
// Recalculates peep count after loading a save to fix corrupted files
|
||||
uint32_t guestCount = 0;
|
||||
|
@ -374,23 +374,23 @@ void game_fix_save_vars()
|
|||
Ride* ride = GetRide(rideIdx);
|
||||
if (ride == nullptr)
|
||||
{
|
||||
log_warning("Couldn't find ride %u, resetting ride on peep %u", rideIdx, peep->sprite_index);
|
||||
LOG_WARNING("Couldn't find ride %u, resetting ride on peep %u", rideIdx, peep->sprite_index);
|
||||
peep->CurrentRide = RideId::GetNull();
|
||||
continue;
|
||||
}
|
||||
auto curName = peep->GetName();
|
||||
log_warning(
|
||||
LOG_WARNING(
|
||||
"Peep %u (%s) has invalid ride station = %u for ride %u.", peep->sprite_index, curName.c_str(),
|
||||
srcStation.ToUnderlying(), rideIdx);
|
||||
auto station = RideGetFirstValidStationExit(*ride);
|
||||
if (station.IsNull())
|
||||
{
|
||||
log_warning("Couldn't find station, removing peep %u", peep->sprite_index);
|
||||
LOG_WARNING("Couldn't find station, removing peep %u", peep->sprite_index);
|
||||
peepsToRemove.push_back(peep);
|
||||
}
|
||||
else
|
||||
{
|
||||
log_warning("Amending ride station to %u.", station);
|
||||
LOG_WARNING("Amending ride station to %u.", station);
|
||||
peep->CurrentRideStation = station;
|
||||
}
|
||||
}
|
||||
|
@ -417,11 +417,11 @@ void game_fix_save_vars()
|
|||
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
log_error("Null map element at x = %d and y = %d. Fixing...", x, y);
|
||||
LOG_ERROR("Null map element at x = %d and y = %d. Fixing...", x, y);
|
||||
surfaceElement = TileElementInsert<SurfaceElement>(TileCoordsXYZ{ x, y, 14 }.ToCoordsXYZ(), 0b0000);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
log_error("Unable to fix: Map element limit reached.");
|
||||
LOG_ERROR("Unable to fix: Map element limit reached.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ void game_fix_save_vars()
|
|||
MapCountRemainingLandRights();
|
||||
}
|
||||
|
||||
void game_load_init()
|
||||
void GameLoadInit()
|
||||
{
|
||||
IGameStateSnapshots* snapshots = GetContext()->GetGameStateSnapshots();
|
||||
snapshots->Reset();
|
||||
|
@ -467,7 +467,7 @@ void game_load_init()
|
|||
if (!gLoadKeepWindowsOpen)
|
||||
{
|
||||
ViewportInitAll();
|
||||
game_create_windows();
|
||||
GameCreateWindows();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -483,7 +483,7 @@ void game_load_init()
|
|||
GameActions::ClearQueue();
|
||||
}
|
||||
ResetEntitySpatialIndices();
|
||||
reset_all_sprite_quadrant_placements();
|
||||
ResetAllSpriteQuadrantPlacements();
|
||||
ScenerySetDefaultPlacementConfiguration();
|
||||
|
||||
auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES);
|
||||
|
@ -504,21 +504,21 @@ void game_load_init()
|
|||
gGameSpeed = 1;
|
||||
}
|
||||
|
||||
void game_load_scripts()
|
||||
void GameLoadScripts()
|
||||
{
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
GetContext()->GetScriptEngine().LoadTransientPlugins();
|
||||
#endif
|
||||
}
|
||||
|
||||
void game_unload_scripts()
|
||||
void GameUnloadScripts()
|
||||
{
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
GetContext()->GetScriptEngine().UnloadTransientPlugins();
|
||||
#endif
|
||||
}
|
||||
|
||||
void game_notify_map_change()
|
||||
void GameNotifyMapChange()
|
||||
{
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
// Ensure we don't get a two lots of change events
|
||||
|
@ -534,7 +534,7 @@ void game_notify_map_change()
|
|||
#endif
|
||||
}
|
||||
|
||||
void game_notify_map_changed()
|
||||
void GameNotifyMapChanged()
|
||||
{
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
using namespace OpenRCT2::Scripting;
|
||||
|
@ -551,7 +551,7 @@ void game_notify_map_changed()
|
|||
* rct2: 0x0069E9A7
|
||||
* Call after a rotation or loading of a save to reset sprite quadrants
|
||||
*/
|
||||
void reset_all_sprite_quadrant_placements()
|
||||
void ResetAllSpriteQuadrantPlacements()
|
||||
{
|
||||
for (EntityId::UnderlyingType i = 0; i < MAX_ENTITIES; i++)
|
||||
{
|
||||
|
@ -563,48 +563,48 @@ void reset_all_sprite_quadrant_placements()
|
|||
}
|
||||
}
|
||||
|
||||
void save_game()
|
||||
void SaveGame()
|
||||
{
|
||||
if (!gFirstTimeSaving && !gIsAutosaveLoaded)
|
||||
{
|
||||
const auto savePath = Path::WithExtension(gScenarioSavePath, ".park");
|
||||
save_game_with_name(savePath);
|
||||
SaveGameWithName(savePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
save_game_as();
|
||||
SaveGameAs();
|
||||
}
|
||||
}
|
||||
|
||||
void save_game_cmd(u8string_view name /* = {} */)
|
||||
void SaveGameCmd(u8string_view name /* = {} */)
|
||||
{
|
||||
if (name.empty())
|
||||
{
|
||||
const auto savePath = Path::WithExtension(gScenarioSavePath, ".park");
|
||||
|
||||
save_game_with_name(savePath);
|
||||
SaveGameWithName(savePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto env = GetContext()->GetPlatformEnvironment();
|
||||
auto savePath = Path::Combine(env->GetDirectoryPath(DIRBASE::USER, DIRID::SAVE), u8string(name) + u8".park");
|
||||
save_game_with_name(savePath);
|
||||
SaveGameWithName(savePath);
|
||||
}
|
||||
}
|
||||
|
||||
void save_game_with_name(u8string_view name)
|
||||
void SaveGameWithName(u8string_view name)
|
||||
{
|
||||
log_verbose("Saving to %s", u8string(name).c_str());
|
||||
LOG_VERBOSE("Saving to %s", u8string(name).c_str());
|
||||
if (scenario_save(name, gConfigGeneral.SavePluginData ? 1 : 0))
|
||||
{
|
||||
log_verbose("Saved to %s", u8string(name).c_str());
|
||||
LOG_VERBOSE("Saved to %s", u8string(name).c_str());
|
||||
gCurrentLoadedPath = name;
|
||||
gIsAutosaveLoaded = false;
|
||||
gScreenAge = 0;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<Intent> create_save_game_as_intent()
|
||||
std::unique_ptr<Intent> CreateSaveGameAsIntent()
|
||||
{
|
||||
auto name = Path::GetFileNameWithoutExtension(gScenarioSavePath);
|
||||
|
||||
|
@ -615,13 +615,13 @@ std::unique_ptr<Intent> create_save_game_as_intent()
|
|||
return intent;
|
||||
}
|
||||
|
||||
void save_game_as()
|
||||
void SaveGameAs()
|
||||
{
|
||||
auto intent = create_save_game_as_intent();
|
||||
auto intent = CreateSaveGameAsIntent();
|
||||
ContextOpenIntent(intent.get());
|
||||
}
|
||||
|
||||
static void limit_autosave_count(const size_t numberOfFilesToKeep, bool processLandscapeFolder)
|
||||
static void LimitAutosaveCount(const size_t numberOfFilesToKeep, bool processLandscapeFolder)
|
||||
{
|
||||
size_t autosavesCount = 0;
|
||||
size_t numAutosavesToDelete = 0;
|
||||
|
@ -675,12 +675,12 @@ static void limit_autosave_count(const size_t numberOfFilesToKeep, bool processL
|
|||
{
|
||||
if (!File::Delete(autosaveFiles[i]))
|
||||
{
|
||||
log_warning("Failed to delete autosave file: %s", autosaveFiles[i].data());
|
||||
LOG_WARNING("Failed to delete autosave file: %s", autosaveFiles[i].data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void game_autosave()
|
||||
void GameAutosave()
|
||||
{
|
||||
auto subDirectory = DIRID::SAVE;
|
||||
const char* fileExtension = ".park";
|
||||
|
@ -702,7 +702,7 @@ void game_autosave()
|
|||
currentDate.day, currentTime.hour, currentTime.minute, currentTime.second, fileExtension);
|
||||
|
||||
int32_t autosavesToKeep = gConfigGeneral.AutosaveAmount;
|
||||
limit_autosave_count(autosavesToKeep - 1, (gScreenFlags & SCREEN_FLAGS_EDITOR));
|
||||
LimitAutosaveCount(autosavesToKeep - 1, (gScreenFlags & SCREEN_FLAGS_EDITOR));
|
||||
|
||||
auto env = GetContext()->GetPlatformEnvironment();
|
||||
auto autosaveDir = Path::Combine(env->GetDirectoryPath(DIRBASE::USER, subDirectory), u8"autosave");
|
||||
|
@ -721,16 +721,16 @@ void game_autosave()
|
|||
Console::Error::WriteLine("Could not autosave the scenario. Is the save folder writeable?");
|
||||
}
|
||||
|
||||
static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8* path)
|
||||
static void GameLoadOrQuitNoSavePromptCallback(int32_t result, const utf8* path)
|
||||
{
|
||||
if (result == MODAL_RESULT_OK)
|
||||
{
|
||||
game_notify_map_change();
|
||||
game_unload_scripts();
|
||||
GameNotifyMapChange();
|
||||
GameUnloadScripts();
|
||||
WindowCloseByClass(WindowClass::EditorObjectSelection);
|
||||
GetContext()->LoadParkFromFile(path);
|
||||
game_load_scripts();
|
||||
game_notify_map_changed();
|
||||
GameLoadScripts();
|
||||
GameNotifyMapChanged();
|
||||
gIsAutosaveLoaded = gIsAutosave;
|
||||
gFirstTimeSaving = false;
|
||||
}
|
||||
|
@ -739,17 +739,17 @@ static void game_load_or_quit_no_save_prompt_callback(int32_t result, const utf8
|
|||
static void NewGameWindowCallback(const utf8* path)
|
||||
{
|
||||
WindowCloseByClass(WindowClass::EditorObjectSelection);
|
||||
game_notify_map_change();
|
||||
GameNotifyMapChange();
|
||||
GetContext()->LoadParkFromFile(path, false, true);
|
||||
game_load_scripts();
|
||||
game_notify_map_changed();
|
||||
GameLoadScripts();
|
||||
GameNotifyMapChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0066DB79
|
||||
*/
|
||||
void game_load_or_quit_no_save_prompt()
|
||||
void GameLoadOrQuitNoSavePrompt()
|
||||
{
|
||||
switch (gSavePromptMode)
|
||||
{
|
||||
|
@ -760,13 +760,13 @@ void game_load_or_quit_no_save_prompt()
|
|||
ToolCancel();
|
||||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
{
|
||||
load_landscape();
|
||||
LoadLandscape();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto intent = Intent(WindowClass::Loadsave);
|
||||
intent.putExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME);
|
||||
intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast<void*>(game_load_or_quit_no_save_prompt_callback));
|
||||
intent.putExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast<void*>(GameLoadOrQuitNoSavePromptCallback));
|
||||
ContextOpenIntent(&intent);
|
||||
}
|
||||
break;
|
||||
|
@ -776,14 +776,14 @@ void game_load_or_quit_no_save_prompt()
|
|||
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::CloseSavePrompt);
|
||||
GameActions::Execute(&loadOrQuitAction);
|
||||
ToolCancel();
|
||||
if (input_test_flag(INPUT_FLAG_5))
|
||||
if (InputTestFlag(INPUT_FLAG_5))
|
||||
{
|
||||
input_set_flag(INPUT_FLAG_5, false);
|
||||
InputSetFlag(INPUT_FLAG_5, false);
|
||||
}
|
||||
gGameSpeed = 1;
|
||||
gFirstTimeSaving = true;
|
||||
game_notify_map_change();
|
||||
game_unload_scripts();
|
||||
GameNotifyMapChange();
|
||||
GameUnloadScripts();
|
||||
title_load();
|
||||
break;
|
||||
}
|
||||
|
@ -798,13 +798,13 @@ void game_load_or_quit_no_save_prompt()
|
|||
break;
|
||||
}
|
||||
default:
|
||||
game_unload_scripts();
|
||||
openrct2_finish();
|
||||
GameUnloadScripts();
|
||||
OpenRCT2Finish();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void start_silent_record()
|
||||
void StartSilentRecord()
|
||||
{
|
||||
std::string name = Path::Combine(
|
||||
OpenRCT2::GetContext()->GetPlatformEnvironment()->GetDirectoryPath(OpenRCT2::DIRBASE::USER), u8"debug_replay.parkrep");
|
||||
|
@ -820,7 +820,7 @@ void start_silent_record()
|
|||
}
|
||||
}
|
||||
|
||||
bool stop_silent_record()
|
||||
bool StopSilentRecord()
|
||||
{
|
||||
auto* replayManager = OpenRCT2::GetContext()->GetReplayManager();
|
||||
if (!replayManager->IsRecording() && !replayManager->IsNormalising())
|
||||
|
|
|
@ -149,31 +149,31 @@ extern bool gIsAutosaveLoaded;
|
|||
|
||||
extern bool gLoadKeepWindowsOpen;
|
||||
|
||||
void game_reset_speed();
|
||||
void game_increase_game_speed();
|
||||
void game_reduce_game_speed();
|
||||
void GameResetSpeed();
|
||||
void GameIncreaseGameSpeed();
|
||||
void GameReduceGameSpeed();
|
||||
|
||||
void game_create_windows();
|
||||
void reset_all_sprite_quadrant_placements();
|
||||
void update_palette_effects();
|
||||
void GameCreateWindows();
|
||||
void ResetAllSpriteQuadrantPlacements();
|
||||
void UpdatePaletteEffects();
|
||||
|
||||
void game_load_or_quit_no_save_prompt();
|
||||
void game_load_init();
|
||||
void game_load_scripts();
|
||||
void game_unload_scripts();
|
||||
void game_notify_map_change();
|
||||
void game_notify_map_changed();
|
||||
void pause_toggle();
|
||||
bool game_is_paused();
|
||||
bool game_is_not_paused();
|
||||
void save_game();
|
||||
std::unique_ptr<Intent> create_save_game_as_intent();
|
||||
void save_game_as();
|
||||
void save_game_cmd(u8string_view name = {});
|
||||
void save_game_with_name(u8string_view name);
|
||||
void game_autosave();
|
||||
void GameLoadOrQuitNoSavePrompt();
|
||||
void GameLoadInit();
|
||||
void GameLoadScripts();
|
||||
void GameUnloadScripts();
|
||||
void GameNotifyMapChange();
|
||||
void GameNotifyMapChanged();
|
||||
void PauseToggle();
|
||||
bool GameIsPaused();
|
||||
bool GameIsNotPaused();
|
||||
void SaveGame();
|
||||
std::unique_ptr<Intent> CreateSaveGameAsIntent();
|
||||
void SaveGameAs();
|
||||
void SaveGameCmd(u8string_view name = {});
|
||||
void SaveGameWithName(u8string_view name);
|
||||
void GameAutosave();
|
||||
void RCT2StringToUTF8Self(char* buffer, size_t length);
|
||||
void game_fix_save_vars();
|
||||
void start_silent_record();
|
||||
bool stop_silent_record();
|
||||
void GameFixSaveVars();
|
||||
void StartSilentRecord();
|
||||
bool StopSilentRecord();
|
||||
void PrepareMapForSave();
|
||||
|
|
|
@ -112,9 +112,9 @@ void GameState::Tick()
|
|||
|
||||
// 0x006E3AEC // screen_game_process_mouse_input();
|
||||
ScreenshotCheck();
|
||||
game_handle_keyboard_input();
|
||||
GameHandleKeyboardInput();
|
||||
|
||||
if (game_is_not_paused() && gPreviewingTitleSequenceInGame)
|
||||
if (GameIsNotPaused() && gPreviewingTitleSequenceInGame)
|
||||
{
|
||||
auto player = GetContext()->GetUiContext()->GetTitleSequencePlayer();
|
||||
if (player != nullptr)
|
||||
|
@ -140,7 +140,7 @@ void GameState::Tick()
|
|||
}
|
||||
}
|
||||
|
||||
bool isPaused = game_is_paused();
|
||||
bool isPaused = GameIsPaused();
|
||||
if (network_get_mode() == NETWORK_MODE_SERVER && gConfigNetwork.PauseServerIfNoClients)
|
||||
{
|
||||
// If we are headless we always have 1 player (host), pause if no one else is around.
|
||||
|
@ -156,7 +156,7 @@ void GameState::Tick()
|
|||
if (gDoSingleUpdate && network_get_mode() == NETWORK_MODE_NONE)
|
||||
{
|
||||
didRunSingleFrame = true;
|
||||
pause_toggle();
|
||||
PauseToggle();
|
||||
numUpdates = 1;
|
||||
}
|
||||
else
|
||||
|
@ -189,11 +189,11 @@ void GameState::Tick()
|
|||
UpdateLogic();
|
||||
if (gGameSpeed == 1)
|
||||
{
|
||||
if (input_get_state() == InputState::Reset || input_get_state() == InputState::Normal)
|
||||
if (InputGetState() == InputState::Reset || InputGetState() == InputState::Normal)
|
||||
{
|
||||
if (input_test_flag(INPUT_FLAG_VIEWPORT_SCROLLING))
|
||||
if (InputTestFlag(INPUT_FLAG_VIEWPORT_SCROLLING))
|
||||
{
|
||||
input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false);
|
||||
InputSetFlag(INPUT_FLAG_VIEWPORT_SCROLLING, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ void GameState::Tick()
|
|||
|
||||
if (!gOpenRCT2Headless)
|
||||
{
|
||||
input_set_flag(INPUT_FLAG_VIEWPORT_SCROLLING, false);
|
||||
InputSetFlag(INPUT_FLAG_VIEWPORT_SCROLLING, false);
|
||||
|
||||
// the flickering frequency is reduced by 4, compared to the original
|
||||
// it was done due to inability to reproduce original frequency
|
||||
|
@ -242,9 +242,9 @@ void GameState::Tick()
|
|||
|
||||
WindowDispatchUpdateAll();
|
||||
|
||||
if (didRunSingleFrame && game_is_not_paused() && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
|
||||
if (didRunSingleFrame && GameIsNotPaused() && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO))
|
||||
{
|
||||
pause_toggle();
|
||||
PauseToggle();
|
||||
}
|
||||
|
||||
gDoSingleUpdate = false;
|
||||
|
@ -360,7 +360,7 @@ void GameState::UpdateLogic(LogicTimings* timings)
|
|||
peep_update_crowd_noise();
|
||||
ClimateUpdateSound();
|
||||
report_time(LogicTimePart::Sounds);
|
||||
editor_open_windows_for_current_step();
|
||||
EditorOpenWindowsForCurrentStep();
|
||||
|
||||
// Update windows
|
||||
// WindowDispatchUpdateAll();
|
||||
|
|
|
@ -97,7 +97,7 @@ struct GameStateSnapshot_t
|
|||
// can fail gracefully when fields added/removed
|
||||
if (!EntitiesSizeCheck<Vehicle, Guest, Staff, Litter, MoneyEffect, Balloon, Duck, JumpingFountain, SteamParticle>(ds))
|
||||
{
|
||||
log_error("Entity index corrupted!");
|
||||
LOG_ERROR("Entity index corrupted!");
|
||||
return;
|
||||
}
|
||||
ds << numSavedSprites;
|
||||
|
@ -115,7 +115,7 @@ struct GameStateSnapshot_t
|
|||
EntitySnapshot* entity = getEntity(spriteIdx);
|
||||
if (entity == nullptr)
|
||||
{
|
||||
log_error("Entity index corrupted!");
|
||||
LOG_ERROR("Entity index corrupted!");
|
||||
return;
|
||||
}
|
||||
auto& sprite = *entity;
|
||||
|
@ -186,7 +186,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots
|
|||
snapshot.SerialiseSprites(
|
||||
[](const EntityId index) { return reinterpret_cast<EntitySnapshot*>(GetEntity(index)); }, MAX_ENTITIES, true);
|
||||
|
||||
// log_info("Snapshot size: %u bytes", static_cast<uint32_t>(snapshot.storedSprites.GetLength()));
|
||||
// LOG_INFO("Snapshot size: %u bytes", static_cast<uint32_t>(snapshot.storedSprites.GetLength()));
|
||||
}
|
||||
|
||||
virtual const GameStateSnapshot_t* GetLinkedSnapshot(uint32_t tick) const override final
|
||||
|
|
|
@ -27,7 +27,7 @@ widget_ref gCurrentToolWidget;
|
|||
*
|
||||
* rct2: 0x006E3B43
|
||||
*/
|
||||
void title_handle_keyboard_input()
|
||||
void TitleHandleKeyboardInput()
|
||||
{
|
||||
ContextInputHandleKeyboard(true);
|
||||
}
|
||||
|
@ -36,12 +36,12 @@ void title_handle_keyboard_input()
|
|||
*
|
||||
* rct2: 0x006E3B43
|
||||
*/
|
||||
void game_handle_keyboard_input()
|
||||
void GameHandleKeyboardInput()
|
||||
{
|
||||
ContextInputHandleKeyboard(false);
|
||||
}
|
||||
|
||||
void input_set_flag(INPUT_FLAGS flag, bool on)
|
||||
void InputSetFlag(INPUT_FLAGS flag, bool on)
|
||||
{
|
||||
if (on)
|
||||
{
|
||||
|
@ -53,32 +53,32 @@ void input_set_flag(INPUT_FLAGS flag, bool on)
|
|||
}
|
||||
}
|
||||
|
||||
bool input_test_flag(INPUT_FLAGS flag)
|
||||
bool InputTestFlag(INPUT_FLAGS flag)
|
||||
{
|
||||
return _inputFlags & flag;
|
||||
}
|
||||
|
||||
void input_reset_flags()
|
||||
void InputResetFlags()
|
||||
{
|
||||
_inputFlags = 0;
|
||||
}
|
||||
|
||||
void input_set_state(InputState state)
|
||||
void InputSetState(InputState state)
|
||||
{
|
||||
_inputState = state;
|
||||
}
|
||||
|
||||
InputState input_get_state()
|
||||
InputState InputGetState()
|
||||
{
|
||||
return _inputState;
|
||||
}
|
||||
|
||||
void reset_tooltip_not_shown()
|
||||
void ResetTooltipNotShown()
|
||||
{
|
||||
_tooltipNotShownTicks = 0;
|
||||
}
|
||||
|
||||
void input_reset_place_obj_modifier()
|
||||
void InputResetPlaceObjModifier()
|
||||
{
|
||||
gInputPlaceObjectModifier = PLACE_OBJECT_MODIFIER_NONE;
|
||||
}
|
||||
|
|
|
@ -94,25 +94,25 @@ extern uint16_t _tooltipNotShownTicks;
|
|||
|
||||
void InputWindowPositionBegin(rct_window& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords);
|
||||
|
||||
void title_handle_keyboard_input();
|
||||
void TitleHandleKeyboardInput();
|
||||
void GameHandleInput();
|
||||
void game_handle_keyboard_input();
|
||||
void GameHandleKeyboardInput();
|
||||
void GameHandleEdgeScroll();
|
||||
int32_t GetNextKey();
|
||||
|
||||
void StoreMouseInput(MouseState state, const ScreenCoordsXY& screenCoords);
|
||||
|
||||
void input_set_flag(INPUT_FLAGS flag, bool on);
|
||||
bool input_test_flag(INPUT_FLAGS flag);
|
||||
void input_reset_flags();
|
||||
void InputSetFlag(INPUT_FLAGS flag, bool on);
|
||||
bool InputTestFlag(INPUT_FLAGS flag);
|
||||
void InputResetFlags();
|
||||
|
||||
bool InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER modifier);
|
||||
|
||||
void input_set_state(InputState state);
|
||||
InputState input_get_state();
|
||||
void InputSetState(InputState state);
|
||||
InputState InputGetState();
|
||||
|
||||
void reset_tooltip_not_shown();
|
||||
void ResetTooltipNotShown();
|
||||
|
||||
void input_reset_place_obj_modifier();
|
||||
void InputResetPlaceObjModifier();
|
||||
|
||||
void InputScrollViewport(const ScreenCoordsXY& screenCoords);
|
||||
|
|
|
@ -35,16 +35,16 @@ static int32_t _introStateCounter;
|
|||
static std::shared_ptr<IAudioChannel> _soundChannel = nullptr;
|
||||
static bool _chainLiftFinished;
|
||||
|
||||
static void screen_intro_process_mouse_input();
|
||||
static void screen_intro_process_keyboard_input();
|
||||
static void screen_intro_skip_part();
|
||||
static void screen_intro_draw_logo(rct_drawpixelinfo* dpi);
|
||||
static void ScreenIntroProcessMouseInput();
|
||||
static void ScreenIntroProcessKeyboardInput();
|
||||
static void ScreenIntroSkipPart();
|
||||
static void ScreenIntroDrawLogo(rct_drawpixelinfo* dpi);
|
||||
|
||||
// rct2: 0x0068E966
|
||||
void intro_update()
|
||||
void IntroUpdate()
|
||||
{
|
||||
screen_intro_process_mouse_input();
|
||||
screen_intro_process_keyboard_input();
|
||||
ScreenIntroProcessMouseInput();
|
||||
ScreenIntroProcessKeyboardInput();
|
||||
|
||||
switch (gIntroState)
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ void intro_update()
|
|||
}
|
||||
}
|
||||
|
||||
void intro_draw(rct_drawpixelinfo* dpi)
|
||||
void IntroDraw(rct_drawpixelinfo* dpi)
|
||||
{
|
||||
int32_t screenWidth = ContextGetWidth();
|
||||
|
||||
|
@ -216,10 +216,10 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
|||
{
|
||||
GfxTransposePalette(PALETTE_G1_IDX_LOGO, 255);
|
||||
}
|
||||
screen_intro_draw_logo(dpi);
|
||||
ScreenIntroDrawLogo(dpi);
|
||||
break;
|
||||
case IntroState::LogoWait:
|
||||
screen_intro_draw_logo(dpi);
|
||||
ScreenIntroDrawLogo(dpi);
|
||||
break;
|
||||
case IntroState::LogoFadeOut:
|
||||
if (_introStateCounter >= 0)
|
||||
|
@ -230,7 +230,7 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
|||
{
|
||||
GfxTransposePalette(PALETTE_G1_IDX_LOGO, 0);
|
||||
}
|
||||
screen_intro_draw_logo(dpi);
|
||||
ScreenIntroDrawLogo(dpi);
|
||||
break;
|
||||
case IntroState::Clear:
|
||||
GfxClear(dpi, BACKROUND_COLOUR_DARK);
|
||||
|
@ -240,11 +240,11 @@ void intro_draw(rct_drawpixelinfo* dpi)
|
|||
}
|
||||
}
|
||||
|
||||
static void screen_intro_process_mouse_input()
|
||||
static void ScreenIntroProcessMouseInput()
|
||||
{
|
||||
if (ContextGetCursorState()->any == CURSOR_PRESSED)
|
||||
{
|
||||
screen_intro_skip_part();
|
||||
ScreenIntroSkipPart();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,20 +252,20 @@ static void screen_intro_process_mouse_input()
|
|||
*
|
||||
* rct2: 0x006E3AEC
|
||||
*/
|
||||
static void screen_intro_process_keyboard_input()
|
||||
static void ScreenIntroProcessKeyboardInput()
|
||||
{
|
||||
const uint8_t* keys = ContextGetKeysState();
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
if (keys[i] != 0)
|
||||
{
|
||||
screen_intro_skip_part();
|
||||
ScreenIntroSkipPart();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void screen_intro_skip_part()
|
||||
static void ScreenIntroSkipPart()
|
||||
{
|
||||
switch (gIntroState)
|
||||
{
|
||||
|
@ -280,7 +280,7 @@ static void screen_intro_skip_part()
|
|||
}
|
||||
}
|
||||
|
||||
static void screen_intro_draw_logo(rct_drawpixelinfo* dpi)
|
||||
static void ScreenIntroDrawLogo(rct_drawpixelinfo* dpi)
|
||||
{
|
||||
int32_t screenWidth = ContextGetWidth();
|
||||
int32_t imageWidth = 640;
|
||||
|
|
|
@ -31,5 +31,5 @@ enum class IntroState : uint8_t
|
|||
|
||||
extern IntroState gIntroState;
|
||||
|
||||
void intro_update();
|
||||
void intro_draw(rct_drawpixelinfo* dpi);
|
||||
void IntroUpdate();
|
||||
void IntroDraw(rct_drawpixelinfo* dpi);
|
||||
|
|
|
@ -62,7 +62,7 @@ extern uint8_t gScreenFlags;
|
|||
extern uint32_t gScreenAge;
|
||||
extern PromptMode gSavePromptMode;
|
||||
|
||||
void openrct2_write_full_version_info(utf8* buffer, size_t bufferSize);
|
||||
void openrct2_finish();
|
||||
void OpenRCT2WriteFullVersionInfo(utf8* buffer, size_t bufferSize);
|
||||
void OpenRCT2Finish();
|
||||
|
||||
int32_t CmdlineRun(const char** argv, int32_t argc);
|
||||
|
|
|
@ -221,12 +221,12 @@ std::unique_ptr<IPlatformEnvironment> OpenRCT2::CreatePlatformEnvironment()
|
|||
}
|
||||
|
||||
// Log base paths
|
||||
log_verbose("DIRBASE::RCT1 : %s", env->GetDirectoryPath(DIRBASE::RCT1).c_str());
|
||||
log_verbose("DIRBASE::RCT2 : %s", env->GetDirectoryPath(DIRBASE::RCT2).c_str());
|
||||
log_verbose("DIRBASE::OPENRCT2: %s", env->GetDirectoryPath(DIRBASE::OPENRCT2).c_str());
|
||||
log_verbose("DIRBASE::USER : %s", env->GetDirectoryPath(DIRBASE::USER).c_str());
|
||||
log_verbose("DIRBASE::CONFIG : %s", env->GetDirectoryPath(DIRBASE::CONFIG).c_str());
|
||||
log_verbose("DIRBASE::CACHE : %s", env->GetDirectoryPath(DIRBASE::CACHE).c_str());
|
||||
LOG_VERBOSE("DIRBASE::RCT1 : %s", env->GetDirectoryPath(DIRBASE::RCT1).c_str());
|
||||
LOG_VERBOSE("DIRBASE::RCT2 : %s", env->GetDirectoryPath(DIRBASE::RCT2).c_str());
|
||||
LOG_VERBOSE("DIRBASE::OPENRCT2: %s", env->GetDirectoryPath(DIRBASE::OPENRCT2).c_str());
|
||||
LOG_VERBOSE("DIRBASE::USER : %s", env->GetDirectoryPath(DIRBASE::USER).c_str());
|
||||
LOG_VERBOSE("DIRBASE::CONFIG : %s", env->GetDirectoryPath(DIRBASE::CONFIG).c_str());
|
||||
LOG_VERBOSE("DIRBASE::CACHE : %s", env->GetDirectoryPath(DIRBASE::CACHE).c_str());
|
||||
|
||||
return env;
|
||||
}
|
||||
|
|
|
@ -331,7 +331,7 @@ namespace OpenRCT2
|
|||
}
|
||||
else
|
||||
{
|
||||
log_error("Unable to write to file '%s'", outFile.c_str());
|
||||
LOG_ERROR("Unable to write to file '%s'", outFile.c_str());
|
||||
result = false;
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ namespace OpenRCT2
|
|||
}
|
||||
catch (const std::runtime_error& err)
|
||||
{
|
||||
log_warning("Snapshot data failed to be read. Snapshot not compared. %s", err.what());
|
||||
LOG_WARNING("Snapshot data failed to be read. Snapshot not compared. %s", err.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -423,13 +423,13 @@ namespace OpenRCT2
|
|||
|
||||
if (!ReadReplayData(file, *replayData))
|
||||
{
|
||||
log_error("Unable to read replay data.");
|
||||
LOG_ERROR("Unable to read replay data.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LoadReplayDataMap(*replayData))
|
||||
{
|
||||
log_error("Unable to load map.");
|
||||
LOG_ERROR("Unable to load map.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -534,12 +534,12 @@ namespace OpenRCT2
|
|||
DataSerialiser parkParamsDs(false, data.parkParams);
|
||||
SerialiseParkParameters(parkParamsDs);
|
||||
|
||||
game_load_init();
|
||||
GameLoadInit();
|
||||
FixInvalidVehicleSpriteSizes();
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
log_error("Exception: %s", ex.what());
|
||||
LOG_ERROR("Exception: %s", ex.what());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -712,13 +712,13 @@ namespace OpenRCT2
|
|||
serialiser << data.magic;
|
||||
if (data.magic != ReplayMagic)
|
||||
{
|
||||
log_error("Magic does not match %08X, expected: %08X", data.magic, ReplayMagic);
|
||||
LOG_ERROR("Magic does not match %08X, expected: %08X", data.magic, ReplayMagic);
|
||||
return false;
|
||||
}
|
||||
serialiser << data.version;
|
||||
if (data.version != ReplayVersion && !Compatible(data))
|
||||
{
|
||||
log_error("Invalid version detected %04X, expected: %04X", data.version, ReplayVersion);
|
||||
LOG_ERROR("Invalid version detected %04X, expected: %04X", data.version, ReplayVersion);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -727,7 +727,7 @@ namespace OpenRCT2
|
|||
// NOTE: This does not mean the replay will not function, only a warning.
|
||||
if (data.networkId != network_get_version())
|
||||
{
|
||||
log_warning(
|
||||
LOG_WARNING(
|
||||
"Replay network version mismatch: '%s', expected: '%s'", data.networkId.c_str(),
|
||||
network_get_version().c_str());
|
||||
}
|
||||
|
@ -799,7 +799,7 @@ namespace OpenRCT2
|
|||
uint32_t replayTick = gCurrentTicks - _currentReplay->tickStart;
|
||||
|
||||
// Detected different game state.
|
||||
log_warning(
|
||||
LOG_WARNING(
|
||||
"Different sprite checksum at tick %u (Replay Tick: %u) ; Saved: %s, Current: %s", gCurrentTicks,
|
||||
replayTick, savedChecksum.second.ToString().c_str(), checksum.ToString().c_str());
|
||||
|
||||
|
@ -808,7 +808,7 @@ namespace OpenRCT2
|
|||
else
|
||||
{
|
||||
// Good state.
|
||||
log_verbose(
|
||||
LOG_VERBOSE(
|
||||
"Good state at tick %u ; Saved: %s, Current: %s", gCurrentTicks,
|
||||
savedChecksum.second.ToString().c_str(), checksum.ToString().c_str());
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ const char gVersionInfoFull[] = OPENRCT2_NAME ", "
|
|||
#endif
|
||||
;
|
||||
|
||||
NewVersionInfo get_latest_version()
|
||||
NewVersionInfo GetLatestVersion()
|
||||
{
|
||||
// If the check doesn't succeed, provide current version so we don't bother user
|
||||
// with invalid data.
|
||||
|
|
|
@ -84,4 +84,4 @@ struct NewVersionInfo
|
|||
std::string url;
|
||||
};
|
||||
|
||||
NewVersionInfo get_latest_version();
|
||||
NewVersionInfo GetLatestVersion();
|
||||
|
|
|
@ -39,7 +39,7 @@ GameActions::Result BalloonPressAction::Query() const
|
|||
auto balloon = TryGetEntity<Balloon>(_spriteIndex);
|
||||
if (balloon == nullptr)
|
||||
{
|
||||
log_error("Tried getting invalid sprite for balloon: %u", _spriteIndex);
|
||||
LOG_ERROR("Tried getting invalid sprite for balloon: %u", _spriteIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||
}
|
||||
return GameActions::Result();
|
||||
|
@ -50,7 +50,7 @@ GameActions::Result BalloonPressAction::Execute() const
|
|||
auto balloon = TryGetEntity<Balloon>(_spriteIndex);
|
||||
if (balloon == nullptr)
|
||||
{
|
||||
log_error("Tried getting invalid sprite for balloon: %u", _spriteIndex);
|
||||
LOG_ERROR("Tried getting invalid sprite for balloon: %u", _spriteIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ GameActions::Result BannerPlaceAction::Query() const
|
|||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
log_error("No free map elements.");
|
||||
LOG_ERROR("No free map elements.");
|
||||
return GameActions::Result(
|
||||
GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ GameActions::Result BannerPlaceAction::Query() const
|
|||
|
||||
if (HasReachedBannerLimit())
|
||||
{
|
||||
log_error("No free banners available");
|
||||
LOG_ERROR("No free banners available");
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ GameActions::Result BannerPlaceAction::Query() const
|
|||
auto* bannerEntry = GetBannerEntry(_bannerType);
|
||||
if (bannerEntry == nullptr)
|
||||
{
|
||||
log_error("Invalid banner object type. bannerType = ", _bannerType);
|
||||
LOG_ERROR("Invalid banner object type. bannerType = ", _bannerType);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
res.Cost = bannerEntry->price;
|
||||
|
@ -115,7 +115,7 @@ GameActions::Result BannerPlaceAction::Execute() const
|
|||
|
||||
if (!MapCheckCapacityAndReorganise(_loc))
|
||||
{
|
||||
log_error("No free map elements.");
|
||||
LOG_ERROR("No free map elements.");
|
||||
return GameActions::Result(
|
||||
GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
@ -123,14 +123,14 @@ GameActions::Result BannerPlaceAction::Execute() const
|
|||
auto* bannerEntry = GetBannerEntry(_bannerType);
|
||||
if (bannerEntry == nullptr)
|
||||
{
|
||||
log_error("Invalid banner object type. bannerType = ", _bannerType);
|
||||
LOG_ERROR("Invalid banner object type. bannerType = ", _bannerType);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
auto banner = CreateBanner();
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_error("No free banners available");
|
||||
LOG_ERROR("No free banners available");
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
|
|
@ -57,21 +57,21 @@ GameActions::Result BannerRemoveAction::Query() const
|
|||
BannerElement* bannerElement = GetBannerElementAt();
|
||||
if (bannerElement == nullptr)
|
||||
{
|
||||
log_error("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
LOG_ERROR("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
auto bannerIndex = bannerElement->GetIndex();
|
||||
if (bannerIndex == BannerIndex::GetNull())
|
||||
{
|
||||
log_error("Invalid banner index. index = ", bannerIndex);
|
||||
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
auto banner = bannerElement->GetBanner();
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_error("Invalid banner index. index = ", bannerIndex);
|
||||
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -96,21 +96,21 @@ GameActions::Result BannerRemoveAction::Execute() const
|
|||
BannerElement* bannerElement = GetBannerElementAt();
|
||||
if (bannerElement == nullptr)
|
||||
{
|
||||
log_error("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
LOG_ERROR("Invalid banner location, x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
auto bannerIndex = bannerElement->GetIndex();
|
||||
if (bannerIndex == BannerIndex::GetNull())
|
||||
{
|
||||
log_error("Invalid banner index. index = ", bannerIndex);
|
||||
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
auto banner = bannerElement->GetBanner();
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_error("Invalid banner index. index = ", bannerIndex);
|
||||
LOG_ERROR("Invalid banner index. index = ", bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,13 +60,13 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const
|
|||
|
||||
if (!LocationValid(_loc))
|
||||
{
|
||||
log_error("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y);
|
||||
LOG_ERROR("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if (_primaryColour > 31)
|
||||
{
|
||||
log_error("Invalid primary colour: colour = %u", _primaryColour);
|
||||
LOG_ERROR("Invalid primary colour: colour = %u", _primaryColour);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const
|
|||
|
||||
if (bannerElement == nullptr)
|
||||
{
|
||||
log_error("Could not find banner at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
LOG_ERROR("Could not find banner at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction);
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const
|
|||
auto banner = GetBanner(index);
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_error("Invalid banner index: index = %u", index);
|
||||
LOG_ERROR("Invalid banner index: index = %u", index);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ GameActions::Result BannerSetNameAction::Query() const
|
|||
auto banner = GetBanner(_bannerIndex);
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_warning("Invalid banner id, banner id = %d", _bannerIndex);
|
||||
LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE);
|
||||
}
|
||||
return GameActions::Result();
|
||||
|
@ -58,7 +58,7 @@ GameActions::Result BannerSetNameAction::Execute() const
|
|||
auto banner = GetBanner(_bannerIndex);
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_warning("Invalid banner id, banner id = %d", _bannerIndex);
|
||||
LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ GameActions::Result BannerSetStyleAction::Query() const
|
|||
auto banner = GetBanner(_bannerIndex);
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_error("Invalid banner index: index = %u", _bannerIndex);
|
||||
LOG_ERROR("Invalid banner index: index = %u", _bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ GameActions::Result BannerSetStyleAction::Query() const
|
|||
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_error("Could not find banner index = %u", _bannerIndex);
|
||||
LOG_ERROR("Could not find banner index = %u", _bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ GameActions::Result BannerSetStyleAction::Query() const
|
|||
case BannerSetStyleType::PrimaryColour:
|
||||
if (_parameter > 31)
|
||||
{
|
||||
log_error("Invalid primary colour: colour = %u", _parameter);
|
||||
LOG_ERROR("Invalid primary colour: colour = %u", _parameter);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
break;
|
||||
|
@ -78,19 +78,19 @@ GameActions::Result BannerSetStyleAction::Query() const
|
|||
case BannerSetStyleType::TextColour:
|
||||
if (_parameter > 13)
|
||||
{
|
||||
log_error("Invalid text colour: colour = %u", _parameter);
|
||||
LOG_ERROR("Invalid text colour: colour = %u", _parameter);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
break;
|
||||
case BannerSetStyleType::NoEntry:
|
||||
if (tileElement->AsBanner() == nullptr)
|
||||
{
|
||||
log_error("Tile element was not a banner.");
|
||||
LOG_ERROR("Tile element was not a banner.");
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
log_error("Invalid type: %u", _type);
|
||||
LOG_ERROR("Invalid type: %u", _type);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
return res;
|
||||
|
@ -103,7 +103,7 @@ GameActions::Result BannerSetStyleAction::Execute() const
|
|||
auto banner = GetBanner(_bannerIndex);
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_error("Invalid banner index: index = %u", _bannerIndex);
|
||||
LOG_ERROR("Invalid banner index: index = %u", _bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ GameActions::Result BannerSetStyleAction::Execute() const
|
|||
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_error("Could not find banner index = %u", _bannerIndex);
|
||||
LOG_ERROR("Could not find banner index = %u", _bannerIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ GameActions::Result BannerSetStyleAction::Execute() const
|
|||
BannerElement* bannerElement = tileElement->AsBanner();
|
||||
if (bannerElement == nullptr)
|
||||
{
|
||||
log_error("Tile element was not a banner.");
|
||||
LOG_ERROR("Tile element was not a banner.");
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ GameActions::Result BannerSetStyleAction::Execute() const
|
|||
break;
|
||||
}
|
||||
default:
|
||||
log_error("Invalid type: %u", _type);
|
||||
LOG_ERROR("Invalid type: %u", _type);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ GameActions::Result CheatSetAction::Execute() const
|
|||
break;
|
||||
default:
|
||||
{
|
||||
log_error("Unabled cheat: %d", _cheatType.id);
|
||||
LOG_ERROR("Unabled cheat: %d", _cheatType.id);
|
||||
GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -73,7 +73,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const
|
|||
auto tileElement = MapGetFootpathElement(_loc);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_error("Could not find path element.");
|
||||
LOG_ERROR("Could not find path element.");
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const
|
|||
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
log_error("Could not find path element.");
|
||||
LOG_ERROR("Could not find path element.");
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -67,20 +67,20 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const
|
|||
auto tileElement = MapGetFootpathElement(_loc);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_warning("Could not find path element.");
|
||||
LOG_WARNING("Could not find path element.");
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
auto pathElement = tileElement->AsPath();
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
log_warning("Could not find path element.");
|
||||
LOG_WARNING("Could not find path element.");
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if (!pathElement->AdditionIsGhost() && (GetFlags() & GAME_COMMAND_FLAG_GHOST))
|
||||
{
|
||||
log_warning("Tried to remove non ghost during ghost removal.");
|
||||
LOG_WARNING("Tried to remove non ghost during ghost removal.");
|
||||
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
auto res = GameActions::Result();
|
||||
|
@ -101,7 +101,7 @@ GameActions::Result FootpathAdditionRemoveAction::Execute() const
|
|||
|
||||
if (pathElement == nullptr)
|
||||
{
|
||||
log_error("Could not find path element.");
|
||||
LOG_ERROR("Could not find path element.");
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ GameActions::Result FootpathPlaceAction::Query() const
|
|||
|
||||
if (_direction != INVALID_DIRECTION && !DirectionValid(_direction))
|
||||
{
|
||||
log_error("Direction invalid. direction = %u", _direction);
|
||||
LOG_ERROR("Direction invalid. direction = %u", _direction);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) cons
|
|||
auto tileElement = MapGetFootpathElement(CoordsXYZ(_loc, z));
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_error("Something went wrong. Could not refind footpath.");
|
||||
LOG_ERROR("Something went wrong. Could not refind footpath.");
|
||||
return;
|
||||
}
|
||||
pathElement = tileElement->AsPath();
|
||||
|
|
|
@ -280,7 +280,7 @@ namespace GameActions
|
|||
output.Write(temp, strlen(temp) + 1);
|
||||
|
||||
const char* text = static_cast<const char*>(output.GetData());
|
||||
log_verbose("%s", text);
|
||||
LOG_VERBOSE("%s", text);
|
||||
|
||||
network_append_server_log(text);
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ namespace GameActions
|
|||
// As a client we have to wait or send it first.
|
||||
if (!(actionFlags & GameActions::Flags::ClientOnly) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
|
||||
{
|
||||
log_verbose("[%s] GameAction::Execute %s (Out)", GetRealm(), action->GetName());
|
||||
LOG_VERBOSE("[%s] GameAction::Execute %s (Out)", GetRealm(), action->GetName());
|
||||
network_send_game_action(action);
|
||||
|
||||
return result;
|
||||
|
@ -340,7 +340,7 @@ namespace GameActions
|
|||
// at the beginning of the frame, so we have to put them into the queue.
|
||||
if (!(actionFlags & GameActions::Flags::ClientOnly) && !(flags & GAME_COMMAND_FLAG_NETWORKED))
|
||||
{
|
||||
log_verbose("[%s] GameAction::Execute %s (Queue)", GetRealm(), action->GetName());
|
||||
LOG_VERBOSE("[%s] GameAction::Execute %s (Queue)", GetRealm(), action->GetName());
|
||||
Enqueue(action, gCurrentTicks);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -42,7 +42,7 @@ GameActions::Result GuestSetFlagsAction::Query() const
|
|||
auto* peep = TryGetEntity<Guest>(_peepId);
|
||||
if (peep == nullptr)
|
||||
{
|
||||
log_error("Used invalid sprite index for peep: %u", _peepId.ToUnderlying());
|
||||
LOG_ERROR("Used invalid sprite index for peep: %u", _peepId.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE);
|
||||
}
|
||||
return GameActions::Result();
|
||||
|
@ -53,7 +53,7 @@ GameActions::Result GuestSetFlagsAction::Execute() const
|
|||
auto* peep = TryGetEntity<Guest>(_peepId);
|
||||
if (peep == nullptr)
|
||||
{
|
||||
log_error("Used invalid sprite index for peep: %u", _peepId.ToUnderlying());
|
||||
LOG_ERROR("Used invalid sprite index for peep: %u", _peepId.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ GameActions::Result GuestSetNameAction::Query() const
|
|||
auto guest = TryGetEntity<Guest>(_spriteIndex);
|
||||
if (guest == nullptr)
|
||||
{
|
||||
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
||||
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ GameActions::Result GuestSetNameAction::Execute() const
|
|||
auto guest = TryGetEntity<Guest>(_spriteIndex);
|
||||
if (guest == nullptr)
|
||||
{
|
||||
log_warning("Invalid game command for sprite %u", _spriteIndex);
|
||||
LOG_WARNING("Invalid game command for sprite %u", _spriteIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE);
|
||||
}
|
||||
|
||||
|
|
|
@ -110,14 +110,14 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
|
|||
{
|
||||
if (_setting >= LandBuyRightSetting::Count)
|
||||
{
|
||||
log_warning("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
|
||||
LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE);
|
||||
}
|
||||
|
||||
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
log_error("Could not find surface. x = %d, y = %d", loc.x, loc.y);
|
||||
LOG_ERROR("Could not find surface. x = %d, y = %d", loc.x, loc.y);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY&
|
|||
return res;
|
||||
|
||||
default:
|
||||
log_warning("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
|
||||
LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY&
|
|||
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc);
|
||||
if (surfaceElement == nullptr)
|
||||
{
|
||||
log_error("Could not find surface. x = %d, y = %d", loc.x, loc.y);
|
||||
LOG_ERROR("Could not find surface. x = %d, y = %d", loc.x, loc.y);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY&
|
|||
return res;
|
||||
}
|
||||
default:
|
||||
log_warning("Tried calling set land rights with an incorrect setting. setting = %u", _setting);
|
||||
LOG_WARNING("Tried calling set land rights with an incorrect setting. setting = %u", _setting);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -606,7 +606,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const
|
|||
break;
|
||||
}
|
||||
default:
|
||||
log_error("Invalid map selection %u", _selectionType);
|
||||
LOG_ERROR("Invalid map selection %u", _selectionType);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, std::get<StringId>(res.ErrorTitle), STR_NONE);
|
||||
} // switch selectionType
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
|
|||
|
||||
if (_primaryColour >= COLOUR_COUNT || _secondaryColour >= COLOUR_COUNT || _tertiaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
log_error(
|
||||
LOG_ERROR(
|
||||
"Invalid game command for scenery placement, primaryColour = %u, secondaryColour = %u", _primaryColour,
|
||||
_secondaryColour);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
|
@ -75,14 +75,14 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
|
|||
|
||||
if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS)
|
||||
{
|
||||
log_error("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
|
||||
LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
auto* sceneryEntry = GetLargeSceneryEntry(_sceneryType);
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
log_error("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
|
||||
LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
|
|||
{
|
||||
if (HasReachedBannerLimit())
|
||||
{
|
||||
log_error("No free banners available");
|
||||
LOG_ERROR("No free banners available");
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const
|
|||
|
||||
if (!CheckMapCapacity(sceneryEntry->tiles, totalNumTiles))
|
||||
{
|
||||
log_error("No free map elements available");
|
||||
LOG_ERROR("No free map elements available");
|
||||
return GameActions::Result(
|
||||
GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED);
|
||||
}
|
||||
|
@ -194,13 +194,13 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
|
|||
auto* sceneryEntry = GetLargeSceneryEntry(_sceneryType);
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
log_error("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
|
||||
LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
if (sceneryEntry->tiles == nullptr)
|
||||
{
|
||||
log_error("Invalid large scenery object, sceneryType = %u", _sceneryType);
|
||||
LOG_ERROR("Invalid large scenery object, sceneryType = %u", _sceneryType);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const
|
|||
banner = CreateBanner();
|
||||
if (banner == nullptr)
|
||||
{
|
||||
log_error("No free banners available");
|
||||
LOG_ERROR("No free banners available");
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_TOO_MANY_BANNERS_IN_GAME);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const
|
|||
TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_warning("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
|
||||
LOG_WARNING("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
|
|||
TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_warning("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
|
||||
LOG_WARNING("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y);
|
||||
return GameActions::Result(
|
||||
GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const
|
|||
}
|
||||
else
|
||||
{
|
||||
log_error("Tile not found when trying to remove element!");
|
||||
LOG_ERROR("Tile not found when trying to remove element!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,25 +67,25 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
|
|||
auto mapSizeMax = GetMapSizeMaxXY();
|
||||
if (_loc.x < 0 || _loc.y < 0 || _loc.x > mapSizeMax.x || _loc.y > mapSizeMax.y)
|
||||
{
|
||||
log_error("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y);
|
||||
LOG_ERROR("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if (_primaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
log_error("Invalid primary colour: colour = %u", _primaryColour);
|
||||
LOG_ERROR("Invalid primary colour: colour = %u", _primaryColour);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if (_secondaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
log_error("Invalid secondary colour: colour = %u", _secondaryColour);
|
||||
LOG_ERROR("Invalid secondary colour: colour = %u", _secondaryColour);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
if (_tertiaryColour >= COLOUR_COUNT)
|
||||
{
|
||||
log_error("Invalid tertiary colour: colour = %u", _tertiaryColour);
|
||||
LOG_ERROR("Invalid tertiary colour: colour = %u", _tertiaryColour);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
|
|||
|
||||
if (largeElement == nullptr)
|
||||
{
|
||||
log_error(
|
||||
LOG_ERROR(
|
||||
"Could not find large scenery at: x = %d, y = %d, z = %d, direction = %d, tileIndex = %u", _loc.x, _loc.y, _loc.z,
|
||||
_loc.direction, _tileIndex);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
|
@ -108,7 +108,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
|
|||
|
||||
if (sceneryEntry == nullptr)
|
||||
{
|
||||
log_error("Could not find scenery object. type = %u", largeElement->GetEntryIndex());
|
||||
LOG_ERROR("Could not find scenery object. type = %u", largeElement->GetEntryIndex());
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
}
|
||||
// Work out the base tile coordinates (Tile with index 0)
|
||||
|
@ -143,7 +143,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting)
|
|||
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
log_error(
|
||||
LOG_ERROR(
|
||||
"Large scenery element not found at: x = %d, y = %d, z = %d, direction = %d", _loc.x, _loc.y, _loc.z,
|
||||
_loc.direction);
|
||||
return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue