The array is static. I don't know how to make dynamic-sized arrays. If the static array has 163840 elements. The array is pointed to within the function though.
Code:
char LoadFile(const char FileName[64], char FileType, BITMAPINFOHEADER *BMPInfo, unsigned char *BMPData, char FogUsed, double ObjectScaling, char LoadType)
{
...
if (DebugTest[0] == 2) // check to see if the method works
{
DebugTest[0] = 3;
DebugTest[1] = sizeof(BMPData); // a test
sprintf(DebugDetails, "First array length is %d", DebugTest[1]); // to display debug details
MessageBox(hwnd, DebugDetails, "DebugResults", MB_OK | MB_ICONEXCLAMATION); // shows 4
}
if (DebugTest[0] == 1)
{
DebugTest[0] = 2;
DebugTest[2] = sizeof(BMPData); // a test
sprintf(DebugDetails, "Second array length is %d", DebugTest[2]); // to display debug details
MessageBox(hwnd, DebugDetails, "DebugResults", MB_OK | MB_ICONEXCLAMATION); // shows 4
}
if (DebugTest[0] == 0)
{
DebugTest[0] = 1;
DebugTest[3] = sizeof(BMPData); // a test
sprintf(DebugDetails, "Third array length is %d", DebugTest[3]); // to display debug details
MessageBox(hwnd, DebugDetails, "DebugResults", MB_OK | MB_ICONEXCLAMATION); // shows 4
}
What I'm doing is trying to see if the image is too big for the array.