Class: Doom::Wad::CompositeTexture
- Inherits:
-
Object
- Object
- Doom::Wad::CompositeTexture
- Defined in:
- lib/doom/wad/texture.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #column_pixels(x, _height_needed = nil) ⇒ Object
-
#initialize(name, width, height, columns) ⇒ CompositeTexture
constructor
A new instance of CompositeTexture.
Constructor Details
#initialize(name, width, height, columns) ⇒ CompositeTexture
Returns a new instance of CompositeTexture.
133 134 135 136 137 138 139 140 |
# File 'lib/doom/wad/texture.rb', line 133 def initialize(name, width, height, columns) @name = name @width = width @height = height @columns = columns @column_cache = Array.new(width) precompute_columns end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
131 132 133 |
# File 'lib/doom/wad/texture.rb', line 131 def columns @columns end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
131 132 133 |
# File 'lib/doom/wad/texture.rb', line 131 def height @height end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
131 132 133 |
# File 'lib/doom/wad/texture.rb', line 131 def name @name end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
131 132 133 |
# File 'lib/doom/wad/texture.rb', line 131 def width @width end |
Instance Method Details
#column_pixels(x, _height_needed = nil) ⇒ Object
142 143 144 |
# File 'lib/doom/wad/texture.rb', line 142 def column_pixels(x, _height_needed = nil) @column_cache[x & (@width - 1)] end |