summaryrefslogtreecommitdiff
path: root/src/common/timer.c
diff options
context:
space:
mode:
authorSusu <bruant.bastien@gmail.com>2013-06-07 20:03:32 +0200
committerSusu <bruant.bastien@gmail.com>2013-06-07 20:03:32 +0200
commitd73783f22b2bb881aab74524d153d89a5932a199 (patch)
treefeea3cd428cee18be3da9bf0bee6d4570d9cad02 /src/common/timer.c
parentdc7f14c7dc9829061f8902354367bdc8467eb841 (diff)
downloadhercules-d73783f22b2bb881aab74524d153d89a5932a199.tar.gz
hercules-d73783f22b2bb881aab74524d153d89a5932a199.tar.bz2
hercules-d73783f22b2bb881aab74524d153d89a5932a199.tar.xz
hercules-d73783f22b2bb881aab74524d153d89a5932a199.zip
Hercules Renewal Phase One : pc, party, map, timer
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
Diffstat (limited to 'src/common/timer.c')
-rw-r--r--src/common/timer.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/common/timer.c b/src/common/timer.c
index edb46bd71..955a971c8 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -257,7 +257,7 @@ int timer_add_interval(unsigned int tick, TimerFunc func, int id, intptr_t data,
int tid;
if( interval < 1 ) {
- ShowError("timer_add_interval: invalid interval (tick=%u %p[%s] id=%d data=%d diff_tick=%d)\n", tick, func, search_timer_func_list(func), id, data, DIFF_TICK(tick, gettick()));
+ ShowError("timer_add_interval: invalid interval (tick=%u %p[%s] id=%d data=%d diff_tick=%d)\n", tick, func, search_timer_func_list(func), id, data, DIFF_TICK(tick, iTimer->gettick()));
return INVALID_TIMER;
}
@@ -300,7 +300,7 @@ int timer_do_delete(int tid, TimerFunc func) {
/// Adjusts a timer's expiration time.
/// Returns the new tick value, or -1 if it fails.
int timer_addtick(int tid, unsigned int tick) {
- return settick_timer(tid, timer_data[tid].tick+tick);
+ return iTimer->settick_timer(tid, timer_data[tid].tick+tick);
}
/// Modifies a timer's expiration time (an alternative to deleting a timer and starting a new one).
@@ -409,15 +409,26 @@ void timer_final(void) {
BHEAP_CLEAR(timer_heap);
if (free_timer_list) aFree(free_timer_list);
}
-void timer_defaults(void) {
- gettick = timer_gettick;
- gettick_nocache = timer_gettick_nocache;
- add_timer = timer_add;
- add_timer_interval = timer_add_interval;
- add_timer_func_list = timer_add_func_list;
- get_timer = timer_get;
- delete_timer = timer_do_delete;
- addtick_timer = timer_addtick;
- settick_timer = timer_settick;
- get_uptime = timer_get_uptime;
+/*=====================================
+* Default Functions : timer.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+void timer_defaults(void) {
+ iTimer = &iTimer_s;
+
+ /* funcs */
+ iTimer->gettick = timer_gettick;
+ iTimer->gettick_nocache = timer_gettick_nocache;
+ iTimer->add_timer = timer_add;
+ iTimer->add_timer_interval = timer_add_interval;
+ iTimer->add_timer_func_list = timer_add_func_list;
+ iTimer->get_timer = timer_get;
+ iTimer->delete_timer = timer_do_delete;
+ iTimer->addtick_timer = timer_addtick;
+ iTimer->settick_timer = timer_settick;
+ iTimer->get_uptime = timer_get_uptime;
+ iTimer->do_timer = do_timer;
+ iTimer->init = timer_init;
+ iTimer->final = timer_final;
}