mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-20 04:31:09 +02:00
fix(gen2): stay below LuaJIT local limit
This commit is contained in:
@@ -34,7 +34,6 @@ local Font = require("src.render.Font")
|
|||||||
-- a mod has taken a facade (src/mods/Gen2Compat.lua).
|
-- a mod has taken a facade (src/mods/Gen2Compat.lua).
|
||||||
local Gen1Facade = require("src.mods.Gen2Compat")
|
local Gen1Facade = require("src.mods.Gen2Compat")
|
||||||
local GbcPalette = require("src.render.GbcPalette")
|
local GbcPalette = require("src.render.GbcPalette")
|
||||||
local GameViewport = require("src.render.GameViewport")
|
|
||||||
local Gen2Save = require("src.core.gen2.Save")
|
local Gen2Save = require("src.core.gen2.Save")
|
||||||
local HallOfFame = require("src.core.gen2.HallOfFame")
|
local HallOfFame = require("src.core.gen2.HallOfFame")
|
||||||
local HiddenItems = require("src.world.gen2.HiddenItems")
|
local HiddenItems = require("src.world.gen2.HiddenItems")
|
||||||
@@ -7549,7 +7548,7 @@ function World:interactBody()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function World:fitScale()
|
function World:fitScale()
|
||||||
local w, h = GameViewport.dimensions()
|
local w, h = require("src.render.GameViewport").dimensions()
|
||||||
return math.max(1, math.floor(math.min(w / 160, h / 144)))
|
return math.max(1, math.floor(math.min(w / 160, h / 144)))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -8376,7 +8375,7 @@ function World:rebuildNeighbors()
|
|||||||
self.neighbors = {}
|
self.neighbors = {}
|
||||||
if not self.map then return end
|
if not self.map then return end
|
||||||
local s = self:zoomScale()
|
local s = self:zoomScale()
|
||||||
local ww, wh = GameViewport.dimensions()
|
local ww, wh = require("src.render.GameViewport").dimensions()
|
||||||
local vw = math.ceil(ww / s)
|
local vw = math.ceil(ww / s)
|
||||||
local vh = math.ceil(wh / s)
|
local vh = math.ceil(wh / s)
|
||||||
if vw % 2 ~= 0 then vw = vw + 1 end
|
if vw % 2 ~= 0 then vw = vw + 1 end
|
||||||
@@ -9743,7 +9742,7 @@ function World:drawGround(s)
|
|||||||
if canvas then
|
if canvas then
|
||||||
bw, bh = canvas:getDimensions()
|
bw, bh = canvas:getDimensions()
|
||||||
else
|
else
|
||||||
bw, bh = GameViewport.dimensions()
|
bw, bh = require("src.render.GameViewport").dimensions()
|
||||||
end
|
end
|
||||||
BorderFill.draw(self, self:borderImageFor(self.map.id),
|
BorderFill.draw(self, self:borderImageFor(self.map.id),
|
||||||
cam.x, cam.y, bw, bh, s, self.map.id)
|
cam.x, cam.y, bw, bh, s, self.map.id)
|
||||||
@@ -10003,7 +10002,7 @@ end
|
|||||||
|
|
||||||
function World:draw()
|
function World:draw()
|
||||||
local G = love.graphics
|
local G = love.graphics
|
||||||
local w, h = GameViewport.dimensions()
|
local w, h = require("src.render.GameViewport").dimensions()
|
||||||
self:refreshColorMode()
|
self:refreshColorMode()
|
||||||
G.clear(0.07, 0.05, 0.02, 1)
|
G.clear(0.07, 0.05, 0.02, 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user