Class: Bayonetta::WMBFile::Bayo1Material
- Inherits:
-
Object
- Object
- Bayonetta::WMBFile::Bayo1Material
- Defined in:
- lib/bayonetta/wmb.rb
Instance Attribute Summary collapse
-
#flag ⇒ Object
readonly
Returns the value of attribute flag.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#samplers ⇒ Object
readonly
Returns the value of attribute samplers.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(m) ⇒ Bayo1Material
constructor
A new instance of Bayo1Material.
Constructor Details
#initialize(m) ⇒ Bayo1Material
Returns a new instance of Bayo1Material.
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 |
# File 'lib/bayonetta/wmb.rb', line 783 def initialize(m) @type = m.type @flag = m.flag @layout = $material_db[@type][:layout] @samplers = {} @parameters = {} field_count = 0 @layout.each { |name, t| if t == "sampler2D_t" || t == "samplerCUBE_t" @samplers[name] = m.material_data[field_count] field_count += 1 else @parameters[name] = m.material_data[field_count...(field_count+4)].pack("L4").unpack("F4") field_count += 4 end } end |
Instance Attribute Details
#flag ⇒ Object (readonly)
Returns the value of attribute flag.
779 780 781 |
# File 'lib/bayonetta/wmb.rb', line 779 def flag @flag end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
781 782 783 |
# File 'lib/bayonetta/wmb.rb', line 781 def parameters @parameters end |
#samplers ⇒ Object (readonly)
Returns the value of attribute samplers.
780 781 782 |
# File 'lib/bayonetta/wmb.rb', line 780 def samplers @samplers end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
778 779 780 |
# File 'lib/bayonetta/wmb.rb', line 778 def type @type end |