From: Javier Sancho Date: Sun, 10 May 2020 11:04:44 +0000 (+0200) Subject: timer X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=1b678022b55a310e5feca208587f82cab17cf529;p=guile-irrlicht.git timer --- diff --git a/src/timer.cpp b/src/timer.cpp index 0022f10..48ea549 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -21,28 +21,26 @@ #include #include - #include "gsubr.h" #include "timer.h" -#include "wrapped.h" + + +using namespace irr; + + +SCM +ITimer_getTime (SCM timer) +{ + return scm_from_uint32 (((ITimer*) scm_to_pointer (timer))->getTime()); +} + extern "C" { void init_timer (void) { - init_timer_type (); - DEFINE_GSUBR ("get-time", 1, 0, 0, irr_getTime); - } - - DEFINE_WRAPPED_TYPE (irr::ITimer*, "timer", - init_timer_type, timer_p, - wrap_timer, unwrap_timer); - - SCM - irr_getTime (SCM wrapped_timer) - { - return scm_from_uint32 (unwrap_timer (wrapped_timer)->getTime()); + DEFINE_GSUBR ("ITimer_getTime", 1, 0, 0, ITimer_getTime); } } diff --git a/src/timer.h b/src/timer.h index 0187e94..fbae584 100644 --- a/src/timer.h +++ b/src/timer.h @@ -22,21 +22,9 @@ #ifndef __GUILE_IRRLICHT_TIMER_H_INCLUDED__ #define __GUILE_IRRLICHT_TIMER_H_INCLUDED__ -#include -#include -#include "wrapped.h" - extern "C" { - void init_timer (void); - - DECLARE_WRAPPED_TYPE (irr::ITimer*, init_timer_type, - timer_p, wrap_timer, unwrap_timer); - - SCM - irr_getTime (SCM wrapped_timer); - } #endif