Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : DROD 4 source + GatEB
New Topic New Poll Post Reply
Poster Message
dopefish78
Level: Roachling
Rank Points: 13
Registered: 01-15-2014
IP: Logged
icon DROD 4 source + GatEB (0)  
Hi - I'm trying to compile the DROD 4.0 source code so that it will play Gunthro and the Epic Blunder.

I have got it to compile (Linux), but the program fails to initialise. Using gdb I have identified it fails when trying to locate a graphics resource called "Fog1" while loading the game screen (SCR_Game). It looks for this in ~/.local/share/Caravel\ Games/drod-4_0/Bitmaps first, then in $(DROD_INSTALL_DIR)/Data/Bitmaps, and then gives up.

The GatEB distribution for Linux does not include any Fog1.* files in its Data/Bitmap folder, yet the included binary successfully loads and runs GatEB.

So... my question is, what am I missing? Should the Fog1 file have been found in a different place - such as in the .dat file? Or embedded in the binary itself? Or is Fog1 not required, and I am compiling DROD with the wrong settings?

Thanks!
01-15-2014 at 09:13 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: DROD 4 source + GatEB (0)  
Yes, file assets like this one are embedded in the drod4_0.dat file. Just use the one from a demo or full game install and it should work. IIRC, there's a readme in the source archive that mentions setting this up.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
01-16-2014 at 05:13 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
dopefish78
Level: Roachling
Rank Points: 13
Registered: 01-15-2014
IP: Logged
icon Re: DROD 4 source + GatEB (+3)  
Thanks for your reply.

I dug a bit further, and it actually found the Fog1.png in the DAT file. What was actually happening was libpng failing to read it, the actual error reported was "IDAT: invalid distance too far back"

I'm compiling against libpng 1.6 (not 1.5 as the binary release uses), and it appears loading of some PNG files was broken in 1.6. From the libpng manual (not allowed to post the link...):

Libpng-1.6.0 and later use the CMF bytes at the beginning of the IDAT stream
to set the size of the sliding window for reading instead of using the default
32-kbyte sliding window size. It was discovered that there are hundreds of PNG
files in the wild that have incorrect CMF bytes that cause libpng to now issue
a "too far back" error and reject the file. Libpng-1.6.3 provides a way to
revert to the libpng-1.5.x behavior (ignoring the CMF bytes and using a
32-kbyte sliding window), by using

png_set_option(png_ptr, PNG_MAXIMUM_INFLATE_WINDOW,
PNG_OPTION_ON);

and provides a tool (contrib/tools/pngfix) for optimizing the CMF bytes
correctly.

Adding the above line of code to CPNGHandler sorted the issue and it now runs successfully.

(Of course I could have used libpng 1.5, but I'd rather use the one provided by my system if possible!)

01-17-2014 at 06:32 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: DROD 4 source + GatEB (0)  
Ah, thank you for investigating this issue and reporting back with your findings and a fix!

We should include a conditional compile in the code with this line based on the libpng version.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
01-17-2014 at 09:32 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : DROD 4 source + GatEB
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.