bin2o problem - reported file size
Posted: Thu Sep 04, 2008 7:42 pm
I'm not 100% sure this post belongs in this part of the forums, so point me in the right direction if I'm mistaken.
I'm experiencing a problem using bin2o. I have a data folder with one bitmap inside it that is being picked up by my make file and compiled into an object file. The header file is being generated fine, and I parse the bmp and display it as a background tile. All of this works fine. Until I change the contents of the bitmap. For some reason, when I change the contents of my bitmap and rebuild the executable, the file size that's in the generated header is around 4GB instead of around 2KB. I allocate a buffer to hold a copy of the bitmap file, since I need to mirror the pixel data before I copy it into tile memory. So when the file size is 4GB, I get a bad alloc exception and my program ends.
bin2o is just supposed to treat the file as binary data, so the contents themselves couldn't be what's causing this, right? The .o is 2KB, the size of the bitmap. Could it be a problem with how the .o is being linked into the executable? Has anyone else encountered this?
Thanks in advance
I'm experiencing a problem using bin2o. I have a data folder with one bitmap inside it that is being picked up by my make file and compiled into an object file. The header file is being generated fine, and I parse the bmp and display it as a background tile. All of this works fine. Until I change the contents of the bitmap. For some reason, when I change the contents of my bitmap and rebuild the executable, the file size that's in the generated header is around 4GB instead of around 2KB. I allocate a buffer to hold a copy of the bitmap file, since I need to mirror the pixel data before I copy it into tile memory. So when the file size is 4GB, I get a bad alloc exception and my program ends.
bin2o is just supposed to treat the file as binary data, so the contents themselves couldn't be what's causing this, right? The .o is 2KB, the size of the bitmap. Could it be a problem with how the .o is being linked into the executable? Has anyone else encountered this?
Thanks in advance