diff --git a/examples/3d.cr b/examples/3d.cr index 8f8ecbb..6b25477 100644 --- a/examples/3d.cr +++ b/examples/3d.cr @@ -156,6 +156,5 @@ class ThreeDee < PF::Game end end -# engine = ThreeDee.new(256, 240, 4) -engine = ThreeDee.new(256 * 2, 240 * 2, 2) +engine = ThreeDee.new(640, 480, 2) engine.run! diff --git a/src/matrix.cr b/src/matrix.cr index f1ada71..39a395f 100644 --- a/src/matrix.cr +++ b/src/matrix.cr @@ -14,11 +14,11 @@ module PF macro [](*args) # width and height are the isqrt of args.size {% if args.size == 4 %} - PF::Matrix(typeof({{*args}}), 4).new(2, 2, StaticArray[{{*args}}]) + PF::Matrix(typeof({{args.splat}}), 4).new(2, 2, StaticArray[{{args.splat}}]) {% elsif args.size == 9 %} - PF::Matrix(typeof({{*args}}), 9).new(3, 3, StaticArray[{{*args}}]) + PF::Matrix(typeof({{args.splat}}), 9).new(3, 3, StaticArray[{{args.splat}}]) {% elsif args.size == 16 %} - PF::Matrix(typeof({{*args}}), 16).new(4, 4, StaticArray[{{*args}}]) + PF::Matrix(typeof({{args.splat}}), 16).new(4, 4, StaticArray[{{args.splat}}]) {% else %} raise "Cannot determine width and height of matrix with {{ args.size }} elements, " \ "please provide them explicitly Matrix(Int32, 16).new(4, 4, StaticArray[...])" diff --git a/src/vector.cr b/src/vector.cr index 7465dd7..f0a682c 100644 --- a/src/vector.cr +++ b/src/vector.cr @@ -8,7 +8,7 @@ module PF # PF::Vector[1, 2] # => PF::Vector2(Int32)(@x=1, @y=2) # ``` macro [](*args) - PF::Vector{{args.size}}(typeof({{*args}})).new( + PF::Vector{{args.size}}(typeof({{args.splat}})).new( {% for arg in args %} {{ arg }}, {% end %}