From d0aa09889903a137fb623d36b3018f6f50014877 Mon Sep 17 00:00:00 2001 From: Ryex Date: Sun, 10 Aug 2014 20:54:15 -0600 Subject: [PATCH] removing generated cython files --- rabbyt/rabbyt._anims.c | 14300 ----------------------------------- rabbyt/rabbyt._rabbyt.c | 5322 ------------- rabbyt/rabbyt._sprites.c | 6220 --------------- rabbyt/rabbyt.collisions.c | 7485 ------------------ rabbyt/rabbyt.primitives.c | 5774 -------------- 5 files changed, 39101 deletions(-) delete mode 100644 rabbyt/rabbyt._anims.c delete mode 100644 rabbyt/rabbyt._rabbyt.c delete mode 100644 rabbyt/rabbyt._sprites.c delete mode 100644 rabbyt/rabbyt.collisions.c delete mode 100644 rabbyt/rabbyt.primitives.c diff --git a/rabbyt/rabbyt._anims.c b/rabbyt/rabbyt._anims.c deleted file mode 100644 index b5e5ab4..0000000 --- a/rabbyt/rabbyt._anims.c +++ /dev/null @@ -1,14300 +0,0 @@ -/* Generated by Cython 0.19.2 on Mon Dec 16 21:39:48 2013 */ - -#define PY_SSIZE_T_CLEAN -#ifndef CYTHON_USE_PYLONG_INTERNALS -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 0 -#else -#include "pyconfig.h" -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 1 -#else -#define CYTHON_USE_PYLONG_INTERNALS 0 -#endif -#endif -#endif -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02040000 - #error Cython requires Python 2.4+. -#else -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION -#define CYTHON_COMPILING_IN_PYPY 1 -#define CYTHON_COMPILING_IN_CPYTHON 0 -#else -#define CYTHON_COMPILING_IN_PYPY 0 -#define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define CYTHON_FORMAT_SSIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) - #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ - (PyErr_Format(PyExc_TypeError, \ - "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ - (PyObject*)0)) - #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ - !PyComplex_Check(o)) - #define PyIndex_Check __Pyx_PyIndex_Check - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) - #define __PYX_BUILD_PY_SSIZE_T "i" -#else - #define __PYX_BUILD_PY_SSIZE_T "n" - #define CYTHON_FORMAT_SSIZE_T "z" - #define __Pyx_PyIndex_Check PyIndex_Check -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) - #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) - typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); - typedef void (*releasebufferproc)(PyObject *, Py_buffer *); -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 - #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_TPFLAGS_HAVE_VERSION_TAG 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ - PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_VERSION_HEX < 0x03020000 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and - a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is - a quiet NaN. */ - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE__rabbyt___anims -#define __PYX_HAVE_API__rabbyt___anims -#include "anim_sys.h" -#include "include_math.h" -#include "stdlib.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) -#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return u_end - u - 1; -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (ascii_chars_u == NULL) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - } - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - default_encoding_c = PyBytes_AS_STRING(default_encoding); - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(sys); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -#ifdef __GNUC__ - /* Test for GCC > 2.95 */ - #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #else /* __GNUC__ > 2 ... */ - #define likely(x) (x) - #define unlikely(x) (x) - #endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "rabbyt._anims.pyx", -}; - -/*--- Type declarations ---*/ -struct __pyx_obj_6rabbyt_6_anims_Anim; -struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader; -struct __pyx_obj_6rabbyt_6_anims_AnimProxy; -struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim; -struct __pyx_obj_6rabbyt_6_anims_AnimSlot; -struct __pyx_obj_6rabbyt_6_anims_AnimPointer; -struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim; -struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase; -struct __pyx_obj_6rabbyt_6_anims_AnimWrap; -struct __pyx_obj_6rabbyt_6_anims_anim_slot; -struct __pyx_obj_6rabbyt_6_anims_cAnimable; -struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc; -struct __pyx_obj_6rabbyt_6_anims_AnimConst; -struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier; -struct __pyx_obj_6rabbyt_6_anims_AnimRate; -struct __pyx_obj_6rabbyt_6_anims_ChainAnim; -struct __pyx_t_6rabbyt_6_anims_chain_link_s; -typedef struct __pyx_t_6rabbyt_6_anims_chain_link_s __pyx_t_6rabbyt_6_anims_chain_link_s; -struct __pyx_t_6rabbyt_6_anims_chain_data_s; -typedef struct __pyx_t_6rabbyt_6_anims_chain_data_s __pyx_t_6rabbyt_6_anims_chain_data_s; -struct __pyx_t_6rabbyt_6_anims_static_bezier3_data_s; -typedef struct __pyx_t_6rabbyt_6_anims_static_bezier3_data_s __pyx_t_6rabbyt_6_anims_static_bezier3_data_s; -struct __pyx_t_6rabbyt_6_anims_wrap_data; -struct __pyx_t_6rabbyt_6_anims_op_data; -struct __pyx_t_6rabbyt_6_anims__py_func_data; -struct __pyx_t_6rabbyt_6_anims_rate_data; - -/* "rabbyt/rabbyt._anims.pyx":520 - * return self._data.end_time - * - * ctypedef struct chain_link_s: # <<<<<<<<<<<<<< - * float end_time - * Anim_s anim - */ -struct __pyx_t_6rabbyt_6_anims_chain_link_s { - float end_time; - Anim_s anim; -}; - -/* "rabbyt/rabbyt._anims.pyx":524 - * Anim_s anim - * - * ctypedef struct chain_data_s: # <<<<<<<<<<<<<< - * int link_count - * chain_link_s * links - */ -struct __pyx_t_6rabbyt_6_anims_chain_data_s { - int link_count; - __pyx_t_6rabbyt_6_anims_chain_link_s *links; -}; - -/* "rabbyt/rabbyt._anims.pyx":601 - * return t - * - * ctypedef struct static_bezier3_data_s: # <<<<<<<<<<<<<< - * int link_count - * float p0 - */ -struct __pyx_t_6rabbyt_6_anims_static_bezier3_data_s { - int link_count; - float p0; - float startt; - float endt; - int extend; - float one_over_dt; - float a; - float b; - float c; - int use_global_time; - AnimSlot_s t; -}; - -/* "rabbyt/rabbyt._anims.pyx":667 - * - * - * cdef struct wrap_data: # <<<<<<<<<<<<<< - * float a, b - * AnimSlot_s input - */ -struct __pyx_t_6rabbyt_6_anims_wrap_data { - float a; - float b; - AnimSlot_s input; -}; - -/* "rabbyt/rabbyt._anims.pyx":726 - * - * - * cdef struct op_data: # <<<<<<<<<<<<<< - * AnimSlot_s a, b - * - */ -struct __pyx_t_6rabbyt_6_anims_op_data { - AnimSlot_s a; - AnimSlot_s b; -}; - -/* "rabbyt/rabbyt._anims.pyx":788 - * return "" % self.operation_name - * - * cdef struct _py_func_data: # <<<<<<<<<<<<<< - * void * function - * float cache, cache_time - */ -struct __pyx_t_6rabbyt_6_anims__py_func_data { - void *function; - float cache; - float cache_time; - int do_cache; -}; - -/* "rabbyt/rabbyt._anims.pyx":874 - * self.cache_time = 0 - * - * cdef struct rate_data: # <<<<<<<<<<<<<< - * AnimSlot_s target - * float last, last_time, last_rate - */ -struct __pyx_t_6rabbyt_6_anims_rate_data { - AnimSlot_s target; - float last; - float last_time; - float last_rate; -}; - -/* "rabbyt\_anims.pxd":40 - * cdef _modify_slots(self) - * - * cdef class Anim: # <<<<<<<<<<<<<< - * cdef Anim_s _anim - * cdef object dependencies - */ -struct __pyx_obj_6rabbyt_6_anims_Anim { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtab; - Anim_s _anim; - PyObject *dependencies; -}; - - -/* "rabbyt/rabbyt._anims.pyx":657 - * return v - * - * cdef class AnimSlotReader(Anim): # <<<<<<<<<<<<<< - * cdef AnimSlot read_slot - * def __init__(self, AnimSlot read_slot not None): - */ -struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *read_slot; -}; - - -/* "rabbyt/rabbyt._anims.pyx":831 - * - * - * cdef class AnimProxy(AnimSlotReader): # <<<<<<<<<<<<<< - * """ - * ``AnimProxy(value, cache=False)`` - */ -struct __pyx_obj_6rabbyt_6_anims_AnimProxy { - struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader __pyx_base; - int cache_output; - float cache; - float cache_time; -}; - - -/* "rabbyt/rabbyt._anims.pyx":762 - * - * - * cdef class ArithmeticAnim(Anim): # <<<<<<<<<<<<<< - * cdef op_data _data - * cdef public object operation_name - */ -struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - struct __pyx_t_6rabbyt_6_anims_op_data _data; - PyObject *operation_name; -}; - - -/* "rabbyt\_anims.pxd":45 - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1 - * - * cdef class AnimSlot: # <<<<<<<<<<<<<< - * cdef AnimSlot_s _internal_slot - * cdef AnimSlot_s * _slot - */ -struct __pyx_obj_6rabbyt_6_anims_AnimSlot { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *__pyx_vtab; - AnimSlot_s _internal_slot; - AnimSlot_s *_slot; - struct __pyx_obj_6rabbyt_6_anims_Anim *_py_anim; -}; - - -/* "rabbyt/rabbyt._anims.pyx":388 - * - * - * cdef class AnimPointer(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimPointer(pointer, [owner])`` - */ -struct __pyx_obj_6rabbyt_6_anims_AnimPointer { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - PyObject *_owner; -}; - - -/* "rabbyt/rabbyt._anims.pyx":427 - * return self._owner - * - * cdef class InterpolateAnim(Anim): # <<<<<<<<<<<<<< - * cdef InterpolateAnim_data _data - * cdef public object method_name - */ -struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - InterpolateAnim_data _data; - PyObject *method_name; -}; - - -/* "rabbyt/rabbyt._anims.pyx":120 - * return end - * - * cdef class IncompleteAnimBase: # <<<<<<<<<<<<<< - * """ - * This class is only used for introspection. rabbyt.anims.IncompleteAnim is - */ -struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase { - PyObject_HEAD -}; - - -/* "rabbyt/rabbyt._anims.pyx":671 - * AnimSlot_s input - * - * cdef class AnimWrap(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimWrap(bounds, parent, static=True)`` - */ -struct __pyx_obj_6rabbyt_6_anims_AnimWrap { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - struct __pyx_t_6rabbyt_6_anims_wrap_data _data; - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *input_slot; -}; - - -/* "rabbyt/rabbyt._anims.pyx":249 - * self.c_set_value(value) - * - * cdef class anim_slot # <<<<<<<<<<<<<< - * - * cdef class cAnimable: - */ -struct __pyx_obj_6rabbyt_6_anims_anim_slot { - PyObject_HEAD - int index; - float default_value; - PyObject *__doc__; -}; - - -/* "rabbyt\_anims.pxd":34 - * cdef void READ_SLOT(AnimSlot_s * slot, float * out) - * - * cdef class cAnimable: # <<<<<<<<<<<<<< - * cdef object _anim_list - * cdef int c_slot_count - */ -struct __pyx_obj_6rabbyt_6_anims_cAnimable { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable *__pyx_vtab; - PyObject *_anim_list; - int c_slot_count; - AnimSlot_s **c_anim_slots; -}; - - -/* "rabbyt/rabbyt._anims.pyx":803 - * return v - * - * cdef class AnimPyFunc(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimPyFunc(function, cache=False)`` - */ -struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - PyObject *function; - struct __pyx_t_6rabbyt_6_anims__py_func_data _data; -}; - - -/* "rabbyt/rabbyt._anims.pyx":372 - * return ((slot.anim.data))[0] - * - * cdef class AnimConst(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimConst(value)`` - */ -struct __pyx_obj_6rabbyt_6_anims_AnimConst { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - float v; -}; - - -/* "rabbyt/rabbyt._anims.pyx":623 - * return d.a*t3 + d.b*t2 + d.c*t + d.p0 - * - * cdef class AnimStaticCubicBezier(Anim): # <<<<<<<<<<<<<< - * cdef static_bezier3_data_s _data - * - */ -struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - __pyx_t_6rabbyt_6_anims_static_bezier3_data_s _data; -}; - - -/* "rabbyt/rabbyt._anims.pyx":893 - * return d.last_rate - * - * cdef class AnimRate(Anim): # <<<<<<<<<<<<<< - * cdef rate_data _data - * def __init__(self, target): - */ -struct __pyx_obj_6rabbyt_6_anims_AnimRate { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - struct __pyx_t_6rabbyt_6_anims_rate_data _data; -}; - - -/* "rabbyt/rabbyt._anims.pyx":546 - * return slot.anim.func(slot) - * - * cdef class ChainAnim(Anim): # <<<<<<<<<<<<<< - * cdef chain_data_s chain_data - * cdef object _anims - */ -struct __pyx_obj_6rabbyt_6_anims_ChainAnim { - struct __pyx_obj_6rabbyt_6_anims_Anim __pyx_base; - __pyx_t_6rabbyt_6_anims_chain_data_s chain_data; - PyObject *_anims; -}; - - - -/* "rabbyt/rabbyt._anims.pyx":143 - * return self - * - * cdef class Anim: # <<<<<<<<<<<<<< - * """ - * ``Anim()`` - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_Anim { - int (*add_dependency)(struct __pyx_obj_6rabbyt_6_anims_Anim *, PyObject *, AnimSlot_s *); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtabptr_6rabbyt_6_anims_Anim; - - -/* "rabbyt/rabbyt._anims.pyx":893 - * return d.last_rate - * - * cdef class AnimRate(Anim): # <<<<<<<<<<<<<< - * cdef rate_data _data - * def __init__(self, target): - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimRate { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimRate *__pyx_vtabptr_6rabbyt_6_anims_AnimRate; - - -/* "rabbyt/rabbyt._anims.pyx":372 - * return ((slot.anim.data))[0] - * - * cdef class AnimConst(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimConst(value)`` - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimConst { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimConst *__pyx_vtabptr_6rabbyt_6_anims_AnimConst; - - -/* "rabbyt/rabbyt._anims.pyx":198 - * target.local = float(source) - * - * cdef class AnimSlot: # <<<<<<<<<<<<<< - * #cdef AnimSlot_s _internal_slot - * #cdef AnimSlot_s * _slot - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot { - int (*c_set_anim)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, struct __pyx_obj_6rabbyt_6_anims_Anim *); - struct __pyx_obj_6rabbyt_6_anims_Anim *(*c_get_anim)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *); - float (*c_get_value)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *); - int (*c_set_value)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, float); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *__pyx_vtabptr_6rabbyt_6_anims_AnimSlot; - - -/* "rabbyt/rabbyt._anims.pyx":762 - * - * - * cdef class ArithmeticAnim(Anim): # <<<<<<<<<<<<<< - * cdef op_data _data - * cdef public object operation_name - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_ArithmeticAnim { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_ArithmeticAnim *__pyx_vtabptr_6rabbyt_6_anims_ArithmeticAnim; - - -/* "rabbyt/rabbyt._anims.pyx":623 - * return d.a*t3 + d.b*t2 + d.c*t + d.p0 - * - * cdef class AnimStaticCubicBezier(Anim): # <<<<<<<<<<<<<< - * cdef static_bezier3_data_s _data - * - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimStaticCubicBezier { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; - float (*g)(struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimStaticCubicBezier *__pyx_vtabptr_6rabbyt_6_anims_AnimStaticCubicBezier; - - -/* "rabbyt/rabbyt._anims.pyx":251 - * cdef class anim_slot - * - * cdef class cAnimable: # <<<<<<<<<<<<<< - * #cdef object _anim_list - * #cdef int c_slot_count - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable { - PyObject *(*_modify_slots)(struct __pyx_obj_6rabbyt_6_anims_cAnimable *); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable *__pyx_vtabptr_6rabbyt_6_anims_cAnimable; - - -/* "rabbyt/rabbyt._anims.pyx":427 - * return self._owner - * - * cdef class InterpolateAnim(Anim): # <<<<<<<<<<<<<< - * cdef InterpolateAnim_data _data - * cdef public object method_name - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_InterpolateAnim { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_InterpolateAnim *__pyx_vtabptr_6rabbyt_6_anims_InterpolateAnim; - - -/* "rabbyt/rabbyt._anims.pyx":671 - * AnimSlot_s input - * - * cdef class AnimWrap(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimWrap(bounds, parent, static=True)`` - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimWrap { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimWrap *__pyx_vtabptr_6rabbyt_6_anims_AnimWrap; - - -/* "rabbyt/rabbyt._anims.pyx":388 - * - * - * cdef class AnimPointer(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimPointer(pointer, [owner])`` - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimPointer { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimPointer *__pyx_vtabptr_6rabbyt_6_anims_AnimPointer; - - -/* "rabbyt/rabbyt._anims.pyx":657 - * return v - * - * cdef class AnimSlotReader(Anim): # <<<<<<<<<<<<<< - * cdef AnimSlot read_slot - * def __init__(self, AnimSlot read_slot not None): - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlotReader { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlotReader *__pyx_vtabptr_6rabbyt_6_anims_AnimSlotReader; - - -/* "rabbyt/rabbyt._anims.pyx":803 - * return v - * - * cdef class AnimPyFunc(Anim): # <<<<<<<<<<<<<< - * """ - * ``AnimPyFunc(function, cache=False)`` - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimPyFunc { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimPyFunc *__pyx_vtabptr_6rabbyt_6_anims_AnimPyFunc; - - -/* "rabbyt/rabbyt._anims.pyx":546 - * return slot.anim.func(slot) - * - * cdef class ChainAnim(Anim): # <<<<<<<<<<<<<< - * cdef chain_data_s chain_data - * cdef object _anims - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_ChainAnim { - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_ChainAnim *__pyx_vtabptr_6rabbyt_6_anims_ChainAnim; - - -/* "rabbyt/rabbyt._anims.pyx":831 - * - * - * cdef class AnimProxy(AnimSlotReader): # <<<<<<<<<<<<<< - * """ - * ``AnimProxy(value, cache=False)`` - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimProxy { - struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlotReader __pyx_base; -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimProxy *__pyx_vtabptr_6rabbyt_6_anims_AnimProxy; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - if (acquire_gil) { \ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - PyGILState_Release(__pyx_gilstate_save); \ - } else { \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext() \ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XDECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_XDECREF(tmp); \ - } while (0) -#define __Pyx_DECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_DECREF(tmp); \ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ - -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif - return PyObject_SetAttr(obj, attr_name, value); -} -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { - PyObject *method, *result = NULL; - if (unlikely(!args)) return NULL; - method = __Pyx_PyObject_GetAttrStr(obj, method_name); - if (unlikely(!method)) goto bad; - result = PyObject_Call(method, args, NULL); - Py_DECREF(method); -bad: - Py_DECREF(args); - return result; -} -#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ - __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) -#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ - __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) -#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ - __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) -#define __Pyx_PyObject_CallMethod0(obj, name) \ - __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) - -static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ - -static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ -#if CYTHON_COMPILING_IN_PYPY -#define __Pyx_PyObject_AsDouble(obj) \ -(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \ - likely(PyInt_CheckExact(obj)) ? \ - PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj)) -#else -#define __Pyx_PyObject_AsDouble(obj) \ -((likely(PyFloat_CheckExact(obj))) ? \ - PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) -#endif - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ - -#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) { - int result = PySequence_Contains(seq, item); - return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); -} - -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ - const char* function_name); /*proto*/ - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact); /*proto*/ - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) -#else -#define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) -#endif - -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -#if PY_MAJOR_VERSION >= 3 -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */ - -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename); /*proto*/ - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_check_binary_version(void); - -typedef struct { - int code_line; - PyCodeObject* code_object; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - - -/* Module declarations from 'rabbyt._anims' */ -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_Anim = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimSlotReader = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimProxy = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimSlot = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimPointer = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_InterpolateAnim = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_IncompleteAnimBase = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimWrap = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_anim_slot = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_cAnimable = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimPyFunc = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimConst = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimStaticCubicBezier = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimRate = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_ChainAnim = 0; -static float __pyx_f_6rabbyt_6_anims__on_end_clear(AnimSlot_s *, void *, float); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__anim_const_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__on_end_chain(AnimSlot_s *, void *, float); /*proto*/ -static float __pyx_f_6rabbyt_6_anims_extend_t(float, int); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__static_bezier3_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__slot_reader_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__wrap_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__add_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__sub_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__mul_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__div_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__py_func_func(AnimSlot_s *); /*proto*/ -static float __pyx_f_6rabbyt_6_anims__rate_func(AnimSlot_s *); /*proto*/ -#define __Pyx_MODULE_NAME "rabbyt._anims" -int __pyx_module_is_main_rabbyt___anims = 0; - -/* Implementation of 'rabbyt._anims' */ -static PyObject *__pyx_builtin_NotImplementedError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_pf_6rabbyt_6_anims_set_time(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_t); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_2get_time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_4add_time(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_t); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_2__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_4__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -#if PY_MAJOR_VERSION < 3 -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_6__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -#endif -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_8__neg__(struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_10__pos__(struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_4Anim___init__(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_2__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_4__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_6__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -#if PY_MAJOR_VERSION < 3 -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_8__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ -#endif -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_10__neg__(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_12__pos__(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_14get_value(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_16get(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_8AnimSlot___init__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_8AnimSlot_4anim___get__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_8AnimSlot_4anim_2__set__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self, PyObject *__pyx_v_anim); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_8AnimSlot_5value___get__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_8AnimSlot_5value_2__set__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self, float __pyx_v_value); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9cAnimable___init__(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ -static void __pyx_pf_6rabbyt_6_anims_9cAnimable_2__dealloc__(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9cAnimable_14anim_slot_list___get__(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9cAnimable_4set_anim_slot_locations(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9cAnimable_6set_anim_slot_locations_in_array(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self, PyObject *__pyx_v_attr_names); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9anim_slot___init__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_default, PyObject *__pyx_v_doc, PyObject *__pyx_v_index); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_2__get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_type_); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_4__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_obj, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_6get_slot(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_obj); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_5index___get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_5index_2__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_13default_value___get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_13default_value_2__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc_____get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc___2__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc___4__del__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9AnimConst___init__(struct __pyx_obj_6rabbyt_6_anims_AnimConst *__pyx_v_self, float __pyx_v_v); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_11AnimPointer___init__(struct __pyx_obj_6rabbyt_6_anims_AnimPointer *__pyx_v_self, PyObject *__pyx_v_pointer, PyObject *__pyx_v_owner); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_11AnimPointer_5owner___get__(struct __pyx_obj_6rabbyt_6_anims_AnimPointer *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_15InterpolateAnim___init__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_extend, float __pyx_v_startt, float __pyx_v_endt, PyObject *__pyx_v_t); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_5start___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_3end___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_6startt___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_4endt___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_2dt___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_2__repr__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_8end_time___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name_2__set__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name_4__del__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9ChainAnim___init__(struct __pyx_obj_6rabbyt_6_anims_ChainAnim *__pyx_v_self, PyObject *__pyx_v_anims); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9ChainAnim_5anims___get__(struct __pyx_obj_6rabbyt_6_anims_ChainAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9ChainAnim_2__dealloc___(struct __pyx_obj_6rabbyt_6_anims_ChainAnim *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_21AnimStaticCubicBezier___init__(struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *__pyx_v_self, float __pyx_v_p0, float __pyx_v_p1, float __pyx_v_p2, float __pyx_v_p3, float __pyx_v_startt, float __pyx_v_endt, PyObject *__pyx_v_t, int __pyx_v_extend); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_14AnimSlotReader___init__(struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_read_slot); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_8AnimWrap___init__(struct __pyx_obj_6rabbyt_6_anims_AnimWrap *__pyx_v_self, PyObject *__pyx_v_bounds, PyObject *__pyx_v_parent, PyObject *__pyx_v_static); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim___init__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self, PyObject *__pyx_v_operation, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_2__repr__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name___get__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_2__set__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_4__del__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_10AnimPyFunc___init__(struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_cache); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9AnimProxy___init__(struct __pyx_obj_6rabbyt_6_anims_AnimProxy *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_cache); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_9AnimProxy_5value___get__(struct __pyx_obj_6rabbyt_6_anims_AnimProxy *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_9AnimProxy_5value_2__set__(struct __pyx_obj_6rabbyt_6_anims_AnimProxy *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static int __pyx_pf_6rabbyt_6_anims_8AnimRate___init__(struct __pyx_obj_6rabbyt_6_anims_AnimRate *__pyx_v_self, PyObject *__pyx_v_target); /* proto */ -static PyObject *__pyx_pf_6rabbyt_6_anims_6to_Anim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v); /* proto */ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_Anim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimSlotReader(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimProxy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_ArithmeticAnim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimSlot(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimPointer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_InterpolateAnim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_IncompleteAnimBase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimWrap(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_anim_slot(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_cAnimable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimPyFunc(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimConst(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimStaticCubicBezier(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimRate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_6_anims_ChainAnim(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static char __pyx_k_1[] = "_anim_slot_descriptors"; -static char __pyx_k_2[] = "set_anim_slot_locations"; -static char __pyx_k_3[] = "_anim_slot_descriptor_names"; -static char __pyx_k_4[] = ""; -static char __pyx_k_5[] = "Animable is not yet initialized. Call Animable.__init__(self) first. (Or Sprite.__init__)"; -static char __pyx_k_7[] = "Animable is not yet initialized."; -static char __pyx_k_9[] = ""; -static char __pyx_k_11[] = "Unknown arithmetic operation"; -static char __pyx_k_13[] = ""; -static char __pyx_k_16[] = "AnimProxy currently doesn't support caching."; -static char __pyx_k_18[] = "to_Anim() is deprecated"; -static char __pyx_k_20[] = "\n The value that this anim will return.\n\n You can assign another anim here, and it's value will be returned.\n "; -static char __pyx_k_21[] = "\n\nThis module provides the compiled Anim classes. Everything is imported into\nthe rabbyt.anims module, and should be accessed from there.\n\n"; -static char __pyx_k_22[] = "\nCopyright (C) 2007 Matthew Marshall\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"; -static char __pyx_k_23[] = "Matthew Marshall "; -static char __pyx_k_26[] = "C:\\Users\\Ryexander\\Desktop\\Rabbyt-0.8.3\\rabbyt\\rabbyt._anims.pyx"; -static char __pyx_k_27[] = "rabbyt._anims"; -static char __pyx_k__a[] = "a"; -static char __pyx_k__b[] = "b"; -static char __pyx_k__c[] = "c"; -static char __pyx_k__t[] = "t"; -static char __pyx_k__v[] = "v"; -static char __pyx_k__dv[] = "dv"; -static char __pyx_k__p0[] = "p0"; -static char __pyx_k__p1[] = "p1"; -static char __pyx_k__p2[] = "p2"; -static char __pyx_k__p3[] = "p3"; -static char __pyx_k__add[] = "add"; -static char __pyx_k__div[] = "div"; -static char __pyx_k__doc[] = "doc"; -static char __pyx_k__end[] = "end"; -static char __pyx_k__mul[] = "mul"; -static char __pyx_k__sub[] = "sub"; -static char __pyx_k__anim[] = "anim"; -static char __pyx_k__endt[] = "endt"; -static char __pyx_k__lerp[] = "lerp"; -static char __pyx_k__warn[] = "warn"; -static char __pyx_k__anims[] = "anims"; -static char __pyx_k__cache[] = "cache"; -static char __pyx_k__index[] = "index"; -static char __pyx_k__owner[] = "owner"; -static char __pyx_k__range[] = "range"; -static char __pyx_k__start[] = "start"; -static char __pyx_k__value[] = "value"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__bounds[] = "bounds"; -static char __pyx_k__ctypes[] = "ctypes"; -static char __pyx_k__extend[] = "extend"; -static char __pyx_k__method[] = "method"; -static char __pyx_k__parent[] = "parent"; -static char __pyx_k__repeat[] = "repeat"; -static char __pyx_k__startt[] = "startt"; -static char __pyx_k__static[] = "static"; -static char __pyx_k__target[] = "target"; -static char __pyx_k____get__[] = "__get__"; -static char __pyx_k__default[] = "default"; -static char __pyx_k__pointer[] = "pointer"; -static char __pyx_k__reverse[] = "reverse"; -static char __pyx_k__to_Anim[] = "to_Anim"; -static char __pyx_k____base__[] = "__base__"; -static char __pyx_k____init__[] = "__init__"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__add_time[] = "add_time"; -static char __pyx_k__constant[] = "constant"; -static char __pyx_k__contents[] = "contents"; -static char __pyx_k__end_time[] = "end_time"; -static char __pyx_k__function[] = "function"; -static char __pyx_k__get_slot[] = "get_slot"; -static char __pyx_k__get_time[] = "get_time"; -static char __pyx_k__in_array[] = "in_array"; -static char __pyx_k__set_time[] = "set_time"; -static char __pyx_k__warnings[] = "warnings"; -static char __pyx_k____class__[] = "__class__"; -static char __pyx_k__addressof[] = "addressof"; -static char __pyx_k__ease_back[] = "ease_back"; -static char __pyx_k__ease_circ[] = "ease_circ"; -static char __pyx_k__ease_quad[] = "ease_quad"; -static char __pyx_k__ease_sine[] = "ease_sine"; -static char __pyx_k__get_value[] = "get_value"; -static char __pyx_k__operation[] = "operation"; -static char __pyx_k__read_slot[] = "read_slot"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k____author__[] = "__author__"; -static char __pyx_k____import__[] = "__import__"; -static char __pyx_k__ease_cubic[] = "ease_cubic"; -static char __pyx_k__stacklevel[] = "stacklevel"; -static char __pyx_k____credits__[] = "__credits__"; -static char __pyx_k__ease_bounce[] = "ease_bounce"; -static char __pyx_k__extrapolate[] = "extrapolate"; -static char __pyx_k__one_over_dt[] = "one_over_dt"; -static char __pyx_k__RuntimeError[] = "RuntimeError"; -static char __pyx_k__ease_in_back[] = "ease_in_back"; -static char __pyx_k__ease_in_circ[] = "ease_in_circ"; -static char __pyx_k__ease_in_quad[] = "ease_in_quad"; -static char __pyx_k__ease_in_sine[] = "ease_in_sine"; -static char __pyx_k__ease_in_cubic[] = "ease_in_cubic"; -static char __pyx_k__ease_out_back[] = "ease_out_back"; -static char __pyx_k__ease_out_circ[] = "ease_out_circ"; -static char __pyx_k__ease_out_quad[] = "ease_out_quad"; -static char __pyx_k__ease_out_sine[] = "ease_out_sine"; -static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__"; -static char __pyx_k__ease_in_bounce[] = "ease_in_bounce"; -static char __pyx_k__ease_out_cubic[] = "ease_out_cubic"; -static char __pyx_k__force_complete[] = "force_complete"; -static char __pyx_k__ease_out_bounce[] = "ease_out_bounce"; -static char __pyx_k__get_data_stride[] = "get_data_stride"; -static char __pyx_k__get_data_ptr_addr[] = "get_data_ptr_addr"; -static char __pyx_k__NotImplementedError[] = "NotImplementedError"; -static char __pyx_k__ease_in_exponential[] = "ease_in_exponential"; -static PyObject *__pyx_n_s_1; -static PyObject *__pyx_kp_s_11; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_16; -static PyObject *__pyx_kp_s_18; -static PyObject *__pyx_n_s_2; -static PyObject *__pyx_kp_s_22; -static PyObject *__pyx_kp_s_23; -static PyObject *__pyx_kp_s_26; -static PyObject *__pyx_n_s_27; -static PyObject *__pyx_n_s_3; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_kp_s_9; -static PyObject *__pyx_n_s__NotImplementedError; -static PyObject *__pyx_n_s__RuntimeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____author__; -static PyObject *__pyx_n_s____base__; -static PyObject *__pyx_n_s____class__; -static PyObject *__pyx_n_s____credits__; -static PyObject *__pyx_n_s____get__; -static PyObject *__pyx_n_s____import__; -static PyObject *__pyx_n_s____init__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____pyx_vtable__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s__a; -static PyObject *__pyx_n_s__add; -static PyObject *__pyx_n_s__add_time; -static PyObject *__pyx_n_s__addressof; -static PyObject *__pyx_n_s__anim; -static PyObject *__pyx_n_s__anims; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__b; -static PyObject *__pyx_n_s__bounds; -static PyObject *__pyx_n_s__c; -static PyObject *__pyx_n_s__cache; -static PyObject *__pyx_n_s__constant; -static PyObject *__pyx_n_s__contents; -static PyObject *__pyx_n_s__ctypes; -static PyObject *__pyx_n_s__default; -static PyObject *__pyx_n_s__div; -static PyObject *__pyx_n_s__doc; -static PyObject *__pyx_n_s__dv; -static PyObject *__pyx_n_s__ease_back; -static PyObject *__pyx_n_s__ease_bounce; -static PyObject *__pyx_n_s__ease_circ; -static PyObject *__pyx_n_s__ease_cubic; -static PyObject *__pyx_n_s__ease_in_back; -static PyObject *__pyx_n_s__ease_in_bounce; -static PyObject *__pyx_n_s__ease_in_circ; -static PyObject *__pyx_n_s__ease_in_cubic; -static PyObject *__pyx_n_s__ease_in_exponential; -static PyObject *__pyx_n_s__ease_in_quad; -static PyObject *__pyx_n_s__ease_in_sine; -static PyObject *__pyx_n_s__ease_out_back; -static PyObject *__pyx_n_s__ease_out_bounce; -static PyObject *__pyx_n_s__ease_out_circ; -static PyObject *__pyx_n_s__ease_out_cubic; -static PyObject *__pyx_n_s__ease_out_quad; -static PyObject *__pyx_n_s__ease_out_sine; -static PyObject *__pyx_n_s__ease_quad; -static PyObject *__pyx_n_s__ease_sine; -static PyObject *__pyx_n_s__end; -static PyObject *__pyx_n_s__end_time; -static PyObject *__pyx_n_s__endt; -static PyObject *__pyx_n_s__extend; -static PyObject *__pyx_n_s__extrapolate; -static PyObject *__pyx_n_s__force_complete; -static PyObject *__pyx_n_s__function; -static PyObject *__pyx_n_s__get_data_ptr_addr; -static PyObject *__pyx_n_s__get_data_stride; -static PyObject *__pyx_n_s__get_slot; -static PyObject *__pyx_n_s__get_time; -static PyObject *__pyx_n_s__get_value; -static PyObject *__pyx_n_s__in_array; -static PyObject *__pyx_n_s__index; -static PyObject *__pyx_n_s__lerp; -static PyObject *__pyx_n_s__method; -static PyObject *__pyx_n_s__mul; -static PyObject *__pyx_n_s__one_over_dt; -static PyObject *__pyx_n_s__operation; -static PyObject *__pyx_n_s__owner; -static PyObject *__pyx_n_s__p0; -static PyObject *__pyx_n_s__p1; -static PyObject *__pyx_n_s__p2; -static PyObject *__pyx_n_s__p3; -static PyObject *__pyx_n_s__parent; -static PyObject *__pyx_n_s__pointer; -static PyObject *__pyx_n_s__range; -static PyObject *__pyx_n_s__read_slot; -static PyObject *__pyx_n_s__repeat; -static PyObject *__pyx_n_s__reverse; -static PyObject *__pyx_n_s__set_time; -static PyObject *__pyx_n_s__stacklevel; -static PyObject *__pyx_n_s__start; -static PyObject *__pyx_n_s__startt; -static PyObject *__pyx_n_s__static; -static PyObject *__pyx_n_s__sub; -static PyObject *__pyx_n_s__t; -static PyObject *__pyx_n_s__target; -static PyObject *__pyx_n_s__to_Anim; -static PyObject *__pyx_n_s__v; -static PyObject *__pyx_n_s__value; -static PyObject *__pyx_n_s__warn; -static PyObject *__pyx_n_s__warnings; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_2; -static PyObject *__pyx_int_neg_1; -static PyObject *__pyx_k_10; -static PyObject *__pyx_k_14; -static PyObject *__pyx_k_15; -static PyObject *__pyx_k_tuple_6; -static PyObject *__pyx_k_tuple_8; -static PyObject *__pyx_k_tuple_12; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_19; -static PyObject *__pyx_k_tuple_24; -static PyObject *__pyx_k_tuple_29; -static PyObject *__pyx_k_tuple_31; -static PyObject *__pyx_k_codeobj_25; -static PyObject *__pyx_k_codeobj_28; -static PyObject *__pyx_k_codeobj_30; -static PyObject *__pyx_k_codeobj_32; - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_1set_time(PyObject *__pyx_self, PyObject *__pyx_arg_t); /*proto*/ -static char __pyx_doc_6rabbyt_6_anims_set_time[] = "\n ``set_time(t)``\n\n Sets the time that ``get_time()`` should return.\n\n If you are using any time based animations, (such as ``lerp()``,)\n you should call this function every frame.\n\n For example, if you are using pygame you can do this::\n\n rabbyt.set_time(pygame.time.get_ticks())\n\n Using this function should make it easier to implement a pause feature.\n\n Note that rabbyt makes no assumption about the unit that the time is in.\n You can use milliseconds or seconds or even something else. It's up to\n you.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_6_anims_1set_time = {__Pyx_NAMESTR("set_time"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_1set_time, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_6_anims_set_time)}; -static PyObject *__pyx_pw_6rabbyt_6_anims_1set_time(PyObject *__pyx_self, PyObject *__pyx_arg_t) { - float __pyx_v_t; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_time (wrapper)", 0); - assert(__pyx_arg_t); { - __pyx_v_t = __pyx_PyFloat_AsFloat(__pyx_arg_t); if (unlikely((__pyx_v_t == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.set_time", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_set_time(__pyx_self, ((float)__pyx_v_t)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":68 - * import warnings - * - * def set_time(float t): # <<<<<<<<<<<<<< - * """ - * ``set_time(t)`` - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_set_time(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_t) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_time", 0); - - /* "rabbyt/rabbyt._anims.pyx":87 - * you. - * """ - * _set_time(t) # <<<<<<<<<<<<<< - * - * def get_time(): - */ - _set_time(__pyx_v_t); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_3get_time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6rabbyt_6_anims_2get_time[] = "\n ``get_time()``\n\n Gets the time that was last set by ``set_time()``\n "; -static PyMethodDef __pyx_mdef_6rabbyt_6_anims_3get_time = {__Pyx_NAMESTR("get_time"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_3get_time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_6_anims_2get_time)}; -static PyObject *__pyx_pw_6rabbyt_6_anims_3get_time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_time (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_2get_time(__pyx_self); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":89 - * _set_time(t) - * - * def get_time(): # <<<<<<<<<<<<<< - * """ - * ``get_time()`` - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_2get_time(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_time", 0); - - /* "rabbyt/rabbyt._anims.pyx":95 - * Gets the time that was last set by ``set_time()`` - * """ - * return _get_time() # <<<<<<<<<<<<<< - * - * def add_time(float t): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(_get_time()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.get_time", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_5add_time(PyObject *__pyx_self, PyObject *__pyx_arg_t); /*proto*/ -static char __pyx_doc_6rabbyt_6_anims_4add_time[] = "\n ``add_time(t)``\n\n Adds ``t`` to the ... time ... (Is it just me or does that sound dorky?)\n\n This is really just a short cut that does this:\n\n .. sourcecode:: python\n\n set_time(get_time() + t)\n\n The new time is returned.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_6_anims_5add_time = {__Pyx_NAMESTR("add_time"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_5add_time, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_6_anims_4add_time)}; -static PyObject *__pyx_pw_6rabbyt_6_anims_5add_time(PyObject *__pyx_self, PyObject *__pyx_arg_t) { - float __pyx_v_t; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("add_time (wrapper)", 0); - assert(__pyx_arg_t); { - __pyx_v_t = __pyx_PyFloat_AsFloat(__pyx_arg_t); if (unlikely((__pyx_v_t == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.add_time", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_4add_time(__pyx_self, ((float)__pyx_v_t)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":97 - * return _get_time() - * - * def add_time(float t): # <<<<<<<<<<<<<< - * """ - * ``add_time(t)`` - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4add_time(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_t) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("add_time", 0); - - /* "rabbyt/rabbyt._anims.pyx":111 - * The new time is returned. - * """ - * _add_time(t) # <<<<<<<<<<<<<< - * return _get_time() - * - */ - _add_time(__pyx_v_t); - - /* "rabbyt/rabbyt._anims.pyx":112 - * """ - * _add_time(t) - * return _get_time() # <<<<<<<<<<<<<< - * - * cdef float _on_end_clear(AnimSlot_s * slot, void * data, float end): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(_get_time()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.add_time", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":114 - * return _get_time() - * - * cdef float _on_end_clear(AnimSlot_s * slot, void * data, float end): # <<<<<<<<<<<<<< - * slot.anim = NULL - * slot.type = SLOT_LOCAL - */ - -static float __pyx_f_6rabbyt_6_anims__on_end_clear(AnimSlot_s *__pyx_v_slot, CYTHON_UNUSED void *__pyx_v_data, float __pyx_v_end) { - float __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_on_end_clear", 0); - - /* "rabbyt/rabbyt._anims.pyx":115 - * - * cdef float _on_end_clear(AnimSlot_s * slot, void * data, float end): - * slot.anim = NULL # <<<<<<<<<<<<<< - * slot.type = SLOT_LOCAL - * slot.local = end - */ - __pyx_v_slot->anim = NULL; - - /* "rabbyt/rabbyt._anims.pyx":116 - * cdef float _on_end_clear(AnimSlot_s * slot, void * data, float end): - * slot.anim = NULL - * slot.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * slot.local = end - * return end - */ - __pyx_v_slot->type = SLOT_LOCAL; - - /* "rabbyt/rabbyt._anims.pyx":117 - * slot.anim = NULL - * slot.type = SLOT_LOCAL - * slot.local = end # <<<<<<<<<<<<<< - * return end - * - */ - __pyx_v_slot->local = __pyx_v_end; - - /* "rabbyt/rabbyt._anims.pyx":118 - * slot.type = SLOT_LOCAL - * slot.local = end - * return end # <<<<<<<<<<<<<< - * - * cdef class IncompleteAnimBase: - */ - __pyx_r = __pyx_v_end; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_1__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_1__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase___add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":125 - * where the implementation is. - * """ - * def __add__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("add", self, other) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__add__", 0); - - /* "rabbyt/rabbyt._anims.pyx":126 - * """ - * def __add__(self, other): - * return ArithmeticAnim("add", self, other) # <<<<<<<<<<<<<< - * - * def __sub__(self, other): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__add)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__add)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__add)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.IncompleteAnimBase.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_3__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_3__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_2__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":128 - * return ArithmeticAnim("add", self, other) - * - * def __sub__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("sub", self, other) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_2__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__sub__", 0); - - /* "rabbyt/rabbyt._anims.pyx":129 - * - * def __sub__(self, other): - * return ArithmeticAnim("sub", self, other) # <<<<<<<<<<<<<< - * - * def __mul__(self, other): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sub)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__sub)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sub)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.IncompleteAnimBase.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_5__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_5__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_4__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":131 - * return ArithmeticAnim("sub", self, other) - * - * def __mul__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("mul", self, other) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_4__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__mul__", 0); - - /* "rabbyt/rabbyt._anims.pyx":132 - * - * def __mul__(self, other): - * return ArithmeticAnim("mul", self, other) # <<<<<<<<<<<<<< - * - * def __div__(self, other): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__mul)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__mul)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mul)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.IncompleteAnimBase.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -#if PY_MAJOR_VERSION < 3 -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_7__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_7__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_6__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -#endif /*!(#if PY_MAJOR_VERSION < 3)*/ - -/* "rabbyt/rabbyt._anims.pyx":134 - * return ArithmeticAnim("mul", self, other) - * - * def __div__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("div", self, other) - * - */ - -#if PY_MAJOR_VERSION < 3 -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_6__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__div__", 0); - - /* "rabbyt/rabbyt._anims.pyx":135 - * - * def __div__(self, other): - * return ArithmeticAnim("div", self, other) # <<<<<<<<<<<<<< - * - * def __neg__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__div)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__div)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__div)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.IncompleteAnimBase.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -#endif /*!(#if PY_MAJOR_VERSION < 3)*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_9__neg__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_9__neg__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_8__neg__(((struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":137 - * return ArithmeticAnim("div", self, other) - * - * def __neg__(self): # <<<<<<<<<<<<<< - * return ArithmeticAnim("sub", 0, self) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_8__neg__(struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__neg__", 0); - - /* "rabbyt/rabbyt._anims.pyx":138 - * - * def __neg__(self): - * return ArithmeticAnim("sub", 0, self) # <<<<<<<<<<<<<< - * - * def __pos__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sub)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__sub)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sub)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.IncompleteAnimBase.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_11__pos__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_11__pos__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_10__pos__(((struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":140 - * return ArithmeticAnim("sub", 0, self) - * - * def __pos__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_18IncompleteAnimBase_10__pos__(struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pos__", 0); - - /* "rabbyt/rabbyt._anims.pyx":141 - * - * def __pos__(self): - * return self # <<<<<<<<<<<<<< - * - * cdef class Anim: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_4Anim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_4Anim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim___init__(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":153 - * """ - * - * def __init__(self): # <<<<<<<<<<<<<< - * self._anim.on_end = _on_end_clear - * self._anim.on_end_data = NULL - */ - -static int __pyx_pf_6rabbyt_6_anims_4Anim___init__(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":154 - * - * def __init__(self): - * self._anim.on_end = _on_end_clear # <<<<<<<<<<<<<< - * self._anim.on_end_data = NULL - * self.dependencies = [] - */ - __pyx_v_self->_anim.on_end = __pyx_f_6rabbyt_6_anims__on_end_clear; - - /* "rabbyt/rabbyt._anims.pyx":155 - * def __init__(self): - * self._anim.on_end = _on_end_clear - * self._anim.on_end_data = NULL # <<<<<<<<<<<<<< - * self.dependencies = [] - * - */ - __pyx_v_self->_anim.on_end_data = NULL; - - /* "rabbyt/rabbyt._anims.pyx":156 - * self._anim.on_end = _on_end_clear - * self._anim.on_end_data = NULL - * self.dependencies = [] # <<<<<<<<<<<<<< - * - * def __add__(self, other): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->dependencies); - __Pyx_DECREF(__pyx_v_self->dependencies); - __pyx_v_self->dependencies = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.Anim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_3__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_3__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__add__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_2__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":158 - * self.dependencies = [] - * - * def __add__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("add", self, other) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_2__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__add__", 0); - - /* "rabbyt/rabbyt._anims.pyx":159 - * - * def __add__(self, other): - * return ArithmeticAnim("add", self, other) # <<<<<<<<<<<<<< - * - * def __sub__(self, other): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__add)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__add)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__add)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.Anim.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_5__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_5__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_4__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":161 - * return ArithmeticAnim("add", self, other) - * - * def __sub__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("sub", self, other) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_4__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__sub__", 0); - - /* "rabbyt/rabbyt._anims.pyx":162 - * - * def __sub__(self, other): - * return ArithmeticAnim("sub", self, other) # <<<<<<<<<<<<<< - * - * def __mul__(self, other): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sub)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__sub)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sub)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.Anim.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_7__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_7__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_6__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":164 - * return ArithmeticAnim("sub", self, other) - * - * def __mul__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("mul", self, other) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_6__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__mul__", 0); - - /* "rabbyt/rabbyt._anims.pyx":165 - * - * def __mul__(self, other): - * return ArithmeticAnim("mul", self, other) # <<<<<<<<<<<<<< - * - * def __div__(self, other): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__mul)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__mul)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__mul)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.Anim.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -#if PY_MAJOR_VERSION < 3 -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_9__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_9__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__div__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_8__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -#endif /*!(#if PY_MAJOR_VERSION < 3)*/ - -/* "rabbyt/rabbyt._anims.pyx":167 - * return ArithmeticAnim("mul", self, other) - * - * def __div__(self, other): # <<<<<<<<<<<<<< - * return ArithmeticAnim("div", self, other) - * - */ - -#if PY_MAJOR_VERSION < 3 -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_8__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__div__", 0); - - /* "rabbyt/rabbyt._anims.pyx":168 - * - * def __div__(self, other): - * return ArithmeticAnim("div", self, other) # <<<<<<<<<<<<<< - * - * def __neg__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__div)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__div)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__div)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_other); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_other); - __Pyx_GIVEREF(__pyx_v_other); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.Anim.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -#endif /*!(#if PY_MAJOR_VERSION < 3)*/ - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_11__neg__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_11__neg__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_10__neg__(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":170 - * return ArithmeticAnim("div", self, other) - * - * def __neg__(self): # <<<<<<<<<<<<<< - * return ArithmeticAnim("sub", 0, self) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_10__neg__(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__neg__", 0); - - /* "rabbyt/rabbyt._anims.pyx":171 - * - * def __neg__(self): - * return ArithmeticAnim("sub", 0, self) # <<<<<<<<<<<<<< - * - * def __pos__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__sub)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__sub)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sub)); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_ArithmeticAnim)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.Anim.__neg__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_13__pos__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_13__pos__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_12__pos__(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":173 - * return ArithmeticAnim("sub", 0, self) - * - * def __pos__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_12__pos__(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__pos__", 0); - - /* "rabbyt/rabbyt._anims.pyx":174 - * - * def __pos__(self): - * return self # <<<<<<<<<<<<<< - * - * def get_value(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_15get_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_15get_value(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_value (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_14get_value(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":176 - * return self - * - * def get_value(self): # <<<<<<<<<<<<<< - * slot = AnimSlot() # TODO cache this! - * slot.anim = self - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_14get_value(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_slot = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_value", 0); - - /* "rabbyt/rabbyt._anims.pyx":177 - * - * def get_value(self): - * slot = AnimSlot() # TODO cache this! # <<<<<<<<<<<<<< - * slot.anim = self - * return slot.value - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimSlot)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":178 - * def get_value(self): - * slot = AnimSlot() # TODO cache this! - * slot.anim = self # <<<<<<<<<<<<<< - * return slot.value - * - */ - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_slot), __pyx_n_s__anim, ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":179 - * slot = AnimSlot() # TODO cache this! - * slot.anim = self - * return slot.value # <<<<<<<<<<<<<< - * - * def get(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_slot), __pyx_n_s__value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.Anim.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_slot); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_4Anim_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_4Anim_16get(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":181 - * return slot.value - * - * def get(self): # <<<<<<<<<<<<<< - * return self.get_value() - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_4Anim_16get(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get", 0); - - /* "rabbyt/rabbyt._anims.pyx":182 - * - * def get(self): - * return self.get_value() # <<<<<<<<<<<<<< - * - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.Anim.get", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":184 - * return self.get_value() - * - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1: # <<<<<<<<<<<<<< - * cdef AnimSlot slot - * if isinstance(source, IncompleteAnimBase): - */ - -static int __pyx_f_6rabbyt_6_anims_4Anim_add_dependency(struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_self, PyObject *__pyx_v_source, AnimSlot_s *__pyx_v_target) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_slot = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - double __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("add_dependency", 0); - __Pyx_INCREF(__pyx_v_source); - - /* "rabbyt/rabbyt._anims.pyx":186 - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1: - * cdef AnimSlot slot - * if isinstance(source, IncompleteAnimBase): # <<<<<<<<<<<<<< - * source = source.force_complete() - * if isinstance(source, Anim): - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_source, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_IncompleteAnimBase)); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":187 - * cdef AnimSlot slot - * if isinstance(source, IncompleteAnimBase): - * source = source.force_complete() # <<<<<<<<<<<<<< - * if isinstance(source, Anim): - * slot = AnimSlot() - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s__force_complete); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":188 - * if isinstance(source, IncompleteAnimBase): - * source = source.force_complete() - * if isinstance(source, Anim): # <<<<<<<<<<<<<< - * slot = AnimSlot() - * slot._slot = target - */ - __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_source, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)); - __pyx_t_1 = (__pyx_t_2 != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":189 - * source = source.force_complete() - * if isinstance(source, Anim): - * slot = AnimSlot() # <<<<<<<<<<<<<< - * slot._slot = target - * slot._slot.type = SLOT_LOCAL - */ - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimSlot)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._anims.pyx":190 - * if isinstance(source, Anim): - * slot = AnimSlot() - * slot._slot = target # <<<<<<<<<<<<<< - * slot._slot.type = SLOT_LOCAL - * slot.anim = source - */ - __pyx_v_slot->_slot = __pyx_v_target; - - /* "rabbyt/rabbyt._anims.pyx":191 - * slot = AnimSlot() - * slot._slot = target - * slot._slot.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * slot.anim = source - * self.dependencies.append(source) - */ - __pyx_v_slot->_slot->type = SLOT_LOCAL; - - /* "rabbyt/rabbyt._anims.pyx":192 - * slot._slot = target - * slot._slot.type = SLOT_LOCAL - * slot.anim = source # <<<<<<<<<<<<<< - * self.dependencies.append(source) - * else: - */ - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_slot), __pyx_n_s__anim, __pyx_v_source) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":193 - * slot._slot.type = SLOT_LOCAL - * slot.anim = source - * self.dependencies.append(source) # <<<<<<<<<<<<<< - * else: - * target.type = SLOT_LOCAL - */ - __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_self->dependencies, __pyx_v_source); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L4; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":195 - * self.dependencies.append(source) - * else: - * target.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * target.local = float(source) - * - */ - __pyx_v_target->type = SLOT_LOCAL; - - /* "rabbyt/rabbyt._anims.pyx":196 - * else: - * target.type = SLOT_LOCAL - * target.local = float(source) # <<<<<<<<<<<<<< - * - * cdef class AnimSlot: - */ - __pyx_t_5 = __Pyx_PyObject_AsDouble(__pyx_v_source); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_target->local = __pyx_t_5; - } - __pyx_L4:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rabbyt._anims.Anim.add_dependency", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_slot); - __Pyx_XDECREF(__pyx_v_source); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_8AnimSlot_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_8AnimSlot_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - __pyx_r = __pyx_pf_6rabbyt_6_anims_8AnimSlot___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":203 - * #cdef Anim _py_anim - * - * def __init__(self): # <<<<<<<<<<<<<< - * self._slot = &self._internal_slot - * self._slot.type = SLOT_LOCAL - */ - -static int __pyx_pf_6rabbyt_6_anims_8AnimSlot___init__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":204 - * - * def __init__(self): - * self._slot = &self._internal_slot # <<<<<<<<<<<<<< - * self._slot.type = SLOT_LOCAL - * - */ - __pyx_v_self->_slot = (&__pyx_v_self->_internal_slot); - - /* "rabbyt/rabbyt._anims.pyx":205 - * def __init__(self): - * self._slot = &self._internal_slot - * self._slot.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * - * cdef int c_set_anim(self, Anim anim) except -1: - */ - __pyx_v_self->_slot->type = SLOT_LOCAL; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":207 - * self._slot.type = SLOT_LOCAL - * - * cdef int c_set_anim(self, Anim anim) except -1: # <<<<<<<<<<<<<< - * self._py_anim = anim - * if anim is None: - */ - -static int __pyx_f_6rabbyt_6_anims_8AnimSlot_c_set_anim(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_anim) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("c_set_anim", 0); - - /* "rabbyt/rabbyt._anims.pyx":208 - * - * cdef int c_set_anim(self, Anim anim) except -1: - * self._py_anim = anim # <<<<<<<<<<<<<< - * if anim is None: - * self._slot.anim = NULL - */ - __Pyx_INCREF(((PyObject *)__pyx_v_anim)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_anim)); - __Pyx_GOTREF(__pyx_v_self->_py_anim); - __Pyx_DECREF(((PyObject *)__pyx_v_self->_py_anim)); - __pyx_v_self->_py_anim = __pyx_v_anim; - - /* "rabbyt/rabbyt._anims.pyx":209 - * cdef int c_set_anim(self, Anim anim) except -1: - * self._py_anim = anim - * if anim is None: # <<<<<<<<<<<<<< - * self._slot.anim = NULL - * self._slot.type = SLOT_LOCAL - */ - __pyx_t_1 = (((PyObject *)__pyx_v_anim) == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":210 - * self._py_anim = anim - * if anim is None: - * self._slot.anim = NULL # <<<<<<<<<<<<<< - * self._slot.type = SLOT_LOCAL - * else: - */ - __pyx_v_self->_slot->anim = NULL; - - /* "rabbyt/rabbyt._anims.pyx":211 - * if anim is None: - * self._slot.anim = NULL - * self._slot.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * else: - * self._slot.anim = &self._py_anim._anim - */ - __pyx_v_self->_slot->type = SLOT_LOCAL; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":213 - * self._slot.type = SLOT_LOCAL - * else: - * self._slot.anim = &self._py_anim._anim # <<<<<<<<<<<<<< - * self._slot.type = SLOT_ANIM - * self._slot.recursion_check = 0 - */ - __pyx_v_self->_slot->anim = (&__pyx_v_self->_py_anim->_anim); - - /* "rabbyt/rabbyt._anims.pyx":214 - * else: - * self._slot.anim = &self._py_anim._anim - * self._slot.type = SLOT_ANIM # <<<<<<<<<<<<<< - * self._slot.recursion_check = 0 - * - */ - __pyx_v_self->_slot->type = SLOT_ANIM; - - /* "rabbyt/rabbyt._anims.pyx":215 - * self._slot.anim = &self._py_anim._anim - * self._slot.type = SLOT_ANIM - * self._slot.recursion_check = 0 # <<<<<<<<<<<<<< - * - * cdef Anim c_get_anim(self): - */ - __pyx_v_self->_slot->recursion_check = 0; - } - __pyx_L3:; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":217 - * self._slot.recursion_check = 0 - * - * cdef Anim c_get_anim(self): # <<<<<<<<<<<<<< - * if self._slot.type != SLOT_ANIM: - * self._py_anim = None - */ - -static struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_f_6rabbyt_6_anims_8AnimSlot_c_get_anim(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self) { - struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("c_get_anim", 0); - - /* "rabbyt/rabbyt._anims.pyx":218 - * - * cdef Anim c_get_anim(self): - * if self._slot.type != SLOT_ANIM: # <<<<<<<<<<<<<< - * self._py_anim = None - * return self._py_anim - */ - __pyx_t_1 = ((__pyx_v_self->_slot->type != SLOT_ANIM) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":219 - * cdef Anim c_get_anim(self): - * if self._slot.type != SLOT_ANIM: - * self._py_anim = None # <<<<<<<<<<<<<< - * return self._py_anim - * - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->_py_anim); - __Pyx_DECREF(((PyObject *)__pyx_v_self->_py_anim)); - __pyx_v_self->_py_anim = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)Py_None); - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":220 - * if self._slot.type != SLOT_ANIM: - * self._py_anim = None - * return self._py_anim # <<<<<<<<<<<<<< - * - * property anim: - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_self->_py_anim)); - __pyx_r = __pyx_v_self->_py_anim; - goto __pyx_L0; - - __pyx_r = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)Py_None); __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_8AnimSlot_4anim_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_8AnimSlot_4anim_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_8AnimSlot_4anim___get__(((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":223 - * - * property anim: - * def __get__(self): # <<<<<<<<<<<<<< - * return self.c_get_anim() - * def __set__(self, anim): - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_8AnimSlot_4anim___get__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":224 - * property anim: - * def __get__(self): - * return self.c_get_anim() # <<<<<<<<<<<<<< - * def __set__(self, anim): - * if isinstance(anim, IncompleteAnimBase): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *)__pyx_v_self->__pyx_vtab)->c_get_anim(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.AnimSlot.anim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_8AnimSlot_4anim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_anim); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_8AnimSlot_4anim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_anim) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_8AnimSlot_4anim_2__set__(((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_v_self), ((PyObject *)__pyx_v_anim)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":225 - * def __get__(self): - * return self.c_get_anim() - * def __set__(self, anim): # <<<<<<<<<<<<<< - * if isinstance(anim, IncompleteAnimBase): - * anim = anim.force_complete() - */ - -static int __pyx_pf_6rabbyt_6_anims_8AnimSlot_4anim_2__set__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self, PyObject *__pyx_v_anim) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_anim); - - /* "rabbyt/rabbyt._anims.pyx":226 - * return self.c_get_anim() - * def __set__(self, anim): - * if isinstance(anim, IncompleteAnimBase): # <<<<<<<<<<<<<< - * anim = anim.force_complete() - * self.c_set_anim(anim) - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_anim, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_IncompleteAnimBase)); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":227 - * def __set__(self, anim): - * if isinstance(anim, IncompleteAnimBase): - * anim = anim.force_complete() # <<<<<<<<<<<<<< - * self.c_set_anim(anim) - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_anim, __pyx_n_s__force_complete); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_anim, __pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":228 - * if isinstance(anim, IncompleteAnimBase): - * anim = anim.force_complete() - * self.c_set_anim(anim) # <<<<<<<<<<<<<< - * - * cdef float c_get_value(self): - */ - if (!(likely(((__pyx_v_anim) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_anim, __pyx_ptype_6rabbyt_6_anims_Anim))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *)__pyx_v_self->__pyx_vtab)->c_set_anim(__pyx_v_self, ((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_anim)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rabbyt._anims.AnimSlot.anim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_anim); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":230 - * self.c_set_anim(anim) - * - * cdef float c_get_value(self): # <<<<<<<<<<<<<< - * cdef float v - * READ_SLOT(self._slot, &v) - */ - -static float __pyx_f_6rabbyt_6_anims_8AnimSlot_c_get_value(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self) { - float __pyx_v_v; - float __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("c_get_value", 0); - - /* "rabbyt/rabbyt._anims.pyx":232 - * cdef float c_get_value(self): - * cdef float v - * READ_SLOT(self._slot, &v) # <<<<<<<<<<<<<< - * return v - * - */ - READ_SLOT(__pyx_v_self->_slot, (&__pyx_v_v)); - - /* "rabbyt/rabbyt._anims.pyx":233 - * cdef float v - * READ_SLOT(self._slot, &v) - * return v # <<<<<<<<<<<<<< - * - * cdef int c_set_value(self, float value) except -1: - */ - __pyx_r = __pyx_v_v; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":235 - * return v - * - * cdef int c_set_value(self, float value) except -1: # <<<<<<<<<<<<<< - * if self._slot.type == SLOT_ANIM: - * self._slot.type = SLOT_LOCAL - */ - -static int __pyx_f_6rabbyt_6_anims_8AnimSlot_c_set_value(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self, float __pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("c_set_value", 0); - - /* "rabbyt/rabbyt._anims.pyx":236 - * - * cdef int c_set_value(self, float value) except -1: - * if self._slot.type == SLOT_ANIM: # <<<<<<<<<<<<<< - * self._slot.type = SLOT_LOCAL - * if self._slot.type == SLOT_LOCAL: - */ - __pyx_t_1 = ((__pyx_v_self->_slot->type == SLOT_ANIM) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":237 - * cdef int c_set_value(self, float value) except -1: - * if self._slot.type == SLOT_ANIM: - * self._slot.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * if self._slot.type == SLOT_LOCAL: - * self._slot.local = value - */ - __pyx_v_self->_slot->type = SLOT_LOCAL; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":238 - * if self._slot.type == SLOT_ANIM: - * self._slot.type = SLOT_LOCAL - * if self._slot.type == SLOT_LOCAL: # <<<<<<<<<<<<<< - * self._slot.local = value - * else: - */ - __pyx_t_1 = ((__pyx_v_self->_slot->type == SLOT_LOCAL) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":239 - * self._slot.type = SLOT_LOCAL - * if self._slot.type == SLOT_LOCAL: - * self._slot.local = value # <<<<<<<<<<<<<< - * else: - * raise NotImplementedError - */ - __pyx_v_self->_slot->local = __pyx_v_value; - goto __pyx_L4; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":241 - * self._slot.local = value - * else: - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * property value: - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L4:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimSlot.c_set_value", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_8AnimSlot_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_8AnimSlot_5value_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_8AnimSlot_5value___get__(((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":244 - * - * property value: - * def __get__(self): # <<<<<<<<<<<<<< - * return self.c_get_value() - * def __set__(self, float value): - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_8AnimSlot_5value___get__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":245 - * property value: - * def __get__(self): - * return self.c_get_value() # <<<<<<<<<<<<<< - * def __set__(self, float value): - * self.c_set_value(value) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *)__pyx_v_self->__pyx_vtab)->c_get_value(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.AnimSlot.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_8AnimSlot_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_8AnimSlot_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { - float __pyx_v_value; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_value); { - __pyx_v_value = __pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimSlot.value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_8AnimSlot_5value_2__set__(((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_v_self), ((float)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":246 - * def __get__(self): - * return self.c_get_value() - * def __set__(self, float value): # <<<<<<<<<<<<<< - * self.c_set_value(value) - * - */ - -static int __pyx_pf_6rabbyt_6_anims_8AnimSlot_5value_2__set__(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_self, float __pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._anims.pyx":247 - * return self.c_get_value() - * def __set__(self, float value): - * self.c_set_value(value) # <<<<<<<<<<<<<< - * - * cdef class anim_slot - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *)__pyx_v_self->__pyx_vtab)->c_set_value(__pyx_v_self, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimSlot.value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9cAnimable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9cAnimable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - CYTHON_UNUSED PyObject *__pyx_v_args = 0; - CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; - __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); - if (unlikely(!__pyx_v_kwargs)) return -1; - __Pyx_GOTREF(__pyx_v_kwargs); - __Pyx_INCREF(__pyx_args); - __pyx_v_args = __pyx_args; - __pyx_r = __pyx_pf_6rabbyt_6_anims_9cAnimable___init__(((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); - __Pyx_XDECREF(__pyx_v_args); - __Pyx_XDECREF(__pyx_v_kwargs); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":257 - * #cdef AnimSlot_s ** c_anim_slots - * #cdef AnimSlot_s ** c_live_slots - * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< - * cdef AnimSlot slot - * cdef anim_slot desc - */ - -static int __pyx_pf_6rabbyt_6_anims_9cAnimable___init__(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_slot = 0; - long __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - long __pyx_t_6; - AnimSlot_s *__pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":260 - * cdef AnimSlot slot - * cdef anim_slot desc - * self._anim_list = [] # <<<<<<<<<<<<<< - * self.c_slot_count = 0 - * if hasattr(self, "_anim_slot_descriptors"): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->_anim_list); - __Pyx_DECREF(__pyx_v_self->_anim_list); - __pyx_v_self->_anim_list = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":261 - * cdef anim_slot desc - * self._anim_list = [] - * self.c_slot_count = 0 # <<<<<<<<<<<<<< - * if hasattr(self, "_anim_slot_descriptors"): - * self.c_slot_count = len(self._anim_slot_descriptors) - */ - __pyx_v_self->c_slot_count = 0; - - /* "rabbyt/rabbyt._anims.pyx":262 - * self._anim_list = [] - * self.c_slot_count = 0 - * if hasattr(self, "_anim_slot_descriptors"): # <<<<<<<<<<<<<< - * self.c_slot_count = len(self._anim_slot_descriptors) - * self.c_anim_slots = malloc( - */ - __pyx_t_2 = PyObject_HasAttr(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_n_s_1)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (__pyx_t_2 != 0); - if (__pyx_t_3) { - - /* "rabbyt/rabbyt._anims.pyx":263 - * self.c_slot_count = 0 - * if hasattr(self, "_anim_slot_descriptors"): - * self.c_slot_count = len(self._anim_slot_descriptors) # <<<<<<<<<<<<<< - * self.c_anim_slots = malloc( - * sizeof(void*)*self.c_slot_count) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_self->c_slot_count = __pyx_t_4; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":264 - * if hasattr(self, "_anim_slot_descriptors"): - * self.c_slot_count = len(self._anim_slot_descriptors) - * self.c_anim_slots = malloc( # <<<<<<<<<<<<<< - * sizeof(void*)*self.c_slot_count) - * - */ - __pyx_v_self->c_anim_slots = ((AnimSlot_s **)malloc(((sizeof(void *)) * __pyx_v_self->c_slot_count))); - - /* "rabbyt/rabbyt._anims.pyx":267 - * sizeof(void*)*self.c_slot_count) - * - * for i in range(self.c_slot_count): # <<<<<<<<<<<<<< - * slot = AnimSlot() - * self._anim_list.append(slot) - */ - __pyx_t_5 = __pyx_v_self->c_slot_count; - for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { - __pyx_v_i = __pyx_t_6; - - /* "rabbyt/rabbyt._anims.pyx":268 - * - * for i in range(self.c_slot_count): - * slot = AnimSlot() # <<<<<<<<<<<<<< - * self._anim_list.append(slot) - * self._modify_slots() - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimSlot)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":269 - * for i in range(self.c_slot_count): - * slot = AnimSlot() - * self._anim_list.append(slot) # <<<<<<<<<<<<<< - * self._modify_slots() - * - */ - __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_self->_anim_list, ((PyObject *)__pyx_v_slot)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - - /* "rabbyt/rabbyt._anims.pyx":270 - * slot = AnimSlot() - * self._anim_list.append(slot) - * self._modify_slots() # <<<<<<<<<<<<<< - * - * for i from 0 <= i < self.c_slot_count: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable *)__pyx_v_self->__pyx_vtab)->_modify_slots(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":272 - * self._modify_slots() - * - * for i from 0 <= i < self.c_slot_count: # <<<<<<<<<<<<<< - * slot = self._anim_list[i] - * self.c_anim_slots[i] = slot._slot - */ - __pyx_t_5 = __pyx_v_self->c_slot_count; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - - /* "rabbyt/rabbyt._anims.pyx":273 - * - * for i from 0 <= i < self.c_slot_count: - * slot = self._anim_list[i] # <<<<<<<<<<<<<< - * self.c_anim_slots[i] = slot._slot - * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->_anim_list, __pyx_v_i, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":274 - * for i from 0 <= i < self.c_slot_count: - * slot = self._anim_list[i] - * self.c_anim_slots[i] = slot._slot # <<<<<<<<<<<<<< - * - * self.set_anim_slot_locations() - */ - __pyx_t_7 = __pyx_v_slot->_slot; - (__pyx_v_self->c_anim_slots[__pyx_v_i]) = __pyx_t_7; - } - - /* "rabbyt/rabbyt._anims.pyx":276 - * self.c_anim_slots[i] = slot._slot - * - * self.set_anim_slot_locations() # <<<<<<<<<<<<<< - * - * cdef _modify_slots(self): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rabbyt._anims.cAnimable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_slot); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":278 - * self.set_anim_slot_locations() - * - * cdef _modify_slots(self): # <<<<<<<<<<<<<< - * """ - * Called after self._anim_list is populated, be before c_anim_slots. - */ - -static PyObject *__pyx_f_6rabbyt_6_anims_9cAnimable__modify_slots(CYTHON_UNUSED struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_modify_slots", 0); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static void __pyx_pw_6rabbyt_6_anims_9cAnimable_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_6rabbyt_6_anims_9cAnimable_3__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_6rabbyt_6_anims_9cAnimable_2__dealloc__(((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); -} - -/* "rabbyt/rabbyt._anims.pyx":284 - * pass - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self.c_anim_slots != NULL: - * free(self.c_anim_slots) - */ - -static void __pyx_pf_6rabbyt_6_anims_9cAnimable_2__dealloc__(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__", 0); - - /* "rabbyt/rabbyt._anims.pyx":285 - * - * def __dealloc__(self): - * if self.c_anim_slots != NULL: # <<<<<<<<<<<<<< - * free(self.c_anim_slots) - * self.c_anim_slots = NULL - */ - __pyx_t_1 = ((__pyx_v_self->c_anim_slots != NULL) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":286 - * def __dealloc__(self): - * if self.c_anim_slots != NULL: - * free(self.c_anim_slots) # <<<<<<<<<<<<<< - * self.c_anim_slots = NULL - * - */ - free(__pyx_v_self->c_anim_slots); - - /* "rabbyt/rabbyt._anims.pyx":287 - * if self.c_anim_slots != NULL: - * free(self.c_anim_slots) - * self.c_anim_slots = NULL # <<<<<<<<<<<<<< - * - * property anim_slot_list: - */ - __pyx_v_self->c_anim_slots = NULL; - goto __pyx_L3; - } - __pyx_L3:; - - __Pyx_RefNannyFinishContext(); -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9cAnimable_14anim_slot_list_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9cAnimable_14anim_slot_list_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9cAnimable_14anim_slot_list___get__(((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":290 - * - * property anim_slot_list: - * def __get__(self): # <<<<<<<<<<<<<< - * return list(self._anim_list) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9cAnimable_14anim_slot_list___get__(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":291 - * property anim_slot_list: - * def __get__(self): - * return list(self._anim_list) # <<<<<<<<<<<<<< - * - * def set_anim_slot_locations(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_self->_anim_list); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_anim_list); - __Pyx_GIVEREF(__pyx_v_self->_anim_list); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.cAnimable.anim_slot_list.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9cAnimable_5set_anim_slot_locations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9cAnimable_5set_anim_slot_locations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_anim_slot_locations (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9cAnimable_4set_anim_slot_locations(((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":293 - * return list(self._anim_list) - * - * def set_anim_slot_locations(self): # <<<<<<<<<<<<<< - * cdef AnimSlot slot - * for slot in self._anim_list: - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9cAnimable_4set_anim_slot_locations(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_slot = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_anim_slot_locations", 0); - - /* "rabbyt/rabbyt._anims.pyx":295 - * def set_anim_slot_locations(self): - * cdef AnimSlot slot - * for slot in self._anim_list: # <<<<<<<<<<<<<< - * if slot._slot.type >= 0: - * slot._slot.type = SLOT_LOCAL - */ - if (PyList_CheckExact(__pyx_v_self->_anim_list) || PyTuple_CheckExact(__pyx_v_self->_anim_list)) { - __pyx_t_1 = __pyx_v_self->_anim_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->_anim_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; - } - for (;;) { - if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_4)); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._anims.pyx":296 - * cdef AnimSlot slot - * for slot in self._anim_list: - * if slot._slot.type >= 0: # <<<<<<<<<<<<<< - * slot._slot.type = SLOT_LOCAL - * - */ - __pyx_t_5 = ((__pyx_v_slot->_slot->type >= 0) != 0); - if (__pyx_t_5) { - - /* "rabbyt/rabbyt._anims.pyx":297 - * for slot in self._anim_list: - * if slot._slot.type >= 0: - * slot._slot.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * - * def set_anim_slot_locations_in_array(self, attr_names): - */ - __pyx_v_slot->_slot->type = SLOT_LOCAL; - goto __pyx_L5; - } - __pyx_L5:; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rabbyt._anims.cAnimable.set_anim_slot_locations", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_slot); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9cAnimable_7set_anim_slot_locations_in_array(PyObject *__pyx_v_self, PyObject *__pyx_v_attr_names); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9cAnimable_7set_anim_slot_locations_in_array(PyObject *__pyx_v_self, PyObject *__pyx_v_attr_names) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_anim_slot_locations_in_array (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9cAnimable_6set_anim_slot_locations_in_array(((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_self), ((PyObject *)__pyx_v_attr_names)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":299 - * slot._slot.type = SLOT_LOCAL - * - * def set_anim_slot_locations_in_array(self, attr_names): # <<<<<<<<<<<<<< - * cdef AnimSlot slot - * cdef unsigned long temp - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9cAnimable_6set_anim_slot_locations_in_array(struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_self, PyObject *__pyx_v_attr_names) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_slot = 0; - unsigned long __pyx_v_temp; - PyObject *__pyx_v_name = NULL; - PyObject *__pyx_v_array = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - unsigned long __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_anim_slot_locations_in_array", 0); - - /* "rabbyt/rabbyt._anims.pyx":302 - * cdef AnimSlot slot - * cdef unsigned long temp - * for name in attr_names: # <<<<<<<<<<<<<< - * if name in self.__class__.__base__._anim_slot_descriptor_names: - * slot = getattr(self.__class__.__base__, name).get_slot(self) - */ - if (PyList_CheckExact(__pyx_v_attr_names) || PyTuple_CheckExact(__pyx_v_attr_names)) { - __pyx_t_1 = __pyx_v_attr_names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_attr_names); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; - } - for (;;) { - if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._anims.pyx":303 - * cdef unsigned long temp - * for name in attr_names: - * if name in self.__class__.__base__._anim_slot_descriptor_names: # <<<<<<<<<<<<<< - * slot = getattr(self.__class__.__base__, name).get_slot(self) - * array = getattr(self.in_array, name) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s____base__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = (__Pyx_PySequence_Contains(__pyx_v_name, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = (__pyx_t_6 != 0); - if (__pyx_t_7) { - - /* "rabbyt/rabbyt._anims.pyx":304 - * for name in attr_names: - * if name in self.__class__.__base__._anim_slot_descriptor_names: - * slot = getattr(self.__class__.__base__, name).get_slot(self) # <<<<<<<<<<<<<< - * array = getattr(self.in_array, name) - * # TODO make sure array type is float. - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s____base__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetAttr(__pyx_t_5, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get_slot); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_8)); - __pyx_t_8 = 0; - - /* "rabbyt/rabbyt._anims.pyx":305 - * if name in self.__class__.__base__._anim_slot_descriptor_names: - * slot = getattr(self.__class__.__base__, name).get_slot(self) - * array = getattr(self.in_array, name) # <<<<<<<<<<<<<< - * # TODO make sure array type is float. - * slot._slot.type = 0 - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__in_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetAttr(__pyx_t_8, __pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF_SET(__pyx_v_array, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._anims.pyx":307 - * array = getattr(self.in_array, name) - * # TODO make sure array type is float. - * slot._slot.type = 0 # <<<<<<<<<<<<<< - * slot._slot.offset = (self.in_array.index(self) * - * array.get_data_stride()) - */ - __pyx_v_slot->_slot->type = 0; - - /* "rabbyt/rabbyt._anims.pyx":308 - * # TODO make sure array type is float. - * slot._slot.type = 0 - * slot._slot.offset = (self.in_array.index(self) * # <<<<<<<<<<<<<< - * array.get_data_stride()) - * temp = array.get_data_ptr_addr() - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__in_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__index); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_5 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._anims.pyx":309 - * slot._slot.type = 0 - * slot._slot.offset = (self.in_array.index(self) * - * array.get_data_stride()) # <<<<<<<<<<<<<< - * temp = array.get_data_ptr_addr() - * slot._slot.base = (temp) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s__get_data_stride); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._anims.pyx":308 - * # TODO make sure array type is float. - * slot._slot.type = 0 - * slot._slot.offset = (self.in_array.index(self) * # <<<<<<<<<<<<<< - * array.get_data_stride()) - * temp = array.get_data_ptr_addr() - */ - __pyx_v_slot->_slot->offset = __pyx_t_9; - - /* "rabbyt/rabbyt._anims.pyx":310 - * slot._slot.offset = (self.in_array.index(self) * - * array.get_data_stride()) - * temp = array.get_data_ptr_addr() # <<<<<<<<<<<<<< - * slot._slot.base = (temp) - * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_array, __pyx_n_s__get_data_ptr_addr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_10 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_8); if (unlikely((__pyx_t_10 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_temp = __pyx_t_10; - - /* "rabbyt/rabbyt._anims.pyx":311 - * array.get_data_stride()) - * temp = array.get_data_ptr_addr() - * slot._slot.base = (temp) # <<<<<<<<<<<<<< - * - * cdef class anim_slot: - */ - __pyx_v_slot->_slot->base = ((void **)__pyx_v_temp); - goto __pyx_L5; - } - __pyx_L5:; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rabbyt._anims.cAnimable.set_anim_slot_locations_in_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_slot); - __Pyx_XDECREF(__pyx_v_name); - __Pyx_XDECREF(__pyx_v_array); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_default = 0; - PyObject *__pyx_v_doc = 0; - PyObject *__pyx_v_index = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__default,&__pyx_n_s__doc,&__pyx_n_s__index,0}; - PyObject* values[3] = {0,0,0}; - values[0] = ((PyObject *)__pyx_int_0); - values[1] = ((PyObject *)__pyx_kp_s_4); - values[2] = ((PyObject *)__pyx_int_neg_1); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__default); - if (value) { values[0] = value; kw_args--; } - } - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__doc); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__index); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_default = values[0]; - __pyx_v_doc = values[1]; - __pyx_v_index = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.anim_slot.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot___init__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self), __pyx_v_default, __pyx_v_doc, __pyx_v_index); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":330 - * cdef public float default_value - * cdef public object __doc__ - * def __init__(self, default=0, doc="", index=-1): # <<<<<<<<<<<<<< - * self.default_value = default - * self.index = index - */ - -static int __pyx_pf_6rabbyt_6_anims_9anim_slot___init__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_default, PyObject *__pyx_v_doc, PyObject *__pyx_v_index) { - int __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":331 - * cdef public object __doc__ - * def __init__(self, default=0, doc="", index=-1): - * self.default_value = default # <<<<<<<<<<<<<< - * self.index = index - * self.__doc__ = doc - */ - __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_default); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->default_value = __pyx_t_1; - - /* "rabbyt/rabbyt._anims.pyx":332 - * def __init__(self, default=0, doc="", index=-1): - * self.default_value = default - * self.index = index # <<<<<<<<<<<<<< - * self.__doc__ = doc - * - */ - __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->index = __pyx_t_2; - - /* "rabbyt/rabbyt._anims.pyx":333 - * self.default_value = default - * self.index = index - * self.__doc__ = doc # <<<<<<<<<<<<<< - * - * def __get__(self, cAnimable obj, type_): - */ - __Pyx_INCREF(__pyx_v_doc); - __Pyx_GIVEREF(__pyx_v_doc); - __Pyx_GOTREF(__pyx_v_self->__doc__); - __Pyx_DECREF(__pyx_v_self->__doc__); - __pyx_v_self->__doc__ = __pyx_v_doc; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._anims.anim_slot.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type_); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type_) { - CYTHON_UNUSED int __pyx_lineno = 0; - CYTHON_UNUSED const char *__pyx_filename = NULL; - CYTHON_UNUSED int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_6rabbyt_6_anims_cAnimable, 1, "obj", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_2__get__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self), ((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_obj), ((PyObject *)__pyx_v_type_)); - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":335 - * self.__doc__ = doc - * - * def __get__(self, cAnimable obj, type_): # <<<<<<<<<<<<<< - * if obj is None: - * return self - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_2__get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_obj, CYTHON_UNUSED PyObject *__pyx_v_type_) { - float __pyx_v_v; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":336 - * - * def __get__(self, cAnimable obj, type_): - * if obj is None: # <<<<<<<<<<<<<< - * return self - * if self.index == -1: - */ - __pyx_t_1 = (((PyObject *)__pyx_v_obj) == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":337 - * def __get__(self, cAnimable obj, type_): - * if obj is None: - * return self # <<<<<<<<<<<<<< - * if self.index == -1: - * raise RuntimeError - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":338 - * if obj is None: - * return self - * if self.index == -1: # <<<<<<<<<<<<<< - * raise RuntimeError - * if obj.c_anim_slots == NULL: - */ - __pyx_t_2 = ((__pyx_v_self->index == -1) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":339 - * return self - * if self.index == -1: - * raise RuntimeError # <<<<<<<<<<<<<< - * if obj.c_anim_slots == NULL: - * raise RuntimeError("Animable is not yet initialized. Call " - */ - __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt._anims.pyx":340 - * if self.index == -1: - * raise RuntimeError - * if obj.c_anim_slots == NULL: # <<<<<<<<<<<<<< - * raise RuntimeError("Animable is not yet initialized. Call " - * "Animable.__init__(self) first. (Or Sprite.__init__)") - */ - __pyx_t_2 = ((__pyx_v_obj->c_anim_slots == NULL) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":341 - * raise RuntimeError - * if obj.c_anim_slots == NULL: - * raise RuntimeError("Animable is not yet initialized. Call " # <<<<<<<<<<<<<< - * "Animable.__init__(self) first. (Or Sprite.__init__)") - * cdef float v - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "rabbyt/rabbyt._anims.pyx":344 - * "Animable.__init__(self) first. (Or Sprite.__init__)") - * cdef float v - * READ_SLOT(obj.c_anim_slots[self.index], &v) # <<<<<<<<<<<<<< - * return v - * - */ - READ_SLOT((__pyx_v_obj->c_anim_slots[__pyx_v_self->index]), (&__pyx_v_v)); - - /* "rabbyt/rabbyt._anims.pyx":345 - * cdef float v - * READ_SLOT(obj.c_anim_slots[self.index], &v) - * return v # <<<<<<<<<<<<<< - * - * def __set__(self, cAnimable obj not None, value): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_v); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.anim_slot.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_value) { - CYTHON_UNUSED int __pyx_lineno = 0; - CYTHON_UNUSED const char *__pyx_filename = NULL; - CYTHON_UNUSED int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_6rabbyt_6_anims_cAnimable, 0, "obj", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_4__set__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self), ((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_obj), ((PyObject *)__pyx_v_value)); - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":347 - * return v - * - * def __set__(self, cAnimable obj not None, value): # <<<<<<<<<<<<<< - * if self.index == -1: - * raise RuntimeError - */ - -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_4__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_obj, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - float __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - - /* "rabbyt/rabbyt._anims.pyx":348 - * - * def __set__(self, cAnimable obj not None, value): - * if self.index == -1: # <<<<<<<<<<<<<< - * raise RuntimeError - * if obj.c_anim_slots == NULL: - */ - __pyx_t_1 = ((__pyx_v_self->index == -1) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":349 - * def __set__(self, cAnimable obj not None, value): - * if self.index == -1: - * raise RuntimeError # <<<<<<<<<<<<<< - * if obj.c_anim_slots == NULL: - * raise RuntimeError("Animable is not yet initialized.") - */ - __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":350 - * if self.index == -1: - * raise RuntimeError - * if obj.c_anim_slots == NULL: # <<<<<<<<<<<<<< - * raise RuntimeError("Animable is not yet initialized.") - * if PyNumber_Check(value): - */ - __pyx_t_1 = ((__pyx_v_obj->c_anim_slots == NULL) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":351 - * raise RuntimeError - * if obj.c_anim_slots == NULL: - * raise RuntimeError("Animable is not yet initialized.") # <<<<<<<<<<<<<< - * if PyNumber_Check(value): - * obj.c_anim_slots[self.index].type = SLOT_LOCAL - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt._anims.pyx":352 - * if obj.c_anim_slots == NULL: - * raise RuntimeError("Animable is not yet initialized.") - * if PyNumber_Check(value): # <<<<<<<<<<<<<< - * obj.c_anim_slots[self.index].type = SLOT_LOCAL - * obj.c_anim_slots[self.index].local = value - */ - __pyx_t_1 = (PyNumber_Check(__pyx_v_value) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":353 - * raise RuntimeError("Animable is not yet initialized.") - * if PyNumber_Check(value): - * obj.c_anim_slots[self.index].type = SLOT_LOCAL # <<<<<<<<<<<<<< - * obj.c_anim_slots[self.index].local = value - * elif isinstance(value, Anim): - */ - (__pyx_v_obj->c_anim_slots[__pyx_v_self->index])->type = SLOT_LOCAL; - - /* "rabbyt/rabbyt._anims.pyx":354 - * if PyNumber_Check(value): - * obj.c_anim_slots[self.index].type = SLOT_LOCAL - * obj.c_anim_slots[self.index].local = value # <<<<<<<<<<<<<< - * elif isinstance(value, Anim): - * obj._anim_list[self.index].anim = value - */ - __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (__pyx_v_obj->c_anim_slots[__pyx_v_self->index])->local = __pyx_t_3; - goto __pyx_L5; - } - - /* "rabbyt/rabbyt._anims.pyx":355 - * obj.c_anim_slots[self.index].type = SLOT_LOCAL - * obj.c_anim_slots[self.index].local = value - * elif isinstance(value, Anim): # <<<<<<<<<<<<<< - * obj._anim_list[self.index].anim = value - * elif isinstance(value, IncompleteAnimBase): - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)); - __pyx_t_4 = (__pyx_t_1 != 0); - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._anims.pyx":356 - * obj.c_anim_slots[self.index].local = value - * elif isinstance(value, Anim): - * obj._anim_list[self.index].anim = value # <<<<<<<<<<<<<< - * elif isinstance(value, IncompleteAnimBase): - * value = value.force_complete(start=self.__get__(obj, obj.__class__)) - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj->_anim_list, __pyx_v_self->index, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s__anim, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L5; - } - - /* "rabbyt/rabbyt._anims.pyx":357 - * elif isinstance(value, Anim): - * obj._anim_list[self.index].anim = value - * elif isinstance(value, IncompleteAnimBase): # <<<<<<<<<<<<<< - * value = value.force_complete(start=self.__get__(obj, obj.__class__)) - * obj._anim_list[self.index].anim = value - */ - __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_value, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_IncompleteAnimBase)); - __pyx_t_1 = (__pyx_t_4 != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":358 - * obj._anim_list[self.index].anim = value - * elif isinstance(value, IncompleteAnimBase): - * value = value.force_complete(start=self.__get__(obj, obj.__class__)) # <<<<<<<<<<<<<< - * obj._anim_list[self.index].anim = value - * elif callable(value): - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s__force_complete); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____get__); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_obj), __pyx_n_s____class__); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(((PyObject *)__pyx_v_obj)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_obj)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_obj)); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__start), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_7); - __pyx_t_7 = 0; - - /* "rabbyt/rabbyt._anims.pyx":359 - * elif isinstance(value, IncompleteAnimBase): - * value = value.force_complete(start=self.__get__(obj, obj.__class__)) - * obj._anim_list[self.index].anim = value # <<<<<<<<<<<<<< - * elif callable(value): - * obj._anim_list[self.index].anim = AnimPyFunc(value) - */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_obj->_anim_list, __pyx_v_self->index, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_n_s__anim, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L5; - } - - /* "rabbyt/rabbyt._anims.pyx":360 - * value = value.force_complete(start=self.__get__(obj, obj.__class__)) - * obj._anim_list[self.index].anim = value - * elif callable(value): # <<<<<<<<<<<<<< - * obj._anim_list[self.index].anim = AnimPyFunc(value) - * else: - */ - __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = (__pyx_t_1 != 0); - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._anims.pyx":361 - * obj._anim_list[self.index].anim = value - * elif callable(value): - * obj._anim_list[self.index].anim = AnimPyFunc(value) # <<<<<<<<<<<<<< - * else: - * raise ValueError() - */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimPyFunc)), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_obj->_anim_list, __pyx_v_self->index, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_PyObject_SetAttrStr(__pyx_t_7, __pyx_n_s__anim, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L5; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":363 - * obj._anim_list[self.index].anim = AnimPyFunc(value) - * else: - * raise ValueError() # <<<<<<<<<<<<<< - * - * def get_slot(self, cAnimable obj not None): - */ - __pyx_t_7 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_Raise(__pyx_t_7, 0, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L5:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rabbyt._anims.anim_slot.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_value); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_7get_slot(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_7get_slot(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) { - CYTHON_UNUSED int __pyx_lineno = 0; - CYTHON_UNUSED const char *__pyx_filename = NULL; - CYTHON_UNUSED int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_slot (wrapper)", 0); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_ptype_6rabbyt_6_anims_cAnimable, 0, "obj", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_6get_slot(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self), ((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_obj)); - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":365 - * raise ValueError() - * - * def get_slot(self, cAnimable obj not None): # <<<<<<<<<<<<<< - * return obj._anim_list[self.index] - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_6get_slot(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_cAnimable *__pyx_v_obj) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_slot", 0); - - /* "rabbyt/rabbyt._anims.pyx":366 - * - * def get_slot(self, cAnimable obj not None): - * return obj._anim_list[self.index] # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj->_anim_list, __pyx_v_self->index, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.anim_slot.get_slot", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_5index_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_5index_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_5index___get__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":327 - * ``anim_slot`` only works in ``Animable`` subclasses. - * """ - * cdef public int index # <<<<<<<<<<<<<< - * cdef public float default_value - * cdef public object __doc__ - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_5index___get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.anim_slot.index.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_5index_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_5index_2__set__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_5index_2__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->index = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._anims.anim_slot.index.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_13default_value_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_13default_value_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_13default_value___get__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":328 - * """ - * cdef public int index - * cdef public float default_value # <<<<<<<<<<<<<< - * cdef public object __doc__ - * def __init__(self, default=0, doc="", index=-1): - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_13default_value___get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->default_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.anim_slot.default_value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_13default_value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_13default_value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_13default_value_2__set__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_13default_value_2__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->default_value = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._anims.anim_slot.default_value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc_____get__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":329 - * cdef public int index - * cdef public float default_value - * cdef public object __doc__ # <<<<<<<<<<<<<< - * def __init__(self, default=0, doc="", index=-1): - * self.default_value = default - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc_____get__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->__doc__); - __pyx_r = __pyx_v_self->__doc__; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc___2__set__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc___2__set__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->__doc__); - __Pyx_DECREF(__pyx_v_self->__doc__); - __pyx_v_self->__doc__ = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc___4__del__(((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_9anim_slot_7__doc___4__del__(struct __pyx_obj_6rabbyt_6_anims_anim_slot *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->__doc__); - __Pyx_DECREF(__pyx_v_self->__doc__); - __pyx_v_self->__doc__ = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":369 - * - * - * cdef float _anim_const_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * return ((slot.anim.data))[0] - * - */ - -static float __pyx_f_6rabbyt_6_anims__anim_const_func(AnimSlot_s *__pyx_v_slot) { - float __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_anim_const_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":370 - * - * cdef float _anim_const_func(AnimSlot_s * slot): - * return ((slot.anim.data))[0] # <<<<<<<<<<<<<< - * - * cdef class AnimConst(Anim): - */ - __pyx_r = (((float *)__pyx_v_slot->anim->data)[0]); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9AnimConst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9AnimConst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - float __pyx_v_v; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__v,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__v)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_v = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_v == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimConst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_9AnimConst___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimConst *)__pyx_v_self), __pyx_v_v); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":382 - * """ - * cdef float v - * def __init__(self, float v): # <<<<<<<<<<<<<< - * self.v = v - * self._anim.data = &self.v - */ - -static int __pyx_pf_6rabbyt_6_anims_9AnimConst___init__(struct __pyx_obj_6rabbyt_6_anims_AnimConst *__pyx_v_self, float __pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":383 - * cdef float v - * def __init__(self, float v): - * self.v = v # <<<<<<<<<<<<<< - * self._anim.data = &self.v - * self._anim.func = _anim_const_func - */ - __pyx_v_self->v = __pyx_v_v; - - /* "rabbyt/rabbyt._anims.pyx":384 - * def __init__(self, float v): - * self.v = v - * self._anim.data = &self.v # <<<<<<<<<<<<<< - * self._anim.func = _anim_const_func - * - */ - __pyx_v_self->__pyx_base._anim.data = (&__pyx_v_self->v); - - /* "rabbyt/rabbyt._anims.pyx":385 - * self.v = v - * self._anim.data = &self.v - * self._anim.func = _anim_const_func # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__anim_const_func); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_11AnimPointer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_11AnimPointer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_pointer = 0; - PyObject *__pyx_v_owner = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__pointer,&__pyx_n_s__owner,0}; - PyObject* values[2] = {0,0}; - - /* "rabbyt/rabbyt._anims.pyx":410 - * """ - * cdef object _owner - * def __init__(self, pointer, owner=None): # <<<<<<<<<<<<<< - * cdef unsigned long address - * if owner is None: - */ - values[1] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pointer)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__owner); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_pointer = values[0]; - __pyx_v_owner = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimPointer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_11AnimPointer___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimPointer *)__pyx_v_self), __pyx_v_pointer, __pyx_v_owner); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_11AnimPointer___init__(struct __pyx_obj_6rabbyt_6_anims_AnimPointer *__pyx_v_self, PyObject *__pyx_v_pointer, PyObject *__pyx_v_owner) { - unsigned long __pyx_v_address; - PyObject *__pyx_v_ctypes = NULL; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - unsigned long __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - __Pyx_INCREF(__pyx_v_owner); - - /* "rabbyt/rabbyt._anims.pyx":412 - * def __init__(self, pointer, owner=None): - * cdef unsigned long address - * if owner is None: # <<<<<<<<<<<<<< - * owner = pointer - * if PyNumber_Check(pointer): - */ - __pyx_t_1 = (__pyx_v_owner == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":413 - * cdef unsigned long address - * if owner is None: - * owner = pointer # <<<<<<<<<<<<<< - * if PyNumber_Check(pointer): - * address = pointer - */ - __Pyx_INCREF(__pyx_v_pointer); - __Pyx_DECREF_SET(__pyx_v_owner, __pyx_v_pointer); - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":414 - * if owner is None: - * owner = pointer - * if PyNumber_Check(pointer): # <<<<<<<<<<<<<< - * address = pointer - * else: - */ - __pyx_t_2 = (PyNumber_Check(__pyx_v_pointer) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":415 - * owner = pointer - * if PyNumber_Check(pointer): - * address = pointer # <<<<<<<<<<<<<< - * else: - * import ctypes - */ - __pyx_t_3 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_pointer); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_address = __pyx_t_3; - goto __pyx_L4; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":417 - * address = pointer - * else: - * import ctypes # <<<<<<<<<<<<<< - * address = ctypes.addressof(pointer.contents) - * self._owner = owner - */ - __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s__ctypes), 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_ctypes = __pyx_t_4; - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._anims.pyx":418 - * else: - * import ctypes - * address = ctypes.addressof(pointer.contents) # <<<<<<<<<<<<<< - * self._owner = owner - * self._anim.func = _anim_const_func - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_n_s__addressof); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pointer, __pyx_n_s__contents); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_5); if (unlikely((__pyx_t_3 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_address = __pyx_t_3; - } - __pyx_L4:; - - /* "rabbyt/rabbyt._anims.pyx":419 - * import ctypes - * address = ctypes.addressof(pointer.contents) - * self._owner = owner # <<<<<<<<<<<<<< - * self._anim.func = _anim_const_func - * self._anim.data = address - */ - __Pyx_INCREF(__pyx_v_owner); - __Pyx_GIVEREF(__pyx_v_owner); - __Pyx_GOTREF(__pyx_v_self->_owner); - __Pyx_DECREF(__pyx_v_self->_owner); - __pyx_v_self->_owner = __pyx_v_owner; - - /* "rabbyt/rabbyt._anims.pyx":420 - * address = ctypes.addressof(pointer.contents) - * self._owner = owner - * self._anim.func = _anim_const_func # <<<<<<<<<<<<<< - * self._anim.data = address - * - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__anim_const_func); - - /* "rabbyt/rabbyt._anims.pyx":421 - * self._owner = owner - * self._anim.func = _anim_const_func - * self._anim.data = address # <<<<<<<<<<<<<< - * - * property owner: - */ - __pyx_v_self->__pyx_base._anim.data = ((void *)__pyx_v_address); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rabbyt._anims.AnimPointer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ctypes); - __Pyx_XDECREF(__pyx_v_owner); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_11AnimPointer_5owner_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_11AnimPointer_5owner_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_11AnimPointer_5owner___get__(((struct __pyx_obj_6rabbyt_6_anims_AnimPointer *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":424 - * - * property owner: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._owner - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_11AnimPointer_5owner___get__(struct __pyx_obj_6rabbyt_6_anims_AnimPointer *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":425 - * property owner: - * def __get__(self): - * return self._owner # <<<<<<<<<<<<<< - * - * cdef class InterpolateAnim(Anim): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->_owner); - __pyx_r = __pyx_v_self->_owner; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_method = 0; - PyObject *__pyx_v_start = 0; - PyObject *__pyx_v_end = 0; - PyObject *__pyx_v_extend = 0; - float __pyx_v_startt; - float __pyx_v_endt; - PyObject *__pyx_v_t = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__method,&__pyx_n_s__start,&__pyx_n_s__end,&__pyx_n_s__extend,&__pyx_n_s__startt,&__pyx_n_s__endt,&__pyx_n_s__t,0}; - PyObject* values[7] = {0,0,0,0,0,0,0}; - - /* "rabbyt/rabbyt._anims.pyx":431 - * cdef public object method_name - * def __init__(self, method, start, end, extend, float startt=0, float endt=0, - * t=None): # <<<<<<<<<<<<<< - * Anim.__init__(self) - * - */ - values[6] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__method)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__start)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__end)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__extend)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__startt); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endt); - if (value) { values[5] = value; kw_args--; } - } - case 6: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__t); - if (value) { values[6] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_method = values[0]; - __pyx_v_start = values[1]; - __pyx_v_end = values[2]; - __pyx_v_extend = values[3]; - if (values[4]) { - __pyx_v_startt = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_startt == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - - /* "rabbyt/rabbyt._anims.pyx":430 - * cdef InterpolateAnim_data _data - * cdef public object method_name - * def __init__(self, method, start, end, extend, float startt=0, float endt=0, # <<<<<<<<<<<<<< - * t=None): - * Anim.__init__(self) - */ - __pyx_v_startt = ((float)0.0); - } - if (values[5]) { - __pyx_v_endt = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_endt == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_endt = ((float)0.0); - } - __pyx_v_t = values[6]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim___init__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self), __pyx_v_method, __pyx_v_start, __pyx_v_end, __pyx_v_extend, __pyx_v_startt, __pyx_v_endt, __pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_15InterpolateAnim___init__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_start, PyObject *__pyx_v_end, PyObject *__pyx_v_extend, float __pyx_v_startt, float __pyx_v_endt, PyObject *__pyx_v_t) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - float __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":432 - * def __init__(self, method, start, end, extend, float startt=0, float endt=0, - * t=None): - * Anim.__init__(self) # <<<<<<<<<<<<<< - * - * self._data.start_time = startt - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":434 - * Anim.__init__(self) - * - * self._data.start_time = startt # <<<<<<<<<<<<<< - * self._data.end_time = endt - * #self.extend = extend - */ - __pyx_v_self->_data.start_time = __pyx_v_startt; - - /* "rabbyt/rabbyt._anims.pyx":435 - * - * self._data.start_time = startt - * self._data.end_time = endt # <<<<<<<<<<<<<< - * #self.extend = extend - * self._data.one_over_dt = 0 - */ - __pyx_v_self->_data.end_time = __pyx_v_endt; - - /* "rabbyt/rabbyt._anims.pyx":437 - * self._data.end_time = endt - * #self.extend = extend - * self._data.one_over_dt = 0 # <<<<<<<<<<<<<< - * if (endt > startt): - * self._data.one_over_dt = 1/(endt-startt) - */ - __pyx_v_self->_data.one_over_dt = 0.0; - - /* "rabbyt/rabbyt._anims.pyx":438 - * #self.extend = extend - * self._data.one_over_dt = 0 - * if (endt > startt): # <<<<<<<<<<<<<< - * self._data.one_over_dt = 1/(endt-startt) - * - */ - __pyx_t_4 = ((__pyx_v_endt > __pyx_v_startt) != 0); - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._anims.pyx":439 - * self._data.one_over_dt = 0 - * if (endt > startt): - * self._data.one_over_dt = 1/(endt-startt) # <<<<<<<<<<<<<< - * - * if t is None: - */ - __pyx_t_5 = ((float)(__pyx_v_endt - __pyx_v_startt)); - if (unlikely(__pyx_t_5 == 0)) { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_self->_data.one_over_dt = (1.0 / __pyx_t_5); - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":441 - * self._data.one_over_dt = 1/(endt-startt) - * - * if t is None: # <<<<<<<<<<<<<< - * self._data.use_global_time = True - * else: - */ - __pyx_t_4 = (__pyx_v_t == Py_None); - __pyx_t_6 = (__pyx_t_4 != 0); - if (__pyx_t_6) { - - /* "rabbyt/rabbyt._anims.pyx":442 - * - * if t is None: - * self._data.use_global_time = True # <<<<<<<<<<<<<< - * else: - * self._data.use_global_time = False - */ - __pyx_v_self->_data.use_global_time = 1; - goto __pyx_L4; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":444 - * self._data.use_global_time = True - * else: - * self._data.use_global_time = False # <<<<<<<<<<<<<< - * self.add_dependency(t, &self._data.t) - * - */ - __pyx_v_self->_data.use_global_time = 0; - - /* "rabbyt/rabbyt._anims.pyx":445 - * else: - * self._data.use_global_time = False - * self.add_dependency(t, &self._data.t) # <<<<<<<<<<<<<< - * - * self.add_dependency(start, &self._data.start) - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_t, (&__pyx_v_self->_data.t)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L4:; - - /* "rabbyt/rabbyt._anims.pyx":447 - * self.add_dependency(t, &self._data.t) - * - * self.add_dependency(start, &self._data.start) # <<<<<<<<<<<<<< - * self.add_dependency(end, &self._data.end) - * - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_start, (&__pyx_v_self->_data.start)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":448 - * - * self.add_dependency(start, &self._data.start) - * self.add_dependency(end, &self._data.end) # <<<<<<<<<<<<<< - * - * self._anim.data = &(self._data) - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_end, (&__pyx_v_self->_data.end)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":450 - * self.add_dependency(end, &self._data.end) - * - * self._anim.data = &(self._data) # <<<<<<<<<<<<<< - * - * self._anim.func = interpolate_func - */ - __pyx_v_self->__pyx_base._anim.data = (&__pyx_v_self->_data); - - /* "rabbyt/rabbyt._anims.pyx":452 - * self._anim.data = &(self._data) - * - * self._anim.func = interpolate_func # <<<<<<<<<<<<<< - * - * self._data.inter_mode = { - */ - __pyx_v_self->__pyx_base._anim.func = interpolate_func; - - /* "rabbyt/rabbyt._anims.pyx":454 - * self._anim.func = interpolate_func - * - * self._data.inter_mode = { # <<<<<<<<<<<<<< - * "lerp": INTER_LERP, - * - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - - /* "rabbyt/rabbyt._anims.pyx":455 - * - * self._data.inter_mode = { - * "lerp": INTER_LERP, # <<<<<<<<<<<<<< - * - * "ease_quad": INTER_IN_OUT_QUAD, - */ - __pyx_t_2 = PyInt_FromLong(INTER_LERP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__lerp), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":457 - * "lerp": INTER_LERP, - * - * "ease_quad": INTER_IN_OUT_QUAD, # <<<<<<<<<<<<<< - * "ease_cubic": INTER_IN_OUT_CUBIC, - * "ease_circ": INTER_IN_OUT_CIRC, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_OUT_QUAD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_quad), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":458 - * - * "ease_quad": INTER_IN_OUT_QUAD, - * "ease_cubic": INTER_IN_OUT_CUBIC, # <<<<<<<<<<<<<< - * "ease_circ": INTER_IN_OUT_CIRC, - * "ease_back": INTER_IN_OUT_BACK, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_OUT_CUBIC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_cubic), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":459 - * "ease_quad": INTER_IN_OUT_QUAD, - * "ease_cubic": INTER_IN_OUT_CUBIC, - * "ease_circ": INTER_IN_OUT_CIRC, # <<<<<<<<<<<<<< - * "ease_back": INTER_IN_OUT_BACK, - * "ease_sine": INTER_IN_OUT_SINE, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_OUT_CIRC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_circ), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":460 - * "ease_cubic": INTER_IN_OUT_CUBIC, - * "ease_circ": INTER_IN_OUT_CIRC, - * "ease_back": INTER_IN_OUT_BACK, # <<<<<<<<<<<<<< - * "ease_sine": INTER_IN_OUT_SINE, - * "ease_bounce": INTER_IN_OUT_BOUNCE, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_OUT_BACK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_back), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":461 - * "ease_circ": INTER_IN_OUT_CIRC, - * "ease_back": INTER_IN_OUT_BACK, - * "ease_sine": INTER_IN_OUT_SINE, # <<<<<<<<<<<<<< - * "ease_bounce": INTER_IN_OUT_BOUNCE, - * - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_OUT_SINE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_sine), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":462 - * "ease_back": INTER_IN_OUT_BACK, - * "ease_sine": INTER_IN_OUT_SINE, - * "ease_bounce": INTER_IN_OUT_BOUNCE, # <<<<<<<<<<<<<< - * - * "ease_in_sine":INTER_IN_SINE, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_OUT_BOUNCE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_bounce), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":464 - * "ease_bounce": INTER_IN_OUT_BOUNCE, - * - * "ease_in_sine":INTER_IN_SINE, # <<<<<<<<<<<<<< - * "ease_in_quad":INTER_IN_QUAD, - * "ease_in_cubic":INTER_IN_CUBIC, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_SINE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_in_sine), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":465 - * - * "ease_in_sine":INTER_IN_SINE, - * "ease_in_quad":INTER_IN_QUAD, # <<<<<<<<<<<<<< - * "ease_in_cubic":INTER_IN_CUBIC, - * "ease_in_exponential":INTER_EXPONENTIAL, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_QUAD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_in_quad), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":466 - * "ease_in_sine":INTER_IN_SINE, - * "ease_in_quad":INTER_IN_QUAD, - * "ease_in_cubic":INTER_IN_CUBIC, # <<<<<<<<<<<<<< - * "ease_in_exponential":INTER_EXPONENTIAL, - * "ease_in_circ":INTER_IN_CIRC, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_CUBIC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_in_cubic), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":467 - * "ease_in_quad":INTER_IN_QUAD, - * "ease_in_cubic":INTER_IN_CUBIC, - * "ease_in_exponential":INTER_EXPONENTIAL, # <<<<<<<<<<<<<< - * "ease_in_circ":INTER_IN_CIRC, - * "ease_in_back": INTER_IN_BACK, - */ - __pyx_t_2 = PyInt_FromLong(INTER_EXPONENTIAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_in_exponential), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":468 - * "ease_in_cubic":INTER_IN_CUBIC, - * "ease_in_exponential":INTER_EXPONENTIAL, - * "ease_in_circ":INTER_IN_CIRC, # <<<<<<<<<<<<<< - * "ease_in_back": INTER_IN_BACK, - * "ease_in_bounce": INTER_IN_BOUNCE, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_CIRC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_in_circ), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":469 - * "ease_in_exponential":INTER_EXPONENTIAL, - * "ease_in_circ":INTER_IN_CIRC, - * "ease_in_back": INTER_IN_BACK, # <<<<<<<<<<<<<< - * "ease_in_bounce": INTER_IN_BOUNCE, - * - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_BACK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_in_back), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":470 - * "ease_in_circ":INTER_IN_CIRC, - * "ease_in_back": INTER_IN_BACK, - * "ease_in_bounce": INTER_IN_BOUNCE, # <<<<<<<<<<<<<< - * - * "ease_out_quad": INTER_OUT_QUAD, - */ - __pyx_t_2 = PyInt_FromLong(INTER_IN_BOUNCE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_in_bounce), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":472 - * "ease_in_bounce": INTER_IN_BOUNCE, - * - * "ease_out_quad": INTER_OUT_QUAD, # <<<<<<<<<<<<<< - * "ease_out_cubic": INTER_OUT_CUBIC, - * "ease_out_sine":INTER_OUT_SINE, - */ - __pyx_t_2 = PyInt_FromLong(INTER_OUT_QUAD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_out_quad), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":473 - * - * "ease_out_quad": INTER_OUT_QUAD, - * "ease_out_cubic": INTER_OUT_CUBIC, # <<<<<<<<<<<<<< - * "ease_out_sine":INTER_OUT_SINE, - * "ease_out_circ": INTER_OUT_CIRC, - */ - __pyx_t_2 = PyInt_FromLong(INTER_OUT_CUBIC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_out_cubic), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":474 - * "ease_out_quad": INTER_OUT_QUAD, - * "ease_out_cubic": INTER_OUT_CUBIC, - * "ease_out_sine":INTER_OUT_SINE, # <<<<<<<<<<<<<< - * "ease_out_circ": INTER_OUT_CIRC, - * "ease_out_back": INTER_OUT_BACK, - */ - __pyx_t_2 = PyInt_FromLong(INTER_OUT_SINE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_out_sine), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":475 - * "ease_out_cubic": INTER_OUT_CUBIC, - * "ease_out_sine":INTER_OUT_SINE, - * "ease_out_circ": INTER_OUT_CIRC, # <<<<<<<<<<<<<< - * "ease_out_back": INTER_OUT_BACK, - * "ease_out_bounce": INTER_OUT_BOUNCE}[method] - */ - __pyx_t_2 = PyInt_FromLong(INTER_OUT_CIRC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_out_circ), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":476 - * "ease_out_sine":INTER_OUT_SINE, - * "ease_out_circ": INTER_OUT_CIRC, - * "ease_out_back": INTER_OUT_BACK, # <<<<<<<<<<<<<< - * "ease_out_bounce": INTER_OUT_BOUNCE}[method] - * - */ - __pyx_t_2 = PyInt_FromLong(INTER_OUT_BACK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_out_back), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":477 - * "ease_out_circ": INTER_OUT_CIRC, - * "ease_out_back": INTER_OUT_BACK, - * "ease_out_bounce": INTER_OUT_BOUNCE}[method] # <<<<<<<<<<<<<< - * - * self._data.extend_mode = { - */ - __pyx_t_2 = PyInt_FromLong(INTER_OUT_BOUNCE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__ease_out_bounce), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_3), __pyx_v_method); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":454 - * self._anim.func = interpolate_func - * - * self._data.inter_mode = { # <<<<<<<<<<<<<< - * "lerp": INTER_LERP, - * - */ - __pyx_v_self->_data.inter_mode = __pyx_t_7; - - /* "rabbyt/rabbyt._anims.pyx":479 - * "ease_out_bounce": INTER_OUT_BOUNCE}[method] - * - * self._data.extend_mode = { # <<<<<<<<<<<<<< - * "constant":EXTEND_CONSTANT, - * "extrapolate":EXTEND_EXTRAPOLATE, - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - - /* "rabbyt/rabbyt._anims.pyx":480 - * - * self._data.extend_mode = { - * "constant":EXTEND_CONSTANT, # <<<<<<<<<<<<<< - * "extrapolate":EXTEND_EXTRAPOLATE, - * "repeat":EXTEND_REPEAT, - */ - __pyx_t_3 = PyInt_FromLong(EXTEND_CONSTANT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__constant), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":481 - * self._data.extend_mode = { - * "constant":EXTEND_CONSTANT, - * "extrapolate":EXTEND_EXTRAPOLATE, # <<<<<<<<<<<<<< - * "repeat":EXTEND_REPEAT, - * "reverse":EXTEND_REVERSE}[extend] - */ - __pyx_t_3 = PyInt_FromLong(EXTEND_EXTRAPOLATE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__extrapolate), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":482 - * "constant":EXTEND_CONSTANT, - * "extrapolate":EXTEND_EXTRAPOLATE, - * "repeat":EXTEND_REPEAT, # <<<<<<<<<<<<<< - * "reverse":EXTEND_REVERSE}[extend] - * - */ - __pyx_t_3 = PyInt_FromLong(EXTEND_REPEAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__repeat), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":483 - * "extrapolate":EXTEND_EXTRAPOLATE, - * "repeat":EXTEND_REPEAT, - * "reverse":EXTEND_REVERSE}[extend] # <<<<<<<<<<<<<< - * - * self.method_name = method - */ - __pyx_t_3 = PyInt_FromLong(EXTEND_REVERSE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__reverse), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_t_2), __pyx_v_extend); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":479 - * "ease_out_bounce": INTER_OUT_BOUNCE}[method] - * - * self._data.extend_mode = { # <<<<<<<<<<<<<< - * "constant":EXTEND_CONSTANT, - * "extrapolate":EXTEND_EXTRAPOLATE, - */ - __pyx_v_self->_data.extend_mode = __pyx_t_7; - - /* "rabbyt/rabbyt._anims.pyx":485 - * "reverse":EXTEND_REVERSE}[extend] - * - * self.method_name = method # <<<<<<<<<<<<<< - * - * property start: - */ - __Pyx_INCREF(__pyx_v_method); - __Pyx_GIVEREF(__pyx_v_method); - __Pyx_GOTREF(__pyx_v_self->method_name); - __Pyx_DECREF(__pyx_v_self->method_name); - __pyx_v_self->method_name = __pyx_v_method; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_5start_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_5start_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_5start___get__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":488 - * - * property start: - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float x - * READ_SLOT(&self._data.start, &x) - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_5start___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - float __pyx_v_x; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":490 - * def __get__(self): - * cdef float x - * READ_SLOT(&self._data.start, &x) # <<<<<<<<<<<<<< - * return x - * - */ - READ_SLOT((&__pyx_v_self->_data.start), (&__pyx_v_x)); - - /* "rabbyt/rabbyt._anims.pyx":491 - * cdef float x - * READ_SLOT(&self._data.start, &x) - * return x # <<<<<<<<<<<<<< - * - * property end: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.start.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_3end_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_3end_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_3end___get__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":494 - * - * property end: - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float x - * READ_SLOT(&self._data.end, &x) - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_3end___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - float __pyx_v_x; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":496 - * def __get__(self): - * cdef float x - * READ_SLOT(&self._data.end, &x) # <<<<<<<<<<<<<< - * return x - * - */ - READ_SLOT((&__pyx_v_self->_data.end), (&__pyx_v_x)); - - /* "rabbyt/rabbyt._anims.pyx":497 - * cdef float x - * READ_SLOT(&self._data.end, &x) - * return x # <<<<<<<<<<<<<< - * - * property startt: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.end.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_6startt_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_6startt_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_6startt___get__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":500 - * - * property startt: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._data.start_time - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_6startt___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":501 - * property startt: - * def __get__(self): - * return self._data.start_time # <<<<<<<<<<<<<< - * - * property endt: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_data.start_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.startt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_4endt_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_4endt_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_4endt___get__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":504 - * - * property endt: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._data.end_time - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_4endt___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":505 - * property endt: - * def __get__(self): - * return self._data.end_time # <<<<<<<<<<<<<< - * - * property dt: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_data.end_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.endt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_2dt_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_2dt_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_2dt___get__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":508 - * - * property dt: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._data.end_time - self._data.start_time - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_2dt___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":509 - * property dt: - * def __get__(self): - * return self._data.end_time - self._data.start_time # <<<<<<<<<<<<<< - * - * # TODO provide introspection capabilities for 't' argument? - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_data.end_time - __pyx_v_self->_data.start_time)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.dt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_3__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_3__repr__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_2__repr__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":513 - * # TODO provide introspection capabilities for 't' argument? - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % self.method_name - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_2__repr__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 0); - - /* "rabbyt/rabbyt._anims.pyx":514 - * - * def __repr__(self): - * return "" % self.method_name # <<<<<<<<<<<<<< - * - * property end_time: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_v_self->method_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_8end_time_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_8end_time_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_8end_time___get__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":517 - * - * property end_time: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._data.end_time - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_8end_time___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":518 - * property end_time: - * def __get__(self): - * return self._data.end_time # <<<<<<<<<<<<<< - * - * ctypedef struct chain_link_s: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_data.end_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.InterpolateAnim.end_time.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name___get__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":429 - * cdef class InterpolateAnim(Anim): - * cdef InterpolateAnim_data _data - * cdef public object method_name # <<<<<<<<<<<<<< - * def __init__(self, method, start, end, extend, float startt=0, float endt=0, - * t=None): - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name___get__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->method_name); - __pyx_r = __pyx_v_self->method_name; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name_2__set__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name_2__set__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->method_name); - __Pyx_DECREF(__pyx_v_self->method_name); - __pyx_v_self->method_name = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name_4__del__(((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_15InterpolateAnim_11method_name_4__del__(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->method_name); - __Pyx_DECREF(__pyx_v_self->method_name); - __pyx_v_self->method_name = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":528 - * chain_link_s * links - * - * cdef float _on_end_chain(AnimSlot_s * slot, void * data, float end): # <<<<<<<<<<<<<< - * cdef int i - * cdef float time - */ - -static float __pyx_f_6rabbyt_6_anims__on_end_chain(AnimSlot_s *__pyx_v_slot, void *__pyx_v_data, CYTHON_UNUSED float __pyx_v_end) { - int __pyx_v_i; - float __pyx_v_time; - __pyx_t_6rabbyt_6_anims_chain_data_s *__pyx_v_d; - float __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - AnimFunc __pyx_t_3; - void *__pyx_t_4; - __Pyx_RefNannySetupContext("_on_end_chain", 0); - - /* "rabbyt/rabbyt._anims.pyx":531 - * cdef int i - * cdef float time - * time = _get_time() # <<<<<<<<<<<<<< - * cdef chain_data_s * d - * d = data - */ - __pyx_v_time = _get_time(); - - /* "rabbyt/rabbyt._anims.pyx":533 - * time = _get_time() - * cdef chain_data_s * d - * d = data # <<<<<<<<<<<<<< - * - * for i from 0 <= i < d.link_count: - */ - __pyx_v_d = ((__pyx_t_6rabbyt_6_anims_chain_data_s *)__pyx_v_data); - - /* "rabbyt/rabbyt._anims.pyx":535 - * d = data - * - * for i from 0 <= i < d.link_count: # <<<<<<<<<<<<<< - * if d.links[i].end_time > time: - * slot.anim.func = d.links[i].anim.func - */ - __pyx_t_1 = __pyx_v_d->link_count; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - - /* "rabbyt/rabbyt._anims.pyx":536 - * - * for i from 0 <= i < d.link_count: - * if d.links[i].end_time > time: # <<<<<<<<<<<<<< - * slot.anim.func = d.links[i].anim.func - * slot.anim.data = d.links[i].anim.data - */ - __pyx_t_2 = (((__pyx_v_d->links[__pyx_v_i]).end_time > __pyx_v_time) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":537 - * for i from 0 <= i < d.link_count: - * if d.links[i].end_time > time: - * slot.anim.func = d.links[i].anim.func # <<<<<<<<<<<<<< - * slot.anim.data = d.links[i].anim.data - * return slot.anim.func(slot) - */ - __pyx_t_3 = (__pyx_v_d->links[__pyx_v_i]).anim.func; - __pyx_v_slot->anim->func = __pyx_t_3; - - /* "rabbyt/rabbyt._anims.pyx":538 - * if d.links[i].end_time > time: - * slot.anim.func = d.links[i].anim.func - * slot.anim.data = d.links[i].anim.data # <<<<<<<<<<<<<< - * return slot.anim.func(slot) - * slot.anim.func = d.links[d.link_count-1].anim.func - */ - __pyx_t_4 = (__pyx_v_d->links[__pyx_v_i]).anim.data; - __pyx_v_slot->anim->data = __pyx_t_4; - - /* "rabbyt/rabbyt._anims.pyx":539 - * slot.anim.func = d.links[i].anim.func - * slot.anim.data = d.links[i].anim.data - * return slot.anim.func(slot) # <<<<<<<<<<<<<< - * slot.anim.func = d.links[d.link_count-1].anim.func - * slot.anim.data = d.links[d.link_count-1].anim.data - */ - __pyx_r = __pyx_v_slot->anim->func(__pyx_v_slot); - goto __pyx_L0; - goto __pyx_L5; - } - __pyx_L5:; - } - - /* "rabbyt/rabbyt._anims.pyx":540 - * slot.anim.data = d.links[i].anim.data - * return slot.anim.func(slot) - * slot.anim.func = d.links[d.link_count-1].anim.func # <<<<<<<<<<<<<< - * slot.anim.data = d.links[d.link_count-1].anim.data - * slot.anim.on_end = _on_end_clear - */ - __pyx_t_3 = (__pyx_v_d->links[(__pyx_v_d->link_count - 1)]).anim.func; - __pyx_v_slot->anim->func = __pyx_t_3; - - /* "rabbyt/rabbyt._anims.pyx":541 - * return slot.anim.func(slot) - * slot.anim.func = d.links[d.link_count-1].anim.func - * slot.anim.data = d.links[d.link_count-1].anim.data # <<<<<<<<<<<<<< - * slot.anim.on_end = _on_end_clear - * slot.anim.on_end_data = NULL - */ - __pyx_t_4 = (__pyx_v_d->links[(__pyx_v_d->link_count - 1)]).anim.data; - __pyx_v_slot->anim->data = __pyx_t_4; - - /* "rabbyt/rabbyt._anims.pyx":542 - * slot.anim.func = d.links[d.link_count-1].anim.func - * slot.anim.data = d.links[d.link_count-1].anim.data - * slot.anim.on_end = _on_end_clear # <<<<<<<<<<<<<< - * slot.anim.on_end_data = NULL - * return slot.anim.func(slot) - */ - __pyx_v_slot->anim->on_end = __pyx_f_6rabbyt_6_anims__on_end_clear; - - /* "rabbyt/rabbyt._anims.pyx":543 - * slot.anim.data = d.links[d.link_count-1].anim.data - * slot.anim.on_end = _on_end_clear - * slot.anim.on_end_data = NULL # <<<<<<<<<<<<<< - * return slot.anim.func(slot) - * - */ - __pyx_v_slot->anim->on_end_data = NULL; - - /* "rabbyt/rabbyt._anims.pyx":544 - * slot.anim.on_end = _on_end_clear - * slot.anim.on_end_data = NULL - * return slot.anim.func(slot) # <<<<<<<<<<<<<< - * - * cdef class ChainAnim(Anim): - */ - __pyx_r = __pyx_v_slot->anim->func(__pyx_v_slot); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9ChainAnim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9ChainAnim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_anims = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__anims,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__anims)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_anims = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.ChainAnim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_9ChainAnim___init__(((struct __pyx_obj_6rabbyt_6_anims_ChainAnim *)__pyx_v_self), __pyx_v_anims); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":550 - * cdef object _anims - * - * def __init__(self, anims): # <<<<<<<<<<<<<< - * cdef int i - * cdef Anim anim - */ - -static int __pyx_pf_6rabbyt_6_anims_9ChainAnim___init__(struct __pyx_obj_6rabbyt_6_anims_ChainAnim *__pyx_v_self, PyObject *__pyx_v_anims) { - int __pyx_v_i; - struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_anim = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - Anim_s __pyx_t_5; - float __pyx_t_6; - AnimFunc __pyx_t_7; - void *__pyx_t_8; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":553 - * cdef int i - * cdef Anim anim - * assert len(anims) # <<<<<<<<<<<<<< - * self._anims = list(anims) - * self.chain_data.link_count = len(self._anims) - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - __pyx_t_1 = PyObject_Length(__pyx_v_anims); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!(__pyx_t_1 != 0))) { - PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #endif - - /* "rabbyt/rabbyt._anims.pyx":554 - * cdef Anim anim - * assert len(anims) - * self._anims = list(anims) # <<<<<<<<<<<<<< - * self.chain_data.link_count = len(self._anims) - * self.chain_data.links = malloc( - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_anims); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_anims); - __Pyx_GIVEREF(__pyx_v_anims); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_v_self->_anims); - __Pyx_DECREF(__pyx_v_self->_anims); - __pyx_v_self->_anims = __pyx_t_3; - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":555 - * assert len(anims) - * self._anims = list(anims) - * self.chain_data.link_count = len(self._anims) # <<<<<<<<<<<<<< - * self.chain_data.links = malloc( - * sizeof(chain_link_s)*self.chain_data.link_count) - */ - __pyx_t_3 = __pyx_v_self->_anims; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_self->chain_data.link_count = __pyx_t_1; - - /* "rabbyt/rabbyt._anims.pyx":556 - * self._anims = list(anims) - * self.chain_data.link_count = len(self._anims) - * self.chain_data.links = malloc( # <<<<<<<<<<<<<< - * sizeof(chain_link_s)*self.chain_data.link_count) - * - */ - __pyx_v_self->chain_data.links = ((__pyx_t_6rabbyt_6_anims_chain_link_s *)malloc(((sizeof(__pyx_t_6rabbyt_6_anims_chain_link_s)) * __pyx_v_self->chain_data.link_count))); - - /* "rabbyt/rabbyt._anims.pyx":559 - * sizeof(chain_link_s)*self.chain_data.link_count) - * - * for i from 0 <= i < self.chain_data.link_count: # <<<<<<<<<<<<<< - * anim = self._anims[i] - * self.chain_data.links[i].anim = anim._anim - */ - __pyx_t_4 = __pyx_v_self->chain_data.link_count; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - - /* "rabbyt/rabbyt._anims.pyx":560 - * - * for i from 0 <= i < self.chain_data.link_count: - * anim = self._anims[i] # <<<<<<<<<<<<<< - * self.chain_data.links[i].anim = anim._anim - * self.chain_data.links[i].end_time = anim.end_time - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->_anims, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6rabbyt_6_anims_Anim))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_XDECREF_SET(__pyx_v_anim, ((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":561 - * for i from 0 <= i < self.chain_data.link_count: - * anim = self._anims[i] - * self.chain_data.links[i].anim = anim._anim # <<<<<<<<<<<<<< - * self.chain_data.links[i].end_time = anim.end_time - * self._anim.on_end = _on_end_chain - */ - __pyx_t_5 = __pyx_v_anim->_anim; - (__pyx_v_self->chain_data.links[__pyx_v_i]).anim = __pyx_t_5; - - /* "rabbyt/rabbyt._anims.pyx":562 - * anim = self._anims[i] - * self.chain_data.links[i].anim = anim._anim - * self.chain_data.links[i].end_time = anim.end_time # <<<<<<<<<<<<<< - * self._anim.on_end = _on_end_chain - * self._anim.on_end_data = &self.chain_data - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_anim), __pyx_n_s__end_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - (__pyx_v_self->chain_data.links[__pyx_v_i]).end_time = __pyx_t_6; - } - - /* "rabbyt/rabbyt._anims.pyx":563 - * self.chain_data.links[i].anim = anim._anim - * self.chain_data.links[i].end_time = anim.end_time - * self._anim.on_end = _on_end_chain # <<<<<<<<<<<<<< - * self._anim.on_end_data = &self.chain_data - * - */ - __pyx_v_self->__pyx_base._anim.on_end = __pyx_f_6rabbyt_6_anims__on_end_chain; - - /* "rabbyt/rabbyt._anims.pyx":564 - * self.chain_data.links[i].end_time = anim.end_time - * self._anim.on_end = _on_end_chain - * self._anim.on_end_data = &self.chain_data # <<<<<<<<<<<<<< - * - * self._anim.func = self.chain_data.links[0].anim.func - */ - __pyx_v_self->__pyx_base._anim.on_end_data = (&__pyx_v_self->chain_data); - - /* "rabbyt/rabbyt._anims.pyx":566 - * self._anim.on_end_data = &self.chain_data - * - * self._anim.func = self.chain_data.links[0].anim.func # <<<<<<<<<<<<<< - * self._anim.data = self.chain_data.links[0].anim.data - * - */ - __pyx_t_7 = (__pyx_v_self->chain_data.links[0]).anim.func; - __pyx_v_self->__pyx_base._anim.func = __pyx_t_7; - - /* "rabbyt/rabbyt._anims.pyx":567 - * - * self._anim.func = self.chain_data.links[0].anim.func - * self._anim.data = self.chain_data.links[0].anim.data # <<<<<<<<<<<<<< - * - * property anims: - */ - __pyx_t_8 = (__pyx_v_self->chain_data.links[0]).anim.data; - __pyx_v_self->__pyx_base._anim.data = __pyx_t_8; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.ChainAnim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_anim); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9ChainAnim_5anims_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9ChainAnim_5anims_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9ChainAnim_5anims___get__(((struct __pyx_obj_6rabbyt_6_anims_ChainAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":570 - * - * property anims: - * def __get__(self): # <<<<<<<<<<<<<< - * return list(self._anims) - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9ChainAnim_5anims___get__(struct __pyx_obj_6rabbyt_6_anims_ChainAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":571 - * property anims: - * def __get__(self): - * return list(self._anims) # <<<<<<<<<<<<<< - * - * def __dealloc___(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_self->_anims); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_anims); - __Pyx_GIVEREF(__pyx_v_self->_anims); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._anims.ChainAnim.anims.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9ChainAnim_3__dealloc___(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9ChainAnim_3__dealloc___(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__dealloc___ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9ChainAnim_2__dealloc___(((struct __pyx_obj_6rabbyt_6_anims_ChainAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":573 - * return list(self._anims) - * - * def __dealloc___(self): # <<<<<<<<<<<<<< - * if self.chain_data.links != NULL: - * free(self.chain_data.links) - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9ChainAnim_2__dealloc___(struct __pyx_obj_6rabbyt_6_anims_ChainAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc___", 0); - - /* "rabbyt/rabbyt._anims.pyx":574 - * - * def __dealloc___(self): - * if self.chain_data.links != NULL: # <<<<<<<<<<<<<< - * free(self.chain_data.links) - * self.chain_data.links = NULL - */ - __pyx_t_1 = ((__pyx_v_self->chain_data.links != NULL) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":575 - * def __dealloc___(self): - * if self.chain_data.links != NULL: - * free(self.chain_data.links) # <<<<<<<<<<<<<< - * self.chain_data.links = NULL - * - */ - free(__pyx_v_self->chain_data.links); - - /* "rabbyt/rabbyt._anims.pyx":576 - * if self.chain_data.links != NULL: - * free(self.chain_data.links) - * self.chain_data.links = NULL # <<<<<<<<<<<<<< - * - * # TODO move this to anim_sys.c? - */ - __pyx_v_self->chain_data.links = NULL; - goto __pyx_L3; - } - __pyx_L3:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":579 - * - * # TODO move this to anim_sys.c? - * cdef float extend_t(float t, int mode): # <<<<<<<<<<<<<< - * if mode == 1: # constant - * if t < 0: - */ - -static float __pyx_f_6rabbyt_6_anims_extend_t(float __pyx_v_t, int __pyx_v_mode) { - float __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("extend_t", 0); - - /* "rabbyt/rabbyt._anims.pyx":592 - * elif t < 0: - * t = 1 + t - (t) - * elif mode == 4: # reverse # <<<<<<<<<<<<<< - * if t < 0: - * t = -t - */ - switch (__pyx_v_mode) { - - /* "rabbyt/rabbyt._anims.pyx":580 - * # TODO move this to anim_sys.c? - * cdef float extend_t(float t, int mode): - * if mode == 1: # constant # <<<<<<<<<<<<<< - * if t < 0: - * t = 0 - */ - case 1: - - /* "rabbyt/rabbyt._anims.pyx":581 - * cdef float extend_t(float t, int mode): - * if mode == 1: # constant - * if t < 0: # <<<<<<<<<<<<<< - * t = 0 - * elif t > 1: - */ - __pyx_t_1 = ((__pyx_v_t < 0.0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":582 - * if mode == 1: # constant - * if t < 0: - * t = 0 # <<<<<<<<<<<<<< - * elif t > 1: - * t = 1 - */ - __pyx_v_t = 0.0; - goto __pyx_L3; - } - - /* "rabbyt/rabbyt._anims.pyx":583 - * if t < 0: - * t = 0 - * elif t > 1: # <<<<<<<<<<<<<< - * t = 1 - * elif mode == 2: # extrapolate - */ - __pyx_t_1 = ((__pyx_v_t > 1.0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":584 - * t = 0 - * elif t > 1: - * t = 1 # <<<<<<<<<<<<<< - * elif mode == 2: # extrapolate - * pass - */ - __pyx_v_t = 1.0; - goto __pyx_L3; - } - __pyx_L3:; - break; - - /* "rabbyt/rabbyt._anims.pyx":585 - * elif t > 1: - * t = 1 - * elif mode == 2: # extrapolate # <<<<<<<<<<<<<< - * pass - * elif mode == 3: # repeat - */ - case 2: - break; - - /* "rabbyt/rabbyt._anims.pyx":587 - * elif mode == 2: # extrapolate - * pass - * elif mode == 3: # repeat # <<<<<<<<<<<<<< - * if t > 1.00001: - * t = t - (t) - */ - case 3: - - /* "rabbyt/rabbyt._anims.pyx":588 - * pass - * elif mode == 3: # repeat - * if t > 1.00001: # <<<<<<<<<<<<<< - * t = t - (t) - * elif t < 0: - */ - __pyx_t_1 = ((__pyx_v_t > 1.00001) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":589 - * elif mode == 3: # repeat - * if t > 1.00001: - * t = t - (t) # <<<<<<<<<<<<<< - * elif t < 0: - * t = 1 + t - (t) - */ - __pyx_v_t = (__pyx_v_t - ((int)__pyx_v_t)); - goto __pyx_L4; - } - - /* "rabbyt/rabbyt._anims.pyx":590 - * if t > 1.00001: - * t = t - (t) - * elif t < 0: # <<<<<<<<<<<<<< - * t = 1 + t - (t) - * elif mode == 4: # reverse - */ - __pyx_t_1 = ((__pyx_v_t < 0.0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":591 - * t = t - (t) - * elif t < 0: - * t = 1 + t - (t) # <<<<<<<<<<<<<< - * elif mode == 4: # reverse - * if t < 0: - */ - __pyx_v_t = ((1.0 + __pyx_v_t) - ((int)__pyx_v_t)); - goto __pyx_L4; - } - __pyx_L4:; - break; - - /* "rabbyt/rabbyt._anims.pyx":592 - * elif t < 0: - * t = 1 + t - (t) - * elif mode == 4: # reverse # <<<<<<<<<<<<<< - * if t < 0: - * t = -t - */ - case 4: - - /* "rabbyt/rabbyt._anims.pyx":593 - * t = 1 + t - (t) - * elif mode == 4: # reverse - * if t < 0: # <<<<<<<<<<<<<< - * t = -t - * if (t) % 2 == 1: - */ - __pyx_t_1 = ((__pyx_v_t < 0.0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":594 - * elif mode == 4: # reverse - * if t < 0: - * t = -t # <<<<<<<<<<<<<< - * if (t) % 2 == 1: - * t = 1 - (t - (t)) - */ - __pyx_v_t = (-__pyx_v_t); - goto __pyx_L5; - } - __pyx_L5:; - - /* "rabbyt/rabbyt._anims.pyx":595 - * if t < 0: - * t = -t - * if (t) % 2 == 1: # <<<<<<<<<<<<<< - * t = 1 - (t - (t)) - * else: - */ - __pyx_t_1 = ((__Pyx_mod_long(((int)__pyx_v_t), 2) == 1) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":596 - * t = -t - * if (t) % 2 == 1: - * t = 1 - (t - (t)) # <<<<<<<<<<<<<< - * else: - * t = t - (t) - */ - __pyx_v_t = (1.0 - (__pyx_v_t - ((int)__pyx_v_t))); - goto __pyx_L6; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":598 - * t = 1 - (t - (t)) - * else: - * t = t - (t) # <<<<<<<<<<<<<< - * return t - * - */ - __pyx_v_t = (__pyx_v_t - ((int)__pyx_v_t)); - } - __pyx_L6:; - break; - } - - /* "rabbyt/rabbyt._anims.pyx":599 - * else: - * t = t - (t) - * return t # <<<<<<<<<<<<<< - * - * ctypedef struct static_bezier3_data_s: - */ - __pyx_r = __pyx_v_t; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":611 - * AnimSlot_s t - * - * cdef float _static_bezier3_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef float t, t2, t3 - * cdef static_bezier3_data_s * d - */ - -static float __pyx_f_6rabbyt_6_anims__static_bezier3_func(AnimSlot_s *__pyx_v_slot) { - float __pyx_v_t; - float __pyx_v_t2; - float __pyx_v_t3; - __pyx_t_6rabbyt_6_anims_static_bezier3_data_s *__pyx_v_d; - float __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("_static_bezier3_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":614 - * cdef float t, t2, t3 - * cdef static_bezier3_data_s * d - * d = (slot.anim.data) # <<<<<<<<<<<<<< - * if d.use_global_time: - * t = extend_t((_get_time()-d.startt)*d.one_over_dt, d.extend) - */ - __pyx_v_d = ((__pyx_t_6rabbyt_6_anims_static_bezier3_data_s *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":615 - * cdef static_bezier3_data_s * d - * d = (slot.anim.data) - * if d.use_global_time: # <<<<<<<<<<<<<< - * t = extend_t((_get_time()-d.startt)*d.one_over_dt, d.extend) - * else: - */ - __pyx_t_1 = (__pyx_v_d->use_global_time != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":616 - * d = (slot.anim.data) - * if d.use_global_time: - * t = extend_t((_get_time()-d.startt)*d.one_over_dt, d.extend) # <<<<<<<<<<<<<< - * else: - * READ_SLOT(&d.t, &t) - */ - __pyx_v_t = __pyx_f_6rabbyt_6_anims_extend_t(((_get_time() - __pyx_v_d->startt) * __pyx_v_d->one_over_dt), __pyx_v_d->extend); - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":618 - * t = extend_t((_get_time()-d.startt)*d.one_over_dt, d.extend) - * else: - * READ_SLOT(&d.t, &t) # <<<<<<<<<<<<<< - * t2 = t * t - * t3 = t2 * t - */ - READ_SLOT((&__pyx_v_d->t), (&__pyx_v_t)); - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":619 - * else: - * READ_SLOT(&d.t, &t) - * t2 = t * t # <<<<<<<<<<<<<< - * t3 = t2 * t - * return d.a*t3 + d.b*t2 + d.c*t + d.p0 - */ - __pyx_v_t2 = (__pyx_v_t * __pyx_v_t); - - /* "rabbyt/rabbyt._anims.pyx":620 - * READ_SLOT(&d.t, &t) - * t2 = t * t - * t3 = t2 * t # <<<<<<<<<<<<<< - * return d.a*t3 + d.b*t2 + d.c*t + d.p0 - * - */ - __pyx_v_t3 = (__pyx_v_t2 * __pyx_v_t); - - /* "rabbyt/rabbyt._anims.pyx":621 - * t2 = t * t - * t3 = t2 * t - * return d.a*t3 + d.b*t2 + d.c*t + d.p0 # <<<<<<<<<<<<<< - * - * cdef class AnimStaticCubicBezier(Anim): - */ - __pyx_r = ((((__pyx_v_d->a * __pyx_v_t3) + (__pyx_v_d->b * __pyx_v_t2)) + (__pyx_v_d->c * __pyx_v_t)) + __pyx_v_d->p0); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_21AnimStaticCubicBezier_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_21AnimStaticCubicBezier_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - float __pyx_v_p0; - float __pyx_v_p1; - float __pyx_v_p2; - float __pyx_v_p3; - float __pyx_v_startt; - float __pyx_v_endt; - PyObject *__pyx_v_t = 0; - int __pyx_v_extend; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__p0,&__pyx_n_s__p1,&__pyx_n_s__p2,&__pyx_n_s__p3,&__pyx_n_s__startt,&__pyx_n_s__endt,&__pyx_n_s__t,&__pyx_n_s__extend,0}; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p0)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p1)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p2)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p3)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 4: - if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__startt)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 5: - if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endt)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 6: - if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__t)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 7: - if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__extend)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - values[6] = PyTuple_GET_ITEM(__pyx_args, 6); - values[7] = PyTuple_GET_ITEM(__pyx_args, 7); - } - __pyx_v_p0 = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_p0 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_p1 = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_p1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_p2 = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_p2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_p3 = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_p3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_startt = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_startt == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_endt = __pyx_PyFloat_AsFloat(values[5]); if (unlikely((__pyx_v_endt == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_v_t = values[6]; - __pyx_v_extend = __Pyx_PyInt_AsInt(values[7]); if (unlikely((__pyx_v_extend == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimStaticCubicBezier.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_21AnimStaticCubicBezier___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *)__pyx_v_self), __pyx_v_p0, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3, __pyx_v_startt, __pyx_v_endt, __pyx_v_t, __pyx_v_extend); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":626 - * cdef static_bezier3_data_s _data - * - * def __init__(self, float p0, float p1, float p2, float p3, float startt, # <<<<<<<<<<<<<< - * float endt, t, int extend): - * self._data.p0 = p0 - */ - -static int __pyx_pf_6rabbyt_6_anims_21AnimStaticCubicBezier___init__(struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *__pyx_v_self, float __pyx_v_p0, float __pyx_v_p1, float __pyx_v_p2, float __pyx_v_p3, float __pyx_v_startt, float __pyx_v_endt, PyObject *__pyx_v_t, int __pyx_v_extend) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - float __pyx_t_3; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":628 - * def __init__(self, float p0, float p1, float p2, float p3, float startt, - * float endt, t, int extend): - * self._data.p0 = p0 # <<<<<<<<<<<<<< - * self._data.startt = startt - * self._data.endt = endt - */ - __pyx_v_self->_data.p0 = __pyx_v_p0; - - /* "rabbyt/rabbyt._anims.pyx":629 - * float endt, t, int extend): - * self._data.p0 = p0 - * self._data.startt = startt # <<<<<<<<<<<<<< - * self._data.endt = endt - * self._data.extend = extend - */ - __pyx_v_self->_data.startt = __pyx_v_startt; - - /* "rabbyt/rabbyt._anims.pyx":630 - * self._data.p0 = p0 - * self._data.startt = startt - * self._data.endt = endt # <<<<<<<<<<<<<< - * self._data.extend = extend - * if t is None: - */ - __pyx_v_self->_data.endt = __pyx_v_endt; - - /* "rabbyt/rabbyt._anims.pyx":631 - * self._data.startt = startt - * self._data.endt = endt - * self._data.extend = extend # <<<<<<<<<<<<<< - * if t is None: - * self._data.use_global_time = True - */ - __pyx_v_self->_data.extend = __pyx_v_extend; - - /* "rabbyt/rabbyt._anims.pyx":632 - * self._data.endt = endt - * self._data.extend = extend - * if t is None: # <<<<<<<<<<<<<< - * self._data.use_global_time = True - * self._data.one_over_dt = 1/(endt-startt) - */ - __pyx_t_1 = (__pyx_v_t == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":633 - * self._data.extend = extend - * if t is None: - * self._data.use_global_time = True # <<<<<<<<<<<<<< - * self._data.one_over_dt = 1/(endt-startt) - * else: - */ - __pyx_v_self->_data.use_global_time = 1; - - /* "rabbyt/rabbyt._anims.pyx":634 - * if t is None: - * self._data.use_global_time = True - * self._data.one_over_dt = 1/(endt-startt) # <<<<<<<<<<<<<< - * else: - * self._data.use_global_time = False - */ - __pyx_t_3 = ((float)(__pyx_v_endt - __pyx_v_startt)); - if (unlikely(__pyx_t_3 == 0)) { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_self->_data.one_over_dt = (1.0 / __pyx_t_3); - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":636 - * self._data.one_over_dt = 1/(endt-startt) - * else: - * self._data.use_global_time = False # <<<<<<<<<<<<<< - * self._data.one_over_dt = 1 - * self.add_dependency(t, &self._data.t) - */ - __pyx_v_self->_data.use_global_time = 0; - - /* "rabbyt/rabbyt._anims.pyx":637 - * else: - * self._data.use_global_time = False - * self._data.one_over_dt = 1 # <<<<<<<<<<<<<< - * self.add_dependency(t, &self._data.t) - * self._data.c = 3.0 * (p1 - p0) - */ - __pyx_v_self->_data.one_over_dt = 1.0; - - /* "rabbyt/rabbyt._anims.pyx":638 - * self._data.use_global_time = False - * self._data.one_over_dt = 1 - * self.add_dependency(t, &self._data.t) # <<<<<<<<<<<<<< - * self._data.c = 3.0 * (p1 - p0) - * self._data.b = 3.0 * (p2 - p1) - self._data.c - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_AnimStaticCubicBezier *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_t, (&__pyx_v_self->_data.t)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":639 - * self._data.one_over_dt = 1 - * self.add_dependency(t, &self._data.t) - * self._data.c = 3.0 * (p1 - p0) # <<<<<<<<<<<<<< - * self._data.b = 3.0 * (p2 - p1) - self._data.c - * self._data.a = p3 - p0 - self._data.c - self._data.b - */ - __pyx_v_self->_data.c = (3.0 * (__pyx_v_p1 - __pyx_v_p0)); - - /* "rabbyt/rabbyt._anims.pyx":640 - * self.add_dependency(t, &self._data.t) - * self._data.c = 3.0 * (p1 - p0) - * self._data.b = 3.0 * (p2 - p1) - self._data.c # <<<<<<<<<<<<<< - * self._data.a = p3 - p0 - self._data.c - self._data.b - * self._anim.func = _static_bezier3_func - */ - __pyx_v_self->_data.b = ((3.0 * (__pyx_v_p2 - __pyx_v_p1)) - __pyx_v_self->_data.c); - - /* "rabbyt/rabbyt._anims.pyx":641 - * self._data.c = 3.0 * (p1 - p0) - * self._data.b = 3.0 * (p2 - p1) - self._data.c - * self._data.a = p3 - p0 - self._data.c - self._data.b # <<<<<<<<<<<<<< - * self._anim.func = _static_bezier3_func - * self._anim.data = &self._data - */ - __pyx_v_self->_data.a = (((__pyx_v_p3 - __pyx_v_p0) - __pyx_v_self->_data.c) - __pyx_v_self->_data.b); - - /* "rabbyt/rabbyt._anims.pyx":642 - * self._data.b = 3.0 * (p2 - p1) - self._data.c - * self._data.a = p3 - p0 - self._data.c - self._data.b - * self._anim.func = _static_bezier3_func # <<<<<<<<<<<<<< - * self._anim.data = &self._data - * - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__static_bezier3_func); - - /* "rabbyt/rabbyt._anims.pyx":643 - * self._data.a = p3 - p0 - self._data.c - self._data.b - * self._anim.func = _static_bezier3_func - * self._anim.data = &self._data # <<<<<<<<<<<<<< - * - * cdef float g(self): - */ - __pyx_v_self->__pyx_base._anim.data = (&__pyx_v_self->_data); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimStaticCubicBezier.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":645 - * self._anim.data = &self._data - * - * cdef float g(self): # <<<<<<<<<<<<<< - * cdef float t, t2, t3 - * t = extend_t((_get_time()-self.startt)*self.one_over_dt, self.extend) - */ - -static float __pyx_f_6rabbyt_6_anims_21AnimStaticCubicBezier_g(struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *__pyx_v_self) { - float __pyx_v_t; - float __pyx_v_t2; - float __pyx_v_t3; - float __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - float __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("g", 0); - - /* "rabbyt/rabbyt._anims.pyx":647 - * cdef float g(self): - * cdef float t, t2, t3 - * t = extend_t((_get_time()-self.startt)*self.one_over_dt, self.extend) # <<<<<<<<<<<<<< - * t2 = t * t - * t3 = t2 * t - */ - __pyx_t_1 = PyFloat_FromDouble(_get_time()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__startt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__one_over_dt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_t = __pyx_f_6rabbyt_6_anims_extend_t(__pyx_t_4, __pyx_t_5); - - /* "rabbyt/rabbyt._anims.pyx":648 - * cdef float t, t2, t3 - * t = extend_t((_get_time()-self.startt)*self.one_over_dt, self.extend) - * t2 = t * t # <<<<<<<<<<<<<< - * t3 = t2 * t - * return self.a*t3 + self.b*t2 + self.c*t + self.p0 - */ - __pyx_v_t2 = (__pyx_v_t * __pyx_v_t); - - /* "rabbyt/rabbyt._anims.pyx":649 - * t = extend_t((_get_time()-self.startt)*self.one_over_dt, self.extend) - * t2 = t * t - * t3 = t2 * t # <<<<<<<<<<<<<< - * return self.a*t3 + self.b*t2 + self.c*t + self.p0 - * - */ - __pyx_v_t3 = (__pyx_v_t2 * __pyx_v_t); - - /* "rabbyt/rabbyt._anims.pyx":650 - * t2 = t * t - * t3 = t2 * t - * return self.a*t3 + self.b*t2 + self.c*t + self.p0 # <<<<<<<<<<<<<< - * - * cdef float _slot_reader_func(AnimSlot_s * slot): - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_t3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_t2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__c); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__p0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_WriteUnraisable("rabbyt._anims.AnimStaticCubicBezier.g", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":652 - * return self.a*t3 + self.b*t2 + self.c*t + self.p0 - * - * cdef float _slot_reader_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef float v - * READ_SLOT((slot.anim.data)[0], &v) - */ - -static float __pyx_f_6rabbyt_6_anims__slot_reader_func(AnimSlot_s *__pyx_v_slot) { - float __pyx_v_v; - float __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_slot_reader_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":654 - * cdef float _slot_reader_func(AnimSlot_s * slot): - * cdef float v - * READ_SLOT((slot.anim.data)[0], &v) # <<<<<<<<<<<<<< - * return v - * - */ - READ_SLOT((((AnimSlot_s **)__pyx_v_slot->anim->data)[0]), (&__pyx_v_v)); - - /* "rabbyt/rabbyt._anims.pyx":655 - * cdef float v - * READ_SLOT((slot.anim.data)[0], &v) - * return v # <<<<<<<<<<<<<< - * - * cdef class AnimSlotReader(Anim): - */ - __pyx_r = __pyx_v_v; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_14AnimSlotReader_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_14AnimSlotReader_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_read_slot = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__read_slot,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__read_slot)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_read_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)values[0]); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimSlotReader.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_read_slot), __pyx_ptype_6rabbyt_6_anims_AnimSlot, 0, "read_slot", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_pf_6rabbyt_6_anims_14AnimSlotReader___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *)__pyx_v_self), __pyx_v_read_slot); - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":659 - * cdef class AnimSlotReader(Anim): - * cdef AnimSlot read_slot - * def __init__(self, AnimSlot read_slot not None): # <<<<<<<<<<<<<< - * self.read_slot = read_slot - * cdef AnimSlot_s ** _slot - */ - -static int __pyx_pf_6rabbyt_6_anims_14AnimSlotReader___init__(struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *__pyx_v_self, struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_read_slot) { - AnimSlot_s **__pyx_v__slot; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":660 - * cdef AnimSlot read_slot - * def __init__(self, AnimSlot read_slot not None): - * self.read_slot = read_slot # <<<<<<<<<<<<<< - * cdef AnimSlot_s ** _slot - * _slot = &self.read_slot._slot - */ - __Pyx_INCREF(((PyObject *)__pyx_v_read_slot)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_read_slot)); - __Pyx_GOTREF(__pyx_v_self->read_slot); - __Pyx_DECREF(((PyObject *)__pyx_v_self->read_slot)); - __pyx_v_self->read_slot = __pyx_v_read_slot; - - /* "rabbyt/rabbyt._anims.pyx":662 - * self.read_slot = read_slot - * cdef AnimSlot_s ** _slot - * _slot = &self.read_slot._slot # <<<<<<<<<<<<<< - * self._anim.data = _slot - * self._anim.func = _slot_reader_func - */ - __pyx_v__slot = (&__pyx_v_self->read_slot->_slot); - - /* "rabbyt/rabbyt._anims.pyx":663 - * cdef AnimSlot_s ** _slot - * _slot = &self.read_slot._slot - * self._anim.data = _slot # <<<<<<<<<<<<<< - * self._anim.func = _slot_reader_func - * - */ - __pyx_v_self->__pyx_base._anim.data = __pyx_v__slot; - - /* "rabbyt/rabbyt._anims.pyx":664 - * _slot = &self.read_slot._slot - * self._anim.data = _slot - * self._anim.func = _slot_reader_func # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__slot_reader_func); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_8AnimWrap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_8AnimWrap_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_bounds = 0; - PyObject *__pyx_v_parent = 0; - PyObject *__pyx_v_static = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bounds,&__pyx_n_s__parent,&__pyx_n_s__static,0}; - PyObject* values[3] = {0,0,0}; - values[2] = __pyx_k_10; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bounds)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__static); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_bounds = values[0]; - __pyx_v_parent = values[1]; - __pyx_v_static = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimWrap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_8AnimWrap___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimWrap *)__pyx_v_self), __pyx_v_bounds, __pyx_v_parent, __pyx_v_static); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":692 - * - * - * def __init__(self, bounds, parent, static=True): # <<<<<<<<<<<<<< - * Anim.__init__(self) - * self.input_slot = AnimSlot() - */ - -static int __pyx_pf_6rabbyt_6_anims_8AnimWrap___init__(struct __pyx_obj_6rabbyt_6_anims_AnimWrap *__pyx_v_self, PyObject *__pyx_v_bounds, PyObject *__pyx_v_parent, PyObject *__pyx_v_static) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - float __pyx_t_5; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":693 - * - * def __init__(self, bounds, parent, static=True): - * Anim.__init__(self) # <<<<<<<<<<<<<< - * self.input_slot = AnimSlot() - * self.input_slot._slot = &self._data.input - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":694 - * def __init__(self, bounds, parent, static=True): - * Anim.__init__(self) - * self.input_slot = AnimSlot() # <<<<<<<<<<<<<< - * self.input_slot._slot = &self._data.input - * - */ - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimSlot)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_v_self->input_slot); - __Pyx_DECREF(((PyObject *)__pyx_v_self->input_slot)); - __pyx_v_self->input_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":695 - * Anim.__init__(self) - * self.input_slot = AnimSlot() - * self.input_slot._slot = &self._data.input # <<<<<<<<<<<<<< - * - * self.input_slot.anim = parent - */ - __pyx_v_self->input_slot->_slot = (&__pyx_v_self->_data.input); - - /* "rabbyt/rabbyt._anims.pyx":697 - * self.input_slot._slot = &self._data.input - * - * self.input_slot.anim = parent # <<<<<<<<<<<<<< - * - * self._anim.data = &(self._data) - */ - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->input_slot), __pyx_n_s__anim, __pyx_v_parent) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":699 - * self.input_slot.anim = parent - * - * self._anim.data = &(self._data) # <<<<<<<<<<<<<< - * if static: - * self._data.a = bounds[0] - */ - __pyx_v_self->__pyx_base._anim.data = (&__pyx_v_self->_data); - - /* "rabbyt/rabbyt._anims.pyx":700 - * - * self._anim.data = &(self._data) - * if static: # <<<<<<<<<<<<<< - * self._data.a = bounds[0] - * self._data.b = bounds[1] - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_static); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._anims.pyx":701 - * self._anim.data = &(self._data) - * if static: - * self._data.a = bounds[0] # <<<<<<<<<<<<<< - * self._data.b = bounds[1] - * else: - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_self->_data.a = __pyx_t_5; - - /* "rabbyt/rabbyt._anims.pyx":702 - * if static: - * self._data.a = bounds[0] - * self._data.b = bounds[1] # <<<<<<<<<<<<<< - * else: - * raise NotImplementedError - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_bounds, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_self->_data.b = __pyx_t_5; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":704 - * self._data.b = bounds[1] - * else: - * raise NotImplementedError # <<<<<<<<<<<<<< - * self.add_dependency(parent, &self._data.input) - * self._anim.func = _wrap_func - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":705 - * else: - * raise NotImplementedError - * self.add_dependency(parent, &self._data.input) # <<<<<<<<<<<<<< - * self._anim.func = _wrap_func - * - */ - __pyx_t_6 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_AnimWrap *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_parent, (&__pyx_v_self->_data.input)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":706 - * raise NotImplementedError - * self.add_dependency(parent, &self._data.input) - * self._anim.func = _wrap_func # <<<<<<<<<<<<<< - * - * cdef float _wrap_func(AnimSlot_s * slot): - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__wrap_func); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.AnimWrap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":708 - * self._anim.func = _wrap_func - * - * cdef float _wrap_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef wrap_data * data - * data = (slot.anim.data) - */ - -static float __pyx_f_6rabbyt_6_anims__wrap_func(AnimSlot_s *__pyx_v_slot) { - struct __pyx_t_6rabbyt_6_anims_wrap_data *__pyx_v_data; - float __pyx_v_b1; - float __pyx_v_b2; - float __pyx_v_d; - float __pyx_v_p; - float __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("_wrap_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":710 - * cdef float _wrap_func(AnimSlot_s * slot): - * cdef wrap_data * data - * data = (slot.anim.data) # <<<<<<<<<<<<<< - * cdef float b1, b2, d - * b1 = data.a - */ - __pyx_v_data = ((struct __pyx_t_6rabbyt_6_anims_wrap_data *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":712 - * data = (slot.anim.data) - * cdef float b1, b2, d - * b1 = data.a # <<<<<<<<<<<<<< - * b2 = data.b - * cdef float p - */ - __pyx_t_1 = __pyx_v_data->a; - __pyx_v_b1 = __pyx_t_1; - - /* "rabbyt/rabbyt._anims.pyx":713 - * cdef float b1, b2, d - * b1 = data.a - * b2 = data.b # <<<<<<<<<<<<<< - * cdef float p - * READ_SLOT(&data.input, &p) - */ - __pyx_t_1 = __pyx_v_data->b; - __pyx_v_b2 = __pyx_t_1; - - /* "rabbyt/rabbyt._anims.pyx":715 - * b2 = data.b - * cdef float p - * READ_SLOT(&data.input, &p) # <<<<<<<<<<<<<< - * - * d = b2 - b1 - */ - READ_SLOT((&__pyx_v_data->input), (&__pyx_v_p)); - - /* "rabbyt/rabbyt._anims.pyx":717 - * READ_SLOT(&data.input, &p) - * - * d = b2 - b1 # <<<<<<<<<<<<<< - * - * p = fmodf(p-fmodf(b1,d), d) - */ - __pyx_v_d = (__pyx_v_b2 - __pyx_v_b1); - - /* "rabbyt/rabbyt._anims.pyx":719 - * d = b2 - b1 - * - * p = fmodf(p-fmodf(b1,d), d) # <<<<<<<<<<<<<< - * if p < 0: - * p = p + d - */ - __pyx_v_p = fmodf((__pyx_v_p - fmodf(__pyx_v_b1, __pyx_v_d)), __pyx_v_d); - - /* "rabbyt/rabbyt._anims.pyx":720 - * - * p = fmodf(p-fmodf(b1,d), d) - * if p < 0: # <<<<<<<<<<<<<< - * p = p + d - * - */ - __pyx_t_2 = ((__pyx_v_p < 0.0) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._anims.pyx":721 - * p = fmodf(p-fmodf(b1,d), d) - * if p < 0: - * p = p + d # <<<<<<<<<<<<<< - * - * return p + b1 - */ - __pyx_v_p = (__pyx_v_p + __pyx_v_d); - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":723 - * p = p + d - * - * return p + b1 # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = (__pyx_v_p + __pyx_v_b1); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":729 - * AnimSlot_s a, b - * - * cdef float _add_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef float a, b - * cdef op_data * data - */ - -static float __pyx_f_6rabbyt_6_anims__add_func(AnimSlot_s *__pyx_v_slot) { - float __pyx_v_a; - float __pyx_v_b; - struct __pyx_t_6rabbyt_6_anims_op_data *__pyx_v_data; - float __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_add_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":732 - * cdef float a, b - * cdef op_data * data - * data = (slot.anim.data) # <<<<<<<<<<<<<< - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - */ - __pyx_v_data = ((struct __pyx_t_6rabbyt_6_anims_op_data *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":733 - * cdef op_data * data - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) # <<<<<<<<<<<<<< - * READ_SLOT(&data.b, &b) - * return a + b - */ - READ_SLOT((&__pyx_v_data->a), (&__pyx_v_a)); - - /* "rabbyt/rabbyt._anims.pyx":734 - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) # <<<<<<<<<<<<<< - * return a + b - * - */ - READ_SLOT((&__pyx_v_data->b), (&__pyx_v_b)); - - /* "rabbyt/rabbyt._anims.pyx":735 - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - * return a + b # <<<<<<<<<<<<<< - * - * cdef float _sub_func(AnimSlot_s * slot): - */ - __pyx_r = (__pyx_v_a + __pyx_v_b); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":737 - * return a + b - * - * cdef float _sub_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef float a, b - * cdef op_data * data - */ - -static float __pyx_f_6rabbyt_6_anims__sub_func(AnimSlot_s *__pyx_v_slot) { - float __pyx_v_a; - float __pyx_v_b; - struct __pyx_t_6rabbyt_6_anims_op_data *__pyx_v_data; - float __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_sub_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":740 - * cdef float a, b - * cdef op_data * data - * data = (slot.anim.data) # <<<<<<<<<<<<<< - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - */ - __pyx_v_data = ((struct __pyx_t_6rabbyt_6_anims_op_data *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":741 - * cdef op_data * data - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) # <<<<<<<<<<<<<< - * READ_SLOT(&data.b, &b) - * return a - b - */ - READ_SLOT((&__pyx_v_data->a), (&__pyx_v_a)); - - /* "rabbyt/rabbyt._anims.pyx":742 - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) # <<<<<<<<<<<<<< - * return a - b - * - */ - READ_SLOT((&__pyx_v_data->b), (&__pyx_v_b)); - - /* "rabbyt/rabbyt._anims.pyx":743 - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - * return a - b # <<<<<<<<<<<<<< - * - * cdef float _mul_func(AnimSlot_s * slot): - */ - __pyx_r = (__pyx_v_a - __pyx_v_b); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":745 - * return a - b - * - * cdef float _mul_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef float a, b - * cdef op_data * data - */ - -static float __pyx_f_6rabbyt_6_anims__mul_func(AnimSlot_s *__pyx_v_slot) { - float __pyx_v_a; - float __pyx_v_b; - struct __pyx_t_6rabbyt_6_anims_op_data *__pyx_v_data; - float __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_mul_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":748 - * cdef float a, b - * cdef op_data * data - * data = (slot.anim.data) # <<<<<<<<<<<<<< - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - */ - __pyx_v_data = ((struct __pyx_t_6rabbyt_6_anims_op_data *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":749 - * cdef op_data * data - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) # <<<<<<<<<<<<<< - * READ_SLOT(&data.b, &b) - * return a * b - */ - READ_SLOT((&__pyx_v_data->a), (&__pyx_v_a)); - - /* "rabbyt/rabbyt._anims.pyx":750 - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) # <<<<<<<<<<<<<< - * return a * b - * - */ - READ_SLOT((&__pyx_v_data->b), (&__pyx_v_b)); - - /* "rabbyt/rabbyt._anims.pyx":751 - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - * return a * b # <<<<<<<<<<<<<< - * - * cdef float _div_func(AnimSlot_s * slot): - */ - __pyx_r = (__pyx_v_a * __pyx_v_b); - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":753 - * return a * b - * - * cdef float _div_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef float a, b - * cdef op_data * data - */ - -static float __pyx_f_6rabbyt_6_anims__div_func(AnimSlot_s *__pyx_v_slot) { - float __pyx_v_a; - float __pyx_v_b; - struct __pyx_t_6rabbyt_6_anims_op_data *__pyx_v_data; - float __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_div_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":756 - * cdef float a, b - * cdef op_data * data - * data = (slot.anim.data) # <<<<<<<<<<<<<< - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - */ - __pyx_v_data = ((struct __pyx_t_6rabbyt_6_anims_op_data *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":757 - * cdef op_data * data - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) # <<<<<<<<<<<<<< - * READ_SLOT(&data.b, &b) - * return a / b - */ - READ_SLOT((&__pyx_v_data->a), (&__pyx_v_a)); - - /* "rabbyt/rabbyt._anims.pyx":758 - * data = (slot.anim.data) - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) # <<<<<<<<<<<<<< - * return a / b - * - */ - READ_SLOT((&__pyx_v_data->b), (&__pyx_v_b)); - - /* "rabbyt/rabbyt._anims.pyx":759 - * READ_SLOT(&data.a, &a) - * READ_SLOT(&data.b, &b) - * return a / b # <<<<<<<<<<<<<< - * - * - */ - if (unlikely(__pyx_v_b == 0)) { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_r = (__pyx_v_a / __pyx_v_b); - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_WriteUnraisable("rabbyt._anims._div_func", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_operation = 0; - PyObject *__pyx_v_a = 0; - PyObject *__pyx_v_b = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__operation,&__pyx_n_s__a,&__pyx_n_s__b,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__operation)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__b)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - } - __pyx_v_operation = values[0]; - __pyx_v_a = values[1]; - __pyx_v_b = values[2]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.ArithmeticAnim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim___init__(((struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)__pyx_v_self), __pyx_v_operation, __pyx_v_a, __pyx_v_b); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":765 - * cdef op_data _data - * cdef public object operation_name - * def __init__(self, operation, a, b): # <<<<<<<<<<<<<< - * Anim.__init__(self) - * self.add_dependency(a, &self._data.a) - */ - -static int __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim___init__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self, PyObject *__pyx_v_operation, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":766 - * cdef public object operation_name - * def __init__(self, operation, a, b): - * Anim.__init__(self) # <<<<<<<<<<<<<< - * self.add_dependency(a, &self._data.a) - * self.add_dependency(b, &self._data.b) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":767 - * def __init__(self, operation, a, b): - * Anim.__init__(self) - * self.add_dependency(a, &self._data.a) # <<<<<<<<<<<<<< - * self.add_dependency(b, &self._data.b) - * - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_ArithmeticAnim *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_a, (&__pyx_v_self->_data.a)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":768 - * Anim.__init__(self) - * self.add_dependency(a, &self._data.a) - * self.add_dependency(b, &self._data.b) # <<<<<<<<<<<<<< - * - * self._anim.data = &(self._data) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_ArithmeticAnim *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_b, (&__pyx_v_self->_data.b)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":770 - * self.add_dependency(b, &self._data.b) - * - * self._anim.data = &(self._data) # <<<<<<<<<<<<<< - * - * if operation == "add": - */ - __pyx_v_self->__pyx_base._anim.data = (&__pyx_v_self->_data); - - /* "rabbyt/rabbyt._anims.pyx":772 - * self._anim.data = &(self._data) - * - * if operation == "add": # <<<<<<<<<<<<<< - * self._anim.func = _add_func - * elif operation == "sub": - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_operation, ((PyObject *)__pyx_n_s__add), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_5) { - - /* "rabbyt/rabbyt._anims.pyx":773 - * - * if operation == "add": - * self._anim.func = _add_func # <<<<<<<<<<<<<< - * elif operation == "sub": - * self._anim.func = _sub_func - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__add_func); - goto __pyx_L3; - } - - /* "rabbyt/rabbyt._anims.pyx":774 - * if operation == "add": - * self._anim.func = _add_func - * elif operation == "sub": # <<<<<<<<<<<<<< - * self._anim.func = _sub_func - * elif operation == "mul": - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_operation, ((PyObject *)__pyx_n_s__sub), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_5) { - - /* "rabbyt/rabbyt._anims.pyx":775 - * self._anim.func = _add_func - * elif operation == "sub": - * self._anim.func = _sub_func # <<<<<<<<<<<<<< - * elif operation == "mul": - * self._anim.func = _mul_func - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__sub_func); - goto __pyx_L3; - } - - /* "rabbyt/rabbyt._anims.pyx":776 - * elif operation == "sub": - * self._anim.func = _sub_func - * elif operation == "mul": # <<<<<<<<<<<<<< - * self._anim.func = _mul_func - * elif operation == "div": - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_operation, ((PyObject *)__pyx_n_s__mul), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_5) { - - /* "rabbyt/rabbyt._anims.pyx":777 - * self._anim.func = _sub_func - * elif operation == "mul": - * self._anim.func = _mul_func # <<<<<<<<<<<<<< - * elif operation == "div": - * self._anim.func = _div_func - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__mul_func); - goto __pyx_L3; - } - - /* "rabbyt/rabbyt._anims.pyx":778 - * elif operation == "mul": - * self._anim.func = _mul_func - * elif operation == "div": # <<<<<<<<<<<<<< - * self._anim.func = _div_func - * else: - */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_operation, ((PyObject *)__pyx_n_s__div), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_5) { - - /* "rabbyt/rabbyt._anims.pyx":779 - * self._anim.func = _mul_func - * elif operation == "div": - * self._anim.func = _div_func # <<<<<<<<<<<<<< - * else: - * raise ValueError("Unknown arithmetic operation") - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__div_func); - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":781 - * self._anim.func = _div_func - * else: - * raise ValueError("Unknown arithmetic operation") # <<<<<<<<<<<<<< - * - * self.operation_name = operation - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":783 - * raise ValueError("Unknown arithmetic operation") - * - * self.operation_name = operation # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __Pyx_INCREF(__pyx_v_operation); - __Pyx_GIVEREF(__pyx_v_operation); - __Pyx_GOTREF(__pyx_v_self->operation_name); - __Pyx_DECREF(__pyx_v_self->operation_name); - __pyx_v_self->operation_name = __pyx_v_operation; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.ArithmeticAnim.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_3__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_3__repr__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_2__repr__(((struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":785 - * self.operation_name = operation - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "" % self.operation_name - * - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_2__repr__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 0); - - /* "rabbyt/rabbyt._anims.pyx":786 - * - * def __repr__(self): - * return "" % self.operation_name # <<<<<<<<<<<<<< - * - * cdef struct _py_func_data: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_v_self->operation_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.ArithmeticAnim.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name___get__(((struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":764 - * cdef class ArithmeticAnim(Anim): - * cdef op_data _data - * cdef public object operation_name # <<<<<<<<<<<<<< - * def __init__(self, operation, a, b): - * Anim.__init__(self) - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name___get__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self->operation_name); - __pyx_r = __pyx_v_self->operation_name; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_2__set__(((struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_2__set__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->operation_name); - __Pyx_DECREF(__pyx_v_self->operation_name); - __pyx_v_self->operation_name = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_4__del__(((struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_4__del__(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->operation_name); - __Pyx_DECREF(__pyx_v_self->operation_name); - __pyx_v_self->operation_name = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":793 - * int do_cache - * - * cdef float _py_func_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef object function - * cdef _py_func_data * d - */ - -static float __pyx_f_6rabbyt_6_anims__py_func_func(AnimSlot_s *__pyx_v_slot) { - PyObject *__pyx_v_function = 0; - struct __pyx_t_6rabbyt_6_anims__py_func_data *__pyx_v_d; - float __pyx_v_v; - float __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - float __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_py_func_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":797 - * cdef _py_func_data * d - * cdef float v - * d = <_py_func_data *>(slot.anim.data) # <<<<<<<<<<<<<< - * function = d.function - * # TODO caching - */ - __pyx_v_d = ((struct __pyx_t_6rabbyt_6_anims__py_func_data *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":798 - * cdef float v - * d = <_py_func_data *>(slot.anim.data) - * function = d.function # <<<<<<<<<<<<<< - * # TODO caching - * v = function() - */ - __Pyx_INCREF(((PyObject *)__pyx_v_d->function)); - __pyx_v_function = ((PyObject *)__pyx_v_d->function); - - /* "rabbyt/rabbyt._anims.pyx":800 - * function = d.function - * # TODO caching - * v = function() # <<<<<<<<<<<<<< - * return v - * - */ - __pyx_t_1 = PyObject_Call(__pyx_v_function, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_v = __pyx_t_2; - - /* "rabbyt/rabbyt._anims.pyx":801 - * # TODO caching - * v = function() - * return v # <<<<<<<<<<<<<< - * - * cdef class AnimPyFunc(Anim): - */ - __pyx_r = __pyx_v_v; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_WriteUnraisable("rabbyt._anims._py_func_func", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_function); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_10AnimPyFunc_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_10AnimPyFunc_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_function = 0; - PyObject *__pyx_v_cache = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__function,&__pyx_n_s__cache,0}; - PyObject* values[2] = {0,0}; - values[1] = __pyx_k_14; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__function)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cache); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_function = values[0]; - __pyx_v_cache = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimPyFunc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_10AnimPyFunc___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *)__pyx_v_self), __pyx_v_function, __pyx_v_cache); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":819 - * cdef object function - * cdef _py_func_data _data - * def __init__(self, function, cache=False): # <<<<<<<<<<<<<< - * self.function = function - * self._anim.data = &(self._data) - */ - -static int __pyx_pf_6rabbyt_6_anims_10AnimPyFunc___init__(struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *__pyx_v_self, PyObject *__pyx_v_function, PyObject *__pyx_v_cache) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":820 - * cdef _py_func_data _data - * def __init__(self, function, cache=False): - * self.function = function # <<<<<<<<<<<<<< - * self._anim.data = &(self._data) - * - */ - __Pyx_INCREF(__pyx_v_function); - __Pyx_GIVEREF(__pyx_v_function); - __Pyx_GOTREF(__pyx_v_self->function); - __Pyx_DECREF(__pyx_v_self->function); - __pyx_v_self->function = __pyx_v_function; - - /* "rabbyt/rabbyt._anims.pyx":821 - * def __init__(self, function, cache=False): - * self.function = function - * self._anim.data = &(self._data) # <<<<<<<<<<<<<< - * - * # We're storing the function in two places, but only INCREF'ing once. - */ - __pyx_v_self->__pyx_base._anim.data = (&__pyx_v_self->_data); - - /* "rabbyt/rabbyt._anims.pyx":824 - * - * # We're storing the function in two places, but only INCREF'ing once. - * self._data.function = function # <<<<<<<<<<<<<< - * - * self._data.do_cache = cache - */ - __pyx_v_self->_data.function = ((void *)__pyx_v_function); - - /* "rabbyt/rabbyt._anims.pyx":826 - * self._data.function = function - * - * self._data.do_cache = cache # <<<<<<<<<<<<<< - * self._data.cache_time = -1 - * self._anim.func = _py_func_func - */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_cache); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->_data.do_cache = __pyx_t_1; - - /* "rabbyt/rabbyt._anims.pyx":827 - * - * self._data.do_cache = cache - * self._data.cache_time = -1 # <<<<<<<<<<<<<< - * self._anim.func = _py_func_func - * - */ - __pyx_v_self->_data.cache_time = -1.0; - - /* "rabbyt/rabbyt._anims.pyx":828 - * self._data.do_cache = cache - * self._data.cache_time = -1 - * self._anim.func = _py_func_func # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__py_func_func); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimPyFunc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9AnimProxy_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9AnimProxy_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_value = 0; - PyObject *__pyx_v_cache = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__value,&__pyx_n_s__cache,0}; - PyObject* values[2] = {0,0}; - values[1] = __pyx_k_15; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cache); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_value = values[0]; - __pyx_v_cache = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimProxy.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_9AnimProxy___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimProxy *)__pyx_v_self), __pyx_v_value, __pyx_v_cache); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":846 - * cdef float cache - * cdef float cache_time - * def __init__(self, value, cache=False): # <<<<<<<<<<<<<< - * AnimSlotReader.__init__(self, AnimSlot()) - * if cache == True: - */ - -static int __pyx_pf_6rabbyt_6_anims_9AnimProxy___init__(struct __pyx_obj_6rabbyt_6_anims_AnimProxy *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_cache) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":847 - * cdef float cache_time - * def __init__(self, value, cache=False): - * AnimSlotReader.__init__(self, AnimSlot()) # <<<<<<<<<<<<<< - * if cache == True: - * warnings.warn("AnimProxy currently doesn't support caching.", - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimSlotReader)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimSlot)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._anims.pyx":848 - * def __init__(self, value, cache=False): - * AnimSlotReader.__init__(self, AnimSlot()) - * if cache == True: # <<<<<<<<<<<<<< - * warnings.warn("AnimProxy currently doesn't support caching.", - * stacklevel=2) - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_cache, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._anims.pyx":849 - * AnimSlotReader.__init__(self, AnimSlot()) - * if cache == True: - * warnings.warn("AnimProxy currently doesn't support caching.", # <<<<<<<<<<<<<< - * stacklevel=2) - * self.cache_output = cache - */ - __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__warnings); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__stacklevel), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_17), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":851 - * warnings.warn("AnimProxy currently doesn't support caching.", - * stacklevel=2) - * self.cache_output = cache # <<<<<<<<<<<<<< - * self.value = value - * - */ - __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_cache); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->cache_output = __pyx_t_5; - - /* "rabbyt/rabbyt._anims.pyx":852 - * stacklevel=2) - * self.cache_output = cache - * self.value = value # <<<<<<<<<<<<<< - * - * property value: - */ - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__value, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.AnimProxy.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_9AnimProxy_5value_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_6_anims_9AnimProxy_5value_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9AnimProxy_5value___get__(((struct __pyx_obj_6rabbyt_6_anims_AnimProxy *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":860 - * You can assign another anim here, and it's value will be returned. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self.read_slot.value - * def __set__(self, value): - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_9AnimProxy_5value___get__(struct __pyx_obj_6rabbyt_6_anims_AnimProxy *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._anims.pyx":861 - * """ - * def __get__(self): - * return self.read_slot.value # <<<<<<<<<<<<<< - * def __set__(self, value): - * if PyNumber_Check(value): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.read_slot), __pyx_n_s__value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._anims.AnimProxy.value.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_9AnimProxy_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_9AnimProxy_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_9AnimProxy_5value_2__set__(((struct __pyx_obj_6rabbyt_6_anims_AnimProxy *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":862 - * def __get__(self): - * return self.read_slot.value - * def __set__(self, value): # <<<<<<<<<<<<<< - * if PyNumber_Check(value): - * self.read_slot._slot.type = SLOT_LOCAL - */ - -static int __pyx_pf_6rabbyt_6_anims_9AnimProxy_5value_2__set__(struct __pyx_obj_6rabbyt_6_anims_AnimProxy *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - float __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._anims.pyx":863 - * return self.read_slot.value - * def __set__(self, value): - * if PyNumber_Check(value): # <<<<<<<<<<<<<< - * self.read_slot._slot.type = SLOT_LOCAL - * self.read_slot._slot.local = value - */ - __pyx_t_1 = (PyNumber_Check(__pyx_v_value) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":864 - * def __set__(self, value): - * if PyNumber_Check(value): - * self.read_slot._slot.type = SLOT_LOCAL # <<<<<<<<<<<<<< - * self.read_slot._slot.local = value - * elif isinstance(value, (Anim, IncompleteAnimBase)): - */ - __pyx_v_self->__pyx_base.read_slot->_slot->type = SLOT_LOCAL; - - /* "rabbyt/rabbyt._anims.pyx":865 - * if PyNumber_Check(value): - * self.read_slot._slot.type = SLOT_LOCAL - * self.read_slot._slot.local = value # <<<<<<<<<<<<<< - * elif isinstance(value, (Anim, IncompleteAnimBase)): - * self.read_slot.anim = value - */ - __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->__pyx_base.read_slot->_slot->local = __pyx_t_2; - goto __pyx_L3; - } - - /* "rabbyt/rabbyt._anims.pyx":866 - * self.read_slot._slot.type = SLOT_LOCAL - * self.read_slot._slot.local = value - * elif isinstance(value, (Anim, IncompleteAnimBase)): # <<<<<<<<<<<<<< - * self.read_slot.anim = value - * elif callable(value): - */ - __Pyx_INCREF(__pyx_v_value); - __pyx_t_3 = __pyx_v_value; - __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_3, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)); - if (!__pyx_t_1) { - __pyx_t_4 = __Pyx_TypeCheck(__pyx_t_3, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_IncompleteAnimBase)); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_1; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = (__pyx_t_5 != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":867 - * self.read_slot._slot.local = value - * elif isinstance(value, (Anim, IncompleteAnimBase)): - * self.read_slot.anim = value # <<<<<<<<<<<<<< - * elif callable(value): - * self.read_slot.anim = AnimPyFunc(value) - */ - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.read_slot), __pyx_n_s__anim, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - - /* "rabbyt/rabbyt._anims.pyx":868 - * elif isinstance(value, (Anim, IncompleteAnimBase)): - * self.read_slot.anim = value - * elif callable(value): # <<<<<<<<<<<<<< - * self.read_slot.anim = AnimPyFunc(value) - * else: - */ - __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = (__pyx_t_1 != 0); - if (__pyx_t_5) { - - /* "rabbyt/rabbyt._anims.pyx":869 - * self.read_slot.anim = value - * elif callable(value): - * self.read_slot.anim = AnimPyFunc(value) # <<<<<<<<<<<<<< - * else: - * raise ValueError() - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimPyFunc)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.read_slot), __pyx_n_s__anim, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":871 - * self.read_slot.anim = AnimPyFunc(value) - * else: - * raise ValueError() # <<<<<<<<<<<<<< - * self.cache_time = 0 - * - */ - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":872 - * else: - * raise ValueError() - * self.cache_time = 0 # <<<<<<<<<<<<<< - * - * cdef struct rate_data: - */ - __pyx_v_self->cache_time = 0.0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rabbyt._anims.AnimProxy.value.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":878 - * float last, last_time, last_rate - * - * cdef float _rate_func(AnimSlot_s * slot): # <<<<<<<<<<<<<< - * cdef rate_data * d - * d = (slot.anim.data) - */ - -static float __pyx_f_6rabbyt_6_anims__rate_func(AnimSlot_s *__pyx_v_slot) { - struct __pyx_t_6rabbyt_6_anims_rate_data *__pyx_v_d; - float __pyx_v_v; - float __pyx_v_t; - float __pyx_v_dt; - float __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - float __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_rate_func", 0); - - /* "rabbyt/rabbyt._anims.pyx":880 - * cdef float _rate_func(AnimSlot_s * slot): - * cdef rate_data * d - * d = (slot.anim.data) # <<<<<<<<<<<<<< - * cdef float v, t, dt - * t = _get_time() - */ - __pyx_v_d = ((struct __pyx_t_6rabbyt_6_anims_rate_data *)__pyx_v_slot->anim->data); - - /* "rabbyt/rabbyt._anims.pyx":882 - * d = (slot.anim.data) - * cdef float v, t, dt - * t = _get_time() # <<<<<<<<<<<<<< - * if t == d.last_time: - * return d.last_rate - */ - __pyx_v_t = _get_time(); - - /* "rabbyt/rabbyt._anims.pyx":883 - * cdef float v, t, dt - * t = _get_time() - * if t == d.last_time: # <<<<<<<<<<<<<< - * return d.last_rate - * else: - */ - __pyx_t_1 = ((__pyx_v_t == __pyx_v_d->last_time) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._anims.pyx":884 - * t = _get_time() - * if t == d.last_time: - * return d.last_rate # <<<<<<<<<<<<<< - * else: - * READ_SLOT(&(d.target), &v) - */ - __pyx_r = __pyx_v_d->last_rate; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":886 - * return d.last_rate - * else: - * READ_SLOT(&(d.target), &v) # <<<<<<<<<<<<<< - * dt = t-d.last_time - * d.last_rate = (v-d.last)/dt - */ - READ_SLOT((&__pyx_v_d->target), (&__pyx_v_v)); - - /* "rabbyt/rabbyt._anims.pyx":887 - * else: - * READ_SLOT(&(d.target), &v) - * dt = t-d.last_time # <<<<<<<<<<<<<< - * d.last_rate = (v-d.last)/dt - * d.last = v - */ - __pyx_v_dt = (__pyx_v_t - __pyx_v_d->last_time); - - /* "rabbyt/rabbyt._anims.pyx":888 - * READ_SLOT(&(d.target), &v) - * dt = t-d.last_time - * d.last_rate = (v-d.last)/dt # <<<<<<<<<<<<<< - * d.last = v - * d.last_time = t - */ - __pyx_t_2 = (__pyx_v_v - __pyx_v_d->last); - if (unlikely(__pyx_v_dt == 0)) { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_d->last_rate = (__pyx_t_2 / __pyx_v_dt); - - /* "rabbyt/rabbyt._anims.pyx":889 - * dt = t-d.last_time - * d.last_rate = (v-d.last)/dt - * d.last = v # <<<<<<<<<<<<<< - * d.last_time = t - * return d.last_rate - */ - __pyx_v_d->last = __pyx_v_v; - - /* "rabbyt/rabbyt._anims.pyx":890 - * d.last_rate = (v-d.last)/dt - * d.last = v - * d.last_time = t # <<<<<<<<<<<<<< - * return d.last_rate - * - */ - __pyx_v_d->last_time = __pyx_v_t; - - /* "rabbyt/rabbyt._anims.pyx":891 - * d.last = v - * d.last_time = t - * return d.last_rate # <<<<<<<<<<<<<< - * - * cdef class AnimRate(Anim): - */ - __pyx_r = __pyx_v_d->last_rate; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_WriteUnraisable("rabbyt._anims._rate_func", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_6_anims_8AnimRate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_6_anims_8AnimRate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_target = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__target,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__target)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_target = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._anims.AnimRate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_6_anims_8AnimRate___init__(((struct __pyx_obj_6rabbyt_6_anims_AnimRate *)__pyx_v_self), __pyx_v_target); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":895 - * cdef class AnimRate(Anim): - * cdef rate_data _data - * def __init__(self, target): # <<<<<<<<<<<<<< - * Anim.__init__(self) - * self.add_dependency(target, &self._data.target) - */ - -static int __pyx_pf_6rabbyt_6_anims_8AnimRate___init__(struct __pyx_obj_6rabbyt_6_anims_AnimRate *__pyx_v_self, PyObject *__pyx_v_target) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "rabbyt/rabbyt._anims.pyx":896 - * cdef rate_data _data - * def __init__(self, target): - * Anim.__init__(self) # <<<<<<<<<<<<<< - * self.add_dependency(target, &self._data.target) - * READ_SLOT(&self._data.target, &self._data.last) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":897 - * def __init__(self, target): - * Anim.__init__(self) - * self.add_dependency(target, &self._data.target) # <<<<<<<<<<<<<< - * READ_SLOT(&self._data.target, &self._data.last) - * self._data.last_time = _get_time() - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6rabbyt_6_anims_AnimRate *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.add_dependency(((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_self), __pyx_v_target, (&__pyx_v_self->_data.target)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":898 - * Anim.__init__(self) - * self.add_dependency(target, &self._data.target) - * READ_SLOT(&self._data.target, &self._data.last) # <<<<<<<<<<<<<< - * self._data.last_time = _get_time() - * self._data.last_rate = 0 - */ - READ_SLOT((&__pyx_v_self->_data.target), (&__pyx_v_self->_data.last)); - - /* "rabbyt/rabbyt._anims.pyx":899 - * self.add_dependency(target, &self._data.target) - * READ_SLOT(&self._data.target, &self._data.last) - * self._data.last_time = _get_time() # <<<<<<<<<<<<<< - * self._data.last_rate = 0 - * self._anim.func = _rate_func - */ - __pyx_v_self->_data.last_time = _get_time(); - - /* "rabbyt/rabbyt._anims.pyx":900 - * READ_SLOT(&self._data.target, &self._data.last) - * self._data.last_time = _get_time() - * self._data.last_rate = 0 # <<<<<<<<<<<<<< - * self._anim.func = _rate_func - * self._anim.data = &self._data - */ - __pyx_v_self->_data.last_rate = 0.0; - - /* "rabbyt/rabbyt._anims.pyx":901 - * self._data.last_time = _get_time() - * self._data.last_rate = 0 - * self._anim.func = _rate_func # <<<<<<<<<<<<<< - * self._anim.data = &self._data - * - */ - __pyx_v_self->__pyx_base._anim.func = ((AnimFunc)__pyx_f_6rabbyt_6_anims__rate_func); - - /* "rabbyt/rabbyt._anims.pyx":902 - * self._data.last_rate = 0 - * self._anim.func = _rate_func - * self._anim.data = &self._data # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->__pyx_base._anim.data = ((void *)(&__pyx_v_self->_data)); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.AnimRate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_6_anims_7to_Anim(PyObject *__pyx_self, PyObject *__pyx_v_v); /*proto*/ -static char __pyx_doc_6rabbyt_6_anims_6to_Anim[] = "\n ``to_Anim(value) -> Anim subclass instance``\n\n *This function is deprecated, and will eventually be removed.*\n\n This is a convenience function to get ``Anim`` for a value.\n\n If ``value`` is already an ``Anim``, it is returned directly.\n\n If ``value`` is callable, it is wrapped in an ``AnimPyFunc``.\n\n Otherwise, ``value`` is wrapped in an ``AnimConst``.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_6_anims_7to_Anim = {__Pyx_NAMESTR("to_Anim"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_7to_Anim, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_6_anims_6to_Anim)}; -static PyObject *__pyx_pw_6rabbyt_6_anims_7to_Anim(PyObject *__pyx_self, PyObject *__pyx_v_v) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("to_Anim (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_6_anims_6to_Anim(__pyx_self, ((PyObject *)__pyx_v_v)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._anims.pyx":905 - * - * - * def to_Anim(v): # <<<<<<<<<<<<<< - * """ - * ``to_Anim(value) -> Anim subclass instance`` - */ - -static PyObject *__pyx_pf_6rabbyt_6_anims_6to_Anim(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v) { - struct __pyx_obj_6rabbyt_6_anims_Anim *__pyx_v_dv = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("to_Anim", 0); - - /* "rabbyt/rabbyt._anims.pyx":919 - * Otherwise, ``value`` is wrapped in an ``AnimConst``. - * """ - * warnings.warn("to_Anim() is deprecated", stacklevel=2) # <<<<<<<<<<<<<< - * cdef Anim dv - * if isinstance(v, Anim): - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__stacklevel), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_19), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._anims.pyx":921 - * warnings.warn("to_Anim() is deprecated", stacklevel=2) - * cdef Anim dv - * if isinstance(v, Anim): # <<<<<<<<<<<<<< - * dv = v - * elif callable(v): - */ - __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_v, ((PyObject*)__pyx_ptype_6rabbyt_6_anims_Anim)); - __pyx_t_5 = (__pyx_t_4 != 0); - if (__pyx_t_5) { - - /* "rabbyt/rabbyt._anims.pyx":922 - * cdef Anim dv - * if isinstance(v, Anim): - * dv = v # <<<<<<<<<<<<<< - * elif callable(v): - * dv = AnimPyFunc(v) - */ - if (!(likely(((__pyx_v_v) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_v, __pyx_ptype_6rabbyt_6_anims_Anim))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_v); - __pyx_v_dv = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_v_v); - goto __pyx_L3; - } - - /* "rabbyt/rabbyt._anims.pyx":923 - * if isinstance(v, Anim): - * dv = v - * elif callable(v): # <<<<<<<<<<<<<< - * dv = AnimPyFunc(v) - * else: - */ - __pyx_t_5 = __Pyx_PyCallable_Check(__pyx_v_v); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = (__pyx_t_5 != 0); - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._anims.pyx":924 - * dv = v - * elif callable(v): - * dv = AnimPyFunc(v) # <<<<<<<<<<<<<< - * else: - * dv = AnimConst(v) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_v); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_v); - __Pyx_GIVEREF(__pyx_v_v); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimPyFunc)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_v_dv = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._anims.pyx":926 - * dv = AnimPyFunc(v) - * else: - * dv = AnimConst(v) # <<<<<<<<<<<<<< - * return dv - * - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_v); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_v); - __Pyx_GIVEREF(__pyx_v_v); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_6_anims_AnimConst)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_dv = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)__pyx_t_3); - __pyx_t_3 = 0; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._anims.pyx":927 - * else: - * dv = AnimConst(v) - * return dv # <<<<<<<<<<<<<< - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_dv)); - __pyx_r = ((PyObject *)__pyx_v_dv); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._anims.to_Anim", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_dv); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_6rabbyt_6_anims_Anim __pyx_vtable_6rabbyt_6_anims_Anim; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_Anim(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_Anim *p; - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)o); - p->__pyx_vtab = __pyx_vtabptr_6rabbyt_6_anims_Anim; - p->dependencies = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_Anim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_Anim *p = (struct __pyx_obj_6rabbyt_6_anims_Anim *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->dependencies); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_Anim(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_Anim *p = (struct __pyx_obj_6rabbyt_6_anims_Anim *)o; - if (p->dependencies) { - e = (*v)(p->dependencies, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_Anim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_Anim *p = (struct __pyx_obj_6rabbyt_6_anims_Anim *)o; - PyObject* tmp; - tmp = ((PyObject*)p->dependencies); - p->dependencies = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_Anim[] = { - {__Pyx_NAMESTR("get_value"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_4Anim_15get_value, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_4Anim_17get, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_Anim = { - __pyx_pw_6rabbyt_6_anims_4Anim_3__add__, /*nb_add*/ - __pyx_pw_6rabbyt_6_anims_4Anim_5__sub__, /*nb_subtract*/ - __pyx_pw_6rabbyt_6_anims_4Anim_7__mul__, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - __pyx_pw_6rabbyt_6_anims_4Anim_9__div__, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - __pyx_pw_6rabbyt_6_anims_4Anim_11__neg__, /*nb_negative*/ - __pyx_pw_6rabbyt_6_anims_4Anim_13__pos__, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_Anim = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.Anim"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_Anim), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_Anim, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - &__pyx_tp_as_number_Anim, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n ``Anim()``\n\n This is the base class for anims. It shouldn't be instanced directly.\n\n Performing arithmetic operations on an anim will result in a new anim that\n will allways be up to date.\n "), /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_Anim, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_Anim, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_Anim, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_4Anim_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_Anim, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlotReader __pyx_vtable_6rabbyt_6_anims_AnimSlotReader; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimSlotReader(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimSlotReader; - p->read_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_AnimSlotReader(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *p = (struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->read_slot); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_6_anims_Anim(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_AnimSlotReader(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *p = (struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *)o; - e = __pyx_tp_traverse_6rabbyt_6_anims_Anim(o, v, a); if (e) return e; - if (p->read_slot) { - e = (*v)(((PyObject*)p->read_slot), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_AnimSlotReader(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *p = (struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_6_anims_Anim(o); - tmp = ((PyObject*)p->read_slot); - p->read_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimSlotReader[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimSlotReader = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimSlotReader"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimSlotReader), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_AnimSlotReader, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_AnimSlotReader, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_AnimSlotReader, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimSlotReader, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_14AnimSlotReader_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimSlotReader, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimProxy __pyx_vtable_6rabbyt_6_anims_AnimProxy; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimProxy(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimProxy *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_AnimSlotReader(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimProxy *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimProxy; - return o; -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_9AnimProxy_value(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_9AnimProxy_5value_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_9AnimProxy_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_9AnimProxy_5value_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimProxy[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_AnimProxy[] = { - {(char *)"value", __pyx_getprop_6rabbyt_6_anims_9AnimProxy_value, __pyx_setprop_6rabbyt_6_anims_9AnimProxy_value, __Pyx_DOCSTR(__pyx_k_20), 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimProxy = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimProxy"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimProxy), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_AnimSlotReader, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n ``AnimProxy(value, cache=False)``\n\n An anim that simply returns the value of another anim.\n\n ``value`` is the value that can be returned. It can be a number, a\n function, or another anim.\n\n If ``cache`` is True, a cached value will be called when the anim is\n accessed a second time without the global time changing.\n "), /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_AnimSlotReader, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_AnimSlotReader, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimProxy, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_AnimProxy, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_9AnimProxy_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimProxy, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_ArithmeticAnim __pyx_vtable_6rabbyt_6_anims_ArithmeticAnim; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_ArithmeticAnim(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_ArithmeticAnim; - p->operation_name = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_ArithmeticAnim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *p = (struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->operation_name); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_6_anims_Anim(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_ArithmeticAnim(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *p = (struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)o; - e = __pyx_tp_traverse_6rabbyt_6_anims_Anim(o, v, a); if (e) return e; - if (p->operation_name) { - e = (*v)(p->operation_name, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_ArithmeticAnim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *p = (struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_6_anims_Anim(o); - tmp = ((PyObject*)p->operation_name); - p->operation_name = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_14ArithmeticAnim_operation_name(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_14ArithmeticAnim_operation_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_3__set__(o, v); - } - else { - return __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_14operation_name_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_ArithmeticAnim[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_ArithmeticAnim[] = { - {(char *)"operation_name", __pyx_getprop_6rabbyt_6_anims_14ArithmeticAnim_operation_name, __pyx_setprop_6rabbyt_6_anims_14ArithmeticAnim_operation_name, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_ArithmeticAnim = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.ArithmeticAnim"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_ArithmeticAnim), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_ArithmeticAnim, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_3__repr__, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_ArithmeticAnim, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_ArithmeticAnim, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_ArithmeticAnim, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_ArithmeticAnim, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_14ArithmeticAnim_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_ArithmeticAnim, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot __pyx_vtable_6rabbyt_6_anims_AnimSlot; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimSlot(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *p; - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)o); - p->__pyx_vtab = __pyx_vtabptr_6rabbyt_6_anims_AnimSlot; - p->_py_anim = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_AnimSlot(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *p = (struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->_py_anim); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_AnimSlot(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *p = (struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)o; - if (p->_py_anim) { - e = (*v)(((PyObject*)p->_py_anim), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_AnimSlot(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *p = (struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)o; - PyObject* tmp; - tmp = ((PyObject*)p->_py_anim); - p->_py_anim = ((struct __pyx_obj_6rabbyt_6_anims_Anim *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_8AnimSlot_anim(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_8AnimSlot_4anim_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_8AnimSlot_anim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_8AnimSlot_4anim_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_8AnimSlot_value(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_8AnimSlot_5value_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_8AnimSlot_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_8AnimSlot_5value_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimSlot[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_AnimSlot[] = { - {(char *)"anim", __pyx_getprop_6rabbyt_6_anims_8AnimSlot_anim, __pyx_setprop_6rabbyt_6_anims_8AnimSlot_anim, 0, 0}, - {(char *)"value", __pyx_getprop_6rabbyt_6_anims_8AnimSlot_value, __pyx_setprop_6rabbyt_6_anims_8AnimSlot_value, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimSlot = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimSlot"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimSlot), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_AnimSlot, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_AnimSlot, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_AnimSlot, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimSlot, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_AnimSlot, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_8AnimSlot_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimSlot, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimPointer __pyx_vtable_6rabbyt_6_anims_AnimPointer; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimPointer(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimPointer *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimPointer *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimPointer; - p->_owner = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_AnimPointer(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimPointer *p = (struct __pyx_obj_6rabbyt_6_anims_AnimPointer *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->_owner); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_6_anims_Anim(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_AnimPointer(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_AnimPointer *p = (struct __pyx_obj_6rabbyt_6_anims_AnimPointer *)o; - e = __pyx_tp_traverse_6rabbyt_6_anims_Anim(o, v, a); if (e) return e; - if (p->_owner) { - e = (*v)(p->_owner, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_AnimPointer(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimPointer *p = (struct __pyx_obj_6rabbyt_6_anims_AnimPointer *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_6_anims_Anim(o); - tmp = ((PyObject*)p->_owner); - p->_owner = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_11AnimPointer_owner(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_11AnimPointer_5owner_1__get__(o); -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimPointer[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_AnimPointer[] = { - {(char *)"owner", __pyx_getprop_6rabbyt_6_anims_11AnimPointer_owner, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimPointer = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimPointer"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimPointer), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_AnimPointer, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n ``AnimPointer(pointer, [owner])``\n\n An anim that reads it's value from a memory address.\n\n ``pointer`` should either be a ctypes pointer object or the memory address\n as an integer.\n\n If ``owner`` is given, a reference to it will be held for the lifetime of\n the anim. Pass the owner of the memory that ``pointer`` points to to\n insure that it won't be deleted before this anim is deleted. (You risk\n getting a segmentation fault otherwise. Nasty!)\n\n ``owner`` defaults to be the same as ``pointer``, which is probably what\n you want if ``pointer`` is a ctypes pointer. But if it's an integer you\n should give ``owner`` explicitly.\n\n The pointer must point to a C float. (If it's anything else you'll get\n some crazy results!)\n "), /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_AnimPointer, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_AnimPointer, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimPointer, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_AnimPointer, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_11AnimPointer_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimPointer, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_InterpolateAnim __pyx_vtable_6rabbyt_6_anims_InterpolateAnim; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_InterpolateAnim(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_InterpolateAnim; - p->method_name = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_InterpolateAnim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *p = (struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->method_name); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_6_anims_Anim(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_InterpolateAnim(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *p = (struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)o; - e = __pyx_tp_traverse_6rabbyt_6_anims_Anim(o, v, a); if (e) return e; - if (p->method_name) { - e = (*v)(p->method_name, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_InterpolateAnim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *p = (struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_6_anims_Anim(o); - tmp = ((PyObject*)p->method_name); - p->method_name = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_start(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_5start_1__get__(o); -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_end(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_3end_1__get__(o); -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_startt(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_6startt_1__get__(o); -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_endt(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_4endt_1__get__(o); -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_dt(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_2dt_1__get__(o); -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_end_time(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_8end_time_1__get__(o); -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_method_name(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_15InterpolateAnim_method_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_3__set__(o, v); - } - else { - return __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_11method_name_5__del__(o); - } -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_InterpolateAnim[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_InterpolateAnim[] = { - {(char *)"start", __pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_start, 0, 0, 0}, - {(char *)"end", __pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_end, 0, 0, 0}, - {(char *)"startt", __pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_startt, 0, 0, 0}, - {(char *)"endt", __pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_endt, 0, 0, 0}, - {(char *)"dt", __pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_dt, 0, 0, 0}, - {(char *)"end_time", __pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_end_time, 0, 0, 0}, - {(char *)"method_name", __pyx_getprop_6rabbyt_6_anims_15InterpolateAnim_method_name, __pyx_setprop_6rabbyt_6_anims_15InterpolateAnim_method_name, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_InterpolateAnim = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.InterpolateAnim"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_InterpolateAnim), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_InterpolateAnim, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_3__repr__, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_InterpolateAnim, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_InterpolateAnim, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_InterpolateAnim, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_InterpolateAnim, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_15InterpolateAnim_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_InterpolateAnim, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_IncompleteAnimBase(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_IncompleteAnimBase(PyObject *o) { - (*Py_TYPE(o)->tp_free)(o); -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_IncompleteAnimBase[] = { - {0, 0, 0, 0} -}; - -static PyNumberMethods __pyx_tp_as_number_IncompleteAnimBase = { - __pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_1__add__, /*nb_add*/ - __pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_3__sub__, /*nb_subtract*/ - __pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_5__mul__, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 - __pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_7__div__, /*nb_divide*/ - #endif - 0, /*nb_remainder*/ - 0, /*nb_divmod*/ - 0, /*nb_power*/ - __pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_9__neg__, /*nb_negative*/ - __pyx_pw_6rabbyt_6_anims_18IncompleteAnimBase_11__pos__, /*nb_positive*/ - 0, /*nb_absolute*/ - 0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_coerce*/ - #endif - 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif - 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 - 0, /*nb_hex*/ - #endif - 0, /*nb_inplace_add*/ - 0, /*nb_inplace_subtract*/ - 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 - 0, /*nb_inplace_divide*/ - #endif - 0, /*nb_inplace_remainder*/ - 0, /*nb_inplace_power*/ - 0, /*nb_inplace_lshift*/ - 0, /*nb_inplace_rshift*/ - 0, /*nb_inplace_and*/ - 0, /*nb_inplace_xor*/ - 0, /*nb_inplace_or*/ - 0, /*nb_floor_divide*/ - 0, /*nb_true_divide*/ - 0, /*nb_inplace_floor_divide*/ - 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 - 0, /*nb_index*/ - #endif -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_IncompleteAnimBase = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.IncompleteAnimBase"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_IncompleteAnimBase), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_IncompleteAnimBase, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - &__pyx_tp_as_number_IncompleteAnimBase, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("\n This class is only used for introspection. rabbyt.anims.IncompleteAnim is\n where the implementation is.\n "), /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_IncompleteAnimBase, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_IncompleteAnimBase, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimWrap __pyx_vtable_6rabbyt_6_anims_AnimWrap; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimWrap(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimWrap *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimWrap *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimWrap; - p->input_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_AnimWrap(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimWrap *p = (struct __pyx_obj_6rabbyt_6_anims_AnimWrap *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->input_slot); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_6_anims_Anim(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_AnimWrap(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_AnimWrap *p = (struct __pyx_obj_6rabbyt_6_anims_AnimWrap *)o; - e = __pyx_tp_traverse_6rabbyt_6_anims_Anim(o, v, a); if (e) return e; - if (p->input_slot) { - e = (*v)(((PyObject*)p->input_slot), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_AnimWrap(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimWrap *p = (struct __pyx_obj_6rabbyt_6_anims_AnimWrap *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_6_anims_Anim(o); - tmp = ((PyObject*)p->input_slot); - p->input_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimWrap[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimWrap = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimWrap"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimWrap), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_AnimWrap, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n ``AnimWrap(bounds, parent, static=True)``\n\n An anim that returns another anim wrapped within two bounds.\n\n You might want to use ``rabbyt.wrap()`` instead.\n\n ``bounds`` is the bounds that the value should be wrapped within. It can\n be anything supporting item access with a length of at least two.\n\n ``parent`` is the ``Anim`` that is being wrapped.\n\n If static is ``True``, ``bounds[0]`` and ``bounds[1]`` are read only once\n and stored as variables in c. This is much faster, but doesn't work if\n ``bounds`` is an object you wish to mutate.\n "), /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_AnimWrap, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_AnimWrap, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimWrap, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_8AnimWrap_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimWrap, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_anim_slot(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_anim_slot *p; - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_anim_slot *)o); - p->__doc__ = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_anim_slot(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_anim_slot *p = (struct __pyx_obj_6rabbyt_6_anims_anim_slot *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->__doc__); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_anim_slot(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_anim_slot *p = (struct __pyx_obj_6rabbyt_6_anims_anim_slot *)o; - if (p->__doc__) { - e = (*v)(p->__doc__, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_anim_slot(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_anim_slot *p = (struct __pyx_obj_6rabbyt_6_anims_anim_slot *)o; - PyObject* tmp; - tmp = ((PyObject*)p->__doc__); - p->__doc__ = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_tp_descr_get_6rabbyt_6_anims_anim_slot(PyObject *o, PyObject *i, PyObject *c) { - PyObject *r = 0; - if (!i) i = Py_None; - if (!c) c = Py_None; - r = __pyx_pw_6rabbyt_6_anims_9anim_slot_3__get__(o, i, c); - return r; -} - -static int __pyx_tp_descr_set_6rabbyt_6_anims_anim_slot(PyObject *o, PyObject *i, PyObject *v) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_5__set__(o, i, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__delete__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_9anim_slot_index(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_5index_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_9anim_slot_index(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_5index_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_9anim_slot_default_value(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_13default_value_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_9anim_slot_default_value(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_13default_value_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_9anim_slot___doc__(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___1__get__(o); -} - -static int __pyx_setprop_6rabbyt_6_anims_9anim_slot___doc__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___3__set__(o, v); - } - else { - return __pyx_pw_6rabbyt_6_anims_9anim_slot_7__doc___5__del__(o); - } -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_anim_slot[] = { - {__Pyx_NAMESTR("get_slot"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_9anim_slot_7get_slot, METH_O, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_anim_slot[] = { - {(char *)"index", __pyx_getprop_6rabbyt_6_anims_9anim_slot_index, __pyx_setprop_6rabbyt_6_anims_9anim_slot_index, 0, 0}, - {(char *)"default_value", __pyx_getprop_6rabbyt_6_anims_9anim_slot_default_value, __pyx_setprop_6rabbyt_6_anims_9anim_slot_default_value, 0, 0}, - {(char *)"__doc__", __pyx_getprop_6rabbyt_6_anims_9anim_slot___doc__, __pyx_setprop_6rabbyt_6_anims_9anim_slot___doc__, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_anim_slot = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.anim_slot"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_anim_slot), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_anim_slot, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n ``anim_slot([default], [doc], [index])``\n\n ``anim_slot`` is used to create a property that 'understands' anims. See\n the docs for ``Animable`` for usage.\n\n ``default`` is the default value for the anim slot. (It defaults to ``0``.)\n\n ``index`` is used for optimizing low-level C code. Only use it if you\n know what you are doing.\n\n ``anim_slot`` only works in ``Animable`` subclasses.\n "), /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_anim_slot, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_anim_slot, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_anim_slot, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_anim_slot, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - __pyx_tp_descr_get_6rabbyt_6_anims_anim_slot, /*tp_descr_get*/ - __pyx_tp_descr_set_6rabbyt_6_anims_anim_slot, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_9anim_slot_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_anim_slot, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable __pyx_vtable_6rabbyt_6_anims_cAnimable; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_cAnimable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_cAnimable *p; - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)o); - p->__pyx_vtab = __pyx_vtabptr_6rabbyt_6_anims_cAnimable; - p->_anim_list = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_cAnimable(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_cAnimable *p = (struct __pyx_obj_6rabbyt_6_anims_cAnimable *)o; - PyObject_GC_UnTrack(o); - { - PyObject *etype, *eval, *etb; - PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pw_6rabbyt_6_anims_9cAnimable_3__dealloc__(o); - if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); - PyErr_Restore(etype, eval, etb); - } - Py_CLEAR(p->_anim_list); - (*Py_TYPE(o)->tp_free)(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_cAnimable(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_cAnimable *p = (struct __pyx_obj_6rabbyt_6_anims_cAnimable *)o; - if (p->_anim_list) { - e = (*v)(p->_anim_list, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_cAnimable(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_cAnimable *p = (struct __pyx_obj_6rabbyt_6_anims_cAnimable *)o; - PyObject* tmp; - tmp = ((PyObject*)p->_anim_list); - p->_anim_list = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_9cAnimable_anim_slot_list(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_9cAnimable_14anim_slot_list_1__get__(o); -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_cAnimable[] = { - {__Pyx_NAMESTR("set_anim_slot_locations"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_9cAnimable_5set_anim_slot_locations, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("set_anim_slot_locations_in_array"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_9cAnimable_7set_anim_slot_locations_in_array, METH_O, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_cAnimable[] = { - {(char *)"anim_slot_list", __pyx_getprop_6rabbyt_6_anims_9cAnimable_anim_slot_list, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_cAnimable = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.cAnimable"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_cAnimable), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_cAnimable, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_cAnimable, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_cAnimable, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_cAnimable, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_cAnimable, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_9cAnimable_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_cAnimable, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimPyFunc __pyx_vtable_6rabbyt_6_anims_AnimPyFunc; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimPyFunc(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimPyFunc; - p->function = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_AnimPyFunc(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *p = (struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->function); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_6_anims_Anim(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_AnimPyFunc(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *p = (struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *)o; - e = __pyx_tp_traverse_6rabbyt_6_anims_Anim(o, v, a); if (e) return e; - if (p->function) { - e = (*v)(p->function, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_AnimPyFunc(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *p = (struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_6_anims_Anim(o); - tmp = ((PyObject*)p->function); - p->function = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimPyFunc[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimPyFunc = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimPyFunc"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimPyFunc), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_AnimPyFunc, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n ``AnimPyFunc(function, cache=False)``\n\n An anim that calls a python function, using the returned value.\n\n function is the callback called to retrieve the value. It should\n return a float.\n\n If ``cache`` is ``True``, the result returned by function will be\n cached for as long as the time (as set by ``rabbyt.set_time()``) doesn't\n change. This could provide good speedup if the value is read multiple\n times per frame.\n "), /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_AnimPyFunc, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_AnimPyFunc, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimPyFunc, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_10AnimPyFunc_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimPyFunc, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimConst __pyx_vtable_6rabbyt_6_anims_AnimConst; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimConst(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimConst *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimConst *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimConst; - return o; -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimConst[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimConst = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimConst"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimConst), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_Anim, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("\n ``AnimConst(value)``\n\n An anim that isn't animated.\n\n This is mostly here so that constant values can be used with the same\n interface as Anim. Once upon a time this made sense.\n "), /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_Anim, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_Anim, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimConst, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_9AnimConst_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimConst, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimStaticCubicBezier __pyx_vtable_6rabbyt_6_anims_AnimStaticCubicBezier; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimStaticCubicBezier(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimStaticCubicBezier; - return o; -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimStaticCubicBezier[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimStaticCubicBezier = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimStaticCubicBezier"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_Anim, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_Anim, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_Anim, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimStaticCubicBezier, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_21AnimStaticCubicBezier_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimStaticCubicBezier, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimRate __pyx_vtable_6rabbyt_6_anims_AnimRate; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_AnimRate(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_AnimRate *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_AnimRate *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_AnimRate; - return o; -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_AnimRate[] = { - {0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_AnimRate = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.AnimRate"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimRate), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_Anim, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_Anim, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_Anim, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_AnimRate, /*tp_methods*/ - 0, /*tp_members*/ - 0, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_8AnimRate_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_AnimRate, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_ChainAnim __pyx_vtable_6rabbyt_6_anims_ChainAnim; - -static PyObject *__pyx_tp_new_6rabbyt_6_anims_ChainAnim(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_6_anims_ChainAnim *p; - PyObject *o = __pyx_tp_new_6rabbyt_6_anims_Anim(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_6_anims_ChainAnim *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__pyx_vtabptr_6rabbyt_6_anims_ChainAnim; - p->_anims = Py_None; Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_6_anims_ChainAnim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_ChainAnim *p = (struct __pyx_obj_6rabbyt_6_anims_ChainAnim *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->_anims); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_6_anims_Anim(o); -} - -static int __pyx_tp_traverse_6rabbyt_6_anims_ChainAnim(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_6_anims_ChainAnim *p = (struct __pyx_obj_6rabbyt_6_anims_ChainAnim *)o; - e = __pyx_tp_traverse_6rabbyt_6_anims_Anim(o, v, a); if (e) return e; - if (p->_anims) { - e = (*v)(p->_anims, a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_6_anims_ChainAnim(PyObject *o) { - struct __pyx_obj_6rabbyt_6_anims_ChainAnim *p = (struct __pyx_obj_6rabbyt_6_anims_ChainAnim *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_6_anims_Anim(o); - tmp = ((PyObject*)p->_anims); - p->_anims = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_6_anims_9ChainAnim_anims(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_6_anims_9ChainAnim_5anims_1__get__(o); -} - -static PyMethodDef __pyx_methods_6rabbyt_6_anims_ChainAnim[] = { - {__Pyx_NAMESTR("__dealloc___"), (PyCFunction)__pyx_pw_6rabbyt_6_anims_9ChainAnim_3__dealloc___, METH_NOARGS, __Pyx_DOCSTR(0)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_6_anims_ChainAnim[] = { - {(char *)"anims", __pyx_getprop_6rabbyt_6_anims_9ChainAnim_anims, 0, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_6_anims_ChainAnim = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._anims.ChainAnim"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_6_anims_ChainAnim), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_6_anims_ChainAnim, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_6_anims_ChainAnim, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_6_anims_ChainAnim, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_6_anims_ChainAnim, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_6_anims_ChainAnim, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_6_anims_9ChainAnim_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_6_anims_ChainAnim, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - __Pyx_NAMESTR("_anims"), - __Pyx_DOCSTR(__pyx_k_21), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1}, - {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, - {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, - {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, - {&__pyx_n_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 1}, - {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, - {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, - {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0}, - {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1}, - {&__pyx_n_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 1}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, - {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____author__, __pyx_k____author__, sizeof(__pyx_k____author__), 0, 0, 1, 1}, - {&__pyx_n_s____base__, __pyx_k____base__, sizeof(__pyx_k____base__), 0, 0, 1, 1}, - {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1}, - {&__pyx_n_s____credits__, __pyx_k____credits__, sizeof(__pyx_k____credits__), 0, 0, 1, 1}, - {&__pyx_n_s____get__, __pyx_k____get__, sizeof(__pyx_k____get__), 0, 0, 1, 1}, - {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1}, - {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1}, - {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1}, - {&__pyx_n_s__add_time, __pyx_k__add_time, sizeof(__pyx_k__add_time), 0, 0, 1, 1}, - {&__pyx_n_s__addressof, __pyx_k__addressof, sizeof(__pyx_k__addressof), 0, 0, 1, 1}, - {&__pyx_n_s__anim, __pyx_k__anim, sizeof(__pyx_k__anim), 0, 0, 1, 1}, - {&__pyx_n_s__anims, __pyx_k__anims, sizeof(__pyx_k__anims), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1}, - {&__pyx_n_s__bounds, __pyx_k__bounds, sizeof(__pyx_k__bounds), 0, 0, 1, 1}, - {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 1, 1}, - {&__pyx_n_s__cache, __pyx_k__cache, sizeof(__pyx_k__cache), 0, 0, 1, 1}, - {&__pyx_n_s__constant, __pyx_k__constant, sizeof(__pyx_k__constant), 0, 0, 1, 1}, - {&__pyx_n_s__contents, __pyx_k__contents, sizeof(__pyx_k__contents), 0, 0, 1, 1}, - {&__pyx_n_s__ctypes, __pyx_k__ctypes, sizeof(__pyx_k__ctypes), 0, 0, 1, 1}, - {&__pyx_n_s__default, __pyx_k__default, sizeof(__pyx_k__default), 0, 0, 1, 1}, - {&__pyx_n_s__div, __pyx_k__div, sizeof(__pyx_k__div), 0, 0, 1, 1}, - {&__pyx_n_s__doc, __pyx_k__doc, sizeof(__pyx_k__doc), 0, 0, 1, 1}, - {&__pyx_n_s__dv, __pyx_k__dv, sizeof(__pyx_k__dv), 0, 0, 1, 1}, - {&__pyx_n_s__ease_back, __pyx_k__ease_back, sizeof(__pyx_k__ease_back), 0, 0, 1, 1}, - {&__pyx_n_s__ease_bounce, __pyx_k__ease_bounce, sizeof(__pyx_k__ease_bounce), 0, 0, 1, 1}, - {&__pyx_n_s__ease_circ, __pyx_k__ease_circ, sizeof(__pyx_k__ease_circ), 0, 0, 1, 1}, - {&__pyx_n_s__ease_cubic, __pyx_k__ease_cubic, sizeof(__pyx_k__ease_cubic), 0, 0, 1, 1}, - {&__pyx_n_s__ease_in_back, __pyx_k__ease_in_back, sizeof(__pyx_k__ease_in_back), 0, 0, 1, 1}, - {&__pyx_n_s__ease_in_bounce, __pyx_k__ease_in_bounce, sizeof(__pyx_k__ease_in_bounce), 0, 0, 1, 1}, - {&__pyx_n_s__ease_in_circ, __pyx_k__ease_in_circ, sizeof(__pyx_k__ease_in_circ), 0, 0, 1, 1}, - {&__pyx_n_s__ease_in_cubic, __pyx_k__ease_in_cubic, sizeof(__pyx_k__ease_in_cubic), 0, 0, 1, 1}, - {&__pyx_n_s__ease_in_exponential, __pyx_k__ease_in_exponential, sizeof(__pyx_k__ease_in_exponential), 0, 0, 1, 1}, - {&__pyx_n_s__ease_in_quad, __pyx_k__ease_in_quad, sizeof(__pyx_k__ease_in_quad), 0, 0, 1, 1}, - {&__pyx_n_s__ease_in_sine, __pyx_k__ease_in_sine, sizeof(__pyx_k__ease_in_sine), 0, 0, 1, 1}, - {&__pyx_n_s__ease_out_back, __pyx_k__ease_out_back, sizeof(__pyx_k__ease_out_back), 0, 0, 1, 1}, - {&__pyx_n_s__ease_out_bounce, __pyx_k__ease_out_bounce, sizeof(__pyx_k__ease_out_bounce), 0, 0, 1, 1}, - {&__pyx_n_s__ease_out_circ, __pyx_k__ease_out_circ, sizeof(__pyx_k__ease_out_circ), 0, 0, 1, 1}, - {&__pyx_n_s__ease_out_cubic, __pyx_k__ease_out_cubic, sizeof(__pyx_k__ease_out_cubic), 0, 0, 1, 1}, - {&__pyx_n_s__ease_out_quad, __pyx_k__ease_out_quad, sizeof(__pyx_k__ease_out_quad), 0, 0, 1, 1}, - {&__pyx_n_s__ease_out_sine, __pyx_k__ease_out_sine, sizeof(__pyx_k__ease_out_sine), 0, 0, 1, 1}, - {&__pyx_n_s__ease_quad, __pyx_k__ease_quad, sizeof(__pyx_k__ease_quad), 0, 0, 1, 1}, - {&__pyx_n_s__ease_sine, __pyx_k__ease_sine, sizeof(__pyx_k__ease_sine), 0, 0, 1, 1}, - {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1}, - {&__pyx_n_s__end_time, __pyx_k__end_time, sizeof(__pyx_k__end_time), 0, 0, 1, 1}, - {&__pyx_n_s__endt, __pyx_k__endt, sizeof(__pyx_k__endt), 0, 0, 1, 1}, - {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1}, - {&__pyx_n_s__extrapolate, __pyx_k__extrapolate, sizeof(__pyx_k__extrapolate), 0, 0, 1, 1}, - {&__pyx_n_s__force_complete, __pyx_k__force_complete, sizeof(__pyx_k__force_complete), 0, 0, 1, 1}, - {&__pyx_n_s__function, __pyx_k__function, sizeof(__pyx_k__function), 0, 0, 1, 1}, - {&__pyx_n_s__get_data_ptr_addr, __pyx_k__get_data_ptr_addr, sizeof(__pyx_k__get_data_ptr_addr), 0, 0, 1, 1}, - {&__pyx_n_s__get_data_stride, __pyx_k__get_data_stride, sizeof(__pyx_k__get_data_stride), 0, 0, 1, 1}, - {&__pyx_n_s__get_slot, __pyx_k__get_slot, sizeof(__pyx_k__get_slot), 0, 0, 1, 1}, - {&__pyx_n_s__get_time, __pyx_k__get_time, sizeof(__pyx_k__get_time), 0, 0, 1, 1}, - {&__pyx_n_s__get_value, __pyx_k__get_value, sizeof(__pyx_k__get_value), 0, 0, 1, 1}, - {&__pyx_n_s__in_array, __pyx_k__in_array, sizeof(__pyx_k__in_array), 0, 0, 1, 1}, - {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, - {&__pyx_n_s__lerp, __pyx_k__lerp, sizeof(__pyx_k__lerp), 0, 0, 1, 1}, - {&__pyx_n_s__method, __pyx_k__method, sizeof(__pyx_k__method), 0, 0, 1, 1}, - {&__pyx_n_s__mul, __pyx_k__mul, sizeof(__pyx_k__mul), 0, 0, 1, 1}, - {&__pyx_n_s__one_over_dt, __pyx_k__one_over_dt, sizeof(__pyx_k__one_over_dt), 0, 0, 1, 1}, - {&__pyx_n_s__operation, __pyx_k__operation, sizeof(__pyx_k__operation), 0, 0, 1, 1}, - {&__pyx_n_s__owner, __pyx_k__owner, sizeof(__pyx_k__owner), 0, 0, 1, 1}, - {&__pyx_n_s__p0, __pyx_k__p0, sizeof(__pyx_k__p0), 0, 0, 1, 1}, - {&__pyx_n_s__p1, __pyx_k__p1, sizeof(__pyx_k__p1), 0, 0, 1, 1}, - {&__pyx_n_s__p2, __pyx_k__p2, sizeof(__pyx_k__p2), 0, 0, 1, 1}, - {&__pyx_n_s__p3, __pyx_k__p3, sizeof(__pyx_k__p3), 0, 0, 1, 1}, - {&__pyx_n_s__parent, __pyx_k__parent, sizeof(__pyx_k__parent), 0, 0, 1, 1}, - {&__pyx_n_s__pointer, __pyx_k__pointer, sizeof(__pyx_k__pointer), 0, 0, 1, 1}, - {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1}, - {&__pyx_n_s__read_slot, __pyx_k__read_slot, sizeof(__pyx_k__read_slot), 0, 0, 1, 1}, - {&__pyx_n_s__repeat, __pyx_k__repeat, sizeof(__pyx_k__repeat), 0, 0, 1, 1}, - {&__pyx_n_s__reverse, __pyx_k__reverse, sizeof(__pyx_k__reverse), 0, 0, 1, 1}, - {&__pyx_n_s__set_time, __pyx_k__set_time, sizeof(__pyx_k__set_time), 0, 0, 1, 1}, - {&__pyx_n_s__stacklevel, __pyx_k__stacklevel, sizeof(__pyx_k__stacklevel), 0, 0, 1, 1}, - {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1}, - {&__pyx_n_s__startt, __pyx_k__startt, sizeof(__pyx_k__startt), 0, 0, 1, 1}, - {&__pyx_n_s__static, __pyx_k__static, sizeof(__pyx_k__static), 0, 0, 1, 1}, - {&__pyx_n_s__sub, __pyx_k__sub, sizeof(__pyx_k__sub), 0, 0, 1, 1}, - {&__pyx_n_s__t, __pyx_k__t, sizeof(__pyx_k__t), 0, 0, 1, 1}, - {&__pyx_n_s__target, __pyx_k__target, sizeof(__pyx_k__target), 0, 0, 1, 1}, - {&__pyx_n_s__to_Anim, __pyx_k__to_Anim, sizeof(__pyx_k__to_Anim), 0, 0, 1, 1}, - {&__pyx_n_s__v, __pyx_k__v, sizeof(__pyx_k__v), 0, 0, 1, 1}, - {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1}, - {&__pyx_n_s__warn, __pyx_k__warn, sizeof(__pyx_k__warn), 0, 0, 1, 1}, - {&__pyx_n_s__warnings, __pyx_k__warnings, sizeof(__pyx_k__warnings), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "rabbyt/rabbyt._anims.pyx":341 - * raise RuntimeError - * if obj.c_anim_slots == NULL: - * raise RuntimeError("Animable is not yet initialized. Call " # <<<<<<<<<<<<<< - * "Animable.__init__(self) first. (Or Sprite.__init__)") - * cdef float v - */ - __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_6); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); - - /* "rabbyt/rabbyt._anims.pyx":351 - * raise RuntimeError - * if obj.c_anim_slots == NULL: - * raise RuntimeError("Animable is not yet initialized.") # <<<<<<<<<<<<<< - * if PyNumber_Check(value): - * obj.c_anim_slots[self.index].type = SLOT_LOCAL - */ - __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_7)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_8); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); - - /* "rabbyt/rabbyt._anims.pyx":781 - * self._anim.func = _div_func - * else: - * raise ValueError("Unknown arithmetic operation") # <<<<<<<<<<<<<< - * - * self.operation_name = operation - */ - __pyx_k_tuple_12 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_11)); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_12); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - - /* "rabbyt/rabbyt._anims.pyx":849 - * AnimSlotReader.__init__(self, AnimSlot()) - * if cache == True: - * warnings.warn("AnimProxy currently doesn't support caching.", # <<<<<<<<<<<<<< - * stacklevel=2) - * self.cache_output = cache - */ - __pyx_k_tuple_17 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_17); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - - /* "rabbyt/rabbyt._anims.pyx":919 - * Otherwise, ``value`` is wrapped in an ``AnimConst``. - * """ - * warnings.warn("to_Anim() is deprecated", stacklevel=2) # <<<<<<<<<<<<<< - * cdef Anim dv - * if isinstance(v, Anim): - */ - __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_19); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - - /* "rabbyt/rabbyt._anims.pyx":68 - * import warnings - * - * def set_time(float t): # <<<<<<<<<<<<<< - * """ - * ``set_time(t)`` - */ - __pyx_k_tuple_24 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__t), ((PyObject *)__pyx_n_s__t)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_24); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - __pyx_k_codeobj_25 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__set_time, 68, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":89 - * _set_time(t) - * - * def get_time(): # <<<<<<<<<<<<<< - * """ - * ``get_time()`` - */ - __pyx_k_codeobj_28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__get_time, 89, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":97 - * return _get_time() - * - * def add_time(float t): # <<<<<<<<<<<<<< - * """ - * ``add_time(t)`` - */ - __pyx_k_tuple_29 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__t), ((PyObject *)__pyx_n_s__t)); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_29); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29)); - __pyx_k_codeobj_30 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__add_time, 97, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":905 - * - * - * def to_Anim(v): # <<<<<<<<<<<<<< - * """ - * ``to_Anim(value) -> Anim subclass instance`` - */ - __pyx_k_tuple_31 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__v), ((PyObject *)__pyx_n_s__dv)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_31); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31)); - __pyx_k_codeobj_32 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_26, __pyx_n_s__to_Anim, 905, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_anims(void); /*proto*/ -PyMODINIT_FUNC init_anims(void) -#else -PyMODINIT_FUNC PyInit__anims(void); /*proto*/ -PyMODINIT_FUNC PyInit__anims(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__anims(void)", 0); - if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __Pyx_CyFunction_USED - if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_anims"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_21), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_d); - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "rabbyt._anims")) { - if (unlikely(PyDict_SetItemString(modules, "rabbyt._anims", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__pyx_module_is_main_rabbyt___anims) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_6rabbyt_6_anims_Anim = &__pyx_vtable_6rabbyt_6_anims_Anim; - __pyx_vtable_6rabbyt_6_anims_Anim.add_dependency = (int (*)(struct __pyx_obj_6rabbyt_6_anims_Anim *, PyObject *, AnimSlot_s *))__pyx_f_6rabbyt_6_anims_4Anim_add_dependency; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_Anim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_Anim.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_Anim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Anim", (PyObject *)&__pyx_type_6rabbyt_6_anims_Anim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_Anim = &__pyx_type_6rabbyt_6_anims_Anim; - __pyx_vtabptr_6rabbyt_6_anims_AnimSlotReader = &__pyx_vtable_6rabbyt_6_anims_AnimSlotReader; - __pyx_vtable_6rabbyt_6_anims_AnimSlotReader.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_AnimSlotReader.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimSlotReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimSlotReader.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimSlotReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimSlotReader", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimSlotReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimSlotReader = &__pyx_type_6rabbyt_6_anims_AnimSlotReader; - __pyx_vtabptr_6rabbyt_6_anims_AnimProxy = &__pyx_vtable_6rabbyt_6_anims_AnimProxy; - __pyx_vtable_6rabbyt_6_anims_AnimProxy.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_AnimSlotReader; - __pyx_type_6rabbyt_6_anims_AnimProxy.tp_base = __pyx_ptype_6rabbyt_6_anims_AnimSlotReader; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimProxy.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimProxy", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimProxy) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimProxy = &__pyx_type_6rabbyt_6_anims_AnimProxy; - __pyx_vtabptr_6rabbyt_6_anims_ArithmeticAnim = &__pyx_vtable_6rabbyt_6_anims_ArithmeticAnim; - __pyx_vtable_6rabbyt_6_anims_ArithmeticAnim.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_ArithmeticAnim.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_ArithmeticAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_ArithmeticAnim.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_ArithmeticAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ArithmeticAnim", (PyObject *)&__pyx_type_6rabbyt_6_anims_ArithmeticAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_ArithmeticAnim = &__pyx_type_6rabbyt_6_anims_ArithmeticAnim; - __pyx_vtabptr_6rabbyt_6_anims_AnimSlot = &__pyx_vtable_6rabbyt_6_anims_AnimSlot; - __pyx_vtable_6rabbyt_6_anims_AnimSlot.c_set_anim = (int (*)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, struct __pyx_obj_6rabbyt_6_anims_Anim *))__pyx_f_6rabbyt_6_anims_8AnimSlot_c_set_anim; - __pyx_vtable_6rabbyt_6_anims_AnimSlot.c_get_anim = (struct __pyx_obj_6rabbyt_6_anims_Anim *(*)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *))__pyx_f_6rabbyt_6_anims_8AnimSlot_c_get_anim; - __pyx_vtable_6rabbyt_6_anims_AnimSlot.c_get_value = (float (*)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *))__pyx_f_6rabbyt_6_anims_8AnimSlot_c_get_value; - __pyx_vtable_6rabbyt_6_anims_AnimSlot.c_set_value = (int (*)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, float))__pyx_f_6rabbyt_6_anims_8AnimSlot_c_set_value; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimSlot) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimSlot.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimSlot) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimSlot", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimSlot) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimSlot = &__pyx_type_6rabbyt_6_anims_AnimSlot; - __pyx_vtabptr_6rabbyt_6_anims_AnimPointer = &__pyx_vtable_6rabbyt_6_anims_AnimPointer; - __pyx_vtable_6rabbyt_6_anims_AnimPointer.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_AnimPointer.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimPointer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimPointer.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimPointer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimPointer", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimPointer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimPointer = &__pyx_type_6rabbyt_6_anims_AnimPointer; - __pyx_vtabptr_6rabbyt_6_anims_InterpolateAnim = &__pyx_vtable_6rabbyt_6_anims_InterpolateAnim; - __pyx_vtable_6rabbyt_6_anims_InterpolateAnim.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_InterpolateAnim.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_InterpolateAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_InterpolateAnim.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_InterpolateAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "InterpolateAnim", (PyObject *)&__pyx_type_6rabbyt_6_anims_InterpolateAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_InterpolateAnim = &__pyx_type_6rabbyt_6_anims_InterpolateAnim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_IncompleteAnimBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "IncompleteAnimBase", (PyObject *)&__pyx_type_6rabbyt_6_anims_IncompleteAnimBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_IncompleteAnimBase = &__pyx_type_6rabbyt_6_anims_IncompleteAnimBase; - __pyx_vtabptr_6rabbyt_6_anims_AnimWrap = &__pyx_vtable_6rabbyt_6_anims_AnimWrap; - __pyx_vtable_6rabbyt_6_anims_AnimWrap.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_AnimWrap.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimWrap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimWrap.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimWrap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimWrap", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimWrap) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimWrap = &__pyx_type_6rabbyt_6_anims_AnimWrap; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_anim_slot) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "anim_slot", (PyObject *)&__pyx_type_6rabbyt_6_anims_anim_slot) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_anim_slot = &__pyx_type_6rabbyt_6_anims_anim_slot; - __pyx_vtabptr_6rabbyt_6_anims_cAnimable = &__pyx_vtable_6rabbyt_6_anims_cAnimable; - __pyx_vtable_6rabbyt_6_anims_cAnimable._modify_slots = (PyObject *(*)(struct __pyx_obj_6rabbyt_6_anims_cAnimable *))__pyx_f_6rabbyt_6_anims_9cAnimable__modify_slots; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_cAnimable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_cAnimable.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_cAnimable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "cAnimable", (PyObject *)&__pyx_type_6rabbyt_6_anims_cAnimable) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_cAnimable = &__pyx_type_6rabbyt_6_anims_cAnimable; - __pyx_vtabptr_6rabbyt_6_anims_AnimPyFunc = &__pyx_vtable_6rabbyt_6_anims_AnimPyFunc; - __pyx_vtable_6rabbyt_6_anims_AnimPyFunc.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_AnimPyFunc.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimPyFunc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimPyFunc.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimPyFunc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimPyFunc", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimPyFunc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimPyFunc = &__pyx_type_6rabbyt_6_anims_AnimPyFunc; - __pyx_vtabptr_6rabbyt_6_anims_AnimConst = &__pyx_vtable_6rabbyt_6_anims_AnimConst; - __pyx_vtable_6rabbyt_6_anims_AnimConst.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_AnimConst.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimConst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimConst.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimConst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimConst", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimConst) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimConst = &__pyx_type_6rabbyt_6_anims_AnimConst; - __pyx_vtabptr_6rabbyt_6_anims_AnimStaticCubicBezier = &__pyx_vtable_6rabbyt_6_anims_AnimStaticCubicBezier; - __pyx_vtable_6rabbyt_6_anims_AnimStaticCubicBezier.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_vtable_6rabbyt_6_anims_AnimStaticCubicBezier.g = (float (*)(struct __pyx_obj_6rabbyt_6_anims_AnimStaticCubicBezier *))__pyx_f_6rabbyt_6_anims_21AnimStaticCubicBezier_g; - __pyx_type_6rabbyt_6_anims_AnimStaticCubicBezier.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimStaticCubicBezier) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimStaticCubicBezier.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimStaticCubicBezier) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimStaticCubicBezier", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimStaticCubicBezier) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimStaticCubicBezier = &__pyx_type_6rabbyt_6_anims_AnimStaticCubicBezier; - __pyx_vtabptr_6rabbyt_6_anims_AnimRate = &__pyx_vtable_6rabbyt_6_anims_AnimRate; - __pyx_vtable_6rabbyt_6_anims_AnimRate.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_AnimRate.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_AnimRate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_AnimRate.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_AnimRate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "AnimRate", (PyObject *)&__pyx_type_6rabbyt_6_anims_AnimRate) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimRate = &__pyx_type_6rabbyt_6_anims_AnimRate; - __pyx_vtabptr_6rabbyt_6_anims_ChainAnim = &__pyx_vtable_6rabbyt_6_anims_ChainAnim; - __pyx_vtable_6rabbyt_6_anims_ChainAnim.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_Anim; - __pyx_type_6rabbyt_6_anims_ChainAnim.tp_base = __pyx_ptype_6rabbyt_6_anims_Anim; - if (PyType_Ready(&__pyx_type_6rabbyt_6_anims_ChainAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_6_anims_ChainAnim.tp_dict, __pyx_vtabptr_6rabbyt_6_anims_ChainAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "ChainAnim", (PyObject *)&__pyx_type_6rabbyt_6_anims_ChainAnim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_ChainAnim = &__pyx_type_6rabbyt_6_anims_ChainAnim; - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "rabbyt/rabbyt._anims.pyx":9 - * - * __credits__ = ( - * """ # <<<<<<<<<<<<<< - * Copyright (C) 2007 Matthew Marshall - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____credits__, ((PyObject *)__pyx_kp_s_22)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":31 - * """) - * - * __author__ = "Matthew Marshall " # <<<<<<<<<<<<<< - * - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_23)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._anims.pyx":66 - * cdef AnimFunc interpolate_func - * - * import warnings # <<<<<<<<<<<<<< - * - * def set_time(float t): - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__warnings, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":68 - * import warnings - * - * def set_time(float t): # <<<<<<<<<<<<<< - * """ - * ``set_time(t)`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_6_anims_1set_time, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":89 - * _set_time(t) - * - * def get_time(): # <<<<<<<<<<<<<< - * """ - * ``get_time()`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_6_anims_3get_time, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__get_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":97 - * return _get_time() - * - * def add_time(float t): # <<<<<<<<<<<<<< - * """ - * ``add_time(t)`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_6_anims_5add_time, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__add_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":692 - * - * - * def __init__(self, bounds, parent, static=True): # <<<<<<<<<<<<<< - * Anim.__init__(self) - * self.input_slot = AnimSlot() - */ - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_k_10 = __pyx_t_1; - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":819 - * cdef object function - * cdef _py_func_data _data - * def __init__(self, function, cache=False): # <<<<<<<<<<<<<< - * self.function = function - * self._anim.data = &(self._data) - */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_k_14 = __pyx_t_1; - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":846 - * cdef float cache - * cdef float cache_time - * def __init__(self, value, cache=False): # <<<<<<<<<<<<<< - * AnimSlotReader.__init__(self, AnimSlot()) - * if cache == True: - */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_k_15 = __pyx_t_1; - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":905 - * - * - * def to_Anim(v): # <<<<<<<<<<<<<< - * """ - * ``to_Anim(value) -> Anim subclass instance`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_6_anims_7to_Anim, NULL, __pyx_n_s_27); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__to_Anim, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._anims.pyx":1 - * """ # <<<<<<<<<<<<<< - * - * This module provides the compiled Anim classes. Everything is imported into - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - __Pyx_AddTraceback("init rabbyt._anims", __pyx_clineno, __pyx_lineno, __pyx_filename); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init rabbyt._anims"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif /* CYTHON_REFNANNY */ - -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -static CYTHON_INLINE int __Pyx_CheckKeywordStrings( - PyObject *kwdict, - const char* function_name, - int kw_allowed) -{ - PyObject* key = 0; - Py_ssize_t pos = 0; -#if CPYTHON_COMPILING_IN_PYPY - if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0)) - goto invalid_keyword; - return 1; -#else - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #endif - if (unlikely(!PyUnicode_Check(key))) - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - return 0; -#endif -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return NULL; - Py_INCREF(Py_None); - return Py_None; /* this is just to have an accurate signature */ - } else { - return __Pyx_PyObject_CallMethod1(L, __pyx_n_s__append, x); - } -} - -static double __Pyx__PyObject_AsDouble(PyObject* obj) { - PyObject* float_value; -#if CYTHON_COMPILING_IN_PYPY - float_value = PyNumber_Float(obj); -#else - PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number; - if (likely(nb) && likely(nb->nb_float)) { - float_value = nb->nb_float(obj); - if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) { - PyErr_Format(PyExc_TypeError, - "__float__ returned non-float (type %.200s)", - Py_TYPE(float_value)->tp_name); - Py_DECREF(float_value); - goto bad; - } - } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { -#if PY_MAJOR_VERSION >= 3 - float_value = PyFloat_FromString(obj); -#else - float_value = PyFloat_FromString(obj, 0); -#endif - } else { - PyObject* args = PyTuple_New(1); - if (unlikely(!args)) goto bad; - PyTuple_SET_ITEM(args, 0, obj); - float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); - PyTuple_SET_ITEM(args, 0, 0); - Py_DECREF(args); - } -#endif - if (likely(float_value)) { - double value = PyFloat_AS_DOUBLE(float_value); - Py_DECREF(float_value); - return value; - } -bad: - return (double)-1; -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_Restore(type, value, tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(type, value, tb); -#endif -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - #if PY_VERSION_HEX < 0x02050000 - if (PyClass_Check(type)) { - #else - if (PyType_Check(type)) { - #endif -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else /* Python 3+ */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyEval_CallObject(type, args); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - return NULL; - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { -#if CYTHON_COMPILING_IN_CPYTHON -#if PY_MAJOR_VERSION >= 3 - if (likely(PyUnicode_Check(n))) -#else - if (likely(PyString_Check(n))) -#endif - return __Pyx_PyObject_GetAttrStr(o, n); -#endif - return PyObject_GetAttr(o, n); -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, - const char *name, int exact) -{ - if (!type) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (none_allowed && obj == Py_None) return 1; - else if (exact) { - if (Py_TYPE(obj) == type) return 1; - } - else { - if (PyObject_TypeCheck(obj, type)) return 1; - } - PyErr_Format(PyExc_TypeError, - "Argument '%s' has incorrect type (expected %s, got %s)", - name, type->tp_name, Py_TYPE(obj)->tp_name); - return 0; -} - -static CYTHON_INLINE long __Pyx_mod_long(long a, long b) { - long r = a % b; - r += ((r != 0) & ((r ^ b) < 0)) * b; - return r; -} - -static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -} - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (result) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItem(dict, __pyx_n_s____pyx_vtable__, ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - #if PY_VERSION_HEX >= 0x02050000 - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; /* try absolute import on failure */ - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } - #else - if (level>0) { - PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); - goto bad; - } - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); - #endif -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned long)PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (long)PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed long)PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - #if PY_VERSION_HEX < 0x02050000 - return PyErr_Warn(NULL, message); - #else - return PyErr_WarnEx(NULL, message, 1); - #endif - } - return 0; -} - -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = (start + end) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, /*int argcount,*/ - 0, /*int kwonlyargcount,*/ - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_globals = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else /* PY_VERSION_HEX < 0x03030000 */ - if (PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_DATA_SIZE(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ - return PyUnicode_AsUTF8AndSize(o, length); -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ -#endif /* PY_VERSION_HEX < 0x03030000 */ - } else -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (r < 0) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred()) - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/rabbyt/rabbyt._rabbyt.c b/rabbyt/rabbyt._rabbyt.c deleted file mode 100644 index aa050c6..0000000 --- a/rabbyt/rabbyt._rabbyt.c +++ /dev/null @@ -1,5322 +0,0 @@ -/* Generated by Cython 0.19.2 on Mon Dec 16 21:11:31 2013 */ - -#define PY_SSIZE_T_CLEAN -#ifndef CYTHON_USE_PYLONG_INTERNALS -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 0 -#else -#include "pyconfig.h" -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 1 -#else -#define CYTHON_USE_PYLONG_INTERNALS 0 -#endif -#endif -#endif -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02040000 - #error Cython requires Python 2.4+. -#else -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION -#define CYTHON_COMPILING_IN_PYPY 1 -#define CYTHON_COMPILING_IN_CPYTHON 0 -#else -#define CYTHON_COMPILING_IN_PYPY 0 -#define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define CYTHON_FORMAT_SSIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) - #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ - (PyErr_Format(PyExc_TypeError, \ - "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ - (PyObject*)0)) - #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ - !PyComplex_Check(o)) - #define PyIndex_Check __Pyx_PyIndex_Check - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) - #define __PYX_BUILD_PY_SSIZE_T "i" -#else - #define __PYX_BUILD_PY_SSIZE_T "n" - #define CYTHON_FORMAT_SSIZE_T "z" - #define __Pyx_PyIndex_Check PyIndex_Check -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) - #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) - typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); - typedef void (*releasebufferproc)(PyObject *, Py_buffer *); -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 - #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_TPFLAGS_HAVE_VERSION_TAG 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ - PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_VERSION_HEX < 0x03020000 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and - a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is - a quiet NaN. */ - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE__rabbyt___rabbyt -#define __PYX_HAVE_API__rabbyt___rabbyt -#include "include_math.h" -#include "include_gl.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) -#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return u_end - u - 1; -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (ascii_chars_u == NULL) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - } - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - default_encoding_c = PyBytes_AS_STRING(default_encoding); - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(sys); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -#ifdef __GNUC__ - /* Test for GCC > 2.95 */ - #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #else /* __GNUC__ > 2 ... */ - #define likely(x) (x) - #define unlikely(x) (x) - #endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "rabbyt._rabbyt.pyx", -}; - -/*--- Type declarations ---*/ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - if (acquire_gil) { \ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - PyGILState_Release(__pyx_gilstate_save); \ - } else { \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext() \ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XDECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_XDECREF(tmp); \ - } while (0) -#define __Pyx_DECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_DECREF(tmp); \ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ - const char* function_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ - -#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ - -static CYTHON_INLINE GLint __Pyx_PyInt_from_py_GLint(PyObject *); - -static CYTHON_INLINE GLsizei __Pyx_PyInt_from_py_GLsizei(PyObject *); - -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_GLuint(GLuint); - -static CYTHON_INLINE GLuint __Pyx_PyInt_from_py_GLuint(PyObject *); - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_check_binary_version(void); - -typedef struct { - int code_line; - PyCodeObject* code_object; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - - -/* Module declarations from 'rabbyt._rabbyt' */ -#define __Pyx_MODULE_NAME "rabbyt._rabbyt" -int __pyx_module_is_main_rabbyt___rabbyt = 0; - -/* Implementation of 'rabbyt._rabbyt' */ -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_set_load_texture_file_hook(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_2render_unsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sprites); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_4render_sorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sprites); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_6set_viewport(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_viewport, PyObject *__pyx_v_projection); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_8set_default_attribs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_10set_gl_color(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rgba); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_12get_gl_vendor(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_14load_texture(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte_string, PyObject *__pyx_v_size, PyObject *__pyx_v_type_, PyObject *__pyx_v_filter, PyObject *__pyx_v_mipmap); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_16update_texture(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_texture_id, PyObject *__pyx_v_byte_string, PyObject *__pyx_v_size, PyObject *__pyx_v_type_, PyObject *__pyx_v_filter, PyObject *__pyx_v_mipmap); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_18unload_texture(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_texture_id); /* proto */ -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_20clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rgba); /* proto */ -static char __pyx_k_1[] = "load_texture_file_hook"; -static char __pyx_k_2[] = "Viewport values cannot be negative"; -static char __pyx_k_4[] = "set_gl_color is deprecated. Use glColor4f instead."; -static char __pyx_k_10[] = "Trying to load a texture without an OpenGL context"; -static char __pyx_k_12[] = "type_ must be \"RGBA\" or \"RGB\""; -static char __pyx_k_14[] = "byte_string is an unexpected size."; -static char __pyx_k_17[] = "\nCopyright (C) 2007 Matthew Marshall\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"; -static char __pyx_k_18[] = "Matthew Marshall "; -static char __pyx_k_21[] = "set_load_texture_file_hook"; -static char __pyx_k_22[] = "C:\\Users\\Ryexander\\Desktop\\Rabbyt-0.8.3\\rabbyt\\rabbyt._rabbyt.pyx"; -static char __pyx_k_23[] = "rabbyt._rabbyt"; -static char __pyx_k__a[] = "a"; -static char __pyx_k__b[] = "b"; -static char __pyx_k__g[] = "g"; -static char __pyx_k__h[] = "h"; -static char __pyx_k__i[] = "i"; -static char __pyx_k__l[] = "l"; -static char __pyx_k__r[] = "r"; -static char __pyx_k__s[] = "s"; -static char __pyx_k__t[] = "t"; -static char __pyx_k__w[] = "w"; -static char __pyx_k__id[] = "id"; -static char __pyx_k__ss[] = "ss"; -static char __pyx_k__RGB[] = "RGB"; -static char __pyx_k__RGBA[] = "RGBA"; -static char __pyx_k__data[] = "data"; -static char __pyx_k__rgba[] = "rgba"; -static char __pyx_k__size[] = "size"; -static char __pyx_k__warn[] = "warn"; -static char __pyx_k__clear[] = "clear"; -static char __pyx_k__ptype[] = "ptype"; -static char __pyx_k__type_[] = "type_"; -static char __pyx_k__filter[] = "filter"; -static char __pyx_k__mipmap[] = "mipmap"; -static char __pyx_k__render[] = "render"; -static char __pyx_k__string[] = "string"; -static char __pyx_k__sprites[] = "sprites"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__callback[] = "callback"; -static char __pyx_k__channels[] = "channels"; -static char __pyx_k__textures[] = "textures"; -static char __pyx_k__viewport[] = "viewport"; -static char __pyx_k__warnings[] = "warnings"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k____author__[] = "__author__"; -static char __pyx_k____import__[] = "__import__"; -static char __pyx_k__projection[] = "projection"; -static char __pyx_k__stacklevel[] = "stacklevel"; -static char __pyx_k__texture_id[] = "texture_id"; -static char __pyx_k____credits__[] = "__credits__"; -static char __pyx_k__byte_string[] = "byte_string"; -static char __pyx_k__filter_type[] = "filter_type"; -static char __pyx_k__RuntimeError[] = "RuntimeError"; -static char __pyx_k__load_texture[] = "load_texture"; -static char __pyx_k__set_gl_color[] = "set_gl_color"; -static char __pyx_k__set_viewport[] = "set_viewport"; -static char __pyx_k__get_gl_vendor[] = "get_gl_vendor"; -static char __pyx_k__render_sorted[] = "render_sorted"; -static char __pyx_k__unload_texture[] = "unload_texture"; -static char __pyx_k__update_texture[] = "update_texture"; -static char __pyx_k__render_unsorted[] = "render_unsorted"; -static char __pyx_k__set_default_attribs[] = "set_default_attribs"; -static PyObject *__pyx_n_s_1; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_kp_s_12; -static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_17; -static PyObject *__pyx_kp_s_18; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_n_s_21; -static PyObject *__pyx_kp_s_22; -static PyObject *__pyx_n_s_23; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_n_s__RGB; -static PyObject *__pyx_n_s__RGBA; -static PyObject *__pyx_n_s__RuntimeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____author__; -static PyObject *__pyx_n_s____credits__; -static PyObject *__pyx_n_s____import__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s__a; -static PyObject *__pyx_n_s__b; -static PyObject *__pyx_n_s__byte_string; -static PyObject *__pyx_n_s__callback; -static PyObject *__pyx_n_s__channels; -static PyObject *__pyx_n_s__clear; -static PyObject *__pyx_n_s__data; -static PyObject *__pyx_n_s__filter; -static PyObject *__pyx_n_s__filter_type; -static PyObject *__pyx_n_s__g; -static PyObject *__pyx_n_s__get_gl_vendor; -static PyObject *__pyx_n_s__h; -static PyObject *__pyx_n_s__i; -static PyObject *__pyx_n_s__id; -static PyObject *__pyx_n_s__l; -static PyObject *__pyx_n_s__load_texture; -static PyObject *__pyx_n_s__mipmap; -static PyObject *__pyx_n_s__projection; -static PyObject *__pyx_n_s__ptype; -static PyObject *__pyx_n_s__r; -static PyObject *__pyx_n_s__render; -static PyObject *__pyx_n_s__render_sorted; -static PyObject *__pyx_n_s__render_unsorted; -static PyObject *__pyx_n_s__rgba; -static PyObject *__pyx_n_s__s; -static PyObject *__pyx_n_s__set_default_attribs; -static PyObject *__pyx_n_s__set_gl_color; -static PyObject *__pyx_n_s__set_viewport; -static PyObject *__pyx_n_s__size; -static PyObject *__pyx_n_s__sprites; -static PyObject *__pyx_n_s__ss; -static PyObject *__pyx_n_s__stacklevel; -static PyObject *__pyx_n_s__string; -static PyObject *__pyx_n_s__t; -static PyObject *__pyx_n_s__texture_id; -static PyObject *__pyx_n_s__textures; -static PyObject *__pyx_n_s__type_; -static PyObject *__pyx_n_s__unload_texture; -static PyObject *__pyx_n_s__update_texture; -static PyObject *__pyx_n_s__viewport; -static PyObject *__pyx_n_s__w; -static PyObject *__pyx_n_s__warn; -static PyObject *__pyx_n_s__warnings; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_2; -static PyObject *__pyx_int_3; -static PyObject *__pyx_int_4; -static PyObject *__pyx_k_6; -static PyObject *__pyx_k_7; -static PyObject *__pyx_k_8; -static PyObject *__pyx_k_9; -static PyObject *__pyx_k_16; -static PyObject *__pyx_k_tuple_3; -static PyObject *__pyx_k_tuple_5; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_13; -static PyObject *__pyx_k_tuple_15; -static PyObject *__pyx_k_tuple_19; -static PyObject *__pyx_k_tuple_24; -static PyObject *__pyx_k_tuple_26; -static PyObject *__pyx_k_tuple_28; -static PyObject *__pyx_k_tuple_31; -static PyObject *__pyx_k_tuple_33; -static PyObject *__pyx_k_tuple_35; -static PyObject *__pyx_k_tuple_37; -static PyObject *__pyx_k_tuple_39; -static PyObject *__pyx_k_tuple_41; -static PyObject *__pyx_k_codeobj_20; -static PyObject *__pyx_k_codeobj_25; -static PyObject *__pyx_k_codeobj_27; -static PyObject *__pyx_k_codeobj_29; -static PyObject *__pyx_k_codeobj_30; -static PyObject *__pyx_k_codeobj_32; -static PyObject *__pyx_k_codeobj_34; -static PyObject *__pyx_k_codeobj_36; -static PyObject *__pyx_k_codeobj_38; -static PyObject *__pyx_k_codeobj_40; -static PyObject *__pyx_k_codeobj_42; - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_1set_load_texture_file_hook(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_set_load_texture_file_hook[] = "\n ``set_load_texture_file_hook(callback)``\n\n This sets the ``callback`` that is used to load a texture from a file.\n (It is called when you give a string for the first argument of\n ``Sprite``.)\n\n The default is ``rabbyt.autodetect_load_texture``, which will smartly\n choose between using pyglet of pygame to load the file.\n\n The ``callback`` should take the filename as a single argument, and return\n either a tuple of the form ``(texture_id, (width, height))`` or any value\n suitable for assiging to ``Sprite.texture``.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_1set_load_texture_file_hook = {__Pyx_NAMESTR("set_load_texture_file_hook"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_1set_load_texture_file_hook, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_set_load_texture_file_hook)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_1set_load_texture_file_hook(PyObject *__pyx_self, PyObject *__pyx_v_callback) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_load_texture_file_hook (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_set_load_texture_file_hook(__pyx_self, ((PyObject *)__pyx_v_callback)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":103 - * - * load_texture_file_hook = None - * def set_load_texture_file_hook(callback): # <<<<<<<<<<<<<< - * """ - * ``set_load_texture_file_hook(callback)`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_set_load_texture_file_hook(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_load_texture_file_hook", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":119 - * """ - * global load_texture_file_hook - * load_texture_file_hook = callback # <<<<<<<<<<<<<< - * - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_1, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._rabbyt.set_load_texture_file_hook", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_3render_unsorted(PyObject *__pyx_self, PyObject *__pyx_v_sprites); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_2render_unsorted[] = "\n ``render_unsorted(sprites)``\n\n Renders a list of sprites.\n\n Since this function is implemented in Pyrex, it should be a little faster\n than looping through the sprites in Python.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_3render_unsorted = {__Pyx_NAMESTR("render_unsorted"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_3render_unsorted, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_2render_unsorted)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_3render_unsorted(PyObject *__pyx_self, PyObject *__pyx_v_sprites) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("render_unsorted (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_2render_unsorted(__pyx_self, ((PyObject *)__pyx_v_sprites)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":123 - * - * - * def render_unsorted(sprites): # <<<<<<<<<<<<<< - * """ - * ``render_unsorted(sprites)`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_2render_unsorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sprites) { - PyObject *__pyx_v_s = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("render_unsorted", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":132 - * than looping through the sprites in Python. - * """ - * for s in sprites: # <<<<<<<<<<<<<< - * s.render() - * - */ - if (PyList_CheckExact(__pyx_v_sprites) || PyTuple_CheckExact(__pyx_v_sprites)) { - __pyx_t_1 = __pyx_v_sprites; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sprites); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; - } - for (;;) { - if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":133 - * """ - * for s in sprites: - * s.render() # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s__render); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rabbyt._rabbyt.render_unsorted", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_5render_sorted(PyObject *__pyx_self, PyObject *__pyx_v_sprites); /*proto*/ -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_5render_sorted = {__Pyx_NAMESTR("render_sorted"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_5render_sorted, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_5render_sorted(PyObject *__pyx_self, PyObject *__pyx_v_sprites) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("render_sorted (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_4render_sorted(__pyx_self, ((PyObject *)__pyx_v_sprites)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":136 - * - * - * def render_sorted(sprites): # <<<<<<<<<<<<<< - * ss = list(sprites) - * ss.sort() - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_4render_sorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sprites) { - PyObject *__pyx_v_ss = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("render_sorted", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":137 - * - * def render_sorted(sprites): - * ss = list(sprites) # <<<<<<<<<<<<<< - * ss.sort() - * render_unsorted(ss) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_sprites); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sprites); - __Pyx_GIVEREF(__pyx_v_sprites); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_v_ss = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":138 - * def render_sorted(sprites): - * ss = list(sprites) - * ss.sort() # <<<<<<<<<<<<<< - * render_unsorted(ss) - * - */ - __pyx_t_3 = PyList_Sort(((PyObject *)__pyx_v_ss)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":139 - * ss = list(sprites) - * ss.sort() - * render_unsorted(ss) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__render_unsorted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_ss)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ss)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ss)); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rabbyt._rabbyt.render_sorted", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_ss); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_7set_viewport(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_6set_viewport[] = "\n ``set_viewport(viewport, [projection])``\n\n Sets how coordinates map to the screen.\n\n ``viewport`` gives the screen coordinates that will be drawn to. It\n should be in either the form ``(width, height)`` or\n ``(left, top, right, bottom)``\n\n ``projection`` gives the sprite coordinates that will be mapped to the\n screen coordinates given by ``viewport``. It too should be in one of the\n two forms accepted by ``viewport``. If ``projection`` is not given, it\n will default to the width and height of ``viewport``. If only the width\n and height are given, ``(0, 0)`` will be the center point.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_7set_viewport = {__Pyx_NAMESTR("set_viewport"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_7set_viewport, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_6set_viewport)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_7set_viewport(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_viewport = 0; - PyObject *__pyx_v_projection = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_viewport (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__viewport,&__pyx_n_s__projection,0}; - PyObject* values[2] = {0,0}; - - /* "rabbyt/rabbyt._rabbyt.pyx":142 - * - * - * def set_viewport(viewport, projection=None): # <<<<<<<<<<<<<< - * """ - * ``set_viewport(viewport, [projection])`` - */ - values[1] = ((PyObject *)Py_None); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__viewport)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__projection); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_viewport") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_viewport = values[0]; - __pyx_v_projection = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_viewport", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._rabbyt.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_6set_viewport(__pyx_self, __pyx_v_viewport, __pyx_v_projection); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_6set_viewport(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_viewport, PyObject *__pyx_v_projection) { - PyObject *__pyx_v_l = NULL; - PyObject *__pyx_v_t = NULL; - PyObject *__pyx_v_r = NULL; - PyObject *__pyx_v_b = NULL; - PyObject *__pyx_v_i = NULL; - PyObject *__pyx_v_w = NULL; - PyObject *__pyx_v_h = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *(*__pyx_t_8)(PyObject *); - GLint __pyx_t_9; - GLint __pyx_t_10; - GLsizei __pyx_t_11; - GLsizei __pyx_t_12; - int __pyx_t_13; - GLint __pyx_t_14; - GLint __pyx_t_15; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_viewport", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":158 - * and height are given, ``(0, 0)`` will be the center point. - * """ - * glMatrixMode(GL_PROJECTION) # <<<<<<<<<<<<<< - * glLoadIdentity() - * if len(viewport) == 4: - */ - glMatrixMode(GL_PROJECTION); - - /* "rabbyt/rabbyt._rabbyt.pyx":159 - * """ - * glMatrixMode(GL_PROJECTION) - * glLoadIdentity() # <<<<<<<<<<<<<< - * if len(viewport) == 4: - * l, t, r, b = viewport - */ - glLoadIdentity(); - - /* "rabbyt/rabbyt._rabbyt.pyx":160 - * glMatrixMode(GL_PROJECTION) - * glLoadIdentity() - * if len(viewport) == 4: # <<<<<<<<<<<<<< - * l, t, r, b = viewport - * else: - */ - __pyx_t_1 = PyObject_Length(__pyx_v_viewport); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((__pyx_t_1 == 4) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._rabbyt.pyx":161 - * glLoadIdentity() - * if len(viewport) == 4: - * l, t, r, b = viewport # <<<<<<<<<<<<<< - * else: - * l, t = 0, 0 - */ - if ((likely(PyTuple_CheckExact(__pyx_v_viewport))) || (PyList_CheckExact(__pyx_v_viewport))) { - PyObject* sequence = __pyx_v_viewport; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); - __pyx_t_5 = PyList_GET_ITEM(sequence, 2); - __pyx_t_6 = PyList_GET_ITEM(sequence, 3); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - #else - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - #endif - } else - { - Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6}; - __pyx_t_7 = PyObject_GetIter(__pyx_v_viewport); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L4_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L5_unpacking_done; - __pyx_L4_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L5_unpacking_done:; - } - __pyx_v_l = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_t = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_v_r = __pyx_t_5; - __pyx_t_5 = 0; - __pyx_v_b = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._rabbyt.pyx":163 - * l, t, r, b = viewport - * else: - * l, t = 0, 0 # <<<<<<<<<<<<<< - * r, b = viewport - * for i in (l,t,r,b): - */ - __pyx_t_6 = __pyx_int_0; - __Pyx_INCREF(__pyx_t_6); - __pyx_t_5 = __pyx_int_0; - __Pyx_INCREF(__pyx_t_5); - __pyx_v_l = __pyx_t_6; - __pyx_t_6 = 0; - __pyx_v_t = __pyx_t_5; - __pyx_t_5 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":164 - * else: - * l, t = 0, 0 - * r, b = viewport # <<<<<<<<<<<<<< - * for i in (l,t,r,b): - * if i < 0: - */ - if ((likely(PyTuple_CheckExact(__pyx_v_viewport))) || (PyList_CheckExact(__pyx_v_viewport))) { - PyObject* sequence = __pyx_v_viewport; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - #endif - } else - { - Py_ssize_t index = -1; - __pyx_t_4 = PyObject_GetIter(__pyx_v_viewport); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = Py_TYPE(__pyx_t_4)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_4); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L7_unpacking_done; - __pyx_L6_unpacking_failed:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L7_unpacking_done:; - } - __pyx_v_r = __pyx_t_5; - __pyx_t_5 = 0; - __pyx_v_b = __pyx_t_6; - __pyx_t_6 = 0; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._rabbyt.pyx":165 - * l, t = 0, 0 - * r, b = viewport - * for i in (l,t,r,b): # <<<<<<<<<<<<<< - * if i < 0: - * raise ValueError("Viewport values cannot be negative") - */ - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_v_l); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_l); - __Pyx_GIVEREF(__pyx_v_l); - __Pyx_INCREF(__pyx_v_t); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_t); - __Pyx_GIVEREF(__pyx_v_t); - __Pyx_INCREF(__pyx_v_r); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_r); - __Pyx_GIVEREF(__pyx_v_r); - __Pyx_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_b); - __Pyx_GIVEREF(__pyx_v_b); - __pyx_t_5 = ((PyObject *)__pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - for (;;) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); - __pyx_t_6 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":166 - * r, b = viewport - * for i in (l,t,r,b): - * if i < 0: # <<<<<<<<<<<<<< - * raise ValueError("Viewport values cannot be negative") - * glViewport(l, t, r-l, b-t) - */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._rabbyt.pyx":167 - * for i in (l,t,r,b): - * if i < 0: - * raise ValueError("Viewport values cannot be negative") # <<<<<<<<<<<<<< - * glViewport(l, t, r-l, b-t) - * - */ - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; - } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":168 - * if i < 0: - * raise ValueError("Viewport values cannot be negative") - * glViewport(l, t, r-l, b-t) # <<<<<<<<<<<<<< - * - * if projection is not None: - */ - __pyx_t_9 = __Pyx_PyInt_from_py_GLint(__pyx_v_l); if (unlikely((__pyx_t_9 == (GLint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_10 = __Pyx_PyInt_from_py_GLint(__pyx_v_t); if (unlikely((__pyx_t_10 == (GLint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyNumber_Subtract(__pyx_v_r, __pyx_v_l); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyInt_from_py_GLsizei(__pyx_t_5); if (unlikely((__pyx_t_11 == (GLsizei)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_v_b, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyInt_from_py_GLsizei(__pyx_t_5); if (unlikely((__pyx_t_12 == (GLsizei)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - glViewport(__pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12); - - /* "rabbyt/rabbyt._rabbyt.pyx":170 - * glViewport(l, t, r-l, b-t) - * - * if projection is not None: # <<<<<<<<<<<<<< - * if len(projection) == 4: - * l, t, r, b = projection - */ - __pyx_t_2 = (__pyx_v_projection != Py_None); - __pyx_t_13 = (__pyx_t_2 != 0); - if (__pyx_t_13) { - - /* "rabbyt/rabbyt._rabbyt.pyx":171 - * - * if projection is not None: - * if len(projection) == 4: # <<<<<<<<<<<<<< - * l, t, r, b = projection - * else: - */ - __pyx_t_1 = PyObject_Length(__pyx_v_projection); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_13 = ((__pyx_t_1 == 4) != 0); - if (__pyx_t_13) { - - /* "rabbyt/rabbyt._rabbyt.pyx":172 - * if projection is not None: - * if len(projection) == 4: - * l, t, r, b = projection # <<<<<<<<<<<<<< - * else: - * w,h = projection - */ - if ((likely(PyTuple_CheckExact(__pyx_v_projection))) || (PyList_CheckExact(__pyx_v_projection))) { - PyObject* sequence = __pyx_v_projection; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); - } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - __pyx_t_3 = PyList_GET_ITEM(sequence, 3); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - #else - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_4,&__pyx_t_3}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - #endif - } else - { - Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_4,&__pyx_t_3}; - __pyx_t_7 = PyObject_GetIter(__pyx_v_projection); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L13_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L14_unpacking_done; - __pyx_L13_unpacking_failed:; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L14_unpacking_done:; - } - __Pyx_DECREF_SET(__pyx_v_l, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L12; - } - /*else*/ { - - /* "rabbyt/rabbyt._rabbyt.pyx":174 - * l, t, r, b = projection - * else: - * w,h = projection # <<<<<<<<<<<<<< - * l, r, t, b = -w/2, w/2, -h/2, h/2 - * else: - */ - if ((likely(PyTuple_CheckExact(__pyx_v_projection))) || (PyList_CheckExact(__pyx_v_projection))) { - PyObject* sequence = __pyx_v_projection; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - #endif - } else - { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_v_projection); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; - index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L15_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = NULL; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L16_unpacking_done; - __pyx_L15_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L16_unpacking_done:; - } - __pyx_v_w = __pyx_t_3; - __pyx_t_3 = 0; - __pyx_v_h = __pyx_t_4; - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":175 - * else: - * w,h = projection - * l, r, t, b = -w/2, w/2, -h/2, h/2 # <<<<<<<<<<<<<< - * else: - * w,h = r-l, b-t - */ - __pyx_t_4 = PyNumber_Negative(__pyx_v_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_w, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Negative(__pyx_v_h); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_h, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF_SET(__pyx_v_l, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_6); - __pyx_t_6 = 0; - } - __pyx_L12:; - goto __pyx_L11; - } - /*else*/ { - - /* "rabbyt/rabbyt._rabbyt.pyx":177 - * l, r, t, b = -w/2, w/2, -h/2, h/2 - * else: - * w,h = r-l, b-t # <<<<<<<<<<<<<< - * l, r, b, t = -w/2, w/2, -h/2, h/2 - * glOrtho(l, r, b, t, -1, 1) - */ - __pyx_t_6 = PyNumber_Subtract(__pyx_v_r, __pyx_v_l); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_b, __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_v_w = __pyx_t_6; - __pyx_t_6 = 0; - __pyx_v_h = __pyx_t_5; - __pyx_t_5 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":178 - * else: - * w,h = r-l, b-t - * l, r, b, t = -w/2, w/2, -h/2, h/2 # <<<<<<<<<<<<<< - * glOrtho(l, r, b, t, -1, 1) - * glMatrixMode(GL_MODELVIEW) - */ - __pyx_t_5 = PyNumber_Negative(__pyx_v_w); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_w, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Negative(__pyx_v_h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_v_h, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF_SET(__pyx_v_l, __pyx_t_6); - __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L11:; - - /* "rabbyt/rabbyt._rabbyt.pyx":179 - * w,h = r-l, b-t - * l, r, b, t = -w/2, w/2, -h/2, h/2 - * glOrtho(l, r, b, t, -1, 1) # <<<<<<<<<<<<<< - * glMatrixMode(GL_MODELVIEW) - * glLoadIdentity() - */ - __pyx_t_10 = __Pyx_PyInt_from_py_GLint(__pyx_v_l); if (unlikely((__pyx_t_10 == (GLint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_9 = __Pyx_PyInt_from_py_GLint(__pyx_v_r); if (unlikely((__pyx_t_9 == (GLint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_14 = __Pyx_PyInt_from_py_GLint(__pyx_v_b); if (unlikely((__pyx_t_14 == (GLint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_15 = __Pyx_PyInt_from_py_GLint(__pyx_v_t); if (unlikely((__pyx_t_15 == (GLint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - glOrtho(__pyx_t_10, __pyx_t_9, __pyx_t_14, __pyx_t_15, -1, 1); - - /* "rabbyt/rabbyt._rabbyt.pyx":180 - * l, r, b, t = -w/2, w/2, -h/2, h/2 - * glOrtho(l, r, b, t, -1, 1) - * glMatrixMode(GL_MODELVIEW) # <<<<<<<<<<<<<< - * glLoadIdentity() - * - */ - glMatrixMode(GL_MODELVIEW); - - /* "rabbyt/rabbyt._rabbyt.pyx":181 - * glOrtho(l, r, b, t, -1, 1) - * glMatrixMode(GL_MODELVIEW) - * glLoadIdentity() # <<<<<<<<<<<<<< - * - * def set_default_attribs(): - */ - glLoadIdentity(); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("rabbyt._rabbyt.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_l); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_XDECREF(__pyx_v_r); - __Pyx_XDECREF(__pyx_v_b); - __Pyx_XDECREF(__pyx_v_i); - __Pyx_XDECREF(__pyx_v_w); - __Pyx_XDECREF(__pyx_v_h); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_9set_default_attribs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_8set_default_attribs[] = "\n ``set_default_attribs()``\n\n Sets a few of the OpenGL attributes that sprites expect.\n\n Unless you know what you are doing, you should call this at least once\n before rendering any sprites. (It is called automatically in\n ``rabbyt.init_display()``)\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_9set_default_attribs = {__Pyx_NAMESTR("set_default_attribs"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_9set_default_attribs, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_8set_default_attribs)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_9set_default_attribs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_default_attribs (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_8set_default_attribs(__pyx_self); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":183 - * glLoadIdentity() - * - * def set_default_attribs(): # <<<<<<<<<<<<<< - * """ - * ``set_default_attribs()`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_8set_default_attribs(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_default_attribs", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":193 - * ``rabbyt.init_display()``) - * """ - * glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) # <<<<<<<<<<<<<< - * glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) - * glEnable(GL_BLEND) - */ - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - /* "rabbyt/rabbyt._rabbyt.pyx":194 - * """ - * glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - * glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) # <<<<<<<<<<<<<< - * glEnable(GL_BLEND) - * #glEnable(GL_POLYGON_SMOOTH) - */ - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - /* "rabbyt/rabbyt._rabbyt.pyx":195 - * glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) - * glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) - * glEnable(GL_BLEND) # <<<<<<<<<<<<<< - * #glEnable(GL_POLYGON_SMOOTH) - * - */ - glEnable(GL_BLEND); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_11set_gl_color(PyObject *__pyx_self, PyObject *__pyx_v_rgba); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_10set_gl_color[] = "\n ``set_gl_color(rgba)``\n\n This is a thin wrapper around ``glColor4f()``.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_11set_gl_color = {__Pyx_NAMESTR("set_gl_color"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_11set_gl_color, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_10set_gl_color)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_11set_gl_color(PyObject *__pyx_self, PyObject *__pyx_v_rgba) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("set_gl_color (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_10set_gl_color(__pyx_self, ((PyObject *)__pyx_v_rgba)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":199 - * - * - * def set_gl_color(rgba): # <<<<<<<<<<<<<< - * """ - * ``set_gl_color(rgba)`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_10set_gl_color(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rgba) { - float __pyx_v_r; - float __pyx_v_g; - float __pyx_v_b; - float __pyx_v_a; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - float __pyx_t_7; - float __pyx_t_8; - float __pyx_t_9; - float __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("set_gl_color", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":205 - * This is a thin wrapper around ``glColor4f()``. - * """ - * warn("set_gl_color is deprecated. Use glColor4f instead.", # <<<<<<<<<<<<<< - * stacklevel=2) - * cdef float r,g,b,a - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__stacklevel), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":208 - * stacklevel=2) - * cdef float r,g,b,a - * r, g, b, a = rgba # <<<<<<<<<<<<<< - * glColor4f(r,g,b,a) - * - */ - if ((likely(PyTuple_CheckExact(__pyx_v_rgba))) || (PyList_CheckExact(__pyx_v_rgba))) { - PyObject* sequence = __pyx_v_rgba; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); - } else { - __pyx_t_3 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - __pyx_t_1 = PyList_GET_ITEM(sequence, 2); - __pyx_t_4 = PyList_GET_ITEM(sequence, 3); - } - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - #else - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - #endif - } else - { - Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4}; - __pyx_t_5 = PyObject_GetIter(__pyx_v_rgba); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_6(__pyx_t_5); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L4_unpacking_done:; - } - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_r = __pyx_t_7; - __pyx_v_g = __pyx_t_8; - __pyx_v_b = __pyx_t_9; - __pyx_v_a = __pyx_t_10; - - /* "rabbyt/rabbyt._rabbyt.pyx":209 - * cdef float r,g,b,a - * r, g, b, a = rgba - * glColor4f(r,g,b,a) # <<<<<<<<<<<<<< - * - * def get_gl_vendor(): - */ - glColor4f(__pyx_v_r, __pyx_v_g, __pyx_v_b, __pyx_v_a); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rabbyt._rabbyt.set_gl_color", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_13get_gl_vendor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_12get_gl_vendor[] = "\n ``gl_get_vendor()``\n\n Returns the OpenGL vendor string. Returns None if there is no context.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_13get_gl_vendor = {__Pyx_NAMESTR("get_gl_vendor"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_13get_gl_vendor, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_12get_gl_vendor)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_13get_gl_vendor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("get_gl_vendor (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_12get_gl_vendor(__pyx_self); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":211 - * glColor4f(r,g,b,a) - * - * def get_gl_vendor(): # <<<<<<<<<<<<<< - * """ - * ``gl_get_vendor()`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_12get_gl_vendor(CYTHON_UNUSED PyObject *__pyx_self) { - char *__pyx_v_string; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_gl_vendor", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":218 - * """ - * cdef char * string - * string = glGetString(GL_VENDOR) # <<<<<<<<<<<<<< - * if string == NULL: - * return None - */ - __pyx_v_string = ((char *)glGetString(GL_VENDOR)); - - /* "rabbyt/rabbyt._rabbyt.pyx":219 - * cdef char * string - * string = glGetString(GL_VENDOR) - * if string == NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_string == NULL) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._rabbyt.pyx":220 - * string = glGetString(GL_VENDOR) - * if string == NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return string - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._rabbyt.pyx":222 - * return None - * else: - * return string # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_r = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._rabbyt.get_gl_vendor", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_15load_texture(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_14load_texture[] = "\n ``load_texture(byte_string, size, type_='RGBA', filter=True, mipmap=True)``\n\n Load a texture and return it.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_15load_texture = {__Pyx_NAMESTR("load_texture"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_15load_texture, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_14load_texture)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_15load_texture(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_byte_string = 0; - PyObject *__pyx_v_size = 0; - PyObject *__pyx_v_type_ = 0; - PyObject *__pyx_v_filter = 0; - PyObject *__pyx_v_mipmap = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("load_texture (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__byte_string,&__pyx_n_s__size,&__pyx_n_s__type_,&__pyx_n_s__filter,&__pyx_n_s__mipmap,0}; - PyObject* values[5] = {0,0,0,0,0}; - values[2] = ((PyObject *)__pyx_n_s__RGBA); - values[3] = __pyx_k_6; - values[4] = __pyx_k_7; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__byte_string)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("load_texture", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type_); - if (value) { values[2] = value; kw_args--; } - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mipmap); - if (value) { values[4] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_texture") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_byte_string = values[0]; - __pyx_v_size = values[1]; - __pyx_v_type_ = values[2]; - __pyx_v_filter = values[3]; - __pyx_v_mipmap = values[4]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("load_texture", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._rabbyt.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_14load_texture(__pyx_self, __pyx_v_byte_string, __pyx_v_size, __pyx_v_type_, __pyx_v_filter, __pyx_v_mipmap); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":227 - * # The following functions were ripped from Simmon Wittber's GFX library: - * - * def load_texture(byte_string, size, type_='RGBA', filter=True, mipmap=True): # <<<<<<<<<<<<<< - * """ - * ``load_texture(byte_string, size, type_='RGBA', filter=True, mipmap=True)`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_14load_texture(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_byte_string, PyObject *__pyx_v_size, PyObject *__pyx_v_type_, PyObject *__pyx_v_filter, PyObject *__pyx_v_mipmap) { - GLuint __pyx_v_textures[1]; - GLuint __pyx_v_id; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("load_texture", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":235 - * cdef GLuint textures[1] - * cdef GLuint id - * glGenTextures(1, textures) # <<<<<<<<<<<<<< - * id = textures[0] - * update_texture(id, byte_string, size, type_, filter, mipmap) - */ - glGenTextures(1, __pyx_v_textures); - - /* "rabbyt/rabbyt._rabbyt.pyx":236 - * cdef GLuint id - * glGenTextures(1, textures) - * id = textures[0] # <<<<<<<<<<<<<< - * update_texture(id, byte_string, size, type_, filter, mipmap) - * return id - */ - __pyx_v_id = (__pyx_v_textures[0]); - - /* "rabbyt/rabbyt._rabbyt.pyx":237 - * glGenTextures(1, textures) - * id = textures[0] - * update_texture(id, byte_string, size, type_, filter, mipmap) # <<<<<<<<<<<<<< - * return id - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__update_texture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_to_py_GLuint(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_byte_string); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_byte_string); - __Pyx_GIVEREF(__pyx_v_byte_string); - __Pyx_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_size); - __Pyx_GIVEREF(__pyx_v_size); - __Pyx_INCREF(__pyx_v_type_); - PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_type_); - __Pyx_GIVEREF(__pyx_v_type_); - __Pyx_INCREF(__pyx_v_filter); - PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_filter); - __Pyx_GIVEREF(__pyx_v_filter); - __Pyx_INCREF(__pyx_v_mipmap); - PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_mipmap); - __Pyx_GIVEREF(__pyx_v_mipmap); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":238 - * id = textures[0] - * update_texture(id, byte_string, size, type_, filter, mipmap) - * return id # <<<<<<<<<<<<<< - * - * def update_texture(texture_id, byte_string, size, type_='RGBA', filter=True, - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_to_py_GLuint(__pyx_v_id); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt._rabbyt.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_17update_texture(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_16update_texture[] = "\n ``update_texture(texture_id, byte_string, size, type_='RGBA', filter=True,\n mipmap=True)``\n\n Update a texture with a different byte_string.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_17update_texture = {__Pyx_NAMESTR("update_texture"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_17update_texture, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_16update_texture)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_17update_texture(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_texture_id = 0; - PyObject *__pyx_v_byte_string = 0; - PyObject *__pyx_v_size = 0; - PyObject *__pyx_v_type_ = 0; - PyObject *__pyx_v_filter = 0; - PyObject *__pyx_v_mipmap = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("update_texture (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__texture_id,&__pyx_n_s__byte_string,&__pyx_n_s__size,&__pyx_n_s__type_,&__pyx_n_s__filter,&__pyx_n_s__mipmap,0}; - PyObject* values[6] = {0,0,0,0,0,0}; - values[3] = ((PyObject *)__pyx_n_s__RGBA); - values[4] = __pyx_k_8; - values[5] = __pyx_k_9; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__texture_id)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__byte_string)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("update_texture", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("update_texture", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 3: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type_); - if (value) { values[3] = value; kw_args--; } - } - case 4: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__filter); - if (value) { values[4] = value; kw_args--; } - } - case 5: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mipmap); - if (value) { values[5] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_texture") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_texture_id = values[0]; - __pyx_v_byte_string = values[1]; - __pyx_v_size = values[2]; - __pyx_v_type_ = values[3]; - __pyx_v_filter = values[4]; - __pyx_v_mipmap = values[5]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("update_texture", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._rabbyt.update_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_16update_texture(__pyx_self, __pyx_v_texture_id, __pyx_v_byte_string, __pyx_v_size, __pyx_v_type_, __pyx_v_filter, __pyx_v_mipmap); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":240 - * return id - * - * def update_texture(texture_id, byte_string, size, type_='RGBA', filter=True, # <<<<<<<<<<<<<< - * mipmap=True): - * """ - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_16update_texture(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_texture_id, PyObject *__pyx_v_byte_string, PyObject *__pyx_v_size, PyObject *__pyx_v_type_, PyObject *__pyx_v_filter, PyObject *__pyx_v_mipmap) { - char *__pyx_v_data; - int __pyx_v_ptype; - PyObject *__pyx_v_channels = NULL; - int __pyx_v_filter_type; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - char *__pyx_t_5; - PyObject *__pyx_t_6 = NULL; - Py_ssize_t __pyx_t_7; - GLuint __pyx_t_8; - GLint __pyx_t_9; - GLsizei __pyx_t_10; - GLsizei __pyx_t_11; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("update_texture", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":249 - * """ - * - * if not get_gl_vendor(): # <<<<<<<<<<<<<< - * raise RuntimeError("Trying to load a texture without an OpenGL context") - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__get_gl_vendor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = ((!__pyx_t_3) != 0); - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._rabbyt.pyx":250 - * - * if not get_gl_vendor(): - * raise RuntimeError("Trying to load a texture without an OpenGL context") # <<<<<<<<<<<<<< - * - * cdef char *data - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._rabbyt.pyx":253 - * - * cdef char *data - * data = byte_string # <<<<<<<<<<<<<< - * if type_ == 'RGBA': - * ptype = GL_RGBA - */ - __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_v_byte_string); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_data = __pyx_t_5; - - /* "rabbyt/rabbyt._rabbyt.pyx":254 - * cdef char *data - * data = byte_string - * if type_ == 'RGBA': # <<<<<<<<<<<<<< - * ptype = GL_RGBA - * channels = 4 - */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_type_, ((PyObject *)__pyx_n_s__RGBA), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._rabbyt.pyx":255 - * data = byte_string - * if type_ == 'RGBA': - * ptype = GL_RGBA # <<<<<<<<<<<<<< - * channels = 4 - * elif type_ == 'RGB': - */ - __pyx_v_ptype = GL_RGBA; - - /* "rabbyt/rabbyt._rabbyt.pyx":256 - * if type_ == 'RGBA': - * ptype = GL_RGBA - * channels = 4 # <<<<<<<<<<<<<< - * elif type_ == 'RGB': - * ptype = GL_RGB - */ - __Pyx_INCREF(__pyx_int_4); - __pyx_v_channels = __pyx_int_4; - goto __pyx_L4; - } - - /* "rabbyt/rabbyt._rabbyt.pyx":257 - * ptype = GL_RGBA - * channels = 4 - * elif type_ == 'RGB': # <<<<<<<<<<<<<< - * ptype = GL_RGB - * channels = 3 - */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_type_, ((PyObject *)__pyx_n_s__RGB), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._rabbyt.pyx":258 - * channels = 4 - * elif type_ == 'RGB': - * ptype = GL_RGB # <<<<<<<<<<<<<< - * channels = 3 - * else: - */ - __pyx_v_ptype = GL_RGB; - - /* "rabbyt/rabbyt._rabbyt.pyx":259 - * elif type_ == 'RGB': - * ptype = GL_RGB - * channels = 3 # <<<<<<<<<<<<<< - * else: - * raise ValueError('type_ must be "RGBA" or "RGB"') - */ - __Pyx_INCREF(__pyx_int_3); - __pyx_v_channels = __pyx_int_3; - goto __pyx_L4; - } - /*else*/ { - - /* "rabbyt/rabbyt._rabbyt.pyx":261 - * channels = 3 - * else: - * raise ValueError('type_ must be "RGBA" or "RGB"') # <<<<<<<<<<<<<< - * - * if size[0]*size[1]*channels != len(byte_string): - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L4:; - - /* "rabbyt/rabbyt._rabbyt.pyx":263 - * raise ValueError('type_ must be "RGBA" or "RGB"') - * - * if size[0]*size[1]*channels != len(byte_string): # <<<<<<<<<<<<<< - * raise ValueError('byte_string is an unexpected size.') - * - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_size, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_v_channels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = PyObject_Length(__pyx_v_byte_string); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._rabbyt.pyx":264 - * - * if size[0]*size[1]*channels != len(byte_string): - * raise ValueError('byte_string is an unexpected size.') # <<<<<<<<<<<<<< - * - * filter_type = GL_NEAREST - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "rabbyt/rabbyt._rabbyt.pyx":266 - * raise ValueError('byte_string is an unexpected size.') - * - * filter_type = GL_NEAREST # <<<<<<<<<<<<<< - * if filter: filter_type = GL_LINEAR - * glBindTexture(GL_TEXTURE_2D, texture_id) - */ - __pyx_v_filter_type = GL_NEAREST; - - /* "rabbyt/rabbyt._rabbyt.pyx":267 - * - * filter_type = GL_NEAREST - * if filter: filter_type = GL_LINEAR # <<<<<<<<<<<<<< - * glBindTexture(GL_TEXTURE_2D, texture_id) - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_type) - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_filter); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - __pyx_v_filter_type = GL_LINEAR; - goto __pyx_L6; - } - __pyx_L6:; - - /* "rabbyt/rabbyt._rabbyt.pyx":268 - * filter_type = GL_NEAREST - * if filter: filter_type = GL_LINEAR - * glBindTexture(GL_TEXTURE_2D, texture_id) # <<<<<<<<<<<<<< - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_type) - * if mipmap: - */ - __pyx_t_8 = __Pyx_PyInt_from_py_GLuint(__pyx_v_texture_id); if (unlikely((__pyx_t_8 == (GLuint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - glBindTexture(GL_TEXTURE_2D, __pyx_t_8); - - /* "rabbyt/rabbyt._rabbyt.pyx":269 - * if filter: filter_type = GL_LINEAR - * glBindTexture(GL_TEXTURE_2D, texture_id) - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_type) # <<<<<<<<<<<<<< - * if mipmap: - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST) - */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, __pyx_v_filter_type); - - /* "rabbyt/rabbyt._rabbyt.pyx":270 - * glBindTexture(GL_TEXTURE_2D, texture_id) - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_type) - * if mipmap: # <<<<<<<<<<<<<< - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST) - * gluBuild2DMipmaps(GL_TEXTURE_2D, channels, size[0], size[1], ptype, GL_UNSIGNED_BYTE, data) - */ - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_mipmap); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "rabbyt/rabbyt._rabbyt.pyx":271 - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_type) - * if mipmap: - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST) # <<<<<<<<<<<<<< - * gluBuild2DMipmaps(GL_TEXTURE_2D, channels, size[0], size[1], ptype, GL_UNSIGNED_BYTE, data) - * else: - */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); - - /* "rabbyt/rabbyt._rabbyt.pyx":272 - * if mipmap: - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST) - * gluBuild2DMipmaps(GL_TEXTURE_2D, channels, size[0], size[1], ptype, GL_UNSIGNED_BYTE, data) # <<<<<<<<<<<<<< - * else: - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter_type) - */ - __pyx_t_9 = __Pyx_PyInt_from_py_GLint(__pyx_v_channels); if (unlikely((__pyx_t_9 == (GLint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_size, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyInt_from_py_GLsizei(__pyx_t_2); if (unlikely((__pyx_t_10 == (GLsizei)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_size, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyInt_from_py_GLsizei(__pyx_t_2); if (unlikely((__pyx_t_11 == (GLsizei)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - gluBuild2DMipmaps(GL_TEXTURE_2D, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_ptype, GL_UNSIGNED_BYTE, __pyx_v_data); - goto __pyx_L7; - } - /*else*/ { - - /* "rabbyt/rabbyt._rabbyt.pyx":274 - * gluBuild2DMipmaps(GL_TEXTURE_2D, channels, size[0], size[1], ptype, GL_UNSIGNED_BYTE, data) - * else: - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter_type) # <<<<<<<<<<<<<< - * glTexImage2D(GL_TEXTURE_2D, 0, ptype, size[0], size[1], 0, ptype, GL_UNSIGNED_BYTE, data) - * - */ - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, __pyx_v_filter_type); - - /* "rabbyt/rabbyt._rabbyt.pyx":275 - * else: - * glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter_type) - * glTexImage2D(GL_TEXTURE_2D, 0, ptype, size[0], size[1], 0, ptype, GL_UNSIGNED_BYTE, data) # <<<<<<<<<<<<<< - * - * def unload_texture(texture_id): - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_size, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyInt_from_py_GLsizei(__pyx_t_2); if (unlikely((__pyx_t_11 == (GLsizei)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_size, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyInt_from_py_GLsizei(__pyx_t_2); if (unlikely((__pyx_t_10 == (GLsizei)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - glTexImage2D(GL_TEXTURE_2D, 0, __pyx_v_ptype, __pyx_t_11, __pyx_t_10, 0, __pyx_v_ptype, GL_UNSIGNED_BYTE, __pyx_v_data); - } - __pyx_L7:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rabbyt._rabbyt.update_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_channels); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_19unload_texture(PyObject *__pyx_self, PyObject *__pyx_v_texture_id); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_18unload_texture[] = "\n ``unload_texture(texture_id)``\n\n Unload a texture from memory.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_19unload_texture = {__Pyx_NAMESTR("unload_texture"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_19unload_texture, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_18unload_texture)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_19unload_texture(PyObject *__pyx_self, PyObject *__pyx_v_texture_id) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("unload_texture (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_18unload_texture(__pyx_self, ((PyObject *)__pyx_v_texture_id)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":277 - * glTexImage2D(GL_TEXTURE_2D, 0, ptype, size[0], size[1], 0, ptype, GL_UNSIGNED_BYTE, data) - * - * def unload_texture(texture_id): # <<<<<<<<<<<<<< - * """ - * ``unload_texture(texture_id)`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_18unload_texture(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_texture_id) { - GLuint __pyx_v_textures[1]; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - GLuint __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("unload_texture", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":284 - * """ - * cdef GLuint textures[1] - * textures[0] = texture_id # <<<<<<<<<<<<<< - * glDeleteTextures(1, textures) - * - */ - __pyx_t_1 = __Pyx_PyInt_from_py_GLuint(__pyx_v_texture_id); if (unlikely((__pyx_t_1 == (GLuint)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - (__pyx_v_textures[0]) = __pyx_t_1; - - /* "rabbyt/rabbyt._rabbyt.pyx":285 - * cdef GLuint textures[1] - * textures[0] = texture_id - * glDeleteTextures(1, textures) # <<<<<<<<<<<<<< - * - * def clear(rgba=(0.0,0.0,0.0,1.0)): - */ - glDeleteTextures(1, __pyx_v_textures); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._rabbyt.unload_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_21clear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_7_rabbyt_20clear[] = "\n ``clear(rgba=(0.0,0.0,0.0,1.0))``\n\n Clear the screen to a background color.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_7_rabbyt_21clear = {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pw_6rabbyt_7_rabbyt_21clear, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_7_rabbyt_20clear)}; -static PyObject *__pyx_pw_6rabbyt_7_rabbyt_21clear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_rgba = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("clear (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__rgba,0}; - PyObject* values[1] = {0}; - values[0] = __pyx_k_16; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rgba); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clear") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_rgba = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("clear", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._rabbyt.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_7_rabbyt_20clear(__pyx_self, __pyx_v_rgba); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._rabbyt.pyx":287 - * glDeleteTextures(1, textures) - * - * def clear(rgba=(0.0,0.0,0.0,1.0)): # <<<<<<<<<<<<<< - * """ - * ``clear(rgba=(0.0,0.0,0.0,1.0))`` - */ - -static PyObject *__pyx_pf_6rabbyt_7_rabbyt_20clear(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_rgba) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - GLclampf __pyx_t_6; - GLclampf __pyx_t_7; - GLclampf __pyx_t_8; - GLclampf __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("clear", 0); - __Pyx_INCREF(__pyx_v_rgba); - - /* "rabbyt/rabbyt._rabbyt.pyx":293 - * Clear the screen to a background color. - * """ - * if len(rgba) == 3: # <<<<<<<<<<<<<< - * rgba = tuple(rgba) + (1.0,) - * glClearColor(rgba[0], rgba[1], rgba[2], rgba[3]) - */ - __pyx_t_1 = PyObject_Length(__pyx_v_rgba); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((__pyx_t_1 == 3) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._rabbyt.pyx":294 - * """ - * if len(rgba) == 3: - * rgba = tuple(rgba) + (1.0,) # <<<<<<<<<<<<<< - * glClearColor(rgba[0], rgba[1], rgba[2], rgba[3]) - * glClear(GL_COLOR_BUFFER_BIT) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_rgba); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_rgba); - __Pyx_GIVEREF(__pyx_v_rgba); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_rgba, ((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._rabbyt.pyx":295 - * if len(rgba) == 3: - * rgba = tuple(rgba) + (1.0,) - * glClearColor(rgba[0], rgba[1], rgba[2], rgba[3]) # <<<<<<<<<<<<<< - * glClear(GL_COLOR_BUFFER_BIT) - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rgba, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (GLclampf)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rgba, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (GLclampf)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rgba, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_8 == (GLclampf)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rgba, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_9 == (GLclampf)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - glClearColor(__pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9); - - /* "rabbyt/rabbyt._rabbyt.pyx":296 - * rgba = tuple(rgba) + (1.0,) - * glClearColor(rgba[0], rgba[1], rgba[2], rgba[3]) - * glClear(GL_COLOR_BUFFER_BIT) # <<<<<<<<<<<<<< - */ - glClear(GL_COLOR_BUFFER_BIT); - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rabbyt._rabbyt.clear", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_rgba); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - __Pyx_NAMESTR("_rabbyt"), - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1}, - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, - {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, - {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1}, - {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, - {&__pyx_n_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 1}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_n_s__RGB, __pyx_k__RGB, sizeof(__pyx_k__RGB), 0, 0, 1, 1}, - {&__pyx_n_s__RGBA, __pyx_k__RGBA, sizeof(__pyx_k__RGBA), 0, 0, 1, 1}, - {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____author__, __pyx_k____author__, sizeof(__pyx_k____author__), 0, 0, 1, 1}, - {&__pyx_n_s____credits__, __pyx_k____credits__, sizeof(__pyx_k____credits__), 0, 0, 1, 1}, - {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1}, - {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1}, - {&__pyx_n_s__byte_string, __pyx_k__byte_string, sizeof(__pyx_k__byte_string), 0, 0, 1, 1}, - {&__pyx_n_s__callback, __pyx_k__callback, sizeof(__pyx_k__callback), 0, 0, 1, 1}, - {&__pyx_n_s__channels, __pyx_k__channels, sizeof(__pyx_k__channels), 0, 0, 1, 1}, - {&__pyx_n_s__clear, __pyx_k__clear, sizeof(__pyx_k__clear), 0, 0, 1, 1}, - {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1}, - {&__pyx_n_s__filter, __pyx_k__filter, sizeof(__pyx_k__filter), 0, 0, 1, 1}, - {&__pyx_n_s__filter_type, __pyx_k__filter_type, sizeof(__pyx_k__filter_type), 0, 0, 1, 1}, - {&__pyx_n_s__g, __pyx_k__g, sizeof(__pyx_k__g), 0, 0, 1, 1}, - {&__pyx_n_s__get_gl_vendor, __pyx_k__get_gl_vendor, sizeof(__pyx_k__get_gl_vendor), 0, 0, 1, 1}, - {&__pyx_n_s__h, __pyx_k__h, sizeof(__pyx_k__h), 0, 0, 1, 1}, - {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1}, - {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1}, - {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1}, - {&__pyx_n_s__load_texture, __pyx_k__load_texture, sizeof(__pyx_k__load_texture), 0, 0, 1, 1}, - {&__pyx_n_s__mipmap, __pyx_k__mipmap, sizeof(__pyx_k__mipmap), 0, 0, 1, 1}, - {&__pyx_n_s__projection, __pyx_k__projection, sizeof(__pyx_k__projection), 0, 0, 1, 1}, - {&__pyx_n_s__ptype, __pyx_k__ptype, sizeof(__pyx_k__ptype), 0, 0, 1, 1}, - {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1}, - {&__pyx_n_s__render, __pyx_k__render, sizeof(__pyx_k__render), 0, 0, 1, 1}, - {&__pyx_n_s__render_sorted, __pyx_k__render_sorted, sizeof(__pyx_k__render_sorted), 0, 0, 1, 1}, - {&__pyx_n_s__render_unsorted, __pyx_k__render_unsorted, sizeof(__pyx_k__render_unsorted), 0, 0, 1, 1}, - {&__pyx_n_s__rgba, __pyx_k__rgba, sizeof(__pyx_k__rgba), 0, 0, 1, 1}, - {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1}, - {&__pyx_n_s__set_default_attribs, __pyx_k__set_default_attribs, sizeof(__pyx_k__set_default_attribs), 0, 0, 1, 1}, - {&__pyx_n_s__set_gl_color, __pyx_k__set_gl_color, sizeof(__pyx_k__set_gl_color), 0, 0, 1, 1}, - {&__pyx_n_s__set_viewport, __pyx_k__set_viewport, sizeof(__pyx_k__set_viewport), 0, 0, 1, 1}, - {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1}, - {&__pyx_n_s__sprites, __pyx_k__sprites, sizeof(__pyx_k__sprites), 0, 0, 1, 1}, - {&__pyx_n_s__ss, __pyx_k__ss, sizeof(__pyx_k__ss), 0, 0, 1, 1}, - {&__pyx_n_s__stacklevel, __pyx_k__stacklevel, sizeof(__pyx_k__stacklevel), 0, 0, 1, 1}, - {&__pyx_n_s__string, __pyx_k__string, sizeof(__pyx_k__string), 0, 0, 1, 1}, - {&__pyx_n_s__t, __pyx_k__t, sizeof(__pyx_k__t), 0, 0, 1, 1}, - {&__pyx_n_s__texture_id, __pyx_k__texture_id, sizeof(__pyx_k__texture_id), 0, 0, 1, 1}, - {&__pyx_n_s__textures, __pyx_k__textures, sizeof(__pyx_k__textures), 0, 0, 1, 1}, - {&__pyx_n_s__type_, __pyx_k__type_, sizeof(__pyx_k__type_), 0, 0, 1, 1}, - {&__pyx_n_s__unload_texture, __pyx_k__unload_texture, sizeof(__pyx_k__unload_texture), 0, 0, 1, 1}, - {&__pyx_n_s__update_texture, __pyx_k__update_texture, sizeof(__pyx_k__update_texture), 0, 0, 1, 1}, - {&__pyx_n_s__viewport, __pyx_k__viewport, sizeof(__pyx_k__viewport), 0, 0, 1, 1}, - {&__pyx_n_s__w, __pyx_k__w, sizeof(__pyx_k__w), 0, 0, 1, 1}, - {&__pyx_n_s__warn, __pyx_k__warn, sizeof(__pyx_k__warn), 0, 0, 1, 1}, - {&__pyx_n_s__warnings, __pyx_k__warnings, sizeof(__pyx_k__warnings), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "rabbyt/rabbyt._rabbyt.pyx":167 - * for i in (l,t,r,b): - * if i < 0: - * raise ValueError("Viewport values cannot be negative") # <<<<<<<<<<<<<< - * glViewport(l, t, r-l, b-t) - * - */ - __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_3); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3)); - - /* "rabbyt/rabbyt._rabbyt.pyx":205 - * This is a thin wrapper around ``glColor4f()``. - * """ - * warn("set_gl_color is deprecated. Use glColor4f instead.", # <<<<<<<<<<<<<< - * stacklevel=2) - * cdef float r,g,b,a - */ - __pyx_k_tuple_5 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_5); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - - /* "rabbyt/rabbyt._rabbyt.pyx":250 - * - * if not get_gl_vendor(): - * raise RuntimeError("Trying to load a texture without an OpenGL context") # <<<<<<<<<<<<<< - * - * cdef char *data - */ - __pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_11); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "rabbyt/rabbyt._rabbyt.pyx":261 - * channels = 3 - * else: - * raise ValueError('type_ must be "RGBA" or "RGB"') # <<<<<<<<<<<<<< - * - * if size[0]*size[1]*channels != len(byte_string): - */ - __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_13); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - - /* "rabbyt/rabbyt._rabbyt.pyx":264 - * - * if size[0]*size[1]*channels != len(byte_string): - * raise ValueError('byte_string is an unexpected size.') # <<<<<<<<<<<<<< - * - * filter_type = GL_NEAREST - */ - __pyx_k_tuple_15 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_14)); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_15); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - - /* "rabbyt/rabbyt._rabbyt.pyx":103 - * - * load_texture_file_hook = None - * def set_load_texture_file_hook(callback): # <<<<<<<<<<<<<< - * """ - * ``set_load_texture_file_hook(callback)`` - */ - __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__callback)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_19); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - __pyx_k_codeobj_20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s_21, 103, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":123 - * - * - * def render_unsorted(sprites): # <<<<<<<<<<<<<< - * """ - * ``render_unsorted(sprites)`` - */ - __pyx_k_tuple_24 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__sprites), ((PyObject *)__pyx_n_s__s)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_24); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - __pyx_k_codeobj_25 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__render_unsorted, 123, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":136 - * - * - * def render_sorted(sprites): # <<<<<<<<<<<<<< - * ss = list(sprites) - * ss.sort() - */ - __pyx_k_tuple_26 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__sprites), ((PyObject *)__pyx_n_s__ss)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_26); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26)); - __pyx_k_codeobj_27 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__render_sorted, 136, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":142 - * - * - * def set_viewport(viewport, projection=None): # <<<<<<<<<<<<<< - * """ - * ``set_viewport(viewport, [projection])`` - */ - __pyx_k_tuple_28 = PyTuple_Pack(9, ((PyObject *)__pyx_n_s__viewport), ((PyObject *)__pyx_n_s__projection), ((PyObject *)__pyx_n_s__l), ((PyObject *)__pyx_n_s__t), ((PyObject *)__pyx_n_s__r), ((PyObject *)__pyx_n_s__b), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__w), ((PyObject *)__pyx_n_s__h)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_28); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28)); - __pyx_k_codeobj_29 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__set_viewport, 142, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":183 - * glLoadIdentity() - * - * def set_default_attribs(): # <<<<<<<<<<<<<< - * """ - * ``set_default_attribs()`` - */ - __pyx_k_codeobj_30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__set_default_attribs, 183, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":199 - * - * - * def set_gl_color(rgba): # <<<<<<<<<<<<<< - * """ - * ``set_gl_color(rgba)`` - */ - __pyx_k_tuple_31 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__rgba), ((PyObject *)__pyx_n_s__r), ((PyObject *)__pyx_n_s__g), ((PyObject *)__pyx_n_s__b), ((PyObject *)__pyx_n_s__a)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_31); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31)); - __pyx_k_codeobj_32 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__set_gl_color, 199, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":211 - * glColor4f(r,g,b,a) - * - * def get_gl_vendor(): # <<<<<<<<<<<<<< - * """ - * ``gl_get_vendor()`` - */ - __pyx_k_tuple_33 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__string)); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_33); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33)); - __pyx_k_codeobj_34 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__get_gl_vendor, 211, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":227 - * # The following functions were ripped from Simmon Wittber's GFX library: - * - * def load_texture(byte_string, size, type_='RGBA', filter=True, mipmap=True): # <<<<<<<<<<<<<< - * """ - * ``load_texture(byte_string, size, type_='RGBA', filter=True, mipmap=True)`` - */ - __pyx_k_tuple_35 = PyTuple_Pack(7, ((PyObject *)__pyx_n_s__byte_string), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__type_), ((PyObject *)__pyx_n_s__filter), ((PyObject *)__pyx_n_s__mipmap), ((PyObject *)__pyx_n_s__textures), ((PyObject *)__pyx_n_s__id)); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_35); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35)); - __pyx_k_codeobj_36 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__load_texture, 227, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":240 - * return id - * - * def update_texture(texture_id, byte_string, size, type_='RGBA', filter=True, # <<<<<<<<<<<<<< - * mipmap=True): - * """ - */ - __pyx_k_tuple_37 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__texture_id), ((PyObject *)__pyx_n_s__byte_string), ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_n_s__type_), ((PyObject *)__pyx_n_s__filter), ((PyObject *)__pyx_n_s__mipmap), ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__ptype), ((PyObject *)__pyx_n_s__channels), ((PyObject *)__pyx_n_s__filter_type)); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_37); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37)); - __pyx_k_codeobj_38 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__update_texture, 240, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":277 - * glTexImage2D(GL_TEXTURE_2D, 0, ptype, size[0], size[1], 0, ptype, GL_UNSIGNED_BYTE, data) - * - * def unload_texture(texture_id): # <<<<<<<<<<<<<< - * """ - * ``unload_texture(texture_id)`` - */ - __pyx_k_tuple_39 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__texture_id), ((PyObject *)__pyx_n_s__textures)); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_39); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39)); - __pyx_k_codeobj_40 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__unload_texture, 277, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":287 - * glDeleteTextures(1, textures) - * - * def clear(rgba=(0.0,0.0,0.0,1.0)): # <<<<<<<<<<<<<< - * """ - * ``clear(rgba=(0.0,0.0,0.0,1.0))`` - */ - __pyx_k_tuple_41 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__rgba)); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_41); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41)); - __pyx_k_codeobj_42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_22, __pyx_n_s__clear, 287, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_rabbyt(void); /*proto*/ -PyMODINIT_FUNC init_rabbyt(void) -#else -PyMODINIT_FUNC PyInit__rabbyt(void); /*proto*/ -PyMODINIT_FUNC PyInit__rabbyt(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__rabbyt(void)", 0); - if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __Pyx_CyFunction_USED - if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_rabbyt"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_d); - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "rabbyt._rabbyt")) { - if (unlikely(PyDict_SetItemString(modules, "rabbyt._rabbyt", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__pyx_module_is_main_rabbyt___rabbyt) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "rabbyt/rabbyt._rabbyt.pyx":2 - * __credits__ = ( - * """ # <<<<<<<<<<<<<< - * Copyright (C) 2007 Matthew Marshall - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____credits__, ((PyObject *)__pyx_kp_s_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":24 - * """) - * - * __author__ = "Matthew Marshall " # <<<<<<<<<<<<<< - * - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_18)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":100 - * cdef GLint gluBuild2DMipmaps( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, void *data) - * - * from warnings import warn # <<<<<<<<<<<<<< - * - * load_texture_file_hook = None - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__warn)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__warn)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__warn)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), ((PyObject *)__pyx_t_1), -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__warn, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":102 - * from warnings import warn - * - * load_texture_file_hook = None # <<<<<<<<<<<<<< - * def set_load_texture_file_hook(callback): - * """ - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_1, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._rabbyt.pyx":103 - * - * load_texture_file_hook = None - * def set_load_texture_file_hook(callback): # <<<<<<<<<<<<<< - * """ - * ``set_load_texture_file_hook(callback)`` - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_1set_load_texture_file_hook, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_21, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":123 - * - * - * def render_unsorted(sprites): # <<<<<<<<<<<<<< - * """ - * ``render_unsorted(sprites)`` - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_3render_unsorted, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__render_unsorted, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":136 - * - * - * def render_sorted(sprites): # <<<<<<<<<<<<<< - * ss = list(sprites) - * ss.sort() - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_5render_sorted, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__render_sorted, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":142 - * - * - * def set_viewport(viewport, projection=None): # <<<<<<<<<<<<<< - * """ - * ``set_viewport(viewport, [projection])`` - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_7set_viewport, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_viewport, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":183 - * glLoadIdentity() - * - * def set_default_attribs(): # <<<<<<<<<<<<<< - * """ - * ``set_default_attribs()`` - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_9set_default_attribs, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_default_attribs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":199 - * - * - * def set_gl_color(rgba): # <<<<<<<<<<<<<< - * """ - * ``set_gl_color(rgba)`` - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_11set_gl_color, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_gl_color, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":211 - * glColor4f(r,g,b,a) - * - * def get_gl_vendor(): # <<<<<<<<<<<<<< - * """ - * ``gl_get_vendor()`` - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_13get_gl_vendor, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__get_gl_vendor, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":227 - * # The following functions were ripped from Simmon Wittber's GFX library: - * - * def load_texture(byte_string, size, type_='RGBA', filter=True, mipmap=True): # <<<<<<<<<<<<<< - * """ - * ``load_texture(byte_string, size, type_='RGBA', filter=True, mipmap=True)`` - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_k_6 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_k_7 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_15load_texture, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__load_texture, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":240 - * return id - * - * def update_texture(texture_id, byte_string, size, type_='RGBA', filter=True, # <<<<<<<<<<<<<< - * mipmap=True): - * """ - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_k_8 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":241 - * - * def update_texture(texture_id, byte_string, size, type_='RGBA', filter=True, - * mipmap=True): # <<<<<<<<<<<<<< - * """ - * ``update_texture(texture_id, byte_string, size, type_='RGBA', filter=True, - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_k_9 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":240 - * return id - * - * def update_texture(texture_id, byte_string, size, type_='RGBA', filter=True, # <<<<<<<<<<<<<< - * mipmap=True): - * """ - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_17update_texture, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__update_texture, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":277 - * glTexImage2D(GL_TEXTURE_2D, 0, ptype, size[0], size[1], 0, ptype, GL_UNSIGNED_BYTE, data) - * - * def unload_texture(texture_id): # <<<<<<<<<<<<<< - * """ - * ``unload_texture(texture_id)`` - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_19unload_texture, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__unload_texture, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":287 - * glDeleteTextures(1, textures) - * - * def clear(rgba=(0.0,0.0,0.0,1.0)): # <<<<<<<<<<<<<< - * """ - * ``clear(rgba=(0.0,0.0,0.0,1.0))`` - */ - __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_k_16 = ((PyObject *)__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_7_rabbyt_21clear, NULL, __pyx_n_s_23); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__clear, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rabbyt/rabbyt._rabbyt.pyx":1 - * __credits__ = ( # <<<<<<<<<<<<<< - * """ - * Copyright (C) 2007 Matthew Marshall - */ - __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - if (__pyx_m) { - __Pyx_AddTraceback("init rabbyt._rabbyt", __pyx_clineno, __pyx_lineno, __pyx_filename); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init rabbyt._rabbyt"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif /* CYTHON_REFNANNY */ - -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (result) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack", - index, (index == 1) ? "" : "s"); -} - -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_Restore(type, value, tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(type, value, tb); -#endif -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - #if PY_VERSION_HEX < 0x02050000 - if (PyClass_Check(type)) { - #else - if (PyType_Check(type)) { - #endif -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else /* Python 3+ */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyEval_CallObject(type, args); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - return NULL; - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - #if PY_VERSION_HEX >= 0x02050000 - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; /* try absolute import on failure */ - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } - #else - if (level>0) { - PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); - goto bad; - } - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); - #endif -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -static CYTHON_INLINE GLint __Pyx_PyInt_from_py_GLint(PyObject* x) { - const GLint neg_one = (GLint)-1, const_zero = (GLint)0; - const int is_unsigned = const_zero < neg_one; - if (sizeof(GLint) == sizeof(char)) { - if (is_unsigned) - return (GLint)__Pyx_PyInt_AsUnsignedChar(x); - else - return (GLint)__Pyx_PyInt_AsSignedChar(x); - } else if (sizeof(GLint) == sizeof(short)) { - if (is_unsigned) - return (GLint)__Pyx_PyInt_AsUnsignedShort(x); - else - return (GLint)__Pyx_PyInt_AsSignedShort(x); - } else if (sizeof(GLint) == sizeof(int)) { - if (is_unsigned) - return (GLint)__Pyx_PyInt_AsUnsignedInt(x); - else - return (GLint)__Pyx_PyInt_AsSignedInt(x); - } else if (sizeof(GLint) == sizeof(long)) { - if (is_unsigned) - return (GLint)__Pyx_PyInt_AsUnsignedLong(x); - else - return (GLint)__Pyx_PyInt_AsSignedLong(x); - } else if (sizeof(GLint) == sizeof(PY_LONG_LONG)) { - if (is_unsigned) - return (GLint)__Pyx_PyInt_AsUnsignedLongLong(x); - else - return (GLint)__Pyx_PyInt_AsSignedLongLong(x); - } else { - #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); - #else - GLint val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } - #endif - return (GLint)-1; - } -} - -static CYTHON_INLINE GLsizei __Pyx_PyInt_from_py_GLsizei(PyObject* x) { - const GLsizei neg_one = (GLsizei)-1, const_zero = (GLsizei)0; - const int is_unsigned = const_zero < neg_one; - if (sizeof(GLsizei) == sizeof(char)) { - if (is_unsigned) - return (GLsizei)__Pyx_PyInt_AsUnsignedChar(x); - else - return (GLsizei)__Pyx_PyInt_AsSignedChar(x); - } else if (sizeof(GLsizei) == sizeof(short)) { - if (is_unsigned) - return (GLsizei)__Pyx_PyInt_AsUnsignedShort(x); - else - return (GLsizei)__Pyx_PyInt_AsSignedShort(x); - } else if (sizeof(GLsizei) == sizeof(int)) { - if (is_unsigned) - return (GLsizei)__Pyx_PyInt_AsUnsignedInt(x); - else - return (GLsizei)__Pyx_PyInt_AsSignedInt(x); - } else if (sizeof(GLsizei) == sizeof(long)) { - if (is_unsigned) - return (GLsizei)__Pyx_PyInt_AsUnsignedLong(x); - else - return (GLsizei)__Pyx_PyInt_AsSignedLong(x); - } else if (sizeof(GLsizei) == sizeof(PY_LONG_LONG)) { - if (is_unsigned) - return (GLsizei)__Pyx_PyInt_AsUnsignedLongLong(x); - else - return (GLsizei)__Pyx_PyInt_AsSignedLongLong(x); - } else { - #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); - #else - GLsizei val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } - #endif - return (GLsizei)-1; - } -} - -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_GLuint(GLuint val) { - const GLuint neg_one = (GLuint)-1, const_zero = (GLuint)0; - const int is_unsigned = const_zero < neg_one; - if ((sizeof(GLuint) == sizeof(char)) || - (sizeof(GLuint) == sizeof(short))) { - return PyInt_FromLong((long)val); - } else if ((sizeof(GLuint) == sizeof(int)) || - (sizeof(GLuint) == sizeof(long))) { - if (is_unsigned) - return PyLong_FromUnsignedLong((unsigned long)val); - else - return PyInt_FromLong((long)val); - } else if (sizeof(GLuint) == sizeof(PY_LONG_LONG)) { - if (is_unsigned) - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); - else - return PyLong_FromLongLong((PY_LONG_LONG)val); - } else { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - return _PyLong_FromByteArray(bytes, sizeof(GLuint), - little, !is_unsigned); - } -} - -static CYTHON_INLINE GLuint __Pyx_PyInt_from_py_GLuint(PyObject* x) { - const GLuint neg_one = (GLuint)-1, const_zero = (GLuint)0; - const int is_unsigned = const_zero < neg_one; - if (sizeof(GLuint) == sizeof(char)) { - if (is_unsigned) - return (GLuint)__Pyx_PyInt_AsUnsignedChar(x); - else - return (GLuint)__Pyx_PyInt_AsSignedChar(x); - } else if (sizeof(GLuint) == sizeof(short)) { - if (is_unsigned) - return (GLuint)__Pyx_PyInt_AsUnsignedShort(x); - else - return (GLuint)__Pyx_PyInt_AsSignedShort(x); - } else if (sizeof(GLuint) == sizeof(int)) { - if (is_unsigned) - return (GLuint)__Pyx_PyInt_AsUnsignedInt(x); - else - return (GLuint)__Pyx_PyInt_AsSignedInt(x); - } else if (sizeof(GLuint) == sizeof(long)) { - if (is_unsigned) - return (GLuint)__Pyx_PyInt_AsUnsignedLong(x); - else - return (GLuint)__Pyx_PyInt_AsSignedLong(x); - } else if (sizeof(GLuint) == sizeof(PY_LONG_LONG)) { - if (is_unsigned) - return (GLuint)__Pyx_PyInt_AsUnsignedLongLong(x); - else - return (GLuint)__Pyx_PyInt_AsSignedLongLong(x); - } else { - #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); - #else - GLuint val; - PyObject *v = __Pyx_PyNumber_Int(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } - #endif - return (GLuint)-1; - } -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned long)PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (long)PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed long)PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - #if PY_VERSION_HEX < 0x02050000 - return PyErr_Warn(NULL, message); - #else - return PyErr_WarnEx(NULL, message, 1); - #endif - } - return 0; -} - -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = (start + end) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, /*int argcount,*/ - 0, /*int kwonlyargcount,*/ - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_globals = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else /* PY_VERSION_HEX < 0x03030000 */ - if (PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_DATA_SIZE(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ - return PyUnicode_AsUTF8AndSize(o, length); -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ -#endif /* PY_VERSION_HEX < 0x03030000 */ - } else -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (r < 0) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred()) - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/rabbyt/rabbyt._sprites.c b/rabbyt/rabbyt._sprites.c deleted file mode 100644 index 5b4d934..0000000 --- a/rabbyt/rabbyt._sprites.c +++ /dev/null @@ -1,6220 +0,0 @@ -/* Generated by Cython 0.19.2 on Mon Dec 16 21:31:30 2013 */ - -#define PY_SSIZE_T_CLEAN -#ifndef CYTHON_USE_PYLONG_INTERNALS -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 0 -#else -#include "pyconfig.h" -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 1 -#else -#define CYTHON_USE_PYLONG_INTERNALS 0 -#endif -#endif -#endif -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02040000 - #error Cython requires Python 2.4+. -#else -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION -#define CYTHON_COMPILING_IN_PYPY 1 -#define CYTHON_COMPILING_IN_CPYTHON 0 -#else -#define CYTHON_COMPILING_IN_PYPY 0 -#define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define CYTHON_FORMAT_SSIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) - #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ - (PyErr_Format(PyExc_TypeError, \ - "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ - (PyObject*)0)) - #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ - !PyComplex_Check(o)) - #define PyIndex_Check __Pyx_PyIndex_Check - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) - #define __PYX_BUILD_PY_SSIZE_T "i" -#else - #define __PYX_BUILD_PY_SSIZE_T "n" - #define CYTHON_FORMAT_SSIZE_T "z" - #define __Pyx_PyIndex_Check PyIndex_Check -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) - #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) - typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); - typedef void (*releasebufferproc)(PyObject *, Py_buffer *); -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 - #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_TPFLAGS_HAVE_VERSION_TAG 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ - PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_VERSION_HEX < 0x03020000 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and - a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is - a quiet NaN. */ - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE__rabbyt___sprites -#define __PYX_HAVE_API__rabbyt___sprites -#include "anim_sys.h" -#include "include_math.h" -#include "stdlib.h" -#include "include_gl.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) -#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return u_end - u - 1; -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (ascii_chars_u == NULL) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - } - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - default_encoding_c = PyBytes_AS_STRING(default_encoding); - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(sys); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -#ifdef __GNUC__ - /* Test for GCC > 2.95 */ - #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #else /* __GNUC__ > 2 ... */ - #define likely(x) (x) - #define unlikely(x) (x) - #endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "rabbyt._sprites.pyx", - "primitives.pxd", - "_anims.pxd", -}; - -/*--- Type declarations ---*/ -struct __pyx_obj_6rabbyt_6_anims_cAnimable; -struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite; -struct __pyx_obj_6rabbyt_8_sprites_cSprite; -struct __pyx_obj_6rabbyt_6_anims_Anim; -struct __pyx_obj_6rabbyt_6_anims_AnimSlot; -struct __pyx_obj_6rabbyt_10primitives_Quad; -struct __pyx_t_6rabbyt_10primitives_Point2d; -struct __pyx_t_6rabbyt_10primitives_float2; - -/* "primitives.pxd":1 - * cdef struct Point2d: # <<<<<<<<<<<<<< - * float x,y - * - */ -struct __pyx_t_6rabbyt_10primitives_Point2d { - float x; - float y; -}; - -/* "primitives.pxd":4 - * float x,y - * - * cdef struct float2: # <<<<<<<<<<<<<< - * float a, b - * - */ -struct __pyx_t_6rabbyt_10primitives_float2 { - float a; - float b; -}; - -/* "_anims.pxd":34 - * cdef void READ_SLOT(AnimSlot_s * slot, float * out) - * - * cdef class cAnimable: # <<<<<<<<<<<<<< - * cdef object _anim_list - * cdef int c_slot_count - */ -struct __pyx_obj_6rabbyt_6_anims_cAnimable { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable *__pyx_vtab; - PyObject *_anim_list; - int c_slot_count; - AnimSlot_s **c_anim_slots; -}; - - -/* "rabbyt\_sprites.pxd":5 - * from _anims cimport cAnimable, AnimSlot, AnimSlot_s, READ_SLOT - * - * cdef class cBaseSprite(cAnimable): # <<<<<<<<<<<<<< - * cdef float _bounding_radius - * cdef AnimSlot_s _x, _y, _rot - */ -struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite { - struct __pyx_obj_6rabbyt_6_anims_cAnimable __pyx_base; - float _bounding_radius; - AnimSlot_s _x; - AnimSlot_s _y; - AnimSlot_s _rot; - AnimSlot_s _red; - AnimSlot_s _green; - AnimSlot_s _blue; - AnimSlot_s _alpha; - AnimSlot_s _scale_x; - AnimSlot_s _scale_y; -}; - - -/* "rabbyt\_sprites.pxd":15 - * - * - * cdef class cSprite(cBaseSprite): # <<<<<<<<<<<<<< - * cdef Quad _shape - * cdef Quad _tex_shape - */ -struct __pyx_obj_6rabbyt_8_sprites_cSprite { - struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite __pyx_base; - struct __pyx_obj_6rabbyt_10primitives_Quad *_shape; - struct __pyx_obj_6rabbyt_10primitives_Quad *_tex_shape; - AnimSlot_s _u; - AnimSlot_s _v; - int _texture_id; - int _bounding_radius_is_explicit; -}; - - -/* "_anims.pxd":40 - * cdef _modify_slots(self) - * - * cdef class Anim: # <<<<<<<<<<<<<< - * cdef Anim_s _anim - * cdef object dependencies - */ -struct __pyx_obj_6rabbyt_6_anims_Anim { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtab; - Anim_s _anim; - PyObject *dependencies; -}; - - -/* "_anims.pxd":45 - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1 - * - * cdef class AnimSlot: # <<<<<<<<<<<<<< - * cdef AnimSlot_s _internal_slot - * cdef AnimSlot_s * _slot - */ -struct __pyx_obj_6rabbyt_6_anims_AnimSlot { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *__pyx_vtab; - AnimSlot_s _internal_slot; - AnimSlot_s *_slot; - struct __pyx_obj_6rabbyt_6_anims_Anim *_py_anim; -}; - - -/* "primitives.pxd":7 - * float a, b - * - * cdef class Quad: # <<<<<<<<<<<<<< - * cdef Point2d v[4] - * cdef public float bounding_radius - */ -struct __pyx_obj_6rabbyt_10primitives_Quad { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *__pyx_vtab; - struct __pyx_t_6rabbyt_10primitives_Point2d v[4]; - float bounding_radius; -}; - - - -/* "_anims.pxd":40 - * cdef _modify_slots(self) - * - * cdef class Anim: # <<<<<<<<<<<<<< - * cdef Anim_s _anim - * cdef object dependencies - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_Anim { - int (*add_dependency)(struct __pyx_obj_6rabbyt_6_anims_Anim *, PyObject *, AnimSlot_s *); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtabptr_6rabbyt_6_anims_Anim; - - -/* "_anims.pxd":34 - * cdef void READ_SLOT(AnimSlot_s * slot, float * out) - * - * cdef class cAnimable: # <<<<<<<<<<<<<< - * cdef object _anim_list - * cdef int c_slot_count - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable { - PyObject *(*_modify_slots)(struct __pyx_obj_6rabbyt_6_anims_cAnimable *); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable *__pyx_vtabptr_6rabbyt_6_anims_cAnimable; - - -/* "rabbyt/rabbyt._sprites.pyx":126 - * from _anims cimport cAnimable, AnimSlot, AnimSlot_s, READ_SLOT - * - * cdef class cBaseSprite(cAnimable): # <<<<<<<<<<<<<< - * #cdef float _bounding_radius - * #cdef AnimSlot_s _x, _y, _rot - */ - -struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite { - struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable __pyx_base; - struct __pyx_t_6rabbyt_10primitives_Point2d (*_convert_offset)(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *, float, float); -}; -static struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite *__pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite; - - -/* "rabbyt/rabbyt._sprites.pyx":261 - * - * - * cdef class cSprite(cBaseSprite): # <<<<<<<<<<<<<< - * #cdef Quad _shape - * #cdef Quad _tex_shape - */ - -struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite { - struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite __pyx_base; - int (*_render)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_x)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_y)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *); -}; -static struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *__pyx_vtabptr_6rabbyt_8_sprites_cSprite; - - -/* "primitives.pxd":7 - * float a, b - * - * cdef class Quad: # <<<<<<<<<<<<<< - * cdef Point2d v[4] - * cdef public float bounding_radius - */ - -struct __pyx_vtabstruct_6rabbyt_10primitives_Quad { - void (*_shift_x)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float); - void (*_shift_y)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_x)(struct __pyx_obj_6rabbyt_10primitives_Quad *); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_y)(struct __pyx_obj_6rabbyt_10primitives_Quad *); - void (*_update_bounding_radius)(struct __pyx_obj_6rabbyt_10primitives_Quad *); -}; -static struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *__pyx_vtabptr_6rabbyt_10primitives_Quad; - - -/* "_anims.pxd":45 - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1 - * - * cdef class AnimSlot: # <<<<<<<<<<<<<< - * cdef AnimSlot_s _internal_slot - * cdef AnimSlot_s * _slot - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot { - int (*c_set_anim)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, struct __pyx_obj_6rabbyt_6_anims_Anim *); - struct __pyx_obj_6rabbyt_6_anims_Anim *(*c_get_anim)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *); - float (*c_get_value)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *); - int (*c_set_value)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, float); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *__pyx_vtabptr_6rabbyt_6_anims_AnimSlot; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - if (acquire_gil) { \ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - PyGILState_Release(__pyx_gilstate_save); \ - } else { \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext() \ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XDECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_XDECREF(tmp); \ - } while (0) -#define __Pyx_DECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_DECREF(tmp); \ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ - -#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ - -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif - return PyObject_SetAttr(obj, attr_name, value); -} -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc); - -static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse); - -static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc); - -static void* __Pyx_GetVtable(PyObject *dict); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_check_binary_version(void); - -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ - -typedef struct { - int code_line; - PyCodeObject* code_object; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - - -/* Module declarations from 'rabbyt.primitives' */ -static PyTypeObject *__pyx_ptype_6rabbyt_10primitives_Quad = 0; - -/* Module declarations from 'rabbyt._anims' */ -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_cAnimable = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_Anim = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimSlot = 0; - -/* Module declarations from 'rabbyt._sprites' */ -static PyTypeObject *__pyx_ptype_6rabbyt_8_sprites_cBaseSprite = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_8_sprites_cSprite = 0; -#define __Pyx_MODULE_NAME "rabbyt._sprites" -int __pyx_module_is_main_rabbyt___sprites = 0; - -/* Implementation of 'rabbyt._sprites' */ -static PyObject *__pyx_builtin_NotImplementedError; -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius___get__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self, PyObject *__pyx_v_v); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared___get__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self, float __pyx_v_r2); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_convert_offset(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self, PyObject *__pyx_v_offset); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_2render(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_4render_after_transform(CYTHON_UNUSED struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_v); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius_4__del__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, float __pyx_v_r2); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_4__del__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_5shape___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_5shape_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_9tex_shape___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_9tex_shape_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_10texture_id___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_10texture_id_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, int __pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_render(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_4left___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_4left_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_5right___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_5right_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_6bottom___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_6bottom_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_y); /* proto */ -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_3top___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_3top_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_y); /* proto */ -static PyObject *__pyx_tp_new_6rabbyt_8_sprites_cBaseSprite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_6rabbyt_8_sprites_cSprite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static char __pyx_k_1[] = "render_after_transform"; -static char __pyx_k_2[] = "\n bounding_radius\n\n This should be the distance of the farthest point from the center. It\n can be used for collision detection.\n "; -static char __pyx_k_3[] = "\n bounding_radius_squared\n\n This is just like ``bounding_radius``, only it's squared. (duh)\n\n ``bounding_radius`` and ``bounding_radius_squared`` are automatically\n kept in sync with each other.\n "; -static char __pyx_k_4[] = "\n bounding_radius\n\n This should be the distance of the farthest point from the center. It\n can be used for collision detection.\n\n By default this is calculated from the ``shape`` property, and is\n automatically updated whenever the shape is updated. However, you can\n set it explicitly yourself.\n\n After the value is explicitly set it will no longer be updated by\n changes to the shape. To revert back to the default behavior, delete\n the property using the ``del`` statement::\n\n del sprite.bounding_radius\n "; -static char __pyx_k_5[] = "\n The shape of the sprite.\n\n This must either be of the form ``[left, top, right, bottom]``, or a\n list of four coordinates, eg. ``[(0,0), (20,0), (20,20), (0,20)]``\n\n ``[-10, -10, 10, 10]`` is the default.\n\n When you assign to ``shape``, ``bounding_radius`` is automatically set\n to the distance of the farthest coordinate.\n "; -static char __pyx_k_6[] = "\n This defines how a texture is mapped onto the sprite.\n\n Like ``Sprite.shape``, you can give either\n ``[left, top, right, bottom]`` or a list of coordinates.\n\n The default is ``[0, 1, 1, 0]``, which uses the entire texture.\n\n For easy integration with pyglet, a tuple with four items will be\n interpreted as the format used by the ``tex_coords`` attribute\n of pyglet textures.\n "; -static char __pyx_k_7[] = " x coordinate of the left side of the sprite "; -static char __pyx_k_8[] = " x coordinate of the right side of the sprite "; -static char __pyx_k_9[] = " y coordinate of the bottom of the sprite "; -static char __pyx_k_10[] = " y coordinate of the top of the sprite "; -static char __pyx_k_11[] = "\nThe most interesting part of this module is probably the ``Sprite`` class.\n\nIf you need more specialized rendering, try subclassing from ``BaseSprite``.\n"; -static char __pyx_k_12[] = "\nCopyright (C) 2007 Matthew Marshall\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"; -static char __pyx_k_13[] = "Matthew Marshall "; -static char __pyx_k_14[] = "Sprite BaseSprite"; -static char __pyx_k__x[] = "x"; -static char __pyx_k__y[] = "y"; -static char __pyx_k__split[] = "split"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k____author__[] = "__author__"; -static char __pyx_k____credits__[] = "__credits__"; -static char __pyx_k____docs_all__[] = "__docs_all__"; -static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__"; -static char __pyx_k__NotImplementedError[] = "NotImplementedError"; -static char __pyx_k___tex_shape_data_ptr[] = "_tex_shape_data_ptr"; -static PyObject *__pyx_n_s_1; -static PyObject *__pyx_kp_s_12; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_n_s__NotImplementedError; -static PyObject *__pyx_n_s____author__; -static PyObject *__pyx_n_s____credits__; -static PyObject *__pyx_n_s____docs_all__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____pyx_vtable__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___tex_shape_data_ptr; -static PyObject *__pyx_n_s__split; -static PyObject *__pyx_n_s__x; -static PyObject *__pyx_n_s__y; - -/* "rabbyt/rabbyt._sprites.pyx":132 - * #cdef AnimSlot_s _scale_x, _scale_y - * - * cdef _modify_slots(self): # <<<<<<<<<<<<<< - * cAnimable._modify_slots(self) - * cdef AnimSlot slot - */ - -static PyObject *__pyx_f_6rabbyt_8_sprites_11cBaseSprite__modify_slots(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_slot = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_modify_slots", 0); - - /* "rabbyt/rabbyt._sprites.pyx":133 - * - * cdef _modify_slots(self): - * cAnimable._modify_slots(self) # <<<<<<<<<<<<<< - * cdef AnimSlot slot - * - */ - __pyx_t_1 = __pyx_vtabptr_6rabbyt_6_anims_cAnimable->_modify_slots(((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":136 - * cdef AnimSlot slot - * - * if (len(self._anim_list) > 0): # <<<<<<<<<<<<<< - * slot = self._anim_list[0] - * slot._slot = &self._x - */ - __pyx_t_1 = __pyx_v_self->__pyx_base._anim_list; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = ((__pyx_t_2 > 0) != 0); - if (__pyx_t_3) { - - /* "rabbyt/rabbyt._sprites.pyx":137 - * - * if (len(self._anim_list) > 0): - * slot = self._anim_list[0] # <<<<<<<<<<<<<< - * slot._slot = &self._x - * slot = self._anim_list[1] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":138 - * if (len(self._anim_list) > 0): - * slot = self._anim_list[0] - * slot._slot = &self._x # <<<<<<<<<<<<<< - * slot = self._anim_list[1] - * slot._slot = &self._y - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_x); - - /* "rabbyt/rabbyt._sprites.pyx":139 - * slot = self._anim_list[0] - * slot._slot = &self._x - * slot = self._anim_list[1] # <<<<<<<<<<<<<< - * slot._slot = &self._y - * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":140 - * slot._slot = &self._x - * slot = self._anim_list[1] - * slot._slot = &self._y # <<<<<<<<<<<<<< - * - * slot = self._anim_list[2] - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_y); - - /* "rabbyt/rabbyt._sprites.pyx":142 - * slot._slot = &self._y - * - * slot = self._anim_list[2] # <<<<<<<<<<<<<< - * slot._slot = &self._rot - * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":143 - * - * slot = self._anim_list[2] - * slot._slot = &self._rot # <<<<<<<<<<<<<< - * - * slot = self._anim_list[3] - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_rot); - - /* "rabbyt/rabbyt._sprites.pyx":145 - * slot._slot = &self._rot - * - * slot = self._anim_list[3] # <<<<<<<<<<<<<< - * slot._slot = &self._red - * slot = self._anim_list[4] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":146 - * - * slot = self._anim_list[3] - * slot._slot = &self._red # <<<<<<<<<<<<<< - * slot = self._anim_list[4] - * slot._slot = &self._green - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_red); - - /* "rabbyt/rabbyt._sprites.pyx":147 - * slot = self._anim_list[3] - * slot._slot = &self._red - * slot = self._anim_list[4] # <<<<<<<<<<<<<< - * slot._slot = &self._green - * slot = self._anim_list[5] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":148 - * slot._slot = &self._red - * slot = self._anim_list[4] - * slot._slot = &self._green # <<<<<<<<<<<<<< - * slot = self._anim_list[5] - * slot._slot = &self._blue - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_green); - - /* "rabbyt/rabbyt._sprites.pyx":149 - * slot = self._anim_list[4] - * slot._slot = &self._green - * slot = self._anim_list[5] # <<<<<<<<<<<<<< - * slot._slot = &self._blue - * slot = self._anim_list[6] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 5, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":150 - * slot._slot = &self._green - * slot = self._anim_list[5] - * slot._slot = &self._blue # <<<<<<<<<<<<<< - * slot = self._anim_list[6] - * slot._slot = &self._alpha - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_blue); - - /* "rabbyt/rabbyt._sprites.pyx":151 - * slot = self._anim_list[5] - * slot._slot = &self._blue - * slot = self._anim_list[6] # <<<<<<<<<<<<<< - * slot._slot = &self._alpha - * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 6, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":152 - * slot._slot = &self._blue - * slot = self._anim_list[6] - * slot._slot = &self._alpha # <<<<<<<<<<<<<< - * - * slot = self._anim_list[7] - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_alpha); - - /* "rabbyt/rabbyt._sprites.pyx":154 - * slot._slot = &self._alpha - * - * slot = self._anim_list[7] # <<<<<<<<<<<<<< - * slot._slot = &self._scale_x - * slot = self._anim_list[8] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 7, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":155 - * - * slot = self._anim_list[7] - * slot._slot = &self._scale_x # <<<<<<<<<<<<<< - * slot = self._anim_list[8] - * slot._slot = &self._scale_y - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_scale_x); - - /* "rabbyt/rabbyt._sprites.pyx":156 - * slot = self._anim_list[7] - * slot._slot = &self._scale_x - * slot = self._anim_list[8] # <<<<<<<<<<<<<< - * slot._slot = &self._scale_y - * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base._anim_list, 8, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":157 - * slot._slot = &self._scale_x - * slot = self._anim_list[8] - * slot._slot = &self._scale_y # <<<<<<<<<<<<<< - * - * property bounding_radius: - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_scale_y); - goto __pyx_L3; - } - __pyx_L3:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite._modify_slots", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_slot); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius___get__(((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":166 - * can be used for collision detection. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._bounding_radius - * def __set__(self, v): - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius___get__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":167 - * """ - * def __get__(self): - * return self._bounding_radius # <<<<<<<<<<<<<< - * def __set__(self, v): - * self._bounding_radius = v - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_bounding_radius); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite.bounding_radius.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self), ((PyObject *)__pyx_v_v)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":168 - * def __get__(self): - * return self._bounding_radius - * def __set__(self, v): # <<<<<<<<<<<<<< - * self._bounding_radius = v - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self, PyObject *__pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":169 - * return self._bounding_radius - * def __set__(self, v): - * self._bounding_radius = v # <<<<<<<<<<<<<< - * - * property bounding_radius_squared: - */ - __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_v); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->_bounding_radius = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite.bounding_radius.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared___get__(((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":180 - * kept in sync with each other. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._bounding_radius * self._bounding_radius - * def __set__(self, float r2): - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared___get__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":181 - * """ - * def __get__(self): - * return self._bounding_radius * self._bounding_radius # <<<<<<<<<<<<<< - * def __set__(self, float r2): - * self._bounding_radius = sqrtf(r2) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_bounding_radius * __pyx_v_self->_bounding_radius)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite.bounding_radius_squared.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_r2); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_r2) { - float __pyx_v_r2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_r2); { - __pyx_v_r2 = __pyx_PyFloat_AsFloat(__pyx_arg_r2); if (unlikely((__pyx_v_r2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite.bounding_radius_squared.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self), ((float)__pyx_v_r2)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":182 - * def __get__(self): - * return self._bounding_radius * self._bounding_radius - * def __set__(self, float r2): # <<<<<<<<<<<<<< - * self._bounding_radius = sqrtf(r2) - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self, float __pyx_v_r2) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":183 - * return self._bounding_radius * self._bounding_radius - * def __set__(self, float r2): - * self._bounding_radius = sqrtf(r2) # <<<<<<<<<<<<<< - * - * cdef Point2d _convert_offset(self, float ox, float oy): - */ - __pyx_v_self->_bounding_radius = sqrtf(__pyx_v_r2); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":185 - * self._bounding_radius = sqrtf(r2) - * - * cdef Point2d _convert_offset(self, float ox, float oy): # <<<<<<<<<<<<<< - * cdef float x, y, sx, sy, r, co, si - * cdef Point2d out - */ - -static struct __pyx_t_6rabbyt_10primitives_Point2d __pyx_f_6rabbyt_8_sprites_11cBaseSprite__convert_offset(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self, float __pyx_v_ox, float __pyx_v_oy) { - float __pyx_v_x; - float __pyx_v_y; - float __pyx_v_sx; - float __pyx_v_sy; - float __pyx_v_r; - float __pyx_v_co; - float __pyx_v_si; - struct __pyx_t_6rabbyt_10primitives_Point2d __pyx_v_out; - struct __pyx_t_6rabbyt_10primitives_Point2d __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_convert_offset", 0); - - /* "rabbyt/rabbyt._sprites.pyx":188 - * cdef float x, y, sx, sy, r, co, si - * cdef Point2d out - * READ_SLOT(&self._x, &x) # <<<<<<<<<<<<<< - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._scale_x, &sx) - */ - READ_SLOT((&__pyx_v_self->_x), (&__pyx_v_x)); - - /* "rabbyt/rabbyt._sprites.pyx":189 - * cdef Point2d out - * READ_SLOT(&self._x, &x) - * READ_SLOT(&self._y, &y) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - */ - READ_SLOT((&__pyx_v_self->_y), (&__pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":190 - * READ_SLOT(&self._x, &x) - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._scale_x, &sx) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) - */ - READ_SLOT((&__pyx_v_self->_scale_x), (&__pyx_v_sx)); - - /* "rabbyt/rabbyt._sprites.pyx":191 - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) # <<<<<<<<<<<<<< - * READ_SLOT(&self._rot, &r) - * - */ - READ_SLOT((&__pyx_v_self->_scale_y), (&__pyx_v_sy)); - - /* "rabbyt/rabbyt._sprites.pyx":192 - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) # <<<<<<<<<<<<<< - * - * co = cosf(r*PI_OVER_180) - */ - READ_SLOT((&__pyx_v_self->_rot), (&__pyx_v_r)); - - /* "rabbyt/rabbyt._sprites.pyx":194 - * READ_SLOT(&self._rot, &r) - * - * co = cosf(r*PI_OVER_180) # <<<<<<<<<<<<<< - * si = sinf(r*PI_OVER_180) - * out.x = (ox*sx*co - oy*sy*si) + x - */ - __pyx_v_co = cosf((__pyx_v_r * PI_OVER_180)); - - /* "rabbyt/rabbyt._sprites.pyx":195 - * - * co = cosf(r*PI_OVER_180) - * si = sinf(r*PI_OVER_180) # <<<<<<<<<<<<<< - * out.x = (ox*sx*co - oy*sy*si) + x - * out.y = (ox*sx*si + oy*sy*co) + y - */ - __pyx_v_si = sinf((__pyx_v_r * PI_OVER_180)); - - /* "rabbyt/rabbyt._sprites.pyx":196 - * co = cosf(r*PI_OVER_180) - * si = sinf(r*PI_OVER_180) - * out.x = (ox*sx*co - oy*sy*si) + x # <<<<<<<<<<<<<< - * out.y = (ox*sx*si + oy*sy*co) + y - * return out - */ - __pyx_v_out.x = ((((__pyx_v_ox * __pyx_v_sx) * __pyx_v_co) - ((__pyx_v_oy * __pyx_v_sy) * __pyx_v_si)) + __pyx_v_x); - - /* "rabbyt/rabbyt._sprites.pyx":197 - * si = sinf(r*PI_OVER_180) - * out.x = (ox*sx*co - oy*sy*si) + x - * out.y = (ox*sx*si + oy*sy*co) + y # <<<<<<<<<<<<<< - * return out - * - */ - __pyx_v_out.y = ((((__pyx_v_ox * __pyx_v_sx) * __pyx_v_si) + ((__pyx_v_oy * __pyx_v_sy) * __pyx_v_co)) + __pyx_v_y); - - /* "rabbyt/rabbyt._sprites.pyx":198 - * out.x = (ox*sx*co - oy*sy*si) + x - * out.y = (ox*sx*si + oy*sy*co) + y - * return out # <<<<<<<<<<<<<< - * - * def convert_offset(self, offset): - */ - __pyx_r = __pyx_v_out; - goto __pyx_L0; - - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_1convert_offset(PyObject *__pyx_v_self, PyObject *__pyx_v_offset); /*proto*/ -static char __pyx_doc_6rabbyt_8_sprites_11cBaseSprite_convert_offset[] = "\n ``convert_offset((x, y)) -> (x, y)``\n\n Converts coordinates relative to this sprite to global coordinates,\n including rotation and scaling.\n "; -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_1convert_offset(PyObject *__pyx_v_self, PyObject *__pyx_v_offset) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("convert_offset (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_convert_offset(((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self), ((PyObject *)__pyx_v_offset)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":200 - * return out - * - * def convert_offset(self, offset): # <<<<<<<<<<<<<< - * """ - * ``convert_offset((x, y)) -> (x, y)`` - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_convert_offset(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self, PyObject *__pyx_v_offset) { - struct __pyx_t_6rabbyt_10primitives_Point2d __pyx_v_c_offset; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - float __pyx_t_2; - float __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("convert_offset", 0); - - /* "rabbyt/rabbyt._sprites.pyx":208 - * """ - * cdef Point2d c_offset, out_offset - * c_offset = self._convert_offset(offset[0], offset[1]) # <<<<<<<<<<<<<< - * return (c_offset.x, c_offset.y) - * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_offset, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_offset, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_c_offset = ((struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self->__pyx_base.__pyx_vtab)->_convert_offset(__pyx_v_self, __pyx_t_2, __pyx_t_3); - - /* "rabbyt/rabbyt._sprites.pyx":209 - * cdef Point2d c_offset, out_offset - * c_offset = self._convert_offset(offset[0], offset[1]) - * return (c_offset.x, c_offset.y) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c_offset.x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_c_offset.y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_1 = 0; - __pyx_t_4 = 0; - __pyx_r = ((PyObject *)__pyx_t_5); - __pyx_t_5 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite.convert_offset", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_3render(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6rabbyt_8_sprites_11cBaseSprite_2render[] = "\n ``render()``\n\n Renders the sprite.\n\n By default, this method will transform the OpenGL modelview matrix\n according to ``x``, ``y``, ``scale``, and ``rot``, and call\n ``render_after_transform()``.\n\n If you want transformations to be handled for you, leave this method and\n override ``render_after_transform()``. Otherwise, override\n ``render()``.\n "; -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_3render(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("render (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_2render(((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":212 - * - * - * def render(self): # <<<<<<<<<<<<<< - * """ - * ``render()`` - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_2render(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self) { - float __pyx_v_x; - float __pyx_v_y; - float __pyx_v_sx; - float __pyx_v_sy; - float __pyx_v_r; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("render", 0); - - /* "rabbyt/rabbyt._sprites.pyx":228 - * cdef float x, y, sx, sy, r - * - * READ_SLOT(&self._x, &x) # <<<<<<<<<<<<<< - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._scale_x, &sx) - */ - READ_SLOT((&__pyx_v_self->_x), (&__pyx_v_x)); - - /* "rabbyt/rabbyt._sprites.pyx":229 - * - * READ_SLOT(&self._x, &x) - * READ_SLOT(&self._y, &y) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - */ - READ_SLOT((&__pyx_v_self->_y), (&__pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":230 - * READ_SLOT(&self._x, &x) - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._scale_x, &sx) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) - */ - READ_SLOT((&__pyx_v_self->_scale_x), (&__pyx_v_sx)); - - /* "rabbyt/rabbyt._sprites.pyx":231 - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) # <<<<<<<<<<<<<< - * READ_SLOT(&self._rot, &r) - * - */ - READ_SLOT((&__pyx_v_self->_scale_y), (&__pyx_v_sy)); - - /* "rabbyt/rabbyt._sprites.pyx":232 - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) # <<<<<<<<<<<<<< - * - * if x != 0 or y != 0 or sx != 1 or sy != 1 or r != 0: - */ - READ_SLOT((&__pyx_v_self->_rot), (&__pyx_v_r)); - - /* "rabbyt/rabbyt._sprites.pyx":234 - * READ_SLOT(&self._rot, &r) - * - * if x != 0 or y != 0 or sx != 1 or sy != 1 or r != 0: # <<<<<<<<<<<<<< - * glPushMatrix() - * try: - */ - __pyx_t_1 = ((__pyx_v_x != 0.0) != 0); - if (!__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_y != 0.0) != 0); - if (!__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_sx != 1.0) != 0); - if (!__pyx_t_3) { - __pyx_t_4 = ((__pyx_v_sy != 1.0) != 0); - if (!__pyx_t_4) { - __pyx_t_5 = ((__pyx_v_r != 0.0) != 0); - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_4; - } - __pyx_t_4 = __pyx_t_6; - } else { - __pyx_t_4 = __pyx_t_3; - } - __pyx_t_3 = __pyx_t_4; - } else { - __pyx_t_3 = __pyx_t_2; - } - __pyx_t_2 = __pyx_t_3; - } else { - __pyx_t_2 = __pyx_t_1; - } - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._sprites.pyx":235 - * - * if x != 0 or y != 0 or sx != 1 or sy != 1 or r != 0: - * glPushMatrix() # <<<<<<<<<<<<<< - * try: - * glTranslatef(x, y, 0) - */ - glPushMatrix(); - - /* "rabbyt/rabbyt._sprites.pyx":236 - * if x != 0 or y != 0 or sx != 1 or sy != 1 or r != 0: - * glPushMatrix() - * try: # <<<<<<<<<<<<<< - * glTranslatef(x, y, 0) - * if r != 0: - */ - /*try:*/ { - - /* "rabbyt/rabbyt._sprites.pyx":237 - * glPushMatrix() - * try: - * glTranslatef(x, y, 0) # <<<<<<<<<<<<<< - * if r != 0: - * glRotatef(r,0,0,1) - */ - glTranslatef(__pyx_v_x, __pyx_v_y, 0.0); - - /* "rabbyt/rabbyt._sprites.pyx":238 - * try: - * glTranslatef(x, y, 0) - * if r != 0: # <<<<<<<<<<<<<< - * glRotatef(r,0,0,1) - * if sx != 1 or sy != 1: - */ - __pyx_t_2 = ((__pyx_v_r != 0.0) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._sprites.pyx":239 - * glTranslatef(x, y, 0) - * if r != 0: - * glRotatef(r,0,0,1) # <<<<<<<<<<<<<< - * if sx != 1 or sy != 1: - * glScalef(sx, sy, 1) - */ - glRotatef(__pyx_v_r, 0.0, 0.0, 1.0); - goto __pyx_L7; - } - __pyx_L7:; - - /* "rabbyt/rabbyt._sprites.pyx":240 - * if r != 0: - * glRotatef(r,0,0,1) - * if sx != 1 or sy != 1: # <<<<<<<<<<<<<< - * glScalef(sx, sy, 1) - * self.render_after_transform() - */ - __pyx_t_2 = ((__pyx_v_sx != 1.0) != 0); - if (!__pyx_t_2) { - __pyx_t_1 = ((__pyx_v_sy != 1.0) != 0); - __pyx_t_3 = __pyx_t_1; - } else { - __pyx_t_3 = __pyx_t_2; - } - if (__pyx_t_3) { - - /* "rabbyt/rabbyt._sprites.pyx":241 - * glRotatef(r,0,0,1) - * if sx != 1 or sy != 1: - * glScalef(sx, sy, 1) # <<<<<<<<<<<<<< - * self.render_after_transform() - * finally: - */ - glScalef(__pyx_v_sx, __pyx_v_sy, 1.0); - goto __pyx_L8; - } - __pyx_L8:; - - /* "rabbyt/rabbyt._sprites.pyx":242 - * if sx != 1 or sy != 1: - * glScalef(sx, sy, 1) - * self.render_after_transform() # <<<<<<<<<<<<<< - * finally: - * glPopMatrix() - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - - /* "rabbyt/rabbyt._sprites.pyx":244 - * self.render_after_transform() - * finally: - * glPopMatrix() # <<<<<<<<<<<<<< - * else: - * self.render_after_transform() - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L6; - __pyx_L5: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L6; - } - __pyx_L6:; - glPopMatrix(); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":246 - * glPopMatrix() - * else: - * self.render_after_transform() # <<<<<<<<<<<<<< - * - * def render_after_transform(self): - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_L3:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_5render_after_transform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6rabbyt_8_sprites_11cBaseSprite_4render_after_transform[] = "\n ``render_after_transform()``\n\n This method is called by ``BaseSprite.render()`` after transformations\n have been applied.\n\n If you don't want to mess with doing transformations yourself, you can\n override this method instead of ``render()``.\n "; -static PyObject *__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_5render_after_transform(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("render_after_transform (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_11cBaseSprite_4render_after_transform(((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":248 - * self.render_after_transform() - * - * def render_after_transform(self): # <<<<<<<<<<<<<< - * """ - * ``render_after_transform()`` - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_11cBaseSprite_4render_after_transform(CYTHON_UNUSED struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("render_after_transform", 0); - - /* "rabbyt/rabbyt._sprites.pyx":258 - * override this method instead of ``render()``. - * """ - * raise NotImplementedError # <<<<<<<<<<<<<< - * - * - */ - __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._sprites.cBaseSprite.render_after_transform", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":271 - * #cdef int _bounding_radius_is_explicit - * - * cdef _modify_slots(self): # <<<<<<<<<<<<<< - * cBaseSprite._modify_slots(self) - * cdef AnimSlot slot - */ - -static PyObject *__pyx_f_6rabbyt_8_sprites_7cSprite__modify_slots(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - struct __pyx_obj_6rabbyt_6_anims_AnimSlot *__pyx_v_slot = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - int __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_modify_slots", 0); - - /* "rabbyt/rabbyt._sprites.pyx":272 - * - * cdef _modify_slots(self): - * cBaseSprite._modify_slots(self) # <<<<<<<<<<<<<< - * cdef AnimSlot slot - * - */ - __pyx_t_1 = __pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite->__pyx_base._modify_slots(((struct __pyx_obj_6rabbyt_6_anims_cAnimable *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":275 - * cdef AnimSlot slot - * - * if (len(self._anim_list) > 0): # <<<<<<<<<<<<<< - * slot = self._anim_list[9] - * slot._slot = &self._u - */ - __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._anim_list; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = ((__pyx_t_2 > 0) != 0); - if (__pyx_t_3) { - - /* "rabbyt/rabbyt._sprites.pyx":276 - * - * if (len(self._anim_list) > 0): - * slot = self._anim_list[9] # <<<<<<<<<<<<<< - * slot._slot = &self._u - * slot = self._anim_list[10] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base.__pyx_base._anim_list, 9, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_slot = ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":277 - * if (len(self._anim_list) > 0): - * slot = self._anim_list[9] - * slot._slot = &self._u # <<<<<<<<<<<<<< - * slot = self._anim_list[10] - * slot._slot = &self._v - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_u); - - /* "rabbyt/rabbyt._sprites.pyx":278 - * slot = self._anim_list[9] - * slot._slot = &self._u - * slot = self._anim_list[10] # <<<<<<<<<<<<<< - * slot._slot = &self._v - * - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->__pyx_base.__pyx_base._anim_list, 10, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6rabbyt_6_anims_AnimSlot))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF_SET(__pyx_v_slot, ((struct __pyx_obj_6rabbyt_6_anims_AnimSlot *)__pyx_t_1)); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":279 - * slot._slot = &self._u - * slot = self._anim_list[10] - * slot._slot = &self._v # <<<<<<<<<<<<<< - * - * property bounding_radius: - */ - __pyx_v_slot->_slot = (&__pyx_v_self->_v); - goto __pyx_L3; - } - __pyx_L3:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cSprite._modify_slots", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_slot); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":298 - * del sprite.bounding_radius - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float s, sy - * if self._bounding_radius_is_explicit: - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - float __pyx_v_s; - float __pyx_v_sy; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":300 - * def __get__(self): - * cdef float s, sy - * if self._bounding_radius_is_explicit: # <<<<<<<<<<<<<< - * return self._bounding_radius - * else: - */ - __pyx_t_1 = (__pyx_v_self->_bounding_radius_is_explicit != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":301 - * cdef float s, sy - * if self._bounding_radius_is_explicit: - * return self._bounding_radius # <<<<<<<<<<<<<< - * else: - * READ_SLOT(&self._scale_x, &s) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->__pyx_base._bounding_radius); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":303 - * return self._bounding_radius - * else: - * READ_SLOT(&self._scale_x, &s) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_y, &sy) - * if sy > s: - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_x), (&__pyx_v_s)); - - /* "rabbyt/rabbyt._sprites.pyx":304 - * else: - * READ_SLOT(&self._scale_x, &s) - * READ_SLOT(&self._scale_y, &sy) # <<<<<<<<<<<<<< - * if sy > s: - * s = sy; - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_y), (&__pyx_v_sy)); - - /* "rabbyt/rabbyt._sprites.pyx":305 - * READ_SLOT(&self._scale_x, &s) - * READ_SLOT(&self._scale_y, &sy) - * if sy > s: # <<<<<<<<<<<<<< - * s = sy; - * return self._shape.bounding_radius * s - */ - __pyx_t_1 = ((__pyx_v_sy > __pyx_v_s) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":306 - * READ_SLOT(&self._scale_y, &sy) - * if sy > s: - * s = sy; # <<<<<<<<<<<<<< - * return self._shape.bounding_radius * s - * def __set__(self, v): - */ - __pyx_v_s = __pyx_v_sy; - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt._sprites.pyx":307 - * if sy > s: - * s = sy; - * return self._shape.bounding_radius * s # <<<<<<<<<<<<<< - * def __set__(self, v): - * self._bounding_radius = v - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->_shape->bounding_radius * __pyx_v_s)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.bounding_radius.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((PyObject *)__pyx_v_v)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":308 - * s = sy; - * return self._shape.bounding_radius * s - * def __set__(self, v): # <<<<<<<<<<<<<< - * self._bounding_radius = v - * self._bounding_radius_is_explicit = 1 - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":309 - * return self._shape.bounding_radius * s - * def __set__(self, v): - * self._bounding_radius = v # <<<<<<<<<<<<<< - * self._bounding_radius_is_explicit = 1 - * def __del__(self): - */ - __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_v); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->__pyx_base._bounding_radius = __pyx_t_1; - - /* "rabbyt/rabbyt._sprites.pyx":310 - * def __set__(self, v): - * self._bounding_radius = v - * self._bounding_radius_is_explicit = 1 # <<<<<<<<<<<<<< - * def __del__(self): - * self._bounding_radius_is_explicit = 0 - */ - __pyx_v_self->_bounding_radius_is_explicit = 1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._sprites.cSprite.bounding_radius.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius_4__del__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":311 - * self._bounding_radius = v - * self._bounding_radius_is_explicit = 1 - * def __del__(self): # <<<<<<<<<<<<<< - * self._bounding_radius_is_explicit = 0 - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_15bounding_radius_4__del__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":312 - * self._bounding_radius_is_explicit = 1 - * def __del__(self): - * self._bounding_radius_is_explicit = 0 # <<<<<<<<<<<<<< - * - * property bounding_radius_squared: - */ - __pyx_v_self->_bounding_radius_is_explicit = 0; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":323 - * kept in sync with each other. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float s, sy - * if self._bounding_radius_is_explicit: - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - float __pyx_v_s; - float __pyx_v_sy; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":325 - * def __get__(self): - * cdef float s, sy - * if self._bounding_radius_is_explicit: # <<<<<<<<<<<<<< - * return self._bounding_radius * self._bounding_radius - * else: - */ - __pyx_t_1 = (__pyx_v_self->_bounding_radius_is_explicit != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":326 - * cdef float s, sy - * if self._bounding_radius_is_explicit: - * return self._bounding_radius * self._bounding_radius # <<<<<<<<<<<<<< - * else: - * READ_SLOT(&self._scale_x, &s) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->__pyx_base._bounding_radius * __pyx_v_self->__pyx_base._bounding_radius)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":328 - * return self._bounding_radius * self._bounding_radius - * else: - * READ_SLOT(&self._scale_x, &s) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_y, &sy) - * if sy > s: - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_x), (&__pyx_v_s)); - - /* "rabbyt/rabbyt._sprites.pyx":329 - * else: - * READ_SLOT(&self._scale_x, &s) - * READ_SLOT(&self._scale_y, &sy) # <<<<<<<<<<<<<< - * if sy > s: - * s = sy; - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_y), (&__pyx_v_sy)); - - /* "rabbyt/rabbyt._sprites.pyx":330 - * READ_SLOT(&self._scale_x, &s) - * READ_SLOT(&self._scale_y, &sy) - * if sy > s: # <<<<<<<<<<<<<< - * s = sy; - * return self._shape.bounding_radius*self._shape.bounding_radius*s*s - */ - __pyx_t_1 = ((__pyx_v_sy > __pyx_v_s) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":331 - * READ_SLOT(&self._scale_y, &sy) - * if sy > s: - * s = sy; # <<<<<<<<<<<<<< - * return self._shape.bounding_radius*self._shape.bounding_radius*s*s - * def __set__(self, float r2): - */ - __pyx_v_s = __pyx_v_sy; - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt._sprites.pyx":332 - * if sy > s: - * s = sy; - * return self._shape.bounding_radius*self._shape.bounding_radius*s*s # <<<<<<<<<<<<<< - * def __set__(self, float r2): - * self._bounding_radius = sqrtf(r2) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble((((__pyx_v_self->_shape->bounding_radius * __pyx_v_self->_shape->bounding_radius) * __pyx_v_s) * __pyx_v_s)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.bounding_radius_squared.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_r2); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_r2) { - float __pyx_v_r2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_r2); { - __pyx_v_r2 = __pyx_PyFloat_AsFloat(__pyx_arg_r2); if (unlikely((__pyx_v_r2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._sprites.cSprite.bounding_radius_squared.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((float)__pyx_v_r2)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":333 - * s = sy; - * return self._shape.bounding_radius*self._shape.bounding_radius*s*s - * def __set__(self, float r2): # <<<<<<<<<<<<<< - * self._bounding_radius = sqrtf(r2) - * self._bounding_radius_is_explicit = 1 - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, float __pyx_v_r2) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":334 - * return self._shape.bounding_radius*self._shape.bounding_radius*s*s - * def __set__(self, float r2): - * self._bounding_radius = sqrtf(r2) # <<<<<<<<<<<<<< - * self._bounding_radius_is_explicit = 1 - * def __del__(self): - */ - __pyx_v_self->__pyx_base._bounding_radius = sqrtf(__pyx_v_r2); - - /* "rabbyt/rabbyt._sprites.pyx":335 - * def __set__(self, float r2): - * self._bounding_radius = sqrtf(r2) - * self._bounding_radius_is_explicit = 1 # <<<<<<<<<<<<<< - * def __del__(self): - * self._bounding_radius_is_explicit = 0 - */ - __pyx_v_self->_bounding_radius_is_explicit = 1; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_5__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_5__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_4__del__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":336 - * self._bounding_radius = sqrtf(r2) - * self._bounding_radius_is_explicit = 1 - * def __del__(self): # <<<<<<<<<<<<<< - * self._bounding_radius_is_explicit = 0 - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_4__del__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__del__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":337 - * self._bounding_radius_is_explicit = 1 - * def __del__(self): - * self._bounding_radius_is_explicit = 0 # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->_bounding_radius_is_explicit = 0; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_5shape_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_5shape___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":352 - * to the distance of the farthest coordinate. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._shape - * def __set__(self, value): - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_5shape___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":353 - * """ - * def __get__(self): - * return self._shape # <<<<<<<<<<<<<< - * def __set__(self, value): - * if isinstance(value, Quad): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self->_shape)); - __pyx_r = ((PyObject *)__pyx_v_self->_shape); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_5shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_5shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_5shape_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":354 - * def __get__(self): - * return self._shape - * def __set__(self, value): # <<<<<<<<<<<<<< - * if isinstance(value, Quad): - * self._shape = value - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_5shape_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_value) { - CYTHON_UNUSED struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v__shape = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":355 - * return self._shape - * def __set__(self, value): - * if isinstance(value, Quad): # <<<<<<<<<<<<<< - * self._shape = value - * else: - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, ((PyObject*)__pyx_ptype_6rabbyt_10primitives_Quad)); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._sprites.pyx":356 - * def __set__(self, value): - * if isinstance(value, Quad): - * self._shape = value # <<<<<<<<<<<<<< - * else: - * self._shape = Quad(value) - */ - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6rabbyt_10primitives_Quad))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->_shape); - __Pyx_DECREF(((PyObject *)__pyx_v_self->_shape)); - __pyx_v_self->_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_value); - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":358 - * self._shape = value - * else: - * self._shape = Quad(value) # <<<<<<<<<<<<<< - * cdef Quad _shape - * _shape = self._shape - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_10primitives_Quad)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_v_self->_shape); - __Pyx_DECREF(((PyObject *)__pyx_v_self->_shape)); - __pyx_v_self->_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._sprites.pyx":360 - * self._shape = Quad(value) - * cdef Quad _shape - * _shape = self._shape # <<<<<<<<<<<<<< - * - * property tex_shape: - */ - __pyx_t_4 = ((PyObject *)__pyx_v_self->_shape); - __Pyx_INCREF(__pyx_t_4); - __pyx_v__shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_t_4); - __pyx_t_4 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v__shape); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_9tex_shape_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_9tex_shape_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_9tex_shape___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":375 - * of pyglet textures. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._tex_shape - * def __set__(self, value): - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_9tex_shape___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":376 - * """ - * def __get__(self): - * return self._tex_shape # <<<<<<<<<<<<<< - * def __set__(self, value): - * if isinstance(value, Quad): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_self->_tex_shape)); - __pyx_r = ((PyObject *)__pyx_v_self->_tex_shape); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_9tex_shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_9tex_shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_9tex_shape_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":377 - * def __get__(self): - * return self._tex_shape - * def __set__(self, value): # <<<<<<<<<<<<<< - * if isinstance(value, Quad): - * self._tex_shape = value - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_9tex_shape_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":378 - * return self._tex_shape - * def __set__(self, value): - * if isinstance(value, Quad): # <<<<<<<<<<<<<< - * self._tex_shape = value - * else: - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_value, ((PyObject*)__pyx_ptype_6rabbyt_10primitives_Quad)); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt._sprites.pyx":379 - * def __set__(self, value): - * if isinstance(value, Quad): - * self._tex_shape = value # <<<<<<<<<<<<<< - * else: - * self._tex_shape = Quad(value) - */ - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6rabbyt_10primitives_Quad))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(__pyx_v_self->_tex_shape); - __Pyx_DECREF(((PyObject *)__pyx_v_self->_tex_shape)); - __pyx_v_self->_tex_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_value); - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":381 - * self._tex_shape = value - * else: - * self._tex_shape = Quad(value) # <<<<<<<<<<<<<< - * self._tex_shape_data_ptr = self._tex_shape.v - * - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6rabbyt_10primitives_Quad)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_v_self->_tex_shape); - __Pyx_DECREF(((PyObject *)__pyx_v_self->_tex_shape)); - __pyx_v_self->_tex_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_t_4); - __pyx_t_4 = 0; - } - __pyx_L3:; - - /* "rabbyt/rabbyt._sprites.pyx":382 - * else: - * self._tex_shape = Quad(value) - * self._tex_shape_data_ptr = self._tex_shape.v # <<<<<<<<<<<<<< - * - * property texture_id: - */ - __pyx_t_4 = PyLong_FromUnsignedLong(((unsigned long)__pyx_v_self->_tex_shape->v)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___tex_shape_data_ptr, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.tex_shape.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_10texture_id_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_10texture_id_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_10texture_id___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":385 - * - * property texture_id: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._texture_id - * def __set__(self, int value): - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_10texture_id___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":386 - * property texture_id: - * def __get__(self): - * return self._texture_id # <<<<<<<<<<<<<< - * def __set__(self, int value): - * self._texture_id = value - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_texture_id); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.texture_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_10texture_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_10texture_id_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { - int __pyx_v_value; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_value); { - __pyx_v_value = __Pyx_PyInt_AsInt(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt._sprites.cSprite.texture_id.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_10texture_id_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((int)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":387 - * def __get__(self): - * return self._texture_id - * def __set__(self, int value): # <<<<<<<<<<<<<< - * self._texture_id = value - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_10texture_id_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, int __pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":388 - * return self._texture_id - * def __set__(self, int value): - * self._texture_id = value # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_self->_texture_id = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":391 - * - * - * cdef int _render(self) except -1: # <<<<<<<<<<<<<< - * if self._texture_id != 0: - * glEnable(GL_TEXTURE_2D) - */ - -static int __pyx_f_6rabbyt_8_sprites_7cSprite__render(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - float __pyx_v_color[4]; - float __pyx_v_x; - float __pyx_v_y; - float __pyx_v_u; - float __pyx_v_v; - float __pyx_v_sx; - float __pyx_v_sy; - float __pyx_v_r; - int __pyx_v_i; - float __pyx_v_vx; - float __pyx_v_vy; - float __pyx_v_co; - float __pyx_v_si; - struct __pyx_t_6rabbyt_10primitives_Point2d *__pyx_v_vert; - struct __pyx_t_6rabbyt_10primitives_Point2d *__pyx_v_tex; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - struct __pyx_t_6rabbyt_10primitives_Point2d *__pyx_t_2; - __Pyx_RefNannySetupContext("_render", 0); - - /* "rabbyt/rabbyt._sprites.pyx":392 - * - * cdef int _render(self) except -1: - * if self._texture_id != 0: # <<<<<<<<<<<<<< - * glEnable(GL_TEXTURE_2D) - * glBindTexture(GL_TEXTURE_2D, self._texture_id) - */ - __pyx_t_1 = ((__pyx_v_self->_texture_id != 0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":393 - * cdef int _render(self) except -1: - * if self._texture_id != 0: - * glEnable(GL_TEXTURE_2D) # <<<<<<<<<<<<<< - * glBindTexture(GL_TEXTURE_2D, self._texture_id) - * else: - */ - glEnable(GL_TEXTURE_2D); - - /* "rabbyt/rabbyt._sprites.pyx":394 - * if self._texture_id != 0: - * glEnable(GL_TEXTURE_2D) - * glBindTexture(GL_TEXTURE_2D, self._texture_id) # <<<<<<<<<<<<<< - * else: - * glDisable(GL_TEXTURE_2D) - */ - glBindTexture(GL_TEXTURE_2D, __pyx_v_self->_texture_id); - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":396 - * glBindTexture(GL_TEXTURE_2D, self._texture_id) - * else: - * glDisable(GL_TEXTURE_2D) # <<<<<<<<<<<<<< - * - * cdef float color[4] - */ - glDisable(GL_TEXTURE_2D); - } - __pyx_L3:; - - /* "rabbyt/rabbyt._sprites.pyx":399 - * - * cdef float color[4] - * READ_SLOT(&self._red, &color[0]) # <<<<<<<<<<<<<< - * READ_SLOT(&self._green, &color[1]) - * READ_SLOT(&self._blue, &color[2]) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._red), (&(__pyx_v_color[0]))); - - /* "rabbyt/rabbyt._sprites.pyx":400 - * cdef float color[4] - * READ_SLOT(&self._red, &color[0]) - * READ_SLOT(&self._green, &color[1]) # <<<<<<<<<<<<<< - * READ_SLOT(&self._blue, &color[2]) - * READ_SLOT(&self._alpha, &color[3]) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._green), (&(__pyx_v_color[1]))); - - /* "rabbyt/rabbyt._sprites.pyx":401 - * READ_SLOT(&self._red, &color[0]) - * READ_SLOT(&self._green, &color[1]) - * READ_SLOT(&self._blue, &color[2]) # <<<<<<<<<<<<<< - * READ_SLOT(&self._alpha, &color[3]) - * glColor4fv(color) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._blue), (&(__pyx_v_color[2]))); - - /* "rabbyt/rabbyt._sprites.pyx":402 - * READ_SLOT(&self._green, &color[1]) - * READ_SLOT(&self._blue, &color[2]) - * READ_SLOT(&self._alpha, &color[3]) # <<<<<<<<<<<<<< - * glColor4fv(color) - * - */ - READ_SLOT((&__pyx_v_self->__pyx_base._alpha), (&(__pyx_v_color[3]))); - - /* "rabbyt/rabbyt._sprites.pyx":403 - * READ_SLOT(&self._blue, &color[2]) - * READ_SLOT(&self._alpha, &color[3]) - * glColor4fv(color) # <<<<<<<<<<<<<< - * - * cdef float x, y, u, v, sx, sy, r - */ - glColor4fv(__pyx_v_color); - - /* "rabbyt/rabbyt._sprites.pyx":406 - * - * cdef float x, y, u, v, sx, sy, r - * READ_SLOT(&self._x, &x) # <<<<<<<<<<<<<< - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._u, &u) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._x), (&__pyx_v_x)); - - /* "rabbyt/rabbyt._sprites.pyx":407 - * cdef float x, y, u, v, sx, sy, r - * READ_SLOT(&self._x, &x) - * READ_SLOT(&self._y, &y) # <<<<<<<<<<<<<< - * READ_SLOT(&self._u, &u) - * READ_SLOT(&self._v, &v) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._y), (&__pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":408 - * READ_SLOT(&self._x, &x) - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._u, &u) # <<<<<<<<<<<<<< - * READ_SLOT(&self._v, &v) - * READ_SLOT(&self._scale_x, &sx) - */ - READ_SLOT((&__pyx_v_self->_u), (&__pyx_v_u)); - - /* "rabbyt/rabbyt._sprites.pyx":409 - * READ_SLOT(&self._y, &y) - * READ_SLOT(&self._u, &u) - * READ_SLOT(&self._v, &v) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - */ - READ_SLOT((&__pyx_v_self->_v), (&__pyx_v_v)); - - /* "rabbyt/rabbyt._sprites.pyx":410 - * READ_SLOT(&self._u, &u) - * READ_SLOT(&self._v, &v) - * READ_SLOT(&self._scale_x, &sx) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_x), (&__pyx_v_sx)); - - /* "rabbyt/rabbyt._sprites.pyx":411 - * READ_SLOT(&self._v, &v) - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) # <<<<<<<<<<<<<< - * READ_SLOT(&self._rot, &r) - * - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_y), (&__pyx_v_sy)); - - /* "rabbyt/rabbyt._sprites.pyx":412 - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) # <<<<<<<<<<<<<< - * - * cdef int i - */ - READ_SLOT((&__pyx_v_self->__pyx_base._rot), (&__pyx_v_r)); - - /* "rabbyt/rabbyt._sprites.pyx":418 - * - * cdef Point2d * vert, *tex - * vert = self._shape.v # <<<<<<<<<<<<<< - * tex = self._tex_shape.v - * - */ - __pyx_t_2 = __pyx_v_self->_shape->v; - __pyx_v_vert = __pyx_t_2; - - /* "rabbyt/rabbyt._sprites.pyx":419 - * cdef Point2d * vert, *tex - * vert = self._shape.v - * tex = self._tex_shape.v # <<<<<<<<<<<<<< - * - * glBegin(GL_QUADS) - */ - __pyx_t_2 = __pyx_v_self->_tex_shape->v; - __pyx_v_tex = __pyx_t_2; - - /* "rabbyt/rabbyt._sprites.pyx":421 - * tex = self._tex_shape.v - * - * glBegin(GL_QUADS) # <<<<<<<<<<<<<< - * if r == 0: - * glTexCoord2f(tex[0].x+u,tex[0].y+v) - */ - glBegin(GL_QUADS); - - /* "rabbyt/rabbyt._sprites.pyx":422 - * - * glBegin(GL_QUADS) - * if r == 0: # <<<<<<<<<<<<<< - * glTexCoord2f(tex[0].x+u,tex[0].y+v) - * glVertex2f(vert[0].x*sx+x,vert[0].y*sy+y) - */ - __pyx_t_1 = ((__pyx_v_r == 0.0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":423 - * glBegin(GL_QUADS) - * if r == 0: - * glTexCoord2f(tex[0].x+u,tex[0].y+v) # <<<<<<<<<<<<<< - * glVertex2f(vert[0].x*sx+x,vert[0].y*sy+y) - * glTexCoord2f(tex[1].x+u,tex[1].y+v) - */ - glTexCoord2f(((__pyx_v_tex[0]).x + __pyx_v_u), ((__pyx_v_tex[0]).y + __pyx_v_v)); - - /* "rabbyt/rabbyt._sprites.pyx":424 - * if r == 0: - * glTexCoord2f(tex[0].x+u,tex[0].y+v) - * glVertex2f(vert[0].x*sx+x,vert[0].y*sy+y) # <<<<<<<<<<<<<< - * glTexCoord2f(tex[1].x+u,tex[1].y+v) - * glVertex2f(vert[1].x*sx+x,vert[1].y*sy+y) - */ - glVertex2f((((__pyx_v_vert[0]).x * __pyx_v_sx) + __pyx_v_x), (((__pyx_v_vert[0]).y * __pyx_v_sy) + __pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":425 - * glTexCoord2f(tex[0].x+u,tex[0].y+v) - * glVertex2f(vert[0].x*sx+x,vert[0].y*sy+y) - * glTexCoord2f(tex[1].x+u,tex[1].y+v) # <<<<<<<<<<<<<< - * glVertex2f(vert[1].x*sx+x,vert[1].y*sy+y) - * glTexCoord2f(tex[2].x+u,tex[2].y+v) - */ - glTexCoord2f(((__pyx_v_tex[1]).x + __pyx_v_u), ((__pyx_v_tex[1]).y + __pyx_v_v)); - - /* "rabbyt/rabbyt._sprites.pyx":426 - * glVertex2f(vert[0].x*sx+x,vert[0].y*sy+y) - * glTexCoord2f(tex[1].x+u,tex[1].y+v) - * glVertex2f(vert[1].x*sx+x,vert[1].y*sy+y) # <<<<<<<<<<<<<< - * glTexCoord2f(tex[2].x+u,tex[2].y+v) - * glVertex2f(vert[2].x*sx+x,vert[2].y*sy+y) - */ - glVertex2f((((__pyx_v_vert[1]).x * __pyx_v_sx) + __pyx_v_x), (((__pyx_v_vert[1]).y * __pyx_v_sy) + __pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":427 - * glTexCoord2f(tex[1].x+u,tex[1].y+v) - * glVertex2f(vert[1].x*sx+x,vert[1].y*sy+y) - * glTexCoord2f(tex[2].x+u,tex[2].y+v) # <<<<<<<<<<<<<< - * glVertex2f(vert[2].x*sx+x,vert[2].y*sy+y) - * glTexCoord2f(tex[3].x+u,tex[3].y+v) - */ - glTexCoord2f(((__pyx_v_tex[2]).x + __pyx_v_u), ((__pyx_v_tex[2]).y + __pyx_v_v)); - - /* "rabbyt/rabbyt._sprites.pyx":428 - * glVertex2f(vert[1].x*sx+x,vert[1].y*sy+y) - * glTexCoord2f(tex[2].x+u,tex[2].y+v) - * glVertex2f(vert[2].x*sx+x,vert[2].y*sy+y) # <<<<<<<<<<<<<< - * glTexCoord2f(tex[3].x+u,tex[3].y+v) - * glVertex2f(vert[3].x*sx+x,vert[3].y*sy+y) - */ - glVertex2f((((__pyx_v_vert[2]).x * __pyx_v_sx) + __pyx_v_x), (((__pyx_v_vert[2]).y * __pyx_v_sy) + __pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":429 - * glTexCoord2f(tex[2].x+u,tex[2].y+v) - * glVertex2f(vert[2].x*sx+x,vert[2].y*sy+y) - * glTexCoord2f(tex[3].x+u,tex[3].y+v) # <<<<<<<<<<<<<< - * glVertex2f(vert[3].x*sx+x,vert[3].y*sy+y) - * else: - */ - glTexCoord2f(((__pyx_v_tex[3]).x + __pyx_v_u), ((__pyx_v_tex[3]).y + __pyx_v_v)); - - /* "rabbyt/rabbyt._sprites.pyx":430 - * glVertex2f(vert[2].x*sx+x,vert[2].y*sy+y) - * glTexCoord2f(tex[3].x+u,tex[3].y+v) - * glVertex2f(vert[3].x*sx+x,vert[3].y*sy+y) # <<<<<<<<<<<<<< - * else: - * r = r * PI_OVER_180 - */ - glVertex2f((((__pyx_v_vert[3]).x * __pyx_v_sx) + __pyx_v_x), (((__pyx_v_vert[3]).y * __pyx_v_sy) + __pyx_v_y)); - goto __pyx_L4; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":432 - * glVertex2f(vert[3].x*sx+x,vert[3].y*sy+y) - * else: - * r = r * PI_OVER_180 # <<<<<<<<<<<<<< - * co = cosf(r) - * si = sinf(r) - */ - __pyx_v_r = (__pyx_v_r * PI_OVER_180); - - /* "rabbyt/rabbyt._sprites.pyx":433 - * else: - * r = r * PI_OVER_180 - * co = cosf(r) # <<<<<<<<<<<<<< - * si = sinf(r) - * for i from 0 <= i < 4: - */ - __pyx_v_co = cosf(__pyx_v_r); - - /* "rabbyt/rabbyt._sprites.pyx":434 - * r = r * PI_OVER_180 - * co = cosf(r) - * si = sinf(r) # <<<<<<<<<<<<<< - * for i from 0 <= i < 4: - * glTexCoord2f(tex[i].x+u,tex[i].y+v) - */ - __pyx_v_si = sinf(__pyx_v_r); - - /* "rabbyt/rabbyt._sprites.pyx":435 - * co = cosf(r) - * si = sinf(r) - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * glTexCoord2f(tex[i].x+u,tex[i].y+v) - * vx = vert[i].x*sx - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt._sprites.pyx":436 - * si = sinf(r) - * for i from 0 <= i < 4: - * glTexCoord2f(tex[i].x+u,tex[i].y+v) # <<<<<<<<<<<<<< - * vx = vert[i].x*sx - * vy = vert[i].y*sy - */ - glTexCoord2f(((__pyx_v_tex[__pyx_v_i]).x + __pyx_v_u), ((__pyx_v_tex[__pyx_v_i]).y + __pyx_v_v)); - - /* "rabbyt/rabbyt._sprites.pyx":437 - * for i from 0 <= i < 4: - * glTexCoord2f(tex[i].x+u,tex[i].y+v) - * vx = vert[i].x*sx # <<<<<<<<<<<<<< - * vy = vert[i].y*sy - * glVertex2f((vx*co - vy*si)+x, (vx*si + vy*co)+y) - */ - __pyx_v_vx = ((__pyx_v_vert[__pyx_v_i]).x * __pyx_v_sx); - - /* "rabbyt/rabbyt._sprites.pyx":438 - * glTexCoord2f(tex[i].x+u,tex[i].y+v) - * vx = vert[i].x*sx - * vy = vert[i].y*sy # <<<<<<<<<<<<<< - * glVertex2f((vx*co - vy*si)+x, (vx*si + vy*co)+y) - * glEnd() - */ - __pyx_v_vy = ((__pyx_v_vert[__pyx_v_i]).y * __pyx_v_sy); - - /* "rabbyt/rabbyt._sprites.pyx":439 - * vx = vert[i].x*sx - * vy = vert[i].y*sy - * glVertex2f((vx*co - vy*si)+x, (vx*si + vy*co)+y) # <<<<<<<<<<<<<< - * glEnd() - * - */ - glVertex2f((((__pyx_v_vx * __pyx_v_co) - (__pyx_v_vy * __pyx_v_si)) + __pyx_v_x), (((__pyx_v_vx * __pyx_v_si) + (__pyx_v_vy * __pyx_v_co)) + __pyx_v_y)); - } - } - __pyx_L4:; - - /* "rabbyt/rabbyt._sprites.pyx":440 - * vy = vert[i].y*sy - * glVertex2f((vx*co - vy*si)+x, (vx*si + vy*co)+y) - * glEnd() # <<<<<<<<<<<<<< - * - * def render(self): - */ - glEnd(); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_1render(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6rabbyt_8_sprites_7cSprite_render[] = "\n \n "; -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_1render(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("render (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_render(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":442 - * glEnd() - * - * def render(self): # <<<<<<<<<<<<<< - * """ - * - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_render(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("render", 0); - - /* "rabbyt/rabbyt._sprites.pyx":446 - * - * """ - * self._render() # <<<<<<<<<<<<<< - * - * cdef float2 _bounds_x(self): - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_render(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt._sprites.cSprite.render", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":448 - * self._render() - * - * cdef float2 _bounds_x(self): # <<<<<<<<<<<<<< - * cdef float2 bounds - * cdef float r, co, si, x, sx, sy - */ - -static struct __pyx_t_6rabbyt_10primitives_float2 __pyx_f_6rabbyt_8_sprites_7cSprite__bounds_x(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_bounds; - float __pyx_v_r; - float __pyx_v_co; - float __pyx_v_si; - float __pyx_v_x; - float __pyx_v_sx; - float __pyx_v_sy; - int __pyx_v_i; - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("_bounds_x", 0); - - /* "rabbyt/rabbyt._sprites.pyx":452 - * cdef float r, co, si, x, sx, sy - * cdef int i - * READ_SLOT(&self._scale_x, &sx) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_x), (&__pyx_v_sx)); - - /* "rabbyt/rabbyt._sprites.pyx":453 - * cdef int i - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) # <<<<<<<<<<<<<< - * READ_SLOT(&self._rot, &r) - * r = r * PI_OVER_180 - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_y), (&__pyx_v_sy)); - - /* "rabbyt/rabbyt._sprites.pyx":454 - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) # <<<<<<<<<<<<<< - * r = r * PI_OVER_180 - * co = cosf(r) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._rot), (&__pyx_v_r)); - - /* "rabbyt/rabbyt._sprites.pyx":455 - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) - * r = r * PI_OVER_180 # <<<<<<<<<<<<<< - * co = cosf(r) - * si = sinf(r) - */ - __pyx_v_r = (__pyx_v_r * PI_OVER_180); - - /* "rabbyt/rabbyt._sprites.pyx":456 - * READ_SLOT(&self._rot, &r) - * r = r * PI_OVER_180 - * co = cosf(r) # <<<<<<<<<<<<<< - * si = sinf(r) - * - */ - __pyx_v_co = cosf(__pyx_v_r); - - /* "rabbyt/rabbyt._sprites.pyx":457 - * r = r * PI_OVER_180 - * co = cosf(r) - * si = sinf(r) # <<<<<<<<<<<<<< - * - * for i from 0 <= i < 4: - */ - __pyx_v_si = sinf(__pyx_v_r); - - /* "rabbyt/rabbyt._sprites.pyx":459 - * si = sinf(r) - * - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * x = (self._shape.v[i].x*sx*co - self._shape.v[i].y*sy*si) - * if i == 0: - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt._sprites.pyx":460 - * - * for i from 0 <= i < 4: - * x = (self._shape.v[i].x*sx*co - self._shape.v[i].y*sy*si) # <<<<<<<<<<<<<< - * if i == 0: - * bounds.a = x - */ - __pyx_v_x = ((((__pyx_v_self->_shape->v[__pyx_v_i]).x * __pyx_v_sx) * __pyx_v_co) - (((__pyx_v_self->_shape->v[__pyx_v_i]).y * __pyx_v_sy) * __pyx_v_si)); - - /* "rabbyt/rabbyt._sprites.pyx":461 - * for i from 0 <= i < 4: - * x = (self._shape.v[i].x*sx*co - self._shape.v[i].y*sy*si) - * if i == 0: # <<<<<<<<<<<<<< - * bounds.a = x - * bounds.b = x - */ - __pyx_t_1 = ((__pyx_v_i == 0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":462 - * x = (self._shape.v[i].x*sx*co - self._shape.v[i].y*sy*si) - * if i == 0: - * bounds.a = x # <<<<<<<<<<<<<< - * bounds.b = x - * else: - */ - __pyx_v_bounds.a = __pyx_v_x; - - /* "rabbyt/rabbyt._sprites.pyx":463 - * if i == 0: - * bounds.a = x - * bounds.b = x # <<<<<<<<<<<<<< - * else: - * if bounds.a > x: - */ - __pyx_v_bounds.b = __pyx_v_x; - goto __pyx_L5; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":465 - * bounds.b = x - * else: - * if bounds.a > x: # <<<<<<<<<<<<<< - * bounds.a = x - * if bounds.b < x: - */ - __pyx_t_1 = ((__pyx_v_bounds.a > __pyx_v_x) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":466 - * else: - * if bounds.a > x: - * bounds.a = x # <<<<<<<<<<<<<< - * if bounds.b < x: - * bounds.b = x - */ - __pyx_v_bounds.a = __pyx_v_x; - goto __pyx_L6; - } - __pyx_L6:; - - /* "rabbyt/rabbyt._sprites.pyx":467 - * if bounds.a > x: - * bounds.a = x - * if bounds.b < x: # <<<<<<<<<<<<<< - * bounds.b = x - * return bounds - */ - __pyx_t_1 = ((__pyx_v_bounds.b < __pyx_v_x) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":468 - * bounds.a = x - * if bounds.b < x: - * bounds.b = x # <<<<<<<<<<<<<< - * return bounds - * - */ - __pyx_v_bounds.b = __pyx_v_x; - goto __pyx_L7; - } - __pyx_L7:; - } - __pyx_L5:; - } - - /* "rabbyt/rabbyt._sprites.pyx":469 - * if bounds.b < x: - * bounds.b = x - * return bounds # <<<<<<<<<<<<<< - * - * cdef float2 _bounds_y(self): - */ - __pyx_r = __pyx_v_bounds; - goto __pyx_L0; - - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":471 - * return bounds - * - * cdef float2 _bounds_y(self): # <<<<<<<<<<<<<< - * cdef float2 bounds - * cdef float r, co, si, y, sx, sy - */ - -static struct __pyx_t_6rabbyt_10primitives_float2 __pyx_f_6rabbyt_8_sprites_7cSprite__bounds_y(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_bounds; - float __pyx_v_r; - float __pyx_v_co; - float __pyx_v_si; - float __pyx_v_y; - float __pyx_v_sx; - float __pyx_v_sy; - int __pyx_v_i; - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("_bounds_y", 0); - - /* "rabbyt/rabbyt._sprites.pyx":475 - * cdef float r, co, si, y, sx, sy - * cdef int i - * READ_SLOT(&self._scale_x, &sx) # <<<<<<<<<<<<<< - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_x), (&__pyx_v_sx)); - - /* "rabbyt/rabbyt._sprites.pyx":476 - * cdef int i - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) # <<<<<<<<<<<<<< - * READ_SLOT(&self._rot, &r) - * r = r * PI_OVER_180 - */ - READ_SLOT((&__pyx_v_self->__pyx_base._scale_y), (&__pyx_v_sy)); - - /* "rabbyt/rabbyt._sprites.pyx":477 - * READ_SLOT(&self._scale_x, &sx) - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) # <<<<<<<<<<<<<< - * r = r * PI_OVER_180 - * co = cosf(r) - */ - READ_SLOT((&__pyx_v_self->__pyx_base._rot), (&__pyx_v_r)); - - /* "rabbyt/rabbyt._sprites.pyx":478 - * READ_SLOT(&self._scale_y, &sy) - * READ_SLOT(&self._rot, &r) - * r = r * PI_OVER_180 # <<<<<<<<<<<<<< - * co = cosf(r) - * si = sinf(r) - */ - __pyx_v_r = (__pyx_v_r * PI_OVER_180); - - /* "rabbyt/rabbyt._sprites.pyx":479 - * READ_SLOT(&self._rot, &r) - * r = r * PI_OVER_180 - * co = cosf(r) # <<<<<<<<<<<<<< - * si = sinf(r) - * - */ - __pyx_v_co = cosf(__pyx_v_r); - - /* "rabbyt/rabbyt._sprites.pyx":480 - * r = r * PI_OVER_180 - * co = cosf(r) - * si = sinf(r) # <<<<<<<<<<<<<< - * - * for i from 0 <= i < 4: - */ - __pyx_v_si = sinf(__pyx_v_r); - - /* "rabbyt/rabbyt._sprites.pyx":482 - * si = sinf(r) - * - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * y = (self._shape.v[i].x*sx*si + self._shape.v[i].y*sy*co) - * if i == 0: - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt._sprites.pyx":483 - * - * for i from 0 <= i < 4: - * y = (self._shape.v[i].x*sx*si + self._shape.v[i].y*sy*co) # <<<<<<<<<<<<<< - * if i == 0: - * bounds.a = y - */ - __pyx_v_y = ((((__pyx_v_self->_shape->v[__pyx_v_i]).x * __pyx_v_sx) * __pyx_v_si) + (((__pyx_v_self->_shape->v[__pyx_v_i]).y * __pyx_v_sy) * __pyx_v_co)); - - /* "rabbyt/rabbyt._sprites.pyx":484 - * for i from 0 <= i < 4: - * y = (self._shape.v[i].x*sx*si + self._shape.v[i].y*sy*co) - * if i == 0: # <<<<<<<<<<<<<< - * bounds.a = y - * bounds.b = y - */ - __pyx_t_1 = ((__pyx_v_i == 0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":485 - * y = (self._shape.v[i].x*sx*si + self._shape.v[i].y*sy*co) - * if i == 0: - * bounds.a = y # <<<<<<<<<<<<<< - * bounds.b = y - * else: - */ - __pyx_v_bounds.a = __pyx_v_y; - - /* "rabbyt/rabbyt._sprites.pyx":486 - * if i == 0: - * bounds.a = y - * bounds.b = y # <<<<<<<<<<<<<< - * else: - * if bounds.a > y: - */ - __pyx_v_bounds.b = __pyx_v_y; - goto __pyx_L5; - } - /*else*/ { - - /* "rabbyt/rabbyt._sprites.pyx":488 - * bounds.b = y - * else: - * if bounds.a > y: # <<<<<<<<<<<<<< - * bounds.a = y - * if bounds.b < y: - */ - __pyx_t_1 = ((__pyx_v_bounds.a > __pyx_v_y) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":489 - * else: - * if bounds.a > y: - * bounds.a = y # <<<<<<<<<<<<<< - * if bounds.b < y: - * bounds.b = y - */ - __pyx_v_bounds.a = __pyx_v_y; - goto __pyx_L6; - } - __pyx_L6:; - - /* "rabbyt/rabbyt._sprites.pyx":490 - * if bounds.a > y: - * bounds.a = y - * if bounds.b < y: # <<<<<<<<<<<<<< - * bounds.b = y - * return bounds - */ - __pyx_t_1 = ((__pyx_v_bounds.b < __pyx_v_y) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt._sprites.pyx":491 - * bounds.a = y - * if bounds.b < y: - * bounds.b = y # <<<<<<<<<<<<<< - * return bounds - * - */ - __pyx_v_bounds.b = __pyx_v_y; - goto __pyx_L7; - } - __pyx_L7:; - } - __pyx_L5:; - } - - /* "rabbyt/rabbyt._sprites.pyx":492 - * if bounds.b < y: - * bounds.b = y - * return bounds # <<<<<<<<<<<<<< - * - * property left: - */ - __pyx_r = __pyx_v_bounds; - goto __pyx_L0; - - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_4left_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_4left_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_4left___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":496 - * property left: - * """ x coordinate of the left side of the sprite """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float x - * READ_SLOT(&self._x, &x) - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_4left___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - float __pyx_v_x; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":498 - * def __get__(self): - * cdef float x - * READ_SLOT(&self._x, &x) # <<<<<<<<<<<<<< - * return self._bounds_x().a + x - * def __set__(self, x): - */ - READ_SLOT((&__pyx_v_self->__pyx_base._x), (&__pyx_v_x)); - - /* "rabbyt/rabbyt._sprites.pyx":499 - * cdef float x - * READ_SLOT(&self._x, &x) - * return self._bounds_x().a + x # <<<<<<<<<<<<<< - * def __set__(self, x): - * self.x = x - self._bounds_x().a - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_x(__pyx_v_self).a + __pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_4left_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((PyObject *)__pyx_v_x)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":500 - * READ_SLOT(&self._x, &x) - * return self._bounds_x().a + x - * def __set__(self, x): # <<<<<<<<<<<<<< - * self.x = x - self._bounds_x().a - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_4left_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_x) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":501 - * return self._bounds_x().a + x - * def __set__(self, x): - * self.x = x - self._bounds_x().a # <<<<<<<<<<<<<< - * - * property right: - */ - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_x(__pyx_v_self).a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_x, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__x, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_5right_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_5right_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_5right___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":505 - * property right: - * """ x coordinate of the right side of the sprite """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float x - * READ_SLOT(&self._x, &x) - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_5right___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - float __pyx_v_x; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":507 - * def __get__(self): - * cdef float x - * READ_SLOT(&self._x, &x) # <<<<<<<<<<<<<< - * return self._bounds_x().b + x - * def __set__(self, x): - */ - READ_SLOT((&__pyx_v_self->__pyx_base._x), (&__pyx_v_x)); - - /* "rabbyt/rabbyt._sprites.pyx":508 - * cdef float x - * READ_SLOT(&self._x, &x) - * return self._bounds_x().b + x # <<<<<<<<<<<<<< - * def __set__(self, x): - * self.x = x - self._bounds_x().b - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_x(__pyx_v_self).b + __pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_5right_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((PyObject *)__pyx_v_x)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":509 - * READ_SLOT(&self._x, &x) - * return self._bounds_x().b + x - * def __set__(self, x): # <<<<<<<<<<<<<< - * self.x = x - self._bounds_x().b - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_5right_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_x) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":510 - * return self._bounds_x().b + x - * def __set__(self, x): - * self.x = x - self._bounds_x().b # <<<<<<<<<<<<<< - * - * property bottom: - */ - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_x(__pyx_v_self).b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_x, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__x, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_6bottom_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_6bottom_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_6bottom___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":514 - * property bottom: - * """ y coordinate of the bottom of the sprite """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float y - * READ_SLOT(&self._y, &y) - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_6bottom___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - float __pyx_v_y; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":516 - * def __get__(self): - * cdef float y - * READ_SLOT(&self._y, &y) # <<<<<<<<<<<<<< - * return self._bounds_y().a + y - * def __set__(self, y): - */ - READ_SLOT((&__pyx_v_self->__pyx_base._y), (&__pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":517 - * cdef float y - * READ_SLOT(&self._y, &y) - * return self._bounds_y().a + y # <<<<<<<<<<<<<< - * def __set__(self, y): - * self.y = y - self._bounds_y().a - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_y(__pyx_v_self).a + __pyx_v_y)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_y) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_6bottom_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((PyObject *)__pyx_v_y)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":518 - * READ_SLOT(&self._y, &y) - * return self._bounds_y().a + y - * def __set__(self, y): # <<<<<<<<<<<<<< - * self.y = y - self._bounds_y().a - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_6bottom_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_y) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":519 - * return self._bounds_y().a + y - * def __set__(self, y): - * self.y = y - self._bounds_y().a # <<<<<<<<<<<<<< - * - * property top: - */ - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_y(__pyx_v_self).a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_y, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__y, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.bottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_3top_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_8_sprites_7cSprite_3top_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_3top___get__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":523 - * property top: - * """ y coordinate of the top of the sprite """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float y - * READ_SLOT(&self._y, &y) - */ - -static PyObject *__pyx_pf_6rabbyt_8_sprites_7cSprite_3top___get__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self) { - float __pyx_v_y; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":525 - * def __get__(self): - * cdef float y - * READ_SLOT(&self._y, &y) # <<<<<<<<<<<<<< - * return self._bounds_y().b + y - * def __set__(self, y): - */ - READ_SLOT((&__pyx_v_self->__pyx_base._y), (&__pyx_v_y)); - - /* "rabbyt/rabbyt._sprites.pyx":526 - * cdef float y - * READ_SLOT(&self._y, &y) - * return self._bounds_y().b + y # <<<<<<<<<<<<<< - * def __set__(self, y): - * self.y = y - self._bounds_y().b - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_y(__pyx_v_self).b + __pyx_v_y)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_y); /*proto*/ -static int __pyx_pw_6rabbyt_8_sprites_7cSprite_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_y) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_8_sprites_7cSprite_3top_2__set__(((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_self), ((PyObject *)__pyx_v_y)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt._sprites.pyx":527 - * READ_SLOT(&self._y, &y) - * return self._bounds_y().b + y - * def __set__(self, y): # <<<<<<<<<<<<<< - * self.y = y - self._bounds_y().b - * - */ - -static int __pyx_pf_6rabbyt_8_sprites_7cSprite_3top_2__set__(struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_self, PyObject *__pyx_v_y) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt._sprites.pyx":528 - * return self._bounds_y().b + y - * def __set__(self, y): - * self.y = y - self._bounds_y().b # <<<<<<<<<<<<<< - * - * __docs_all__ = ('Sprite BaseSprite').split() - */ - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_y(__pyx_v_self).b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_y, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__y, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt._sprites.cSprite.top.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite __pyx_vtable_6rabbyt_8_sprites_cBaseSprite; - -static PyObject *__pyx_tp_new_6rabbyt_8_sprites_cBaseSprite(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *p; - PyObject *o = __pyx_ptype_6rabbyt_6_anims_cAnimable->tp_new(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *)o); - p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable*)__pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite; - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_8_sprites_cBaseSprite(PyObject *o) { - PyObject_GC_UnTrack(o); - PyObject_GC_Track(o); - if (likely(__pyx_ptype_6rabbyt_6_anims_cAnimable)) __pyx_ptype_6rabbyt_6_anims_cAnimable->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_6rabbyt_8_sprites_cBaseSprite); -} - -static int __pyx_tp_traverse_6rabbyt_8_sprites_cBaseSprite(PyObject *o, visitproc v, void *a) { - int e; - e = ((likely(__pyx_ptype_6rabbyt_6_anims_cAnimable)) ? ((__pyx_ptype_6rabbyt_6_anims_cAnimable->tp_traverse) ? __pyx_ptype_6rabbyt_6_anims_cAnimable->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6rabbyt_8_sprites_cBaseSprite)); if (e) return e; - return 0; -} - -static int __pyx_tp_clear_6rabbyt_8_sprites_cBaseSprite(PyObject *o) { - if (likely(__pyx_ptype_6rabbyt_6_anims_cAnimable)) { if (__pyx_ptype_6rabbyt_6_anims_cAnimable->tp_clear) __pyx_ptype_6rabbyt_6_anims_cAnimable->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6rabbyt_8_sprites_cBaseSprite); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_15bounding_radius_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius_squared(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius_squared(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_11cBaseSprite_23bounding_radius_squared_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6rabbyt_8_sprites_cBaseSprite[] = { - {__Pyx_NAMESTR("convert_offset"), (PyCFunction)__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_1convert_offset, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_8_sprites_11cBaseSprite_convert_offset)}, - {__Pyx_NAMESTR("render"), (PyCFunction)__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_3render, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_8_sprites_11cBaseSprite_2render)}, - {__Pyx_NAMESTR("render_after_transform"), (PyCFunction)__pyx_pw_6rabbyt_8_sprites_11cBaseSprite_5render_after_transform, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_8_sprites_11cBaseSprite_4render_after_transform)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_8_sprites_cBaseSprite[] = { - {(char *)"bounding_radius", __pyx_getprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius, __pyx_setprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius, __Pyx_DOCSTR(__pyx_k_2), 0}, - {(char *)"bounding_radius_squared", __pyx_getprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius_squared, __pyx_setprop_6rabbyt_8_sprites_11cBaseSprite_bounding_radius_squared, __Pyx_DOCSTR(__pyx_k_3), 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_8_sprites_cBaseSprite = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._sprites.cBaseSprite"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_8_sprites_cBaseSprite, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_8_sprites_cBaseSprite, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_8_sprites_cBaseSprite, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_8_sprites_cBaseSprite, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_8_sprites_cBaseSprite, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_8_sprites_cBaseSprite, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; -static struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite __pyx_vtable_6rabbyt_8_sprites_cSprite; - -static PyObject *__pyx_tp_new_6rabbyt_8_sprites_cSprite(PyTypeObject *t, PyObject *a, PyObject *k) { - struct __pyx_obj_6rabbyt_8_sprites_cSprite *p; - PyObject *o = __pyx_tp_new_6rabbyt_8_sprites_cBaseSprite(t, a, k); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)o); - p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable*)__pyx_vtabptr_6rabbyt_8_sprites_cSprite; - p->_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)Py_None); Py_INCREF(Py_None); - p->_tex_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)Py_None); Py_INCREF(Py_None); - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_8_sprites_cSprite(PyObject *o) { - struct __pyx_obj_6rabbyt_8_sprites_cSprite *p = (struct __pyx_obj_6rabbyt_8_sprites_cSprite *)o; - PyObject_GC_UnTrack(o); - Py_CLEAR(p->_shape); - Py_CLEAR(p->_tex_shape); - PyObject_GC_Track(o); - __pyx_tp_dealloc_6rabbyt_8_sprites_cBaseSprite(o); -} - -static int __pyx_tp_traverse_6rabbyt_8_sprites_cSprite(PyObject *o, visitproc v, void *a) { - int e; - struct __pyx_obj_6rabbyt_8_sprites_cSprite *p = (struct __pyx_obj_6rabbyt_8_sprites_cSprite *)o; - e = __pyx_tp_traverse_6rabbyt_8_sprites_cBaseSprite(o, v, a); if (e) return e; - if (p->_shape) { - e = (*v)(((PyObject*)p->_shape), a); if (e) return e; - } - if (p->_tex_shape) { - e = (*v)(((PyObject*)p->_tex_shape), a); if (e) return e; - } - return 0; -} - -static int __pyx_tp_clear_6rabbyt_8_sprites_cSprite(PyObject *o) { - struct __pyx_obj_6rabbyt_8_sprites_cSprite *p = (struct __pyx_obj_6rabbyt_8_sprites_cSprite *)o; - PyObject* tmp; - __pyx_tp_clear_6rabbyt_8_sprites_cBaseSprite(o); - tmp = ((PyObject*)p->_shape); - p->_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_tex_shape); - p->_tex_shape = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - return 0; -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_bounding_radius(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_bounding_radius(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_3__set__(o, v); - } - else { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_15bounding_radius_5__del__(o); - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_bounding_radius_squared(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_bounding_radius_squared(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_3__set__(o, v); - } - else { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_23bounding_radius_squared_5__del__(o); - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_shape(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_5shape_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_5shape_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_tex_shape(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_9tex_shape_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_tex_shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_9tex_shape_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_texture_id(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_10texture_id_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_texture_id(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_10texture_id_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_left(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_4left_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_4left_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_right(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_5right_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_5right_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_bottom(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_6bottom_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_bottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_6bottom_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_8_sprites_7cSprite_top(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_3top_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_8_sprites_7cSprite_top(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_8_sprites_7cSprite_3top_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6rabbyt_8_sprites_cSprite[] = { - {__Pyx_NAMESTR("render"), (PyCFunction)__pyx_pw_6rabbyt_8_sprites_7cSprite_1render, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_8_sprites_7cSprite_render)}, - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_8_sprites_cSprite[] = { - {(char *)"bounding_radius", __pyx_getprop_6rabbyt_8_sprites_7cSprite_bounding_radius, __pyx_setprop_6rabbyt_8_sprites_7cSprite_bounding_radius, __Pyx_DOCSTR(__pyx_k_4), 0}, - {(char *)"bounding_radius_squared", __pyx_getprop_6rabbyt_8_sprites_7cSprite_bounding_radius_squared, __pyx_setprop_6rabbyt_8_sprites_7cSprite_bounding_radius_squared, __Pyx_DOCSTR(__pyx_k_3), 0}, - {(char *)"shape", __pyx_getprop_6rabbyt_8_sprites_7cSprite_shape, __pyx_setprop_6rabbyt_8_sprites_7cSprite_shape, __Pyx_DOCSTR(__pyx_k_5), 0}, - {(char *)"tex_shape", __pyx_getprop_6rabbyt_8_sprites_7cSprite_tex_shape, __pyx_setprop_6rabbyt_8_sprites_7cSprite_tex_shape, __Pyx_DOCSTR(__pyx_k_6), 0}, - {(char *)"texture_id", __pyx_getprop_6rabbyt_8_sprites_7cSprite_texture_id, __pyx_setprop_6rabbyt_8_sprites_7cSprite_texture_id, 0, 0}, - {(char *)"left", __pyx_getprop_6rabbyt_8_sprites_7cSprite_left, __pyx_setprop_6rabbyt_8_sprites_7cSprite_left, __Pyx_DOCSTR(__pyx_k_7), 0}, - {(char *)"right", __pyx_getprop_6rabbyt_8_sprites_7cSprite_right, __pyx_setprop_6rabbyt_8_sprites_7cSprite_right, __Pyx_DOCSTR(__pyx_k_8), 0}, - {(char *)"bottom", __pyx_getprop_6rabbyt_8_sprites_7cSprite_bottom, __pyx_setprop_6rabbyt_8_sprites_7cSprite_bottom, __Pyx_DOCSTR(__pyx_k_9), 0}, - {(char *)"top", __pyx_getprop_6rabbyt_8_sprites_7cSprite_top, __pyx_setprop_6rabbyt_8_sprites_7cSprite_top, __Pyx_DOCSTR(__pyx_k_10), 0}, - {0, 0, 0, 0, 0} -}; - -static PyTypeObject __pyx_type_6rabbyt_8_sprites_cSprite = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt._sprites.cSprite"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_8_sprites_cSprite), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_8_sprites_cSprite, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - 0, /*tp_doc*/ - __pyx_tp_traverse_6rabbyt_8_sprites_cSprite, /*tp_traverse*/ - __pyx_tp_clear_6rabbyt_8_sprites_cSprite, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_8_sprites_cSprite, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_8_sprites_cSprite, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - 0, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_8_sprites_cSprite, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - __Pyx_NAMESTR("_sprites"), - __Pyx_DOCSTR(__pyx_k_11), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1}, - {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, - {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1}, - {&__pyx_n_s____author__, __pyx_k____author__, sizeof(__pyx_k____author__), 0, 0, 1, 1}, - {&__pyx_n_s____credits__, __pyx_k____credits__, sizeof(__pyx_k____credits__), 0, 0, 1, 1}, - {&__pyx_n_s____docs_all__, __pyx_k____docs_all__, sizeof(__pyx_k____docs_all__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___tex_shape_data_ptr, __pyx_k___tex_shape_data_ptr, sizeof(__pyx_k___tex_shape_data_ptr), 0, 0, 1, 1}, - {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1}, - {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1}, - {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_sprites(void); /*proto*/ -PyMODINIT_FUNC init_sprites(void) -#else -PyMODINIT_FUNC PyInit__sprites(void); /*proto*/ -PyMODINIT_FUNC PyInit__sprites(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__sprites(void)", 0); - if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __Pyx_CyFunction_USED - if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_sprites"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_11), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_d); - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "rabbyt._sprites")) { - if (unlikely(PyDict_SetItemString(modules, "rabbyt._sprites", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__pyx_module_is_main_rabbyt___sprites) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_ptype_6rabbyt_6_anims_cAnimable = __Pyx_ImportType("rabbyt._anims", "cAnimable", sizeof(struct __pyx_obj_6rabbyt_6_anims_cAnimable), 1); if (unlikely(!__pyx_ptype_6rabbyt_6_anims_cAnimable)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_6_anims_cAnimable = (struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_cAnimable->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_6_anims_cAnimable)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite = &__pyx_vtable_6rabbyt_8_sprites_cBaseSprite; - __pyx_vtable_6rabbyt_8_sprites_cBaseSprite.__pyx_base = *__pyx_vtabptr_6rabbyt_6_anims_cAnimable; - __pyx_vtable_6rabbyt_8_sprites_cBaseSprite.__pyx_base._modify_slots = (PyObject *(*)(struct __pyx_obj_6rabbyt_6_anims_cAnimable *))__pyx_f_6rabbyt_8_sprites_11cBaseSprite__modify_slots; - __pyx_vtable_6rabbyt_8_sprites_cBaseSprite._convert_offset = (struct __pyx_t_6rabbyt_10primitives_Point2d (*)(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *, float, float))__pyx_f_6rabbyt_8_sprites_11cBaseSprite__convert_offset; - __pyx_type_6rabbyt_8_sprites_cBaseSprite.tp_base = __pyx_ptype_6rabbyt_6_anims_cAnimable; - if (PyType_Ready(&__pyx_type_6rabbyt_8_sprites_cBaseSprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_8_sprites_cBaseSprite.tp_dict, __pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "cBaseSprite", (PyObject *)&__pyx_type_6rabbyt_8_sprites_cBaseSprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_8_sprites_cBaseSprite = &__pyx_type_6rabbyt_8_sprites_cBaseSprite; - __pyx_vtabptr_6rabbyt_8_sprites_cSprite = &__pyx_vtable_6rabbyt_8_sprites_cSprite; - __pyx_vtable_6rabbyt_8_sprites_cSprite.__pyx_base = *__pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite; - __pyx_vtable_6rabbyt_8_sprites_cSprite.__pyx_base.__pyx_base._modify_slots = (PyObject *(*)(struct __pyx_obj_6rabbyt_6_anims_cAnimable *))__pyx_f_6rabbyt_8_sprites_7cSprite__modify_slots; - __pyx_vtable_6rabbyt_8_sprites_cSprite._render = (int (*)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *))__pyx_f_6rabbyt_8_sprites_7cSprite__render; - __pyx_vtable_6rabbyt_8_sprites_cSprite._bounds_x = (struct __pyx_t_6rabbyt_10primitives_float2 (*)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *))__pyx_f_6rabbyt_8_sprites_7cSprite__bounds_x; - __pyx_vtable_6rabbyt_8_sprites_cSprite._bounds_y = (struct __pyx_t_6rabbyt_10primitives_float2 (*)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *))__pyx_f_6rabbyt_8_sprites_7cSprite__bounds_y; - __pyx_type_6rabbyt_8_sprites_cSprite.tp_base = __pyx_ptype_6rabbyt_8_sprites_cBaseSprite; - if (PyType_Ready(&__pyx_type_6rabbyt_8_sprites_cSprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_8_sprites_cSprite.tp_dict, __pyx_vtabptr_6rabbyt_8_sprites_cSprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "cSprite", (PyObject *)&__pyx_type_6rabbyt_8_sprites_cSprite) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_8_sprites_cSprite = &__pyx_type_6rabbyt_8_sprites_cSprite; - /*--- Type import code ---*/ - __pyx_ptype_6rabbyt_10primitives_Quad = __Pyx_ImportType("rabbyt.primitives", "Quad", sizeof(struct __pyx_obj_6rabbyt_10primitives_Quad), 1); if (unlikely(!__pyx_ptype_6rabbyt_10primitives_Quad)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_10primitives_Quad = (struct __pyx_vtabstruct_6rabbyt_10primitives_Quad*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_10primitives_Quad->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_10primitives_Quad)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_Anim = __Pyx_ImportType("rabbyt._anims", "Anim", sizeof(struct __pyx_obj_6rabbyt_6_anims_Anim), 1); if (unlikely(!__pyx_ptype_6rabbyt_6_anims_Anim)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_6_anims_Anim = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_Anim->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_6_anims_Anim)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimSlot = __Pyx_ImportType("rabbyt._anims", "AnimSlot", sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimSlot), 1); if (unlikely(!__pyx_ptype_6rabbyt_6_anims_AnimSlot)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_6_anims_AnimSlot = (struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_AnimSlot->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_6_anims_AnimSlot)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "rabbyt/rabbyt._sprites.pyx":8 - * - * __credits__ = ( - * """ # <<<<<<<<<<<<<< - * Copyright (C) 2007 Matthew Marshall - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____credits__, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._sprites.pyx":30 - * """) - * - * __author__ = "Matthew Marshall " # <<<<<<<<<<<<<< - * - * cdef extern from "include_math.h": - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt._sprites.pyx":530 - * self.y = y - self._bounds_y().b - * - * __docs_all__ = ('Sprite BaseSprite').split() # <<<<<<<<<<<<<< - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_14), __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s____docs_all__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt._sprites.pyx":1 - * """ # <<<<<<<<<<<<<< - * The most interesting part of this module is probably the ``Sprite`` class. - * - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init rabbyt._sprites", __pyx_clineno, __pyx_lineno, __pyx_filename); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init rabbyt._sprites"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif /* CYTHON_REFNANNY */ - -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - return NULL; - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_Restore(type, value, tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(type, value, tb); -#endif -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - #if PY_VERSION_HEX < 0x02050000 - if (PyClass_Check(type)) { - #else - if (PyType_Check(type)) { - #endif -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else /* Python 3+ */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyEval_CallObject(type, args); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) { - PyTypeObject* type = Py_TYPE(obj); - while (type && type->tp_dealloc != current_tp_dealloc) - type = type->tp_base; - while (type && type->tp_dealloc == current_tp_dealloc) - type = type->tp_base; - if (type) - type->tp_dealloc(obj); -} - -static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) { - PyTypeObject* type = Py_TYPE(obj); - while (type && type->tp_traverse != current_tp_traverse) - type = type->tp_base; - while (type && type->tp_traverse == current_tp_traverse) - type = type->tp_base; - if (type && type->tp_traverse) - return type->tp_traverse(obj, v, a); - return 0; -} - -static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) { - PyTypeObject* type = Py_TYPE(obj); - while (type && type->tp_clear != current_tp_clear) - type = type->tp_base; - while (type && type->tp_clear == current_tp_clear) - type = type->tp_base; - if (type && type->tp_clear) - type->tp_clear(obj); -} - -static void* __Pyx_GetVtable(PyObject *dict) { - void* ptr; - PyObject *ob = PyObject_GetItem(dict, __pyx_n_s____pyx_vtable__); - if (!ob) - goto bad; -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - ptr = PyCapsule_GetPointer(ob, 0); -#else - ptr = PyCObject_AsVoidPtr(ob); -#endif - if (!ptr && !PyErr_Occurred()) - PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); - Py_DECREF(ob); - return ptr; -bad: - Py_XDECREF(ob); - return NULL; -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItem(dict, __pyx_n_s____pyx_vtable__, ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned long)PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (long)PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed long)PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - #if PY_VERSION_HEX < 0x02050000 - return PyErr_Warn(NULL, message); - #else - return PyErr_WarnEx(NULL, message, 1); - #endif - } - return 0; -} - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - if (PyErr_Warn(NULL, warning) < 0) goto bad; - #else - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - #endif - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = (start + end) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, /*int argcount,*/ - 0, /*int kwonlyargcount,*/ - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_globals = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else /* PY_VERSION_HEX < 0x03030000 */ - if (PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_DATA_SIZE(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ - return PyUnicode_AsUTF8AndSize(o, length); -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ -#endif /* PY_VERSION_HEX < 0x03030000 */ - } else -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (r < 0) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred()) - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/rabbyt/rabbyt.collisions.c b/rabbyt/rabbyt.collisions.c deleted file mode 100644 index 09c2a08..0000000 --- a/rabbyt/rabbyt.collisions.c +++ /dev/null @@ -1,7485 +0,0 @@ -/* Generated by Cython 0.19.2 on Mon Dec 16 21:11:31 2013 */ - -#define PY_SSIZE_T_CLEAN -#ifndef CYTHON_USE_PYLONG_INTERNALS -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 0 -#else -#include "pyconfig.h" -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 1 -#else -#define CYTHON_USE_PYLONG_INTERNALS 0 -#endif -#endif -#endif -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02040000 - #error Cython requires Python 2.4+. -#else -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION -#define CYTHON_COMPILING_IN_PYPY 1 -#define CYTHON_COMPILING_IN_CPYTHON 0 -#else -#define CYTHON_COMPILING_IN_PYPY 0 -#define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define CYTHON_FORMAT_SSIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) - #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ - (PyErr_Format(PyExc_TypeError, \ - "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ - (PyObject*)0)) - #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ - !PyComplex_Check(o)) - #define PyIndex_Check __Pyx_PyIndex_Check - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) - #define __PYX_BUILD_PY_SSIZE_T "i" -#else - #define __PYX_BUILD_PY_SSIZE_T "n" - #define CYTHON_FORMAT_SSIZE_T "z" - #define __Pyx_PyIndex_Check PyIndex_Check -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) - #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) - typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); - typedef void (*releasebufferproc)(PyObject *, Py_buffer *); -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 - #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_TPFLAGS_HAVE_VERSION_TAG 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ - PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_VERSION_HEX < 0x03020000 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and - a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is - a quiet NaN. */ - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE__rabbyt__collisions -#define __PYX_HAVE_API__rabbyt__collisions -#include "stdlib.h" -#include "anim_sys.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) -#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return u_end - u - 1; -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (ascii_chars_u == NULL) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - } - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - default_encoding_c = PyBytes_AS_STRING(default_encoding); - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(sys); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -#ifdef __GNUC__ - /* Test for GCC > 2.95 */ - #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #else /* __GNUC__ > 2 ... */ - #define likely(x) (x) - #define unlikely(x) (x) - #endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "rabbyt.collisions.pyx", - "primitives.pxd", - "_anims.pxd", - "_sprites.pxd", -}; - -/*--- Type declarations ---*/ -struct __pyx_obj_6rabbyt_6_anims_cAnimable; -struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite; -struct __pyx_obj_6rabbyt_8_sprites_cSprite; -struct __pyx_obj_6rabbyt_6_anims_AnimSlot; -struct __pyx_obj_6rabbyt_6_anims_Anim; -struct __pyx_obj_6rabbyt_10primitives_Quad; -struct __pyx_t_6rabbyt_10primitives_Point2d; -struct __pyx_t_6rabbyt_10primitives_float2; - -/* "primitives.pxd":1 - * cdef struct Point2d: # <<<<<<<<<<<<<< - * float x,y - * - */ -struct __pyx_t_6rabbyt_10primitives_Point2d { - float x; - float y; -}; - -/* "primitives.pxd":4 - * float x,y - * - * cdef struct float2: # <<<<<<<<<<<<<< - * float a, b - * - */ -struct __pyx_t_6rabbyt_10primitives_float2 { - float a; - float b; -}; -struct __pyx_t_6rabbyt_10collisions_side_s; -struct __pyx_t_6rabbyt_10collisions_collision_object_s; -struct __pyx_t_6rabbyt_10collisions_rect_s; - -/* "rabbyt/rabbyt.collisions.pyx":102 - * - * - * cdef enum _Side: # <<<<<<<<<<<<<< - * LEFT=1 - * RIGHT=2 - */ -enum __pyx_t_6rabbyt_10collisions__Side { - __pyx_e_6rabbyt_10collisions_LEFT = 1, - __pyx_e_6rabbyt_10collisions_RIGHT = 2 -}; - -/* "rabbyt/rabbyt.collisions.pyx":106 - * RIGHT=2 - * - * cdef enum _Axis: # <<<<<<<<<<<<<< - * X=1 - * Y=2 - */ -enum __pyx_t_6rabbyt_10collisions__Axis { - __pyx_e_6rabbyt_10collisions_X = 1, - __pyx_e_6rabbyt_10collisions_Y = 2 -}; - -/* "rabbyt/rabbyt.collisions.pyx":110 - * Y=2 - * - * cdef struct side_s: # <<<<<<<<<<<<<< - * float x,y - * _Side side - */ -struct __pyx_t_6rabbyt_10collisions_side_s { - float x; - float y; - enum __pyx_t_6rabbyt_10collisions__Side side; - struct __pyx_t_6rabbyt_10collisions_side_s *other_side; - int index; -}; - -/* "rabbyt/rabbyt.collisions.pyx":269 - * - * - * cdef struct collision_object_s: # <<<<<<<<<<<<<< - * float x, y, brs - * - */ -struct __pyx_t_6rabbyt_10collisions_collision_object_s { - float x; - float y; - float brs; -}; - -/* "rabbyt/rabbyt.collisions.pyx":363 - * - * - * cdef struct rect_s: # <<<<<<<<<<<<<< - * float l, r, t, b - * - */ -struct __pyx_t_6rabbyt_10collisions_rect_s { - float l; - float r; - float t; - float b; -}; - -/* "_anims.pxd":34 - * cdef void READ_SLOT(AnimSlot_s * slot, float * out) - * - * cdef class cAnimable: # <<<<<<<<<<<<<< - * cdef object _anim_list - * cdef int c_slot_count - */ -struct __pyx_obj_6rabbyt_6_anims_cAnimable { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable *__pyx_vtab; - PyObject *_anim_list; - int c_slot_count; - AnimSlot_s **c_anim_slots; -}; - - -/* "_sprites.pxd":5 - * from _anims cimport cAnimable, AnimSlot, AnimSlot_s, READ_SLOT - * - * cdef class cBaseSprite(cAnimable): # <<<<<<<<<<<<<< - * cdef float _bounding_radius - * cdef AnimSlot_s _x, _y, _rot - */ -struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite { - struct __pyx_obj_6rabbyt_6_anims_cAnimable __pyx_base; - float _bounding_radius; - AnimSlot_s _x; - AnimSlot_s _y; - AnimSlot_s _rot; - AnimSlot_s _red; - AnimSlot_s _green; - AnimSlot_s _blue; - AnimSlot_s _alpha; - AnimSlot_s _scale_x; - AnimSlot_s _scale_y; -}; - - -/* "_sprites.pxd":15 - * - * - * cdef class cSprite(cBaseSprite): # <<<<<<<<<<<<<< - * cdef Quad _shape - * cdef Quad _tex_shape - */ -struct __pyx_obj_6rabbyt_8_sprites_cSprite { - struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite __pyx_base; - struct __pyx_obj_6rabbyt_10primitives_Quad *_shape; - struct __pyx_obj_6rabbyt_10primitives_Quad *_tex_shape; - AnimSlot_s _u; - AnimSlot_s _v; - int _texture_id; - int _bounding_radius_is_explicit; -}; - - -/* "_anims.pxd":45 - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1 - * - * cdef class AnimSlot: # <<<<<<<<<<<<<< - * cdef AnimSlot_s _internal_slot - * cdef AnimSlot_s * _slot - */ -struct __pyx_obj_6rabbyt_6_anims_AnimSlot { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *__pyx_vtab; - AnimSlot_s _internal_slot; - AnimSlot_s *_slot; - struct __pyx_obj_6rabbyt_6_anims_Anim *_py_anim; -}; - - -/* "_anims.pxd":40 - * cdef _modify_slots(self) - * - * cdef class Anim: # <<<<<<<<<<<<<< - * cdef Anim_s _anim - * cdef object dependencies - */ -struct __pyx_obj_6rabbyt_6_anims_Anim { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtab; - Anim_s _anim; - PyObject *dependencies; -}; - - -/* "primitives.pxd":7 - * float a, b - * - * cdef class Quad: # <<<<<<<<<<<<<< - * cdef Point2d v[4] - * cdef public float bounding_radius - */ -struct __pyx_obj_6rabbyt_10primitives_Quad { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *__pyx_vtab; - struct __pyx_t_6rabbyt_10primitives_Point2d v[4]; - float bounding_radius; -}; - - - -/* "_anims.pxd":34 - * cdef void READ_SLOT(AnimSlot_s * slot, float * out) - * - * cdef class cAnimable: # <<<<<<<<<<<<<< - * cdef object _anim_list - * cdef int c_slot_count - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable { - PyObject *(*_modify_slots)(struct __pyx_obj_6rabbyt_6_anims_cAnimable *); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable *__pyx_vtabptr_6rabbyt_6_anims_cAnimable; - - -/* "_anims.pxd":45 - * cdef int add_dependency(self, source, AnimSlot_s * target) except -1 - * - * cdef class AnimSlot: # <<<<<<<<<<<<<< - * cdef AnimSlot_s _internal_slot - * cdef AnimSlot_s * _slot - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot { - int (*c_set_anim)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, struct __pyx_obj_6rabbyt_6_anims_Anim *); - struct __pyx_obj_6rabbyt_6_anims_Anim *(*c_get_anim)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *); - float (*c_get_value)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *); - int (*c_set_value)(struct __pyx_obj_6rabbyt_6_anims_AnimSlot *, float); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot *__pyx_vtabptr_6rabbyt_6_anims_AnimSlot; - - -/* "primitives.pxd":7 - * float a, b - * - * cdef class Quad: # <<<<<<<<<<<<<< - * cdef Point2d v[4] - * cdef public float bounding_radius - */ - -struct __pyx_vtabstruct_6rabbyt_10primitives_Quad { - void (*_shift_x)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float); - void (*_shift_y)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_x)(struct __pyx_obj_6rabbyt_10primitives_Quad *); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_y)(struct __pyx_obj_6rabbyt_10primitives_Quad *); - void (*_update_bounding_radius)(struct __pyx_obj_6rabbyt_10primitives_Quad *); -}; -static struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *__pyx_vtabptr_6rabbyt_10primitives_Quad; - - -/* "_sprites.pxd":5 - * from _anims cimport cAnimable, AnimSlot, AnimSlot_s, READ_SLOT - * - * cdef class cBaseSprite(cAnimable): # <<<<<<<<<<<<<< - * cdef float _bounding_radius - * cdef AnimSlot_s _x, _y, _rot - */ - -struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite { - struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable __pyx_base; - struct __pyx_t_6rabbyt_10primitives_Point2d (*_convert_offset)(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite *, float, float); -}; -static struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite *__pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite; - - -/* "_sprites.pxd":15 - * - * - * cdef class cSprite(cBaseSprite): # <<<<<<<<<<<<<< - * cdef Quad _shape - * cdef Quad _tex_shape - */ - -struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite { - struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite __pyx_base; - int (*_render)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_x)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_y)(struct __pyx_obj_6rabbyt_8_sprites_cSprite *); -}; -static struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *__pyx_vtabptr_6rabbyt_8_sprites_cSprite; - - -/* "_anims.pxd":40 - * cdef _modify_slots(self) - * - * cdef class Anim: # <<<<<<<<<<<<<< - * cdef Anim_s _anim - * cdef object dependencies - */ - -struct __pyx_vtabstruct_6rabbyt_6_anims_Anim { - int (*add_dependency)(struct __pyx_obj_6rabbyt_6_anims_Anim *, PyObject *, AnimSlot_s *); -}; -static struct __pyx_vtabstruct_6rabbyt_6_anims_Anim *__pyx_vtabptr_6rabbyt_6_anims_Anim; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - if (acquire_gil) { \ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - PyGILState_Release(__pyx_gilstate_save); \ - } else { \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext() \ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XDECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_XDECREF(tmp); \ - } while (0) -#define __Pyx_DECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_DECREF(tmp); \ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ - const char* function_name); /*proto*/ - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { - PyListObject* L = (PyListObject*) list; - Py_ssize_t len = Py_SIZE(list); - if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { - Py_INCREF(x); - PyList_SET_ITEM(list, len, x); - Py_SIZE(list) = len+1; - return 0; - } - return PyList_Append(list, x); -} -#else -#define __Pyx_PyList_Append(L,x) PyList_Append(L,x) -#endif - -static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) { - PyObject *method, *result = NULL; - if (unlikely(!args)) return NULL; - method = __Pyx_PyObject_GetAttrStr(obj, method_name); - if (unlikely(!method)) goto bad; - result = PyObject_Call(method, args, NULL); - Py_DECREF(method); -bad: - Py_DECREF(args); - return result; -} -#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \ - __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3)) -#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \ - __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2)) -#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \ - __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1)) -#define __Pyx_PyObject_CallMethod0(obj, name) \ - __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple)) - -static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x); /*proto*/ - -static void* __Pyx_GetVtable(PyObject *dict); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_check_binary_version(void); - -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ - -typedef struct { - int code_line; - PyCodeObject* code_object; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - - -/* Module declarations from 'rabbyt.primitives' */ -static PyTypeObject *__pyx_ptype_6rabbyt_10primitives_Quad = 0; - -/* Module declarations from 'rabbyt._anims' */ -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_cAnimable = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_Anim = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_6_anims_AnimSlot = 0; - -/* Module declarations from 'rabbyt._sprites' */ -static PyTypeObject *__pyx_ptype_6rabbyt_8_sprites_cBaseSprite = 0; -static PyTypeObject *__pyx_ptype_6rabbyt_8_sprites_cSprite = 0; - -/* Module declarations from 'rabbyt.collisions' */ -static int __pyx_f_6rabbyt_10collisions__compar_sides_x(void *, void *); /*proto*/ -static int __pyx_f_6rabbyt_10collisions__compar_sides_y(void *, void *); /*proto*/ -static void __pyx_f_6rabbyt_10collisions__rdc(struct __pyx_t_6rabbyt_10collisions_side_s **, int, enum __pyx_t_6rabbyt_10collisions__Axis, int, int, int); /*proto*/ -static PyObject *__pyx_f_6rabbyt_10collisions__brute_force(struct __pyx_t_6rabbyt_10collisions_collision_object_s *, int, PyObject *); /*proto*/ -static int __pyx_f_6rabbyt_10collisions__read_rect(PyObject *, struct __pyx_t_6rabbyt_10collisions_rect_s *); /*proto*/ -static int __pyx_f_6rabbyt_10collisions__collide_rect(struct __pyx_t_6rabbyt_10collisions_rect_s *, struct __pyx_t_6rabbyt_10collisions_rect_s *); /*proto*/ -#define __Pyx_MODULE_NAME "rabbyt.collisions" -int __pyx_module_is_main_rabbyt__collisions = 0; - -/* Implementation of 'rabbyt.collisions' */ -static PyObject *__pyx_pf_6rabbyt_10collisions__get_object_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_2collide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_4collide_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_single, PyObject *__pyx_v_objects); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_6rdc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, int __pyx_v_min_split, int __pyx_v_max_depth); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_8brute_force(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_10collide_groups(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_group_a, PyObject *__pyx_v_group_b); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_12aabb_collide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_14aabb_collide_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_single, PyObject *__pyx_v_objects); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10collisions_16aabb_collide_groups(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_group_a, PyObject *__pyx_v_group_b); /* proto */ -static char __pyx_k_1[] = "bounding_radius_squared"; -static char __pyx_k_2[] = "\nThis module provides some functions for collision detection.\n"; -static char __pyx_k_3[] = "\nCopyright (C) 2007 Matthew Marshall\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"; -static char __pyx_k_4[] = "Matthew Marshall "; -static char __pyx_k_7[] = "C:\\Users\\Ryexander\\Desktop\\Rabbyt-0.8.3\\rabbyt\\rabbyt.collisions.pyx"; -static char __pyx_k_8[] = "rabbyt.collisions"; -static char __pyx_k__a[] = "a"; -static char __pyx_k__b[] = "b"; -static char __pyx_k__d[] = "d"; -static char __pyx_k__i[] = "i"; -static char __pyx_k__j[] = "j"; -static char __pyx_k__l[] = "l"; -static char __pyx_k__o[] = "o"; -static char __pyx_k__r[] = "r"; -static char __pyx_k__t[] = "t"; -static char __pyx_k__x[] = "x"; -static char __pyx_k__y[] = "y"; -static char __pyx_k__dx[] = "dx"; -static char __pyx_k__dy[] = "dy"; -static char __pyx_k__ox[] = "ox"; -static char __pyx_k__oy[] = "oy"; -static char __pyx_k__brs[] = "brs"; -static char __pyx_k__obj[] = "obj"; -static char __pyx_k__r_a[] = "r_a"; -static char __pyx_k__r_b[] = "r_b"; -static char __pyx_k__rdc[] = "rdc"; -static char __pyx_k__top[] = "top"; -static char __pyx_k__left[] = "left"; -static char __pyx_k__objs[] = "objs"; -static char __pyx_k__obrs[] = "obrs"; -static char __pyx_k__rect[] = "rect"; -static char __pyx_k__group[] = "group"; -static char __pyx_k__index[] = "index"; -static char __pyx_k__right[] = "right"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__bottom[] = "bottom"; -static char __pyx_k__extend[] = "extend"; -static char __pyx_k__groups[] = "groups"; -static char __pyx_k__length[] = "length"; -static char __pyx_k__single[] = "single"; -static char __pyx_k__sprite[] = "sprite"; -static char __pyx_k__collide[] = "collide"; -static char __pyx_k__group_a[] = "group_a"; -static char __pyx_k__group_b[] = "group_b"; -static char __pyx_k__objects[] = "objects"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__c_group_b[] = "c_group_b"; -static char __pyx_k__max_depth[] = "max_depth"; -static char __pyx_k__min_split[] = "min_split"; -static char __pyx_k__side_list[] = "side_list"; -static char __pyx_k__temp_side[] = "temp_side"; -static char __pyx_k____author__[] = "__author__"; -static char __pyx_k__collisions[] = "collisions"; -static char __pyx_k____credits__[] = "__credits__"; -static char __pyx_k__brute_force[] = "brute_force"; -static char __pyx_k__group_start[] = "group_start"; -static char __pyx_k__side_p_list[] = "side_p_list"; -static char __pyx_k__temp_float2[] = "temp_float2"; -static char __pyx_k____docs_all__[] = "__docs_all__"; -static char __pyx_k__aabb_collide[] = "aabb_collide"; -static char __pyx_k__current_group[] = "current_group"; -static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__"; -static char __pyx_k__collide_groups[] = "collide_groups"; -static char __pyx_k__collide_single[] = "collide_single"; -static char __pyx_k__bounding_radius[] = "bounding_radius"; -static char __pyx_k___get_object_data[] = "_get_object_data"; -static char __pyx_k__aabb_collide_groups[] = "aabb_collide_groups"; -static char __pyx_k__aabb_collide_single[] = "aabb_collide_single"; -static PyObject *__pyx_n_s_1; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_n_s_8; -static PyObject *__pyx_n_s____author__; -static PyObject *__pyx_n_s____credits__; -static PyObject *__pyx_n_s____docs_all__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____pyx_vtable__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___get_object_data; -static PyObject *__pyx_n_s__a; -static PyObject *__pyx_n_s__aabb_collide; -static PyObject *__pyx_n_s__aabb_collide_groups; -static PyObject *__pyx_n_s__aabb_collide_single; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__b; -static PyObject *__pyx_n_s__bottom; -static PyObject *__pyx_n_s__bounding_radius; -static PyObject *__pyx_n_s__brs; -static PyObject *__pyx_n_s__brute_force; -static PyObject *__pyx_n_s__c_group_b; -static PyObject *__pyx_n_s__collide; -static PyObject *__pyx_n_s__collide_groups; -static PyObject *__pyx_n_s__collide_single; -static PyObject *__pyx_n_s__collisions; -static PyObject *__pyx_n_s__current_group; -static PyObject *__pyx_n_s__d; -static PyObject *__pyx_n_s__dx; -static PyObject *__pyx_n_s__dy; -static PyObject *__pyx_n_s__extend; -static PyObject *__pyx_n_s__group; -static PyObject *__pyx_n_s__group_a; -static PyObject *__pyx_n_s__group_b; -static PyObject *__pyx_n_s__group_start; -static PyObject *__pyx_n_s__groups; -static PyObject *__pyx_n_s__i; -static PyObject *__pyx_n_s__index; -static PyObject *__pyx_n_s__j; -static PyObject *__pyx_n_s__l; -static PyObject *__pyx_n_s__left; -static PyObject *__pyx_n_s__length; -static PyObject *__pyx_n_s__max_depth; -static PyObject *__pyx_n_s__min_split; -static PyObject *__pyx_n_s__o; -static PyObject *__pyx_n_s__obj; -static PyObject *__pyx_n_s__objects; -static PyObject *__pyx_n_s__objs; -static PyObject *__pyx_n_s__obrs; -static PyObject *__pyx_n_s__ox; -static PyObject *__pyx_n_s__oy; -static PyObject *__pyx_n_s__r; -static PyObject *__pyx_n_s__r_a; -static PyObject *__pyx_n_s__r_b; -static PyObject *__pyx_n_s__rdc; -static PyObject *__pyx_n_s__rect; -static PyObject *__pyx_n_s__right; -static PyObject *__pyx_n_s__side_list; -static PyObject *__pyx_n_s__side_p_list; -static PyObject *__pyx_n_s__single; -static PyObject *__pyx_n_s__sprite; -static PyObject *__pyx_n_s__t; -static PyObject *__pyx_n_s__temp_float2; -static PyObject *__pyx_n_s__temp_side; -static PyObject *__pyx_n_s__top; -static PyObject *__pyx_n_s__x; -static PyObject *__pyx_n_s__y; -static PyObject *__pyx_int_2; -static PyObject *__pyx_int_10; -static PyObject *__pyx_k_tuple_5; -static PyObject *__pyx_k_tuple_9; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_13; -static PyObject *__pyx_k_tuple_15; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_19; -static PyObject *__pyx_k_tuple_21; -static PyObject *__pyx_k_tuple_23; -static PyObject *__pyx_k_tuple_25; -static PyObject *__pyx_k_codeobj_6; -static PyObject *__pyx_k_codeobj_10; -static PyObject *__pyx_k_codeobj_12; -static PyObject *__pyx_k_codeobj_14; -static PyObject *__pyx_k_codeobj_16; -static PyObject *__pyx_k_codeobj_18; -static PyObject *__pyx_k_codeobj_20; -static PyObject *__pyx_k_codeobj_22; -static PyObject *__pyx_k_codeobj_24; - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_1_get_object_data(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/ -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_1_get_object_data = {__Pyx_NAMESTR("_get_object_data"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_1_get_object_data, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_1_get_object_data(PyObject *__pyx_self, PyObject *__pyx_v_obj) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_get_object_data (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10collisions__get_object_data(__pyx_self, ((PyObject *)__pyx_v_obj)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":43 - * from _sprites cimport cSprite - * - * def _get_object_data(obj): # <<<<<<<<<<<<<< - * cdef float x,y,brs - * if hasattr(obj, 'x') and hasattr(obj, 'y'): - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions__get_object_data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { - float __pyx_v_x; - float __pyx_v_y; - float __pyx_v_brs; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - float __pyx_t_5; - float __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_get_object_data", 0); - - /* "rabbyt/rabbyt.collisions.pyx":45 - * def _get_object_data(obj): - * cdef float x,y,brs - * if hasattr(obj, 'x') and hasattr(obj, 'y'): # <<<<<<<<<<<<<< - * x,y = obj.x, obj.y - * if hasattr(obj, "bounding_radius"): - */ - __pyx_t_1 = PyObject_HasAttr(__pyx_v_obj, ((PyObject *)__pyx_n_s__x)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if ((__pyx_t_1 != 0)) { - __pyx_t_2 = PyObject_HasAttr(__pyx_v_obj, ((PyObject *)__pyx_n_s__y)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = (__pyx_t_2 != 0); - } else { - __pyx_t_3 = (__pyx_t_1 != 0); - } - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.collisions.pyx":46 - * cdef float x,y,brs - * if hasattr(obj, 'x') and hasattr(obj, 'y'): - * x,y = obj.x, obj.y # <<<<<<<<<<<<<< - * if hasattr(obj, "bounding_radius"): - * brs = obj.bounding_radius**2 - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s__x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s__y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_x = __pyx_t_5; - __pyx_v_y = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":47 - * if hasattr(obj, 'x') and hasattr(obj, 'y'): - * x,y = obj.x, obj.y - * if hasattr(obj, "bounding_radius"): # <<<<<<<<<<<<<< - * brs = obj.bounding_radius**2 - * else: - */ - __pyx_t_3 = PyObject_HasAttr(__pyx_v_obj, ((PyObject *)__pyx_n_s__bounding_radius)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = (__pyx_t_3 != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt.collisions.pyx":48 - * x,y = obj.x, obj.y - * if hasattr(obj, "bounding_radius"): - * brs = obj.bounding_radius**2 # <<<<<<<<<<<<<< - * else: - * brs = 0 - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s__bounding_radius); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_brs = __pyx_t_6; - goto __pyx_L4; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":50 - * brs = obj.bounding_radius**2 - * else: - * brs = 0 # <<<<<<<<<<<<<< - * else: - * x = obj[0] - */ - __pyx_v_brs = 0.0; - } - __pyx_L4:; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":52 - * brs = 0 - * else: - * x = obj[0] # <<<<<<<<<<<<<< - * y = obj[1] - * if len(obj) > 2: - */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_obj, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_x = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":53 - * else: - * x = obj[0] - * y = obj[1] # <<<<<<<<<<<<<< - * if len(obj) > 2: - * brs = obj[2] ** 2 - */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_obj, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_y = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":54 - * x = obj[0] - * y = obj[1] - * if len(obj) > 2: # <<<<<<<<<<<<<< - * brs = obj[2] ** 2 - * else: - */ - __pyx_t_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = ((__pyx_t_8 > 2) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt.collisions.pyx":55 - * y = obj[1] - * if len(obj) > 2: - * brs = obj[2] ** 2 # <<<<<<<<<<<<<< - * else: - * brs = 0 - */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_obj, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_brs = __pyx_t_6; - goto __pyx_L5; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":57 - * brs = obj[2] ** 2 - * else: - * brs = 0 # <<<<<<<<<<<<<< - * return (x,y,brs) - * - */ - __pyx_v_brs = 0.0; - } - __pyx_L5:; - } - __pyx_L3:; - - /* "rabbyt/rabbyt.collisions.pyx":58 - * else: - * brs = 0 - * return (x,y,brs) # <<<<<<<<<<<<<< - * - * def collide(objects): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_brs); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_4 = 0; - __pyx_t_7 = 0; - __pyx_t_9 = 0; - __pyx_r = ((PyObject *)__pyx_t_10); - __pyx_t_10 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("rabbyt.collisions._get_object_data", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_3collide(PyObject *__pyx_self, PyObject *__pyx_v_objects); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_2collide[] = "\n ``collide(objects) -> list of collisions``\n\n Collides ``objects``, first using ``rdc()`` and then using\n ``brute_force()``.\n\n Each object should have the attributes ``x``, ``y``, ``bounding_radius``,\n and ``bounding_radius_squared``.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_3collide = {__Pyx_NAMESTR("collide"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_3collide, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_2collide)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_3collide(PyObject *__pyx_self, PyObject *__pyx_v_objects) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("collide (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10collisions_2collide(__pyx_self, ((PyObject *)__pyx_v_objects)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":60 - * return (x,y,brs) - * - * def collide(objects): # <<<<<<<<<<<<<< - * """ - * ``collide(objects) -> list of collisions`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_2collide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects) { - PyObject *__pyx_v_collisions = NULL; - PyObject *__pyx_v_group = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - Py_ssize_t __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("collide", 0); - - /* "rabbyt/rabbyt.collisions.pyx":70 - * and ``bounding_radius_squared``. - * """ - * collisions = [] # <<<<<<<<<<<<<< - * for group in rdc(objects, min_split=10): - * if len(group) > 1: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_collisions = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":71 - * """ - * collisions = [] - * for group in rdc(objects, min_split=10): # <<<<<<<<<<<<<< - * if len(group) > 1: - * collisions.extend(brute_force(group)) - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__rdc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_objects); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_objects); - __Pyx_GIVEREF(__pyx_v_objects); - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__min_split), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_6(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_group, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":72 - * collisions = [] - * for group in rdc(objects, min_split=10): - * if len(group) > 1: # <<<<<<<<<<<<<< - * collisions.extend(brute_force(group)) - * return collisions - */ - __pyx_t_7 = PyObject_Length(__pyx_v_group); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = ((__pyx_t_7 > 1) != 0); - if (__pyx_t_8) { - - /* "rabbyt/rabbyt.collisions.pyx":73 - * for group in rdc(objects, min_split=10): - * if len(group) > 1: - * collisions.extend(brute_force(group)) # <<<<<<<<<<<<<< - * return collisions - * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_collisions), __pyx_n_s__extend); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__brute_force); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_group); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_group); - __Pyx_GIVEREF(__pyx_v_group); - __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L5; - } - __pyx_L5:; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":74 - * if len(group) > 1: - * collisions.extend(brute_force(group)) - * return collisions # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_collisions)); - __pyx_r = ((PyObject *)__pyx_v_collisions); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("rabbyt.collisions.collide", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_collisions); - __Pyx_XDECREF(__pyx_v_group); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_5collide_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_4collide_single[] = "\n ``collide_single(single, objects)``\n\n Finds collisions between a single object and a list of objects.\n\n ``single`` can either be an object with ``x``, ``y``, and\n ``bounding_radius`` attributes, or a tuple of ``(x,y, bounding_radius)``\n (In both cases, ``bounding_radius`` is optional and defaults to ``0``.)\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_5collide_single = {__Pyx_NAMESTR("collide_single"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_5collide_single, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_4collide_single)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_5collide_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_single = 0; - PyObject *__pyx_v_objects = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("collide_single (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__single,&__pyx_n_s__objects,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__single)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__objects)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("collide_single", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collide_single") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_single = values[0]; - __pyx_v_objects = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("collide_single", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.collisions.collide_single", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10collisions_4collide_single(__pyx_self, __pyx_v_single, __pyx_v_objects); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":77 - * - * - * def collide_single(single, objects): # <<<<<<<<<<<<<< - * """ - * ``collide_single(single, objects)`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_4collide_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_single, PyObject *__pyx_v_objects) { - PyObject *__pyx_v_o = 0; - float __pyx_v_x; - float __pyx_v_y; - float __pyx_v_brs; - float __pyx_v_dx; - float __pyx_v_dy; - float __pyx_v_ox; - float __pyx_v_oy; - float __pyx_v_obrs; - PyObject *__pyx_v_collisions = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *(*__pyx_t_6)(PyObject *); - float __pyx_t_7; - float __pyx_t_8; - float __pyx_t_9; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - PyObject *__pyx_t_12 = NULL; - int __pyx_t_13; - int __pyx_t_14; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("collide_single", 0); - - /* "rabbyt/rabbyt.collisions.pyx":90 - * cdef float x,y,brs, dx,dy, ox, oy, obrs - * - * x,y,brs = _get_object_data(single) # <<<<<<<<<<<<<< - * - * collisions = [] - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___get_object_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_single); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_single); - __Pyx_GIVEREF(__pyx_v_single); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { - PyObject* sequence = __pyx_t_3; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); - } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_4 = PyList_GET_ITEM(sequence, 2); - } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - #endif - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } else - { - Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; - index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L4_unpacking_done:; - } - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_x = __pyx_t_7; - __pyx_v_y = __pyx_t_8; - __pyx_v_brs = __pyx_t_9; - - /* "rabbyt/rabbyt.collisions.pyx":92 - * x,y,brs = _get_object_data(single) - * - * collisions = [] # <<<<<<<<<<<<<< - * for o in objects: - * ox, oy, obrs = _get_object_data(o) - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_collisions = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":93 - * - * collisions = [] - * for o in objects: # <<<<<<<<<<<<<< - * ox, oy, obrs = _get_object_data(o) - * dx = x - ox - */ - if (PyList_CheckExact(__pyx_v_objects) || PyTuple_CheckExact(__pyx_v_objects)) { - __pyx_t_3 = __pyx_v_objects; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; - } - for (;;) { - if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_3)) { - if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_3)) { - if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_11(__pyx_t_3); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":94 - * collisions = [] - * for o in objects: - * ox, oy, obrs = _get_object_data(o) # <<<<<<<<<<<<<< - * dx = x - ox - * dy = y - oy - */ - __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___get_object_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { - PyObject* sequence = __pyx_t_2; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); - } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_4 = PyList_GET_ITEM(sequence, 1); - __pyx_t_5 = PyList_GET_ITEM(sequence, 2); - } - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else - { - Py_ssize_t index = -1; - __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = Py_TYPE(__pyx_t_12)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_12); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_4); - index = 2; __pyx_t_5 = __pyx_t_6(__pyx_t_12); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_12), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_6 = NULL; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - goto __pyx_L8_unpacking_done; - __pyx_L7_unpacking_failed:; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_6 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L8_unpacking_done:; - } - __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_ox = __pyx_t_9; - __pyx_v_oy = __pyx_t_8; - __pyx_v_obrs = __pyx_t_7; - - /* "rabbyt/rabbyt.collisions.pyx":95 - * for o in objects: - * ox, oy, obrs = _get_object_data(o) - * dx = x - ox # <<<<<<<<<<<<<< - * dy = y - oy - * if dx*dx + dy*dy < obrs + brs: - */ - __pyx_v_dx = (__pyx_v_x - __pyx_v_ox); - - /* "rabbyt/rabbyt.collisions.pyx":96 - * ox, oy, obrs = _get_object_data(o) - * dx = x - ox - * dy = y - oy # <<<<<<<<<<<<<< - * if dx*dx + dy*dy < obrs + brs: - * collisions.append(o) - */ - __pyx_v_dy = (__pyx_v_y - __pyx_v_oy); - - /* "rabbyt/rabbyt.collisions.pyx":97 - * dx = x - ox - * dy = y - oy - * if dx*dx + dy*dy < obrs + brs: # <<<<<<<<<<<<<< - * collisions.append(o) - * return collisions - */ - __pyx_t_13 = ((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) < (__pyx_v_obrs + __pyx_v_brs)) != 0); - if (__pyx_t_13) { - - /* "rabbyt/rabbyt.collisions.pyx":98 - * dy = y - oy - * if dx*dx + dy*dy < obrs + brs: - * collisions.append(o) # <<<<<<<<<<<<<< - * return collisions - * - */ - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_collisions, __pyx_v_o); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; - } - __pyx_L9:; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":99 - * if dx*dx + dy*dy < obrs + brs: - * collisions.append(o) - * return collisions # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_collisions)); - __pyx_r = ((PyObject *)__pyx_v_collisions); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("rabbyt.collisions.collide_single", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XDECREF(__pyx_v_collisions); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":116 - * int index - * - * cdef int _compar_sides_x(void *p1, void *p2): # <<<<<<<<<<<<<< - * cdef float x1, x2 - * x1 = (p1)[0][0].x - */ - -static int __pyx_f_6rabbyt_10collisions__compar_sides_x(void *__pyx_v_p1, void *__pyx_v_p2) { - float __pyx_v_x1; - float __pyx_v_x2; - int __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("_compar_sides_x", 0); - - /* "rabbyt/rabbyt.collisions.pyx":118 - * cdef int _compar_sides_x(void *p1, void *p2): - * cdef float x1, x2 - * x1 = (p1)[0][0].x # <<<<<<<<<<<<<< - * x2 = (p2)[0][0].x - * if x1 < x2: - */ - __pyx_t_1 = ((((struct __pyx_t_6rabbyt_10collisions_side_s **)__pyx_v_p1)[0])[0]).x; - __pyx_v_x1 = __pyx_t_1; - - /* "rabbyt/rabbyt.collisions.pyx":119 - * cdef float x1, x2 - * x1 = (p1)[0][0].x - * x2 = (p2)[0][0].x # <<<<<<<<<<<<<< - * if x1 < x2: - * return -1 - */ - __pyx_t_1 = ((((struct __pyx_t_6rabbyt_10collisions_side_s **)__pyx_v_p2)[0])[0]).x; - __pyx_v_x2 = __pyx_t_1; - - /* "rabbyt/rabbyt.collisions.pyx":120 - * x1 = (p1)[0][0].x - * x2 = (p2)[0][0].x - * if x1 < x2: # <<<<<<<<<<<<<< - * return -1 - * elif x1 > x2: - */ - __pyx_t_2 = ((__pyx_v_x1 < __pyx_v_x2) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":121 - * x2 = (p2)[0][0].x - * if x1 < x2: - * return -1 # <<<<<<<<<<<<<< - * elif x1 > x2: - * return 1 - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "rabbyt/rabbyt.collisions.pyx":122 - * if x1 < x2: - * return -1 - * elif x1 > x2: # <<<<<<<<<<<<<< - * return 1 - * else: - */ - __pyx_t_2 = ((__pyx_v_x1 > __pyx_v_x2) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":123 - * return -1 - * elif x1 > x2: - * return 1 # <<<<<<<<<<<<<< - * else: - * return 0 - */ - __pyx_r = 1; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":125 - * return 1 - * else: - * return 0 # <<<<<<<<<<<<<< - * - * cdef int _compar_sides_y(void *p1, void *p2): - */ - __pyx_r = 0; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":127 - * return 0 - * - * cdef int _compar_sides_y(void *p1, void *p2): # <<<<<<<<<<<<<< - * cdef float y1, y2 - * y1 = (p1)[0][0].y - */ - -static int __pyx_f_6rabbyt_10collisions__compar_sides_y(void *__pyx_v_p1, void *__pyx_v_p2) { - float __pyx_v_y1; - float __pyx_v_y2; - int __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("_compar_sides_y", 0); - - /* "rabbyt/rabbyt.collisions.pyx":129 - * cdef int _compar_sides_y(void *p1, void *p2): - * cdef float y1, y2 - * y1 = (p1)[0][0].y # <<<<<<<<<<<<<< - * y2 = (p2)[0][0].y - * if y1 < y2: - */ - __pyx_t_1 = ((((struct __pyx_t_6rabbyt_10collisions_side_s **)__pyx_v_p1)[0])[0]).y; - __pyx_v_y1 = __pyx_t_1; - - /* "rabbyt/rabbyt.collisions.pyx":130 - * cdef float y1, y2 - * y1 = (p1)[0][0].y - * y2 = (p2)[0][0].y # <<<<<<<<<<<<<< - * if y1 < y2: - * return -1 - */ - __pyx_t_1 = ((((struct __pyx_t_6rabbyt_10collisions_side_s **)__pyx_v_p2)[0])[0]).y; - __pyx_v_y2 = __pyx_t_1; - - /* "rabbyt/rabbyt.collisions.pyx":131 - * y1 = (p1)[0][0].y - * y2 = (p2)[0][0].y - * if y1 < y2: # <<<<<<<<<<<<<< - * return -1 - * elif y1 > y2: - */ - __pyx_t_2 = ((__pyx_v_y1 < __pyx_v_y2) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":132 - * y2 = (p2)[0][0].y - * if y1 < y2: - * return -1 # <<<<<<<<<<<<<< - * elif y1 > y2: - * return 1 - */ - __pyx_r = -1; - goto __pyx_L0; - goto __pyx_L3; - } - - /* "rabbyt/rabbyt.collisions.pyx":133 - * if y1 < y2: - * return -1 - * elif y1 > y2: # <<<<<<<<<<<<<< - * return 1 - * else: - */ - __pyx_t_2 = ((__pyx_v_y1 > __pyx_v_y2) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":134 - * return -1 - * elif y1 > y2: - * return 1 # <<<<<<<<<<<<<< - * else: - * return 0 - */ - __pyx_r = 1; - goto __pyx_L0; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":136 - * return 1 - * else: - * return 0 # <<<<<<<<<<<<<< - * - * def rdc(objects, int min_split=1, int max_depth=0): - */ - __pyx_r = 0; - goto __pyx_L0; - } - __pyx_L3:; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_7rdc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_6rdc[] = "\n ``rdc(objects, [max_depth,] [min_split]) -> list of collision groups``\n\n Uses the Recursive Dimensional Clustering algorithm to find groups of\n colliding objects.\n\n ``objects`` should be a list of objects. Each object should have the\n attributes ``x``, ``y``, and ``bounding_radius``.\n\n If the number of objects in a collision group is less than ``min_split``,\n recursion will stop. This defaults to ``1``, but in practice, it is\n usually faster to just use a brute force method once a group gets down\n to ``10`` objects.\n\n ``max_depth`` is the maximum number of recursions to make. It defaults to\n ``0``, which is infinite.\n\n Instead of returning individual collisions, ``rdc()`` returns groups\n (lists) of colliding objects. For example, if ``A`` collides with ``B``\n and ``B`` collides with ``C``, one of the groups will be ``[A, B, C]``,\n even though ``A`` and ``C`` don't directly collide.\n\n Also, each object is returned at most once. If it is in one group, it won't\n be in any other. An object without any collisions isn't returned at all.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_7rdc = {__Pyx_NAMESTR("rdc"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_7rdc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_6rdc)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_7rdc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_objects = 0; - int __pyx_v_min_split; - int __pyx_v_max_depth; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rdc (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__objects,&__pyx_n_s__min_split,&__pyx_n_s__max_depth,0}; - PyObject* values[3] = {0,0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__objects)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_split); - if (value) { values[1] = value; kw_args--; } - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__max_depth); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rdc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else { - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_objects = values[0]; - if (values[1]) { - __pyx_v_min_split = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_min_split == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_min_split = ((int)1); - } - if (values[2]) { - __pyx_v_max_depth = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_max_depth = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rdc", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.collisions.rdc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10collisions_6rdc(__pyx_self, __pyx_v_objects, __pyx_v_min_split, __pyx_v_max_depth); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":138 - * return 0 - * - * def rdc(objects, int min_split=1, int max_depth=0): # <<<<<<<<<<<<<< - * """ - * ``rdc(objects, [max_depth,] [min_split]) -> list of collision groups`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_6rdc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects, int __pyx_v_min_split, int __pyx_v_max_depth) { - struct __pyx_t_6rabbyt_10collisions_side_s *__pyx_v_side_list; - struct __pyx_t_6rabbyt_10collisions_side_s **__pyx_v_side_p_list; - int __pyx_v_length; - int __pyx_v_i; - int __pyx_v_d; - float __pyx_v_r; - float __pyx_v_x; - float __pyx_v_y; - PyObject *__pyx_v_o = NULL; - PyObject *__pyx_v_groups = NULL; - PyObject *__pyx_v_current_group = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - long __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - float __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("rdc", 0); - - /* "rabbyt/rabbyt.collisions.pyx":169 - * cdef int length, i, d, group_start - * cdef float r, x, y - * length = len(objects)*2 # <<<<<<<<<<<<<< - * - * side_list = malloc(sizeof(side_s)*length) - */ - __pyx_t_1 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = (__pyx_t_1 * 2); - - /* "rabbyt/rabbyt.collisions.pyx":171 - * length = len(objects)*2 - * - * side_list = malloc(sizeof(side_s)*length) # <<<<<<<<<<<<<< - * side_p_list = malloc(sizeof(side_s*)*length) - * try: - */ - __pyx_v_side_list = ((struct __pyx_t_6rabbyt_10collisions_side_s *)malloc(((sizeof(struct __pyx_t_6rabbyt_10collisions_side_s)) * __pyx_v_length))); - - /* "rabbyt/rabbyt.collisions.pyx":172 - * - * side_list = malloc(sizeof(side_s)*length) - * side_p_list = malloc(sizeof(side_s*)*length) # <<<<<<<<<<<<<< - * try: - * for i from 0 <= i < length/2: - */ - __pyx_v_side_p_list = ((struct __pyx_t_6rabbyt_10collisions_side_s **)malloc(((sizeof(struct __pyx_t_6rabbyt_10collisions_side_s *)) * __pyx_v_length))); - - /* "rabbyt/rabbyt.collisions.pyx":173 - * side_list = malloc(sizeof(side_s)*length) - * side_p_list = malloc(sizeof(side_s*)*length) - * try: # <<<<<<<<<<<<<< - * for i from 0 <= i < length/2: - * o = objects[i] - */ - /*try:*/ { - - /* "rabbyt/rabbyt.collisions.pyx":174 - * side_p_list = malloc(sizeof(side_s*)*length) - * try: - * for i from 0 <= i < length/2: # <<<<<<<<<<<<<< - * o = objects[i] - * r = o.bounding_radius - */ - __pyx_t_2 = __Pyx_div_long(__pyx_v_length, 2); - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":175 - * try: - * for i from 0 <= i < length/2: - * o = objects[i] # <<<<<<<<<<<<<< - * r = o.bounding_radius - * x = o.x - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_objects, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":176 - * for i from 0 <= i < length/2: - * o = objects[i] - * r = o.bounding_radius # <<<<<<<<<<<<<< - * x = o.x - * y = o.y - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s__bounding_radius); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_r = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":177 - * o = objects[i] - * r = o.bounding_radius - * x = o.x # <<<<<<<<<<<<<< - * y = o.y - * side_list[i*2].x = x-r - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s__x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_x = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":178 - * r = o.bounding_radius - * x = o.x - * y = o.y # <<<<<<<<<<<<<< - * side_list[i*2].x = x-r - * side_list[i*2].y = y-r - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s__y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_y = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":179 - * x = o.x - * y = o.y - * side_list[i*2].x = x-r # <<<<<<<<<<<<<< - * side_list[i*2].y = y-r - * side_list[i*2].side = LEFT - */ - (__pyx_v_side_list[(__pyx_v_i * 2)]).x = (__pyx_v_x - __pyx_v_r); - - /* "rabbyt/rabbyt.collisions.pyx":180 - * y = o.y - * side_list[i*2].x = x-r - * side_list[i*2].y = y-r # <<<<<<<<<<<<<< - * side_list[i*2].side = LEFT - * side_list[i*2].index = i - */ - (__pyx_v_side_list[(__pyx_v_i * 2)]).y = (__pyx_v_y - __pyx_v_r); - - /* "rabbyt/rabbyt.collisions.pyx":181 - * side_list[i*2].x = x-r - * side_list[i*2].y = y-r - * side_list[i*2].side = LEFT # <<<<<<<<<<<<<< - * side_list[i*2].index = i - * side_list[i*2+1].x = x+r - */ - (__pyx_v_side_list[(__pyx_v_i * 2)]).side = __pyx_e_6rabbyt_10collisions_LEFT; - - /* "rabbyt/rabbyt.collisions.pyx":182 - * side_list[i*2].y = y-r - * side_list[i*2].side = LEFT - * side_list[i*2].index = i # <<<<<<<<<<<<<< - * side_list[i*2+1].x = x+r - * side_list[i*2+1].y = y+r - */ - (__pyx_v_side_list[(__pyx_v_i * 2)]).index = __pyx_v_i; - - /* "rabbyt/rabbyt.collisions.pyx":183 - * side_list[i*2].side = LEFT - * side_list[i*2].index = i - * side_list[i*2+1].x = x+r # <<<<<<<<<<<<<< - * side_list[i*2+1].y = y+r - * side_list[i*2+1].side = RIGHT - */ - (__pyx_v_side_list[((__pyx_v_i * 2) + 1)]).x = (__pyx_v_x + __pyx_v_r); - - /* "rabbyt/rabbyt.collisions.pyx":184 - * side_list[i*2].index = i - * side_list[i*2+1].x = x+r - * side_list[i*2+1].y = y+r # <<<<<<<<<<<<<< - * side_list[i*2+1].side = RIGHT - * side_list[i*2+1].index = i - */ - (__pyx_v_side_list[((__pyx_v_i * 2) + 1)]).y = (__pyx_v_y + __pyx_v_r); - - /* "rabbyt/rabbyt.collisions.pyx":185 - * side_list[i*2+1].x = x+r - * side_list[i*2+1].y = y+r - * side_list[i*2+1].side = RIGHT # <<<<<<<<<<<<<< - * side_list[i*2+1].index = i - * - */ - (__pyx_v_side_list[((__pyx_v_i * 2) + 1)]).side = __pyx_e_6rabbyt_10collisions_RIGHT; - - /* "rabbyt/rabbyt.collisions.pyx":186 - * side_list[i*2+1].y = y+r - * side_list[i*2+1].side = RIGHT - * side_list[i*2+1].index = i # <<<<<<<<<<<<<< - * - * side_p_list[i*2] = &side_list[i*2] - */ - (__pyx_v_side_list[((__pyx_v_i * 2) + 1)]).index = __pyx_v_i; - - /* "rabbyt/rabbyt.collisions.pyx":188 - * side_list[i*2+1].index = i - * - * side_p_list[i*2] = &side_list[i*2] # <<<<<<<<<<<<<< - * side_p_list[i*2+1] = &side_list[i*2+1] - * - */ - (__pyx_v_side_p_list[(__pyx_v_i * 2)]) = (&(__pyx_v_side_list[(__pyx_v_i * 2)])); - - /* "rabbyt/rabbyt.collisions.pyx":189 - * - * side_p_list[i*2] = &side_list[i*2] - * side_p_list[i*2+1] = &side_list[i*2+1] # <<<<<<<<<<<<<< - * - * _rdc(side_p_list, length, X, 0, min_split, max_depth) - */ - (__pyx_v_side_p_list[((__pyx_v_i * 2) + 1)]) = (&(__pyx_v_side_list[((__pyx_v_i * 2) + 1)])); - } - - /* "rabbyt/rabbyt.collisions.pyx":191 - * side_p_list[i*2+1] = &side_list[i*2+1] - * - * _rdc(side_p_list, length, X, 0, min_split, max_depth) # <<<<<<<<<<<<<< - * - * groups = [] - */ - __pyx_f_6rabbyt_10collisions__rdc(__pyx_v_side_p_list, __pyx_v_length, __pyx_e_6rabbyt_10collisions_X, 0, __pyx_v_min_split, __pyx_v_max_depth); - - /* "rabbyt/rabbyt.collisions.pyx":193 - * _rdc(side_p_list, length, X, 0, min_split, max_depth) - * - * groups = [] # <<<<<<<<<<<<<< - * current_group = [] - * d = 0 - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_groups = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":194 - * - * groups = [] - * current_group = [] # <<<<<<<<<<<<<< - * d = 0 - * for i from 0 <= i < length: - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_current_group = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":195 - * groups = [] - * current_group = [] - * d = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * if side_p_list[i][0].side == LEFT: - */ - __pyx_v_d = 0; - - /* "rabbyt/rabbyt.collisions.pyx":196 - * current_group = [] - * d = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * if side_p_list[i][0].side == LEFT: - * if d == 0: - */ - __pyx_t_5 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":197 - * d = 0 - * for i from 0 <= i < length: - * if side_p_list[i][0].side == LEFT: # <<<<<<<<<<<<<< - * if d == 0: - * # Check to see if we are a single object without any - */ - __pyx_t_6 = ((((__pyx_v_side_p_list[__pyx_v_i])[0]).side == __pyx_e_6rabbyt_10collisions_LEFT) != 0); - if (__pyx_t_6) { - - /* "rabbyt/rabbyt.collisions.pyx":198 - * for i from 0 <= i < length: - * if side_p_list[i][0].side == LEFT: - * if d == 0: # <<<<<<<<<<<<<< - * # Check to see if we are a single object without any - * # collisions. If so, we shouldn't be added as a group. - */ - __pyx_t_6 = ((__pyx_v_d == 0) != 0); - if (__pyx_t_6) { - - /* "rabbyt/rabbyt.collisions.pyx":202 - * # collisions. If so, we shouldn't be added as a group. - * # (Doing this can cut running time in half.) - * if side_p_list[i][0].index == side_p_list[i+1][0].index: # <<<<<<<<<<<<<< - * # The next item will be the right side of the same - * # object; we can safely skip it. - */ - __pyx_t_6 = ((((__pyx_v_side_p_list[__pyx_v_i])[0]).index == ((__pyx_v_side_p_list[(__pyx_v_i + 1)])[0]).index) != 0); - if (__pyx_t_6) { - - /* "rabbyt/rabbyt.collisions.pyx":205 - * # The next item will be the right side of the same - * # object; we can safely skip it. - * i = i + 1 # <<<<<<<<<<<<<< - * continue - * d = d + 1 - */ - __pyx_v_i = (__pyx_v_i + 1); - - /* "rabbyt/rabbyt.collisions.pyx":206 - * # object; we can safely skip it. - * i = i + 1 - * continue # <<<<<<<<<<<<<< - * d = d + 1 - * current_group.append(objects[side_p_list[i][0].index]) - */ - goto __pyx_L8_continue; - goto __pyx_L12; - } - __pyx_L12:; - goto __pyx_L11; - } - __pyx_L11:; - - /* "rabbyt/rabbyt.collisions.pyx":207 - * i = i + 1 - * continue - * d = d + 1 # <<<<<<<<<<<<<< - * current_group.append(objects[side_p_list[i][0].index]) - * else: - */ - __pyx_v_d = (__pyx_v_d + 1); - - /* "rabbyt/rabbyt.collisions.pyx":208 - * continue - * d = d + 1 - * current_group.append(objects[side_p_list[i][0].index]) # <<<<<<<<<<<<<< - * else: - * d = d - 1 - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_objects, ((__pyx_v_side_p_list[__pyx_v_i])[0]).index, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_current_group, __pyx_t_3); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":210 - * current_group.append(objects[side_p_list[i][0].index]) - * else: - * d = d - 1 # <<<<<<<<<<<<<< - * if d == 0: - * groups.append(current_group) - */ - __pyx_v_d = (__pyx_v_d - 1); - - /* "rabbyt/rabbyt.collisions.pyx":211 - * else: - * d = d - 1 - * if d == 0: # <<<<<<<<<<<<<< - * groups.append(current_group) - * current_group = [] - */ - __pyx_t_6 = ((__pyx_v_d == 0) != 0); - if (__pyx_t_6) { - - /* "rabbyt/rabbyt.collisions.pyx":212 - * d = d - 1 - * if d == 0: - * groups.append(current_group) # <<<<<<<<<<<<<< - * current_group = [] - * return groups - */ - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_groups, ((PyObject *)__pyx_v_current_group)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L4;} - - /* "rabbyt/rabbyt.collisions.pyx":213 - * if d == 0: - * groups.append(current_group) - * current_group = [] # <<<<<<<<<<<<<< - * return groups - * finally: - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF_SET(__pyx_v_current_group, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - goto __pyx_L13; - } - __pyx_L13:; - } - __pyx_L10:; - __pyx_L8_continue:; - } - - /* "rabbyt/rabbyt.collisions.pyx":214 - * groups.append(current_group) - * current_group = [] - * return groups # <<<<<<<<<<<<<< - * finally: - * free(side_list) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_groups)); - __pyx_r = ((PyObject *)__pyx_v_groups); - goto __pyx_L3; - } - - /* "rabbyt/rabbyt.collisions.pyx":216 - * return groups - * finally: - * free(side_list) # <<<<<<<<<<<<<< - * free(side_p_list) - * - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L5; - __pyx_L3: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 3; goto __pyx_L5; - __pyx_L4: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L5; - } - __pyx_L5:; - free(__pyx_v_side_list); - - /* "rabbyt/rabbyt.collisions.pyx":217 - * finally: - * free(side_list) - * free(side_p_list) # <<<<<<<<<<<<<< - * - * cdef void _rdc(side_s ** side_p_list, int length, _Axis axis, int depth, - */ - free(__pyx_v_side_p_list); - switch (__pyx_why) { - case 3: goto __pyx_L0; - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt.collisions.rdc", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XDECREF(__pyx_v_groups); - __Pyx_XDECREF(__pyx_v_current_group); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":219 - * free(side_p_list) - * - * cdef void _rdc(side_s ** side_p_list, int length, _Axis axis, int depth, # <<<<<<<<<<<<<< - * int min_split, int max_depth): - * cdef int i - */ - -static void __pyx_f_6rabbyt_10collisions__rdc(struct __pyx_t_6rabbyt_10collisions_side_s **__pyx_v_side_p_list, int __pyx_v_length, enum __pyx_t_6rabbyt_10collisions__Axis __pyx_v_axis, int __pyx_v_depth, int __pyx_v_min_split, int __pyx_v_max_depth) { - int __pyx_v_i; - enum __pyx_t_6rabbyt_10collisions__Axis __pyx_v_next_axis; - int __pyx_v_group_start; - int __pyx_v_d; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - __Pyx_RefNannySetupContext("_rdc", 0); - - /* "rabbyt/rabbyt.collisions.pyx":222 - * int min_split, int max_depth): - * cdef int i - * if length <= min_split*2: # <<<<<<<<<<<<<< - * return - * if max_depth > 0 and depth >= max_depth: - */ - __pyx_t_1 = ((__pyx_v_length <= (__pyx_v_min_split * 2)) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt.collisions.pyx":223 - * cdef int i - * if length <= min_split*2: - * return # <<<<<<<<<<<<<< - * if max_depth > 0 and depth >= max_depth: - * return - */ - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt.collisions.pyx":224 - * if length <= min_split*2: - * return - * if max_depth > 0 and depth >= max_depth: # <<<<<<<<<<<<<< - * return - * - */ - __pyx_t_1 = ((__pyx_v_max_depth > 0) != 0); - if (__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_depth >= __pyx_v_max_depth) != 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.collisions.pyx":225 - * return - * if max_depth > 0 and depth >= max_depth: - * return # <<<<<<<<<<<<<< - * - * cdef _Axis next_axis - */ - goto __pyx_L0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt.collisions.pyx":229 - * cdef _Axis next_axis - * - * if axis == X: # <<<<<<<<<<<<<< - * qsort(side_p_list, length, sizeof(side_s*), _compar_sides_x) - * next_axis = Y - */ - __pyx_t_3 = ((__pyx_v_axis == __pyx_e_6rabbyt_10collisions_X) != 0); - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.collisions.pyx":230 - * - * if axis == X: - * qsort(side_p_list, length, sizeof(side_s*), _compar_sides_x) # <<<<<<<<<<<<<< - * next_axis = Y - * else: - */ - qsort(__pyx_v_side_p_list, __pyx_v_length, (sizeof(struct __pyx_t_6rabbyt_10collisions_side_s *)), __pyx_f_6rabbyt_10collisions__compar_sides_x); - - /* "rabbyt/rabbyt.collisions.pyx":231 - * if axis == X: - * qsort(side_p_list, length, sizeof(side_s*), _compar_sides_x) - * next_axis = Y # <<<<<<<<<<<<<< - * else: - * qsort(side_p_list, length, sizeof(side_s*), _compar_sides_y) - */ - __pyx_v_next_axis = __pyx_e_6rabbyt_10collisions_Y; - goto __pyx_L5; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":233 - * next_axis = Y - * else: - * qsort(side_p_list, length, sizeof(side_s*), _compar_sides_y) # <<<<<<<<<<<<<< - * next_axis = X - * - */ - qsort(__pyx_v_side_p_list, __pyx_v_length, (sizeof(struct __pyx_t_6rabbyt_10collisions_side_s *)), __pyx_f_6rabbyt_10collisions__compar_sides_y); - - /* "rabbyt/rabbyt.collisions.pyx":234 - * else: - * qsort(side_p_list, length, sizeof(side_s*), _compar_sides_y) - * next_axis = X # <<<<<<<<<<<<<< - * - * cdef int group_start, d - */ - __pyx_v_next_axis = __pyx_e_6rabbyt_10collisions_X; - } - __pyx_L5:; - - /* "rabbyt/rabbyt.collisions.pyx":238 - * cdef int group_start, d - * - * group_start = 0 # <<<<<<<<<<<<<< - * d = 0 - * for i from 0 <= i < length: - */ - __pyx_v_group_start = 0; - - /* "rabbyt/rabbyt.collisions.pyx":239 - * - * group_start = 0 - * d = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * if group_start == 0 and i == length-1: - */ - __pyx_v_d = 0; - - /* "rabbyt/rabbyt.collisions.pyx":240 - * group_start = 0 - * d = 0 - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * if group_start == 0 and i == length-1: - * # We only have one group. If we are the first call, go ahead and try - */ - __pyx_t_4 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":241 - * d = 0 - * for i from 0 <= i < length: - * if group_start == 0 and i == length-1: # <<<<<<<<<<<<<< - * # We only have one group. If we are the first call, go ahead and try - * # the Y access. Otherwise, let's just bail out now. - */ - __pyx_t_3 = ((__pyx_v_group_start == 0) != 0); - if (__pyx_t_3) { - __pyx_t_1 = ((__pyx_v_i == (__pyx_v_length - 1)) != 0); - __pyx_t_2 = __pyx_t_1; - } else { - __pyx_t_2 = __pyx_t_3; - } - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":244 - * # We only have one group. If we are the first call, go ahead and try - * # the Y access. Otherwise, let's just bail out now. - * if depth == 0: # <<<<<<<<<<<<<< - * _rdc(side_p_list, length, Y, 1, min_split, max_depth) - * return - */ - __pyx_t_2 = ((__pyx_v_depth == 0) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":245 - * # the Y access. Otherwise, let's just bail out now. - * if depth == 0: - * _rdc(side_p_list, length, Y, 1, min_split, max_depth) # <<<<<<<<<<<<<< - * return - * - */ - __pyx_f_6rabbyt_10collisions__rdc(__pyx_v_side_p_list, __pyx_v_length, __pyx_e_6rabbyt_10collisions_Y, 1, __pyx_v_min_split, __pyx_v_max_depth); - goto __pyx_L9; - } - __pyx_L9:; - - /* "rabbyt/rabbyt.collisions.pyx":246 - * if depth == 0: - * _rdc(side_p_list, length, Y, 1, min_split, max_depth) - * return # <<<<<<<<<<<<<< - * - * if side_p_list[i][0].side == LEFT: - */ - goto __pyx_L0; - goto __pyx_L8; - } - __pyx_L8:; - - /* "rabbyt/rabbyt.collisions.pyx":248 - * return - * - * if side_p_list[i][0].side == LEFT: # <<<<<<<<<<<<<< - * d = d + 1 - * else: - */ - __pyx_t_2 = ((((__pyx_v_side_p_list[__pyx_v_i])[0]).side == __pyx_e_6rabbyt_10collisions_LEFT) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":249 - * - * if side_p_list[i][0].side == LEFT: - * d = d + 1 # <<<<<<<<<<<<<< - * else: - * d = d - 1 - */ - __pyx_v_d = (__pyx_v_d + 1); - goto __pyx_L10; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":251 - * d = d + 1 - * else: - * d = d - 1 # <<<<<<<<<<<<<< - * if d == 0: - * # If we have come to as many right sides as left sides we have - */ - __pyx_v_d = (__pyx_v_d - 1); - - /* "rabbyt/rabbyt.collisions.pyx":252 - * else: - * d = d - 1 - * if d == 0: # <<<<<<<<<<<<<< - * # If we have come to as many right sides as left sides we have - * # found the end of a group. HOWEVER, if the next left side is - */ - __pyx_t_2 = ((__pyx_v_d == 0) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":257 - * # exactly overlapping this side, we still want it to count as - * # a collision, hence this crazy looking if: - * if i == length-1 or \ # <<<<<<<<<<<<<< - * (axis==X and - * side_p_list[i+1][0].x != side_p_list[i][0].x)\ - */ - __pyx_t_2 = ((__pyx_v_i == (__pyx_v_length - 1)) != 0); - if (!__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":258 - * # a collision, hence this crazy looking if: - * if i == length-1 or \ - * (axis==X and # <<<<<<<<<<<<<< - * side_p_list[i+1][0].x != side_p_list[i][0].x)\ - * or (axis==Y and - */ - __pyx_t_3 = ((__pyx_v_axis == __pyx_e_6rabbyt_10collisions_X) != 0); - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.collisions.pyx":259 - * if i == length-1 or \ - * (axis==X and - * side_p_list[i+1][0].x != side_p_list[i][0].x)\ # <<<<<<<<<<<<<< - * or (axis==Y and - * side_p_list[i+1][0].y != side_p_list[i][0].y): - */ - __pyx_t_1 = ((((__pyx_v_side_p_list[(__pyx_v_i + 1)])[0]).x != ((__pyx_v_side_p_list[__pyx_v_i])[0]).x) != 0); - __pyx_t_5 = __pyx_t_1; - } else { - __pyx_t_5 = __pyx_t_3; - } - if (!__pyx_t_5) { - - /* "rabbyt/rabbyt.collisions.pyx":260 - * (axis==X and - * side_p_list[i+1][0].x != side_p_list[i][0].x)\ - * or (axis==Y and # <<<<<<<<<<<<<< - * side_p_list[i+1][0].y != side_p_list[i][0].y): - * - */ - __pyx_t_3 = ((__pyx_v_axis == __pyx_e_6rabbyt_10collisions_Y) != 0); - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.collisions.pyx":261 - * side_p_list[i+1][0].x != side_p_list[i][0].x)\ - * or (axis==Y and - * side_p_list[i+1][0].y != side_p_list[i][0].y): # <<<<<<<<<<<<<< - * - * _rdc(&side_p_list[group_start], i-group_start+1, next_axis, - */ - __pyx_t_1 = ((((__pyx_v_side_p_list[(__pyx_v_i + 1)])[0]).y != ((__pyx_v_side_p_list[__pyx_v_i])[0]).y) != 0); - __pyx_t_6 = __pyx_t_1; - } else { - __pyx_t_6 = __pyx_t_3; - } - __pyx_t_3 = __pyx_t_6; - } else { - __pyx_t_3 = __pyx_t_5; - } - __pyx_t_5 = __pyx_t_3; - } else { - __pyx_t_5 = __pyx_t_2; - } - if (__pyx_t_5) { - - /* "rabbyt/rabbyt.collisions.pyx":264 - * - * _rdc(&side_p_list[group_start], i-group_start+1, next_axis, - * depth+1, min_split, max_depth) # <<<<<<<<<<<<<< - * group_start = i + 1 - * - */ - __pyx_f_6rabbyt_10collisions__rdc((&(__pyx_v_side_p_list[__pyx_v_group_start])), ((__pyx_v_i - __pyx_v_group_start) + 1), __pyx_v_next_axis, (__pyx_v_depth + 1), __pyx_v_min_split, __pyx_v_max_depth); - - /* "rabbyt/rabbyt.collisions.pyx":265 - * _rdc(&side_p_list[group_start], i-group_start+1, next_axis, - * depth+1, min_split, max_depth) - * group_start = i + 1 # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_group_start = (__pyx_v_i + 1); - goto __pyx_L12; - } - __pyx_L12:; - goto __pyx_L11; - } - __pyx_L11:; - } - __pyx_L10:; - } - - __pyx_L0:; - __Pyx_RefNannyFinishContext(); -} - -/* "rabbyt/rabbyt.collisions.pyx":272 - * float x, y, brs - * - * cdef _brute_force(collision_object_s * objs, int length, objects): # <<<<<<<<<<<<<< - * cdef float dx, dy - * cdef int i, j - */ - -static PyObject *__pyx_f_6rabbyt_10collisions__brute_force(struct __pyx_t_6rabbyt_10collisions_collision_object_s *__pyx_v_objs, int __pyx_v_length, PyObject *__pyx_v_objects) { - float __pyx_v_dx; - float __pyx_v_dy; - int __pyx_v_i; - int __pyx_v_j; - PyObject *__pyx_v_collisions = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - long __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_brute_force", 0); - - /* "rabbyt/rabbyt.collisions.pyx":275 - * cdef float dx, dy - * cdef int i, j - * collisions = [] # <<<<<<<<<<<<<< - * for i from 0 <= i < length-1: - * for j from i < j < length: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_collisions = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":276 - * cdef int i, j - * collisions = [] - * for i from 0 <= i < length-1: # <<<<<<<<<<<<<< - * for j from i < j < length: - * dx = objs[i].x - objs[j].x - */ - __pyx_t_2 = (__pyx_v_length - 1); - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":277 - * collisions = [] - * for i from 0 <= i < length-1: - * for j from i < j < length: # <<<<<<<<<<<<<< - * dx = objs[i].x - objs[j].x - * dy = objs[i].y - objs[j].y - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_j = __pyx_v_i+1; __pyx_v_j < __pyx_t_3; __pyx_v_j++) { - - /* "rabbyt/rabbyt.collisions.pyx":278 - * for i from 0 <= i < length-1: - * for j from i < j < length: - * dx = objs[i].x - objs[j].x # <<<<<<<<<<<<<< - * dy = objs[i].y - objs[j].y - * if dx*dx + dy*dy < objs[i].brs + objs[j].brs: - */ - __pyx_v_dx = ((__pyx_v_objs[__pyx_v_i]).x - (__pyx_v_objs[__pyx_v_j]).x); - - /* "rabbyt/rabbyt.collisions.pyx":279 - * for j from i < j < length: - * dx = objs[i].x - objs[j].x - * dy = objs[i].y - objs[j].y # <<<<<<<<<<<<<< - * if dx*dx + dy*dy < objs[i].brs + objs[j].brs: - * collisions.append((objects[i], - */ - __pyx_v_dy = ((__pyx_v_objs[__pyx_v_i]).y - (__pyx_v_objs[__pyx_v_j]).y); - - /* "rabbyt/rabbyt.collisions.pyx":280 - * dx = objs[i].x - objs[j].x - * dy = objs[i].y - objs[j].y - * if dx*dx + dy*dy < objs[i].brs + objs[j].brs: # <<<<<<<<<<<<<< - * collisions.append((objects[i], - * objects[j])) - */ - __pyx_t_4 = ((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) < ((__pyx_v_objs[__pyx_v_i]).brs + (__pyx_v_objs[__pyx_v_j]).brs)) != 0); - if (__pyx_t_4) { - - /* "rabbyt/rabbyt.collisions.pyx":281 - * dy = objs[i].y - objs[j].y - * if dx*dx + dy*dy < objs[i].brs + objs[j].brs: - * collisions.append((objects[i], # <<<<<<<<<<<<<< - * objects[j])) - * return collisions - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_objects, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - - /* "rabbyt/rabbyt.collisions.pyx":282 - * if dx*dx + dy*dy < objs[i].brs + objs[j].brs: - * collisions.append((objects[i], - * objects[j])) # <<<<<<<<<<<<<< - * return collisions - * - */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_objects, __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_1 = 0; - __pyx_t_5 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_collisions, ((PyObject *)__pyx_t_6)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - goto __pyx_L7; - } - __pyx_L7:; - } - } - - /* "rabbyt/rabbyt.collisions.pyx":283 - * collisions.append((objects[i], - * objects[j])) - * return collisions # <<<<<<<<<<<<<< - * - * def brute_force(objects): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_collisions)); - __pyx_r = ((PyObject *)__pyx_v_collisions); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rabbyt.collisions._brute_force", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_collisions); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_9brute_force(PyObject *__pyx_self, PyObject *__pyx_v_objects); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_8brute_force[] = "\n ``brute_force(objects) -> list of collisions``\n\n Finds collisions between ``objects`` using a brute force algorithm.\n\n ``objects`` should be a list of objects, each of which have the attributes\n ``x``, ``y``, and ``bounding_radius_squared``. Each object is checked\n against every other object.\n\n For example, if ``A`` collides with ``B``, ``B`` collides with ``C``, and\n ``D`` doesn't collide with anything, the result will be:\n ``[(A, B), (B, C)]``.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_9brute_force = {__Pyx_NAMESTR("brute_force"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_9brute_force, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_8brute_force)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_9brute_force(PyObject *__pyx_self, PyObject *__pyx_v_objects) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("brute_force (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10collisions_8brute_force(__pyx_self, ((PyObject *)__pyx_v_objects)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":285 - * return collisions - * - * def brute_force(objects): # <<<<<<<<<<<<<< - * """ - * ``brute_force(objects) -> list of collisions`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_8brute_force(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects) { - struct __pyx_t_6rabbyt_10collisions_collision_object_s *__pyx_v_objs; - int __pyx_v_i; - int __pyx_v_length; - PyObject *__pyx_v_o = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - float __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("brute_force", 0); - - /* "rabbyt/rabbyt.collisions.pyx":302 - * cdef int i, length - * - * length = len(objects) # <<<<<<<<<<<<<< - * objs = malloc(sizeof(collision_object_s)*length) - * try: - */ - __pyx_t_1 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = __pyx_t_1; - - /* "rabbyt/rabbyt.collisions.pyx":303 - * - * length = len(objects) - * objs = malloc(sizeof(collision_object_s)*length) # <<<<<<<<<<<<<< - * try: - * # First we move the data from the python objects into c structures. - */ - __pyx_v_objs = ((struct __pyx_t_6rabbyt_10collisions_collision_object_s *)malloc(((sizeof(struct __pyx_t_6rabbyt_10collisions_collision_object_s)) * __pyx_v_length))); - - /* "rabbyt/rabbyt.collisions.pyx":304 - * length = len(objects) - * objs = malloc(sizeof(collision_object_s)*length) - * try: # <<<<<<<<<<<<<< - * # First we move the data from the python objects into c structures. - * # This is especially important as most of the objects will be sprites, - */ - /*try:*/ { - - /* "rabbyt/rabbyt.collisions.pyx":309 - * # and accessing their positions could set off a long chain of - * # calculations. We only want to do that once. - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * o = objects[i] - * objs[i].x = o.x - */ - __pyx_t_2 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":310 - * # calculations. We only want to do that once. - * for i from 0 <= i < length: - * o = objects[i] # <<<<<<<<<<<<<< - * objs[i].x = o.x - * objs[i].y = o.y - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_objects, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":311 - * for i from 0 <= i < length: - * o = objects[i] - * objs[i].x = o.x # <<<<<<<<<<<<<< - * objs[i].y = o.y - * objs[i].brs = o.bounding_radius_squared - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s__x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - (__pyx_v_objs[__pyx_v_i]).x = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":312 - * o = objects[i] - * objs[i].x = o.x - * objs[i].y = o.y # <<<<<<<<<<<<<< - * objs[i].brs = o.bounding_radius_squared - * # Do the actual work: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s__y); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - (__pyx_v_objs[__pyx_v_i]).y = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":313 - * objs[i].x = o.x - * objs[i].y = o.y - * objs[i].brs = o.bounding_radius_squared # <<<<<<<<<<<<<< - * # Do the actual work: - * return _brute_force(objs, length, objects) - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - (__pyx_v_objs[__pyx_v_i]).brs = __pyx_t_4; - } - - /* "rabbyt/rabbyt.collisions.pyx":315 - * objs[i].brs = o.bounding_radius_squared - * # Do the actual work: - * return _brute_force(objs, length, objects) # <<<<<<<<<<<<<< - * finally: - * free(objs) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __pyx_f_6rabbyt_10collisions__brute_force(__pyx_v_objs, __pyx_v_length, __pyx_v_objects); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L3; - } - - /* "rabbyt/rabbyt.collisions.pyx":317 - * return _brute_force(objs, length, objects) - * finally: - * free(objs) # <<<<<<<<<<<<<< - * - * - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L5; - __pyx_L3: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 3; goto __pyx_L5; - __pyx_L4: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L5; - } - __pyx_L5:; - free(__pyx_v_objs); - switch (__pyx_why) { - case 3: goto __pyx_L0; - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt.collisions.brute_force", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_11collide_groups(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_10collide_groups[] = "\n ``collide_groups(group_a, group_b)``\n\n Returns a list of collisions between objects in ``group_a`` with objects\n in ``group_b``.\n\n All objects must either have ``x``, ``y``, and (optionally)\n ``bounding_radius`` attributes *or* behave like a tuple with the form\n ``(x, y, bounding_radius)`` or ``(x, y)``.\n\n If ``bounding_radius`` is missing it will default to ``0``.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_11collide_groups = {__Pyx_NAMESTR("collide_groups"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_11collide_groups, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_10collide_groups)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_11collide_groups(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_group_a = 0; - PyObject *__pyx_v_group_b = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("collide_groups (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__group_a,&__pyx_n_s__group_b,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group_a)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group_b)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("collide_groups", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collide_groups") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_group_a = values[0]; - __pyx_v_group_b = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("collide_groups", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.collisions.collide_groups", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10collisions_10collide_groups(__pyx_self, __pyx_v_group_a, __pyx_v_group_b); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":320 - * - * - * def collide_groups(group_a, group_b): # <<<<<<<<<<<<<< - * """ - * ``collide_groups(group_a, group_b)`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_10collide_groups(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_group_a, PyObject *__pyx_v_group_b) { - struct __pyx_t_6rabbyt_10collisions_collision_object_s *__pyx_v_c_group_b; - int __pyx_v_i; - int __pyx_v_length; - struct __pyx_t_6rabbyt_10collisions_collision_object_s __pyx_v_obj; - PyObject *__pyx_v_o = 0; - float __pyx_v_dx; - float __pyx_v_dy; - PyObject *__pyx_v_collisions = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *(*__pyx_t_9)(PyObject *); - float __pyx_t_10; - float __pyx_t_11; - float __pyx_t_12; - int __pyx_t_13; - int __pyx_t_14; - int __pyx_t_15; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("collide_groups", 0); - __Pyx_INCREF(__pyx_v_group_b); - - /* "rabbyt/rabbyt.collisions.pyx":339 - * cdef float dx, dy - * - * group_b = list(group_b) # <<<<<<<<<<<<<< - * length = len(group_b) - * - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_group_b); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_group_b); - __Pyx_GIVEREF(__pyx_v_group_b); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF_SET(__pyx_v_group_b, __pyx_t_2); - __pyx_t_2 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":340 - * - * group_b = list(group_b) - * length = len(group_b) # <<<<<<<<<<<<<< - * - * c_group_b = malloc(sizeof(collision_object_s)*length) - */ - __pyx_t_3 = PyObject_Length(__pyx_v_group_b); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = __pyx_t_3; - - /* "rabbyt/rabbyt.collisions.pyx":342 - * length = len(group_b) - * - * c_group_b = malloc(sizeof(collision_object_s)*length) # <<<<<<<<<<<<<< - * try: - * i = 0 - */ - __pyx_v_c_group_b = ((struct __pyx_t_6rabbyt_10collisions_collision_object_s *)malloc(((sizeof(struct __pyx_t_6rabbyt_10collisions_collision_object_s)) * __pyx_v_length))); - - /* "rabbyt/rabbyt.collisions.pyx":343 - * - * c_group_b = malloc(sizeof(collision_object_s)*length) - * try: # <<<<<<<<<<<<<< - * i = 0 - * for o in group_b: - */ - /*try:*/ { - - /* "rabbyt/rabbyt.collisions.pyx":344 - * c_group_b = malloc(sizeof(collision_object_s)*length) - * try: - * i = 0 # <<<<<<<<<<<<<< - * for o in group_b: - * c_group_b[i].x, c_group_b[i].y, c_group_b[i].brs = _get_object_data(o) - */ - __pyx_v_i = 0; - - /* "rabbyt/rabbyt.collisions.pyx":345 - * try: - * i = 0 - * for o in group_b: # <<<<<<<<<<<<<< - * c_group_b[i].x, c_group_b[i].y, c_group_b[i].brs = _get_object_data(o) - * i = i + 1 - */ - if (PyList_CheckExact(__pyx_v_group_b) || PyTuple_CheckExact(__pyx_v_group_b)) { - __pyx_t_2 = __pyx_v_group_b; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_group_b); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; - } - for (;;) { - if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L4;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L4;} - #endif - } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L4;} - #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L4;} - #endif - } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L4;} - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":346 - * i = 0 - * for o in group_b: - * c_group_b[i].x, c_group_b[i].y, c_group_b[i].brs = _get_object_data(o) # <<<<<<<<<<<<<< - * i = i + 1 - * - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___get_object_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) { - PyObject* sequence = __pyx_t_6; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); - } else { - __pyx_t_5 = PyList_GET_ITEM(sequence, 0); - __pyx_t_1 = PyList_GET_ITEM(sequence, 1); - __pyx_t_7 = PyList_GET_ITEM(sequence, 2); - } - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - #else - __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_7); - #endif - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L8_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L9_unpacking_done; - __pyx_L8_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __pyx_L9_unpacking_done:; - } - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - (__pyx_v_c_group_b[__pyx_v_i]).x = __pyx_t_10; - (__pyx_v_c_group_b[__pyx_v_i]).y = __pyx_t_11; - (__pyx_v_c_group_b[__pyx_v_i]).brs = __pyx_t_12; - - /* "rabbyt/rabbyt.collisions.pyx":347 - * for o in group_b: - * c_group_b[i].x, c_group_b[i].y, c_group_b[i].brs = _get_object_data(o) - * i = i + 1 # <<<<<<<<<<<<<< - * - * collisions = [] - */ - __pyx_v_i = (__pyx_v_i + 1); - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":349 - * i = i + 1 - * - * collisions = [] # <<<<<<<<<<<<<< - * for o in group_a: - * obj.x, obj.y, obj.brs = _get_object_data(o) - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_collisions = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":350 - * - * collisions = [] - * for o in group_a: # <<<<<<<<<<<<<< - * obj.x, obj.y, obj.brs = _get_object_data(o) - * for i from 0 <= i < length: - */ - if (PyList_CheckExact(__pyx_v_group_a) || PyTuple_CheckExact(__pyx_v_group_a)) { - __pyx_t_2 = __pyx_v_group_a; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_group_a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; - } - for (;;) { - if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4;} - #endif - } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4;} - #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4;} - #endif - } else { - __pyx_t_6 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_6)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L4;} - } - break; - } - __Pyx_GOTREF(__pyx_t_6); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_6); - __pyx_t_6 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":351 - * collisions = [] - * for o in group_a: - * obj.x, obj.y, obj.brs = _get_object_data(o) # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * dx = c_group_b[i].x - obj.x - */ - __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s___get_object_data); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 3)) { - if (size > 3) __Pyx_RaiseTooManyValuesError(3); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); - } else { - __pyx_t_7 = PyList_GET_ITEM(sequence, 0); - __pyx_t_6 = PyList_GET_ITEM(sequence, 1); - __pyx_t_5 = PyList_GET_ITEM(sequence, 2); - } - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_5); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else - { - Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext; - index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed; - __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed; - __Pyx_GOTREF(__pyx_t_6); - index = 2; __pyx_t_5 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L12_unpacking_failed; - __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - goto __pyx_L13_unpacking_done; - __pyx_L12_unpacking_failed:; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __pyx_L13_unpacking_done:; - } - __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_12 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_obj.x = __pyx_t_12; - __pyx_v_obj.y = __pyx_t_11; - __pyx_v_obj.brs = __pyx_t_10; - - /* "rabbyt/rabbyt.collisions.pyx":352 - * for o in group_a: - * obj.x, obj.y, obj.brs = _get_object_data(o) - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * dx = c_group_b[i].x - obj.x - * dy = c_group_b[i].y - obj.y - */ - __pyx_t_13 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":353 - * obj.x, obj.y, obj.brs = _get_object_data(o) - * for i from 0 <= i < length: - * dx = c_group_b[i].x - obj.x # <<<<<<<<<<<<<< - * dy = c_group_b[i].y - obj.y - * if dx*dx + dy*dy < c_group_b[i].brs + obj.brs: - */ - __pyx_v_dx = ((__pyx_v_c_group_b[__pyx_v_i]).x - __pyx_v_obj.x); - - /* "rabbyt/rabbyt.collisions.pyx":354 - * for i from 0 <= i < length: - * dx = c_group_b[i].x - obj.x - * dy = c_group_b[i].y - obj.y # <<<<<<<<<<<<<< - * if dx*dx + dy*dy < c_group_b[i].brs + obj.brs: - * collisions.append((o, group_b[i])) - */ - __pyx_v_dy = ((__pyx_v_c_group_b[__pyx_v_i]).y - __pyx_v_obj.y); - - /* "rabbyt/rabbyt.collisions.pyx":355 - * dx = c_group_b[i].x - obj.x - * dy = c_group_b[i].y - obj.y - * if dx*dx + dy*dy < c_group_b[i].brs + obj.brs: # <<<<<<<<<<<<<< - * collisions.append((o, group_b[i])) - * finally: - */ - __pyx_t_14 = ((((__pyx_v_dx * __pyx_v_dx) + (__pyx_v_dy * __pyx_v_dy)) < ((__pyx_v_c_group_b[__pyx_v_i]).brs + __pyx_v_obj.brs)) != 0); - if (__pyx_t_14) { - - /* "rabbyt/rabbyt.collisions.pyx":356 - * dy = c_group_b[i].y - obj.y - * if dx*dx + dy*dy < c_group_b[i].brs + obj.brs: - * collisions.append((o, group_b[i])) # <<<<<<<<<<<<<< - * finally: - * free(c_group_b) - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_group_b, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_collisions, ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - goto __pyx_L16; - } - __pyx_L16:; - } - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - - /* "rabbyt/rabbyt.collisions.pyx":358 - * collisions.append((o, group_b[i])) - * finally: - * free(c_group_b) # <<<<<<<<<<<<<< - * - * return collisions - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L5; - __pyx_L4: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L5; - } - __pyx_L5:; - free(__pyx_v_c_group_b); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "rabbyt/rabbyt.collisions.pyx":360 - * free(c_group_b) - * - * return collisions # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_collisions)); - __pyx_r = ((PyObject *)__pyx_v_collisions); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rabbyt.collisions.collide_groups", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XDECREF(__pyx_v_collisions); - __Pyx_XDECREF(__pyx_v_group_b); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":366 - * float l, r, t, b - * - * cdef int _read_rect(object obj, rect_s * rect) except -1: # <<<<<<<<<<<<<< - * cdef float x, y - * cdef cSprite sprite - */ - -static int __pyx_f_6rabbyt_10collisions__read_rect(PyObject *__pyx_v_obj, struct __pyx_t_6rabbyt_10collisions_rect_s *__pyx_v_rect) { - float __pyx_v_x; - float __pyx_v_y; - struct __pyx_obj_6rabbyt_8_sprites_cSprite *__pyx_v_sprite = 0; - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_temp_float2; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - float __pyx_t_4; - float __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_read_rect", 0); - - /* "rabbyt/rabbyt.collisions.pyx":370 - * cdef cSprite sprite - * cdef float2 temp_float2 - * if isinstance(obj, cSprite): # <<<<<<<<<<<<<< - * sprite = obj - * READ_SLOT(&sprite._x, &x) - */ - __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject*)__pyx_ptype_6rabbyt_8_sprites_cSprite)); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":371 - * cdef float2 temp_float2 - * if isinstance(obj, cSprite): - * sprite = obj # <<<<<<<<<<<<<< - * READ_SLOT(&sprite._x, &x) - * READ_SLOT(&sprite._y, &y) - */ - if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_6rabbyt_8_sprites_cSprite))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_obj); - __pyx_v_sprite = ((struct __pyx_obj_6rabbyt_8_sprites_cSprite *)__pyx_v_obj); - - /* "rabbyt/rabbyt.collisions.pyx":372 - * if isinstance(obj, cSprite): - * sprite = obj - * READ_SLOT(&sprite._x, &x) # <<<<<<<<<<<<<< - * READ_SLOT(&sprite._y, &y) - * temp_float2 = sprite._bounds_x() - */ - READ_SLOT((&__pyx_v_sprite->__pyx_base._x), (&__pyx_v_x)); - - /* "rabbyt/rabbyt.collisions.pyx":373 - * sprite = obj - * READ_SLOT(&sprite._x, &x) - * READ_SLOT(&sprite._y, &y) # <<<<<<<<<<<<<< - * temp_float2 = sprite._bounds_x() - * rect.l = temp_float2.a + x - */ - READ_SLOT((&__pyx_v_sprite->__pyx_base._y), (&__pyx_v_y)); - - /* "rabbyt/rabbyt.collisions.pyx":374 - * READ_SLOT(&sprite._x, &x) - * READ_SLOT(&sprite._y, &y) - * temp_float2 = sprite._bounds_x() # <<<<<<<<<<<<<< - * rect.l = temp_float2.a + x - * rect.r = temp_float2.b + x - */ - __pyx_v_temp_float2 = ((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_sprite->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_x(__pyx_v_sprite); - - /* "rabbyt/rabbyt.collisions.pyx":375 - * READ_SLOT(&sprite._y, &y) - * temp_float2 = sprite._bounds_x() - * rect.l = temp_float2.a + x # <<<<<<<<<<<<<< - * rect.r = temp_float2.b + x - * temp_float2= sprite._bounds_y() - */ - __pyx_v_rect->l = (__pyx_v_temp_float2.a + __pyx_v_x); - - /* "rabbyt/rabbyt.collisions.pyx":376 - * temp_float2 = sprite._bounds_x() - * rect.l = temp_float2.a + x - * rect.r = temp_float2.b + x # <<<<<<<<<<<<<< - * temp_float2= sprite._bounds_y() - * rect.b = temp_float2.a + y - */ - __pyx_v_rect->r = (__pyx_v_temp_float2.b + __pyx_v_x); - - /* "rabbyt/rabbyt.collisions.pyx":377 - * rect.l = temp_float2.a + x - * rect.r = temp_float2.b + x - * temp_float2= sprite._bounds_y() # <<<<<<<<<<<<<< - * rect.b = temp_float2.a + y - * rect.t = temp_float2.b + y - */ - __pyx_v_temp_float2 = ((struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite *)__pyx_v_sprite->__pyx_base.__pyx_base.__pyx_vtab)->_bounds_y(__pyx_v_sprite); - - /* "rabbyt/rabbyt.collisions.pyx":378 - * rect.r = temp_float2.b + x - * temp_float2= sprite._bounds_y() - * rect.b = temp_float2.a + y # <<<<<<<<<<<<<< - * rect.t = temp_float2.b + y - * else: - */ - __pyx_v_rect->b = (__pyx_v_temp_float2.a + __pyx_v_y); - - /* "rabbyt/rabbyt.collisions.pyx":379 - * temp_float2= sprite._bounds_y() - * rect.b = temp_float2.a + y - * rect.t = temp_float2.b + y # <<<<<<<<<<<<<< - * else: - * rect.l = obj.left - */ - __pyx_v_rect->t = (__pyx_v_temp_float2.b + __pyx_v_y); - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt.collisions.pyx":381 - * rect.t = temp_float2.b + y - * else: - * rect.l = obj.left # <<<<<<<<<<<<<< - * rect.r = obj.right - * rect.t = obj.top - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s__left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_rect->l = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":382 - * else: - * rect.l = obj.left - * rect.r = obj.right # <<<<<<<<<<<<<< - * rect.t = obj.top - * rect.b = obj.bottom - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s__right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_rect->r = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":383 - * rect.l = obj.left - * rect.r = obj.right - * rect.t = obj.top # <<<<<<<<<<<<<< - * rect.b = obj.bottom - * if rect.r < rect.l: - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s__top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_rect->t = __pyx_t_4; - - /* "rabbyt/rabbyt.collisions.pyx":384 - * rect.r = obj.right - * rect.t = obj.top - * rect.b = obj.bottom # <<<<<<<<<<<<<< - * if rect.r < rect.l: - * # TODO check to make sure that pyrex isn't using tuples for this... - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s__bottom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_rect->b = __pyx_t_4; - } - __pyx_L3:; - - /* "rabbyt/rabbyt.collisions.pyx":385 - * rect.t = obj.top - * rect.b = obj.bottom - * if rect.r < rect.l: # <<<<<<<<<<<<<< - * # TODO check to make sure that pyrex isn't using tuples for this... - * rect.l, rect.r = rect.r, rect.l - */ - __pyx_t_2 = ((__pyx_v_rect->r < __pyx_v_rect->l) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":387 - * if rect.r < rect.l: - * # TODO check to make sure that pyrex isn't using tuples for this... - * rect.l, rect.r = rect.r, rect.l # <<<<<<<<<<<<<< - * if rect.t < rect.b: - * rect.b, rect.t = rect.t, rect.b - */ - __pyx_t_4 = __pyx_v_rect->r; - __pyx_t_5 = __pyx_v_rect->l; - __pyx_v_rect->l = __pyx_t_4; - __pyx_v_rect->r = __pyx_t_5; - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt.collisions.pyx":388 - * # TODO check to make sure that pyrex isn't using tuples for this... - * rect.l, rect.r = rect.r, rect.l - * if rect.t < rect.b: # <<<<<<<<<<<<<< - * rect.b, rect.t = rect.t, rect.b - * return 1 - */ - __pyx_t_2 = ((__pyx_v_rect->t < __pyx_v_rect->b) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":389 - * rect.l, rect.r = rect.r, rect.l - * if rect.t < rect.b: - * rect.b, rect.t = rect.t, rect.b # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_5 = __pyx_v_rect->t; - __pyx_t_4 = __pyx_v_rect->b; - __pyx_v_rect->b = __pyx_t_5; - __pyx_v_rect->t = __pyx_t_4; - goto __pyx_L5; - } - __pyx_L5:; - - /* "rabbyt/rabbyt.collisions.pyx":390 - * if rect.t < rect.b: - * rect.b, rect.t = rect.t, rect.b - * return 1 # <<<<<<<<<<<<<< - * - * cdef int _collide_rect(rect_s * a, rect_s * b): - */ - __pyx_r = 1; - goto __pyx_L0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt.collisions._read_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_sprite); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":392 - * return 1 - * - * cdef int _collide_rect(rect_s * a, rect_s * b): # <<<<<<<<<<<<<< - * if a.l <= b.r and a.r >= b.l and a.b <= b.t and a.t >= b.b: - * return 1 - */ - -static int __pyx_f_6rabbyt_10collisions__collide_rect(struct __pyx_t_6rabbyt_10collisions_rect_s *__pyx_v_a, struct __pyx_t_6rabbyt_10collisions_rect_s *__pyx_v_b) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("_collide_rect", 0); - - /* "rabbyt/rabbyt.collisions.pyx":393 - * - * cdef int _collide_rect(rect_s * a, rect_s * b): - * if a.l <= b.r and a.r >= b.l and a.b <= b.t and a.t >= b.b: # <<<<<<<<<<<<<< - * return 1 - * return 0 - */ - __pyx_t_1 = ((__pyx_v_a->l <= __pyx_v_b->r) != 0); - if (__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_a->r >= __pyx_v_b->l) != 0); - if (__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_a->b <= __pyx_v_b->t) != 0); - if (__pyx_t_3) { - __pyx_t_4 = ((__pyx_v_a->t >= __pyx_v_b->b) != 0); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_3; - } - __pyx_t_3 = __pyx_t_5; - } else { - __pyx_t_3 = __pyx_t_2; - } - __pyx_t_2 = __pyx_t_3; - } else { - __pyx_t_2 = __pyx_t_1; - } - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":394 - * cdef int _collide_rect(rect_s * a, rect_s * b): - * if a.l <= b.r and a.r >= b.l and a.b <= b.t and a.t >= b.b: - * return 1 # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_r = 1; - goto __pyx_L0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt.collisions.pyx":395 - * if a.l <= b.r and a.r >= b.l and a.b <= b.t and a.t >= b.b: - * return 1 - * return 0 # <<<<<<<<<<<<<< - * - * def aabb_collide(objects): - */ - __pyx_r = 0; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_13aabb_collide(PyObject *__pyx_self, PyObject *__pyx_v_objects); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_12aabb_collide[] = "\n ``aabb_collide(objects)``\n\n ``aabb_collide`` works similar to ``collide``, but instead of using\n bounding radius it uses axis aligned bounding boxes [AABB].\n\n All objects must have ``left``, ``top``, ``right``, and ``bottom``\n attributes.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_13aabb_collide = {__Pyx_NAMESTR("aabb_collide"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_13aabb_collide, METH_O, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_12aabb_collide)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_13aabb_collide(PyObject *__pyx_self, PyObject *__pyx_v_objects) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aabb_collide (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10collisions_12aabb_collide(__pyx_self, ((PyObject *)__pyx_v_objects)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":397 - * return 0 - * - * def aabb_collide(objects): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide(objects)`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_12aabb_collide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_objects) { - struct __pyx_t_6rabbyt_10collisions_side_s *__pyx_v_side_list; - struct __pyx_t_6rabbyt_10collisions_side_s **__pyx_v_side_p_list; - struct __pyx_t_6rabbyt_10collisions_side_s *__pyx_v_temp_side; - int __pyx_v_length; - int __pyx_v_i; - int __pyx_v_j; - int __pyx_v_index; - float __pyx_v_l; - float __pyx_v_t; - float __pyx_v_r; - float __pyx_v_b; - struct __pyx_t_6rabbyt_10collisions_rect_s __pyx_v_rect; - PyObject *__pyx_v_o = NULL; - PyObject *__pyx_v_collisions = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - float __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - int __pyx_t_10; - int __pyx_t_11; - int __pyx_t_12; - PyObject *__pyx_t_13 = NULL; - int __pyx_t_14; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("aabb_collide", 0); - - /* "rabbyt/rabbyt.collisions.pyx":416 - * cdef float x,y - * cdef cSprite sprite - * length = len(objects)*2 # <<<<<<<<<<<<<< - * - * side_list = malloc(sizeof(side_s)*length) - */ - __pyx_t_1 = PyObject_Length(__pyx_v_objects); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = (__pyx_t_1 * 2); - - /* "rabbyt/rabbyt.collisions.pyx":418 - * length = len(objects)*2 - * - * side_list = malloc(sizeof(side_s)*length) # <<<<<<<<<<<<<< - * side_p_list = malloc(sizeof(side_s*)*length) - * try: - */ - __pyx_v_side_list = ((struct __pyx_t_6rabbyt_10collisions_side_s *)malloc(((sizeof(struct __pyx_t_6rabbyt_10collisions_side_s)) * __pyx_v_length))); - - /* "rabbyt/rabbyt.collisions.pyx":419 - * - * side_list = malloc(sizeof(side_s)*length) - * side_p_list = malloc(sizeof(side_s*)*length) # <<<<<<<<<<<<<< - * try: - * i = 0 - */ - __pyx_v_side_p_list = ((struct __pyx_t_6rabbyt_10collisions_side_s **)malloc(((sizeof(struct __pyx_t_6rabbyt_10collisions_side_s *)) * __pyx_v_length))); - - /* "rabbyt/rabbyt.collisions.pyx":420 - * side_list = malloc(sizeof(side_s)*length) - * side_p_list = malloc(sizeof(side_s*)*length) - * try: # <<<<<<<<<<<<<< - * i = 0 - * for o in objects: - */ - /*try:*/ { - - /* "rabbyt/rabbyt.collisions.pyx":421 - * side_p_list = malloc(sizeof(side_s*)*length) - * try: - * i = 0 # <<<<<<<<<<<<<< - * for o in objects: - * _read_rect(o, &rect) - */ - __pyx_v_i = 0; - - /* "rabbyt/rabbyt.collisions.pyx":422 - * try: - * i = 0 - * for o in objects: # <<<<<<<<<<<<<< - * _read_rect(o, &rect) - * side_list[i].x = rect.l - */ - if (PyList_CheckExact(__pyx_v_objects) || PyTuple_CheckExact(__pyx_v_objects)) { - __pyx_t_2 = __pyx_v_objects; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; - } - for (;;) { - if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L4;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L4;} - #endif - } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L4;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L4;} - #endif - } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_2); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L4;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":423 - * i = 0 - * for o in objects: - * _read_rect(o, &rect) # <<<<<<<<<<<<<< - * side_list[i].x = rect.l - * side_list[i].y = rect.b - */ - __pyx_t_5 = __pyx_f_6rabbyt_10collisions__read_rect(__pyx_v_o, (&__pyx_v_rect)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L4;} - - /* "rabbyt/rabbyt.collisions.pyx":424 - * for o in objects: - * _read_rect(o, &rect) - * side_list[i].x = rect.l # <<<<<<<<<<<<<< - * side_list[i].y = rect.b - * side_list[i].side = LEFT - */ - __pyx_t_6 = __pyx_v_rect.l; - (__pyx_v_side_list[__pyx_v_i]).x = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":425 - * _read_rect(o, &rect) - * side_list[i].x = rect.l - * side_list[i].y = rect.b # <<<<<<<<<<<<<< - * side_list[i].side = LEFT - * side_list[i].other_side = &side_list[i+1] - */ - __pyx_t_6 = __pyx_v_rect.b; - (__pyx_v_side_list[__pyx_v_i]).y = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":426 - * side_list[i].x = rect.l - * side_list[i].y = rect.b - * side_list[i].side = LEFT # <<<<<<<<<<<<<< - * side_list[i].other_side = &side_list[i+1] - * side_list[i].index = i/2 - */ - (__pyx_v_side_list[__pyx_v_i]).side = __pyx_e_6rabbyt_10collisions_LEFT; - - /* "rabbyt/rabbyt.collisions.pyx":427 - * side_list[i].y = rect.b - * side_list[i].side = LEFT - * side_list[i].other_side = &side_list[i+1] # <<<<<<<<<<<<<< - * side_list[i].index = i/2 - * side_p_list[i] = &side_list[i] - */ - (__pyx_v_side_list[__pyx_v_i]).other_side = (&(__pyx_v_side_list[(__pyx_v_i + 1)])); - - /* "rabbyt/rabbyt.collisions.pyx":428 - * side_list[i].side = LEFT - * side_list[i].other_side = &side_list[i+1] - * side_list[i].index = i/2 # <<<<<<<<<<<<<< - * side_p_list[i] = &side_list[i] - * i = i + 1 - */ - (__pyx_v_side_list[__pyx_v_i]).index = __Pyx_div_long(__pyx_v_i, 2); - - /* "rabbyt/rabbyt.collisions.pyx":429 - * side_list[i].other_side = &side_list[i+1] - * side_list[i].index = i/2 - * side_p_list[i] = &side_list[i] # <<<<<<<<<<<<<< - * i = i + 1 - * side_list[i].x = rect.r - */ - (__pyx_v_side_p_list[__pyx_v_i]) = (&(__pyx_v_side_list[__pyx_v_i])); - - /* "rabbyt/rabbyt.collisions.pyx":430 - * side_list[i].index = i/2 - * side_p_list[i] = &side_list[i] - * i = i + 1 # <<<<<<<<<<<<<< - * side_list[i].x = rect.r - * side_list[i].y = rect.t - */ - __pyx_v_i = (__pyx_v_i + 1); - - /* "rabbyt/rabbyt.collisions.pyx":431 - * side_p_list[i] = &side_list[i] - * i = i + 1 - * side_list[i].x = rect.r # <<<<<<<<<<<<<< - * side_list[i].y = rect.t - * side_list[i].side = RIGHT - */ - __pyx_t_6 = __pyx_v_rect.r; - (__pyx_v_side_list[__pyx_v_i]).x = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":432 - * i = i + 1 - * side_list[i].x = rect.r - * side_list[i].y = rect.t # <<<<<<<<<<<<<< - * side_list[i].side = RIGHT - * side_list[i].other_side = &side_list[i-1] - */ - __pyx_t_6 = __pyx_v_rect.t; - (__pyx_v_side_list[__pyx_v_i]).y = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":433 - * side_list[i].x = rect.r - * side_list[i].y = rect.t - * side_list[i].side = RIGHT # <<<<<<<<<<<<<< - * side_list[i].other_side = &side_list[i-1] - * side_list[i].index = i/2 - */ - (__pyx_v_side_list[__pyx_v_i]).side = __pyx_e_6rabbyt_10collisions_RIGHT; - - /* "rabbyt/rabbyt.collisions.pyx":434 - * side_list[i].y = rect.t - * side_list[i].side = RIGHT - * side_list[i].other_side = &side_list[i-1] # <<<<<<<<<<<<<< - * side_list[i].index = i/2 - * side_p_list[i] = &side_list[i] - */ - (__pyx_v_side_list[__pyx_v_i]).other_side = (&(__pyx_v_side_list[(__pyx_v_i - 1)])); - - /* "rabbyt/rabbyt.collisions.pyx":435 - * side_list[i].side = RIGHT - * side_list[i].other_side = &side_list[i-1] - * side_list[i].index = i/2 # <<<<<<<<<<<<<< - * side_p_list[i] = &side_list[i] - * i = i + 1 - */ - (__pyx_v_side_list[__pyx_v_i]).index = __Pyx_div_long(__pyx_v_i, 2); - - /* "rabbyt/rabbyt.collisions.pyx":436 - * side_list[i].other_side = &side_list[i-1] - * side_list[i].index = i/2 - * side_p_list[i] = &side_list[i] # <<<<<<<<<<<<<< - * i = i + 1 - * - */ - (__pyx_v_side_p_list[__pyx_v_i]) = (&(__pyx_v_side_list[__pyx_v_i])); - - /* "rabbyt/rabbyt.collisions.pyx":437 - * side_list[i].index = i/2 - * side_p_list[i] = &side_list[i] - * i = i + 1 # <<<<<<<<<<<<<< - * - * _rdc(side_p_list, length, X, 0, 1, 0) - */ - __pyx_v_i = (__pyx_v_i + 1); - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":439 - * i = i + 1 - * - * _rdc(side_p_list, length, X, 0, 1, 0) # <<<<<<<<<<<<<< - * - * collisions = [] - */ - __pyx_f_6rabbyt_10collisions__rdc(__pyx_v_side_p_list, __pyx_v_length, __pyx_e_6rabbyt_10collisions_X, 0, 1, 0); - - /* "rabbyt/rabbyt.collisions.pyx":441 - * _rdc(side_p_list, length, X, 0, 1, 0) - * - * collisions = [] # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * if side_p_list[i][0].side == LEFT: - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_collisions = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":442 - * - * collisions = [] - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * if side_p_list[i][0].side == LEFT: - * index = side_p_list[i][0].index - */ - __pyx_t_5 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":443 - * collisions = [] - * for i from 0 <= i < length: - * if side_p_list[i][0].side == LEFT: # <<<<<<<<<<<<<< - * index = side_p_list[i][0].index - * temp_side = side_p_list[i] - */ - __pyx_t_7 = ((((__pyx_v_side_p_list[__pyx_v_i])[0]).side == __pyx_e_6rabbyt_10collisions_LEFT) != 0); - if (__pyx_t_7) { - - /* "rabbyt/rabbyt.collisions.pyx":444 - * for i from 0 <= i < length: - * if side_p_list[i][0].side == LEFT: - * index = side_p_list[i][0].index # <<<<<<<<<<<<<< - * temp_side = side_p_list[i] - * l = temp_side.x - */ - __pyx_t_8 = ((__pyx_v_side_p_list[__pyx_v_i])[0]).index; - __pyx_v_index = __pyx_t_8; - - /* "rabbyt/rabbyt.collisions.pyx":445 - * if side_p_list[i][0].side == LEFT: - * index = side_p_list[i][0].index - * temp_side = side_p_list[i] # <<<<<<<<<<<<<< - * l = temp_side.x - * r = temp_side.other_side[0].x - */ - __pyx_v_temp_side = (__pyx_v_side_p_list[__pyx_v_i]); - - /* "rabbyt/rabbyt.collisions.pyx":446 - * index = side_p_list[i][0].index - * temp_side = side_p_list[i] - * l = temp_side.x # <<<<<<<<<<<<<< - * r = temp_side.other_side[0].x - * b = temp_side[0].y - */ - __pyx_t_6 = __pyx_v_temp_side->x; - __pyx_v_l = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":447 - * temp_side = side_p_list[i] - * l = temp_side.x - * r = temp_side.other_side[0].x # <<<<<<<<<<<<<< - * b = temp_side[0].y - * t = temp_side[0].other_side[0].y - */ - __pyx_t_6 = (__pyx_v_temp_side->other_side[0]).x; - __pyx_v_r = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":448 - * l = temp_side.x - * r = temp_side.other_side[0].x - * b = temp_side[0].y # <<<<<<<<<<<<<< - * t = temp_side[0].other_side[0].y - * j = i + 1 - */ - __pyx_t_6 = (__pyx_v_temp_side[0]).y; - __pyx_v_b = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":449 - * r = temp_side.other_side[0].x - * b = temp_side[0].y - * t = temp_side[0].other_side[0].y # <<<<<<<<<<<<<< - * j = i + 1 - * temp_side = side_p_list[j] - */ - __pyx_t_6 = ((__pyx_v_temp_side[0]).other_side[0]).y; - __pyx_v_t = __pyx_t_6; - - /* "rabbyt/rabbyt.collisions.pyx":450 - * b = temp_side[0].y - * t = temp_side[0].other_side[0].y - * j = i + 1 # <<<<<<<<<<<<<< - * temp_side = side_p_list[j] - * while temp_side.index != index: - */ - __pyx_v_j = (__pyx_v_i + 1); - - /* "rabbyt/rabbyt.collisions.pyx":451 - * t = temp_side[0].other_side[0].y - * j = i + 1 - * temp_side = side_p_list[j] # <<<<<<<<<<<<<< - * while temp_side.index != index: - * if temp_side.side == LEFT: - */ - __pyx_v_temp_side = (__pyx_v_side_p_list[__pyx_v_j]); - - /* "rabbyt/rabbyt.collisions.pyx":452 - * j = i + 1 - * temp_side = side_p_list[j] - * while temp_side.index != index: # <<<<<<<<<<<<<< - * if temp_side.side == LEFT: - * if l <= temp_side.other_side[0].x and \ - */ - while (1) { - __pyx_t_7 = ((__pyx_v_temp_side->index != __pyx_v_index) != 0); - if (!__pyx_t_7) break; - - /* "rabbyt/rabbyt.collisions.pyx":453 - * temp_side = side_p_list[j] - * while temp_side.index != index: - * if temp_side.side == LEFT: # <<<<<<<<<<<<<< - * if l <= temp_side.other_side[0].x and \ - * r >= temp_side.x and\ - */ - __pyx_t_7 = ((__pyx_v_temp_side->side == __pyx_e_6rabbyt_10collisions_LEFT) != 0); - if (__pyx_t_7) { - - /* "rabbyt/rabbyt.collisions.pyx":454 - * while temp_side.index != index: - * if temp_side.side == LEFT: - * if l <= temp_side.other_side[0].x and \ # <<<<<<<<<<<<<< - * r >= temp_side.x and\ - * b <= temp_side.other_side[0].y and \ - */ - __pyx_t_7 = ((__pyx_v_l <= (__pyx_v_temp_side->other_side[0]).x) != 0); - if (__pyx_t_7) { - - /* "rabbyt/rabbyt.collisions.pyx":455 - * if temp_side.side == LEFT: - * if l <= temp_side.other_side[0].x and \ - * r >= temp_side.x and\ # <<<<<<<<<<<<<< - * b <= temp_side.other_side[0].y and \ - * t >= temp_side.y: - */ - __pyx_t_9 = ((__pyx_v_r >= __pyx_v_temp_side->x) != 0); - if (__pyx_t_9) { - - /* "rabbyt/rabbyt.collisions.pyx":456 - * if l <= temp_side.other_side[0].x and \ - * r >= temp_side.x and\ - * b <= temp_side.other_side[0].y and \ # <<<<<<<<<<<<<< - * t >= temp_side.y: - * collisions.append((objects[index], - */ - __pyx_t_10 = ((__pyx_v_b <= (__pyx_v_temp_side->other_side[0]).y) != 0); - if (__pyx_t_10) { - - /* "rabbyt/rabbyt.collisions.pyx":457 - * r >= temp_side.x and\ - * b <= temp_side.other_side[0].y and \ - * t >= temp_side.y: # <<<<<<<<<<<<<< - * collisions.append((objects[index], - * objects[side_p_list[j][0].index])) - */ - __pyx_t_11 = ((__pyx_v_t >= __pyx_v_temp_side->y) != 0); - __pyx_t_12 = __pyx_t_11; - } else { - __pyx_t_12 = __pyx_t_10; - } - __pyx_t_10 = __pyx_t_12; - } else { - __pyx_t_10 = __pyx_t_9; - } - __pyx_t_9 = __pyx_t_10; - } else { - __pyx_t_9 = __pyx_t_7; - } - if (__pyx_t_9) { - - /* "rabbyt/rabbyt.collisions.pyx":458 - * b <= temp_side.other_side[0].y and \ - * t >= temp_side.y: - * collisions.append((objects[index], # <<<<<<<<<<<<<< - * objects[side_p_list[j][0].index])) - * j = j + 1 - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_objects, __pyx_v_index, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_2); - - /* "rabbyt/rabbyt.collisions.pyx":459 - * t >= temp_side.y: - * collisions.append((objects[index], - * objects[side_p_list[j][0].index])) # <<<<<<<<<<<<<< - * j = j + 1 - * temp_side = side_p_list[j] - */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_objects, ((__pyx_v_side_p_list[__pyx_v_j])[0]).index, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_13); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_collisions, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0; - goto __pyx_L14; - } - __pyx_L14:; - goto __pyx_L13; - } - __pyx_L13:; - - /* "rabbyt/rabbyt.collisions.pyx":460 - * collisions.append((objects[index], - * objects[side_p_list[j][0].index])) - * j = j + 1 # <<<<<<<<<<<<<< - * temp_side = side_p_list[j] - * - */ - __pyx_v_j = (__pyx_v_j + 1); - - /* "rabbyt/rabbyt.collisions.pyx":461 - * objects[side_p_list[j][0].index])) - * j = j + 1 - * temp_side = side_p_list[j] # <<<<<<<<<<<<<< - * - * # TODO keyword argument to return the group instead? - */ - __pyx_v_temp_side = (__pyx_v_side_p_list[__pyx_v_j]); - } - goto __pyx_L10; - } - __pyx_L10:; - } - - /* "rabbyt/rabbyt.collisions.pyx":465 - * # TODO keyword argument to return the group instead? - * - * return collisions # <<<<<<<<<<<<<< - * finally: - * free(side_list) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_collisions)); - __pyx_r = ((PyObject *)__pyx_v_collisions); - goto __pyx_L3; - } - - /* "rabbyt/rabbyt.collisions.pyx":467 - * return collisions - * finally: - * free(side_list) # <<<<<<<<<<<<<< - * free(side_p_list) - * - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L5; - __pyx_L3: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 3; goto __pyx_L5; - __pyx_L4: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L5; - } - __pyx_L5:; - free(__pyx_v_side_list); - - /* "rabbyt/rabbyt.collisions.pyx":468 - * finally: - * free(side_list) - * free(side_p_list) # <<<<<<<<<<<<<< - * - * def aabb_collide_single(single, objects): - */ - free(__pyx_v_side_p_list); - switch (__pyx_why) { - case 3: goto __pyx_L0; - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_AddTraceback("rabbyt.collisions.aabb_collide", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XDECREF(__pyx_v_collisions); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_15aabb_collide_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_14aabb_collide_single[] = "\n ``aabb_collide_single(single, objects)``\n\n Finds all objects in ``objects`` that collide with ``single``, (using\n bounding boxes.)\n\n All objects must have ``left``, ``top``, ``right``, and ``bottom``\n attributes.\n\n A list of all objects from ``objects`` that collide with ``single`` is\n returned.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_15aabb_collide_single = {__Pyx_NAMESTR("aabb_collide_single"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_15aabb_collide_single, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_14aabb_collide_single)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_15aabb_collide_single(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_single = 0; - PyObject *__pyx_v_objects = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aabb_collide_single (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__single,&__pyx_n_s__objects,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__single)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__objects)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aabb_collide_single", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aabb_collide_single") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_single = values[0]; - __pyx_v_objects = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("aabb_collide_single", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.collisions.aabb_collide_single", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10collisions_14aabb_collide_single(__pyx_self, __pyx_v_single, __pyx_v_objects); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":470 - * free(side_p_list) - * - * def aabb_collide_single(single, objects): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide_single(single, objects)`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_14aabb_collide_single(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_single, PyObject *__pyx_v_objects) { - struct __pyx_t_6rabbyt_10collisions_rect_s __pyx_v_r_a; - struct __pyx_t_6rabbyt_10collisions_rect_s __pyx_v_r_b; - PyObject *__pyx_v_o = 0; - PyObject *__pyx_v_collisions = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("aabb_collide_single", 0); - - /* "rabbyt/rabbyt.collisions.pyx":486 - * cdef object o, collisions - * - * _read_rect(single, &r_a) # <<<<<<<<<<<<<< - * - * collisions = [] - */ - __pyx_t_1 = __pyx_f_6rabbyt_10collisions__read_rect(__pyx_v_single, (&__pyx_v_r_a)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":488 - * _read_rect(single, &r_a) - * - * collisions = [] # <<<<<<<<<<<<<< - * for o in objects: - * _read_rect(o, &r_b) - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_collisions = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":489 - * - * collisions = [] - * for o in objects: # <<<<<<<<<<<<<< - * _read_rect(o, &r_b) - * if _collide_rect(&r_a, &r_b): - */ - if (PyList_CheckExact(__pyx_v_objects) || PyTuple_CheckExact(__pyx_v_objects)) { - __pyx_t_2 = __pyx_v_objects; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; - } - for (;;) { - if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_5 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_5)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_5); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_5); - __pyx_t_5 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":490 - * collisions = [] - * for o in objects: - * _read_rect(o, &r_b) # <<<<<<<<<<<<<< - * if _collide_rect(&r_a, &r_b): - * collisions.append(o) - */ - __pyx_t_1 = __pyx_f_6rabbyt_10collisions__read_rect(__pyx_v_o, (&__pyx_v_r_b)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":491 - * for o in objects: - * _read_rect(o, &r_b) - * if _collide_rect(&r_a, &r_b): # <<<<<<<<<<<<<< - * collisions.append(o) - * return collisions - */ - __pyx_t_6 = (__pyx_f_6rabbyt_10collisions__collide_rect((&__pyx_v_r_a), (&__pyx_v_r_b)) != 0); - if (__pyx_t_6) { - - /* "rabbyt/rabbyt.collisions.pyx":492 - * _read_rect(o, &r_b) - * if _collide_rect(&r_a, &r_b): - * collisions.append(o) # <<<<<<<<<<<<<< - * return collisions - * - */ - __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_collisions, __pyx_v_o); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - goto __pyx_L5; - } - __pyx_L5:; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":493 - * if _collide_rect(&r_a, &r_b): - * collisions.append(o) - * return collisions # <<<<<<<<<<<<<< - * - * def aabb_collide_groups(group_a, group_b): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_collisions); - __pyx_r = __pyx_v_collisions; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rabbyt.collisions.aabb_collide_single", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XDECREF(__pyx_v_collisions); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10collisions_17aabb_collide_groups(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6rabbyt_10collisions_16aabb_collide_groups[] = "\n ``aabb_collide_groups(group_a, group_b)``\n\n Returns a list of collisions between objects in ``group_a`` with objects\n in ``group_b``.\n\n All objects must have ``left``, ``top``, ``right``, and ``bottom``\n attributes.\n "; -static PyMethodDef __pyx_mdef_6rabbyt_10collisions_17aabb_collide_groups = {__Pyx_NAMESTR("aabb_collide_groups"), (PyCFunction)__pyx_pw_6rabbyt_10collisions_17aabb_collide_groups, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6rabbyt_10collisions_16aabb_collide_groups)}; -static PyObject *__pyx_pw_6rabbyt_10collisions_17aabb_collide_groups(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_group_a = 0; - PyObject *__pyx_v_group_b = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("aabb_collide_groups (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__group_a,&__pyx_n_s__group_b,0}; - PyObject* values[2] = {0,0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group_a)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__group_b)) != 0)) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("aabb_collide_groups", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aabb_collide_groups") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - } - __pyx_v_group_a = values[0]; - __pyx_v_group_b = values[1]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("aabb_collide_groups", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.collisions.aabb_collide_groups", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10collisions_16aabb_collide_groups(__pyx_self, __pyx_v_group_a, __pyx_v_group_b); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.collisions.pyx":495 - * return collisions - * - * def aabb_collide_groups(group_a, group_b): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide_groups(group_a, group_b)`` - */ - -static PyObject *__pyx_pf_6rabbyt_10collisions_16aabb_collide_groups(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_group_a, PyObject *__pyx_v_group_b) { - struct __pyx_t_6rabbyt_10collisions_rect_s *__pyx_v_c_group_b; - struct __pyx_t_6rabbyt_10collisions_rect_s __pyx_v_a; - int __pyx_v_i; - int __pyx_v_length; - PyObject *__pyx_v_o = 0; - PyObject *__pyx_v_collisions = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *(*__pyx_t_6)(PyObject *); - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("aabb_collide_groups", 0); - __Pyx_INCREF(__pyx_v_group_b); - - /* "rabbyt/rabbyt.collisions.pyx":509 - * cdef int i, length - * cdef object o - * if not isinstance(group_b, list): # <<<<<<<<<<<<<< - * group_b = list(group_b) - * - */ - __pyx_t_1 = PyList_Check(__pyx_v_group_b); - __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":510 - * cdef object o - * if not isinstance(group_b, list): - * group_b = list(group_b) # <<<<<<<<<<<<<< - * - * length = len(group_b) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_group_b); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_group_b); - __Pyx_GIVEREF(__pyx_v_group_b); - __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_group_b, __pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt.collisions.pyx":512 - * group_b = list(group_b) - * - * length = len(group_b) # <<<<<<<<<<<<<< - * c_group_b = malloc(sizeof(rect_s)*length) - * - */ - __pyx_t_5 = PyObject_Length(__pyx_v_group_b); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = __pyx_t_5; - - /* "rabbyt/rabbyt.collisions.pyx":513 - * - * length = len(group_b) - * c_group_b = malloc(sizeof(rect_s)*length) # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_c_group_b = ((struct __pyx_t_6rabbyt_10collisions_rect_s *)malloc(((sizeof(struct __pyx_t_6rabbyt_10collisions_rect_s)) * __pyx_v_length))); - - /* "rabbyt/rabbyt.collisions.pyx":515 - * c_group_b = malloc(sizeof(rect_s)*length) - * - * try: # <<<<<<<<<<<<<< - * i = 0 - * for o in group_b: - */ - /*try:*/ { - - /* "rabbyt/rabbyt.collisions.pyx":516 - * - * try: - * i = 0 # <<<<<<<<<<<<<< - * for o in group_b: - * _read_rect(o, &c_group_b[i]) - */ - __pyx_v_i = 0; - - /* "rabbyt/rabbyt.collisions.pyx":517 - * try: - * i = 0 - * for o in group_b: # <<<<<<<<<<<<<< - * _read_rect(o, &c_group_b[i]) - * i = i + 1 - */ - if (PyList_CheckExact(__pyx_v_group_b) || PyTuple_CheckExact(__pyx_v_group_b)) { - __pyx_t_4 = __pyx_v_group_b; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_group_b); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; - } - for (;;) { - if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5;} - #endif - } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5;} - #endif - } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L5;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":518 - * i = 0 - * for o in group_b: - * _read_rect(o, &c_group_b[i]) # <<<<<<<<<<<<<< - * i = i + 1 - * - */ - __pyx_t_7 = __pyx_f_6rabbyt_10collisions__read_rect(__pyx_v_o, (&(__pyx_v_c_group_b[__pyx_v_i]))); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L5;} - - /* "rabbyt/rabbyt.collisions.pyx":519 - * for o in group_b: - * _read_rect(o, &c_group_b[i]) - * i = i + 1 # <<<<<<<<<<<<<< - * - * collisions = [] - */ - __pyx_v_i = (__pyx_v_i + 1); - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":521 - * i = i + 1 - * - * collisions = [] # <<<<<<<<<<<<<< - * for o in group_a: - * _read_rect(o, &a) - */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_collisions = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":522 - * - * collisions = [] - * for o in group_a: # <<<<<<<<<<<<<< - * _read_rect(o, &a) - * for i from 0 <= i < length: - */ - if (PyList_CheckExact(__pyx_v_group_a) || PyTuple_CheckExact(__pyx_v_group_a)) { - __pyx_t_4 = __pyx_v_group_a; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0; - __pyx_t_6 = NULL; - } else { - __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_group_a); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; - } - for (;;) { - if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L5;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L5;} - #endif - } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) { - if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L5;} - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L5;} - #endif - } else { - __pyx_t_3 = __pyx_t_6(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L5;} - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); - __pyx_t_3 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":523 - * collisions = [] - * for o in group_a: - * _read_rect(o, &a) # <<<<<<<<<<<<<< - * for i from 0 <= i < length: - * if _collide_rect(&a, &c_group_b[i]): - */ - __pyx_t_7 = __pyx_f_6rabbyt_10collisions__read_rect(__pyx_v_o, (&__pyx_v_a)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L5;} - - /* "rabbyt/rabbyt.collisions.pyx":524 - * for o in group_a: - * _read_rect(o, &a) - * for i from 0 <= i < length: # <<<<<<<<<<<<<< - * if _collide_rect(&a, &c_group_b[i]): - * collisions.append((o, group_b[i])) - */ - __pyx_t_7 = __pyx_v_length; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { - - /* "rabbyt/rabbyt.collisions.pyx":525 - * _read_rect(o, &a) - * for i from 0 <= i < length: - * if _collide_rect(&a, &c_group_b[i]): # <<<<<<<<<<<<<< - * collisions.append((o, group_b[i])) - * finally: - */ - __pyx_t_2 = (__pyx_f_6rabbyt_10collisions__collide_rect((&__pyx_v_a), (&(__pyx_v_c_group_b[__pyx_v_i]))) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.collisions.pyx":526 - * for i from 0 <= i < length: - * if _collide_rect(&a, &c_group_b[i]): - * collisions.append((o, group_b[i])) # <<<<<<<<<<<<<< - * finally: - * free(c_group_b) - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_group_b, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_o); - __Pyx_GIVEREF(__pyx_v_o); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_collisions, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L5;} - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - goto __pyx_L13; - } - __pyx_L13:; - } - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - - /* "rabbyt/rabbyt.collisions.pyx":528 - * collisions.append((o, group_b[i])) - * finally: - * free(c_group_b) # <<<<<<<<<<<<<< - * return collisions - * - */ - /*finally:*/ { - int __pyx_why; - PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; - int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L6; - __pyx_L5: { - __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); - __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L6; - } - __pyx_L6:; - free(__pyx_v_c_group_b); - switch (__pyx_why) { - case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); - __pyx_lineno = __pyx_exc_lineno; - __pyx_exc_type = 0; - __pyx_exc_value = 0; - __pyx_exc_tb = 0; - goto __pyx_L1_error; - } - } - } - - /* "rabbyt/rabbyt.collisions.pyx":529 - * finally: - * free(c_group_b) - * return collisions # <<<<<<<<<<<<<< - * - * __docs_all__ = ('collide', 'collide_single', 'collide_groups', - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_collisions)); - __pyx_r = ((PyObject *)__pyx_v_collisions); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("rabbyt.collisions.aabb_collide_groups", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XDECREF(__pyx_v_collisions); - __Pyx_XDECREF(__pyx_v_group_b); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - __Pyx_NAMESTR("collisions"), - __Pyx_DOCSTR(__pyx_k_2), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 1}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_n_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 1}, - {&__pyx_n_s____author__, __pyx_k____author__, sizeof(__pyx_k____author__), 0, 0, 1, 1}, - {&__pyx_n_s____credits__, __pyx_k____credits__, sizeof(__pyx_k____credits__), 0, 0, 1, 1}, - {&__pyx_n_s____docs_all__, __pyx_k____docs_all__, sizeof(__pyx_k____docs_all__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___get_object_data, __pyx_k___get_object_data, sizeof(__pyx_k___get_object_data), 0, 0, 1, 1}, - {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1}, - {&__pyx_n_s__aabb_collide, __pyx_k__aabb_collide, sizeof(__pyx_k__aabb_collide), 0, 0, 1, 1}, - {&__pyx_n_s__aabb_collide_groups, __pyx_k__aabb_collide_groups, sizeof(__pyx_k__aabb_collide_groups), 0, 0, 1, 1}, - {&__pyx_n_s__aabb_collide_single, __pyx_k__aabb_collide_single, sizeof(__pyx_k__aabb_collide_single), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1}, - {&__pyx_n_s__bottom, __pyx_k__bottom, sizeof(__pyx_k__bottom), 0, 0, 1, 1}, - {&__pyx_n_s__bounding_radius, __pyx_k__bounding_radius, sizeof(__pyx_k__bounding_radius), 0, 0, 1, 1}, - {&__pyx_n_s__brs, __pyx_k__brs, sizeof(__pyx_k__brs), 0, 0, 1, 1}, - {&__pyx_n_s__brute_force, __pyx_k__brute_force, sizeof(__pyx_k__brute_force), 0, 0, 1, 1}, - {&__pyx_n_s__c_group_b, __pyx_k__c_group_b, sizeof(__pyx_k__c_group_b), 0, 0, 1, 1}, - {&__pyx_n_s__collide, __pyx_k__collide, sizeof(__pyx_k__collide), 0, 0, 1, 1}, - {&__pyx_n_s__collide_groups, __pyx_k__collide_groups, sizeof(__pyx_k__collide_groups), 0, 0, 1, 1}, - {&__pyx_n_s__collide_single, __pyx_k__collide_single, sizeof(__pyx_k__collide_single), 0, 0, 1, 1}, - {&__pyx_n_s__collisions, __pyx_k__collisions, sizeof(__pyx_k__collisions), 0, 0, 1, 1}, - {&__pyx_n_s__current_group, __pyx_k__current_group, sizeof(__pyx_k__current_group), 0, 0, 1, 1}, - {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1}, - {&__pyx_n_s__dx, __pyx_k__dx, sizeof(__pyx_k__dx), 0, 0, 1, 1}, - {&__pyx_n_s__dy, __pyx_k__dy, sizeof(__pyx_k__dy), 0, 0, 1, 1}, - {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1}, - {&__pyx_n_s__group, __pyx_k__group, sizeof(__pyx_k__group), 0, 0, 1, 1}, - {&__pyx_n_s__group_a, __pyx_k__group_a, sizeof(__pyx_k__group_a), 0, 0, 1, 1}, - {&__pyx_n_s__group_b, __pyx_k__group_b, sizeof(__pyx_k__group_b), 0, 0, 1, 1}, - {&__pyx_n_s__group_start, __pyx_k__group_start, sizeof(__pyx_k__group_start), 0, 0, 1, 1}, - {&__pyx_n_s__groups, __pyx_k__groups, sizeof(__pyx_k__groups), 0, 0, 1, 1}, - {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1}, - {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1}, - {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1}, - {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1}, - {&__pyx_n_s__left, __pyx_k__left, sizeof(__pyx_k__left), 0, 0, 1, 1}, - {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1}, - {&__pyx_n_s__max_depth, __pyx_k__max_depth, sizeof(__pyx_k__max_depth), 0, 0, 1, 1}, - {&__pyx_n_s__min_split, __pyx_k__min_split, sizeof(__pyx_k__min_split), 0, 0, 1, 1}, - {&__pyx_n_s__o, __pyx_k__o, sizeof(__pyx_k__o), 0, 0, 1, 1}, - {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1}, - {&__pyx_n_s__objects, __pyx_k__objects, sizeof(__pyx_k__objects), 0, 0, 1, 1}, - {&__pyx_n_s__objs, __pyx_k__objs, sizeof(__pyx_k__objs), 0, 0, 1, 1}, - {&__pyx_n_s__obrs, __pyx_k__obrs, sizeof(__pyx_k__obrs), 0, 0, 1, 1}, - {&__pyx_n_s__ox, __pyx_k__ox, sizeof(__pyx_k__ox), 0, 0, 1, 1}, - {&__pyx_n_s__oy, __pyx_k__oy, sizeof(__pyx_k__oy), 0, 0, 1, 1}, - {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1}, - {&__pyx_n_s__r_a, __pyx_k__r_a, sizeof(__pyx_k__r_a), 0, 0, 1, 1}, - {&__pyx_n_s__r_b, __pyx_k__r_b, sizeof(__pyx_k__r_b), 0, 0, 1, 1}, - {&__pyx_n_s__rdc, __pyx_k__rdc, sizeof(__pyx_k__rdc), 0, 0, 1, 1}, - {&__pyx_n_s__rect, __pyx_k__rect, sizeof(__pyx_k__rect), 0, 0, 1, 1}, - {&__pyx_n_s__right, __pyx_k__right, sizeof(__pyx_k__right), 0, 0, 1, 1}, - {&__pyx_n_s__side_list, __pyx_k__side_list, sizeof(__pyx_k__side_list), 0, 0, 1, 1}, - {&__pyx_n_s__side_p_list, __pyx_k__side_p_list, sizeof(__pyx_k__side_p_list), 0, 0, 1, 1}, - {&__pyx_n_s__single, __pyx_k__single, sizeof(__pyx_k__single), 0, 0, 1, 1}, - {&__pyx_n_s__sprite, __pyx_k__sprite, sizeof(__pyx_k__sprite), 0, 0, 1, 1}, - {&__pyx_n_s__t, __pyx_k__t, sizeof(__pyx_k__t), 0, 0, 1, 1}, - {&__pyx_n_s__temp_float2, __pyx_k__temp_float2, sizeof(__pyx_k__temp_float2), 0, 0, 1, 1}, - {&__pyx_n_s__temp_side, __pyx_k__temp_side, sizeof(__pyx_k__temp_side), 0, 0, 1, 1}, - {&__pyx_n_s__top, __pyx_k__top, sizeof(__pyx_k__top), 0, 0, 1, 1}, - {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1}, - {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - return 0; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "rabbyt/rabbyt.collisions.pyx":43 - * from _sprites cimport cSprite - * - * def _get_object_data(obj): # <<<<<<<<<<<<<< - * cdef float x,y,brs - * if hasattr(obj, 'x') and hasattr(obj, 'y'): - */ - __pyx_k_tuple_5 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__obj), ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__y), ((PyObject *)__pyx_n_s__brs)); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_5); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - __pyx_k_codeobj_6 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s___get_object_data, 43, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":60 - * return (x,y,brs) - * - * def collide(objects): # <<<<<<<<<<<<<< - * """ - * ``collide(objects) -> list of collisions`` - */ - __pyx_k_tuple_9 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__objects), ((PyObject *)__pyx_n_s__collisions), ((PyObject *)__pyx_n_s__group)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_9); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - __pyx_k_codeobj_10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__collide, 60, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":77 - * - * - * def collide_single(single, objects): # <<<<<<<<<<<<<< - * """ - * ``collide_single(single, objects)`` - */ - __pyx_k_tuple_11 = PyTuple_Pack(12, ((PyObject *)__pyx_n_s__single), ((PyObject *)__pyx_n_s__objects), ((PyObject *)__pyx_n_s__o), ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__y), ((PyObject *)__pyx_n_s__brs), ((PyObject *)__pyx_n_s__dx), ((PyObject *)__pyx_n_s__dy), ((PyObject *)__pyx_n_s__ox), ((PyObject *)__pyx_n_s__oy), ((PyObject *)__pyx_n_s__obrs), ((PyObject *)__pyx_n_s__collisions)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_11); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - __pyx_k_codeobj_12 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__collide_single, 77, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":138 - * return 0 - * - * def rdc(objects, int min_split=1, int max_depth=0): # <<<<<<<<<<<<<< - * """ - * ``rdc(objects, [max_depth,] [min_split]) -> list of collision groups`` - */ - __pyx_k_tuple_13 = PyTuple_Pack(15, ((PyObject *)__pyx_n_s__objects), ((PyObject *)__pyx_n_s__min_split), ((PyObject *)__pyx_n_s__max_depth), ((PyObject *)__pyx_n_s__side_list), ((PyObject *)__pyx_n_s__side_p_list), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__d), ((PyObject *)__pyx_n_s__group_start), ((PyObject *)__pyx_n_s__r), ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__y), ((PyObject *)__pyx_n_s__o), ((PyObject *)__pyx_n_s__groups), ((PyObject *)__pyx_n_s__current_group)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_13); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - __pyx_k_codeobj_14 = (PyObject*)__Pyx_PyCode_New(3, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__rdc, 138, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":285 - * return collisions - * - * def brute_force(objects): # <<<<<<<<<<<<<< - * """ - * ``brute_force(objects) -> list of collisions`` - */ - __pyx_k_tuple_15 = PyTuple_Pack(5, ((PyObject *)__pyx_n_s__objects), ((PyObject *)__pyx_n_s__objs), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__o)); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_15); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - __pyx_k_codeobj_16 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__brute_force, 285, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":320 - * - * - * def collide_groups(group_a, group_b): # <<<<<<<<<<<<<< - * """ - * ``collide_groups(group_a, group_b)`` - */ - __pyx_k_tuple_17 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__group_a), ((PyObject *)__pyx_n_s__group_b), ((PyObject *)__pyx_n_s__c_group_b), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__obj), ((PyObject *)__pyx_n_s__o), ((PyObject *)__pyx_n_s__dx), ((PyObject *)__pyx_n_s__dy), ((PyObject *)__pyx_n_s__collisions)); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_17); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - __pyx_k_codeobj_18 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__collide_groups, 320, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":397 - * return 0 - * - * def aabb_collide(objects): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide(objects)`` - */ - __pyx_k_tuple_19 = PyTuple_Pack(21, ((PyObject *)__pyx_n_s__objects), ((PyObject *)__pyx_n_s__side_list), ((PyObject *)__pyx_n_s__side_p_list), ((PyObject *)__pyx_n_s__temp_side), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__d), ((PyObject *)__pyx_n_s__group_start), ((PyObject *)__pyx_n_s__index), ((PyObject *)__pyx_n_s__temp_float2), ((PyObject *)__pyx_n_s__l), ((PyObject *)__pyx_n_s__t), ((PyObject *)__pyx_n_s__r), ((PyObject *)__pyx_n_s__b), ((PyObject *)__pyx_n_s__rect), ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__y), ((PyObject *)__pyx_n_s__sprite), ((PyObject *)__pyx_n_s__o), ((PyObject *)__pyx_n_s__collisions)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_19); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - __pyx_k_codeobj_20 = (PyObject*)__Pyx_PyCode_New(1, 0, 21, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__aabb_collide, 397, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":470 - * free(side_p_list) - * - * def aabb_collide_single(single, objects): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide_single(single, objects)`` - */ - __pyx_k_tuple_21 = PyTuple_Pack(6, ((PyObject *)__pyx_n_s__single), ((PyObject *)__pyx_n_s__objects), ((PyObject *)__pyx_n_s__r_a), ((PyObject *)__pyx_n_s__r_b), ((PyObject *)__pyx_n_s__o), ((PyObject *)__pyx_n_s__collisions)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_21); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21)); - __pyx_k_codeobj_22 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__aabb_collide_single, 470, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":495 - * return collisions - * - * def aabb_collide_groups(group_a, group_b): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide_groups(group_a, group_b)`` - */ - __pyx_k_tuple_23 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__group_a), ((PyObject *)__pyx_n_s__group_b), ((PyObject *)__pyx_n_s__c_group_b), ((PyObject *)__pyx_n_s__a), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__length), ((PyObject *)__pyx_n_s__o), ((PyObject *)__pyx_n_s__collisions)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_23); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); - __pyx_k_codeobj_24 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_7, __pyx_n_s__aabb_collide_groups, 495, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":531 - * return collisions - * - * __docs_all__ = ('collide', 'collide_single', 'collide_groups', # <<<<<<<<<<<<<< - * 'aabb_collide', 'aabb_collide_single', 'aabb_collide_groups', - * 'rdc', 'brute_force') - */ - __pyx_k_tuple_25 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__collide), ((PyObject *)__pyx_n_s__collide_single), ((PyObject *)__pyx_n_s__collide_groups), ((PyObject *)__pyx_n_s__aabb_collide), ((PyObject *)__pyx_n_s__aabb_collide_single), ((PyObject *)__pyx_n_s__aabb_collide_groups), ((PyObject *)__pyx_n_s__rdc), ((PyObject *)__pyx_n_s__brute_force)); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_k_tuple_25); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initcollisions(void); /*proto*/ -PyMODINIT_FUNC initcollisions(void) -#else -PyMODINIT_FUNC PyInit_collisions(void); /*proto*/ -PyMODINIT_FUNC PyInit_collisions(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_collisions(void)", 0); - if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __Pyx_CyFunction_USED - if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("collisions"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_2), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_d); - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "rabbyt.collisions")) { - if (unlikely(PyDict_SetItemString(modules, "rabbyt.collisions", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__pyx_module_is_main_rabbyt__collisions) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_6rabbyt_10primitives_Quad = __Pyx_ImportType("rabbyt.primitives", "Quad", sizeof(struct __pyx_obj_6rabbyt_10primitives_Quad), 1); if (unlikely(!__pyx_ptype_6rabbyt_10primitives_Quad)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_10primitives_Quad = (struct __pyx_vtabstruct_6rabbyt_10primitives_Quad*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_10primitives_Quad->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_10primitives_Quad)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_cAnimable = __Pyx_ImportType("rabbyt._anims", "cAnimable", sizeof(struct __pyx_obj_6rabbyt_6_anims_cAnimable), 1); if (unlikely(!__pyx_ptype_6rabbyt_6_anims_cAnimable)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_6_anims_cAnimable = (struct __pyx_vtabstruct_6rabbyt_6_anims_cAnimable*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_cAnimable->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_6_anims_cAnimable)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_Anim = __Pyx_ImportType("rabbyt._anims", "Anim", sizeof(struct __pyx_obj_6rabbyt_6_anims_Anim), 1); if (unlikely(!__pyx_ptype_6rabbyt_6_anims_Anim)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_6_anims_Anim = (struct __pyx_vtabstruct_6rabbyt_6_anims_Anim*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_Anim->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_6_anims_Anim)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_6_anims_AnimSlot = __Pyx_ImportType("rabbyt._anims", "AnimSlot", sizeof(struct __pyx_obj_6rabbyt_6_anims_AnimSlot), 1); if (unlikely(!__pyx_ptype_6rabbyt_6_anims_AnimSlot)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_6_anims_AnimSlot = (struct __pyx_vtabstruct_6rabbyt_6_anims_AnimSlot*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_6_anims_AnimSlot->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_6_anims_AnimSlot)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_8_sprites_cBaseSprite = __Pyx_ImportType("rabbyt._sprites", "cBaseSprite", sizeof(struct __pyx_obj_6rabbyt_8_sprites_cBaseSprite), 1); if (unlikely(!__pyx_ptype_6rabbyt_8_sprites_cBaseSprite)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite = (struct __pyx_vtabstruct_6rabbyt_8_sprites_cBaseSprite*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_8_sprites_cBaseSprite->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_8_sprites_cBaseSprite)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_8_sprites_cSprite = __Pyx_ImportType("rabbyt._sprites", "cSprite", sizeof(struct __pyx_obj_6rabbyt_8_sprites_cSprite), 1); if (unlikely(!__pyx_ptype_6rabbyt_8_sprites_cSprite)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_6rabbyt_8_sprites_cSprite = (struct __pyx_vtabstruct_6rabbyt_8_sprites_cSprite*)__Pyx_GetVtable(__pyx_ptype_6rabbyt_8_sprites_cSprite->tp_dict); if (unlikely(!__pyx_vtabptr_6rabbyt_8_sprites_cSprite)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "rabbyt/rabbyt.collisions.pyx":6 - * - * __credits__ = ( - * """ # <<<<<<<<<<<<<< - * Copyright (C) 2007 Matthew Marshall - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____credits__, ((PyObject *)__pyx_kp_s_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":28 - * """) - * - * __author__ = "Matthew Marshall " # <<<<<<<<<<<<<< - * - * cdef extern from "stdlib.h": - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":43 - * from _sprites cimport cSprite - * - * def _get_object_data(obj): # <<<<<<<<<<<<<< - * cdef float x,y,brs - * if hasattr(obj, 'x') and hasattr(obj, 'y'): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_1_get_object_data, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s___get_object_data, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":60 - * return (x,y,brs) - * - * def collide(objects): # <<<<<<<<<<<<<< - * """ - * ``collide(objects) -> list of collisions`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_3collide, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__collide, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":77 - * - * - * def collide_single(single, objects): # <<<<<<<<<<<<<< - * """ - * ``collide_single(single, objects)`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_5collide_single, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__collide_single, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":138 - * return 0 - * - * def rdc(objects, int min_split=1, int max_depth=0): # <<<<<<<<<<<<<< - * """ - * ``rdc(objects, [max_depth,] [min_split]) -> list of collision groups`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_7rdc, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__rdc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":285 - * return collisions - * - * def brute_force(objects): # <<<<<<<<<<<<<< - * """ - * ``brute_force(objects) -> list of collisions`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_9brute_force, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__brute_force, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":320 - * - * - * def collide_groups(group_a, group_b): # <<<<<<<<<<<<<< - * """ - * ``collide_groups(group_a, group_b)`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_11collide_groups, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__collide_groups, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":397 - * return 0 - * - * def aabb_collide(objects): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide(objects)`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_13aabb_collide, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__aabb_collide, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":470 - * free(side_p_list) - * - * def aabb_collide_single(single, objects): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide_single(single, objects)`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_15aabb_collide_single, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__aabb_collide_single, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":495 - * return collisions - * - * def aabb_collide_groups(group_a, group_b): # <<<<<<<<<<<<<< - * """ - * ``aabb_collide_groups(group_a, group_b)`` - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6rabbyt_10collisions_17aabb_collide_groups, NULL, __pyx_n_s_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s__aabb_collide_groups, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.collisions.pyx":531 - * return collisions - * - * __docs_all__ = ('collide', 'collide_single', 'collide_groups', # <<<<<<<<<<<<<< - * 'aabb_collide', 'aabb_collide_single', 'aabb_collide_groups', - * 'rdc', 'brute_force') - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____docs_all__, ((PyObject *)__pyx_k_tuple_25)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.collisions.pyx":1 - * """ # <<<<<<<<<<<<<< - * This module provides some functions for collision detection. - * """ - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - __Pyx_AddTraceback("init rabbyt.collisions", __pyx_clineno, __pyx_lineno, __pyx_filename); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init rabbyt.collisions"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif /* CYTHON_REFNANNY */ - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - return NULL; - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (result) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack", - index, (index == 1) ? "" : "s"); -} - -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -static CYTHON_INLINE long __Pyx_div_long(long a, long b) { - long q = a / b; - long r = a - q*b; - q -= ((r != 0) & ((r ^ b) < 0)); - return q; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_Restore(type, value, tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(type, value, tb); -#endif -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_Format(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { - if (likely(PyList_CheckExact(L))) { - if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return NULL; - Py_INCREF(Py_None); - return Py_None; /* this is just to have an accurate signature */ - } else { - return __Pyx_PyObject_CallMethod1(L, __pyx_n_s__append, x); - } -} - -static void* __Pyx_GetVtable(PyObject *dict) { - void* ptr; - PyObject *ob = PyObject_GetItem(dict, __pyx_n_s____pyx_vtable__); - if (!ob) - goto bad; -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - ptr = PyCapsule_GetPointer(ob, 0); -#else - ptr = PyCObject_AsVoidPtr(ob); -#endif - if (!ptr && !PyErr_Occurred()) - PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type"); - Py_DECREF(ob); - return ptr; -bad: - Py_XDECREF(ob); - return NULL; -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned long)PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (long)PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed long)PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - #if PY_VERSION_HEX < 0x02050000 - return PyErr_Warn(NULL, message); - #else - return PyErr_WarnEx(NULL, message, 1); - #endif - } - return 0; -} - -#ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -#ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%s.%s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - if (PyErr_Warn(NULL, warning) < 0) goto bad; - #else - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - #endif - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", - module_name, class_name); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = (start + end) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, /*int argcount,*/ - 0, /*int kwonlyargcount,*/ - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_globals = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else /* PY_VERSION_HEX < 0x03030000 */ - if (PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_DATA_SIZE(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ - return PyUnicode_AsUTF8AndSize(o, length); -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ -#endif /* PY_VERSION_HEX < 0x03030000 */ - } else -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (r < 0) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred()) - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff --git a/rabbyt/rabbyt.primitives.c b/rabbyt/rabbyt.primitives.c deleted file mode 100644 index a317535..0000000 --- a/rabbyt/rabbyt.primitives.c +++ /dev/null @@ -1,5774 +0,0 @@ -/* Generated by Cython 0.19.2 on Mon Dec 16 21:11:31 2013 */ - -#define PY_SSIZE_T_CLEAN -#ifndef CYTHON_USE_PYLONG_INTERNALS -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 0 -#else -#include "pyconfig.h" -#ifdef PYLONG_BITS_IN_DIGIT -#define CYTHON_USE_PYLONG_INTERNALS 1 -#else -#define CYTHON_USE_PYLONG_INTERNALS 0 -#endif -#endif -#endif -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02040000 - #error Cython requires Python 2.4+. -#else -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION -#define CYTHON_COMPILING_IN_PYPY 1 -#define CYTHON_COMPILING_IN_CPYTHON 0 -#else -#define CYTHON_COMPILING_IN_PYPY 0 -#define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" - #define CYTHON_FORMAT_SSIZE_T "" - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o) - #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ - (PyErr_Format(PyExc_TypeError, \ - "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ - (PyObject*)0)) - #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ - !PyComplex_Check(o)) - #define PyIndex_Check __Pyx_PyIndex_Check - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) - #define __PYX_BUILD_PY_SSIZE_T "i" -#else - #define __PYX_BUILD_PY_SSIZE_T "n" - #define CYTHON_FORMAT_SSIZE_T "z" - #define __Pyx_PyIndex_Check PyIndex_Check -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) - #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) - typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); - typedef void (*releasebufferproc)(PyObject *, Py_buffer *); -#endif -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif -#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6 - #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") -#endif -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#if PY_VERSION_HEX < 0x02060000 - #define Py_TPFLAGS_HAVE_VERSION_TAG 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i])) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ - PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type) -#endif -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_VERSION_HEX < 0x03020000 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and - a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is - a quiet NaN. */ - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE__rabbyt__primitives -#define __PYX_HAVE_API__rabbyt__primitives -#include "include_math.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s) -#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s) -#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s) -#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return u_end - u - 1; -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - const char* default_encoding_c = PyBytes_AS_STRING(default_encoding); - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (ascii_chars_u == NULL) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - } - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params() { - PyObject* sys = NULL; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (sys == NULL) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - if (default_encoding == NULL) goto bad; - default_encoding_c = PyBytes_AS_STRING(default_encoding); - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(sys); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(sys); - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -#ifdef __GNUC__ - /* Test for GCC > 2.95 */ - #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #else /* __GNUC__ > 2 ... */ - #define likely(x) (x) - #define unlikely(x) (x) - #endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "rabbyt.primitives.pyx", - "primitives.pxd", -}; - -/*--- Type declarations ---*/ -struct __pyx_obj_6rabbyt_10primitives_Quad; -struct __pyx_t_6rabbyt_10primitives_Point2d; -struct __pyx_t_6rabbyt_10primitives_float2; - -/* "rabbyt\primitives.pxd":1 - * cdef struct Point2d: # <<<<<<<<<<<<<< - * float x,y - * - */ -struct __pyx_t_6rabbyt_10primitives_Point2d { - float x; - float y; -}; - -/* "rabbyt\primitives.pxd":4 - * float x,y - * - * cdef struct float2: # <<<<<<<<<<<<<< - * float a, b - * - */ -struct __pyx_t_6rabbyt_10primitives_float2 { - float a; - float b; -}; - -/* "rabbyt\primitives.pxd":7 - * float a, b - * - * cdef class Quad: # <<<<<<<<<<<<<< - * cdef Point2d v[4] - * cdef public float bounding_radius - */ -struct __pyx_obj_6rabbyt_10primitives_Quad { - PyObject_HEAD - struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *__pyx_vtab; - struct __pyx_t_6rabbyt_10primitives_Point2d v[4]; - float bounding_radius; -}; - - - -/* "rabbyt/rabbyt.primitives.pyx":38 - * cdef float M_PI - * - * cdef class Quad: # <<<<<<<<<<<<<< - * """ - * ``Quad(definition)`` - */ - -struct __pyx_vtabstruct_6rabbyt_10primitives_Quad { - void (*_shift_x)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float); - void (*_shift_y)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_x)(struct __pyx_obj_6rabbyt_10primitives_Quad *); - struct __pyx_t_6rabbyt_10primitives_float2 (*_bounds_y)(struct __pyx_obj_6rabbyt_10primitives_Quad *); - void (*_update_bounding_radius)(struct __pyx_obj_6rabbyt_10primitives_Quad *); -}; -static struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *__pyx_vtabptr_6rabbyt_10primitives_Quad; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - if (acquire_gil) { \ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - PyGILState_Release(__pyx_gilstate_save); \ - } else { \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil) \ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext() \ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XDECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_XDECREF(tmp); \ - } while (0) -#define __Pyx_DECREF_SET(r, v) do { \ - PyObject *tmp = (PyObject *) r; \ - r = v; __Pyx_DECREF(tmp); \ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ - const char* function_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \ - (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck); - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ - -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 -#endif - -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL) -static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_setattro)) - return tp->tp_setattro(obj, attr_name, value); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_setattr)) - return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); -#endif - return PyObject_SetAttr(obj, attr_name, value); -} -#else -#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) -#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) -#endif - -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_check_binary_version(void); - -typedef struct { - int code_line; - PyCodeObject* code_object; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ - - -/* Module declarations from 'rabbyt.primitives' */ -static PyTypeObject *__pyx_ptype_6rabbyt_10primitives_Quad = 0; -#define __Pyx_MODULE_NAME "rabbyt.primitives" -int __pyx_module_is_main_rabbyt__primitives = 0; - -/* Implementation of 'rabbyt.primitives' */ -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_enumerate; -static PyObject *__pyx_builtin_IndexError; -static int __pyx_pf_6rabbyt_10primitives_4Quad___init__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_definition); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_2__getitem__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, int __pyx_v_i); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_4__setitem__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_value); /* proto */ -static Py_ssize_t __pyx_pf_6rabbyt_10primitives_4Quad_6__len__(CYTHON_UNUSED struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_5width___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_5width_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_6height___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_6height_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_1x___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_1x_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_1y___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_1y_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_2xy___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_2xy_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_4left___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_4left_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_5right___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_5right_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_6bottom___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_6bottom_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_3top___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_3top_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_8__repr__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_15bounding_radius___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self); /* proto */ -static int __pyx_pf_6rabbyt_10primitives_4Quad_15bounding_radius_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ -static PyObject *__pyx_tp_new_6rabbyt_10primitives_Quad(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static char __pyx_k_1[] = "Don't know what to do with %r"; -static char __pyx_k_2[] = "Quad((%r, %r, %r, %r))"; -static char __pyx_k_3[] = "\n The width between the left-most and right-most vertexes.\n\n Assigning to this property will scale all vertexes from the center. So\n the ``x`` property will remain the same, but ``left`` and ``right``\n properties will change.\n "; -static char __pyx_k_4[] = "\n The height between the top-most and bottom-most vertexes.\n\n Assigning to this property will scale all vertexes from the center. So\n the ``y`` property will remain the same, but ``top`` and ``bottom``\n properties will change.\n "; -static char __pyx_k_5[] = "\n Halfway between ``left`` and ``right``.\n "; -static char __pyx_k_6[] = "\n Halfway between ``top`` and ``bottom``.\n "; -static char __pyx_k_7[] = "\n The coordinates of the center of the Quad.\n "; -static char __pyx_k_8[] = " The x coordinate of the left-most point. "; -static char __pyx_k_9[] = " The x coordinate of the right-most point. "; -static char __pyx_k_10[] = " The y coordinate of the bottom-most point. "; -static char __pyx_k_11[] = " The y coordinate of the top-most point. "; -static char __pyx_k_12[] = "\nCopyright (C) 2007 Matthew Marshall\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"; -static char __pyx_k_13[] = "Matthew Marshall "; -static char __pyx_k__x[] = "x"; -static char __pyx_k__y[] = "y"; -static char __pyx_k__Quad[] = "Quad"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__enumerate[] = "enumerate"; -static char __pyx_k__IndexError[] = "IndexError"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k____author__[] = "__author__"; -static char __pyx_k__definition[] = "definition"; -static char __pyx_k____credits__[] = "__credits__"; -static char __pyx_k____setitem__[] = "__setitem__"; -static char __pyx_k____docs_all__[] = "__docs_all__"; -static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_12; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_n_s__IndexError; -static PyObject *__pyx_n_s__Quad; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____author__; -static PyObject *__pyx_n_s____credits__; -static PyObject *__pyx_n_s____docs_all__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____pyx_vtable__; -static PyObject *__pyx_n_s____setitem__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s__definition; -static PyObject *__pyx_n_s__enumerate; -static PyObject *__pyx_n_s__x; -static PyObject *__pyx_n_s__y; -static PyObject *__pyx_int_2; - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_definition = 0; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__definition,0}; - PyObject* values[1] = {0}; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args; - const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); - switch (pos_args) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = PyDict_Size(__pyx_kwds); - switch (pos_args) { - case 0: - if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__definition)) != 0)) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - } - __pyx_v_definition = values[0]; - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad___init__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), __pyx_v_definition); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":67 - * # v defined in the pxd - * - * def __init__(self, definition): # <<<<<<<<<<<<<< - * try: - * definition[0][0] - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad___init__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_definition) { - PyObject *__pyx_v_l = NULL; - PyObject *__pyx_v_r = NULL; - PyObject *__pyx_v_b = NULL; - PyObject *__pyx_v_t = NULL; - PyObject *__pyx_v_d = NULL; - int __pyx_v_i; - PyObject *__pyx_v_v = NULL; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - PyObject *__pyx_t_13 = NULL; - PyObject *__pyx_t_14 = NULL; - PyObject *(*__pyx_t_15)(PyObject *); - PyObject *__pyx_t_16 = NULL; - PyObject *(*__pyx_t_17)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - __Pyx_INCREF(__pyx_v_definition); - - /* "rabbyt/rabbyt.primitives.pyx":68 - * - * def __init__(self, definition): - * try: # <<<<<<<<<<<<<< - * definition[0][0] - * except TypeError: - */ - { - __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3); - __Pyx_XGOTREF(__pyx_t_1); - __Pyx_XGOTREF(__pyx_t_2); - __Pyx_XGOTREF(__pyx_t_3); - /*try:*/ { - - /* "rabbyt/rabbyt.primitives.pyx":69 - * def __init__(self, definition): - * try: - * definition[0][0] # <<<<<<<<<<<<<< - * except TypeError: - * if len(definition) == 2: - */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_definition, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L10_try_end; - __pyx_L3_error:; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":70 - * try: - * definition[0][0] - * except TypeError: # <<<<<<<<<<<<<< - * if len(definition) == 2: - * l = -definition[0]/2 - */ - __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); - if (__pyx_t_6) { - __Pyx_AddTraceback("rabbyt.primitives.Quad.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_7); - - /* "rabbyt/rabbyt.primitives.pyx":71 - * definition[0][0] - * except TypeError: - * if len(definition) == 2: # <<<<<<<<<<<<<< - * l = -definition[0]/2 - * r = definition[0]/2 - */ - __pyx_t_8 = PyObject_Length(__pyx_v_definition); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __pyx_t_9 = ((__pyx_t_8 == 2) != 0); - if (__pyx_t_9) { - - /* "rabbyt/rabbyt.primitives.pyx":72 - * except TypeError: - * if len(definition) == 2: - * l = -definition[0]/2 # <<<<<<<<<<<<<< - * r = definition[0]/2 - * b = -definition[1]/2 - */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_definition, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyNumber_Negative(__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_int_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_l = __pyx_t_10; - __pyx_t_10 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":73 - * if len(definition) == 2: - * l = -definition[0]/2 - * r = definition[0]/2 # <<<<<<<<<<<<<< - * b = -definition[1]/2 - * t = definition[1]/2 - */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_definition, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_10, __pyx_int_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_r = __pyx_t_11; - __pyx_t_11 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":74 - * l = -definition[0]/2 - * r = definition[0]/2 - * b = -definition[1]/2 # <<<<<<<<<<<<<< - * t = definition[1]/2 - * definition = [(l, t), (r, t), (r, b), (l, b)] - */ - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_definition, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = PyNumber_Negative(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_10, __pyx_int_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_v_b = __pyx_t_11; - __pyx_t_11 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":75 - * r = definition[0]/2 - * b = -definition[1]/2 - * t = definition[1]/2 # <<<<<<<<<<<<<< - * definition = [(l, t), (r, t), (r, b), (l, b)] - * elif len(definition) == 4: - */ - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_definition, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_int_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_t = __pyx_t_10; - __pyx_t_10 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":76 - * b = -definition[1]/2 - * t = definition[1]/2 - * definition = [(l, t), (r, t), (r, b), (l, b)] # <<<<<<<<<<<<<< - * elif len(definition) == 4: - * l, t, r, b = definition - */ - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_v_l); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_l); - __Pyx_GIVEREF(__pyx_v_l); - __Pyx_INCREF(__pyx_v_t); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_t); - __Pyx_GIVEREF(__pyx_v_t); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_v_r); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_r); - __Pyx_GIVEREF(__pyx_v_r); - __Pyx_INCREF(__pyx_v_t); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_t); - __Pyx_GIVEREF(__pyx_v_t); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_v_r); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_r); - __Pyx_GIVEREF(__pyx_v_r); - __Pyx_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_b); - __Pyx_GIVEREF(__pyx_v_b); - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_INCREF(__pyx_v_l); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_l); - __Pyx_GIVEREF(__pyx_v_l); - __Pyx_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_b); - __Pyx_GIVEREF(__pyx_v_b); - __pyx_t_14 = PyList_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_14); - PyList_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - PyList_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - PyList_SET_ITEM(__pyx_t_14, 2, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - PyList_SET_ITEM(__pyx_t_14, 3, ((PyObject *)__pyx_t_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_13)); - __pyx_t_10 = 0; - __pyx_t_11 = 0; - __pyx_t_12 = 0; - __pyx_t_13 = 0; - __Pyx_DECREF_SET(__pyx_v_definition, ((PyObject *)__pyx_t_14)); - __pyx_t_14 = 0; - goto __pyx_L13; - } - - /* "rabbyt/rabbyt.primitives.pyx":77 - * t = definition[1]/2 - * definition = [(l, t), (r, t), (r, b), (l, b)] - * elif len(definition) == 4: # <<<<<<<<<<<<<< - * l, t, r, b = definition - * definition = [(l, t), (r, t), (r, b), (l, b)] - */ - __pyx_t_8 = PyObject_Length(__pyx_v_definition); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __pyx_t_9 = ((__pyx_t_8 == 4) != 0); - if (__pyx_t_9) { - - /* "rabbyt/rabbyt.primitives.pyx":78 - * definition = [(l, t), (r, t), (r, b), (l, b)] - * elif len(definition) == 4: - * l, t, r, b = definition # <<<<<<<<<<<<<< - * definition = [(l, t), (r, t), (r, b), (l, b)] - * elif len(definition) == 12: - */ - if ((likely(PyTuple_CheckExact(__pyx_v_definition))) || (PyList_CheckExact(__pyx_v_definition))) { - PyObject* sequence = __pyx_v_definition; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 4)) { - if (size > 4) __Pyx_RaiseTooManyValuesError(4); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); - __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); - __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); - } else { - __pyx_t_14 = PyList_GET_ITEM(sequence, 0); - __pyx_t_13 = PyList_GET_ITEM(sequence, 1); - __pyx_t_12 = PyList_GET_ITEM(sequence, 2); - __pyx_t_11 = PyList_GET_ITEM(sequence, 3); - } - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(__pyx_t_13); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(__pyx_t_11); - #else - Py_ssize_t i; - PyObject** temps[4] = {&__pyx_t_14,&__pyx_t_13,&__pyx_t_12,&__pyx_t_11}; - for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(item); - *(temps[i]) = item; - } - #endif - } else - { - Py_ssize_t index = -1; - PyObject** temps[4] = {&__pyx_t_14,&__pyx_t_13,&__pyx_t_12,&__pyx_t_11}; - __pyx_t_10 = PyObject_GetIter(__pyx_v_definition); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext; - for (index=0; index < 4; index++) { - PyObject* item = __pyx_t_15(__pyx_t_10); if (unlikely(!item)) goto __pyx_L14_unpacking_failed; - __Pyx_GOTREF(item); - *(temps[index]) = item; - } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_10), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __pyx_t_15 = NULL; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - goto __pyx_L15_unpacking_done; - __pyx_L14_unpacking_failed:; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_15 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __pyx_L15_unpacking_done:; - } - __pyx_v_l = __pyx_t_14; - __pyx_t_14 = 0; - __pyx_v_t = __pyx_t_13; - __pyx_t_13 = 0; - __pyx_v_r = __pyx_t_12; - __pyx_t_12 = 0; - __pyx_v_b = __pyx_t_11; - __pyx_t_11 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":79 - * elif len(definition) == 4: - * l, t, r, b = definition - * definition = [(l, t), (r, t), (r, b), (l, b)] # <<<<<<<<<<<<<< - * elif len(definition) == 12: - * # Assume this is in the format of pyglet's tex_coords. - */ - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_INCREF(__pyx_v_l); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_l); - __Pyx_GIVEREF(__pyx_v_l); - __Pyx_INCREF(__pyx_v_t); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_t); - __Pyx_GIVEREF(__pyx_v_t); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_INCREF(__pyx_v_r); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_r); - __Pyx_GIVEREF(__pyx_v_r); - __Pyx_INCREF(__pyx_v_t); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_t); - __Pyx_GIVEREF(__pyx_v_t); - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_13); - __Pyx_INCREF(__pyx_v_r); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_r); - __Pyx_GIVEREF(__pyx_v_r); - __Pyx_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_b); - __Pyx_GIVEREF(__pyx_v_b); - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_INCREF(__pyx_v_l); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_l); - __Pyx_GIVEREF(__pyx_v_l); - __Pyx_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_b); - __Pyx_GIVEREF(__pyx_v_b); - __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - PyList_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - PyList_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - PyList_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_t_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_13)); - PyList_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_t_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_14)); - __pyx_t_11 = 0; - __pyx_t_12 = 0; - __pyx_t_13 = 0; - __pyx_t_14 = 0; - __Pyx_DECREF_SET(__pyx_v_definition, ((PyObject *)__pyx_t_10)); - __pyx_t_10 = 0; - goto __pyx_L13; - } - - /* "rabbyt/rabbyt.primitives.pyx":80 - * l, t, r, b = definition - * definition = [(l, t), (r, t), (r, b), (l, b)] - * elif len(definition) == 12: # <<<<<<<<<<<<<< - * # Assume this is in the format of pyglet's tex_coords. - * d = definition - */ - __pyx_t_8 = PyObject_Length(__pyx_v_definition); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __pyx_t_9 = ((__pyx_t_8 == 12) != 0); - if (__pyx_t_9) { - - /* "rabbyt/rabbyt.primitives.pyx":82 - * elif len(definition) == 12: - * # Assume this is in the format of pyglet's tex_coords. - * d = definition # <<<<<<<<<<<<<< - * definition = [ - * (d[9],d[10]), # l t - */ - __Pyx_INCREF(__pyx_v_definition); - __pyx_v_d = __pyx_v_definition; - - /* "rabbyt/rabbyt.primitives.pyx":84 - * d = definition - * definition = [ - * (d[9],d[10]), # l t # <<<<<<<<<<<<<< - * (d[6],d[7]), # r t - * (d[3],d[4]), # r b - */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_d, 9, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_d, 10, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_13); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_10 = 0; - __pyx_t_14 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":85 - * definition = [ - * (d[9],d[10]), # l t - * (d[6],d[7]), # r t # <<<<<<<<<<<<<< - * (d[3],d[4]), # r b - * (d[0],d[1])] # l b - */ - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_d, 6, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_d, 7, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_14 = 0; - __pyx_t_10 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":86 - * (d[9],d[10]), # l t - * (d[6],d[7]), # r t - * (d[3],d[4]), # r b # <<<<<<<<<<<<<< - * (d[0],d[1])] # l b - * else: - */ - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_d, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_d, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_10 = 0; - __pyx_t_14 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":87 - * (d[6],d[7]), # r t - * (d[3],d[4]), # r b - * (d[0],d[1])] # l b # <<<<<<<<<<<<<< - * else: - * raise ValueError("Don't know what to do with %r" % definition) - */ - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_d, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_d, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); - __Pyx_GIVEREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_14 = 0; - __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - PyList_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_13)); - PyList_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - PyList_SET_ITEM(__pyx_t_10, 2, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - PyList_SET_ITEM(__pyx_t_10, 3, ((PyObject *)__pyx_t_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_16)); - __pyx_t_13 = 0; - __pyx_t_12 = 0; - __pyx_t_11 = 0; - __pyx_t_16 = 0; - __Pyx_DECREF_SET(__pyx_v_definition, ((PyObject *)__pyx_t_10)); - __pyx_t_10 = 0; - goto __pyx_L13; - } - /*else*/ { - - /* "rabbyt/rabbyt.primitives.pyx":89 - * (d[0],d[1])] # l b - * else: - * raise ValueError("Don't know what to do with %r" % definition) # <<<<<<<<<<<<<< - * assert len(definition) == 4 - * cdef int i - */ - __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_definition); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_16); - PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0; - __Pyx_Raise(__pyx_t_10, 0, 0, 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} - } - __pyx_L13:; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L4_exception_handled; - } - __pyx_L5_except_error:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - goto __pyx_L1_error; - __pyx_L4_exception_handled:; - __Pyx_XGIVEREF(__pyx_t_1); - __Pyx_XGIVEREF(__pyx_t_2); - __Pyx_XGIVEREF(__pyx_t_3); - __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3); - __pyx_L10_try_end:; - } - - /* "rabbyt/rabbyt.primitives.pyx":90 - * else: - * raise ValueError("Don't know what to do with %r" % definition) - * assert len(definition) == 4 # <<<<<<<<<<<<<< - * cdef int i - * for i, v in enumerate(definition): - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - __pyx_t_8 = PyObject_Length(__pyx_v_definition); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (unlikely(!((__pyx_t_8 == 4) != 0))) { - PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #endif - - /* "rabbyt/rabbyt.primitives.pyx":92 - * assert len(definition) == 4 - * cdef int i - * for i, v in enumerate(definition): # <<<<<<<<<<<<<< - * self.__setitem__(i, v) - * self._update_bounding_radius() - */ - __pyx_t_6 = 0; - if (PyList_CheckExact(__pyx_v_definition) || PyTuple_CheckExact(__pyx_v_definition)) { - __pyx_t_7 = __pyx_v_definition; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; - __pyx_t_17 = NULL; - } else { - __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_definition); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; - } - for (;;) { - if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_7)) { - if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_7)) { - if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #else - __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - } else { - __pyx_t_4 = __pyx_t_17(__pyx_t_7); - if (unlikely(!__pyx_t_4)) { - if (PyErr_Occurred()) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); - else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_v_i = __pyx_t_6; - __pyx_t_6 = (__pyx_t_6 + 1); - - /* "rabbyt/rabbyt.primitives.pyx":93 - * cdef int i - * for i, v in enumerate(definition): - * self.__setitem__(i, v) # <<<<<<<<<<<<<< - * self._update_bounding_radius() - * - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____setitem__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __Pyx_INCREF(__pyx_v_v); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_v); - __Pyx_GIVEREF(__pyx_v_v); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":94 - * for i, v in enumerate(definition): - * self.__setitem__(i, v) - * self._update_bounding_radius() # <<<<<<<<<<<<<< - * - * def __getitem__(self, int i): - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_update_bounding_radius(__pyx_v_self); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_XDECREF(__pyx_t_13); - __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_16); - __Pyx_AddTraceback("rabbyt.primitives.Quad.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_l); - __Pyx_XDECREF(__pyx_v_r); - __Pyx_XDECREF(__pyx_v_b); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_XDECREF(__pyx_v_d); - __Pyx_XDECREF(__pyx_v_v); - __Pyx_XDECREF(__pyx_v_definition); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_i) { - int __pyx_v_i; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - assert(__pyx_arg_i); { - __pyx_v_i = __Pyx_PyInt_AsInt(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_2__getitem__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((int)__pyx_v_i)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":96 - * self._update_bounding_radius() - * - * def __getitem__(self, int i): # <<<<<<<<<<<<<< - * if i < 0: - * i = 4 + i - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_2__getitem__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, int __pyx_v_i) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":97 - * - * def __getitem__(self, int i): - * if i < 0: # <<<<<<<<<<<<<< - * i = 4 + i - * if i < 0 or i >= 4: - */ - __pyx_t_1 = ((__pyx_v_i < 0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt.primitives.pyx":98 - * def __getitem__(self, int i): - * if i < 0: - * i = 4 + i # <<<<<<<<<<<<<< - * if i < 0 or i >= 4: - * raise IndexError(i) - */ - __pyx_v_i = (4 + __pyx_v_i); - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt.primitives.pyx":99 - * if i < 0: - * i = 4 + i - * if i < 0 or i >= 4: # <<<<<<<<<<<<<< - * raise IndexError(i) - * return self.v[i].x, self.v[i].y - */ - __pyx_t_1 = ((__pyx_v_i < 0) != 0); - if (!__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_i >= 4) != 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.primitives.pyx":100 - * i = 4 + i - * if i < 0 or i >= 4: - * raise IndexError(i) # <<<<<<<<<<<<<< - * return self.v[i].x, self.v[i].y - * def __setitem__(self, int i, value): - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt.primitives.pyx":101 - * if i < 0 or i >= 4: - * raise IndexError(i) - * return self.v[i].x, self.v[i].y # <<<<<<<<<<<<<< - * def __setitem__(self, int i, value): - * if i < 0: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->v[__pyx_v_i]).x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->v[__pyx_v_i]).y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_r = ((PyObject *)__pyx_t_6); - __pyx_t_6 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("rabbyt.primitives.Quad.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_i, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_i, PyObject *__pyx_v_value) { - int __pyx_v_i; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - assert(__pyx_arg_i); { - __pyx_v_i = __Pyx_PyInt_AsInt(__pyx_arg_i); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_4__setitem__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((int)__pyx_v_i), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":102 - * raise IndexError(i) - * return self.v[i].x, self.v[i].y - * def __setitem__(self, int i, value): # <<<<<<<<<<<<<< - * if i < 0: - * i = 4 + i - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_4__setitem__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, int __pyx_v_i, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - float __pyx_t_6; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setitem__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":103 - * return self.v[i].x, self.v[i].y - * def __setitem__(self, int i, value): - * if i < 0: # <<<<<<<<<<<<<< - * i = 4 + i - * if i < 0 or i >= 4: - */ - __pyx_t_1 = ((__pyx_v_i < 0) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt.primitives.pyx":104 - * def __setitem__(self, int i, value): - * if i < 0: - * i = 4 + i # <<<<<<<<<<<<<< - * if i < 0 or i >= 4: - * raise IndexError(i) - */ - __pyx_v_i = (4 + __pyx_v_i); - goto __pyx_L3; - } - __pyx_L3:; - - /* "rabbyt/rabbyt.primitives.pyx":105 - * if i < 0: - * i = 4 + i - * if i < 0 or i >= 4: # <<<<<<<<<<<<<< - * raise IndexError(i) - * self.v[i].x = value[0] - */ - __pyx_t_1 = ((__pyx_v_i < 0) != 0); - if (!__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_i >= 4) != 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.primitives.pyx":106 - * i = 4 + i - * if i < 0 or i >= 4: - * raise IndexError(i) # <<<<<<<<<<<<<< - * self.v[i].x = value[0] - * self.v[i].y = value[1] - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "rabbyt/rabbyt.primitives.pyx":107 - * if i < 0 or i >= 4: - * raise IndexError(i) - * self.v[i].x = value[0] # <<<<<<<<<<<<<< - * self.v[i].y = value[1] - * - */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_value, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - (__pyx_v_self->v[__pyx_v_i]).x = __pyx_t_6; - - /* "rabbyt/rabbyt.primitives.pyx":108 - * raise IndexError(i) - * self.v[i].x = value[0] - * self.v[i].y = value[1] # <<<<<<<<<<<<<< - * - * def __len__(self): - */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_value, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - (__pyx_v_self->v[__pyx_v_i]).y = __pyx_t_6; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rabbyt.primitives.Quad.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static Py_ssize_t __pyx_pw_6rabbyt_10primitives_4Quad_7__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pw_6rabbyt_10primitives_4Quad_7__len__(PyObject *__pyx_v_self) { - Py_ssize_t __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_6__len__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":110 - * self.v[i].y = value[1] - * - * def __len__(self): # <<<<<<<<<<<<<< - * return 4 - * - */ - -static Py_ssize_t __pyx_pf_6rabbyt_10primitives_4Quad_6__len__(CYTHON_UNUSED struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - Py_ssize_t __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__len__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":111 - * - * def __len__(self): - * return 4 # <<<<<<<<<<<<<< - * - * cdef void _shift_x(self, float offset): - */ - __pyx_r = 4; - goto __pyx_L0; - - __pyx_r = 0; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":113 - * return 4 - * - * cdef void _shift_x(self, float offset): # <<<<<<<<<<<<<< - * for i from 0 <= i < 4: - * self.v[i].x = self.v[i].x + offset - */ - -static void __pyx_f_6rabbyt_10primitives_4Quad__shift_x(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_offset) { - long __pyx_v_i; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_shift_x", 0); - - /* "rabbyt/rabbyt.primitives.pyx":114 - * - * cdef void _shift_x(self, float offset): - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * self.v[i].x = self.v[i].x + offset - * - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.primitives.pyx":115 - * cdef void _shift_x(self, float offset): - * for i from 0 <= i < 4: - * self.v[i].x = self.v[i].x + offset # <<<<<<<<<<<<<< - * - * cdef void _shift_y(self, float offset): - */ - (__pyx_v_self->v[__pyx_v_i]).x = ((__pyx_v_self->v[__pyx_v_i]).x + __pyx_v_offset); - } - - __Pyx_RefNannyFinishContext(); -} - -/* "rabbyt/rabbyt.primitives.pyx":117 - * self.v[i].x = self.v[i].x + offset - * - * cdef void _shift_y(self, float offset): # <<<<<<<<<<<<<< - * for i from 0 <= i < 4: - * self.v[i].y = self.v[i].y + offset - */ - -static void __pyx_f_6rabbyt_10primitives_4Quad__shift_y(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_offset) { - long __pyx_v_i; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_shift_y", 0); - - /* "rabbyt/rabbyt.primitives.pyx":118 - * - * cdef void _shift_y(self, float offset): - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * self.v[i].y = self.v[i].y + offset - * - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.primitives.pyx":119 - * cdef void _shift_y(self, float offset): - * for i from 0 <= i < 4: - * self.v[i].y = self.v[i].y + offset # <<<<<<<<<<<<<< - * - * property width: - */ - (__pyx_v_self->v[__pyx_v_i]).y = ((__pyx_v_self->v[__pyx_v_i]).y + __pyx_v_offset); - } - - __Pyx_RefNannyFinishContext(); -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_5width_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_5width_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_5width___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":129 - * properties will change. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float2 b - * b = self._bounds_x() - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_5width___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_b; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":131 - * def __get__(self): - * cdef float2 b - * b = self._bounds_x() # <<<<<<<<<<<<<< - * return b.b - b.a - * def __set__(self, float value): - */ - __pyx_v_b = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":132 - * cdef float2 b - * b = self._bounds_x() - * return b.b - b.a # <<<<<<<<<<<<<< - * def __set__(self, float value): - * cdef float scale, center - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_b.b - __pyx_v_b.a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { - float __pyx_v_value; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_value); { - __pyx_v_value = __pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_5width_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((float)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":133 - * b = self._bounds_x() - * return b.b - b.a - * def __set__(self, float value): # <<<<<<<<<<<<<< - * cdef float scale, center - * cdef float2 bounds - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_5width_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_value) { - float __pyx_v_scale; - float __pyx_v_center; - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_bounds; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - float __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":137 - * cdef float2 bounds - * cdef int i - * bounds = self._bounds_x() # <<<<<<<<<<<<<< - * center = (bounds.a + bounds.b)/2 - * if bounds.a == bounds.b: - */ - __pyx_v_bounds = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":138 - * cdef int i - * bounds = self._bounds_x() - * center = (bounds.a + bounds.b)/2 # <<<<<<<<<<<<<< - * if bounds.a == bounds.b: - * self.v[0].x = self.v[3].x = center-value/2 - */ - __pyx_v_center = ((__pyx_v_bounds.a + __pyx_v_bounds.b) / 2.0); - - /* "rabbyt/rabbyt.primitives.pyx":139 - * bounds = self._bounds_x() - * center = (bounds.a + bounds.b)/2 - * if bounds.a == bounds.b: # <<<<<<<<<<<<<< - * self.v[0].x = self.v[3].x = center-value/2 - * self.v[1].x = self.v[2].x = center+value/2 - */ - __pyx_t_1 = ((__pyx_v_bounds.a == __pyx_v_bounds.b) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt.primitives.pyx":140 - * center = (bounds.a + bounds.b)/2 - * if bounds.a == bounds.b: - * self.v[0].x = self.v[3].x = center-value/2 # <<<<<<<<<<<<<< - * self.v[1].x = self.v[2].x = center+value/2 - * else: - */ - __pyx_t_2 = (__pyx_v_center - (__pyx_v_value / 2.0)); - (__pyx_v_self->v[0]).x = __pyx_t_2; - (__pyx_v_self->v[3]).x = __pyx_t_2; - - /* "rabbyt/rabbyt.primitives.pyx":141 - * if bounds.a == bounds.b: - * self.v[0].x = self.v[3].x = center-value/2 - * self.v[1].x = self.v[2].x = center+value/2 # <<<<<<<<<<<<<< - * else: - * scale = value/(bounds.b - bounds.a) - */ - __pyx_t_2 = (__pyx_v_center + (__pyx_v_value / 2.0)); - (__pyx_v_self->v[1]).x = __pyx_t_2; - (__pyx_v_self->v[2]).x = __pyx_t_2; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt.primitives.pyx":143 - * self.v[1].x = self.v[2].x = center+value/2 - * else: - * scale = value/(bounds.b - bounds.a) # <<<<<<<<<<<<<< - * for i from 0 <= i < 4: - * self.v[i].x = (self.v[i].x - center) * scale + center - */ - __pyx_t_2 = (__pyx_v_bounds.b - __pyx_v_bounds.a); - if (unlikely(__pyx_t_2 == 0)) { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_scale = (__pyx_v_value / __pyx_t_2); - - /* "rabbyt/rabbyt.primitives.pyx":144 - * else: - * scale = value/(bounds.b - bounds.a) - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * self.v[i].x = (self.v[i].x - center) * scale + center - * self._update_bounding_radius() - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.primitives.pyx":145 - * scale = value/(bounds.b - bounds.a) - * for i from 0 <= i < 4: - * self.v[i].x = (self.v[i].x - center) * scale + center # <<<<<<<<<<<<<< - * self._update_bounding_radius() - * - */ - (__pyx_v_self->v[__pyx_v_i]).x = ((((__pyx_v_self->v[__pyx_v_i]).x - __pyx_v_center) * __pyx_v_scale) + __pyx_v_center); - } - } - __pyx_L3:; - - /* "rabbyt/rabbyt.primitives.pyx":146 - * for i from 0 <= i < 4: - * self.v[i].x = (self.v[i].x - center) * scale + center - * self._update_bounding_radius() # <<<<<<<<<<<<<< - * - * property height: - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_update_bounding_radius(__pyx_v_self); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_6height_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_6height_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_6height___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":156 - * properties will change. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float2 b - * b = self._bounds_y() - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_6height___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_b; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":158 - * def __get__(self): - * cdef float2 b - * b = self._bounds_y() # <<<<<<<<<<<<<< - * return b.b - b.a - * def __set__(self, float value): - */ - __pyx_v_b = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":159 - * cdef float2 b - * b = self._bounds_y() - * return b.b - b.a # <<<<<<<<<<<<<< - * def __set__(self, float value): - * cdef float scale, center - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble((__pyx_v_b.b - __pyx_v_b.a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { - float __pyx_v_value; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_value); { - __pyx_v_value = __pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_6height_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((float)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":160 - * b = self._bounds_y() - * return b.b - b.a - * def __set__(self, float value): # <<<<<<<<<<<<<< - * cdef float scale, center - * cdef float2 bounds - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_6height_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_value) { - float __pyx_v_scale; - float __pyx_v_center; - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_bounds; - int __pyx_v_i; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - float __pyx_t_2; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":164 - * cdef float2 bounds - * cdef int i - * bounds = self._bounds_y() # <<<<<<<<<<<<<< - * center = (bounds.a + bounds.b)/2 - * if bounds.a == bounds.b: - */ - __pyx_v_bounds = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":165 - * cdef int i - * bounds = self._bounds_y() - * center = (bounds.a + bounds.b)/2 # <<<<<<<<<<<<<< - * if bounds.a == bounds.b: - * self.v[0].y = self.v[1].y = center+value/2 - */ - __pyx_v_center = ((__pyx_v_bounds.a + __pyx_v_bounds.b) / 2.0); - - /* "rabbyt/rabbyt.primitives.pyx":166 - * bounds = self._bounds_y() - * center = (bounds.a + bounds.b)/2 - * if bounds.a == bounds.b: # <<<<<<<<<<<<<< - * self.v[0].y = self.v[1].y = center+value/2 - * self.v[2].y = self.v[3].y = center-value/2 - */ - __pyx_t_1 = ((__pyx_v_bounds.a == __pyx_v_bounds.b) != 0); - if (__pyx_t_1) { - - /* "rabbyt/rabbyt.primitives.pyx":167 - * center = (bounds.a + bounds.b)/2 - * if bounds.a == bounds.b: - * self.v[0].y = self.v[1].y = center+value/2 # <<<<<<<<<<<<<< - * self.v[2].y = self.v[3].y = center-value/2 - * else: - */ - __pyx_t_2 = (__pyx_v_center + (__pyx_v_value / 2.0)); - (__pyx_v_self->v[0]).y = __pyx_t_2; - (__pyx_v_self->v[1]).y = __pyx_t_2; - - /* "rabbyt/rabbyt.primitives.pyx":168 - * if bounds.a == bounds.b: - * self.v[0].y = self.v[1].y = center+value/2 - * self.v[2].y = self.v[3].y = center-value/2 # <<<<<<<<<<<<<< - * else: - * scale = value/(bounds.b - bounds.a) - */ - __pyx_t_2 = (__pyx_v_center - (__pyx_v_value / 2.0)); - (__pyx_v_self->v[2]).y = __pyx_t_2; - (__pyx_v_self->v[3]).y = __pyx_t_2; - goto __pyx_L3; - } - /*else*/ { - - /* "rabbyt/rabbyt.primitives.pyx":170 - * self.v[2].y = self.v[3].y = center-value/2 - * else: - * scale = value/(bounds.b - bounds.a) # <<<<<<<<<<<<<< - * for i from 0 <= i < 4: - * self.v[i].y = (self.v[i].y - center) * scale + center - */ - __pyx_t_2 = (__pyx_v_bounds.b - __pyx_v_bounds.a); - if (unlikely(__pyx_t_2 == 0)) { - #ifdef WITH_THREAD - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); - #endif - PyErr_Format(PyExc_ZeroDivisionError, "float division"); - #ifdef WITH_THREAD - PyGILState_Release(__pyx_gilstate_save); - #endif - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_v_scale = (__pyx_v_value / __pyx_t_2); - - /* "rabbyt/rabbyt.primitives.pyx":171 - * else: - * scale = value/(bounds.b - bounds.a) - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * self.v[i].y = (self.v[i].y - center) * scale + center - * self._update_bounding_radius() - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.primitives.pyx":172 - * scale = value/(bounds.b - bounds.a) - * for i from 0 <= i < 4: - * self.v[i].y = (self.v[i].y - center) * scale + center # <<<<<<<<<<<<<< - * self._update_bounding_radius() - * - */ - (__pyx_v_self->v[__pyx_v_i]).y = ((((__pyx_v_self->v[__pyx_v_i]).y - __pyx_v_center) * __pyx_v_scale) + __pyx_v_center); - } - } - __pyx_L3:; - - /* "rabbyt/rabbyt.primitives.pyx":173 - * for i from 0 <= i < 4: - * self.v[i].y = (self.v[i].y - center) * scale + center - * self._update_bounding_radius() # <<<<<<<<<<<<<< - * - * property x: - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_update_bounding_radius(__pyx_v_self); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_1x_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_1x_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_1x___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":179 - * Halfway between ``left`` and ``right``. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float2 b - * b = self._bounds_x() - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_1x___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_b; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":181 - * def __get__(self): - * cdef float2 b - * b = self._bounds_x() # <<<<<<<<<<<<<< - * return (b.a + b.b)/2 - * def __set__(self, float value): - */ - __pyx_v_b = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":182 - * cdef float2 b - * b = self._bounds_x() - * return (b.a + b.b)/2 # <<<<<<<<<<<<<< - * def __set__(self, float value): - * cdef float2 current - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_b.a + __pyx_v_b.b) / 2.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) { - float __pyx_v_value; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_value); { - __pyx_v_value = __pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.x.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_1x_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((float)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":183 - * b = self._bounds_x() - * return (b.a + b.b)/2 - * def __set__(self, float value): # <<<<<<<<<<<<<< - * cdef float2 current - * current = self._bounds_x() - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_1x_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_value) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_current; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":185 - * def __set__(self, float value): - * cdef float2 current - * current = self._bounds_x() # <<<<<<<<<<<<<< - * self._shift_x(value - (current.a + current.b)/2) - * - */ - __pyx_v_current = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":186 - * cdef float2 current - * current = self._bounds_x() - * self._shift_x(value - (current.a + current.b)/2) # <<<<<<<<<<<<<< - * - * property y: - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_shift_x(__pyx_v_self, (__pyx_v_value - ((__pyx_v_current.a + __pyx_v_current.b) / 2.0))); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_1y_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_1y_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_1y___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":192 - * Halfway between ``top`` and ``bottom``. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * cdef float2 b - * b = self._bounds_y() - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_1y___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_b; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":194 - * def __get__(self): - * cdef float2 b - * b = self._bounds_y() # <<<<<<<<<<<<<< - * return (b.a + b.b)/2 - * def __set__(self, value): - */ - __pyx_v_b = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":195 - * cdef float2 b - * b = self._bounds_y() - * return (b.a + b.b)/2 # <<<<<<<<<<<<<< - * def __set__(self, value): - * cdef float2 current - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_b.a + __pyx_v_b.b) / 2.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_1y_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":196 - * b = self._bounds_y() - * return (b.a + b.b)/2 - * def __set__(self, value): # <<<<<<<<<<<<<< - * cdef float2 current - * current = self._bounds_y() - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_1y_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_value) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_current; - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - float __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":198 - * def __set__(self, value): - * cdef float2 current - * current = self._bounds_y() # <<<<<<<<<<<<<< - * self._shift_y(value - (current.a + current.b)/2) - * - */ - __pyx_v_current = ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self); - - /* "rabbyt/rabbyt.primitives.pyx":199 - * cdef float2 current - * current = self._bounds_y() - * self._shift_y(value - (current.a + current.b)/2) # <<<<<<<<<<<<<< - * - * property xy: - */ - __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_current.a + __pyx_v_current.b) / 2.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_value, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_shift_y(__pyx_v_self, __pyx_t_3); - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("rabbyt.primitives.Quad.y.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_2xy_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_2xy_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_2xy___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":205 - * The coordinates of the center of the Quad. - * """ - * def __get__(self): # <<<<<<<<<<<<<< - * return (self.x, self.y) - * def __set__(self, value): - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_2xy___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":206 - * """ - * def __get__(self): - * return (self.x, self.y) # <<<<<<<<<<<<<< - * def __set__(self, value): - * self.x, self.y = value - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt.primitives.Quad.xy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_2xy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_2xy_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_2xy_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":207 - * def __get__(self): - * return (self.x, self.y) - * def __set__(self, value): # <<<<<<<<<<<<<< - * self.x, self.y = value - * - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_2xy_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *(*__pyx_t_4)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":208 - * return (self.x, self.y) - * def __set__(self, value): - * self.x, self.y = value # <<<<<<<<<<<<<< - * - * cdef float2 _bounds_x(self): - */ - if ((likely(PyTuple_CheckExact(__pyx_v_value))) || (PyList_CheckExact(__pyx_v_value))) { - PyObject* sequence = __pyx_v_value; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - #if CYTHON_COMPILING_IN_CPYTHON - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_1 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - #endif - } else - { - Py_ssize_t index = -1; - __pyx_t_3 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; - index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_1); - index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = NULL; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L4_unpacking_done; - __pyx_L3_unpacking_failed:; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_L4_unpacking_done:; - } - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__x, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__y, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("rabbyt.primitives.Quad.xy.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":210 - * self.x, self.y = value - * - * cdef float2 _bounds_x(self): # <<<<<<<<<<<<<< - * cdef float2 bounds - * cdef float x - */ - -static struct __pyx_t_6rabbyt_10primitives_float2 __pyx_f_6rabbyt_10primitives_4Quad__bounds_x(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_bounds; - float __pyx_v_x; - int __pyx_v_i; - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("_bounds_x", 0); - - /* "rabbyt/rabbyt.primitives.pyx":214 - * cdef float x - * cdef int i - * bounds.a = bounds.b = self.v[0].x # <<<<<<<<<<<<<< - * for i from 1 <= i < 4: - * x = self.v[i].x - */ - __pyx_v_bounds.a = (__pyx_v_self->v[0]).x; - __pyx_v_bounds.b = (__pyx_v_self->v[0]).x; - - /* "rabbyt/rabbyt.primitives.pyx":215 - * cdef int i - * bounds.a = bounds.b = self.v[0].x - * for i from 1 <= i < 4: # <<<<<<<<<<<<<< - * x = self.v[i].x - * if bounds.a > x: - */ - for (__pyx_v_i = 1; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.primitives.pyx":216 - * bounds.a = bounds.b = self.v[0].x - * for i from 1 <= i < 4: - * x = self.v[i].x # <<<<<<<<<<<<<< - * if bounds.a > x: - * bounds.a = x - */ - __pyx_t_1 = (__pyx_v_self->v[__pyx_v_i]).x; - __pyx_v_x = __pyx_t_1; - - /* "rabbyt/rabbyt.primitives.pyx":217 - * for i from 1 <= i < 4: - * x = self.v[i].x - * if bounds.a > x: # <<<<<<<<<<<<<< - * bounds.a = x - * if bounds.b < x: - */ - __pyx_t_2 = ((__pyx_v_bounds.a > __pyx_v_x) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.primitives.pyx":218 - * x = self.v[i].x - * if bounds.a > x: - * bounds.a = x # <<<<<<<<<<<<<< - * if bounds.b < x: - * bounds.b = x - */ - __pyx_v_bounds.a = __pyx_v_x; - goto __pyx_L5; - } - __pyx_L5:; - - /* "rabbyt/rabbyt.primitives.pyx":219 - * if bounds.a > x: - * bounds.a = x - * if bounds.b < x: # <<<<<<<<<<<<<< - * bounds.b = x - * return bounds - */ - __pyx_t_2 = ((__pyx_v_bounds.b < __pyx_v_x) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.primitives.pyx":220 - * bounds.a = x - * if bounds.b < x: - * bounds.b = x # <<<<<<<<<<<<<< - * return bounds - * - */ - __pyx_v_bounds.b = __pyx_v_x; - goto __pyx_L6; - } - __pyx_L6:; - } - - /* "rabbyt/rabbyt.primitives.pyx":221 - * if bounds.b < x: - * bounds.b = x - * return bounds # <<<<<<<<<<<<<< - * - * cdef float2 _bounds_y(self): - */ - __pyx_r = __pyx_v_bounds; - goto __pyx_L0; - - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":223 - * return bounds - * - * cdef float2 _bounds_y(self): # <<<<<<<<<<<<<< - * cdef float2 bounds - * cdef float y - */ - -static struct __pyx_t_6rabbyt_10primitives_float2 __pyx_f_6rabbyt_10primitives_4Quad__bounds_y(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_v_bounds; - float __pyx_v_y; - int __pyx_v_i; - struct __pyx_t_6rabbyt_10primitives_float2 __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("_bounds_y", 0); - - /* "rabbyt/rabbyt.primitives.pyx":227 - * cdef float y - * cdef int i - * bounds.a = bounds.b = self.v[0].y # <<<<<<<<<<<<<< - * for i from 1 <= i < 4: - * y = self.v[i].y - */ - __pyx_v_bounds.a = (__pyx_v_self->v[0]).y; - __pyx_v_bounds.b = (__pyx_v_self->v[0]).y; - - /* "rabbyt/rabbyt.primitives.pyx":228 - * cdef int i - * bounds.a = bounds.b = self.v[0].y - * for i from 1 <= i < 4: # <<<<<<<<<<<<<< - * y = self.v[i].y - * if bounds.a > y: - */ - for (__pyx_v_i = 1; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.primitives.pyx":229 - * bounds.a = bounds.b = self.v[0].y - * for i from 1 <= i < 4: - * y = self.v[i].y # <<<<<<<<<<<<<< - * if bounds.a > y: - * bounds.a = y - */ - __pyx_t_1 = (__pyx_v_self->v[__pyx_v_i]).y; - __pyx_v_y = __pyx_t_1; - - /* "rabbyt/rabbyt.primitives.pyx":230 - * for i from 1 <= i < 4: - * y = self.v[i].y - * if bounds.a > y: # <<<<<<<<<<<<<< - * bounds.a = y - * if bounds.b < y: - */ - __pyx_t_2 = ((__pyx_v_bounds.a > __pyx_v_y) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.primitives.pyx":231 - * y = self.v[i].y - * if bounds.a > y: - * bounds.a = y # <<<<<<<<<<<<<< - * if bounds.b < y: - * bounds.b = y - */ - __pyx_v_bounds.a = __pyx_v_y; - goto __pyx_L5; - } - __pyx_L5:; - - /* "rabbyt/rabbyt.primitives.pyx":232 - * if bounds.a > y: - * bounds.a = y - * if bounds.b < y: # <<<<<<<<<<<<<< - * bounds.b = y - * return bounds - */ - __pyx_t_2 = ((__pyx_v_bounds.b < __pyx_v_y) != 0); - if (__pyx_t_2) { - - /* "rabbyt/rabbyt.primitives.pyx":233 - * bounds.a = y - * if bounds.b < y: - * bounds.b = y # <<<<<<<<<<<<<< - * return bounds - * - */ - __pyx_v_bounds.b = __pyx_v_y; - goto __pyx_L6; - } - __pyx_L6:; - } - - /* "rabbyt/rabbyt.primitives.pyx":234 - * if bounds.b < y: - * bounds.b = y - * return bounds # <<<<<<<<<<<<<< - * - * property left: - */ - __pyx_r = __pyx_v_bounds; - goto __pyx_L0; - - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_4left_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_4left_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_4left___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":238 - * property left: - * """ The x coordinate of the left-most point. """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._bounds_x().a - * def __set__(self, float v): - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_4left___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":239 - * """ The x coordinate of the left-most point. """ - * def __get__(self): - * return self._bounds_x().a # <<<<<<<<<<<<<< - * def __set__(self, float v): - * self._shift_x(v - self._bounds_x().a) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self).a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { - float __pyx_v_v; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_v); { - __pyx_v_v = __pyx_PyFloat_AsFloat(__pyx_arg_v); if (unlikely((__pyx_v_v == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_4left_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((float)__pyx_v_v)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":240 - * def __get__(self): - * return self._bounds_x().a - * def __set__(self, float v): # <<<<<<<<<<<<<< - * self._shift_x(v - self._bounds_x().a) - * self._update_bounding_radius() - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_4left_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":241 - * return self._bounds_x().a - * def __set__(self, float v): - * self._shift_x(v - self._bounds_x().a) # <<<<<<<<<<<<<< - * self._update_bounding_radius() - * - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_shift_x(__pyx_v_self, (__pyx_v_v - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self).a)); - - /* "rabbyt/rabbyt.primitives.pyx":242 - * def __set__(self, float v): - * self._shift_x(v - self._bounds_x().a) - * self._update_bounding_radius() # <<<<<<<<<<<<<< - * - * property right: - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_update_bounding_radius(__pyx_v_self); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_5right_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_5right_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_5right___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":246 - * property right: - * """ The x coordinate of the right-most point. """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._bounds_x().b - * def __set__(self, float v): - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_5right___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":247 - * """ The x coordinate of the right-most point. """ - * def __get__(self): - * return self._bounds_x().b # <<<<<<<<<<<<<< - * def __set__(self, float v): - * self._shift_x(v - self._bounds_x().b) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self).b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { - float __pyx_v_v; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_v); { - __pyx_v_v = __pyx_PyFloat_AsFloat(__pyx_arg_v); if (unlikely((__pyx_v_v == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_5right_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((float)__pyx_v_v)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":248 - * def __get__(self): - * return self._bounds_x().b - * def __set__(self, float v): # <<<<<<<<<<<<<< - * self._shift_x(v - self._bounds_x().b) - * self._update_bounding_radius() - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_5right_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":249 - * return self._bounds_x().b - * def __set__(self, float v): - * self._shift_x(v - self._bounds_x().b) # <<<<<<<<<<<<<< - * self._update_bounding_radius() - * - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_shift_x(__pyx_v_self, (__pyx_v_v - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_x(__pyx_v_self).b)); - - /* "rabbyt/rabbyt.primitives.pyx":250 - * def __set__(self, float v): - * self._shift_x(v - self._bounds_x().b) - * self._update_bounding_radius() # <<<<<<<<<<<<<< - * - * property bottom: - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_update_bounding_radius(__pyx_v_self); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_6bottom_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_6bottom_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_6bottom___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":254 - * property bottom: - * """ The y coordinate of the bottom-most point. """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._bounds_y().a - * def __set__(self, float v): - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_6bottom___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":255 - * """ The y coordinate of the bottom-most point. """ - * def __get__(self): - * return self._bounds_y().a # <<<<<<<<<<<<<< - * def __set__(self, float v): - * self._shift_y(v - self._bounds_y().a) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self).a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { - float __pyx_v_v; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_v); { - __pyx_v_v = __pyx_PyFloat_AsFloat(__pyx_arg_v); if (unlikely((__pyx_v_v == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.bottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_6bottom_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((float)__pyx_v_v)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":256 - * def __get__(self): - * return self._bounds_y().a - * def __set__(self, float v): # <<<<<<<<<<<<<< - * self._shift_y(v - self._bounds_y().a) - * self._update_bounding_radius() - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_6bottom_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":257 - * return self._bounds_y().a - * def __set__(self, float v): - * self._shift_y(v - self._bounds_y().a) # <<<<<<<<<<<<<< - * self._update_bounding_radius() - * - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_shift_y(__pyx_v_self, (__pyx_v_v - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self).a)); - - /* "rabbyt/rabbyt.primitives.pyx":258 - * def __set__(self, float v): - * self._shift_y(v - self._bounds_y().a) - * self._update_bounding_radius() # <<<<<<<<<<<<<< - * - * property top: - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_update_bounding_radius(__pyx_v_self); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_3top_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_3top_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_3top___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":262 - * property top: - * """ The y coordinate of the top-most point. """ - * def __get__(self): # <<<<<<<<<<<<<< - * return self._bounds_y().b - * def __set__(self, float v): - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_3top___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":263 - * """ The y coordinate of the top-most point. """ - * def __get__(self): - * return self._bounds_y().b # <<<<<<<<<<<<<< - * def __set__(self, float v): - * self._shift_y(v - self._bounds_y().b) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self).b); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_v) { - float __pyx_v_v; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - assert(__pyx_arg_v); { - __pyx_v_v = __pyx_PyFloat_AsFloat(__pyx_arg_v); if (unlikely((__pyx_v_v == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.top.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_3top_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((float)__pyx_v_v)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":264 - * def __get__(self): - * return self._bounds_y().b - * def __set__(self, float v): # <<<<<<<<<<<<<< - * self._shift_y(v - self._bounds_y().b) - * self._update_bounding_radius() - */ - -static int __pyx_pf_6rabbyt_10primitives_4Quad_3top_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, float __pyx_v_v) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":265 - * return self._bounds_y().b - * def __set__(self, float v): - * self._shift_y(v - self._bounds_y().b) # <<<<<<<<<<<<<< - * self._update_bounding_radius() - * - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_shift_y(__pyx_v_self, (__pyx_v_v - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_bounds_y(__pyx_v_self).b)); - - /* "rabbyt/rabbyt.primitives.pyx":266 - * def __set__(self, float v): - * self._shift_y(v - self._bounds_y().b) - * self._update_bounding_radius() # <<<<<<<<<<<<<< - * - * - */ - ((struct __pyx_vtabstruct_6rabbyt_10primitives_Quad *)__pyx_v_self->__pyx_vtab)->_update_bounding_radius(__pyx_v_self); - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":269 - * - * - * cdef void _update_bounding_radius(self): # <<<<<<<<<<<<<< - * self.bounding_radius = 0 - * cdef float brs - */ - -static void __pyx_f_6rabbyt_10primitives_4Quad__update_bounding_radius(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - float __pyx_v_brs; - long __pyx_v_i; - PyObject *__pyx_v_d = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - float __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_update_bounding_radius", 0); - - /* "rabbyt/rabbyt.primitives.pyx":270 - * - * cdef void _update_bounding_radius(self): - * self.bounding_radius = 0 # <<<<<<<<<<<<<< - * cdef float brs - * brs = 0 - */ - __pyx_v_self->bounding_radius = 0.0; - - /* "rabbyt/rabbyt.primitives.pyx":272 - * self.bounding_radius = 0 - * cdef float brs - * brs = 0 # <<<<<<<<<<<<<< - * for i from 0 <= i < 4: - * d = self.v[i].x**2 + self.v[i].y**2 - */ - __pyx_v_brs = 0.0; - - /* "rabbyt/rabbyt.primitives.pyx":273 - * cdef float brs - * brs = 0 - * for i from 0 <= i < 4: # <<<<<<<<<<<<<< - * d = self.v[i].x**2 + self.v[i].y**2 - * if d > brs: - */ - for (__pyx_v_i = 0; __pyx_v_i < 4; __pyx_v_i++) { - - /* "rabbyt/rabbyt.primitives.pyx":274 - * brs = 0 - * for i from 0 <= i < 4: - * d = self.v[i].x**2 + self.v[i].y**2 # <<<<<<<<<<<<<< - * if d > brs: - * brs = d - */ - __pyx_t_1 = PyFloat_FromDouble((powf((__pyx_v_self->v[__pyx_v_i]).x, 2.0) + powf((__pyx_v_self->v[__pyx_v_i]).y, 2.0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); - __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":275 - * for i from 0 <= i < 4: - * d = self.v[i].x**2 + self.v[i].y**2 - * if d > brs: # <<<<<<<<<<<<<< - * brs = d - * self.bounding_radius = brs**.5 - */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_brs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_d, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "rabbyt/rabbyt.primitives.pyx":276 - * d = self.v[i].x**2 + self.v[i].y**2 - * if d > brs: - * brs = d # <<<<<<<<<<<<<< - * self.bounding_radius = brs**.5 - * - */ - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_v_d); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_brs = __pyx_t_4; - goto __pyx_L5; - } - __pyx_L5:; - } - - /* "rabbyt/rabbyt.primitives.pyx":277 - * if d > brs: - * brs = d - * self.bounding_radius = brs**.5 # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __pyx_v_self->bounding_radius = pow(((double)__pyx_v_brs), .5); - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_WriteUnraisable("rabbyt.primitives.Quad._update_bounding_radius", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_d); - __Pyx_RefNannyFinishContext(); -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_9__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_9__repr__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_8__repr__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt/rabbyt.primitives.pyx":279 - * self.bounding_radius = brs**.5 - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return "Quad((%r, %r, %r, %r))" % (self[0], self[1], self[2], self[3]) - * - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_8__repr__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__repr__", 0); - - /* "rabbyt/rabbyt.primitives.pyx":280 - * - * def __repr__(self): - * return "Quad((%r, %r, %r, %r))" % (self[0], self[1], self[2], self[3]) # <<<<<<<<<<<<<< - * - * __docs_all__ = ['Quad'] - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_r = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("rabbyt.primitives.Quad.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_15bounding_radius_1__get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pw_6rabbyt_10primitives_4Quad_15bounding_radius_1__get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_15bounding_radius___get__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "rabbyt\primitives.pxd":9 - * cdef class Quad: - * cdef Point2d v[4] - * cdef public float bounding_radius # <<<<<<<<<<<<<< - * cdef void _shift_x(self, float x) - * cdef void _shift_y(self, float y) - */ - -static PyObject *__pyx_pf_6rabbyt_10primitives_4Quad_15bounding_radius___get__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__get__", 0); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->bounding_radius); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("rabbyt.primitives.Quad.bounding_radius.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static int __pyx_pw_6rabbyt_10primitives_4Quad_15bounding_radius_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pw_6rabbyt_10primitives_4Quad_15bounding_radius_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); - __pyx_r = __pyx_pf_6rabbyt_10primitives_4Quad_15bounding_radius_2__set__(((struct __pyx_obj_6rabbyt_10primitives_Quad *)__pyx_v_self), ((PyObject *)__pyx_v_value)); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6rabbyt_10primitives_4Quad_15bounding_radius_2__set__(struct __pyx_obj_6rabbyt_10primitives_Quad *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannyDeclarations - float __pyx_t_1; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_self->bounding_radius = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("rabbyt.primitives.Quad.bounding_radius.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static struct __pyx_vtabstruct_6rabbyt_10primitives_Quad __pyx_vtable_6rabbyt_10primitives_Quad; - -static PyObject *__pyx_tp_new_6rabbyt_10primitives_Quad(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_6rabbyt_10primitives_Quad *p; - PyObject *o; - o = (*t->tp_alloc)(t, 0); - if (unlikely(!o)) return 0; - p = ((struct __pyx_obj_6rabbyt_10primitives_Quad *)o); - p->__pyx_vtab = __pyx_vtabptr_6rabbyt_10primitives_Quad; - return o; -} - -static void __pyx_tp_dealloc_6rabbyt_10primitives_Quad(PyObject *o) { - (*Py_TYPE(o)->tp_free)(o); -} -static PyObject *__pyx_sq_item_6rabbyt_10primitives_Quad(PyObject *o, Py_ssize_t i) { - PyObject *r; - PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); - Py_DECREF(x); - return r; -} - -static int __pyx_mp_ass_subscript_6rabbyt_10primitives_Quad(PyObject *o, PyObject *i, PyObject *v) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_5__setitem__(o, i, v); - } - else { - PyErr_Format(PyExc_NotImplementedError, - "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_width(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_5width_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_5width_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_height(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_6height_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_height(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_6height_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_x(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_1x_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_x(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_1x_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_y(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_1y_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_y(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_1y_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_xy(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_2xy_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_xy(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_2xy_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_left(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_4left_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_4left_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_right(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_5right_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_5right_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_bottom(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_6bottom_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_bottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_6bottom_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_top(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_3top_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_top(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_3top_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6rabbyt_10primitives_4Quad_bounding_radius(PyObject *o, CYTHON_UNUSED void *x) { - return __pyx_pw_6rabbyt_10primitives_4Quad_15bounding_radius_1__get__(o); -} - -static int __pyx_setprop_6rabbyt_10primitives_4Quad_bounding_radius(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { - if (v) { - return __pyx_pw_6rabbyt_10primitives_4Quad_15bounding_radius_3__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6rabbyt_10primitives_Quad[] = { - {0, 0, 0, 0} -}; - -static struct PyGetSetDef __pyx_getsets_6rabbyt_10primitives_Quad[] = { - {(char *)"width", __pyx_getprop_6rabbyt_10primitives_4Quad_width, __pyx_setprop_6rabbyt_10primitives_4Quad_width, __Pyx_DOCSTR(__pyx_k_3), 0}, - {(char *)"height", __pyx_getprop_6rabbyt_10primitives_4Quad_height, __pyx_setprop_6rabbyt_10primitives_4Quad_height, __Pyx_DOCSTR(__pyx_k_4), 0}, - {(char *)"x", __pyx_getprop_6rabbyt_10primitives_4Quad_x, __pyx_setprop_6rabbyt_10primitives_4Quad_x, __Pyx_DOCSTR(__pyx_k_5), 0}, - {(char *)"y", __pyx_getprop_6rabbyt_10primitives_4Quad_y, __pyx_setprop_6rabbyt_10primitives_4Quad_y, __Pyx_DOCSTR(__pyx_k_6), 0}, - {(char *)"xy", __pyx_getprop_6rabbyt_10primitives_4Quad_xy, __pyx_setprop_6rabbyt_10primitives_4Quad_xy, __Pyx_DOCSTR(__pyx_k_7), 0}, - {(char *)"left", __pyx_getprop_6rabbyt_10primitives_4Quad_left, __pyx_setprop_6rabbyt_10primitives_4Quad_left, __Pyx_DOCSTR(__pyx_k_8), 0}, - {(char *)"right", __pyx_getprop_6rabbyt_10primitives_4Quad_right, __pyx_setprop_6rabbyt_10primitives_4Quad_right, __Pyx_DOCSTR(__pyx_k_9), 0}, - {(char *)"bottom", __pyx_getprop_6rabbyt_10primitives_4Quad_bottom, __pyx_setprop_6rabbyt_10primitives_4Quad_bottom, __Pyx_DOCSTR(__pyx_k_10), 0}, - {(char *)"top", __pyx_getprop_6rabbyt_10primitives_4Quad_top, __pyx_setprop_6rabbyt_10primitives_4Quad_top, __Pyx_DOCSTR(__pyx_k_11), 0}, - {(char *)"bounding_radius", __pyx_getprop_6rabbyt_10primitives_4Quad_bounding_radius, __pyx_setprop_6rabbyt_10primitives_4Quad_bounding_radius, 0, 0}, - {0, 0, 0, 0, 0} -}; - -static PySequenceMethods __pyx_tp_as_sequence_Quad = { - __pyx_pw_6rabbyt_10primitives_4Quad_7__len__, /*sq_length*/ - 0, /*sq_concat*/ - 0, /*sq_repeat*/ - __pyx_sq_item_6rabbyt_10primitives_Quad, /*sq_item*/ - 0, /*sq_slice*/ - 0, /*sq_ass_item*/ - 0, /*sq_ass_slice*/ - 0, /*sq_contains*/ - 0, /*sq_inplace_concat*/ - 0, /*sq_inplace_repeat*/ -}; - -static PyMappingMethods __pyx_tp_as_mapping_Quad = { - __pyx_pw_6rabbyt_10primitives_4Quad_7__len__, /*mp_length*/ - __pyx_pw_6rabbyt_10primitives_4Quad_3__getitem__, /*mp_subscript*/ - __pyx_mp_ass_subscript_6rabbyt_10primitives_Quad, /*mp_ass_subscript*/ -}; - -static PyTypeObject __pyx_type_6rabbyt_10primitives_Quad = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("rabbyt.primitives.Quad"), /*tp_name*/ - sizeof(struct __pyx_obj_6rabbyt_10primitives_Quad), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - __pyx_tp_dealloc_6rabbyt_10primitives_Quad, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 - 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - __pyx_pw_6rabbyt_10primitives_4Quad_9__repr__, /*tp_repr*/ - 0, /*tp_as_number*/ - &__pyx_tp_as_sequence_Quad, /*tp_as_sequence*/ - &__pyx_tp_as_mapping_Quad, /*tp_as_mapping*/ - 0, /*tp_hash*/ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("\n ``Quad(definition)``\n\n ``Quad`` provides a convenient representation of a quadrilateral.\n This is useful for specifying ``Sprite.shape`` and ``Sprite.tex_shape``.\n\n ``definition`` can be in a number of forms:\n\n * A tuple with four vertexes.\n For example: ``((0,1), (1,1), (1,0), (0,0))``.\n\n * A tuple with the format ``(left, top, right, bottom)``.\n For example: ``(0, 1, 1, 0)``. You can also think of this as\n ``(x1, y1, x2, y2)``, giving the top-left and bottom-right corners\n of a rectangle.\n\n * A tuple in the format of pyglet's ``Texture.tex_coords`` attribute.\n (This, is a flattened tuple giving each vertex in three\n dimensions. The third dimension will be discarded.)\n\n ``Quad`` has a number of properties to make modifying it easier. The\n ``width`` and ``height`` properties will scale the vertexes from the\n center, but all other properties will move *all* vertexes the same amount.\n (e.g., assigning to ``left`` will move the right side as well: the width\n says the same.)\n "), /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ - 0, /*tp_richcompare*/ - 0, /*tp_weaklistoffset*/ - 0, /*tp_iter*/ - 0, /*tp_iternext*/ - __pyx_methods_6rabbyt_10primitives_Quad, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6rabbyt_10primitives_Quad, /*tp_getset*/ - 0, /*tp_base*/ - 0, /*tp_dict*/ - 0, /*tp_descr_get*/ - 0, /*tp_descr_set*/ - 0, /*tp_dictoffset*/ - __pyx_pw_6rabbyt_10primitives_4Quad_1__init__, /*tp_init*/ - 0, /*tp_alloc*/ - __pyx_tp_new_6rabbyt_10primitives_Quad, /*tp_new*/ - 0, /*tp_free*/ - 0, /*tp_is_gc*/ - 0, /*tp_bases*/ - 0, /*tp_mro*/ - 0, /*tp_cache*/ - 0, /*tp_subclasses*/ - 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif - #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE) - 0, /*tp_finalize*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - __Pyx_NAMESTR("primitives"), - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, - {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1}, - {&__pyx_n_s__Quad, __pyx_k__Quad, sizeof(__pyx_k__Quad), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____author__, __pyx_k____author__, sizeof(__pyx_k____author__), 0, 0, 1, 1}, - {&__pyx_n_s____credits__, __pyx_k____credits__, sizeof(__pyx_k____credits__), 0, 0, 1, 1}, - {&__pyx_n_s____docs_all__, __pyx_k____docs_all__, sizeof(__pyx_k____docs_all__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1}, - {&__pyx_n_s____setitem__, __pyx_k____setitem__, sizeof(__pyx_k____setitem__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s__definition, __pyx_k__definition, sizeof(__pyx_k__definition), 0, 0, 1, 1}, - {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1}, - {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1}, - {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initprimitives(void); /*proto*/ -PyMODINIT_FUNC initprimitives(void) -#else -PyMODINIT_FUNC PyInit_primitives(void); /*proto*/ -PyMODINIT_FUNC PyInit_primitives(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_primitives(void)", 0); - if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #ifdef __Pyx_CyFunction_USED - if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("primitives"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - Py_INCREF(__pyx_d); - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!PyDict_GetItemString(modules, "rabbyt.primitives")) { - if (unlikely(PyDict_SetItemString(modules, "rabbyt.primitives", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - } - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__pyx_module_is_main_rabbyt__primitives) { - if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - __pyx_vtabptr_6rabbyt_10primitives_Quad = &__pyx_vtable_6rabbyt_10primitives_Quad; - __pyx_vtable_6rabbyt_10primitives_Quad._shift_x = (void (*)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float))__pyx_f_6rabbyt_10primitives_4Quad__shift_x; - __pyx_vtable_6rabbyt_10primitives_Quad._shift_y = (void (*)(struct __pyx_obj_6rabbyt_10primitives_Quad *, float))__pyx_f_6rabbyt_10primitives_4Quad__shift_y; - __pyx_vtable_6rabbyt_10primitives_Quad._bounds_x = (struct __pyx_t_6rabbyt_10primitives_float2 (*)(struct __pyx_obj_6rabbyt_10primitives_Quad *))__pyx_f_6rabbyt_10primitives_4Quad__bounds_x; - __pyx_vtable_6rabbyt_10primitives_Quad._bounds_y = (struct __pyx_t_6rabbyt_10primitives_float2 (*)(struct __pyx_obj_6rabbyt_10primitives_Quad *))__pyx_f_6rabbyt_10primitives_4Quad__bounds_y; - __pyx_vtable_6rabbyt_10primitives_Quad._update_bounding_radius = (void (*)(struct __pyx_obj_6rabbyt_10primitives_Quad *))__pyx_f_6rabbyt_10primitives_4Quad__update_bounding_radius; - if (PyType_Ready(&__pyx_type_6rabbyt_10primitives_Quad) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6rabbyt_10primitives_Quad.tp_dict, __pyx_vtabptr_6rabbyt_10primitives_Quad) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Quad", (PyObject *)&__pyx_type_6rabbyt_10primitives_Quad) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_6rabbyt_10primitives_Quad = &__pyx_type_6rabbyt_10primitives_Quad; - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "rabbyt/rabbyt.primitives.pyx":2 - * __credits__ = ( - * """ # <<<<<<<<<<<<<< - * Copyright (C) 2007 Matthew Marshall - * - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____credits__, ((PyObject *)__pyx_kp_s_12)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.primitives.pyx":24 - * """) - * - * __author__ = "Matthew Marshall " # <<<<<<<<<<<<<< - * - * cdef extern from "Python.h": - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s____author__, ((PyObject *)__pyx_kp_s_13)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "rabbyt/rabbyt.primitives.pyx":282 - * return "Quad((%r, %r, %r, %r))" % (self[0], self[1], self[2], self[3]) - * - * __docs_all__ = ['Quad'] # <<<<<<<<<<<<<< - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_n_s__Quad)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Quad)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Quad)); - if (PyDict_SetItem(__pyx_d, __pyx_n_s____docs_all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - - /* "rabbyt/rabbyt.primitives.pyx":1 - * __credits__ = ( # <<<<<<<<<<<<<< - * """ - * Copyright (C) 2007 Matthew Marshall - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - __Pyx_AddTraceback("init rabbyt.primitives", __pyx_clineno, __pyx_lineno, __pyx_filename); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init rabbyt.primitives"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif /* CYTHON_REFNANNY */ - -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - continue; - } - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = (**name == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } - } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, key); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *more_or_less; - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, - int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -#else - return PySequence_GetItem(o, i); -#endif -} -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, - int is_list, int wraparound, int boundscheck) { -#if CYTHON_COMPILING_IN_CPYTHON - if (is_list || PyList_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); - if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { - PyObject *r = PyList_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } - else if (PyTuple_CheckExact(o)) { - Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); - if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, n); - Py_INCREF(r); - return r; - } - } else { - PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; - if (likely(m && m->sq_item)) { - if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { - Py_ssize_t l = m->sq_length(o); - if (likely(l >= 0)) { - i += l; - } else { - if (PyErr_ExceptionMatches(PyExc_OverflowError)) - PyErr_Clear(); - else - return NULL; - } - } - return m->sq_item(o, i); - } - } -#else - if (is_list || PySequence_Check(o)) { - return PySequence_GetItem(o, i); - } -#endif - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *local_type, *local_value, *local_tb; -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - #endif - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_COMPILING_IN_CPYTHON - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (DECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack", - index, (index == 1) ? "" : "s"); -} - -static CYTHON_INLINE int __Pyx_IterFinish(void) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - PyObject* exc_type = tstate->curexc_type; - if (unlikely(exc_type)) { - if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { - PyObject *exc_value, *exc_tb; - exc_value = tstate->curexc_value; - exc_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - Py_DECREF(exc_type); - Py_XDECREF(exc_value); - Py_XDECREF(exc_tb); - return 0; - } else { - return -1; - } - } - return 0; -#else - if (unlikely(PyErr_Occurred())) { - if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { - PyErr_Clear(); - return 0; - } else { - return -1; - } - } - return 0; -#endif -} - -static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { - if (unlikely(retval)) { - Py_DECREF(retval); - __Pyx_RaiseTooManyValuesError(expected); - return -1; - } else { - return __Pyx_IterFinish(); - } - return 0; -} - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_Restore(type, value, tb); -#endif -} -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -#else - PyErr_Fetch(type, value, tb); -#endif -} - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - #if PY_VERSION_HEX < 0x02050000 - if (PyClass_Check(type)) { - #else - if (PyType_Check(type)) { - #endif -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else /* Python 3+ */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyEval_CallObject(type, args); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItem(dict, __pyx_n_s____pyx_vtable__, ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -#else - PyErr_GetExcInfo(type, value, tb); -#endif -} -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { -#if CYTHON_COMPILING_IN_CPYTHON - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(type, value, tb); -#endif -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned long)PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (long)PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)PyLong_AsUnsignedLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed long)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed long)PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS -#include "longintrepr.h" -#endif -#endif -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); - } else { -#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -#if CYTHON_USE_PYLONG_INTERNALS - if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) { - switch (Py_SIZE(x)) { - case 0: return 0; - case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0]; - } - } -#endif -#endif - return (signed PY_LONG_LONG)PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - #if PY_VERSION_HEX < 0x02050000 - return PyErr_Warn(NULL, message); - #else - return PyErr_WarnEx(NULL, message, 1); - #endif - } - return 0; -} - -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = (start + end) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, /*int argcount,*/ - 0, /*int kwonlyargcount,*/ - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_globals = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_globals = PyModule_GetDict(__pyx_m); - if (!py_globals) goto bad; - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - py_globals, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else /* PY_VERSION_HEX < 0x03030000 */ - if (PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_DATA_SIZE(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ - return PyUnicode_AsUTF8AndSize(o, length); -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ -#endif /* PY_VERSION_HEX < 0x03030000 */ - } else -#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (r < 0) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred()) - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */