/[enigma]/enigma/src/d_statusbar.hh
ViewVC logotype

Diff of /enigma/src/d_statusbar.hh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by reallysoft, Thu May 8 11:54:26 2003 UTC revision 1.6 by dheck, Thu May 8 18:54:58 2003 UTC
# Line 63  namespace display Line 63  namespace display
63          void set_counter (int new_counter) {          void set_counter (int new_counter) {
64              if (m_showcounter_p && new_counter != m_counter) {              if (m_showcounter_p && new_counter != m_counter) {
65                  m_changedp = true;                  m_changedp = true;
66                    m_counter = new_counter;
67              }              }
             m_counter = new_counter;  
68          }          }
69          void counter_activate (bool active) {          void show_move_counter (bool active) {
70              if (active != m_showcounter_p) {              if (active != m_showcounter_p) {
71                  m_showcounter_p = active;                  m_showcounter_p = active;
72                  m_changedp      = true;                  m_changedp      = true;
73              }              }
74          }          }
75            void show_odometer (bool active) {
76                if (active != m_showodometer_p) {
77                    m_showodometer_p = active;
78                    m_changedp = true;
79                }
80            }
81    
82    
83      private:      private:
84          ScreenArea     m_itemarea;          ScreenArea     m_itemarea;
# Line 85  namespace display Line 92  namespace display
92          bool   m_showtime_p;          bool   m_showtime_p;
93          int    m_counter;          int    m_counter;
94          bool   m_showcounter_p;          bool   m_showcounter_p;
95            bool   m_showodometer_p;
96      };      };
97  }  }
98    
99  StatusBarImpl::StatusBarImpl (const ScreenArea &area)  StatusBarImpl::StatusBarImpl (const ScreenArea &area)
100      : Window(area),  : Window(area),
101        m_itemarea (area.x+142, area.y+area.h-64+5, area.w-147, 64-10),    m_itemarea (area.x+142, area.y+area.h-64+5, area.w-147, 64-10),
102        m_textarea (area.x+147, area.y+area.h-64+20, area.w-157, 32),    m_textarea (area.x+147, area.y+area.h-64+20, area.w-157, 32),
103        m_models(),    m_models(),
104        m_changedp(false),    m_changedp(false),
105        m_inventory(0),    m_inventory(0),
106        m_textview (m_textarea, *enigma::GetFont("dreamorp24")),    m_textview (m_textarea, *enigma::GetFont("dreamorp24")),
107        m_leveltime (0),    m_leveltime (0),
108        m_showtime_p (true),    m_showtime_p (true),
109        m_counter (0),    m_counter (0),
110        m_showcounter_p(false)    m_showcounter_p(false),
111      m_showodometer_p(false)
112  {}  {}
113    
114  StatusBarImpl::~StatusBarImpl()  StatusBarImpl::~StatusBarImpl()
# Line 130  StatusBarImpl::redraw (px::GC &gc, const Line 139  StatusBarImpl::redraw (px::GC &gc, const
139              int len    = snprintf(buf, BUFSIZE, "%d:%02d", minutes, seconds);              int len    = snprintf(buf, BUFSIZE, "%d:%02d", minutes, seconds);
140              s_time     = f->render(buf);              s_time     = f->render(buf);
141              xsize_time = static_cast<int>((len-0.5)*SIZE_PER_CHAR);              xsize_time = static_cast<int>((len-0.5)*SIZE_PER_CHAR);
   
             if (minutes == 0 and seconds == 30) {  
                 m_leveltime += 10*60;  
             }  
142          }          }
143    
144          if (m_showcounter_p) {          if (m_showcounter_p) {
# Line 238  StatusBarImpl::tick (double dtime) Line 243  StatusBarImpl::tick (double dtime)
243      m_leveltime += dtime;      m_leveltime += dtime;
244      if (m_showtime_p && int(m_leveltime) - int(oldtime) >= 1)      if (m_showtime_p && int(m_leveltime) - int(oldtime) >= 1)
245          m_changedp = true;      // update clock          m_changedp = true;      // update clock
246    
247        if (m_showcounter_p)
248            set_counter (player::GetMoveCounter());
249  }  }
250    
251  void  void
# Line 274  TextDisplay::set_text(const string &t, T Line 282  TextDisplay::set_text(const string &t, T
282      time = 0;      time = 0;
283    
284      switch (mode) {      switch (mode) {
285          case TEXT_2SECONDS: maxtime = 2.0;  break;      case TEXT_2SECONDS: maxtime = 2.0;  break;
286          case TEXT_5SECONDS: maxtime = 5.0;  break;      case TEXT_5SECONDS: maxtime = 5.0;  break;
287          default :           maxtime = 1e20; break; // this should be close to ``indefinitely''      default :           maxtime = 1e20; break; // this should be close to ``indefinitely''
288      }      }
289    
290      if (mode == TEXT_SCROLLING) {      if (mode == TEXT_SCROLLING) {
# Line 286  TextDisplay::set_text(const string &t, T Line 294  TextDisplay::set_text(const string &t, T
294          xoff = -(area.w - textsurface->width())/2;          xoff = -(area.w - textsurface->width())/2;
295      }      }
296    
 //     switch (m) {  
   
 //     }  
   
 //     switch (mode) {  
 //     case TEXT_SCROLLING:  
 //         xoff = -area.w;  
 //         break;  
 //     case TEXT_2SECONDS:  
 //         maxtime = 2.0;          // 2 seconds  
 //         // fall through  
 //     case TEXT_STATIC:  
 //         xoff = -(area.w - textsurface->width())/2;  
 //         break;  
 //     }  
297      changedp = active = true;      changedp = active = true;
298  }  }
299    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26