Release problem ( SOLVED )

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
StarPirate
Posts: 12
Joined: June 29th, 2014, 11:58 am

Release problem ( SOLVED )

Post by StarPirate » December 17th, 2014, 11:10 pm

Hi guys. This is kind of a strange situation i got here. This project here, "Gravity Simulator", has no problem whatsoever building and running in debug mode or not. But when i try to open the release or debug executable the program triggers an assertion and i can't figure why because it works like a charm when i debug it.
Please guys, I really need some help on this one.
Attachments
Gravity Simulator.rar
(92.63 KiB) Downloaded 142 times
Last edited by StarPirate on December 18th, 2014, 9:14 am, edited 1 time in total.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Release problem

Post by albinopapa » December 18th, 2014, 4:05 am

The font bitmap has to be in the same folder as the executable or the string to load the file must point to it. The default directory is the directory of the exe file. Subfolders can be accessed by adding the name of the subfolder before the name separated by two back slashes...

same folder as exe
"Consolas13x24.bmp"

subfolder
"FontSheets\\Consolas13x24.bmp"
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

StarPirate
Posts: 12
Joined: June 29th, 2014, 11:58 am

Re: Release problem

Post by StarPirate » December 18th, 2014, 9:13 am

Thanks, I did not know that. Once the project is done i will post it with some instructions :)

StarPirate
Posts: 12
Joined: June 29th, 2014, 11:58 am

Re: Release problem ( SOLVED )

Post by StarPirate » December 18th, 2014, 5:34 pm

One more question: is there something I can do to hide the bmp files i am using? I don't want the user to be able to see them.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Release problem ( SOLVED )

Post by albinopapa » December 18th, 2014, 11:34 pm

I'm sure there are other ways, but one way is to make your own file format that stores the data in succession.

For instance, if all the files were the same size, you would just copy the pixels to a file one after another and you would be able to read them back in by offsetting the starting position of each read to be the start of the next bitmap data. If the files are of different sizes, you can create a struct that holds the width, the height of the bitmap and a data pointer that when you read in the data, you offset the read by the (sizeof(bitmapStructHeader) + (width * height * bitsPerPixel) of the current read position.

So for the first one you would have to read in the data for the struct, and that will leave the read pointer at sizeof(bitmapStructHeader) which would be about 12 bytes. This would give you the width and height of the first bitmap which would start at byte position 8 if the only data members in your struct are (int width, int height, D3DCOLOR* pData). If declared in that order, the first 4 bytes are width, the second 4 bytes are height, then on byte 8 ( 0 - 7 are width and height) your data would start and at the end of it your read pointer would be at the beginning of the next struct.

Make sure to use sizeof(int) because apparently the size of ints can be between 32 and 64 bits (4 - 8 bytes ) long.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply