enigma-cvs
[Top][All Lists]
Advanced

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

[Enigma-cvs] enigma/src d_statusbar.hh,1.9,1.10


From: Ralf Westram <address@hidden>
Subject: [Enigma-cvs] enigma/src d_statusbar.hh,1.9,1.10
Date: Sun, 09 Nov 2003 11:50:44 +0000

Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv32684/src

Modified Files:
        d_statusbar.hh 
Log Message:
- added StatusBarImpl::set_timer_start (to define start value of timer)
- StatusBarImpl displays negative timer values correctly



Index: d_statusbar.hh
===================================================================
RCS file: /cvsroot/enigma/enigma/src/d_statusbar.hh,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** d_statusbar.hh      7 Jun 2003 15:21:07 -0000       1.9
--- d_statusbar.hh      9 Nov 2003 11:50:42 -0000       1.10
***************
*** 60,65 ****
          void update_inventory (Inventory *inv);
  
!         void show_text (const std::string &str, 
!                         TextMode m=TEXT_SCROLLING, 
                          bool may_interrupt=false);
          void hide_text() { m_textview.deactivate(); }
--- 60,65 ----
          void update_inventory (Inventory *inv);
  
!         void show_text (const std::string &str,
!                         TextMode m=TEXT_SCROLLING,
                          bool may_interrupt=false);
          void hide_text() { m_textview.deactivate(); }
***************
*** 84,87 ****
--- 84,90 ----
          }
  
+         void set_timerstart(int timerstart) {
+             m_timerstart = timerstart;
+         }
  
      private:
***************
*** 95,102 ****
          double m_leveltime;
          bool   m_showtime_p;
          int    m_counter;
          bool   m_showcounter_p;
          bool   m_showodometer_p;
!         bool m_interruptible;   // Current text message may be interrupted
      };
  }
--- 98,106 ----
          double m_leveltime;
          bool   m_showtime_p;
+         int    m_timerstart; // startup timer value
          int    m_counter;
          bool   m_showcounter_p;
          bool   m_showodometer_p;
!         bool   m_interruptible; // Current text message may be interrupted
      };
  }
***************
*** 142,150 ****
          if (m_showtime_p) {
              Font      *f             = enigma::GetFont ("timefont");
!             int        minutes       = static_cast<int>(m_leveltime/60) % 100;
!             int        seconds       = static_cast<int>(m_leveltime) % 60;
              const int  SIZE_PER_CHAR = 16; // depends on fontsize (28 for 
timefont)
  
!             int len    = snprintf(buf, BUFSIZE, "%d:%02d", minutes, seconds);
              s_time     = f->render(buf);
              xsize_time = static_cast<int>((len-0.5)*SIZE_PER_CHAR);
--- 146,157 ----
          if (m_showtime_p) {
              Font      *f             = enigma::GetFont ("timefont");
!             double     abstime       = m_leveltime >= 0 ? m_leveltime : 
fabs(floor(m_leveltime));
!             int        minutes       = static_cast<int>(abstime/60) % 100;
!             int        seconds       = static_cast<int>(abstime) % 60;
              const int  SIZE_PER_CHAR = 16; // depends on fontsize (28 for 
timefont)
  
!             int len = snprintf(buf, BUFSIZE,
!                                m_leveltime >= 0 ? "%d:%02d" : "-%d:%02d",
!                                minutes, seconds);
              s_time     = f->render(buf);
              xsize_time = static_cast<int>((len-0.5)*SIZE_PER_CHAR);
***************
*** 258,262 ****
      double oldtime=m_leveltime;
      m_leveltime += dtime;
!     if (m_showtime_p && int(m_leveltime) - int(oldtime) >= 1)
          m_changedp = true;      // update clock
  
--- 265,269 ----
      double oldtime=m_leveltime;
      m_leveltime += dtime;
!     if (m_showtime_p && floor(m_leveltime)-floor(oldtime) >= 1)
          m_changedp = true;      // update clock
  
***************
*** 268,272 ****
  StatusBarImpl::new_world()
  {
!     m_leveltime = 0;
  
      delete_sequence(m_models.begin(), m_models.end());
--- 275,279 ----
  StatusBarImpl::new_world()
  {
!     m_leveltime = m_timerstart;
  
      delete_sequence(m_models.begin(), m_models.end());
***************
*** 301,305 ****
      case TEXT_2SECONDS: maxtime = 2.0;  break;
      case TEXT_5SECONDS: maxtime = 5.0;  break;
!     default :           
          maxtime = 1e20;         // this should be close to ``indefinitely''
          break;
--- 308,312 ----
      case TEXT_2SECONDS: maxtime = 2.0;  break;
      case TEXT_5SECONDS: maxtime = 5.0;  break;
!     default :
          maxtime = 1e20;         // this should be close to ``indefinitely''
          break;





reply via email to

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