Skip to content
Open
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
22 changes: 22 additions & 0 deletions lua/autorun/!!!glua-patches.lua
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,27 @@ if CLIENT or MENU then

end

-- faster ScrW ScrH etc..
do

local scr_w_cache, src_h_cache = ScrW(), ScrH()
ScrW = function() return scr_w_cache end
ScrH = function() return src_h_cache end

local _640 = 1 / 640.0
local _480 = 1 / 480.0

local scr_w_640, scr_h_480 = scr_w_cache * _640, src_h_cache * _480
ScreenScale = function(a) return a * scr_w_640 end
ScreenScaleH = function(a) return a * scr_h_480 end

hook.Add( "OnScreenSizeChanged", addon_name .. " - ScreenSizes", function(_, _, a, b)
scr_w_cache, src_h_cache = a, b
scr_w_640, scr_h_480 = a * _640, b * _480
end, PRE_HOOK )

end

end

do
Expand Down Expand Up @@ -2124,3 +2145,4 @@ MsgC( SERVER and Color( 50, 100, 250 ) or Color( 250, 100, 50 ), "[" .. addon_na
"Look at where we started and where we will end ♪"
} ) .. "\n" )