From: Oliver O. <fr...@us...> - 2007-06-17 13:39:37
|
Update of /cvsroot/simspark/simspark/spark/kerosin/inputserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21072/kerosin/inputserver Modified Files: inputcontrol.cpp inputserver.cpp Log Message: merge from projectx branch Index: inputcontrol.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputcontrol.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** inputcontrol.cpp 31 Mar 2007 13:18:16 -0000 1.4 --- inputcontrol.cpp 17 Jun 2007 13:38:30 -0000 1.5 *************** *** 263,288 **** if (mAdvanceTime) ! { ! // pass the delta time on to the SimulationServer ! GetSimulationServer()->AdvanceTime(mDeltaTime); ! } } ! float InputControl::GetDeltaTime() { return mDeltaTime; } ! void InputControl::SetAdvanceTime(bool advance) { mAdvanceTime = advance; } ! bool InputControl::GetAdvanceTime() { return mAdvanceTime; } ! bool InputControl::RegisterInputItem(const string& inputItemName, const string& name) { // check if a input item of the requested type was already created --- 263,292 ---- if (mAdvanceTime) ! { ! // pass the delta time on to the SimulationServer ! GetSimulationServer()->AdvanceTime(mDeltaTime); ! } } ! float ! InputControl::GetDeltaTime() { return mDeltaTime; } ! void ! InputControl::SetAdvanceTime(bool advance) { mAdvanceTime = advance; } ! bool ! InputControl::GetAdvanceTime() { return mAdvanceTime; } ! bool ! InputControl::RegisterInputItem(const string& inputItemName, const string& name) { // check if a input item of the requested type was already created *************** *** 291,297 **** if (inputItem.get() != 0) ! { ! return true; ! } // create the input item --- 295,301 ---- if (inputItem.get() != 0) ! { ! return true; ! } // create the input item *************** *** 299,307 **** if (inputItem.get() == 0) ! { ! GetLog()->Error() << "ERROR: (InputControl) Cannot create input item '" ! << inputItemName << "'" << std::endl; ! return false; ! } // link the input item in the hierarchy --- 303,311 ---- if (inputItem.get() == 0) ! { ! GetLog()->Error() << "ERROR: (InputControl) Cannot create input item '" ! << inputItemName << "'" << std::endl; ! return false; ! } // link the input item in the hierarchy *************** *** 309,317 **** if (! AddChildReference(inputItem)) ! { ! GetLog()->Error() << "ERROR: (InputControl) Cannot link the input item '" ! << inputItemName << "' to the hierarchy\n"; ! return false; ! } GetLog()->Debug() << "(InputControl) Registered input item '" --- 313,321 ---- if (! AddChildReference(inputItem)) ! { ! GetLog()->Error() << "ERROR: (InputControl) Cannot link the input item '" ! << inputItemName << "' to the hierarchy\n"; ! return false; ! } GetLog()->Debug() << "(InputControl) Registered input item '" *************** *** 321,326 **** } ! void InputControl::UpdateCached() { ! mFPSController.reset(); } --- 325,331 ---- } ! void ! InputControl::UpdateCached() { ! // mFPSController.reset(); } Index: inputserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/kerosin/inputserver/inputserver.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** inputserver.cpp 15 Mar 2007 07:26:25 -0000 1.3 --- inputserver.cpp 17 Jun 2007 13:38:30 -0000 1.4 *************** *** 263,283 **** } ! bool InputServer::GetInput(Input &input, bool raw) { shared_ptr<InputSystem> inputSystem = GetInputSystem(); if (inputSystem.get() == 0) ! { ! GetLog()->Error() ! << "(InputServer) ERROR: no InputSystem installed\n"; ! input.mId = -1; ! return false; ! } if (! inputSystem->GetInput(input)) ! { ! input.mId = -1; ! return false; ! } if ( --- 263,284 ---- } ! bool ! InputServer::GetInput(Input &input, bool raw) { shared_ptr<InputSystem> inputSystem = GetInputSystem(); if (inputSystem.get() == 0) ! { ! GetLog()->Error() ! << "(InputServer) ERROR: no InputSystem installed\n"; ! input.mId = -1; ! return false; ! } if (! inputSystem->GetInput(input)) ! { ! input.mId = -1; ! return false; ! } if ( *************** *** 285,300 **** (raw) ) ! { ! // return Input::eUser input ! return true; ! } ! // translate raw input to binding TBindMap::iterator bindListIter = mBindings.find(input.mCode); if (bindListIter == mBindings.end()) ! { ! input.mId = -1; ! return false; ! } // we have an entry for the scan code --- 286,300 ---- (raw) ) ! { ! // return Input::eUser input ! return true; ! } // translate raw input to binding TBindMap::iterator bindListIter = mBindings.find(input.mCode); if (bindListIter == mBindings.end()) ! { ! input.mId = -1; ! return false; ! } // we have an entry for the scan code *************** *** 306,310 **** --- 306,323 ---- ++bindIter ) + { + const Bind& bind = (*bindIter); + + //printf("Looking at: %d %d %d", (*bind).mCode, (*bind).cmd, (*bind).modifier); + if (bind.modifier == mModifierState) { + #if 0 + if (input.mType == Input::eButton) + { + if ((bind.event == eKeyUpDown) || + (bind.event == eKeyUp && input.mData.l == 0) || + (bind.event == eKeyDown && input.mData.l == 1) + ) + #else const Bind& bind = (*bindIter); *************** *** 314,336 **** (bind.modifier & mModifierState) ) ! { ! if (input.mType == Input::eButton) ! { ! if ((bind.event == eKeyUpDown) || ! (bind.event == eKeyUp && input.mData.l == 0) || ! (bind.event == eKeyDown && input.mData.l == 1) ! ) ! { ! input.mId = bind.cmd; ! return true; ! } ! } else if (input.mType == Input::eAxis) ! { ! input.mId = bind.cmd; ! return true; ! } ! } } ! input.mId = -1; --- 327,342 ---- (bind.modifier & mModifierState) ) ! #endif ! { ! input.mId = bind.cmd; ! return true; ! } ! else if (input.mType == Input::eAxis) ! { ! input.mId = bind.cmd; ! return true; ! } } ! } input.mId = -1; |