improvements to player sprite
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
structure PlayerSprite =
|
structure PlayerSprite =
|
||||||
struct
|
struct
|
||||||
fun lerp (startX, startY, drawWidth, drawHeight, windowWidth, windowHeight, r, g, b) : Real32.real vector =
|
fun lerp (startX, startY, drawWidth, drawHeight, windowWidth, windowHeight, r,
|
||||||
|
g, b) : Real32.real vector =
|
||||||
let
|
let
|
||||||
val endY = windowHeight - startY
|
val endY = windowHeight - startY
|
||||||
val startY = windowHeight - (startY + drawHeight)
|
val startY = windowHeight - (startY + drawHeight)
|
||||||
@@ -8,36 +9,126 @@ struct
|
|||||||
val windowHeight = windowHeight / 2.0
|
val windowHeight = windowHeight / 2.0
|
||||||
val windowWidth = windowWidth / 2.0
|
val windowWidth = windowWidth / 2.0
|
||||||
in
|
in
|
||||||
#[ (((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
#[ (((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
(((startY * (1.0 - 0.950000047684)) + (endY * 0.950000047684)) / windowHeight) - 1.0,
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
r,
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
g,
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
b,
|
(((startX * (1.0 - 0.375)) + (endX * 0.375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.375)) + (endX * 0.375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.375)) + (endX * 0.375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.5)) + (endX * 0.5)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.5)) + (endX * 0.5)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.625)) + (endX * 0.625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.5)) + (endX * 0.5)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.625)) + (endX * 0.625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.625)) + (endX * 0.625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.75)) + (endX * 0.75)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
(((startY * (1.0 - 0.25)) + (endY * 0.25)) / windowHeight) - 1.0,
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
r,
|
|
||||||
g,
|
|
||||||
b,
|
|
||||||
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
|
||||||
(((startY * (1.0 - 0.25)) + (endY * 0.25)) / windowHeight) - 1.0,
|
|
||||||
r,
|
|
||||||
g,
|
|
||||||
b,
|
|
||||||
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
|
||||||
(((startY * (1.0 - 0.25)) + (endY * 0.25)) / windowHeight) - 1.0,
|
|
||||||
r,
|
|
||||||
g,
|
|
||||||
b,
|
|
||||||
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
|
||||||
(((startY * (1.0 - 0.950000047684)) + (endY * 0.950000047684)) / windowHeight) - 1.0,
|
|
||||||
r,
|
|
||||||
g,
|
|
||||||
b,
|
|
||||||
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
(((startY * (1.0 - 0.950000047684)) + (endY * 0.950000047684)) / windowHeight) - 1.0,
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
r,
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
g,
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
b,
|
(((startX * (1.0 - 0.75)) + (endX * 0.75)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.75)) + (endX * 0.75)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.950000047684)) + (endY * 0.950000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.950000047684)) + (endY * 0.950000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.950000047684)) + (endY * 0.950000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.25)) + (endY * 0.25)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.25)) + (endY * 0.25)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.0625)) + (endX * 0.0625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.9375)) + (endX * 0.9375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.25)) + (endY * 0.25)) / windowHeight) - 1.0, r, g, b,
|
||||||
|
(((startX * (1.0 - 0.375)) + (endX * 0.375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.5)) + (endX * 0.5)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.5)) + (endX * 0.5)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.5)) + (endX * 0.5)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.375)) + (endX * 0.375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.375)) + (endX * 0.375)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.625)) + (endX * 0.625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.75)) + (endX * 0.75)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.75)) + (endX * 0.75)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.75)) + (endX * 0.75)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.625)) + (endX * 0.625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.700000047684)) + (endY * 0.700000047684)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
(((startX * (1.0 - 0.625)) + (endX * 0.625)) / windowWidth) - 1.0,
|
||||||
|
(((startY * (1.0 - 0.799999952316)) + (endY * 0.799999952316)) / windowHeight) - 1.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
|
0.0,
|
||||||
(((startX * (1.0 - 0.3125)) + (endX * 0.3125)) / windowWidth) - 1.0,
|
(((startX * (1.0 - 0.3125)) + (endX * 0.3125)) / windowWidth) - 1.0,
|
||||||
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
(((startY * (1.0 - 0.0)) + (endY * 0.0)) / windowHeight) - 1.0,
|
||||||
0.0,
|
0.0,
|
||||||
|
|||||||
Reference in New Issue
Block a user