Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.392.mcz==================== Summary ====================
Name: EToys-nice.392
Author: nice
Time: 10 May 2020, 6:20:16.982605 pm
UUID: 43a15c49-4926-4f07-8285-8803a430afef
Ancestors: EToys-mt.391
Use Float32Array explicitely
=============== Diff against EToys-mt.391 ===============
Item was changed:
----- Method: FishEyeMorph>>calculateTransform (in category 'initialization') -----
calculateTransform
| stepX stepY rect tx ty arrayX arrayY |
(gridNum x = 0 or: [gridNum y = 0]) ifTrue: [^self].
stepX := srcExtent x // gridNum x.
stepY := srcExtent y // gridNum y.
+ arrayX := (1 to: gridNum y + 1) collect: [:j | Float32Array new: gridNum x + 1].
+ arrayY := (1 to: gridNum y + 1) collect: [:j | Float32Array new: gridNum x + 1].
- arrayX := (1 to: gridNum y + 1) collect: [:j | FloatArray new: gridNum x + 1].
- arrayY := (1 to: gridNum y + 1) collect: [:j | FloatArray new: gridNum x + 1].
0 to: gridNum y do: [:j |
0 to: gridNum x do: [:i |
(arrayX at: (j + 1)) at: (i + 1) put: i*stepX.
(arrayY at: (j + 1)) at: (i + 1) put: j*stepY.
].
].
0 to: gridNum y do: [:j |
self transformX: (arrayX at: (j+1)).
self transformY: (arrayY at: (j+1)).
].
0 to: gridNum y do: [:j |
arrayX at: (j+1) put: ((1 to: gridNum x +1) collect: [:i | ((arrayX at: (j+1)) at: i) asInteger]).
arrayY at: (j+1) put: ((1 to: gridNum x +1) collect: [:i | ((arrayY at: (j+1)) at: i) asInteger]).
].
clipRects := (1 to: gridNum y) collect: [:j | Array new: gridNum x].
toRects := (1 to: gridNum y) collect: [:j | Array new: gridNum x].
quads := (1 to: gridNum y) collect: [:j | Array new: gridNum x].
0 to: gridNum y - 1 do: [:j |
0 to: gridNum x- 1 do: [:i |
rect := (((arrayX at: (j+1)) at: (i+1))@((arrayY at: (j+1)) at: (i+1)))
corner: ((arrayX at: (j+2)) at: (i+2))@((arrayY at: (j+2)) at: (i+2)).
(clipRects at: j+1) at: i+1 put: rect.
rect width >= stepX ifTrue: [rect := rect expandBy: (1@0)].
rect height >= stepY ifTrue: [rect := rect expandBy: (0@1)].
(toRects at: j+1) at: i+1 put: rect.
tx := (i)*stepX.
ty := (j)*stepY.
(quads at: j+1) at: i+1
put: {(tx)@(ty). (tx)@(ty+stepY). (tx+stepX)@(ty+stepY). (tx+stepX)@(ty)}.
].
].
!
Item was changed:
+ Float32Array variableWordSubclass: #KedamaFloatArray
- FloatArray variableWordSubclass: #KedamaFloatArray
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Etoys-StarSqueak'!