Now it gets through the first few parts of my loop, and then crashes, with Windows 7 saying "CPhys has stopped working."
This is because of a loop somewhere in the loader header file initiating an infinite loop in reading a file, and it's in the last 3 loops, but I don't know whar D:
bool load_values()
{
int xres[4]; //X resolution temporary storage
int yres[4]; //Y resolution temporary storage
int fin[5]; //Finish counter temporary storage
char car[30],cag[30],cab[30]; //Color algorithms temporary storage
//Initialize counter
int a = 0;
//Open algorithm
FILE *file = fopen( "used_alg.alg" , "r+" );
while ( a <= 3 )
{
//Get the X resolution
xres[a] = fgetc(file);
//Convert from ASCII to usable array
xres[a] -= 48;
++a;
}
//Convert from array to usable integer
sx = ((xres[0]*1000)+(xres[1]*100)+(xres[2]*10)+xres[3]);
//Output just to make sure
cout << sx << endl;
//Initialize counter
int b = 0;
//Set what character we're looking for
fseek ( file , 4 , SEEK_SET );
while ( b <= 3 )
{
//Get Y resolution
yres[b] = fgetc(file);
//Convert ASCII to a usable array
yres[b] -= 48;
++b;
}
//Convert from array to usable integer
sy = ((yres[0]*1000)+(yres[1]*100)+(yres[2]*10)+yres[3]);
//Output just to make sure
cout << sy << endl;
//Reset counter
a = 0;
//Set what character we're looking for
fseek ( file , 8 , SEEK_SET );
while ( a <= 4 )
{
//Get finish counter
fin[a] = fgetc(file);
//Convert ASCII to a usable array
fin[a] -= 48;
++a;
}
//Convert from array to usable integer
finish = ((fin[0]*10000)+(fin[1]*1000)+(fin[2]*100)+(fin[3]*10)+fin[4]);
//Output just to make sure
cout << finish << endl;
I can't compile these due to the fact that I'm on a different OS and don't have SDL installed, but why not use breakpoints at each loop to determine which is going infinite (none of those look like they would, by the way).
I know, now I use Code::Blocks, and I don't want to use up bandwidth on something as large as VSE (I only get 16 gigs of bandwidth a month, and they cut off my service at 12 gigs, and I live with 3 other people, 1 other person who uses the internet as much as I do (lots))
I'm not fully sure, to be honest. On the surface, it looks fine, however I can't compile it as I don't have SDL and really don't wish to download and install it (though maybe I should, even if I use SFML). If I find anything, I'll tell you, but aside from that I don't see anything inherently obvious.