bitmaps as resources giving me a headache
I am getting really confused by visual studio doing unexpected things when I load bitmaps as resources.
Using Insert>Resource>Import, I find that if I try to import more than a few at a time I get a ''path not found'' warning where the path given is the folder of my project. If I import them 4 or 5 at a time, it''s fine.
The function that I am using to get the images into memory is DDLoadBitmap, which tries to load the bitmap as a resource first, and if that fails as a file.
I have in the past written .rc files manually, and I remember getting a bit confounded at the process but hacked until it worked, for this project I am loathe to do so because I have so many bitmaps (if I did this over I would use big tiled bitmaps and get individual sprites from them... but I haven''t done this so I am a bit stuck.)
After the importing process the .exe doesn''t need recompiling, and if I do recompile it, it doesn''t grow in Kb, and (surprise) it crashes if I run the exe alone, without bitmap files in same folder (debugging says it causes a ''stack overflow in kernel32'', or something along those lines). What obvious step in compiling a resource file am I missing?
possible yu are trying to include too many large images in the exe. you really should not be placing images for a game in your exe. you could try writing a packer that takes all your images and places them in one huge file. then you image loader goes through the one large file, to load the images. basically you have a header that gives the file name, size and offset within the file. there is information on gamedev.net and flipcode.com about this.
I''ve been searching, but couldn''t find any articles on this. Can anyone post a URL explaining the bitmap loading process that ''a person'' mentioned.
Hi graeme. Basically what a person is talking about is a zip file. It''s also known as a "virtual file system". There is a 3 part tut at flipcode on the subject using that name. You might also want to look into using the zlib library (zlib.org). There is a link from that site to an adaptation of the package that allows for multiple files.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement