[Opentnl-cvs] tnl/zap main.cpp,1.25,1.26
Brought to you by:
mark_frohnmayer,
s_alanet
From: Mark F. <mar...@us...> - 2004-05-11 02:45:38
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6106/zap Modified Files: main.cpp Log Message: Cleaned up endian file and added swaps for types > 4 bytes Fully implemented journal recording and playback Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** main.cpp 10 May 2004 22:34:24 -0000 1.25 --- main.cpp 11 May 2004 02:45:27 -0000 1.26 *************** *** 70,74 **** TNL_DECLARE_JOURNAL_ENTRYPOINT(specialkey, (S32 key, S32 x, S32 y)); TNL_DECLARE_JOURNAL_ENTRYPOINT(specialkeyup, (S32 key, S32 x, S32 y)); ! TNL_DECLARE_JOURNAL_ENTRYPOINT(idle, ()); TNL_DECLARE_JOURNAL_ENTRYPOINT(display, ()); }; --- 70,74 ---- TNL_DECLARE_JOURNAL_ENTRYPOINT(specialkey, (S32 key, S32 x, S32 y)); TNL_DECLARE_JOURNAL_ENTRYPOINT(specialkeyup, (S32 key, S32 x, S32 y)); ! TNL_DECLARE_JOURNAL_ENTRYPOINT(idle, (U32 timeDelta)); TNL_DECLARE_JOURNAL_ENTRYPOINT(display, ()); }; *************** *** 194,202 **** void idle() { - gZapJournal.idle(); - } - - TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, idle, ()) - { static S64 lastTimer = Platform::getHighPrecisionTimerValue(); static F64 unusedFraction = 0; --- 194,197 ---- *************** *** 212,223 **** unusedFraction = timeElapsed - integerTime; ! if(UserInterface::current) ! UserInterface::current->idle(integerTime); ! if(gClientGame) ! gClientGame->idle(integerTime); ! if(gServerGame) ! gServerGame->idle(integerTime); ! if(gClientGame) ! glutPostRedisplay(); } --- 207,211 ---- unusedFraction = timeElapsed - integerTime; ! gZapJournal.idle(integerTime); } *************** *** 225,228 **** --- 213,229 ---- // sleep(0) helps reduce the impact of OpenGL on windows. Platform::sleep((gClientGame ? 0 : 1)); + gZapJournal.processNextJournalEntry(); + } + + TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, idle, (U32 integerTime)) + { + if(UserInterface::current) + UserInterface::current->idle(integerTime); + if(gClientGame) + gClientGame->idle(integerTime); + if(gServerGame) + gServerGame->idle(integerTime); + if(gClientGame) + glutPostRedisplay(); } *************** *** 393,396 **** --- 394,407 ---- gJoystickType = atoi(argv[i+1]); } + else if(!stricmp(argv[i], "-jsave")) + { + if(hasAdditionalArg) + gZapJournal.record(argv[i+1]); + } + else if(!stricmp(argv[i], "-jplay")) + { + if(hasAdditionalArg) + gZapJournal.load(argv[i+1]); + } else if(!stricmp(argv[i], "-gain")) { |