mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Eat memory, load faster. edited comments in parser.
This commit is contained in:
@@ -3,7 +3,9 @@ class IMICFPS
|
|||||||
module Parser
|
module Parser
|
||||||
def parse
|
def parse
|
||||||
lines = 0
|
lines = 0
|
||||||
@file.each_line do |line|
|
list = @file.read.split("\n")
|
||||||
|
# @file.each_line do |line|
|
||||||
|
list.each do |line|
|
||||||
lines+=1
|
lines+=1
|
||||||
line = line.strip
|
line = line.strip
|
||||||
|
|
||||||
@@ -65,17 +67,17 @@ class IMICFPS
|
|||||||
@current_material = array.last
|
@current_material = array.last
|
||||||
@materials[array.last] = material
|
@materials[array.last] = material
|
||||||
when 'Ns' # Specular Exponent
|
when 'Ns' # Specular Exponent
|
||||||
when 'Ka' # Ambient
|
when 'Ka' # Ambient color
|
||||||
@materials[@current_material].ambient = Color.new(Float(array[1]), Float(array[2]), Float(array[3]))
|
@materials[@current_material].ambient = Color.new(Float(array[1]), Float(array[2]), Float(array[3]))
|
||||||
when 'Kd' # Diffuse
|
when 'Kd' # Diffuse color
|
||||||
@materials[@current_material].diffuse = Color.new(Float(array[1]), Float(array[2]), Float(array[3]))
|
@materials[@current_material].diffuse = Color.new(Float(array[1]), Float(array[2]), Float(array[3]))
|
||||||
when 'Ks' # Specular
|
when 'Ks' # Specular color
|
||||||
@materials[@current_material].specular = Color.new(Float(array[1]), Float(array[2]), Float(array[3]))
|
@materials[@current_material].specular = Color.new(Float(array[1]), Float(array[2]), Float(array[3]))
|
||||||
when 'Ke' # Emissive
|
when 'Ke' # Emissive
|
||||||
when 'Ni' # Unknown (Blender Specific?)
|
when 'Ni' # Unknown (Blender Specific?)
|
||||||
when 'd' # Dissolved (Transparency)
|
when 'd' # Dissolved (Transparency)
|
||||||
when 'illum' # Illumination model
|
when 'illum' # Illumination model
|
||||||
when 'map_Kd'
|
when 'map_Kd' # Diffuse texture
|
||||||
@materials[@current_material].set_texture(array[1])
|
@materials[@current_material].set_texture(array[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ Faces: #{@number_of_faces}
|
|||||||
Last Frame: #{delta_time}ms (#{Gosu.fps} fps)
|
Last Frame: #{delta_time}ms (#{Gosu.fps} fps)
|
||||||
|
|
||||||
Draw Skydome: #{@draw_skydome}
|
Draw Skydome: #{@draw_skydome}
|
||||||
Debug mode: <c=992200>#{$debug}</b>
|
Debug mode: <c=992200>#{$debug}</c>
|
||||||
eos
|
eos
|
||||||
@text.text = string
|
@text.text = string
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user