Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

wise_Guy

Packaging game art in the .EXE file

This topic is 6613 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Allright! Finally I have a finished game! BUT to make it that *little* bit more professional , I was wondering how to include all the .BMP''s and .WAV''s in the exe file, so other people cannot edit/delete them? I am using Borland C++ 5, with Windows and DirectX... Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Create a copy of the exe with the bmps and wavs concatenated at the end of the file and store the offset to the beginning of the (concatenated) resources at the VERY end of the new exe. Obviously, you''ll need to change your file loading code a bit, but it won''t be major. I hope that makes sense. If I need to get more specific just say so.

Share this post


Link to post
Share on other sites
or...you could make your wav and bmp files into resources like I''ve done, it works and it isn''t hard to do.

Jerry

Share this post


Link to post
Share on other sites
If you want "professional", try writing your own picture format and loader.

the pictures are going to increase your exe size tenfolds so unless your project is small, leave the loading outside

Share this post


Link to post
Share on other sites
I used Zlib to compress my resources with my own header, then at loading decompress it out and use them. It takes a little longer to decompress the files of course.

-------------------------
-Now Working on Pokemon like Engine!

Share this post


Link to post
Share on other sites
errr....

JD - How do you include stuff into your Resource file (whatever that is...)?

Void - Why should it matter where the pictures are cos if they are in the same directory, they will take up say 5 mb, but why would they increase if stored insisde the exe?


______________________________________
getting closer, but still not there...

Share this post


Link to post
Share on other sites
If you're working with directx then MS gives you source code that can load wav and bmp files as resources. For wav the file is called dsutil3d.h and for bmp is ddutil.h. I import them into my resource workshop, the bmp you can view as picture and the wav you can view as series of bytes. You give each resource a name like ID_MISSILE and in your code you use MAKEINTRESOURCE(ID_MISSILE) macro (supplied by win32)and this will convert ID_MISSILE from number let's say 104 to string that you then pass to those wav and bmp DX7 loading functions. That's it. The exe will of course become larger but those who don't have the compiler with resource workshop won't be able to view your bmps.

The best way to protect your data would be to generate your own file format to hold the wav and bmp data and make a custom header that your app is only one that is able to read it. Then encrypt your data file and write a decryptor in your code. However hackers could hex edit your exe and find out how your decryptor works.

I like the idea of creating own zipping utility and decompress the data as the program is loading. This technique is only viable when your data is huge and don't want to take too much harddrive space on the user's machine. Oh by the way, if you're using someone else's bmp or wav then often the owner insists of putting it into a resource only format and not distribute it as a bmp or wav file so I would check their copyrights ahead of time.

Jerry

Edited by - JD on 4/14/00 8:59:29 PM

Share this post


Link to post
Share on other sites
Thanks JD! Oh, and don''t worry, all the art is done by Us (me and the artist!) so (i hope) the copyright rests with us!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!