The Dink Network

Reply to Re: Let's make a cross platform editor for everone to use! (CALLING ALL C++ PROGAMERS!)

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
June 21st 2011, 02:45 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
In the original code, "load_map" in dinkvar.h reads from map.dat, (line 2368 and further). "load_hard" reads from hard.dat (line 3008 and further), and "load_info" reads dink.dat (line 2984). This reading is done with just a call to fread(), so you'll need to look at the struct definitions to check out what the file layout looks like. Also keep byte padding in mind, that fooled me the first time.

In freedink, loading of a single screen of map.dat happens in the "load_map_to" function of "dinkvar.c" (line 907). Similarly, there's "load_hard" around line 1860 for hard.dat and "load_info_to" (line 1785). The freedink code is explicit about reading bytes, instead of just using fread().