Class: Bayonetta::WMBFile::Bayo1Material

Inherits:
Object
  • Object
show all
Defined in:
lib/bayonetta/wmb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#flagObject (readonly)

Returns the value of attribute flag.



779
780
781
# File 'lib/bayonetta/wmb.rb', line 779

def flag
  @flag
end

#parametersObject (readonly)

Returns the value of attribute parameters.



781
782
783
# File 'lib/bayonetta/wmb.rb', line 781

def parameters
  @parameters
end

#samplersObject (readonly)

Returns the value of attribute samplers.



780
781
782
# File 'lib/bayonetta/wmb.rb', line 780

def samplers
  @samplers
end

#typeObject (readonly)

Returns the value of attribute type.



778
779
780
# File 'lib/bayonetta/wmb.rb', line 778

def type
  @type
end