[Opentnl-cvs] tnl/zap UI.cpp,1.2,1.3 UI.h,1.3,1.4 UIGame.cpp,1.15,1.16 UIGame.h,1.4,1.5 main.cpp,1.1
Brought to you by:
mark_frohnmayer,
s_alanet
From: Mark F. <mar...@us...> - 2004-05-03 22:56:00
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26044/zap Modified Files: UI.cpp UI.h UIGame.cpp UIGame.h main.cpp moveObject.h quickChat.h timer.h Log Message: Added newlines to end of files Updated README Index: moveObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/moveObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** moveObject.h 20 Apr 2004 04:27:20 -0000 1.1 --- moveObject.h 3 May 2004 22:55:51 -0000 1.2 *************** *** 85,87 **** }; ! #endif \ No newline at end of file --- 85,87 ---- }; ! #endif Index: timer.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/timer.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** timer.h 2 May 2004 06:27:41 -0000 1.1 --- timer.h 3 May 2004 22:55:51 -0000 1.2 *************** *** 74,76 **** }; ! #endif \ No newline at end of file --- 74,76 ---- }; ! #endif Index: quickChat.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** quickChat.h 22 Apr 2004 07:27:43 -0000 1.1 --- quickChat.h 3 May 2004 22:55:51 -0000 1.2 *************** *** 63,65 **** }; ! #endif \ No newline at end of file --- 63,65 ---- }; ! #endif Index: UI.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UI.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UI.h 27 Apr 2004 20:41:53 -0000 1.3 --- UI.h 3 May 2004 22:55:51 -0000 1.4 *************** *** 50,53 **** --- 50,56 ---- virtual void onMouseDown(S32 x, S32 y); virtual void onMouseUp(S32 x, S32 y); + virtual void onRightMouseDown(S32 x, S32 y); + virtual void onRightMouseUp(S32 x, S32 y); + virtual void onMouseMoved(S32 x, S32 y); virtual void onMouseDragged(S32 x, S32 y); Index: UI.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UI.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UI.cpp 22 Apr 2004 07:46:20 -0000 1.2 --- UI.cpp 3 May 2004 22:55:51 -0000 1.3 *************** *** 121,124 **** --- 121,134 ---- } + void UserInterface::onRightMouseDown(S32 x, S32 y) + { + + } + + void UserInterface::onRightMouseUp(S32 x, S32 y) + { + + } + void UserInterface::onMouseMoved(S32 x, S32 y) { Index: UIGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UIGame.h 27 Apr 2004 20:41:53 -0000 1.4 --- UIGame.h 3 May 2004 22:55:51 -0000 1.5 *************** *** 92,95 **** --- 92,97 ---- void onMouseDown(S32 x, S32 y); void onMouseUp(S32 x, S32 y); + void onRightMouseDown(S32 x, S32 y); + void onRightMouseUp(S32 x, S32 y); void onKeyDown(U32 key); void onKeyUp(U32 key); Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** UIGame.cpp 3 May 2004 02:41:01 -0000 1.15 --- UIGame.cpp 3 May 2004 22:55:51 -0000 1.16 *************** *** 272,275 **** --- 272,285 ---- } + void GameUserInterface::onRightMouseDown(S32 x, S32 y) + { + mCurrentMove.shield = true; + } + + void GameUserInterface::onRightMouseUp(S32 x, S32 y) + { + mCurrentMove.shield = false; + } + void GameUserInterface::onControllerButtonDown(U32 buttonIndex) { Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** main.cpp 3 May 2004 22:06:16 -0000 1.16 --- main.cpp 3 May 2004 22:55:51 -0000 1.17 *************** *** 88,107 **** void mouse(int button, int state, int x, int y) { ! // This is pretty gross. We need a trigger system. - BJG ! static int mouseState = 0; ! if(UserInterface::current && button == 0) { ! if(state==1 && !mouseState) { UserInterface::current->onMouseUp(x, y); ! mouseState = 0; } else { ! mouseState = state; UserInterface::current->onMouseDown(x, y); } } } --- 88,121 ---- void mouse(int button, int state, int x, int y) { ! static int mouseState[2] = { 0, }; ! if(!UserInterface::current) ! return; ! if(button == GLUT_LEFT_BUTTON) { ! if(state == 1 && !mouseState[0]) { UserInterface::current->onMouseUp(x, y); ! mouseState[0] = 0; } else { ! mouseState[0] = state; UserInterface::current->onMouseDown(x, y); } } + else if(button == GLUT_RIGHT_BUTTON) + { + if(state == 1 && !mouseState[1]) + { + UserInterface::current->onRightMouseUp(x, y); + mouseState[1] = 0; + } + else + { + mouseState[1] = state; + UserInterface::current->onRightMouseDown(x, y); + } + } } |