mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Use glLineWidth for wireframe rendering, use LoadingState for MapEditor
This commit is contained in:
@@ -155,6 +155,7 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
if window.config.get(:debug_options, :wireframe)
|
if window.config.get(:debug_options, :wireframe)
|
||||||
|
glLineWidth(2)
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
|
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
|
||||||
Shader.active_shader.uniform_boolean("disableLighting", true)
|
Shader.active_shader.uniform_boolean("disableLighting", true)
|
||||||
|
|
||||||
@@ -163,6 +164,7 @@ class IMICFPS
|
|||||||
|
|
||||||
Shader.active_shader.uniform_boolean("disableLighting", false)
|
Shader.active_shader.uniform_boolean("disableLighting", false)
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
|
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL)
|
||||||
|
glLineWidth(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
glDrawArrays(GL_TRIANGLES, 0, model.faces.count * 3)
|
glDrawArrays(GL_TRIANGLES, 0, model.faces.count * 3)
|
||||||
|
|||||||
@@ -2,7 +2,13 @@ class IMICFPS
|
|||||||
class LoadingState < Menu
|
class LoadingState < Menu
|
||||||
def setup
|
def setup
|
||||||
window.needs_cursor = false
|
window.needs_cursor = false
|
||||||
@map_parser = MapParser.new(map_file: @options[:map_file])
|
if @options[:map_file]
|
||||||
|
@map_parser = MapParser.new(map_file: @options[:map_file])
|
||||||
|
elsif @options[:map_parser]
|
||||||
|
@map_parser = @options[:map_parser]
|
||||||
|
else
|
||||||
|
raise "Unable to load map, missing :map_file or :map_parser"
|
||||||
|
end
|
||||||
|
|
||||||
title "I-MIC FPS"
|
title "I-MIC FPS"
|
||||||
@subheading = Text.new("Loading Map: #{@map_parser.metadata.name}", y: 100, size: 50, alignment: :center)
|
@subheading = Text.new("Loading Map: #{@map_parser.metadata.name}", y: 100, size: 50, alignment: :center)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class IMICFPS
|
|||||||
flow(margin: 10) do
|
flow(margin: 10) do
|
||||||
@maps.each do |map|
|
@maps.each do |map|
|
||||||
button map.metadata.name do
|
button map.metadata.name do
|
||||||
push_state(Editor, map_parser: map)
|
push_state(LoadingState, map_parser: map, forward: Editor)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user