Einzelnen Beitrag anzeigen

Noobmaster

Registriert seit: 18. Jul 2010
114 Beiträge
 
FreePascal / Lazarus
 
#1

Andorra - Imagelist.Add -> SIGSEGV

  Alt 25. Jun 2011, 19:18
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...
  Mit Zitat antworten Zitat