mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-15 00:55:54 +00:00
unused code begone
This commit is contained in:
parent
8a5f8d2ac7
commit
26e1da131d
3 changed files with 0 additions and 134 deletions
|
@ -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;
|
||||
|
|
47
BBGE/Event.h
47
BBGE/Event.h
|
@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <list>
|
||||
|
||||
|
||||
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<EventTimer> EventTimers;
|
||||
EventTimers eventTimers;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue