bvschaik / citybuilding-tools

Tools for the Citybuilding games made by Impressions Games/BreakAway Games

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question regarding number on images / bitmaps

SandroWissmann opened this issue · comments

Hi there,

First of all. Thanks for the great overview of the file format. It helps a lot for reading the data for pharaoh.

I have some questions regarding the encoding which is still unclear to me.

In the header we have:

Offset | Length | Data type | Description
12 | 4 | int32 | Total number of image records present in this file
16 | 4 | int32 | Number of image records in use
20 | 4 | int32 | Number of bitmap records in this file

Now it is clear to me that the data at offset 20 number of bitmaps tells us how many bitmaps we can read from the bitmap section.

But what is the difference between
offset 12 total number of images in file and 16 number of images records in use?

At first glance in some files in pharaoh it looks like both these values are always the same.

To know how many Images i can read from the Image section do I use the calculate at offset 16 or offset 12?

Ok forget about this maybe.
I had some mistake in the code.
Now I can see:

at offset 12 I get 1000 == total images possible in the file
at offset 16 I get 682 = images in use.

Now there is just one thing.
If I start reading at the position 40680 to get the images data I get actually data for 683 images before the entries are zero.

If I see it correctly there is always a first image entry which is empty what about that?

Another question I saw in the bitmap data of each sg3 file that we always get as first bitmap:
system.bmp Static image data, common to all applications. w:300 h:200 c:200 f:1 l:200

So is really in each file first the same bmp file from system encoded? Is it something special?