Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Util/Clooper
diff options
context:
space:
mode:
authorJames <james@mackie.(none)>2007-07-10 13:59:18 (GMT)
committer James <james@mackie.(none)>2007-07-10 13:59:18 (GMT)
commit40363272e6769096787f9f19c3b0de07f7d3af0f (patch)
treebc0b81c02076e88279827b95be98b85bae65a4a0 /Util/Clooper
parentd071e83d4a925ff5e0676c2148655f9d4621565a (diff)
getTick in float with getTickf
Diffstat (limited to 'Util/Clooper')
-rw-r--r--Util/Clooper/aclient.cpp15
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)
{