make tests use Draw.lua for now too
authorsheepluva
Tue, 02 Dec 2014 22:11:22 +0100
changeset 10609 15f2908113a1
parent 10607 532d43f3d6f9
child 10611 58cad46782ff
make tests use Draw.lua for now too
tests/lua/drillrockets_boom.lua
tests/lua/drillrockets_drill.lua
tests/lua/hellfire_burns.lua
tests/lua/twothousandmines.lua
--- a/tests/lua/drillrockets_boom.lua	Tue Dec 02 16:45:26 2014 -0500
+++ b/tests/lua/drillrockets_boom.lua	Tue Dec 02 22:11:22 2014 +0100
@@ -1,29 +1,5 @@
 
- -- taken from http://code.google.com/p/hedgewars/wiki/LuaDrawing
- PointsBuffer = ''  -- A string to accumulate points in
- function AddPoint(x, y, width, erase)
-     PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
-     if width then
-         width = bor(width,0x80)
-         if erase then
-             width = bor(width,0x40)
-         end
-         PointsBuffer = PointsBuffer .. string.char(width)
-     else
-         PointsBuffer = PointsBuffer .. string.char(0)
-     end
-     if #PointsBuffer > 245 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
- function FlushPoints()
-     if #PointsBuffer > 0 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
-
+HedgewarsScriptLoad("/Scripts/Draw.lua")
 
 local ta_pointsize = 63
 local ta_radius = (ta_pointsize * 10 + 6) / 2
--- a/tests/lua/drillrockets_drill.lua	Tue Dec 02 16:45:26 2014 -0500
+++ b/tests/lua/drillrockets_drill.lua	Tue Dec 02 22:11:22 2014 +0100
@@ -1,29 +1,5 @@
 
- -- taken from http://code.google.com/p/hedgewars/wiki/LuaDrawing
- PointsBuffer = ''  -- A string to accumulate points in
- function AddPoint(x, y, width, erase)
-     PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
-     if width then
-         width = bor(width,0x80)
-         if erase then
-             width = bor(width,0x40)
-         end
-         PointsBuffer = PointsBuffer .. string.char(width)
-     else
-         PointsBuffer = PointsBuffer .. string.char(0)
-     end
-     if #PointsBuffer > 245 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
- function FlushPoints()
-     if #PointsBuffer > 0 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
-
+HedgewarsScriptLoad("/Scripts/Draw.lua")
 
 local ta_pointsize = 63
 local ta_radius = (ta_pointsize * 10 + 6) / 2
--- a/tests/lua/hellfire_burns.lua	Tue Dec 02 16:45:26 2014 -0500
+++ b/tests/lua/hellfire_burns.lua	Tue Dec 02 22:11:22 2014 +0100
@@ -1,29 +1,5 @@
 
- -- taken from http://code.google.com/p/hedgewars/wiki/LuaDrawing
- PointsBuffer = ''  -- A string to accumulate points in
- function AddPoint(x, y, width, erase)
-     PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
-     if width then
-         width = bor(width,0x80)
-         if erase then
-             width = bor(width,0x40)
-         end
-         PointsBuffer = PointsBuffer .. string.char(width)
-     else
-         PointsBuffer = PointsBuffer .. string.char(0)
-     end
-     if #PointsBuffer > 245 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
- function FlushPoints()
-     if #PointsBuffer > 0 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
-
+HedgewarsScriptLoad("/Scripts/Draw.lua")
 
 local ta_pointsize = 63
 local ta_radius = (ta_pointsize * 10 + 6) / 2
--- a/tests/lua/twothousandmines.lua	Tue Dec 02 16:45:26 2014 -0500
+++ b/tests/lua/twothousandmines.lua	Tue Dec 02 22:11:22 2014 +0100
@@ -1,30 +1,5 @@
--- spawns 2000 mines in a bit to see if engine can deal with it
 
- -- taken from http://code.google.com/p/hedgewars/wiki/LuaDrawing
- PointsBuffer = ''  -- A string to accumulate points in
- function AddPoint(x, y, width, erase)
-     PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
-     if width then
-         width = bor(width,0x80)
-         if erase then
-             width = bor(width,0x40)
-         end
-         PointsBuffer = PointsBuffer .. string.char(width)
-     else
-         PointsBuffer = PointsBuffer .. string.char(0)
-     end
-     if #PointsBuffer > 245 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
- function FlushPoints()
-     if #PointsBuffer > 0 then
-         ParseCommand('draw '..PointsBuffer)
-         PointsBuffer = ''
-     end
- end
-
+HedgewarsScriptLoad("/Scripts/Draw.lua")
 
 local ta_pointsize = 63
 local ta_radius = (ta_pointsize * 10 + 6) / 2