Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Export/Launch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ ConExecute("set vid_resizable 3")
launch = { }
SetMainObject(launch)

function GetVirtualScreenSize()
local width, height = GetScreenSize()
local scale = GetScreenScale and GetScreenScale() or 1.0
if scale ~= 1.0 then
width = math.floor(width / scale)
height = math.floor(height / scale)
end
return width, height
end

function launch:OnInit()
self.devMode = true
self.subScripts = { }
Expand Down
10 changes: 10 additions & 0 deletions src/Launch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ SetMainObject(launch)
jit.opt.start('maxtrace=4000','maxmcode=8192')
collectgarbage("setpause", 400)

function GetVirtualScreenSize()
local width, height = GetScreenSize()
local scale = GetScreenScale and GetScreenScale() or 1.0
if scale ~= 1.0 then
width = math.floor(width / scale)
height = math.floor(height / scale)
end
return width, height
end

function launch:OnInit()
self.devMode = false
self.installedMode = false
Expand Down
10 changes: 0 additions & 10 deletions src/Modules/Common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1115,16 +1115,6 @@ function escapeGGGString(text)
:gsub("%[[^|]+|([^|]+)%]", "%1")
return line
end
-- Returns virtual screen size
function GetVirtualScreenSize()
local width, height = GetScreenSize()
local scale = GetScreenScale and GetScreenScale() or 1.0
if scale ~= 1.0 then
width = math.floor(width / scale)
height = math.floor(height / scale)
end
return width, height
end

-- used for calculating the hash field of a stat
local GGG_STAT_HASH32_SEED = 0xC58F1A7B
Expand Down
Loading