Original Post
I''m wanting to create resource files for a game I''m working on so I can group all my bitmaps, all my character files etc into one binary file.
What I want to do is create a simple app that will allow me to pick which bmp files I want. I''m going to create a table of contents at the beginning of the file so that I know where to go.
The example table would like something like
bitmap1.bmp|(size of bitmap1)|bitmap2.bmp|(size of bitmap2)|
Just for testing purposes I want to loop through and break the file back into seperate bitmap files.
I''m having several problems. First of all I''m wondering if a table of contents is the way to go. I couldn''t figure out how to do a search in an fstream so I thought that a header telling me where to start would work best.
Next, on the reopen, I''m having trouble putting together the actual code to break apart the file. As near as I can tell I need to use the seekg member function of fstream to get to the position based off of the file sizes of preceding bitmaps.
Example:
Bitmap1 has size of 3
Bitmap2 has size of 2
Bitmap3 has size of 4
I''m searching for bitmap3 so I would go to position 6.
Something doesn''t seem right with this. It seems sloppy and inaccurate, but I''m not sure what else to do. Thanks in advance for your help.