Move stuff that affects the whole screen/viewport out of Drawing.{cpp,h}

This commit is contained in:
Gymnasiast committed 2026-09-06 19:40:56 +02:00
1 parent ef7707a9df
commit 83cbac90ec
56 files changed
+183 -131

No files matched your search

+1
View File
@@ -35,6 +35,7 @@
#include <openrct2/audio/AudioMixer.h>
#include <openrct2/config/Config.h>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/IDrawingEngine.h>
#include <openrct2/drawing/NewDrawing.h>
+1 -1
View File
@@ -27,7 +27,7 @@
#include <openrct2/config/Config.h>
#include <openrct2/core/Console.hpp>
#include <openrct2/core/Guard.hpp>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/NewDrawing.h>
#include <openrct2/interface/Viewport.h>
#include <openrct2/ride/Ride.h>
#include <openrct2/ride/RideConstruction.h>
+6 -6
View File
@@ -30,7 +30,7 @@
#include <openrct2/audio/Audio.h>
#include <openrct2/config/Config.h>
#include <openrct2/core/EnumUtils.hpp>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/interface/Chat.h>
#include <openrct2/interface/Screenshot.h>
#include <openrct2/interface/Viewport.h>
@@ -189,7 +189,7 @@ static void ShortcutRemoveTopBottomToolbarToggle()
ContextOpenWindow(WindowClass::editorStepController); // next step
}
}
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
static void ShortcutAdjustLand()
@@ -459,7 +459,7 @@ static void ShortcutScaleUp()
{
Config::Get().general.windowScale += 0.25f;
Config::Save();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
ContextTriggerResize();
ContextUpdateCursorScale();
}
@@ -469,7 +469,7 @@ static void ShortcutScaleDown()
Config::Get().general.windowScale -= 0.25f;
Config::Get().general.windowScale = std::max(0.5f, Config::Get().general.windowScale);
Config::Save();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
ContextTriggerResize();
ContextUpdateCursorScale();
}
@@ -739,7 +739,7 @@ static void ShortcutToggleTransparentWater()
Config::Get().general.transparentWater ^= 1;
Config::Save();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
#pragma endregion
@@ -805,7 +805,7 @@ void ShortcutManager::registerDefaultShortcuts()
ChatToggle();
}
});
registerShortcut(ShortcutId::kInterfaceScaleToggleWindowMode, STR_SHORTCUT_WINDOWED_MODE_TOGGLE, "ALT+RETURN", ToggleWindowedMode);
registerShortcut(ShortcutId::kInterfaceScaleToggleWindowMode, STR_SHORTCUT_WINDOWED_MODE_TOGGLE, "ALT+RETURN", Drawing::ToggleWindowedMode);
registerShortcut(ShortcutId::kInterfaceScaleIncrease, STR_SHORTCUT_SCALE_UP, ShortcutScaleUp);
registerShortcut(ShortcutId::kInterfaceScaleDecrease, STR_SHORTCUT_SCALE_DOWN, ShortcutScaleDown);
registerShortcut(ShortcutId::kInterfaceOpenLand, STR_SHORTCUT_ADJUST_LAND, "F1", ShortcutAdjustLand);
+5 -5
View File
@@ -19,7 +19,7 @@
#include <openrct2/config/Config.h>
#include <openrct2/core/Path.hpp>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/interface/WindowTypes.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/StringIds.h>
@@ -286,7 +286,7 @@ namespace OpenRCT2::Ui::FileBrowser
{
InvokeCallback(ModalResult::ok, pathBuffer);
windowMgr->CloseByClass(WindowClass::loadsave);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
else
{
@@ -310,7 +310,7 @@ namespace OpenRCT2::Ui::FileBrowser
if (editorScene->LoadLandscape(pathBuffer))
{
gCurrentLoadedPath = pathBuffer;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
InvokeCallback(ModalResult::ok, pathBuffer);
}
else
@@ -381,7 +381,7 @@ namespace OpenRCT2::Ui::FileBrowser
gFirstTimeSaving = false;
windowMgr->CloseByClass(WindowClass::loadsave);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
InvokeCallback(ModalResult::ok, pathBuffer);
}
@@ -400,7 +400,7 @@ namespace OpenRCT2::Ui::FileBrowser
{
gCurrentLoadedPath = pathBuffer;
windowMgr->CloseByClass(WindowClass::loadsave);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
InvokeCallback(ModalResult::ok, pathBuffer);
}
else
+3 -2
View File
@@ -20,9 +20,10 @@
#include <openrct2/config/Config.h>
#include <openrct2/core/UTF8.h>
#include <openrct2/drawing/ColourMap.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.String.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/FilterPaletteIds.h>
#include <openrct2/drawing/NewDrawing.h>
#include <openrct2/drawing/Rectangle.h>
#include <openrct2/drawing/Text.h>
#include <openrct2/interface/ColourWithFlags.h>
@@ -280,7 +281,7 @@ void InGameConsole::Update()
{
_lastMainViewport = mainViewport->viewPos;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
}
}
+2 -1
View File
@@ -22,6 +22,7 @@
#include <openrct2/core/Json.hpp>
#include <openrct2/core/Path.hpp>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/interface/ColourWithFlags.h>
#include <openrct2/interface/WindowBase.h>
@@ -621,7 +622,7 @@ namespace OpenRCT2::Ui
CurrentTheme = theme;
CurrentThemePath.clear();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
static void LoadTheme(const std::string& path)
+8 -7
View File
@@ -12,6 +12,7 @@
#include <openrct2-ui/windows/Windows.h>
#include <openrct2/Context.h>
#include <openrct2/core/Guard.hpp>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.String.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Font.h>
@@ -76,37 +77,37 @@ namespace OpenRCT2::Ui::Windows
{
case WIDX_TOGGLE_SHOW_WIDE_PATHS:
gPaintWidePathsAsGhost = !gPaintWidePathsAsGhost;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_TOGGLE_SHOW_BLOCKED_TILES:
gPaintBlockedTiles = !gPaintBlockedTiles;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS:
gShowSupportSegmentHeights = !gShowSupportSegmentHeights;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_TOGGLE_SHOW_BOUND_BOXES:
gPaintBoundingBoxes = !gPaintBoundingBoxes;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_TOGGLE_SHOW_DIRTY_VISUALS:
gShowDirtyVisuals = !gShowDirtyVisuals;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_TOGGLE_STABLE_PAINT_SORT:
gPaintStableSort = !gPaintStableSort;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_TOGGLE_FORCE_REDRAW:
gPaintForceRedraw = !gPaintForceRedraw;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
}
}
@@ -26,6 +26,7 @@
#include <openrct2/core/Path.hpp>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/ColourMap.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Palette.h>
#include <openrct2/drawing/Rectangle.h>
@@ -487,7 +488,7 @@ namespace OpenRCT2::Ui::Windows
{
objectManager.UnloadObjects({ descriptor });
objectManager.LoadObject(descriptor, entryIndex);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
}
break;
@@ -18,6 +18,7 @@
#include <openrct2/OpenRCT2.h>
#include <openrct2/SpriteIds.h>
#include <openrct2/actions/ResultWithMessage.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Rectangle.h>
#include <openrct2/drawing/Text.h>
+2 -1
View File
@@ -19,6 +19,7 @@
#include <openrct2/core/FileSystem.hpp>
#include <openrct2/core/UnitConversion.h>
#include <openrct2/drawing/ColourMap.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Text.h>
#include <openrct2/localisation/Formatter.h>
@@ -330,7 +331,7 @@ namespace OpenRCT2::Ui::Windows
}
MapGenerator::generate(&mapgenSettings);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
#pragma region Base page
+1
View File
@@ -29,6 +29,7 @@
#include <openrct2/config/Config.h>
#include <openrct2/core/EnumUtils.hpp>
#include <openrct2/drawing/ColourMap.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.String.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/IDrawingEngine.h>
+4 -3
View File
@@ -19,6 +19,7 @@
#include <openrct2/actions/GameActionRunner.h>
#include <openrct2/actions/peep/StaffSetPatrolAreaAction.h>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Text.h>
#include <openrct2/entity/EntityRegistry.h>
@@ -191,7 +192,7 @@ namespace OpenRCT2::Ui::Windows
{
HideGridlines();
ClearPatrolAreaToRender();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void onToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override
@@ -241,7 +242,7 @@ namespace OpenRCT2::Ui::Windows
if (PatrolAreaToolIsActive())
{
SetPatrolAreaToRender(_staffId);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
else
{
@@ -249,7 +250,7 @@ namespace OpenRCT2::Ui::Windows
{
ShowGridlines();
SetPatrolAreaToRender(_staffId);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
}
}
+1
View File
@@ -41,6 +41,7 @@
#include <openrct2/core/String.hpp>
#include <openrct2/core/UnitConversion.h>
#include <openrct2/drawing/ColourMap.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.Sprite.h>
#include <openrct2/drawing/Drawing.String.h>
#include <openrct2/drawing/Drawing.h>
+1
View File
@@ -26,6 +26,7 @@
#include <openrct2/config/Config.h>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/ColourMap.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Rectangle.h>
#include <openrct2/drawing/RenderTarget.h>
+1
View File
@@ -16,6 +16,7 @@
#include <openrct2/Context.h>
#include <openrct2/SpriteIds.h>
#include <openrct2/drawing/ColourMap.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.String.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Rectangle.h>
+4 -3
View File
@@ -12,6 +12,7 @@
#include <openrct2-ui/interface/Window.h>
#include <openrct2-ui/windows/Windows.h>
#include <openrct2/config/Config.h>
#include <openrct2/drawing/Drawing.Screen.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/drawing/Text.h>
#include <openrct2/interface/Viewport.h>
@@ -128,7 +129,7 @@ namespace OpenRCT2::Ui::Windows
_previousClipSelectionB = gClipSelectionB;
gClipSelectionA = { 0, 0 };
gClipSelectionB = { kMaximumMapSizeBig - 1, kMaximumMapSizeBig - 1 };
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_CLIP_CLEAR:
if (IsActive())
@@ -138,7 +139,7 @@ namespace OpenRCT2::Ui::Windows
}
gClipSelectionA = { 0, 0 };
gClipSelectionB = { kMaximumMapSizeBig - 1, kMaximumMapSizeBig - 1 };
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case WIDX_CLIP_SEE_THROUGH_CHECKBOX_ENABLE:
{
@@ -263,7 +264,7 @@ namespace OpenRCT2::Ui::Windows
gClipSelectionB = gMapSelectPositionB;
_toolActive = false;
ToolCancel();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void onPrepareDraw() override
@@ -17,7 +17,7 @@
#include "../../core/EnumUtils.hpp"
#include "../../core/Guard.hpp"
#include "../../drawing/Colour.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../entity/Duck.h"
#include "../../entity/EntityList.h"
#include "../../entity/EntityRegistry.h"
@@ -457,7 +457,7 @@ namespace OpenRCT2::GameActions
}
}
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void CheatSetAction::WaterPlants() const
@@ -473,7 +473,7 @@ namespace OpenRCT2::GameActions
}
} while (TileElementIteratorNext(&it));
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void CheatSetAction::FixVandalism() const
@@ -492,7 +492,7 @@ namespace OpenRCT2::GameActions
it.element->asPath()->setIsBroken(false);
} while (TileElementIteratorNext(&it));
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void CheatSetAction::RemoveLitter(GameState_t& gameState) const
@@ -519,7 +519,7 @@ namespace OpenRCT2::GameActions
} while (TileElementIteratorNext(&it));
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void CheatSetAction::FixBrokenRides(GameState_t& gameState) const
@@ -766,7 +766,7 @@ namespace OpenRCT2::GameActions
auto* windowMgr = Ui::GetWindowManager();
windowMgr->InvalidateByClass(WindowClass::ride);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void CheatSetAction::SetStaffSpeed(uint8_t value) const
@@ -855,6 +855,6 @@ namespace OpenRCT2::GameActions
}
} while (TileElementIteratorNext(&it));
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
} // namespace OpenRCT2::GameActions
@@ -11,7 +11,7 @@
#include "../../Context.h"
#include "../../GameState.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../scripting/ScriptEngine.h"
#include "../../ui/UiContext.h"
#include "../../ui/WindowManager.h"
@@ -88,7 +88,7 @@ namespace OpenRCT2::GameActions
Park::UpdateSize(park);
windowManager->BroadcastIntent(Intent(INTENT_ACTION_MAP));
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
auto& hookEngine = ctx->GetScriptEngine().GetHookEngine();
if (hookEngine.HasSubscriptions(OpenRCT2::Scripting::HookType::mapResize))
@@ -10,7 +10,7 @@
#include "ParkSetNameAction.h"
#include "../../Diagnostic.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../world/Park.h"
#include "../../world/ParkData.h"
@@ -54,7 +54,7 @@ namespace OpenRCT2::GameActions
{
park.name = _name;
Drawing::ScrollingText::invalidate();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
return Result();
}
@@ -12,7 +12,7 @@
#include "../../Context.h"
#include "../../Diagnostic.h"
#include "../../GameState.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../entity/EntityRegistry.h"
#include "../../localisation/StringIds.h"
#include "../../windows/Intent.h"
@@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions
// Easter egg functions are for guests only
guest->handleEasterEggName();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST);
ContextBroadcastIntent(&intent);
@@ -11,7 +11,7 @@
#include "../../Diagnostic.h"
#include "../../GameState.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../entity/EntityRegistry.h"
#include "../../entity/Staff.h"
#include "../../ui/WindowManager.h"
@@ -80,7 +80,7 @@ namespace OpenRCT2::GameActions
PeepEntityRemove(staff);
// Due to patrol areas best to invalidate the whole screen on removal of staff
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return Result();
}
@@ -10,7 +10,7 @@
#include "StaffSetColourAction.h"
#include "../../Diagnostic.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../entity/EntityList.h"
#include "../../entity/Staff.h"
#include "../../localisation/StringIds.h"
@@ -70,7 +70,7 @@ namespace OpenRCT2::GameActions
}
}
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return Result();
}
} // namespace OpenRCT2::GameActions
@@ -12,7 +12,7 @@
#include "../../Context.h"
#include "../../Diagnostic.h"
#include "../../GameState.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../entity/EntityRegistry.h"
#include "../../entity/Staff.h"
#include "../../localisation/StringIds.h"
@@ -82,7 +82,7 @@ namespace OpenRCT2::GameActions
return Result(Status::unknown, STR_CANT_NAME_GUEST, kStringIdNone);
}
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST);
ContextBroadcastIntent(&intent);
@@ -11,7 +11,7 @@
#include "../../Diagnostic.h"
#include "../../GameState.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../entity/EntityRegistry.h"
#include "../../entity/PatrolArea.h"
#include "../../entity/Staff.h"
@@ -99,7 +99,7 @@ namespace OpenRCT2::GameActions
break;
case StaffSetPatrolAreaMode::clearAll:
staff->clearPatrolArea();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
}
UpdateConsolidatedPatrolAreas();
@@ -13,7 +13,7 @@
#include "../../Diagnostic.h"
#include "../../Game.h"
#include "../../GameState.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../drawing/ScrollingText.h"
#include "../../entity/EntityList.h"
#include "../../management/NewsItem.h"
@@ -170,7 +170,7 @@ namespace OpenRCT2::GameActions
windowMgr->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST));
Drawing::ScrollingText::invalidate();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return res;
}
@@ -10,7 +10,7 @@
#include "RideSetAppearanceAction.h"
#include "../../Diagnostic.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../localisation/StringIds.h"
#include "../../ride/Ride.h"
#include "../../ui/WindowManager.h"
@@ -100,15 +100,15 @@ namespace OpenRCT2::GameActions
{
case RideSetAppearanceType::trackColourMain:
ride->trackColours[_index].main = static_cast<Drawing::Colour>(_value);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case RideSetAppearanceType::trackColourAdditional:
ride->trackColours[_index].additional = static_cast<Drawing::Colour>(_value);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case RideSetAppearanceType::trackColourSupports:
ride->trackColours[_index].supports = static_cast<Drawing::Colour>(_value);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case RideSetAppearanceType::vehicleColourBody:
ride->vehicleColours[_index].Body = static_cast<Drawing::Colour>(_value);
@@ -132,7 +132,7 @@ namespace OpenRCT2::GameActions
break;
case RideSetAppearanceType::entranceStyle:
ride->entranceStyle = _value;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
case RideSetAppearanceType::sellingItemColourIsRandom:
ride->flags.set(RideFlag::randomShopColours, static_cast<bool>(_value));
@@ -10,7 +10,7 @@
#include "RideSetNameAction.h"
#include "../../Diagnostic.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../drawing/ScrollingText.h"
#include "../../localisation/StringIds.h"
#include "../../ride/Ride.h"
@@ -79,7 +79,7 @@ namespace OpenRCT2::GameActions
}
Drawing::ScrollingText::invalidate();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
// Refresh windows that display ride name
auto windowManager = Ui::GetWindowManager();
@@ -12,7 +12,7 @@
#include "../../Context.h"
#include "../../Diagnostic.h"
#include "../../GameState.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../object/MusicObject.h"
#include "../../object/ObjectManager.h"
#include "../../ride/Ride.h"
@@ -237,7 +237,7 @@ namespace OpenRCT2::GameActions
case RideSetSetting::rideType:
ride->type = _value;
ride->updateRideTypeForAllPieces();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
break;
}
@@ -14,7 +14,7 @@
#include "../../Diagnostic.h"
#include "../../GameState.h"
#include "../../core/EnumUtils.hpp"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../localisation/StringIds.h"
#include "../../management/Research.h"
#include "../../object/ObjectManager.h"
@@ -222,7 +222,7 @@ namespace OpenRCT2::GameActions
intent.PutExtra(INTENT_EXTRA_RIDE_ID, _rideIndex.ToUnderlying());
ContextBroadcastIntent(&intent);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return res;
}
@@ -11,7 +11,7 @@
#include "../../Context.h"
#include "../../Diagnostic.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../drawing/ScrollingText.h"
#include "../../localisation/StringIds.h"
#include "../../windows/Intent.h"
@@ -93,7 +93,7 @@ namespace OpenRCT2::GameActions
ContextBroadcastIntent(&intent);
Drawing::ScrollingText::invalidate();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return Result();
}
@@ -11,7 +11,7 @@
#include "../../Context.h"
#include "../../Diagnostic.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../drawing/ScrollingText.h"
#include "../../localisation/StringIdType.h"
#include "../../management/Finance.h"
@@ -179,7 +179,7 @@ namespace OpenRCT2::GameActions
ContextBroadcastIntent(&intent);
Drawing::ScrollingText::invalidate();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return res;
}
@@ -10,7 +10,7 @@
#include "SignSetNameAction.h"
#include "../../Diagnostic.h"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../drawing/ScrollingText.h"
#include "../../localisation/StringIds.h"
#include "../../world/Banner.h"
@@ -108,7 +108,7 @@ namespace OpenRCT2::GameActions
}
Drawing::ScrollingText::invalidate();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return Result();
}
} // namespace OpenRCT2::GameActions
+43
View File
@@ -0,0 +1,43 @@
/*****************************************************************************
* Copyright (c) 2014-2026 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "Drawing.Screen.h"
#include "../Context.h"
#include "../config/Config.h"
#include "../interface/ScreenCoords.hpp"
#include "NewDrawing.h"
#include "Palette.h"
namespace OpenRCT2::Drawing
{
/**
*
* rct2: 0x006ED7E5
*/
void GfxInvalidateScreen()
{
GfxSetDirtyBlocks({ { 0, 0 }, { ContextGetWidth(), ContextGetHeight() } });
}
void RefreshVideo()
{
ContextRecreateWindow();
DrawingEngineSetPalette(gPalette);
GfxInvalidateScreen();
}
void ToggleWindowedMode()
{
int32_t rt = Config::Get().general.fullscreenMode == 0 ? 2 : 0;
ContextSetFullscreenMode(rt);
Config::Get().general.fullscreenMode = rt;
Config::Save();
}
} // namespace OpenRCT2::Drawing
+17
View File
@@ -0,0 +1,17 @@
/*****************************************************************************
* Copyright (c) 2014-2026 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
namespace OpenRCT2::Drawing
{
void GfxInvalidateScreen();
void RefreshVideo();
void ToggleWindowedMode();
} // namespace OpenRCT2::Drawing
-24
View File
@@ -410,15 +410,6 @@ void GfxFilterPixel(RenderTarget& rt, const ScreenCoordsXY& coords, FilterPalett
Rectangle::filter(rt, { coords, coords }, palette);
}
/**
*
* rct2: 0x006ED7E5
*/
void GfxInvalidateScreen()
{
GfxSetDirtyBlocks({ { 0, 0 }, { ContextGetWidth(), ContextGetHeight() } });
}
/*
*
* rct2: 0x006EE53B
@@ -506,21 +497,6 @@ FilterPaletteID GetGlassPaletteId(Colour c)
return kGlassPaletteIds[EnumValue(c)];
}
void RefreshVideo()
{
ContextRecreateWindow();
DrawingEngineSetPalette(Drawing::gPalette);
GfxInvalidateScreen();
}
void ToggleWindowedMode()
{
int32_t rt = Config::Get().general.fullscreenMode == 0 ? 2 : 0;
ContextSetFullscreenMode(rt);
Config::Get().general.fullscreenMode = rt;
Config::Save();
}
void DebugRT(RenderTarget& rt)
{
ScreenCoordsXY topLeft = { rt.x, rt.y };
-5
View File
@@ -48,8 +48,6 @@ extern bool gPaintForceRedraw;
bool ClipRenderTarget(
OpenRCT2::Drawing::RenderTarget& dst, OpenRCT2::Drawing::RenderTarget& src, const ScreenCoordsXY& coords, int32_t width,
int32_t height);
void GfxSetDirtyBlocks(const ScreenRect& rect);
void GfxInvalidateScreen();
// other
void GfxClear(OpenRCT2::Drawing::RenderTarget& rt, OpenRCT2::Drawing::PaletteIndex paletteIndex);
@@ -76,7 +74,4 @@ void FASTCALL GfxDrawSpriteRawMasked(
std::optional<uint32_t> GetPaletteG1Index(OpenRCT2::Drawing::FilterPaletteID paletteId);
std::optional<OpenRCT2::Drawing::PaletteMap> GetPaletteMapForColour(OpenRCT2::Drawing::FilterPaletteID paletteId);
void RefreshVideo();
void ToggleWindowedMode();
void DebugRT(OpenRCT2::Drawing::RenderTarget& rt);
+2
View File
@@ -17,6 +17,7 @@ namespace OpenRCT2::Drawing
}
enum class DrawingEngine : int32_t;
struct ScreenRect;
DrawingEngine drawing_engine_get_type();
bool DrawingEngineRequiresNewWindow(DrawingEngine srcEngine, DrawingEngine dstEngine);
@@ -30,3 +31,4 @@ OpenRCT2::Drawing::RenderTarget& DrawingEngineGetRT();
bool DrawingEngineHasDirtyOptimisations();
void DrawingEngineInvalidateImage(uint32_t image);
void DrawingEngineSetVSync(bool vsync);
void GfxSetDirtyBlocks(const ScreenRect& rect);
+1 -1
View File
@@ -17,8 +17,8 @@
#include "../object/WaterEntry.h"
#include "../util/Util.h"
#include "../world/Weather.h"
#include "Drawing.Screen.h"
#include "Drawing.Sprite.h"
#include "Drawing.h"
#include "FilterPaletteIds.h"
#include "LightFX.h"
#include "NewDrawing.h"
+1
View File
@@ -8,6 +8,7 @@
#include "Drawing.Sprite.h"
#include "Drawing.h"
#include "ImageId.hpp"
#include "NewDrawing.h"
#include "RenderTarget.h"
namespace OpenRCT2::Drawing
+1
View File
@@ -17,6 +17,7 @@
#include "../interface/Window.h"
#include "../scenes/intro/IntroScene.h"
#include "BlendColourMap.h"
#include "Drawing.Screen.h"
#include "Drawing.Sprite.h"
#include "Drawing.String.h"
#include "Drawing.h"
+2 -2
View File
@@ -21,7 +21,7 @@
#include "../core/EnumUtils.hpp"
#include "../core/Guard.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../drawing/Drawing.Screen.h"
#include "../drawing/PickupPeep.h"
#include "../entity/Balloon.h"
#include "../entity/EntityList.h"
@@ -2581,7 +2581,7 @@ namespace OpenRCT2
auto intent = Intent(INTENT_ACTION_REFRESH_GUEST_LIST);
ContextBroadcastIntent(&intent);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
void IncrementGuestsInPark()
+1 -1
View File
@@ -15,8 +15,8 @@
#include "../audio/AudioMixer.h"
#include "../core/UTF8.h"
#include "../drawing/Drawing.String.h"
#include "../drawing/Drawing.h"
#include "../drawing/FilterPaletteIds.h"
#include "../drawing/NewDrawing.h"
#include "../drawing/Rectangle.h"
#include "../drawing/Text.h"
#include "../interface/ColourWithFlags.h"
@@ -32,7 +32,7 @@
#include "../core/Guard.hpp"
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../drawing/Drawing.Screen.h"
#include "../drawing/Image.h"
#include "../entity/Balloon.h"
#include "../entity/EntityList.h"
@@ -922,7 +922,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar
float newScale = static_cast<float>(0.001 * std::trunc(1000 * double_val[0]));
Config::Get().general.windowScale = std::clamp(newScale, 0.5f, 5.0f);
Config::Save();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
ContextTriggerResize();
ContextUpdateCursorScale();
console.Execute("get window_scale");
@@ -1020,7 +1020,7 @@ static void ConsoleCommandSet(InteractiveConsole& console, const arguments_t& ar
console.WriteLineError("Invalid variable.");
}
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
else
{
@@ -1114,7 +1114,7 @@ static void ConsoleCommandLoadObject(InteractiveConsole& console, const argument
ContextBroadcastIntent(&ridesIntent);
gWindowUpdateTicks = 0;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
console.WriteLine("Object file loaded.");
}
+2 -1
View File
@@ -17,6 +17,7 @@
#include "../core/Guard.hpp"
#include "../core/JobPool.h"
#include "../core/Numerics.hpp"
#include "../drawing/Drawing.Screen.h"
#include "../drawing/Drawing.Sprite.h"
#include "../drawing/Drawing.h"
#include "../drawing/IDrawingEngine.h"
@@ -472,7 +473,7 @@ namespace OpenRCT2
}
else
{
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
}
+2 -2
View File
@@ -15,8 +15,8 @@
#include "../OpenRCT2.h"
#include "../audio/Audio.h"
#include "../config/Config.h"
#include "../drawing/Drawing.Screen.h"
#include "../drawing/Drawing.String.h"
#include "../drawing/Drawing.h"
#include "../drawing/RenderTarget.h"
#include "../entity/EntityRegistry.h"
#include "../ride/RideAudio.h"
@@ -870,7 +870,7 @@ static constexpr float kWindowScrollLocations[][2] = {
WindowResizeGuiCentredWindows(width, height);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
/**
+1 -1
View File
@@ -1,7 +1,7 @@
#include "WindowBase.h"
#include "../config/Config.h"
#include "../drawing/Drawing.h"
#include "../drawing/NewDrawing.h"
#include "Cursors.h"
#include "Viewport.h"
+2
View File
@@ -253,6 +253,7 @@
<ClInclude Include="drawing\Colour.h" />
<ClInclude Include="drawing\ColourMap.h" />
<ClInclude Include="drawing\Drawing.h" />
<ClInclude Include="drawing\Drawing.Screen.h" />
<ClInclude Include="drawing\Drawing.String.h" />
<ClInclude Include="drawing\FilterPaletteIds.h" />
<ClInclude Include="drawing\Font.h" />
@@ -901,6 +902,7 @@
<ClCompile Include="drawing\Colour.cpp" />
<ClCompile Include="drawing\ColourMap.cpp" />
<ClCompile Include="drawing\Drawing.cpp" />
<ClCompile Include="drawing\Drawing.Screen.cpp" />
<ClCompile Include="drawing\Drawing.Sprite.BMP.cpp" />
<ClCompile Include="drawing\Drawing.Sprite.cpp" />
<ClCompile Include="drawing\Drawing.Sprite.RLE.cpp" />
+2 -2
View File
@@ -24,7 +24,7 @@
#include "../core/File.h"
#include "../core/Guard.hpp"
#include "../core/Json.hpp"
#include "../drawing/Drawing.h"
#include "../drawing/Drawing.Screen.h"
#include "../entity/EntityRegistry.h"
#include "../entity/EntityTweener.h"
#include "../localisation/Formatter.h"
@@ -204,7 +204,7 @@ namespace OpenRCT2::Network
scriptEngine.RemoveNetworkPlugins();
#endif
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
_requireClose = false;
}
+1
View File
@@ -16,6 +16,7 @@
#include "../drawing/Drawing.String.h"
#include "../drawing/Drawing.h"
#include "../drawing/IDrawingEngine.h"
#include "../drawing/NewDrawing.h"
#include "../drawing/Palette.h"
#include "../drawing/PickupPeep.h"
#include "../drawing/Text.h"
+3 -3
View File
@@ -23,7 +23,7 @@
#include "../core/OrcaStream.hpp"
#include "../core/Path.hpp"
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../drawing/Drawing.Screen.h"
#include "../entity/Balloon.h"
#include "../entity/Duck.h"
#include "../entity/EntityList.h"
@@ -2776,10 +2776,10 @@ int32_t ScenarioSave(GameState_t& gameState, u8string_view path, int32_t flags)
Formatter ft;
ft.Add<const char*>(e.what());
ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_STRING, ft);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
if (result && !(flags & S6_SAVE_FLAG_AUTOMATIC))
{
+2 -2
View File
@@ -24,7 +24,7 @@
#include "../core/EnumUtils.hpp"
#include "../core/Guard.hpp"
#include "../core/Numerics.hpp"
#include "../drawing/Drawing.h"
#include "../drawing/Drawing.Screen.h"
#include "../entity/EntityList.h"
#include "../entity/EntityRegistry.h"
#include "../entity/Peep.h"
@@ -4453,7 +4453,7 @@ namespace OpenRCT2
const auto& rtd = ride.getRideTypeDescriptor();
if (rtd.specialType == RtdSpecialType::spaceRings || rtd.flags.has(RtdFlag::vehicleIsIntegral))
{
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
auto& entities = getGameState().entities;
+3 -3
View File
@@ -9,7 +9,7 @@
#include "../Context.h"
#include "../Diagnostic.h"
#include "../drawing/Drawing.h"
#include "../drawing/Drawing.Screen.h"
#include "../interface/Viewport.h"
#include "../localisation/Formatter.h"
#include "../localisation/StringIds.h"
@@ -111,7 +111,7 @@ void TrackDesignSaveSelectNearbyScenery(RideId rideIndex)
}
} while (TileElementIteratorNext(&it));
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
/**
@@ -121,7 +121,7 @@ void TrackDesignSaveSelectNearbyScenery(RideId rideIndex)
void TrackDesignSaveResetScenery()
{
TrackDesignSaveInit();
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
bool TrackDesignSaveContainsTileElement(const TileElement* tileElement)
@@ -16,7 +16,7 @@
#include "../../actions/ResultWithMessage.h"
#include "../../audio/Audio.h"
#include "../../core/EnumUtils.hpp"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../drawing/Palette.h"
#include "../../entity/EntityList.h"
#include "../../entity/Guest.h"
@@ -721,7 +721,7 @@ namespace OpenRCT2::Editor
}
gameState.editorStep = Editor::Step::rollerCoasterDesigner;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
else
{
@@ -731,7 +731,7 @@ namespace OpenRCT2::Editor
ContextBroadcastIntent(&intent);
gameState.editorStep = Editor::Step::landscapeEditor;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
}
+2 -2
View File
@@ -18,7 +18,7 @@
#include "../../audio/Audio.h"
#include "../../config/Config.h"
#include "../../core/Console.hpp"
#include "../../drawing/Drawing.h"
#include "../../drawing/Drawing.Screen.h"
#include "../../drawing/Palette.h"
#include "../../interface/Screenshot.h"
#include "../../interface/Window.h"
@@ -311,7 +311,7 @@ bool TitleScene::TryLoadSequence(bool loadPreview)
Config::Get().interface.currentTitleSequencePreset = configId;
}
_currentSequence = targetSequence;
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return true;
}
targetSequence = (targetSequence + 1) % numSequences;
@@ -14,7 +14,7 @@
#include "../../../Context.h"
#include "../../../GameState.h"
#include "../../../core/EnumMap.hpp"
#include "../../../drawing/Drawing.h"
#include "../../../drawing/Drawing.Screen.h"
#include "../../../ui/WindowManager.h"
#include "../../../windows/Intent.h"
#include "../../../world/Park.h"
@@ -322,7 +322,7 @@ namespace OpenRCT2::Scripting
if (park.name != valueStr)
{
park.name = std::move(valueStr);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
return JS_UNDEFINED;
}
@@ -343,7 +343,7 @@ namespace OpenRCT2::Scripting
const auto flag = kParkFlagMap[key];
auto& gameState = getGameState();
gameState.park.flags.set(flag, value);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
return JS_UNDEFINED;
}
+2 -2
View File
@@ -18,7 +18,7 @@
#include "../audio/AudioChannel.h"
#include "../config/Config.h"
#include "../core/EnumUtils.hpp"
#include "../drawing/Drawing.h"
#include "../drawing/Drawing.Screen.h"
#include "../drawing/FilterPaletteIds.h"
#include "../object/ClimateObject.h"
#include "../object/ObjectManager.h"
@@ -189,7 +189,7 @@ namespace OpenRCT2::Weather
{
gameState.weatherCurrent.weatherGloom = stepWeatherLevel(
gameState.weatherCurrent.weatherGloom, gameState.weatherNext.weatherGloom);
GfxInvalidateScreen();
Drawing::GfxInvalidateScreen();
}
}
else