chore(camera): remove unused functions

This commit is contained in:
Kazhnuz 2019-07-14 22:53:55 +02:00
parent 81dd584e11
commit 7ec715850c

View file

@ -170,27 +170,6 @@ function CameraSystem:getViewCam(id)
return view.cam return view.cam
end end
function CameraSystem:setScissor(id)
local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id)
if (self:getViewNumber() > 2) or (self:getViewNumber() == 2 and SPLITSCREEN_ISVERTICAL) then
-- FIXME: it's an ugly workaround that need to be fixed. For an unkown
-- reason, the scissoring is wrong in and only in this function and only
-- when we have vertical split. Thus, we need to substract viewy to viewy
viewy = viewh - viewy
end
if (self.mode == "split") then
love.graphics.setScissor(viewx, viewy, vieww, viewh)
end
end
function CameraSystem:resetScissor( )
if (self.mode == "split") then
love.graphics.setScissor( )
end
end
function CameraSystem:attachView(id) function CameraSystem:attachView(id)
if (id ~= nil) then if (id ~= nil) then
local view = self:getView(id) local view = self:getView(id)
@ -251,20 +230,6 @@ function CameraSystem:getViewCoordinate(id)
return viewx, viewy, vieww, viewh return viewx, viewy, vieww, viewh
end end
function CameraSystem:getInternalCamCoordinate(id)
local view = self:getView(id)
local cam = self:getViewCam(id)
local viewx, viewy, vieww, viewh
viewx = cam.x - ((self.views.width/2) / cam.scale)
viewy = cam.y - ((self.views.height/2) / cam.scale)
vieww, viewh = core.screen:getDimensions()
vieww = vieww / cam.scale
viewh = viewh / cam.scale
return viewx, viewy, vieww, viewh
end
function CameraSystem:getOnScreenViewCoordinate(id) function CameraSystem:getOnScreenViewCoordinate(id)
local view = self:getView(id) local view = self:getView(id)
@ -342,17 +307,6 @@ function CameraSystem:moveView(id, x, y)
self:limitView(id) self:limitView(id)
end end
function CameraSystem:computeCamPosition(id)
local decalx = self.views.list[id].pos.onScreen.x
local decaly = self.views.list[id].pos.onScreen.y
local realx = self.views.list[id].pos.x
local realy = self.views.list[id].pos.y
self.views.list[id].cam.x = realx - decalx
self.views.list[id].cam.y = realy - decaly
end
function CameraSystem:followActor(id) function CameraSystem:followActor(id)
local view = self:getView(id) local view = self:getView(id)
@ -415,19 +369,6 @@ end
-- DRAW FUNCTIONS -- DRAW FUNCTIONS
-- Basic callback to draw stuff -- Basic callback to draw stuff
function CameraSystem:drawDebugViewBox(id)
local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id)
utils.graphics.box(viewx, viewy, vieww, viewh)
local xx, yy = self:getOnScreenViewCenter(id)
love.graphics.line(xx-3, yy, xx+3, yy)
love.graphics.line(xx, yy-3, xx, yy+3)
local xx, yy = self:getInternalCamCoordinate(id)
local string = id .. " x:" .. xx .. " y:" .. yy
love.graphics.print(string, viewx + 4, viewy + 4)
end
function CameraSystem:drawHUD(id) function CameraSystem:drawHUD(id)
local view = self:getView(id) local view = self:getView(id)
local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id) local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id)