Originally Posted by
Traveler
In case you are using something like 0 to 255(x) x 0 to 255(y) it would decrease speed quite a bit.
Yes, and make array of coordinates in initialization (do not calculate in for cycle)
Code:
for x := 0 to width_tile_count do
for y := 0 to height_tile_count do
DrawImage(aMap[x+PosX,y + PosY],x,y);
//Where PosX and PosY is your current desktop position
procedre InitCoord;
begin
for x := 0 to width_tile_count do
CoordX[x] := x*80;
for y := 0 to height_tile_count do
CoordY [y] := y*80;
end;
procedure DrawImage(pSprite, pX, pY : Integer);
begin
DxImageList1.Items[pSprite].Draw(DxDraw1.surface, CoordX[pX]-scrollX,CoordY[pY]-scrollY, 0);
end;
Bookmarks