How is the "n_images" value calculated for a "dat_shpl_type" instance?

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

How is the "n_images" value calculated for a "dat_shpl_type" instance?

Post by dmitry_s »

When I add an additional image/frame to a DAT file using the PR utility, the value of "n_images" does not change. As a workaround, I increment the value in the code for the corresponding "resource" variable value. Without the workaround the image associated for the frame does not get displayed.

The way I add a frame is by adding a line like this to the GUARD.DAT section of the "resources.xml" file and importing the change into the DAT file.

Code: Select all

<item value="785" path="dead alternate.bmp"/>
In the code it looks like the "n_images" file comes from the DAT file. I wonder why it is not getting incremented by the PR.
https://github.com/NagyD/SDLPoP/blob/96 ... 009.c#L493
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: How is the "n_images" value calculated for a "dat_shpl_type" instance?

Post by David »

"n_images" comes from the first byte of the *.pal.more files.

PR does not increment it because it does not know anything about this byte.
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

Re: How is the "n_images" value calculated for a "dat_shpl_type" instance?

Post by dmitry_s »

That worked. Thanks.
Post Reply