share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
changeset 10611 58cad46782ff
parent 10596 75b5b674387a
child 10630 08d0cacf2aec
equal deleted inserted replaced
10609:15f2908113a1 10611:58cad46782ff
  1101 function onParameters()
  1101 function onParameters()
  1102     parseParams()
  1102     parseParams()
  1103 	mapID = params["m"]
  1103 	mapID = params["m"]
  1104 end
  1104 end
  1105 
  1105 
  1106 PointsBuffer = ''  -- A string to accumulate points in
       
  1107 
       
  1108 function AddPoint(x, y, width, erase)
       
  1109  PointsBuffer = PointsBuffer .. string.char(band(x,0xff00) / 256 , band(x,0xff) , band(y,0xff00) / 256 , band(y,0xff))
       
  1110  if width then
       
  1111      width = bor(width,0x80)
       
  1112      if erase then
       
  1113          width = bor(width,0x40)
       
  1114      end
       
  1115      PointsBuffer = PointsBuffer .. string.char(width)
       
  1116  else
       
  1117      PointsBuffer = PointsBuffer .. string.char(0)
       
  1118  end
       
  1119  if #PointsBuffer > 245 then
       
  1120      ParseCommand('draw '..PointsBuffer)
       
  1121      PointsBuffer = ''
       
  1122  end
       
  1123 end
       
  1124 
       
  1125 function FlushPoints()
       
  1126  if #PointsBuffer > 0 then
       
  1127      ParseCommand('draw '..PointsBuffer)
       
  1128      PointsBuffer = ''
       
  1129  end
       
  1130 end
       
  1131 
       
  1132 function onPreviewInit()
  1106 function onPreviewInit()
  1133 	onGameInit()
  1107 	onGameInit()
  1134 end
  1108 end
  1135 
  1109 
  1136 function onGameInit()
  1110 function onGameInit()