src/ui/uInputQueue.h File Reference

#include "defs.h"
#include "rSDL.h"

Include dependency graph for uInputQueue.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  uInputProcessGuard
 have one object of this class around while processing input More...
class  uInputScrambler
 have one object of this class around while processing sensitive input; non-control key presses will be scrambled for the recording then. More...
class  su_TimerCallback

Functions

void su_FetchAndStoreSDLInput ()
bool su_StoreSDLEvent (const SDL_Event &tEvent)
 stores an event so it will be returned by GetSDLInput() later
bool su_GetSDLInput (SDL_Event &tEvent, REAL &time)
 fetches an event
bool su_GetSDLInput (SDL_Event &tEvent)
int su_InputThread (void *)

Variables

bool su_prefetchInput
bool su_contInput


Function Documentation

void su_FetchAndStoreSDLInput (  ) 

Definition at line 79 of file uInputQueue.cpp.

References tRecorderBase::IsRunning().

Referenced by eGrid::display_simple(), eGameObject::RenderAll(), eCamera::s_Timestep(), and eGameObject::TimestepThisWrapper().

00080 {
00081 #ifndef DEDICATED
00082 #ifndef WIN32
00083 #ifndef MACOSX
00084     if (!tRecorder::IsRunning() )
00085         SDL_PumpEvents();
00086 #endif
00087 #endif
00088 #endif
00089 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool su_GetSDLInput ( SDL_Event &  tEvent  )  [inline]

Definition at line 59 of file uInputQueue.h.

References REAL, and su_GetSDLInput().

00059                                              {
00060     REAL dummy;
00061     return su_GetSDLInput(tEvent,dummy);
00062 }

Here is the call graph for this function:

bool su_GetSDLInput ( SDL_Event &  tEvent,
REAL time 
)

fetches an event

Definition at line 256 of file uInputQueue.cpp.

References EventArchiver< Archiver >::Archive(), current_out, currentIn, increase(), input_get, tRecorder::Playback(), uMenu::quickexit, tRecorder::Record(), sr_LockSDL(), sr_UnlockSDL(), su_end, su_markerRequired, tEvents, Time, and times.

Referenced by gGame::GameLoop(), uMenu::IdleInput(), uMenu::Message(), uMenu::OnEnter(), su_GetSDLInput(), and welcome().

00256                                                  {
00257     bool ret=false;
00258 
00259     // clear out data
00260     memset( &tEvent, 0, sizeof( SDL_Event ) );
00261 
00262     // find end of recording in playback
00263     if ( tRecorder::Playback(su_end) )
00264     {
00265         tRecorder::Record(su_end);
00266         uMenu::quickexit=true;
00267     }
00268 
00269     // try to fetch event from playback
00270     if ( !EventArchiver< tPlaybackBlock >::Archive( tEvent, time, ret ) )
00271     {
00272         // get real event
00273         sr_LockSDL();
00274         input_get=true;
00275         if (current_out!=currentIn){
00276             time=times[current_out];
00277             tEvent=tEvents[current_out];
00278             increase(current_out);
00279             ret=true;
00280         }
00281         else{
00282             time=Time();
00283             ret=
00284 #ifndef DEDICATED
00285                 SDL_PollEvent(&tEvent);
00286 #else
00287                 false;
00288 #endif
00289         }
00290         sr_UnlockSDL();
00291         input_get=false;
00292     }
00293 
00294     su_markerRequired |= ret;
00295 
00296     // store event in recording
00297     if ( ret )
00298         EventArchiver< tRecordingBlock >::Archive( tEvent, time, ret );
00299 
00300     return ret;

Here is the call graph for this function:

Here is the caller graph for this function:

int su_InputThread ( void *   ) 

bool su_StoreSDLEvent ( const SDL_Event &  tEvent  ) 

stores an event so it will be returned by GetSDLInput() later

Definition at line 92 of file uInputQueue.cpp.

References current_out, currentIn, increase(), input_get, next_in, tEvents, Time, and times.

Referenced by filter().

00092                                               {
00093     if (next_in!=current_out && !input_get){
00094         //con << "Extra input!\n";
00095         tEvents[currentIn]=tEvent;
00096         times[currentIn]=Time();
00097         increase(currentIn);
00098         next_in=currentIn;
00099         increase(next_in);
00100         return false;
00101     }
00102     return true;
00103 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

bool su_contInput

Definition at line 60 of file uInputQueue.cpp.

Referenced by cleanup().

bool su_prefetchInput

Definition at line 59 of file uInputQueue.cpp.

Referenced by exit_game_objects(), filter(), and init_game_objects().


Generated on Sat Mar 15 23:20:13 2008 for Armagetron Advanced by  doxygen 1.5.4