From: <sv...@ww...> - 2004-06-29 11:13:03
|
Author: delta Date: 2004-06-29 04:12:56 -0700 (Tue, 29 Jun 2004) New Revision: 1112 Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp Log: InputEvent addition. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1112 Modified: trunk/CSP/CSPSim/Source/CSPSim.cpp =================================================================== --- trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-06-29 11:10:48 UTC (rev 1111) +++ trunk/CSP/CSPSim/Source/CSPSim.cpp 2004-06-29 11:12:56 UTC (rev 1112) @@ -104,7 +104,6 @@ SDLWave m_audioWave; - /////////////////////////////////////////////////////////////////////// // CSPSim @@ -115,9 +114,7 @@ */ CSPSim *CSPSim::theSim = 0; -CSPSim::CSPSim() -{ - +CSPSim::CSPSim() { if (theSim == 0) { theSim = this; } @@ -673,7 +670,6 @@ } } - void CSPSim::doInput(double dt) { CSP_LOG(APP, DEBUG, "CSPSim::doInput()..."); @@ -681,8 +677,9 @@ simdata::Ref<VirtualHID> screen_interface = m_CurrentScreen->getInterface(); SDL_Event event; - int doPoll = 10; - while (doPoll-- && SDL_PollEvent(&event)) { + short doPoll = 5; + while (doPoll-- && m_InputEvent(event)) { + //while (doPoll-- && SDL_PollEvent(&event)) { bool handled = false; HID::translate(event); if (event.type == SDL_QUIT) { @@ -707,6 +704,7 @@ handled = m_Interface->onEvent(event); } } + // run input scripts if (screen_interface.valid()) { screen_interface->onUpdate(dt); |