Registriert seit: 1. Dez 2002
Ort: Oldenburg(Oldenburg)
2.008 Beiträge
FreePascal / Lazarus
|
Re: zeichen problem beim scrollen
15. Dez 2003, 17:22
das problem ist:
er zeichnet ein strein und da ist überhaupt keiner.
ich habe mal die anwendung hochgalden
hier noch mal der "neue" code zum zeichnen:
Delphi-Quellcode:
procedure T2D_Engine.DrawMap;
var
x,y,i,p,m:Integer;
begin
GLXDraw.Clear;
// sx:=0; sy:=0;
if Player.Players[Player.index].x-Player.DX >= 0 then
p:=(Player.Players[Player.index].x-Player.DX)
else
p:=0;
for x:=0 to MapX do begin
for y:=0 to MapY do begin
if Karte[x,y].typ > -1 then begin
for i:=0 to High(Karte[x,y].Tex) do begin
if p > 0 then
GLXImageList.Items[Karte[x,y].typ].Draw( (x-p) * MapS,Y*MapS,Karte[x,y].Tex[i] )
else
GLXImageList.Items[Karte[x,y].typ].Draw( X*MapS,Y*MapS,Karte[x,y].Tex[i] )
end;
end;
end;
end;
{ for i:=0 to High(Player.Players) do begin
if i = Player.index then
GLXImageList.Items[2].Draw((Player.Players[Player.index].X+39 div 2)*MapS, (Player.Players[player.index].Y+21 div 2)*mapS,Player.Players[player.index].Tex )
else
GLXImageList.Items[2].Draw( Player.players[i].X*MapS,Player.players[i].Y*MapS,Player.players[i].tex );
end;}
for i:=0 to High(Player.Players) do begin
if Player.Players[Player.index].x - Player.DX > 0 then
GLXImageList.Items[2].Draw(( Player.Players[Player.index].x-Player.DX )*MapS ,Player.players[Player.index].Y*MapS,Player.players[i].tex )
else
GLXImageList.Items[2].Draw(Player.Players[Player.index].x*MapS ,Player.players[Player.index].Y*MapS,Player.players[i].tex );
end;
GLXDraw.Flip;
end;
Michael Springwald MFG
Michael Springwald,
Bitte nur Deutsche Links angeben Danke (benutzte überwiegend Lazarus)
|
|
Zitat
|