Sign in to follow this  
Mad_Kod3r

Files Hideing Question

Recommended Posts

I was wondering when people make software that has bitmaps in it, why are the bitmap files not in the file where the program is? I see this a lot in games, but I am not just talking about games I mean a lot of programs. Where is the card bitmaps in solitare, where is the bitmaps on games you download, where is the bitmaps you see in word or whatever? I know this is kind of a dumb question but I could never figure this out, because if the bitmaps are on a games cd what if it is a game that you put on ur hardrive and code doesnt come off of the cd?

Share this post


Link to post
Share on other sites
Mad_Kod3r,

Most development environments allow you to attach files as "resources," to the executable. What this means is that when you compile the executable, the IDE goes out and grabs the files you've listed as resources, opens them, and takes all the contents and attaches it to the executable somewhere.

Then in the application, rather than putting a path on disk to where the file was located, you just reference the resource. Using your bitmap example: I tell my compiler I want a bitmap called "card.bmp" as a resource, and I want the resource called CARD_BITMAP_RES. Then in my application I can do something like:

Bitmap* pBitmap = LoadBitmapFromResource( CARD_BITMAP_RES );

So to answer your question more specifically, the files you are looking for are contained within the .exe file itself.

Cheers and good luck!

Share this post


Link to post
Share on other sites
Most people use either a directry to put all the media or (this is the more likely case) put it in a "package". A Package is a compressed normally encrypted file that contains multiple files. They extract the files out of the package when they need them in game. This reduces the number of files that you have to put on the machine and it also gives a little protection to the data files. Any halfway decient hacker can crack the package but it keeps honest folks honest.

theTroll

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this