mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
Changed message of error_printer and made it local, also made the debug table an upvalue, so people can use the debug variable in their programs
This commit is contained in:
@@ -343,7 +343,7 @@ function love.nogame()
|
||||
if not major then major = 0 end
|
||||
if not minor then minor = 0 end
|
||||
if not rev then rev = 0 end
|
||||
|
||||
|
||||
love.graphics.setBackgroundColor(0x84, 0xca, 0xff)
|
||||
|
||||
names = {
|
||||
@@ -623,7 +623,7 @@ function love.nogame()
|
||||
Tank.draw = function(self)
|
||||
love.graphics.draw(images.turret_cannon, self.x+30, self.y-80)
|
||||
love.graphics.draw(images.turret_body, self.x-12, self.y-110)
|
||||
love.graphics.draw(images.belt_track, self.belt.x-74, self.belt.y-28)
|
||||
love.graphics.draw(images.belt_track, self.belt.x-74, self.belt.y-28)
|
||||
love.graphics.draw(images["wheel_"..tostring(major)], self.x, self.y, self.angle, 1, 1, 32, 32)
|
||||
love.graphics.draw(images["wheel_"..tostring(minor)], self.x+self.i, self.y, self.angle, 1, 1, 32, 32)
|
||||
love.graphics.draw(images["wheel_"..tostring(rev)], self.x+self.i*2, self.y, self.angle, 1, 1, 32, 32)
|
||||
@@ -764,6 +764,12 @@ end
|
||||
-- Error screen.
|
||||
-----------------------------------------------------------
|
||||
|
||||
local debug = debug
|
||||
|
||||
local function error_printer(msg)
|
||||
print("Error:", msg, debug.traceback())
|
||||
end
|
||||
|
||||
function love.errhand(msg)
|
||||
|
||||
error_printer(msg)
|
||||
@@ -830,10 +836,6 @@ end
|
||||
-- The root of all calls.
|
||||
-----------------------------------------------------------
|
||||
|
||||
function error_printer(msg)
|
||||
print("boot", msg, debug.traceback())
|
||||
end
|
||||
|
||||
result = xpcall(love.boot, error_printer)
|
||||
if not result then return end
|
||||
result = xpcall(love.init, love.errhand)
|
||||
|
||||
Reference in New Issue
Block a user