Class: Doom::Wad::TextureManager
- Inherits:
-
Object
- Object
- Doom::Wad::TextureManager
- Defined in:
- lib/doom/wad/texture.rb
Instance Attribute Summary collapse
-
#patches ⇒ Object
readonly
Returns the value of attribute patches.
-
#pnames ⇒ Object
readonly
Returns the value of attribute pnames.
-
#texture_names ⇒ Object
readonly
Returns the value of attribute texture_names.
-
#textures ⇒ Object
readonly
Returns the value of attribute textures.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #get_patch(index) ⇒ Object
-
#initialize(wad) ⇒ TextureManager
constructor
A new instance of TextureManager.
Constructor Details
#initialize(wad) ⇒ TextureManager
Returns a new instance of TextureManager.
78 79 80 81 82 83 84 85 86 |
# File 'lib/doom/wad/texture.rb', line 78 def initialize(wad) @wad = wad result = Texture.load_all(wad) @textures = result[:textures] @pnames = result[:pnames] @texture_names = result[:texture_names] @patches = {} @composite_cache = {} end |
Instance Attribute Details
#patches ⇒ Object (readonly)
Returns the value of attribute patches.
76 77 78 |
# File 'lib/doom/wad/texture.rb', line 76 def patches @patches end |
#pnames ⇒ Object (readonly)
Returns the value of attribute pnames.
76 77 78 |
# File 'lib/doom/wad/texture.rb', line 76 def pnames @pnames end |
#texture_names ⇒ Object (readonly)
Returns the value of attribute texture_names.
76 77 78 |
# File 'lib/doom/wad/texture.rb', line 76 def texture_names @texture_names end |
#textures ⇒ Object (readonly)
Returns the value of attribute textures.
76 77 78 |
# File 'lib/doom/wad/texture.rb', line 76 def textures @textures end |
Instance Method Details
#[](name) ⇒ Object
88 89 90 91 92 |
# File 'lib/doom/wad/texture.rb', line 88 def [](name) return nil if name.nil? || name.empty? || name == '-' @composite_cache[name] ||= build_composite(name.upcase) end |