//------------------------------------------------------------------------------- void GameApp::cleanup() { SAFE_DELETE( m_renderer ); SAFE_DELETE( m_camera ); SAFE_DELETE( m_debugCamera ); //cleanupGDOManager(); cleanupConsole(); //m_GDOManager = nullptr; }
int main(int argCount, char **argString) { char keyPressed = FALSE; int keyboardLock = FALSE; double keyboardLockTime = ojGetTimeSec() + KEYBOARD_LOCK_TIMEOUT_SEC; time_t timeStamp; //Get and Format Time String time(&timeStamp); strftime(timeString, DEFAULT_STRING_LENGTH-1, "%m-%d-%Y %X", localtime(&timeStamp)); system(CLEAR); //cDebug(1, "main: Starting Up %s Node Software\n", simulatorGetName()); // if(simulatorStartup()) // { // printf("main: %s Node Startup failed\n", simulatorGetName()); // //cDebug(1, "main: Exiting %s Node Software\n", simulatorGetName()); //#if defined(WIN32) // system("pause"); //#else // printf("Press ENTER to exit\n"); // getch(); //#endif // return 0; // } vehicleSimStartup(); pd = pdCreate(); gpos = gposCreate(); vss = vssCreate(); wd = wdCreate(); setupTerminal(); mainRunning = TRUE; while(mainRunning) { keyPressed = getUserInput(); if(keyPressed) { keyboardLockTime = ojGetTimeSec() + KEYBOARD_LOCK_TIMEOUT_SEC; } else if(ojGetTimeSec() > keyboardLockTime) { keyboardLock = TRUE; } //if(verbose) //{ // choice = getc(stdin); //} //else // Not in verbose mode //{ // choice = getch(); // Get the key that the user has selected // updateScreen(keyboardLock, choice); //} ojSleepMsec(100); } cleanupConsole(); //cDebug(1, "main: Shutting Down %s Node Software\n", simulatorGetName()); wdDestroy(wd); pdDestroy(pd); gposDestroy(gpos); vssDestroy(vss); vehicleSimShutdown(); if(logFile != NULL) { fclose(logFile); } return 0; }