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

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@6226 51575b47-30f0-44d4-a5cc-537603b46e54
parent 1e1830c5
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ function _M:init(t, no_default)
t.lite = t.lite or 0
t.rank = t.rank or 3
t.shader_old_life = 0
t.old_air = 0
t.old_psi = 0
......@@ -296,6 +297,7 @@ function _M:act()
-- Funky shader things !
self:updateMainShader()
self.shader_old_life = self.life
self.old_air = self.air
self.old_psi = self.psi
......@@ -332,7 +334,7 @@ end
function _M:updateMainShader()
if game.fbo_shader then
-- Set shader HP warning
if self.life ~= self.old_life then
if self.life ~= self.shader_old_life then
if self.life < self.max_life / 2 then game.fbo_shader:setUniform("hp_warning", 1 - (self.life / self.max_life))
else game.fbo_shader:setUniform("hp_warning", 0) end
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