Skip to content

Commit d8e7869

Browse files
authored
Merge pull request #43 from cortex-command-community/expose-resolution-multiplier
Expose ResolutionMultiplier to Lua
2 parents 22c1aa5 + f7564a5 commit d8e7869

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
124124

125125
- New `FrameMan` Lua functions `SetHudDisabled(disabled, screenId)` and `IsHudDisabled(screenId)` that allows disabling a given screen's HUD, and checking whether it's currently disabled. The screenId parameters are optional and default to screen 0.
126126

127-
- Exposed `FrameMan` property `ScreenCount` to Lua (R).
127+
- Exposed `FrameMan` properties `ScreenCount` and `ResolutionMultiplier` to Lua (R).
128128

129129
</details>
130130

Source/Lua/LuaBindingsManagers.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ LuaBindingRegisterFunctionDefinitionForType(ManagerLuaBindings, FrameMan) {
6464
.property("PlayerScreenWidth", &FrameMan::GetPlayerScreenWidth)
6565
.property("PlayerScreenHeight", &FrameMan::GetPlayerScreenHeight)
6666
.property("ScreenCount", &FrameMan::GetScreenCount)
67+
.property("ResolutionMultiplier", &FrameMan::GetResolutionMultiplier)
6768

6869
.def("IsHudDisabled", &FrameMan::IsHudDisabled)
6970
.def("SetHudDisabled", &FrameMan::SetHudDisabled)

Source/Managers/FrameMan.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ void FrameMan::ResetSplitScreens(bool hSplit, bool vSplit) {
273273
}
274274
}
275275

276+
float FrameMan::GetResolutionMultiplier() const {
277+
return g_WindowMan.GetResMultiplier();
278+
}
279+
276280
Vector FrameMan::GetMiddleOfPlayerScreen(int whichPlayer) {
277281
Vector middleOfPlayerScreen;
278282

Source/Managers/FrameMan.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ namespace RTE {
112112
/// @return The height of the player screens.
113113
int GetPlayerScreenHeight() const { return GetPlayerFrameBufferHeight(-1); }
114114

115+
/// Gets the resolution multiplier.
116+
float GetResolutionMultiplier() const;
117+
115118
/// Gets a Vector with the absolute position of the middle of the specified player's screen.
116119
/// @param whichPlayer Player to get the middle of the screen for. -1 will give the middle of the entire game window.
117120
/// @return The middle of the screen for the specified player, or the middle of the game window if that player is -1.

0 commit comments

Comments
 (0)