AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Flackern auf einer Map verhindern...

Ein Thema von Master_RC · begonnen am 17. Mai 2005 · letzter Beitrag vom 3. Jun 2005
 
Benutzerbild von Master_RC
Master_RC

Registriert seit: 18. Jan 2005
459 Beiträge
 
Delphi 7 Enterprise
 
#1

Flackern auf einer Map verhindern...

  Alt 17. Mai 2005, 15:51
hi leutz!

heute schon der 3. thread zu meinem RPG

yo...
ganz schnell:
wie kann ich es verhindern, dass meine Map/Karte bei jedem Neuzeichnen flackert?
bzw... kann wer folgende funktion verbessern?
Delphi-Quellcode:
procedure MapRenew;
var aai,i,ii,iii: integer; MyRect,MyRect2: TRect; bitmap: TBitmap; ctype: string; center: TPoint;
begin
 if map[charx,chary].Begehbar = false then begin
  charx := map[0,0].startx;
  chary := map[0,0].starty;
  form1.Popup1.Title := 'ACHTUNG:';
  form1.Popup1.Text := 'Der Charakter war auf einem unzulässigen Feld! Er wurde zurückgesetzt!';
 end;
ctype := ini.ReadString('Char','type','');
MyRect2 := Rect(0,0,32,32);
if charx < 1 then charx := 1;
if chary < 1 then chary := 1;
character.mapx := charx;
character.mapy := chary;

form5.paintbox1.canvas.brush.style := bsclear;

center := Point(form5.Paintbox1.Width div 2-16,form5.Paintbox1.Height div 2-16);

for i := -2 to 2 do
  for ii := -2 to 2 do
    try
     MyRect := Rect(i*32+center.x,ii*32+center.y,i*32+center.x+32,ii*32+center.y+32);
     Bitmap:=TBitmap.Create;
      if (charx+i > 0) and (chary+ii > 0) then begin
      if FileExists('IMG/Map/'+map[charx+i,chary+ii].Textur) then begin
        Bitmap.LoadFromFile('IMG/Map/'+map[charx+i,chary+ii].Textur);
      end else Bitmap.LoadFromFile('IMG/Map/none.bmp');
      end else
        Bitmap.LoadFromFile('IMG/Map/none.bmp');
        form5.PaintBox1.Canvas.BrushCopy(MyRect,Bitmap,MyRect2,clfuchsia);
      if (charx+i > 0) and (chary+ii > 0) then begin
        if map[charx+i,chary+ii].Textur2 <> 'then begin
          Bitmap.LoadFromFile('IMG/Map/'+map[charx+i,chary+ii].Textur2);
          form5.PaintBox1.Canvas.BrushCopy(MyRect,Bitmap,MyRect2,clfuchsia);
        end;
      end;
    finally

    end;
MyRect := Rect(center.x,center.y,center.x+32,center.y+32);
 if fileexists('DATA/TEMPLATES/'+ctype+'/char_'+character.gender+'.bmp') then begin
   Bitmap.LoadFromFile('DATA/TEMPLATES/'+ctype+'/char_'+character.gender+'.bmp');
 end else begin
   Bitmap.LoadFromFile('IMG/Map/nochar.bmp');
 end;
form5.PaintBox1.Canvas.BrushCopy(MyRect,Bitmap,MyRect2,clfuchsia);
{for i := 0 to 1000 do begin
if NPCs[i].name <> '' then begin
  Bitmap.LoadFromFile(NPCs[i].smallpic);
  //MyRect := Rect((NPCs[i].x+center.x)*32,(NPCs[i].y*+center.y)*32,(NPCs[i].x+center.x)*32+32,(NPCs[i].y+center.y)*32+32);
  MyRect := Rect(i*32+center.x,ii*32+center.y,i*32+center.x+32,ii*32+center.y+32);
  form5.PaintBox1.Canvas.BrushCopy(MyRect,Bitmap,MyRect2,clfuchsia);
end;
end;}

for iii := 0 to 1000 do begin
 if NPCs[iii].name <> 'then begin
  for i := -2 to 2 do begin
   for ii := -2 to 2 do begin
    if NPCs[iii].x = charx + i then begin
     if NPCs[iii].y = chary + ii then begin
      Bitmap.LoadFromFile(NPCs[iii].smallpic);
      MyRect := Rect(i*32+center.x,ii*32+center.y,i*32+center.x+32,ii*32+center.y+32);
      form5.PaintBox1.Canvas.BrushCopy(MyRect,Bitmap,MyRect2,clfuchsia);
     end;
    end;
   end;
  end;
 end;
end;
viel spaß beim lesen
Ein Volk ist nur soviel wert, wie es dessen Toten ehrt.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:12 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz