_rtProp.clear();
}
+void SGEventMgr::shutdown()
+{
+ _simQueue.clear();
+ _rtQueue.clear();
+}
+
void SGEventMgr::update(double delta_time_sec)
{
_simQueue.update(delta_time_sec);
_table = new HeapEntry[_tableSize];
for(int i=0; i<_tableSize; i++) {
- _table[i].pri = 0;
+ _table[i].pri = 0;
_table[i].timer = 0;
}
}
SGTimerQueue::~SGTimerQueue()
{
+ clear();
+ delete[] _table;
+}
+
+void SGTimerQueue::clear()
+{
+ // delete entries
for(int i=0; i<_numEntries; i++) {
delete _table[i].timer;
- _table[i].timer = 0;
}
+
_numEntries = 0;
- delete[] _table;
- _table = 0;
- _tableSize = 0;
+
+ // clear entire table to empty
+ for(int i=0; i<_tableSize; i++) {
+ _table[i].pri = 0;
+ _table[i].timer = 0;
+ }
}
void SGTimerQueue::update(double deltaSecs)
SGTimerQueue(int preSize=1);
~SGTimerQueue();
+ void clear();
void update(double deltaSecs);
double now() { return _now; }
virtual void init() {}
virtual void update(double delta_time_sec);
virtual void unbind();
+ virtual void shutdown();
void setRealtimeProperty(SGPropertyNode* node) { _rtProp = node; }