hedgewars/uScript.pas
changeset 10660 79fa79c77c38
parent 10634 35d059bd0932
child 10671 17dd6265a08a
equal deleted inserted replaced
10659:79e466c393f7 10660:79fa79c77c38
  2275     PointsBuffer:= '';
  2275     PointsBuffer:= '';
  2276 end;
  2276 end;
  2277 
  2277 
  2278 
  2278 
  2279 function lc_addPoint(L : Plua_State) : LongInt; Cdecl;
  2279 function lc_addPoint(L : Plua_State) : LongInt; Cdecl;
  2280 var np, param: integer;
  2280 var np, param: LongInt;
  2281 begin
  2281 begin
  2282     if CheckAndFetchParamCountRange(L, 2, 4, 'AddPoint', 'x, y [, width [, erase] ]', np) then
  2282     if CheckAndFetchParamCountRange(L, 2, 4, 'AddPoint', 'x, y [, width [, erase] ]', np) then
  2283         begin
  2283         begin
  2284         // x
  2284         // x
  2285         param:= lua_tointeger(L,1);
  2285         param:= LongInt(lua_tointeger(L,1));
  2286         PointsBuffer:= PointsBuffer + char((param and $FF00) shr 8);
  2286         PointsBuffer:= PointsBuffer + char((param shr 8) and $FF);
  2287         PointsBuffer:= PointsBuffer + char((param and $FF));
  2287         PointsBuffer:= PointsBuffer + char((param and $FF));
  2288         // y
  2288         // y
  2289         param:= lua_tointeger(L,2);
  2289         param:= LongInt(lua_tointeger(L,2));
  2290         PointsBuffer:= PointsBuffer + char((param and $FF00) shr 8);
  2290         PointsBuffer:= PointsBuffer + char((param shr 8) and $FF);
  2291         PointsBuffer:= PointsBuffer + char((param and $FF));
  2291         PointsBuffer:= PointsBuffer + char((param and $FF));
  2292         // width
  2292         // width
  2293         if np > 2 then
  2293         if np > 2 then
  2294             begin
  2294             begin
  2295             param:= lua_tointeger(L,3);
  2295             param:= lua_tointeger(L,3);