From 26e1da131d37aa6b88b12bdbabd3f555ebf5a1d5 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sat, 1 Feb 2025 06:10:21 +0100 Subject: [PATCH] unused code begone --- BBGE/Event.cpp | 86 -------------------------------------------- BBGE/Event.h | 47 ------------------------ BBGE/OSFunctions.cpp | 1 - 3 files changed, 134 deletions(-) diff --git a/BBGE/Event.cpp b/BBGE/Event.cpp index d5115c7..1e50d8a 100644 --- a/BBGE/Event.cpp +++ b/BBGE/Event.cpp @@ -81,92 +81,6 @@ void EventPtr::setActionMapperCallback(ActionMapper *actionMapperCallback, int a this->stateToCall = stateToCall; } -EventPulser::EventPulser() -{ - interval = 1; - time = 1; - randomVariance = 0; - times = -1; -} - -void EventPulser::setInterval(float t) -{ - interval = time = t; -} - -void EventPulser::update(float dt) -{ - if (times == 0) return; - time -= dt; - if (time <= 0) - { - if (times != -1) - { - times --; - } - e.call(); - time = interval; - if (randomVariance) - { - time += rand()%randomVariance; - } - } -} - -EventTimer::EventTimer(const EventPtr &p, float time) -{ - eventPtr = p; - timer.start(time); -} - -void EventTimer::update(float dt) -{ - if (timer.updateCheck(dt)) - { - eventPtr.call(); - } -} - - -EventQueue::EventQueue() -{ -} - -void EventQueue::addEvent(const EventPtr &eventPtr, float t) -{ - eventTimers.push_back(EventTimer(eventPtr, t)); -} - -void EventQueue::update(float dt) -{ - for (EventTimers::iterator i = eventTimers.begin(); i != eventTimers.end();) - { - i->update(dt); - if (i->timer.isDone()) - { - i = eventTimers.erase(i); - } - else - { - i++; - } - } -} - -void EventQueue::clear() -{ - for (EventTimers::iterator i = eventTimers.begin(); i != eventTimers.end(); i++) - { - i->eventPtr.clean(); - } - eventTimers.clear(); -} - -size_t EventQueue::getSize() -{ - return eventTimers.size(); -} - Timer::Timer() { timer = time = 0; diff --git a/BBGE/Event.h b/BBGE/Event.h index bfa328c..9203451 100644 --- a/BBGE/Event.h +++ b/BBGE/Event.h @@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#include - class Event { @@ -126,49 +124,4 @@ protected: float timer, time; }; -class EventPulser -{ -public: - EventPulser(); - - void setInterval(float t); - - void update(float dt); - - float interval; - float time; - - int times; - - int randomVariance; - - EventPtr e; -}; - -class EventTimer -{ -public: - EventTimer(const EventPtr &p, float time); - - void update(float dt); - - EventPtr eventPtr; - - Timer timer; -}; - -class EventQueue -{ -public: - EventQueue(); - void addEvent(const EventPtr &eventPtr, float t); - void update(float dt); - void clear(); - size_t getSize(); - -private: - typedef std::list EventTimers; - EventTimers eventTimers; -}; - #endif diff --git a/BBGE/OSFunctions.cpp b/BBGE/OSFunctions.cpp index 972ba99..c6c17b1 100644 --- a/BBGE/OSFunctions.cpp +++ b/BBGE/OSFunctions.cpp @@ -450,7 +450,6 @@ void forEachDir(const std::string& inpath, FileIterationCallback callback, void #endif #ifdef BBGE_BUILD_WINDOWS - BOOL fFinished; HANDLE hList; TCHAR szDir[MAX_PATH+1]; WIN32_FIND_DATA FileData;