delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/26/05:30:24

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3230084@probe-2.Acclaim-Euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Help me merge my .DAT and .EXE files! Please....
Date: Mon, 26 Oct 1998 10:28:44 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

Leif writes:
> My program uses a file on disk to load graphics and other misc 
> data... I was wondering how I could INCLUDE all that data into 
> my program so that it will not need any other files to be on disk.

Allegro provides two methods for doing this.

1) You can use the dat2s utility to convert an Allegro-format 
datafile (which can contain any other custom object formats that 
you like) into an assembler source file (.s), which you can then 
compile and link with your program to make all these objects 
directly available. Take a look at the setup program for an example
of this method in use.

2) You can use the exedat utility to attach a file (which can be an
Allegro datafile or any other raw data that you like) onto the end
of your executable. This can then be read back using the Allegro
packfile functions: the special filename "#" represents the entire
appended data, and a name in the form "#objectname" represents a
specific object from an appended datafile (so you can embedd lots
of objects into a datafile, append that archive in one step, and 
then read the objects back individually). See the ex34 example
program for a demonstration of using exedat.

If you aren't using Allegro, obviously neither of these methods
will be so directly useful to you, but they are both very easy
to implement, and you are welcome to borrow any bits of these
tools if they would be useful for you.


	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019