(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 |
(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 ^^ |