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

fix ?


git-svn-id: http://svn.net-core.org/repos/t-engine4@4009 51575b47-30f0-44d4-a5cc-537603b46e54
parent 1c606a85
No related branches found
No related tags found
No related merge requests found
......@@ -445,6 +445,9 @@ function _M:setupDisplayMode(reboot, mode)
self.full_fbo = core.display.newFBO(self.w, self.h)
if self.full_fbo then self.full_fbo_shader = Shader.new("full_fbo") if not self.full_fbo_shader.shad then self.full_fbo = nil self.full_fbo_shader = nil end end
self.mm_fbo = core.display.newFBO(200, 200)
if self.mm_fbo then self.mm_fbo_shader = Shader.new("mm_fbo") if not self.mm_fbo_shader.shad then self.mm_fbo = nil self.mm_fbo_shader = nil end end
end
end
......@@ -948,9 +951,19 @@ function _M:display(nb_keyframes)
map:displayEmotes(nb_keyframe or 1)
-- Minimap display
self.minimap_bg:toScreen(0, 0, 200, 200)
self.minimap_scroll_x, self.minimap_scroll_y = util.bound(self.player.x - 25, 0, map.w - 50), util.bound(self.player.y - 25, 0, map.h - 50)
map:minimapDisplay(0, 0, self.minimap_scroll_x, self.minimap_scroll_y, 50, 50, 1)
if self.mm_fbo then
self.mm_fbo:use(true)
self.minimap_scroll_x, self.minimap_scroll_y = util.bound(self.player.x - 25, 0, map.w - 50), util.bound(self.player.y - 25, 0, map.h - 50)
map:minimapDisplay(0, 0, self.minimap_scroll_x, self.minimap_scroll_y, 50, 50, 1)
self.mm_fbo:use(false, self.full_fbo)
self.minimap_bg:toScreen(0, 0, 200, 200)
self.mm_fbo:toScreen(0, 0, 200, 200, self.mm_fbo_shader.shad)
else
self.minimap_bg:toScreen(0, 0, 200, 200)
self.minimap_scroll_x, self.minimap_scroll_y = util.bound(self.player.x - 25, 0, map.w - 50), util.bound(self.player.y - 25, 0, map.h - 50)
map:minimapDisplay(0, 0, self.minimap_scroll_x, self.minimap_scroll_y, 50, 50, 1)
end
-- Mouse gestures
self.gestures:update()
......
......@@ -36,6 +36,7 @@ When activated it will prompt to destroy items on the floor, if there are none i
pricemod = function(o) if o.type == "gem" then return 0.40 else return 0.05 end end,
transmo_filter = function(o) if o:getPrice() <= 0 or o.quest then return false end return true end,
transmo_inven = function(self, who, inven, idx, o)
local price = math.min(o:getPrice() * self.pricemod(o), 25) * o:getNumber()
local price = math.min(o:getPrice() * self.pricemod(o), 25) * o:getNumber()
price = math.floor(price * 100) / 100 -- Make sure we get at most 2 digit precision
if price ~= price then price = 1 end -- NaN is the only value that does not equals itself, this is the way to check it since we do not have a math.isnan method
......
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