From: Anders R. <ma...@us...> - 2006-01-11 23:02:03
|
Update of /cvsroot/planeshift/planeshift/src/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28873/src/client Modified Files: psengine.cpp psengine.h Log Message: - Created an GenericSucc for the EventHandler in psEngine to call clientmsghandler before engine eventhandler for frame events. This to maintain the same functionality as subscribing to the now deprecated event csevPreProcess, by forcing psEngine to be called after msghandler so that messages are processesed before we start drawing. Index: psengine.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psengine.cpp,v retrieving revision 1.558 retrieving revision 1.559 diff -C2 -d -r1.558 -r1.559 *** psengine.cpp 7 Jan 2006 15:25:31 -0000 1.558 --- psengine.cpp 11 Jan 2006 23:01:53 -0000 1.559 *************** *** 754,757 **** --- 754,783 ---- // ---------------------------------------------------------------------------- + const csHandlerID * psEngine::EventHandler::GenericPrec(csRef<iEventHandlerRegistry>&handler_reg, + csRef<iEventNameRegistry>&name_reg, + csEventID e) const + { + if (name_reg->IsKindOf(e, csevFrame (name_reg))) + { + // Make sure psClientMsgHandler::EventHandler is called before psEngine + parent->EHConstraintsFramePrec[0] = handler_reg->GetGenericID("planeshift.clientmsghandler"); + parent->EHConstraintsFramePrec[1] = CS_HANDLERLIST_END; + return parent->EHConstraintsFramePrec; + } + else + { + return NULL; + } + } + + const csHandlerID * psEngine::EventHandler::GenericSucc(csRef<iEventHandlerRegistry> &, + csRef<iEventNameRegistry> &, + csEventID) const + { + return NULL; + } + + // ---------------------------------------------------------------------------- + inline bool psEngine::FrameLimit() { Index: psengine.h =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/client/psengine.h,v retrieving revision 1.185 retrieving revision 1.186 diff -C2 -d -r1.185 -r1.186 *** psengine.h 21 Dec 2005 23:40:46 -0000 1.185 --- psengine.h 11 Jan 2006 23:01:53 -0000 1.186 *************** *** 208,212 **** private: psEngine* parent; - public: SCF_DECLARE_IBASE; --- 208,211 ---- *************** *** 226,233 **** return parent->HandleEvent (ev); } CS_EVENTHANDLER_NAMES ("planeshift.engine.int") ! CS_EVENTHANDLER_NIL_CONSTRAINTS }; csRef<EventHandler> scfiEventHandler; size_t GetTime(); --- 225,242 ---- return parent->HandleEvent (ev); } + CS_EVENTHANDLER_NAMES ("planeshift.engine.int") ! CS_CONST_METHOD virtual const csHandlerID * GenericPrec( ! csRef<iEventHandlerRegistry>&, ! csRef<iEventNameRegistry>&, ! csEventID) const; ! CS_CONST_METHOD virtual const csHandlerID * GenericSucc( ! csRef<iEventHandlerRegistry>&, ! csRef<iEventNameRegistry>&, ! csEventID) const; ! CS_EVENTHANDLER_DEFAULT_INSTANCE_CONSTRAINTS; }; csRef<EventHandler> scfiEventHandler; + csHandlerID EHConstraintsFramePrec[2]; size_t GetTime(); |