paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/src/core pgtimerobject.cpp,1.1.2.2,1.1.2.3


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/src/core pgtimerobject.cpp,1.1.2.2,1.1.2.3
Date: Wed, 29 May 2002 09:33:04 -0400

Update of /cvsroot/paragui/paragui/src/core
In directory subversions:/tmp/cvs-serv7328/src/core

Modified Files:
      Tag: devel-1-0
        pgtimerobject.cpp 
Log Message:
added old single timer (SDL_SetTimer) support to PG_TimerObject



Index: pgtimerobject.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/core/Attic/pgtimerobject.cpp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** pgtimerobject.cpp   29 May 2002 09:25:18 -0000      1.1.2.2
--- pgtimerobject.cpp   29 May 2002 13:33:01 -0000      1.1.2.3
***************
*** 4,7 ****
--- 4,8 ----
  PG_TimerID PG_TimerObject::globalTimerID = 0;
  std::map<PG_TimerID, PG_TimerObject*> PG_TimerObject::timermap;
+ PG_TimerObject* PG_TimerObject::objSingleTimer = NULL;
  
  PG_TimerObject::PG_TimerObject() {
***************
*** 14,17 ****
--- 15,21 ----
  
  PG_TimerObject::~PG_TimerObject() {
+ 
+       // stop single timers
+       StopTimer();
        
        // remove all timers of this object
***************
*** 55,60 ****
--- 59,87 ----
  }
  
+ Uint32 PG_TimerObject::eventTimer(Uint32 interval) {
+       return interval;
+ }
+ 
  Uint32 PG_TimerObject::callbackTimer(Uint32 interval, void* data) {
        PG_TimerID id = reinterpret_cast<PG_TimerID>(data);
        return timermap[id]->eventTimer(id, interval);
+ }
+ 
+ Uint32 PG_TimerObject::callbackSingleTimer(Uint32 interval) {
+       if(objSingleTimer != NULL) {
+               return objSingleTimer->eventTimer(interval);
+       }
+       
+       return 0;
+ }
+ 
+ int PG_TimerObject::SetTimer(Uint32 interval) {
+       StopTimer();
+       objSingleTimer = this;
+       return SDL_SetTimer(interval, &PG_TimerObject::callbackSingleTimer);
+ }
+       
+ void PG_TimerObject::StopTimer() {
+       objSingleTimer = NULL;
+       SDL_SetTimer(0, NULL);
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]