Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Andorra - Imagelist.Add -> SIGSEGV (https://www.delphipraxis.net/161272-andorra-imagelist-add-sigsegv.html)

Noobmaster 25. Jun 2011 19:18

Andorra - Imagelist.Add -> SIGSEGV
 
Hallo!

Folgender Quellcode erzeugt eine SIGSEGV Fehlermeldung
Delphi-Quellcode:
//-----FillImagelist
//-----fills in the imagelist with alle the necessary images/textures
procedure TMainForm.FillImagelist(path: String);
begin
   { Tables }
   if ImageList <> nil then
   begin
      with Imagelist.Add('Table_Blue') do
      begin
         Texture.LoadGraphicFromFile(path+'/Tische/blau.bmp');
      end;
      with Imagelist.Add('Table_Red') do
      begin
         Texture.LoadGraphicFromFile(path+'/Tische/rot.bmp');
      end;
      with Imagelist.Add('Table_Green') do
      begin
         Texture.LoadGraphicFromFile(path+'/Tische/gruen.bmp');
      end;
      ImageList.Restore; //very important line!
   end;
end;
Anschließend springt der Compiler in folgende Prozedur der Unit "AdDraws":
Delphi-Quellcode:
procedure TAdCustomImage.Initialize;
begin
  //Finalize the image, if it is still initialized
  Finalize;

  //Create a new mesh
  AdMesh := FParent.AdAppl.CreateMesh;
end;
Ein Eine Instanz des Typs "TAdDraw" ist erstellt und der Imagelist zugewiesen:
Delphi-Quellcode:
procedure TMainForm.FormCreate(Sender: TObject);
begin
   //Surface:
   Surface := TAdDraw.Create(MainForm); //creates the Surface
   Surface.DllName := 'AndorraOGLLaz.dll'; //Loads the Dll-library; based on OpenGL

   //SpriteEngine:
   SpriteEngine := TSpriteEngine.Create(nil);
   SpriteEngine.Surface := Surface;

   //Connect the main-loop of the application with the andorra-loop
   Application.OnIdle := @Idle;

   //Create ImageList and fill in the images:
   ImageList := TAdImageList.Create(Surface);
   FillImagelist('Data/Bilder');

   NewGame();
end;
Danke schonmal für die Hilfe...

Noobmaster 28. Jun 2011 09:10

AW: Andorra - Imagelist.Add -> SIGSEGV
 
Hallo!

Das Problem tritt jetzt auch allgemein auf, wenn ich meiner AdImagelist ein Bild hinzufügen möchte:

Delphi-Quellcode:
procedure TMainForm.FormCreate(Sender: TObject);
begin
   //Surface:
   Surface := TAdDraw.Create(MainForm); //creates the Surface
   Surface.DllName := 'AndorraOGLLaz.dll'; //Loads the Dll-library; based on OpenGL

   //SpriteEngine:
   SpriteEngine := TSpriteEngine.Create(nil);
   SpriteEngine.Surface := Surface;

   //Connect the main-loop of the application with the andorra-loop
   Application.OnIdle := Idle;

   //Create ImageList and fill in the images:
   AdImageList := TAdImageList.Create(Surface);
   with AdImageList.Add('test') do
      Texture.LoadGraphicFromFile('Bilder/Data/Kugeln/Kugel1.bmp');
   //FillImagelist('Data/Bilder');

   NewGame();
end;

Progman 28. Jun 2011 10:57

AW: Andorra - Imagelist.Add -> SIGSEGV
 
Du hast ein TAdDraw mit dem Namen "Surface"?
Diesen Namen vielleicht mal ändern, denn TAdDraw hat ebenfralls intern ein Surface. Vielleicht ist es ja nur der Namenskonflikt?
"Surface" mal durch "myDraw" (oder was du willst) ersetzen?

Noobmaster 28. Jun 2011 12:14

AW: Andorra - Imagelist.Add -> SIGSEGV
 
Delphi-Quellcode:
procedure TMainForm.FormCreate(Sender: TObject);
begin
   //Surface:
   AdDraw := TAdDraw.Create(MainForm); //creates the Surface
   AdDraw.DllName := 'AndorraOGLLaz.dll'; //Loads the Dll-library; based on OpenGL

   //SpriteEngine:
   SpriteEngine := TSpriteEngine.Create(nil);
   SpriteEngine.Surface := AdDraw;

   //Connect the main-loop of the application with the andorra-loop
   Application.OnIdle := Idle;

   //Create ImageList and fill in the images:
   AdImageList := TAdImageList.Create(AdDraw);
   with AdImageList.Add('test') do
      Texture.LoadGraphicFromFile('Bilder/Data/Kugeln/Kugel1.bmp');
   //FillImagelist('Data/Bilder');

   //NewGame();
end;
Danke für die Antwort, aber es tritt immer noch der selbe Fehler auf...


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:47 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