projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
'auto' option that always picks what it thinks is the best renderer.
[supertux.git]
/
src
/
scripting
/
time_scheduler.cpp
diff --git
a/src/scripting/time_scheduler.cpp
b/src/scripting/time_scheduler.cpp
index
41a4d6f
..
d28308b
100644
(file)
--- a/
src/scripting/time_scheduler.cpp
+++ b/
src/scripting/time_scheduler.cpp
@@
-31,7
+31,7
@@
namespace Scripting
TimeScheduler* TimeScheduler::instance = NULL;
TimeScheduler* TimeScheduler::instance = NULL;
-TimeScheduler::TimeScheduler()
: paused(false), last_update(0), internal_time(0)
+TimeScheduler::TimeScheduler()
{
}
{
}
@@
-42,10
+42,7
@@
TimeScheduler::~TimeScheduler()
void
TimeScheduler::update(float time)
{
void
TimeScheduler::update(float time)
{
- if (!paused) internal_time+=(time - last_update);
- last_update = time;
-
- while(!schedule.empty() && schedule.front().wakeup_time < internal_time) {
+ while(!schedule.empty() && schedule.front().wakeup_time < time) {
HSQOBJECT thread_ref = schedule.front().thread_ref;
sq_pushobject(global_vm, thread_ref);
HSQOBJECT thread_ref = schedule.front().thread_ref;
sq_pushobject(global_vm, thread_ref);
@@
-91,7
+88,7
@@
TimeScheduler::schedule_thread(HSQUIRRELVM scheduled_vm, float time)
sq_pop(global_vm, 2);
throw SquirrelError(global_vm, "Couldn't get thread weakref from vm");
}
sq_pop(global_vm, 2);
throw SquirrelError(global_vm, "Couldn't get thread weakref from vm");
}
- entry.wakeup_time = time
- (last_update - internal_time)
;
+ entry.wakeup_time = time;
sq_addref(global_vm, & entry.thread_ref);
sq_pop(global_vm, 2);
sq_addref(global_vm, & entry.thread_ref);
sq_pop(global_vm, 2);
@@
-100,10
+97,4
@@
TimeScheduler::schedule_thread(HSQUIRRELVM scheduled_vm, float time)
std::push_heap(schedule.begin(), schedule.end());
}
std::push_heap(schedule.begin(), schedule.end());
}
-void
-TimeScheduler::set_pause(bool paused)
-{
- this->paused = paused;
-}
-
}
}