hedgewars/uTouch.pas
changeset 11799 bb745219d882
parent 11780 2f8ffd1e1331
child 11821 d8844d4c67de
equal deleted inserted replaced
11798:984f9c76146d 11799:bb745219d882
   356 
   356 
   357 function addFinger(x,y: Longword; id: TSDL_FingerId): PTouch_Data;
   357 function addFinger(x,y: Longword; id: TSDL_FingerId): PTouch_Data;
   358 var
   358 var
   359     xCursor, yCursor, index : LongInt;
   359     xCursor, yCursor, index : LongInt;
   360 begin
   360 begin
   361 //Check array sizes
   361 // check array size
   362 while Length(fingers) <= pointerCount do
   362 // note: pointerCount will be incremented later,
       
   363 // so at this point it's the index of the new entry
       
   364 if Length(fingers) <= pointerCount then
   363     begin
   365     begin
   364     setLength(fingers, Length(fingers)*2);
   366     setLength(fingers, Length(fingers)*2);
   365     for index := Length(fingers) div 2 to (Length(fingers)-1) do
   367     for index := Length(fingers) div 2 to (Length(fingers)-1) do
   366         fingers[index].id := nilFingerId;
   368         fingers[index].id := nilFingerId;
   367     end;
   369     end;