Fix ASTC partition bug
This commit is contained in:
@@ -345,12 +345,9 @@ module Mikunyan
|
|||||||
sh.reverse! if seed & 1 == 0
|
sh.reverse! if seed & 1 == 0
|
||||||
seeds.map!.with_index{|e, i| e >> sh[i % 2]}
|
seeds.map!.with_index{|e, i| e >> sh[i % 2]}
|
||||||
|
|
||||||
@partition = Array.new(@bw * @bh)
|
@partition = (0...@bw * @bh).map do |i|
|
||||||
|
x = i % @bw
|
||||||
for y in 0...@bh
|
y = i / @bw
|
||||||
for x in 0...@bw
|
|
||||||
idx = x + y * @bw
|
|
||||||
|
|
||||||
if small_block
|
if small_block
|
||||||
x <<= 1
|
x <<= 1
|
||||||
y <<= 1
|
y <<= 1
|
||||||
@@ -361,8 +358,7 @@ module Mikunyan
|
|||||||
c = @part_num < 3 ? 0 : (seeds[4] * x + seeds[5] * y + (rnum >> 6)) & 0x3f
|
c = @part_num < 3 ? 0 : (seeds[4] * x + seeds[5] * y + (rnum >> 6)) & 0x3f
|
||||||
d = @part_num < 4 ? 0 : (seeds[6] * x + seeds[7] * y + (rnum >> 2)) & 0x3f
|
d = @part_num < 4 ? 0 : (seeds[6] * x + seeds[7] * y + (rnum >> 2)) & 0x3f
|
||||||
|
|
||||||
@partition[idx] = 3 - [d, c, b, a].each_with_index.max[1]
|
3 - [d, c, b, a].each_with_index.max[1]
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user