Sha256: 8cf3dc51b81ec4520e2eb83111abf56a457325edbb800a5beb2234d458d37ad2

Contents?: true

Size: 525 Bytes

Versions: 19

Compression:

Stored size: 525 Bytes

Contents

module Mittsu
  module UniformsUtils
    def self.merge(uniforms)
      merged = {}

      uniforms.each do |uniform|
        tmp = UniformsUtils.clone(uniform)

        next if tmp.nil?

        tmp.each do |(p, tmp_p)|
          merged[p] = tmp_p
        end
      end

      merged
    end

    def self.clone(uniforms_src)
      return if uniforms_src.nil?

      uniforms_dst = {}

      uniforms_src.each do |(u, uniform_src)|
        uniforms_dst[u] = uniform_src.clone
      end

      uniforms_dst
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
mittsu-0.4.1 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.4.0 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.3.3 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.3.2 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.3.1 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.3.0 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.2.4 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.2.3 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.2.2 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.2.1 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.2.0 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.7 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.6 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.5 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.4 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.3 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.2 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.1 lib/mittsu/renderers/shaders/uniforms_utils.rb
mittsu-0.1.0 lib/mittsu/renderers/shaders/uniforms_utils.rb