Warning: ob_start(): function 'compress_handler' not found or invalid function name in /www/htdocs/xfmantis/core.php on line 18
0002325: alle Basisbaugrafiken bei Spielstart laden - Mantis
Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002325 [X-Force] Allgemein feature N/A 20.08.09 13:52 24.09.09 03:00
Reporter Natter View Status public  
Assigned To Natter
Priority normal Resolution fixed  
Status closed   Product Version V0.915b04
Summary 0002325: alle Basisbaugrafiken bei Spielstart laden
Description Ich weiß zwar nicht genau, wie das am besten umzusetzen ist, aber imho sollten alle passenden Grafiken (von der Auflösung passend) ab Spielstart für den Basisbau verfügbar sein, und nicht erst, nachdem ein entsprechendes Gebäude erforscht wurde. Ist vor allem für gescriptete Gebäude mit eigener Grafik wichtig.
Additional Information
Attached Files

- Relationships

- Notes
(0004234)
gnfalex
23.08.09 13:44

Greetings.
Yesterday I find that base building grafik is loading on DXBaseBuilder.pas strings 495-516
[code]
    AddImage(BackGroundTextureO,4,4);
    AddImage(BackGroundTextureU,4,4);
    AddImage(BackGroundAlphatron,4,4);

    for Dummy:=0 to high(FloorImages) do
    begin
      AddImage('default\BasisBau:'+FloorImages[Dummy],1,1);
    end;

    for Dummy:=0 to basis_api_GetEinrichtungCount-1 do
    begin
      with basis_api_GetEinrichtung(Dummy) do
      begin
        if RoomTyp=rtHangar then
          AddImage(ImageBase,1,1)
        else
          AddImage(ImageBase,Width,Height);
        
        AddImage(ImageUnder,Width,Height);
      end;
    end;
[/code]
It load only images of existing buildings and floor.

I suggest to add after shown fragment code like this.
[code]
    for Dummy := 0 to science_api_GetProjectCount - 1 do
    begin
      with forsch_api_GetProjectByIndex(dummy) do
      begin
        if TypeID=ptEinrichtung then
        begin
          if RoomTyp=rtHangar then AddImage(BuildImageBase,1,1)
          else AddImage(BuildImageBase,UnitWidth,UnitHeight);
          AddImage(BuildImageUnder,UnitWidth,UnitHeight);
        end;
      end;
    end;
[/code]

But this part is need only for first lauch (it load all grafiks and don't need to reload). I didn't touch any else code.
Fragment checked with Zitadelle building and at least with it work.

Can this be helpful?

Best regards
 
(0004235)
Natter
24.08.09 02:36

It would work - but imho it's not perfect. What if you want to create a room per script with an Image never used for a normal building/Project?
 
(0004236)
Natter
24.08.09 02:51

I added:

    for Dummy:=0 to high(BaseBuildingImagesSmall) do
    begin
      AddImage('default\BasisBau:'+BaseBuildingImagesSmall[Dummy],1,1);
    end;

    for Dummy:=0 to high(BaseBuildingImagesLarge) do
    begin
      AddImage('default\BasisBau:'+BaseBuildingImagesLarge[Dummy],2,2);
    end;

  // Bsaisbaugrafiken aus Spielsatz laden
  Bitmap2:=TBitmap.Create;
  fArchiv:=TArchivFile.Create;
  fArchiv.OpenArchiv(savegame_api_GetGameSet.FileName);
  Assert(fArchiv<>nil);

  for Dummy:=0 to fArchiv.Count-1 do
  begin
    TempName:=fArchiv.Files[Dummy].Name;
    if (Copy(TempName,1,Pos(':',TempName)-1)='BasisBau') then
    begin
      fArchiv.OpenRessource(dummy);
      Bitmap2.LoadFromStream(fArchiv.Stream);
      fArchiv.CloseRessource;
      fArchiv.CloseArchiv;
      AddImage('user\'+TempName,Bitmap2.Width div ObjektSize,Bitmap2.Height div ObjektSize);
      fArchiv.OpenArchiv(savegame_api_GetGameSet.FileName);
    end;
  end;
  fArchiv.Free;
  Bitmap2.free;



for Dummy:=0 to basis_api_GetEinrichtungCount-1 do ... is not used any more. Hopefully their is no problem with rtHangar ^^
 

- Issue History
Date Modified Username Field Change
20.08.09 13:52 Natter New Issue
20.08.09 13:52 Natter Summary alle Basisbaugrafiken bei Spielstzart laden => alle Basisbaugrafiken bei Spielstart laden
23.08.09 13:44 gnfalex Note Added: 0004234
24.08.09 02:36 Natter Note Added: 0004235
24.08.09 02:51 Natter Status new => resolved
24.08.09 02:51 Natter Fixed in Version  => V0.915b05
24.08.09 02:51 Natter Resolution open => fixed
24.08.09 02:51 Natter Assigned To  => Natter
24.08.09 02:51 Natter Note Added: 0004236
24.09.09 03:00 Gast Status resolved => closed


Mantis 1.0.7[^]
Copyright © 2000 - 2007 Mantis Group
Powered by Mantis Bugtracker