Removed redundant glError? from Map class and renamed CommonMethods#glError? to #gl_error?, added debug settings for disabling shaders and whether to exit on opengl error

This commit is contained in:
2020-01-27 22:19:07 -06:00
parent 75f94963b2
commit e7b84bd123
8 changed files with 34 additions and 31 deletions

View File

@@ -43,10 +43,10 @@ class IMICFPS
end
def update
@percentage.text = "#{((@asset_index.to_f/@assets.count)*100.0).round}%"
@percentage.text = "#{((@asset_index.to_f / @assets.count) * 100.0).round}%"
@act = true if @cycled
if @act && (@asset_index+1 <= @assets.count)
if @act && (@asset_index + 1 <= @assets.count)
@act = false
@cycled = false
@@ -55,13 +55,17 @@ class IMICFPS
when :model
ModelLoader.new(manifest: hash[:manifest], entity: @dummy_entity)
when :shader
if $debug.get(:use_shaders)
shader = Shader.new(name: hash[:name], vertex: "shaders/vertex/#{hash[:name]}.glsl", fragment: "shaders/fragment/#{hash[:name]}.glsl")
Shader.add(hash[:name], shader) if shader.compiled?
else
warn "Skipping shader: #{hash[:name]}..."
end
else
warn "Unknown asset: #{hash}"
end
@asset_index+=1
@asset_index += 1
end
unless @asset_index < @assets.count