mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Duct taping a cache bug, added test_object that uses sponza.obj.
This commit is contained in:
@@ -35,7 +35,7 @@ class IMICFPS
|
||||
found = false
|
||||
if CACHE[@type].is_a?(Hash)
|
||||
if CACHE[@type][@file_path]
|
||||
@model = 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}"
|
||||
found = true
|
||||
end
|
||||
|
||||
7
lib/objects/test_object.rb
Normal file
7
lib/objects/test_object.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class IMICFPS
|
||||
class TestObject < GameObject
|
||||
def setup
|
||||
bind_model(ModelLoader.new(type: :obj, file_path: "objects/sponza.obj", game_object: self))
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user