src/main.cpp
/**
 * Performs one move per second.
 * Pops moves from the end of the list "moves".
 */
Performs one move per second.
Pops moves from the end of the list "moves".
Performs one move per second . Pops moves from the end of the list " moves " .
void update() {
    time(&now);
    if (safeToUpdate && !moves.empty() && difftime(now, lastUpdate) > 0) {
        Move m = moves.back();
        cube->rotate(m.slice, m.degrees);
        moves.pop_back();
        time(&lastUpdate);
        safeToUpdate = !moves.empty();
    }
    glutPostRedisplay();
}
void update ( ) { time ( & now ) ; if ( safeToUpdate && ! moves . empty ( ) && difftime ( now , lastUpdate ) > 0 ) { Move m = moves . back ( ) ; cube -> rotate ( m . slice , m . degrees ) ; moves . pop_back ( ) ; time ( & lastUpdate ) ; safeToUpdate = ! moves . empty ( ) ; } glutPostRedisplay ( ) ; }
Performs one move per second.
Performs one move per second .