From b543f3bd125d59e093ed12d9ec93cfecea4878e8 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Mon, 4 Jan 2010 01:46:34 +0000 Subject: [PATCH] fix all 3 display modes git-svn-id: http://svn.net-core.org/repos/t-engine4@193 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/Map.lua | 4 ++-- game/engine/Tiles.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/game/engine/Map.lua b/game/engine/Map.lua index f1787fd9ad..f61807c6ad 100644 --- a/game/engine/Map.lua +++ b/game/engine/Map.lua @@ -379,8 +379,8 @@ function _M:checkMapViewBounded() if self.my > self.h - self.viewport.mheight then self.my = self.h - self.viewport.mheight self.changed = true end -- Center if smaller than map viewport - if self.w < self.viewport.mwidth then self.mx = (self.w - self.viewport.mwidth) / 2 end - if self.h < self.viewport.mheight then self.my = (self.h - self.viewport.mheight) / 2 end + if self.w < self.viewport.mwidth then self.mx = math.floor((self.w - self.viewport.mwidth) / 2) end + if self.h < self.viewport.mheight then self.my = math.floor((self.h - self.viewport.mheight) / 2) end self._map:setScroll(self.mx, self.my) end diff --git a/game/engine/Tiles.lua b/game/engine/Tiles.lua index d63a086aaa..4796499044 100644 --- a/game/engine/Tiles.lua +++ b/game/engine/Tiles.lua @@ -25,13 +25,13 @@ function _M:get(char, fr, fg, fb, br, bg, bb, image, alpha) bgidx = "none" end - if self.use_images and image then char = image end + if (self.use_images or not dochar) and image then char = image end if self.repo[char] and self.repo[char][fgidx] and self.repo[char][fgidx][bgidx] then return self.repo[char][fgidx][bgidx] else local s - if self.use_images and image then + if (self.use_images or not dochar) and image then print("Loading tile", image) s = core.display.loadImage(self.prefix..image) end -- GitLab