gamecore: don't crash when there is no scene
This commit is contained in:
parent
eab1044dc7
commit
2207ebcd89
1 changed files with 10 additions and 6 deletions
|
@ -42,16 +42,20 @@ function SceneManager:update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SceneManager:mousemoved(x, y, dx, dy)
|
function SceneManager:mousemoved(x, y, dx, dy)
|
||||||
|
if (self.currentScene ~= nil) then
|
||||||
self.currentScene.mouse.x,
|
self.currentScene.mouse.x,
|
||||||
self.currentScene.mouse.y = x, y
|
self.currentScene.mouse.y = x, y
|
||||||
self.currentScene:mousemoved(x, y, dx, dy)
|
self.currentScene:mousemoved(x, y, dx, dy)
|
||||||
self.currentScene.menusystem:mousemoved(x, y, dx, dy)
|
self.currentScene.menusystem:mousemoved(x, y, dx, dy)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function SceneManager:mousepressed( x, y, button, istouch )
|
function SceneManager:mousepressed( x, y, button, istouch )
|
||||||
|
if (self.currentScene ~= nil) then
|
||||||
self.currentScene:mousepressed( x, y, button, istouch )
|
self.currentScene:mousepressed( x, y, button, istouch )
|
||||||
self.currentScene.menusystem:mousepressed( x, y, button, istouch )
|
self.currentScene.menusystem:mousepressed( x, y, button, istouch )
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function SceneManager:clearScene()
|
function SceneManager:clearScene()
|
||||||
self.currentScene = nil
|
self.currentScene = nil
|
||||||
|
|
Loading…
Reference in a new issue