summaryrefslogtreecommitdiff
path: root/examples/draw_textured_polygon/main.lua
diff options
context:
space:
mode:
authorjussi2024-04-17 00:35:58 +0300
committerjussi2024-04-17 00:35:58 +0300
commit70b40f67824b3d612235c382aa83821c054fa51e (patch)
tree5d594cc457d6fed8af87e31977a0b9352677a4f5 /examples/draw_textured_polygon/main.lua
parent41b67398247d9031aed4ca6e3ffd6799ec8b1bca (diff)
downloadreilua-enhanced-70b40f67824b3d612235c382aa83821c054fa51e.tar.gz
reilua-enhanced-70b40f67824b3d612235c382aa83821c054fa51e.tar.bz2
reilua-enhanced-70b40f67824b3d612235c382aa83821c054fa51e.zip
Object libraries like Vector2 optimizations.
Diffstat (limited to 'examples/draw_textured_polygon/main.lua')
-rw-r--r--examples/draw_textured_polygon/main.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/draw_textured_polygon/main.lua b/examples/draw_textured_polygon/main.lua
index 391d627..ddf5efc 100644
--- a/examples/draw_textured_polygon/main.lua
+++ b/examples/draw_textured_polygon/main.lua
@@ -5,9 +5,9 @@ package.path = package.path..";"..RL.GetBasePath().."../resources/lib/?.lua"
Vec2 = require( "vector2" )
local monitor = 0
-local mPos = Vec2:new( RL.GetMonitorPosition( monitor ) )
-local mSize = Vec2:new( RL.GetMonitorSize( monitor ) )
-local winSize = Vec2:new( RL.GetScreenSize() )
+local mPos = Vec2:newT( RL.GetMonitorPosition( monitor ) )
+local mSize = Vec2:newT( RL.GetMonitorSize( monitor ) )
+local winSize = Vec2:newT( RL.GetScreenSize() )
local polygon = {
texture = -1,
@@ -56,7 +56,7 @@ function RL.update( delta )
-- Update points rotation with an angle transform
-- NOTE: Base points position are not modified
for i = 1, #polygon.points do
- polygon.positions[i] = Vec2:new( RL.Vector2Rotate( polygon.points[i], polygon.angle ) )
+ polygon.positions[i] = Vec2:newT( RL.Vector2Rotate( polygon.points[i], polygon.angle ) )
end
end