Re: Wrapper for Windows

new topic     » goto parent     » topic index » view thread      » older message » newer message

> I am makign a game  for Windows, and do not want to distribute my graphics
> in separate files, could anybody help me in creating a wrapper that put
all
> my files in a single win32 exe ?
>
I always do this with my games and it's easy to combine all graphics and
sounds used by the game into one executable.  If you look in Win32lib there
is (or was in v. 0.45 - I haven't upgraded since) a local procedure called
loadBitmapFromFile2() which can be copied into your program and adapted for
your needs.  You will need to write down the lengths of all your graphics
files.  Then you need to concatenate them all e.g. (at the DOS prompt)::

copy /b pic1.bmp+pic2.bmp+pic3.bmp myprog.dat

It is then fairly easy to adapt loadBitmapFromFile2() to use offsets (the
lengths you have written down) within the myprog.dat file.  If you need help
on this let me know.

You can then concatenate the bound executable and the datafile in the same
way.

e.g. copy /b myprog.exe+myprog.dat myprog.exe

  To find where the data starts you need to do something like

integer fn, a, err
fn=open("myprog.exe","rb")
err=seek(fn,-1)
a=where(fn) -- tells you how long your exe file is
err=seek(fn,a-12345) -- e.g. if myprog.dat was 12345 bytes long

You should now be at the beginning of your data.

This won't work with Exotica but if anyone has any suggestions I'd like to
hear them.

chris.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu