Skip to content
Snippets Groups Projects
Commit e80d12cb authored by dg's avatar dg
Browse files

Fixed some achievements when not using shockbolt tiles

git-svn-id: http://svn.net-core.org/repos/t-engine4@3451 51575b47-30f0-44d4-a5cc-537603b46e54
parent c1349f77
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,9 @@ function _M:init(t)
self.tex = t.tex
else
self.file = tostring(assert(t.file, "no image file"))
self.image = assert(Tiles:loadImage(self.file), "can not load image "..self.file)
local iw, ih = self.image:getSize()
self.image = Tiles:loadImage(self.file)
local iw, ih = 0, 0
if self.image then iw, ih = self.image:getSize() end
if t.auto_width then t.width = iw end
if t.auto_height then t.height = ih end
end
......@@ -46,10 +47,11 @@ function _M:generate()
self.mouse:reset()
self.key:reset()
self.item = self.tex or {self.image:glTexture()}
if self.image then self.item = self.tex or {self.image:glTexture()} end
end
function _M:display(x, y)
if not self.item then return end
if self.shadow then
self.item[1]:toScreenFull(x + 5, y + 5, self.w, self.h, self.item[2], self.item[3], 0, 0, 0, 0.5)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment