mt_maui
2006.11.30, 11:34 PM
Alright, I've been banging my head against the wall with this problem, ran the debugger over it, and just can't make head or tale of what exactly is happening.
Here's the offending line of code:
if(runningTurn) {
turnCounter = (SDL_GetTicks() - turnStart) / 10;
printf("turn: %d\n", turnCounter);
if(turnCounter >= currentPath.getLength()) {
printf("pathLength:%f\n", currentPath.getLength()); //causes lockup
turnCounter = 0;
runningTurn = false;
} else {
//gTestDot.positionToPoint(currentPath.getCurrentPoi nt(turnCounter));
}
}
The weird thing is, this program runs fine if I comment out that second printf(), but locks up when I leave it in as soon as runningTurn becomes true, without even printing the output of the first printf statement.
In the debugger, it shows that it gets the return value from the getLength() function successfully, and goes unresponsive when the thread box shows "prinft$LDBLstub".
:mad:I'm going crazy right now, this makes no sense to me. I can forget about this thing and focus on finals, I've never seen anything like it. Anyone have any clue what could be causing this?
Here's the offending line of code:
if(runningTurn) {
turnCounter = (SDL_GetTicks() - turnStart) / 10;
printf("turn: %d\n", turnCounter);
if(turnCounter >= currentPath.getLength()) {
printf("pathLength:%f\n", currentPath.getLength()); //causes lockup
turnCounter = 0;
runningTurn = false;
} else {
//gTestDot.positionToPoint(currentPath.getCurrentPoi nt(turnCounter));
}
}
The weird thing is, this program runs fine if I comment out that second printf(), but locks up when I leave it in as soon as runningTurn becomes true, without even printing the output of the first printf statement.
In the debugger, it shows that it gets the return value from the getLength() function successfully, and goes unresponsive when the thread box shows "prinft$LDBLstub".
:mad:I'm going crazy right now, this makes no sense to me. I can forget about this thing and focus on finals, I've never seen anything like it. Anyone have any clue what could be causing this?