diff options
author | James <james@mackie.(none)> | 2007-07-10 13:59:18 (GMT) |
---|---|---|
committer | James <james@mackie.(none)> | 2007-07-10 13:59:18 (GMT) |
commit | 40363272e6769096787f9f19c3b0de07f7d3af0f (patch) | |
tree | bc0b81c02076e88279827b95be98b85bae65a4a0 /Util/Clooper | |
parent | d071e83d4a925ff5e0676c2148655f9d4621565a (diff) |
getTick in float with getTickf
Diffstat (limited to 'Util/Clooper')
-rw-r--r-- | Util/Clooper/aclient.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Util/Clooper/aclient.cpp b/Util/Clooper/aclient.cpp index a01dcc3..861b590 100644 --- a/Util/Clooper/aclient.cpp +++ b/Util/Clooper/aclient.cpp @@ -209,6 +209,17 @@ struct EvLoop { return (int)rtick % tickMax; } + float getTickf(bool mod) + { + if (mod) + { + return fmod(rtick, (MYFLT)tickMax); + } + else + { + return rtick; + } + } void setNumTicks(int nticks) { tickMax = nticks; @@ -859,13 +870,13 @@ DECL(sc_setTrackpadY) //(float v) Py_INCREF(Py_None); return Py_None; } -DECL(sc_loop_getTick) // -> int +DECL(sc_loop_getTick) // -> float { if (!PyArg_ParseTuple(args, "" )) { return NULL; } - return Py_BuildValue("i", sc_tt->loop ? sc_tt->loop->getTick():-1); + return Py_BuildValue("f", sc_tt->loop ? sc_tt->loop->getTickf(true):-1.0f); } DECL(sc_loop_setNumTicks) //(int nticks) { |