mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Debug commands now affect game
This commit is contained in:
@@ -70,7 +70,7 @@ class IMICFPS
|
||||
# glBindBuffer(GL_ARRAY_BUFFER, model.vertices_buffer)
|
||||
# glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0)
|
||||
|
||||
if $debug # This is kinda expensive
|
||||
if $debug.get(:wireframe) # This is kinda expensive
|
||||
glDisable(GL_LIGHTING)
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
|
||||
glPolygonOffset(2, 0.5)
|
||||
|
||||
@@ -17,14 +17,14 @@ class IMICFPS
|
||||
@game_state.entities.each do |object|
|
||||
if object.visible && object.renderable
|
||||
# Render bounding boxes before transformation is applied
|
||||
@bounding_box_renderer.create_bounding_box(object, object.model.bounding_box, object.debug_color, object.object_id) if $debug
|
||||
@bounding_box_renderer.create_bounding_box(object, object.model.bounding_box, object.debug_color, object.object_id) if $debug.get(:boundingboxes)
|
||||
|
||||
@opengl_renderer.draw_object(object)
|
||||
end
|
||||
end
|
||||
|
||||
@bounding_box_renderer.draw_bounding_boxes if $debug
|
||||
window.number_of_vertices+=@bounding_box_renderer.vertex_count if $debug
|
||||
@bounding_box_renderer.draw_bounding_boxes if $debug.get(:boundingboxes)
|
||||
window.number_of_vertices+=@bounding_box_renderer.vertex_count if $debug.get(:boundingboxes)
|
||||
# @bounding_box_renderer.bounding_boxes.clear
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user