mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Added shader support, removed unused debugging puts statements and fixed Gosu Font.draw deprecation warning.
This commit is contained in:
@@ -77,13 +77,13 @@ class IMICFPS
|
||||
glMatrixMode(GL_MODELVIEW) # The modelview matrix is where object information is stored.
|
||||
glLoadIdentity
|
||||
|
||||
if $debug && @game_object
|
||||
glBegin(GL_LINES)
|
||||
glColor3f(1,0,0)
|
||||
glVertex3f(@x, @y, @z)
|
||||
glVertex3f(@game_object.x, @game_object.y, @game_object.z)
|
||||
glEnd
|
||||
end
|
||||
# if $debug && @game_object
|
||||
# glBegin(GL_LINES)
|
||||
# glColor3f(1,0,0)
|
||||
# glVertex3f(@x, @y, @z)
|
||||
# glVertex3f(@game_object.x, @game_object.y, @game_object.z)
|
||||
# glEnd
|
||||
# end
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@@ -19,8 +19,6 @@ class IMICFPS
|
||||
@nearest_vertex_lookup[x_slot][y_slot] = [] unless @nearest_vertex_lookup[x_slot][y_slot]
|
||||
@nearest_vertex_lookup[x_slot][y_slot] << vert
|
||||
end
|
||||
|
||||
p model.faces.first
|
||||
end
|
||||
|
||||
def height_at(vertex, max_distance = Float::INFINITY)
|
||||
|
||||
@@ -37,7 +37,7 @@ class IMICFPS
|
||||
if CACHE[@type].is_a?(Hash)
|
||||
if CACHE[@type][@file_path]
|
||||
@model = CACHE[@type][@file_path]#.dup # Don't know why, but adding .dup improves performance with Sponza (1 fps -> 20 fps)
|
||||
puts "Used cached model for: #{@file_path.split('/').last}"
|
||||
# puts "Used cached model for: #{@file_path.split('/').last}"
|
||||
found = true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -75,20 +75,20 @@ class Text
|
||||
# _color = Gosu::Color.rgba(@color.red, @color.green, @color.blue, @shadow_alpha) if @shadow_alpha <= @color.alpha
|
||||
# _color = Gosu::Color.rgba(@color.red, @color.green, @color.blue, @color.alpha) unless @shadow_alpha <= @color.alpha
|
||||
_color = Gosu::Color::BLACK
|
||||
@textobject.draw(@text, @x-@shadow_size, @y, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw(@text, @x-@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x-@shadow_size, @y, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x-@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
|
||||
@textobject.draw(@text, @x, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw(@text, @x+@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x+@shadow_size, @y-@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
|
||||
@textobject.draw(@text, @x, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw(@text, @x-@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x-@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
|
||||
@textobject.draw(@text, @x+@shadow_size, @y, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw(@text, @x+@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x+@shadow_size, @y, @z, @factor_x, @factor_y, _color)
|
||||
@textobject.draw_text(@text, @x+@shadow_size, @y+@shadow_size, @z, @factor_x, @factor_y, _color)
|
||||
end
|
||||
|
||||
@textobject.draw(@text, @x, @y, @z, @factor_x, @factor_y, @color)
|
||||
@textobject.draw_markup(@text, @x, @y, @z, @factor_x, @factor_y, @color)
|
||||
end
|
||||
|
||||
def update; end
|
||||
|
||||
Reference in New Issue
Block a user