示例#1
0
PyObject* TimeDistribution::operator () ()
{
    // fix-me: replace with non pointer version
    sf::Time* value = new sf::Time;
    *value = (*distribution)();
    return wrap_time(value);
}
示例#2
0
void time_set (void) {
	double newtime;
	newtime = wrap_time();
	flame_step = 0;
	if (auxtime < newtime) {
		flame_step = newtime - auxtime;
	}
	auxtime = newtime;
	thetime += flame_step;
}
void DerivableSoundStream::onSeek(sf::Time timeOffset)
{
    PyGILState_STATE gstate;
    gstate = PyGILState_Ensure();

	static char method[] = "on_seek";
    static char format[] = "O";

    sf::Time* copyTimeOffset = new sf::Time;
    *copyTimeOffset = timeOffset;

    PyObject* pyTime = (PyObject*)(wrap_time(copyTimeOffset));
    PyObject_CallMethod(m_pyobj, method, format, pyTime);

 	Py_DECREF(pyTime);

	PyGILState_Release(gstate);
}
示例#4
0
void time_init (void)
{
	auxtime = wrap_time ();
	thetime = 0;
	srand (auxtime * 1000);
}
示例#5
0
文件: drawing.c 项目: pfroud/DialPlus
/**
 * Gets the time where a tick goes, given a tick is at current_time.
 *
 * @param current_time the time from which to get the next time
 * @param up true to go forward, false to go backwards
 * @return the time where the next tick goes
 */
static struct tm get_next_time(struct tm current_time, bool up) {
    struct tm next_time = current_time; //makes a copy of current_time
    next_time.tm_min += (up ? 10 : -10);
    return wrap_time(next_time);
}