From 14b98a1c057d684ba446e15db300337a4813cbf8 Mon Sep 17 00:00:00 2001 From: yunline Date: Wed, 20 Dec 2023 16:56:11 +0800 Subject: [PATCH] Renderer.blit support FRect --- src_c/_sdl2/video.c | 1049 +++++++++++++-------------- src_c/cython/pygame/_sdl2/video.pxd | 2 +- src_c/cython/pygame/_sdl2/video.pyx | 12 +- 3 files changed, 502 insertions(+), 561 deletions(-) diff --git a/src_c/_sdl2/video.c b/src_c/_sdl2/video.c index 7bd5fdcfca..ee2778ac38 100644 --- a/src_c/_sdl2/video.c +++ b/src_c/_sdl2/video.c @@ -1464,14 +1464,14 @@ struct __pyx_opt_args_6pygame_5_sdl2_5video_5Image_draw; /* "pygame/_sdl2/video.pxd":467 * * cpdef object get_viewport(self) - * cpdef object blit(self, object source, Rect dest=*, Rect area=*, int special_flags=*) # <<<<<<<<<<<<<< + * cpdef object blit(self, object source, object dest=*, object area=*, int special_flags=*) # <<<<<<<<<<<<<< * * cdef class Texture: */ struct __pyx_opt_args_6pygame_5_sdl2_5video_8Renderer_blit { int __pyx_n; - pgRectObject *dest; - pgRectObject *area; + PyObject *dest; + PyObject *area; int special_flags; }; @@ -1521,7 +1521,7 @@ struct __pyx_obj_6pygame_5_sdl2_5video_Renderer { /* "pygame/_sdl2/video.pxd":469 - * cpdef object blit(self, object source, Rect dest=*, Rect area=*, int special_flags=*) + * cpdef object blit(self, object source, object dest=*, object area=*, int special_flags=*) * * cdef class Texture: # <<<<<<<<<<<<<< * cdef SDL_Texture* _tex @@ -2981,7 +2981,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale___get__(struct static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale_2__set__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_scale); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target___get__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_newtarget); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_source, pgRectObject *__pyx_v_dest, pgRectObject *__pyx_v_area, int __pyx_v_special_flags); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ @@ -17277,7 +17277,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py * else: * raise TypeError('target must be a Texture or None') # <<<<<<<<<<<<<< * - * cpdef object blit(self, object source, Rect dest=None, Rect area=None, int special_flags=0): + * cpdef object blit(self, object source, object dest=None, object area=None, int special_flags=0): */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error) @@ -17313,7 +17313,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py /* "pygame/_sdl2/video.pyx":1000 * raise TypeError('target must be a Texture or None') * - * cpdef object blit(self, object source, Rect dest=None, Rect area=None, int special_flags=0): # <<<<<<<<<<<<<< + * cpdef object blit(self, object source, object dest=None, object area=None, int special_flags=0): # <<<<<<<<<<<<<< * """Draw textures using a Surface-like API * */ @@ -17326,8 +17326,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch, struct __pyx_opt_args_6pygame_5_sdl2_5video_8Renderer_blit *__pyx_optional_args) { - pgRectObject *__pyx_v_dest = ((pgRectObject *)Py_None); - pgRectObject *__pyx_v_area = ((pgRectObject *)Py_None); + PyObject *__pyx_v_dest = ((PyObject *)Py_None); + PyObject *__pyx_v_area = ((PyObject *)Py_None); int __pyx_v_special_flags = ((int)0); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -17338,9 +17338,8 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 PyObject *__pyx_t_5 = NULL; int __pyx_t_6; int __pyx_t_7; - struct __pyx_opt_args_6pygame_5_sdl2_5video_7Texture_draw __pyx_t_8; - struct __pyx_opt_args_6pygame_5_sdl2_5video_5Image_draw __pyx_t_9; - int __pyx_t_10; + int __pyx_t_8; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -17390,7 +17389,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 } } { - PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_source, ((PyObject *)__pyx_v_dest), ((PyObject *)__pyx_v_area), __pyx_t_3}; + PyObject *__pyx_callargs[5] = {__pyx_t_5, __pyx_v_source, __pyx_v_dest, __pyx_v_area, __pyx_t_3}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 4+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -17419,109 +17418,37 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 /* "pygame/_sdl2/video.pyx":1013 * .. note:: Textures created by different Renderers cannot shared with each other! * """ - * if isinstance(source, Texture): # <<<<<<<<<<<<<< - * (source).draw(area, dest) - * elif isinstance(source, Image): - */ - __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_6pygame_5_sdl2_5video_Texture); - if (__pyx_t_7) { - - /* "pygame/_sdl2/video.pyx":1014 - * """ - * if isinstance(source, Texture): - * (source).draw(area, dest) # <<<<<<<<<<<<<< - * elif isinstance(source, Image): - * (source).draw(area, dest) - */ - __pyx_t_8.__pyx_n = 2; - __pyx_t_8.srcrect = ((PyObject *)__pyx_v_area); - __pyx_t_8.dstrect = ((PyObject *)__pyx_v_dest); - ((struct __pyx_vtabstruct_6pygame_5_sdl2_5video_Texture *)((struct __pyx_obj_6pygame_5_sdl2_5video_Texture *)__pyx_v_source)->__pyx_vtab)->draw(((struct __pyx_obj_6pygame_5_sdl2_5video_Texture *)__pyx_v_source), 0, &__pyx_t_8); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L1_error) - - /* "pygame/_sdl2/video.pyx":1013 - * .. note:: Textures created by different Renderers cannot shared with each other! - * """ - * if isinstance(source, Texture): # <<<<<<<<<<<<<< - * (source).draw(area, dest) - * elif isinstance(source, Image): - */ - goto __pyx_L3; - } - - /* "pygame/_sdl2/video.pyx":1015 - * if isinstance(source, Texture): - * (source).draw(area, dest) - * elif isinstance(source, Image): # <<<<<<<<<<<<<< - * (source).draw(area, dest) - * elif not hasattr(source, 'draw'): - */ - __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_6pygame_5_sdl2_5video_Image); - if (__pyx_t_7) { - - /* "pygame/_sdl2/video.pyx":1016 - * (source).draw(area, dest) - * elif isinstance(source, Image): - * (source).draw(area, dest) # <<<<<<<<<<<<<< - * elif not hasattr(source, 'draw'): - * raise TypeError('source must be drawable') - */ - __pyx_t_9.__pyx_n = 2; - __pyx_t_9.srcrect = ((PyObject *)__pyx_v_area); - __pyx_t_9.dstrect = ((PyObject *)__pyx_v_dest); - ((struct __pyx_vtabstruct_6pygame_5_sdl2_5video_Image *)((struct __pyx_obj_6pygame_5_sdl2_5video_Image *)__pyx_v_source)->__pyx_vtab)->draw(((struct __pyx_obj_6pygame_5_sdl2_5video_Image *)__pyx_v_source), 0, &__pyx_t_9); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1016, __pyx_L1_error) - - /* "pygame/_sdl2/video.pyx":1015 - * if isinstance(source, Texture): - * (source).draw(area, dest) - * elif isinstance(source, Image): # <<<<<<<<<<<<<< - * (source).draw(area, dest) - * elif not hasattr(source, 'draw'): - */ - goto __pyx_L3; - } - - /* "pygame/_sdl2/video.pyx":1017 - * elif isinstance(source, Image): - * (source).draw(area, dest) - * elif not hasattr(source, 'draw'): # <<<<<<<<<<<<<< - * raise TypeError('source must be drawable') - * else: - */ - __pyx_t_7 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_s_draw); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1017, __pyx_L1_error) - __pyx_t_10 = (!__pyx_t_7); - if (unlikely(__pyx_t_10)) { - - /* "pygame/_sdl2/video.pyx":1018 - * (source).draw(area, dest) - * elif not hasattr(source, 'draw'): - * raise TypeError('source must be drawable') # <<<<<<<<<<<<<< - * else: + * if isinstance(source, (Texture,Image)) or hasattr(source, 'draw'): # <<<<<<<<<<<<<< * source.draw(area, dest) - */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1018, __pyx_L1_error) - - /* "pygame/_sdl2/video.pyx":1017 - * elif isinstance(source, Image): - * (source).draw(area, dest) - * elif not hasattr(source, 'draw'): # <<<<<<<<<<<<<< - * raise TypeError('source must be drawable') * else: */ + __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_6pygame_5_sdl2_5video_Texture); + if (!__pyx_t_9) { + } else { + __pyx_t_8 = __pyx_t_9; + goto __pyx_L6_bool_binop_done; + } + __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_6pygame_5_sdl2_5video_Image); + __pyx_t_8 = __pyx_t_9; + __pyx_L6_bool_binop_done:; + if (!__pyx_t_8) { + } else { + __pyx_t_7 = __pyx_t_8; + goto __pyx_L4_bool_binop_done; } + __pyx_t_8 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_s_draw); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1013, __pyx_L1_error) + __pyx_t_7 = __pyx_t_8; + __pyx_L4_bool_binop_done:; + if (likely(__pyx_t_7)) { - /* "pygame/_sdl2/video.pyx":1020 - * raise TypeError('source must be drawable') - * else: + /* "pygame/_sdl2/video.pyx":1014 + * """ + * if isinstance(source, (Texture,Image)) or hasattr(source, 'draw'): * source.draw(area, dest) # <<<<<<<<<<<<<< - * - * if not dest: + * else: + * raise TypeError('source must be drawable') */ - /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_6 = 0; @@ -17536,29 +17463,53 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 } } { - PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_area), ((PyObject *)__pyx_v_dest)}; + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_area, __pyx_v_dest}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "pygame/_sdl2/video.pyx":1013 + * .. note:: Textures created by different Renderers cannot shared with each other! + * """ + * if isinstance(source, (Texture,Image)) or hasattr(source, 'draw'): # <<<<<<<<<<<<<< + * source.draw(area, dest) + * else: + */ + goto __pyx_L3; + } + + /* "pygame/_sdl2/video.pyx":1016 + * source.draw(area, dest) + * else: + * raise TypeError('source must be drawable') # <<<<<<<<<<<<<< + * + * if not dest: + */ + /*else*/ { + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 1016, __pyx_L1_error) } __pyx_L3:; - /* "pygame/_sdl2/video.pyx":1022 - * source.draw(area, dest) + /* "pygame/_sdl2/video.pyx":1018 + * raise TypeError('source must be drawable') * * if not dest: # <<<<<<<<<<<<<< * return self.get_viewport() * return dest */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_dest)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1022, __pyx_L1_error) - __pyx_t_7 = (!__pyx_t_10); - if (__pyx_t_7) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_dest); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_8 = (!__pyx_t_7); + if (__pyx_t_8) { - /* "pygame/_sdl2/video.pyx":1023 + /* "pygame/_sdl2/video.pyx":1019 * * if not dest: * return self.get_viewport() # <<<<<<<<<<<<<< @@ -17566,14 +17517,14 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self->__pyx_vtab)->get_viewport(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1023, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self->__pyx_vtab)->get_viewport(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":1022 - * source.draw(area, dest) + /* "pygame/_sdl2/video.pyx":1018 + * raise TypeError('source must be drawable') * * if not dest: # <<<<<<<<<<<<<< * return self.get_viewport() @@ -17581,7 +17532,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 */ } - /* "pygame/_sdl2/video.pyx":1024 + /* "pygame/_sdl2/video.pyx":1020 * if not dest: * return self.get_viewport() * return dest # <<<<<<<<<<<<<< @@ -17589,14 +17540,14 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 * def draw_line(self, p1, p2): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF((PyObject *)__pyx_v_dest); - __pyx_r = ((PyObject *)__pyx_v_dest); + __Pyx_INCREF(__pyx_v_dest); + __pyx_r = __pyx_v_dest; goto __pyx_L0; /* "pygame/_sdl2/video.pyx":1000 * raise TypeError('target must be a Texture or None') * - * cpdef object blit(self, object source, Rect dest=None, Rect area=None, int special_flags=0): # <<<<<<<<<<<<<< + * cpdef object blit(self, object source, object dest=None, object area=None, int special_flags=0): # <<<<<<<<<<<<<< * """Draw textures using a Surface-like API * */ @@ -17634,8 +17585,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_source = 0; - pgRectObject *__pyx_v_dest = 0; - pgRectObject *__pyx_v_area = 0; + PyObject *__pyx_v_dest = 0; + PyObject *__pyx_v_area = 0; int __pyx_v_special_flags; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -17650,8 +17601,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_dest,&__pyx_n_s_area,&__pyx_n_s_special_flags,0}; PyObject* values[4] = {0,0,0,0}; - values[1] = (PyObject *)((pgRectObject *)Py_None); - values[2] = (PyObject *)((pgRectObject *)Py_None); + values[1] = ((PyObject *)Py_None); + values[2] = ((PyObject *)Py_None); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -17712,8 +17663,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } __pyx_v_source = values[0]; - __pyx_v_dest = ((pgRectObject *)values[1]); - __pyx_v_area = ((pgRectObject *)values[2]); + __pyx_v_dest = values[1]; + __pyx_v_area = values[2]; if (values[3]) { __pyx_v_special_flags = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_special_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1000, __pyx_L3_error) } else { @@ -17728,20 +17679,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_6pygame_5_sdl2_5video_Rect, 1, "dest", 0))) __PYX_ERR(0, 1000, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_area), __pyx_ptype_6pygame_5_sdl2_5video_Rect, 1, "area", 0))) __PYX_ERR(0, 1000, __pyx_L1_error) __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_source, __pyx_v_dest, __pyx_v_area, __pyx_v_special_flags); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_source, pgRectObject *__pyx_v_dest, pgRectObject *__pyx_v_area, int __pyx_v_special_flags) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_dest, PyObject *__pyx_v_area, int __pyx_v_special_flags) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17772,7 +17717,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_ob return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1026 +/* "pygame/_sdl2/video.pyx":1022 * return dest * * def draw_line(self, p1, p2): # <<<<<<<<<<<<<< @@ -17826,19 +17771,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1026, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1022, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1026, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1022, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_line", 1, 2, 2, 1); __PYX_ERR(0, 1026, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_line", 1, 2, 2, 1); __PYX_ERR(0, 1022, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_line") < 0)) __PYX_ERR(0, 1026, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_line") < 0)) __PYX_ERR(0, 1022, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -17851,7 +17796,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("draw_line", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1026, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_line", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1022, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -17882,39 +17827,39 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_line", 0); - /* "pygame/_sdl2/video.pyx":1034 + /* "pygame/_sdl2/video.pyx":1030 * cdef int res * res = SDL_RenderDrawLineF(self._renderer, * p1[0], p1[1], # <<<<<<<<<<<<<< * p2[0], p2[1]) * if res < 0: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __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_ERR(0, 1034, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __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_ERR(0, 1034, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1030, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1035 + /* "pygame/_sdl2/video.pyx":1031 * res = SDL_RenderDrawLineF(self._renderer, * p1[0], p1[1], * p2[0], p2[1]) # <<<<<<<<<<<<<< * if res < 0: * raise error() */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1033 + /* "pygame/_sdl2/video.pyx":1029 * """ * cdef int res * res = SDL_RenderDrawLineF(self._renderer, # <<<<<<<<<<<<<< @@ -17923,7 +17868,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p */ __pyx_v_res = SDL_RenderDrawLineF(__pyx_v_self->_renderer, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); - /* "pygame/_sdl2/video.pyx":1036 + /* "pygame/_sdl2/video.pyx":1032 * p1[0], p1[1], * p2[0], p2[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -17933,14 +17878,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p __pyx_t_6 = (__pyx_v_res < 0); if (unlikely(__pyx_t_6)) { - /* "pygame/_sdl2/video.pyx":1037 + /* "pygame/_sdl2/video.pyx":1033 * p2[0], p2[1]) * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def draw_point(self, point): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -17958,15 +17903,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p PyObject *__pyx_callargs[1] = {__pyx_t_8, }; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1037, __pyx_L1_error) + __PYX_ERR(0, 1033, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1036 + /* "pygame/_sdl2/video.pyx":1032 * p1[0], p1[1], * p2[0], p2[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -17975,7 +17920,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p */ } - /* "pygame/_sdl2/video.pyx":1026 + /* "pygame/_sdl2/video.pyx":1022 * return dest * * def draw_line(self, p1, p2): # <<<<<<<<<<<<<< @@ -17998,7 +17943,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1039 +/* "pygame/_sdl2/video.pyx":1035 * raise error() * * def draw_point(self, point): # <<<<<<<<<<<<<< @@ -18049,12 +17994,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1035, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_point") < 0)) __PYX_ERR(0, 1039, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_point") < 0)) __PYX_ERR(0, 1035, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18065,7 +18010,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("draw_point", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1039, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_point", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1035, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18094,23 +18039,23 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_point", 0); - /* "pygame/_sdl2/video.pyx":1047 + /* "pygame/_sdl2/video.pyx":1043 * cdef int res * res = SDL_RenderDrawPointF(self._renderer, * point[0], point[1]) # <<<<<<<<<<<<<< * if res < 0: * raise error() */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __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_ERR(0, 1047, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __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_ERR(0, 1047, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1043, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1046 + /* "pygame/_sdl2/video.pyx":1042 * # https://wiki.libsdl.org/SDL_RenderDrawPointF * cdef int res * res = SDL_RenderDrawPointF(self._renderer, # <<<<<<<<<<<<<< @@ -18119,7 +18064,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ */ __pyx_v_res = SDL_RenderDrawPointF(__pyx_v_self->_renderer, __pyx_t_2, __pyx_t_3); - /* "pygame/_sdl2/video.pyx":1048 + /* "pygame/_sdl2/video.pyx":1044 * res = SDL_RenderDrawPointF(self._renderer, * point[0], point[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -18129,14 +18074,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ __pyx_t_4 = (__pyx_v_res < 0); if (unlikely(__pyx_t_4)) { - /* "pygame/_sdl2/video.pyx":1049 + /* "pygame/_sdl2/video.pyx":1045 * point[0], point[1]) * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def draw_rect(self, rect): */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -18154,15 +18099,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ PyObject *__pyx_callargs[1] = {__pyx_t_6, }; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1049, __pyx_L1_error) + __PYX_ERR(0, 1045, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1048 + /* "pygame/_sdl2/video.pyx":1044 * res = SDL_RenderDrawPointF(self._renderer, * point[0], point[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -18171,7 +18116,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ */ } - /* "pygame/_sdl2/video.pyx":1039 + /* "pygame/_sdl2/video.pyx":1035 * raise error() * * def draw_point(self, point): # <<<<<<<<<<<<<< @@ -18194,7 +18139,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1051 +/* "pygame/_sdl2/video.pyx":1047 * raise error() * * def draw_rect(self, rect): # <<<<<<<<<<<<<< @@ -18245,12 +18190,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_rect") < 0)) __PYX_ERR(0, 1051, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_rect") < 0)) __PYX_ERR(0, 1047, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18261,7 +18206,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1051, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1047, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18290,7 +18235,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_rect", 0); - /* "pygame/_sdl2/video.pyx":1061 + /* "pygame/_sdl2/video.pyx":1057 * cdef int res * * frectptr = pgFRect_FromObject(rect, &_frect) # <<<<<<<<<<<<<< @@ -18299,7 +18244,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p */ __pyx_v_frectptr = pgFRect_FromObject(__pyx_v_rect, (&__pyx_v__frect)); - /* "pygame/_sdl2/video.pyx":1062 + /* "pygame/_sdl2/video.pyx":1058 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18309,20 +18254,20 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p __pyx_t_1 = (__pyx_v_frectptr == NULL); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1063 + /* "pygame/_sdl2/video.pyx":1059 * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: * raise TypeError('expected a rectangle') # <<<<<<<<<<<<<< * * res = SDL_RenderDrawRectF(self._renderer, frectptr) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __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_ERR(0, 1063, __pyx_L1_error) + __PYX_ERR(0, 1059, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1062 + /* "pygame/_sdl2/video.pyx":1058 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18331,7 +18276,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1065 + /* "pygame/_sdl2/video.pyx":1061 * raise TypeError('expected a rectangle') * * res = SDL_RenderDrawRectF(self._renderer, frectptr) # <<<<<<<<<<<<<< @@ -18340,7 +18285,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p */ __pyx_v_res = SDL_RenderDrawRectF(__pyx_v_self->_renderer, __pyx_v_frectptr); - /* "pygame/_sdl2/video.pyx":1067 + /* "pygame/_sdl2/video.pyx":1063 * res = SDL_RenderDrawRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18350,14 +18295,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1068 + /* "pygame/_sdl2/video.pyx":1064 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def fill_rect(self, rect): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -18375,15 +18320,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p PyObject *__pyx_callargs[1] = {__pyx_t_4, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1068, __pyx_L1_error) + __PYX_ERR(0, 1064, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1067 + /* "pygame/_sdl2/video.pyx":1063 * res = SDL_RenderDrawRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18392,7 +18337,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1051 + /* "pygame/_sdl2/video.pyx":1047 * raise error() * * def draw_rect(self, rect): # <<<<<<<<<<<<<< @@ -18415,7 +18360,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1070 +/* "pygame/_sdl2/video.pyx":1066 * raise error() * * def fill_rect(self, rect): # <<<<<<<<<<<<<< @@ -18466,12 +18411,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rect)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_rect") < 0)) __PYX_ERR(0, 1070, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_rect") < 0)) __PYX_ERR(0, 1066, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18482,7 +18427,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1070, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1066, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18511,7 +18456,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill_rect", 0); - /* "pygame/_sdl2/video.pyx":1081 + /* "pygame/_sdl2/video.pyx":1077 * * * frectptr = pgFRect_FromObject(rect, &_frect) # <<<<<<<<<<<<<< @@ -18520,7 +18465,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p */ __pyx_v_frectptr = pgFRect_FromObject(__pyx_v_rect, (&__pyx_v__frect)); - /* "pygame/_sdl2/video.pyx":1082 + /* "pygame/_sdl2/video.pyx":1078 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18530,20 +18475,20 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p __pyx_t_1 = (__pyx_v_frectptr == NULL); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1083 + /* "pygame/_sdl2/video.pyx":1079 * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: * raise TypeError('expected a rectangle') # <<<<<<<<<<<<<< * * res = SDL_RenderFillRectF(self._renderer, frectptr) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __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_ERR(0, 1083, __pyx_L1_error) + __PYX_ERR(0, 1079, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1082 + /* "pygame/_sdl2/video.pyx":1078 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18552,7 +18497,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1085 + /* "pygame/_sdl2/video.pyx":1081 * raise TypeError('expected a rectangle') * * res = SDL_RenderFillRectF(self._renderer, frectptr) # <<<<<<<<<<<<<< @@ -18561,7 +18506,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p */ __pyx_v_res = SDL_RenderFillRectF(__pyx_v_self->_renderer, __pyx_v_frectptr); - /* "pygame/_sdl2/video.pyx":1087 + /* "pygame/_sdl2/video.pyx":1083 * res = SDL_RenderFillRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18571,14 +18516,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1088 + /* "pygame/_sdl2/video.pyx":1084 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def draw_triangle(self, p1, p2, p3): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -18596,15 +18541,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p PyObject *__pyx_callargs[1] = {__pyx_t_4, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1088, __pyx_L1_error) + __PYX_ERR(0, 1084, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1087 + /* "pygame/_sdl2/video.pyx":1083 * res = SDL_RenderFillRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18613,7 +18558,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1070 + /* "pygame/_sdl2/video.pyx":1066 * raise error() * * def fill_rect(self, rect): # <<<<<<<<<<<<<< @@ -18636,7 +18581,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1090 +/* "pygame/_sdl2/video.pyx":1086 * raise error() * * def draw_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -18692,26 +18637,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1090, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1086, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p3)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1090, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1090, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1086, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_triangle") < 0)) __PYX_ERR(0, 1090, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_triangle") < 0)) __PYX_ERR(0, 1086, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -18726,7 +18671,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1090, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1086, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_triangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -18759,7 +18704,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_triangle", 0); - /* "pygame/_sdl2/video.pyx":1094 + /* "pygame/_sdl2/video.pyx":1090 * cdef SDL_FPoint fpoints[4] * * for i, pos in enumerate((p1, p2, p3, p1)): # <<<<<<<<<<<<<< @@ -18768,7 +18713,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct */ __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -18787,50 +18732,50 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct for (;;) { if (__pyx_t_4 >= 4) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 1090, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1094, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; - /* "pygame/_sdl2/video.pyx":1095 + /* "pygame/_sdl2/video.pyx":1091 * * for i, pos in enumerate((p1, p2, p3, p1)): * fpoints[i].x = pos[0] # <<<<<<<<<<<<<< * fpoints[i].y = pos[1] * */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).x = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1096 + /* "pygame/_sdl2/video.pyx":1092 * for i, pos in enumerate((p1, p2, p3, p1)): * fpoints[i].x = pos[0] * fpoints[i].y = pos[1] # <<<<<<<<<<<<<< * * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 4) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1092, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1092, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).y = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1094 + /* "pygame/_sdl2/video.pyx":1090 * cdef SDL_FPoint fpoints[4] * * for i, pos in enumerate((p1, p2, p3, p1)): # <<<<<<<<<<<<<< @@ -18841,7 +18786,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1098 + /* "pygame/_sdl2/video.pyx":1094 * fpoints[i].y = pos[1] * * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 4) # <<<<<<<<<<<<<< @@ -18850,7 +18795,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct */ __pyx_v_res = SDL_RenderDrawLinesF(__pyx_v_self->_renderer, __pyx_v_fpoints, 4); - /* "pygame/_sdl2/video.pyx":1100 + /* "pygame/_sdl2/video.pyx":1096 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 4) * * if res < 0: # <<<<<<<<<<<<<< @@ -18860,14 +18805,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct __pyx_t_7 = (__pyx_v_res < 0); if (unlikely(__pyx_t_7)) { - /* "pygame/_sdl2/video.pyx":1101 + /* "pygame/_sdl2/video.pyx":1097 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def fill_triangle(self, p1, p2, p3): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1101, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -18885,15 +18830,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct PyObject *__pyx_callargs[1] = {__pyx_t_2, }; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1101, __pyx_L1_error) + __PYX_ERR(0, 1097, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1100 + /* "pygame/_sdl2/video.pyx":1096 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 4) * * if res < 0: # <<<<<<<<<<<<<< @@ -18902,7 +18847,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1090 + /* "pygame/_sdl2/video.pyx":1086 * raise error() * * def draw_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -18927,7 +18872,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1103 +/* "pygame/_sdl2/video.pyx":1099 * raise error() * * def fill_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -18983,26 +18928,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1103, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1103, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1103, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1099, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p3)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1103, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1103, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1099, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_triangle") < 0)) __PYX_ERR(0, 1103, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_triangle") < 0)) __PYX_ERR(0, 1099, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -19017,7 +18962,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1103, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1099, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.fill_triangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19051,7 +18996,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill_triangle", 0); - /* "pygame/_sdl2/video.pyx":1105 + /* "pygame/_sdl2/video.pyx":1101 * def fill_triangle(self, p1, p2, p3): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19061,14 +19006,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct __pyx_t_1 = (!(SDL_VERSION_ATLEAST(2, 0, 18) != 0)); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1106 + /* "pygame/_sdl2/video.pyx":1102 * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): * raise error("fill_triangle requires SDL 2.0.18 or newer") # <<<<<<<<<<<<<< * * cdef Uint8[4] rgba */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19086,15 +19031,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_fill_triangle_requires_SDL_2_0_1}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1106, __pyx_L1_error) + __PYX_ERR(0, 1102, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1105 + /* "pygame/_sdl2/video.pyx":1101 * def fill_triangle(self, p1, p2, p3): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19103,7 +19048,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1110 + /* "pygame/_sdl2/video.pyx":1106 * cdef Uint8[4] rgba * * cdef int res = SDL_GetRenderDrawColor(self._renderer, # <<<<<<<<<<<<<< @@ -19112,7 +19057,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ __pyx_v_res = SDL_GetRenderDrawColor(__pyx_v_self->_renderer, (&(__pyx_v_rgba[0])), (&(__pyx_v_rgba[1])), (&(__pyx_v_rgba[2])), (&(__pyx_v_rgba[3]))); - /* "pygame/_sdl2/video.pyx":1116 + /* "pygame/_sdl2/video.pyx":1112 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19122,14 +19067,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1117 + /* "pygame/_sdl2/video.pyx":1113 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * cdef SDL_Vertex vertices[3] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19147,15 +19092,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct PyObject *__pyx_callargs[1] = {__pyx_t_4, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1117, __pyx_L1_error) + __PYX_ERR(0, 1113, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1116 + /* "pygame/_sdl2/video.pyx":1112 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19164,7 +19109,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1120 + /* "pygame/_sdl2/video.pyx":1116 * * cdef SDL_Vertex vertices[3] * for i, pos in enumerate((p1, p2, p3)): # <<<<<<<<<<<<<< @@ -19173,7 +19118,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -19189,90 +19134,90 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct for (;;) { if (__pyx_t_6 >= 3) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; - /* "pygame/_sdl2/video.pyx":1121 + /* "pygame/_sdl2/video.pyx":1117 * cdef SDL_Vertex vertices[3] * for i, pos in enumerate((p1, p2, p3)): * vertices[i].position.x = pos[0] # <<<<<<<<<<<<<< * vertices[i].position.y = pos[1] * vertices[i].color.r = rgba[0] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1117, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.x = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1122 + /* "pygame/_sdl2/video.pyx":1118 * for i, pos in enumerate((p1, p2, p3)): * vertices[i].position.x = pos[0] * vertices[i].position.y = pos[1] # <<<<<<<<<<<<<< * vertices[i].color.r = rgba[0] * vertices[i].color.g = rgba[1] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.y = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1123 + /* "pygame/_sdl2/video.pyx":1119 * vertices[i].position.x = pos[0] * vertices[i].position.y = pos[1] * vertices[i].color.r = rgba[0] # <<<<<<<<<<<<<< * vertices[i].color.g = rgba[1] * vertices[i].color.b = rgba[2] */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1123, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.r = (__pyx_v_rgba[0]); - /* "pygame/_sdl2/video.pyx":1124 + /* "pygame/_sdl2/video.pyx":1120 * vertices[i].position.y = pos[1] * vertices[i].color.r = rgba[0] * vertices[i].color.g = rgba[1] # <<<<<<<<<<<<<< * vertices[i].color.b = rgba[2] * vertices[i].color.a = rgba[3] */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1120, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.g = (__pyx_v_rgba[1]); - /* "pygame/_sdl2/video.pyx":1125 + /* "pygame/_sdl2/video.pyx":1121 * vertices[i].color.r = rgba[0] * vertices[i].color.g = rgba[1] * vertices[i].color.b = rgba[2] # <<<<<<<<<<<<<< * vertices[i].color.a = rgba[3] * */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.b = (__pyx_v_rgba[2]); - /* "pygame/_sdl2/video.pyx":1126 + /* "pygame/_sdl2/video.pyx":1122 * vertices[i].color.g = rgba[1] * vertices[i].color.b = rgba[2] * vertices[i].color.a = rgba[3] # <<<<<<<<<<<<<< * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.a = (__pyx_v_rgba[3]); - /* "pygame/_sdl2/video.pyx":1120 + /* "pygame/_sdl2/video.pyx":1116 * * cdef SDL_Vertex vertices[3] * for i, pos in enumerate((p1, p2, p3)): # <<<<<<<<<<<<<< @@ -19283,7 +19228,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pygame/_sdl2/video.pyx":1128 + /* "pygame/_sdl2/video.pyx":1124 * vertices[i].color.a = rgba[3] * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) # <<<<<<<<<<<<<< @@ -19292,7 +19237,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ __pyx_v_res = SDL_RenderGeometry(__pyx_v_self->_renderer, NULL, __pyx_v_vertices, 3, NULL, 0); - /* "pygame/_sdl2/video.pyx":1129 + /* "pygame/_sdl2/video.pyx":1125 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -19302,14 +19247,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1130 + /* "pygame/_sdl2/video.pyx":1126 * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def draw_quad(self, p1, p2, p3, p4): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -19327,15 +19272,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct PyObject *__pyx_callargs[1] = {__pyx_t_3, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1130, __pyx_L1_error) + __PYX_ERR(0, 1126, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1129 + /* "pygame/_sdl2/video.pyx":1125 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -19344,7 +19289,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1103 + /* "pygame/_sdl2/video.pyx":1099 * raise error() * * def fill_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -19369,7 +19314,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1132 +/* "pygame/_sdl2/video.pyx":1128 * raise error() * * def draw_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -19428,33 +19373,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 1); __PYX_ERR(0, 1132, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 1); __PYX_ERR(0, 1128, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p3)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 2); __PYX_ERR(0, 1132, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 2); __PYX_ERR(0, 1128, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p4)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1128, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 3); __PYX_ERR(0, 1132, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 3); __PYX_ERR(0, 1128, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_quad") < 0)) __PYX_ERR(0, 1132, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "draw_quad") < 0)) __PYX_ERR(0, 1128, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; @@ -19471,7 +19416,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1132, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1128, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_quad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19504,7 +19449,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("draw_quad", 0); - /* "pygame/_sdl2/video.pyx":1135 + /* "pygame/_sdl2/video.pyx":1131 * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[5] * for i, pos in enumerate((p1, p2, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -19513,7 +19458,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p */ __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; - __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -19535,50 +19480,50 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p for (;;) { if (__pyx_t_4 >= 5) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 1131, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; - /* "pygame/_sdl2/video.pyx":1136 + /* "pygame/_sdl2/video.pyx":1132 * cdef SDL_FPoint fpoints[5] * for i, pos in enumerate((p1, p2, p3, p4, p1)): * fpoints[i].x = pos[0] # <<<<<<<<<<<<<< * fpoints[i].y = pos[1] * */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1132, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).x = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1137 + /* "pygame/_sdl2/video.pyx":1133 * for i, pos in enumerate((p1, p2, p3, p4, p1)): * fpoints[i].x = pos[0] * fpoints[i].y = pos[1] # <<<<<<<<<<<<<< * * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 5) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1137, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1137, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1137, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1133, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).y = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1135 + /* "pygame/_sdl2/video.pyx":1131 * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[5] * for i, pos in enumerate((p1, p2, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -19589,7 +19534,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1139 + /* "pygame/_sdl2/video.pyx":1135 * fpoints[i].y = pos[1] * * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 5) # <<<<<<<<<<<<<< @@ -19598,7 +19543,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p */ __pyx_v_res = SDL_RenderDrawLinesF(__pyx_v_self->_renderer, __pyx_v_fpoints, 5); - /* "pygame/_sdl2/video.pyx":1141 + /* "pygame/_sdl2/video.pyx":1137 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 5) * * if res < 0: # <<<<<<<<<<<<<< @@ -19608,14 +19553,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p __pyx_t_7 = (__pyx_v_res < 0); if (unlikely(__pyx_t_7)) { - /* "pygame/_sdl2/video.pyx":1142 + /* "pygame/_sdl2/video.pyx":1138 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def fill_quad(self, p1, p2, p3, p4): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -19633,15 +19578,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p PyObject *__pyx_callargs[1] = {__pyx_t_2, }; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1142, __pyx_L1_error) + __PYX_ERR(0, 1138, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1141 + /* "pygame/_sdl2/video.pyx":1137 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 5) * * if res < 0: # <<<<<<<<<<<<<< @@ -19650,7 +19595,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1132 + /* "pygame/_sdl2/video.pyx":1128 * raise error() * * def draw_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -19675,7 +19620,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1144 +/* "pygame/_sdl2/video.pyx":1140 * raise error() * * def fill_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -19734,33 +19679,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 1); __PYX_ERR(0, 1144, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 1); __PYX_ERR(0, 1140, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p3)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 2); __PYX_ERR(0, 1144, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 2); __PYX_ERR(0, 1140, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p4)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 3); __PYX_ERR(0, 1144, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 3); __PYX_ERR(0, 1140, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_quad") < 0)) __PYX_ERR(0, 1144, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fill_quad") < 0)) __PYX_ERR(0, 1140, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; @@ -19777,7 +19722,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1144, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1140, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.fill_quad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -19811,7 +19756,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("fill_quad", 0); - /* "pygame/_sdl2/video.pyx":1146 + /* "pygame/_sdl2/video.pyx":1142 * def fill_quad(self, p1, p2, p3, p4): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19821,14 +19766,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p __pyx_t_1 = (!(SDL_VERSION_ATLEAST(2, 0, 18) != 0)); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1147 + /* "pygame/_sdl2/video.pyx":1143 * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): * raise error("fill_quad requires SDL 2.0.18 or newer") # <<<<<<<<<<<<<< * * cdef Uint8[4] rgba */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1147, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19846,15 +19791,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_s_fill_quad_requires_SDL_2_0_18_or}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1147, __pyx_L1_error) + __PYX_ERR(0, 1143, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1146 + /* "pygame/_sdl2/video.pyx":1142 * def fill_quad(self, p1, p2, p3, p4): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19863,7 +19808,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1151 + /* "pygame/_sdl2/video.pyx":1147 * cdef Uint8[4] rgba * * cdef int res = SDL_GetRenderDrawColor(self._renderer, # <<<<<<<<<<<<<< @@ -19872,7 +19817,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ __pyx_v_res = SDL_GetRenderDrawColor(__pyx_v_self->_renderer, (&(__pyx_v_rgba[0])), (&(__pyx_v_rgba[1])), (&(__pyx_v_rgba[2])), (&(__pyx_v_rgba[3]))); - /* "pygame/_sdl2/video.pyx":1157 + /* "pygame/_sdl2/video.pyx":1153 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19882,14 +19827,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1158 + /* "pygame/_sdl2/video.pyx":1154 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * cdef SDL_Vertex vertices[6] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1158, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19907,15 +19852,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p PyObject *__pyx_callargs[1] = {__pyx_t_4, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1158, __pyx_L1_error) + __PYX_ERR(0, 1154, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1157 + /* "pygame/_sdl2/video.pyx":1153 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19924,7 +19869,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1161 + /* "pygame/_sdl2/video.pyx":1157 * * cdef SDL_Vertex vertices[6] * for i, pos in enumerate((p1, p2, p3, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -19933,7 +19878,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ __Pyx_INCREF(__pyx_int_0); __pyx_t_2 = __pyx_int_0; - __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -19958,90 +19903,90 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p for (;;) { if (__pyx_t_6 >= 6) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1157, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1161, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; - /* "pygame/_sdl2/video.pyx":1162 + /* "pygame/_sdl2/video.pyx":1158 * cdef SDL_Vertex vertices[6] * for i, pos in enumerate((p1, p2, p3, p3, p4, p1)): * vertices[i].position.x = pos[0] # <<<<<<<<<<<<<< * vertices[i].position.y = pos[1] * vertices[i].color.r = rgba[0] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.x = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1163 + /* "pygame/_sdl2/video.pyx":1159 * for i, pos in enumerate((p1, p2, p3, p3, p4, p1)): * vertices[i].position.x = pos[0] * vertices[i].position.y = pos[1] # <<<<<<<<<<<<<< * vertices[i].color.r = rgba[0] * vertices[i].color.g = rgba[1] */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1163, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1163, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.y = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1164 + /* "pygame/_sdl2/video.pyx":1160 * vertices[i].position.x = pos[0] * vertices[i].position.y = pos[1] * vertices[i].color.r = rgba[0] # <<<<<<<<<<<<<< * vertices[i].color.g = rgba[1] * vertices[i].color.b = rgba[2] */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1164, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1160, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.r = (__pyx_v_rgba[0]); - /* "pygame/_sdl2/video.pyx":1165 + /* "pygame/_sdl2/video.pyx":1161 * vertices[i].position.y = pos[1] * vertices[i].color.r = rgba[0] * vertices[i].color.g = rgba[1] # <<<<<<<<<<<<<< * vertices[i].color.b = rgba[2] * vertices[i].color.a = rgba[3] */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1165, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1161, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.g = (__pyx_v_rgba[1]); - /* "pygame/_sdl2/video.pyx":1166 + /* "pygame/_sdl2/video.pyx":1162 * vertices[i].color.r = rgba[0] * vertices[i].color.g = rgba[1] * vertices[i].color.b = rgba[2] # <<<<<<<<<<<<<< * vertices[i].color.a = rgba[3] * */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1166, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.b = (__pyx_v_rgba[2]); - /* "pygame/_sdl2/video.pyx":1167 + /* "pygame/_sdl2/video.pyx":1163 * vertices[i].color.g = rgba[1] * vertices[i].color.b = rgba[2] * vertices[i].color.a = rgba[3] # <<<<<<<<<<<<<< * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) */ - __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1167, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1163, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.a = (__pyx_v_rgba[3]); - /* "pygame/_sdl2/video.pyx":1161 + /* "pygame/_sdl2/video.pyx":1157 * * cdef SDL_Vertex vertices[6] * for i, pos in enumerate((p1, p2, p3, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -20052,7 +19997,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "pygame/_sdl2/video.pyx":1169 + /* "pygame/_sdl2/video.pyx":1165 * vertices[i].color.a = rgba[3] * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) # <<<<<<<<<<<<<< @@ -20061,7 +20006,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ __pyx_v_res = SDL_RenderGeometry(__pyx_v_self->_renderer, NULL, __pyx_v_vertices, 6, NULL, 0); - /* "pygame/_sdl2/video.pyx":1170 + /* "pygame/_sdl2/video.pyx":1166 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -20071,14 +20016,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1171 + /* "pygame/_sdl2/video.pyx":1167 * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def to_surface(self, surface=None, area=None): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -20096,15 +20041,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p PyObject *__pyx_callargs[1] = {__pyx_t_3, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1171, __pyx_L1_error) + __PYX_ERR(0, 1167, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1170 + /* "pygame/_sdl2/video.pyx":1166 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -20113,7 +20058,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1144 + /* "pygame/_sdl2/video.pyx":1140 * raise error() * * def fill_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -20138,7 +20083,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1173 +/* "pygame/_sdl2/video.pyx":1169 * raise error() * * def to_surface(self, surface=None, area=None): # <<<<<<<<<<<<<< @@ -20196,19 +20141,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_surface); if (value) { values[0] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_area); if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_surface") < 0)) __PYX_ERR(0, 1173, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "to_surface") < 0)) __PYX_ERR(0, 1169, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -20225,7 +20170,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("to_surface", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 1173, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_surface", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 1169, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.to_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -20261,7 +20206,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __Pyx_RefNannySetupContext("to_surface", 0); __Pyx_INCREF(__pyx_v_surface); - /* "pygame/_sdl2/video.pyx":1201 + /* "pygame/_sdl2/video.pyx":1197 * * # obtain area to use * if area is not None: # <<<<<<<<<<<<<< @@ -20271,7 +20216,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_1 = (__pyx_v_area != Py_None); if (__pyx_t_1) { - /* "pygame/_sdl2/video.pyx":1203 + /* "pygame/_sdl2/video.pyx":1199 * if area is not None: * * rectptr = pgRect_FromObject(area, &rarea) # <<<<<<<<<<<<<< @@ -20280,7 +20225,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ __pyx_v_rectptr = pgRect_FromObject(__pyx_v_area, (&__pyx_v_rarea)); - /* "pygame/_sdl2/video.pyx":1204 + /* "pygame/_sdl2/video.pyx":1200 * * rectptr = pgRect_FromObject(area, &rarea) * if rectptr == NULL: # <<<<<<<<<<<<<< @@ -20290,20 +20235,20 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_1 = (__pyx_v_rectptr == NULL); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1205 + /* "pygame/_sdl2/video.pyx":1201 * rectptr = pgRect_FromObject(area, &rarea) * if rectptr == NULL: * raise TypeError('area must be None or a rect') # <<<<<<<<<<<<<< * * # clip area */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __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_ERR(0, 1205, __pyx_L1_error) + __PYX_ERR(0, 1201, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1204 + /* "pygame/_sdl2/video.pyx":1200 * * rectptr = pgRect_FromObject(area, &rarea) * if rectptr == NULL: # <<<<<<<<<<<<<< @@ -20312,7 +20257,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1208 + /* "pygame/_sdl2/video.pyx":1204 * * # clip area * SDL_RenderGetViewport(self._renderer, &tempviewport) # <<<<<<<<<<<<<< @@ -20321,7 +20266,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ SDL_RenderGetViewport(__pyx_v_self->_renderer, (&__pyx_v_tempviewport)); - /* "pygame/_sdl2/video.pyx":1209 + /* "pygame/_sdl2/video.pyx":1205 * # clip area * SDL_RenderGetViewport(self._renderer, &tempviewport) * SDL_IntersectRect(rectptr, &tempviewport, rectptr) # <<<<<<<<<<<<<< @@ -20330,7 +20275,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ (void)(SDL_IntersectRect(__pyx_v_rectptr, (&__pyx_v_tempviewport), __pyx_v_rectptr)); - /* "pygame/_sdl2/video.pyx":1211 + /* "pygame/_sdl2/video.pyx":1207 * SDL_IntersectRect(rectptr, &tempviewport, rectptr) * * areaparam = rectptr # <<<<<<<<<<<<<< @@ -20339,7 +20284,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ __pyx_v_areaparam = __pyx_v_rectptr; - /* "pygame/_sdl2/video.pyx":1212 + /* "pygame/_sdl2/video.pyx":1208 * * areaparam = rectptr * rarea.x = rectptr.x # <<<<<<<<<<<<<< @@ -20349,7 +20294,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_3 = __pyx_v_rectptr->x; __pyx_v_rarea.x = __pyx_t_3; - /* "pygame/_sdl2/video.pyx":1213 + /* "pygame/_sdl2/video.pyx":1209 * areaparam = rectptr * rarea.x = rectptr.x * rarea.y = rectptr.y # <<<<<<<<<<<<<< @@ -20359,7 +20304,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_3 = __pyx_v_rectptr->y; __pyx_v_rarea.y = __pyx_t_3; - /* "pygame/_sdl2/video.pyx":1214 + /* "pygame/_sdl2/video.pyx":1210 * rarea.x = rectptr.x * rarea.y = rectptr.y * rarea.w = rectptr.w # <<<<<<<<<<<<<< @@ -20369,7 +20314,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_3 = __pyx_v_rectptr->w; __pyx_v_rarea.w = __pyx_t_3; - /* "pygame/_sdl2/video.pyx":1215 + /* "pygame/_sdl2/video.pyx":1211 * rarea.y = rectptr.y * rarea.w = rectptr.w * rarea.h = rectptr.h # <<<<<<<<<<<<<< @@ -20379,7 +20324,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_3 = __pyx_v_rectptr->h; __pyx_v_rarea.h = __pyx_t_3; - /* "pygame/_sdl2/video.pyx":1201 + /* "pygame/_sdl2/video.pyx":1197 * * # obtain area to use * if area is not None: # <<<<<<<<<<<<<< @@ -20389,7 +20334,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ goto __pyx_L3; } - /* "pygame/_sdl2/video.pyx":1217 + /* "pygame/_sdl2/video.pyx":1213 * rarea.h = rectptr.h * else: * SDL_RenderGetViewport(self._renderer, &rarea) # <<<<<<<<<<<<<< @@ -20399,7 +20344,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ /*else*/ { SDL_RenderGetViewport(__pyx_v_self->_renderer, (&__pyx_v_rarea)); - /* "pygame/_sdl2/video.pyx":1218 + /* "pygame/_sdl2/video.pyx":1214 * else: * SDL_RenderGetViewport(self._renderer, &rarea) * areaparam = NULL # <<<<<<<<<<<<<< @@ -20410,7 +20355,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ } __pyx_L3:; - /* "pygame/_sdl2/video.pyx":1221 + /* "pygame/_sdl2/video.pyx":1217 * * # prepare surface * if surface is None: # <<<<<<<<<<<<<< @@ -20420,7 +20365,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_1 = (__pyx_v_surface == Py_None); if (__pyx_t_1) { - /* "pygame/_sdl2/video.pyx":1223 + /* "pygame/_sdl2/video.pyx":1219 * if surface is None: * # create a new surface * format = SDL_GetWindowPixelFormat(self._win._win) # <<<<<<<<<<<<<< @@ -20429,7 +20374,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ __pyx_v_format = SDL_GetWindowPixelFormat(__pyx_v_self->_win->_win); - /* "pygame/_sdl2/video.pyx":1224 + /* "pygame/_sdl2/video.pyx":1220 * # create a new surface * format = SDL_GetWindowPixelFormat(self._win._win) * if format == SDL_PIXELFORMAT_UNKNOWN: # <<<<<<<<<<<<<< @@ -20439,14 +20384,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_1 = (__pyx_v_format == SDL_PIXELFORMAT_UNKNOWN); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1225 + /* "pygame/_sdl2/video.pyx":1221 * format = SDL_GetWindowPixelFormat(self._win._win) * if format == SDL_PIXELFORMAT_UNKNOWN: * raise error() # <<<<<<<<<<<<<< * * surf = SDL_CreateRGBSurfaceWithFormat( */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1225, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_3 = 0; @@ -20464,15 +20409,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ PyObject *__pyx_callargs[1] = {__pyx_t_5, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_3, 0+__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1225, __pyx_L1_error) + __PYX_ERR(0, 1221, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1224 + /* "pygame/_sdl2/video.pyx":1220 * # create a new surface * format = SDL_GetWindowPixelFormat(self._win._win) * if format == SDL_PIXELFORMAT_UNKNOWN: # <<<<<<<<<<<<<< @@ -20481,7 +20426,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1227 + /* "pygame/_sdl2/video.pyx":1223 * raise error() * * surf = SDL_CreateRGBSurfaceWithFormat( # <<<<<<<<<<<<<< @@ -20490,7 +20435,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ __pyx_v_surf = SDL_CreateRGBSurfaceWithFormat(0, __pyx_v_rarea.w, __pyx_v_rarea.h, SDL_BITSPERPIXEL(__pyx_v_format), __pyx_v_format); - /* "pygame/_sdl2/video.pyx":1232 + /* "pygame/_sdl2/video.pyx":1228 * SDL_BITSPERPIXEL(format), * format) * if surf == NULL: # <<<<<<<<<<<<<< @@ -20500,20 +20445,20 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_1 = (__pyx_v_surf == NULL); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1233 + /* "pygame/_sdl2/video.pyx":1229 * format) * if surf == NULL: * raise MemoryError("not enough memory for the surface") # <<<<<<<<<<<<<< * * surface = pgSurface_New2(surf, 1) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __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_ERR(0, 1233, __pyx_L1_error) + __PYX_ERR(0, 1229, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1232 + /* "pygame/_sdl2/video.pyx":1228 * SDL_BITSPERPIXEL(format), * format) * if surf == NULL: # <<<<<<<<<<<<<< @@ -20522,7 +20467,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1235 + /* "pygame/_sdl2/video.pyx":1231 * raise MemoryError("not enough memory for the surface") * * surface = pgSurface_New2(surf, 1) # <<<<<<<<<<<<<< @@ -20535,7 +20480,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __Pyx_DECREF_SET(__pyx_v_surface, __pyx_t_2); __pyx_t_2 = 0; - /* "pygame/_sdl2/video.pyx":1221 + /* "pygame/_sdl2/video.pyx":1217 * * # prepare surface * if surface is None: # <<<<<<<<<<<<<< @@ -20545,7 +20490,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ goto __pyx_L5; } - /* "pygame/_sdl2/video.pyx":1236 + /* "pygame/_sdl2/video.pyx":1232 * * surface = pgSurface_New2(surf, 1) * elif pgSurface_Check(surface): # <<<<<<<<<<<<<< @@ -20555,7 +20500,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_1 = (pgSurface_Check(__pyx_v_surface) != 0); if (likely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1237 + /* "pygame/_sdl2/video.pyx":1233 * surface = pgSurface_New2(surf, 1) * elif pgSurface_Check(surface): * surf = pgSurface_AsSurface(surface) # <<<<<<<<<<<<<< @@ -20564,7 +20509,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ __pyx_v_surf = pgSurface_AsSurface(__pyx_v_surface); - /* "pygame/_sdl2/video.pyx":1238 + /* "pygame/_sdl2/video.pyx":1234 * elif pgSurface_Check(surface): * surf = pgSurface_AsSurface(surface) * if surf.w < rarea.w or surf.h < rarea.h: # <<<<<<<<<<<<<< @@ -20582,20 +20527,20 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1239 + /* "pygame/_sdl2/video.pyx":1235 * surf = pgSurface_AsSurface(surface) * if surf.w < rarea.w or surf.h < rarea.h: * raise ValueError("the surface is too small") # <<<<<<<<<<<<<< * format = surf.format.format * else: */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1235, __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_ERR(0, 1239, __pyx_L1_error) + __PYX_ERR(0, 1235, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1238 + /* "pygame/_sdl2/video.pyx":1234 * elif pgSurface_Check(surface): * surf = pgSurface_AsSurface(surface) * if surf.w < rarea.w or surf.h < rarea.h: # <<<<<<<<<<<<<< @@ -20604,7 +20549,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1240 + /* "pygame/_sdl2/video.pyx":1236 * if surf.w < rarea.w or surf.h < rarea.h: * raise ValueError("the surface is too small") * format = surf.format.format # <<<<<<<<<<<<<< @@ -20614,7 +20559,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_t_8 = __pyx_v_surf->format->format; __pyx_v_format = __pyx_t_8; - /* "pygame/_sdl2/video.pyx":1236 + /* "pygame/_sdl2/video.pyx":1232 * * surface = pgSurface_New2(surf, 1) * elif pgSurface_Check(surface): # <<<<<<<<<<<<<< @@ -20624,7 +20569,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ goto __pyx_L5; } - /* "pygame/_sdl2/video.pyx":1242 + /* "pygame/_sdl2/video.pyx":1238 * format = surf.format.format * else: * raise TypeError("'surface' must be a surface or None") # <<<<<<<<<<<<<< @@ -20632,15 +20577,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ * if SDL_RenderReadPixels(self._renderer, */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __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_ERR(0, 1242, __pyx_L1_error) + __PYX_ERR(0, 1238, __pyx_L1_error) } __pyx_L5:; - /* "pygame/_sdl2/video.pyx":1246 + /* "pygame/_sdl2/video.pyx":1242 * if SDL_RenderReadPixels(self._renderer, * areaparam, * format, surf.pixels, surf.pitch) < 0: # <<<<<<<<<<<<<< @@ -20649,7 +20594,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ __pyx_t_1 = (SDL_RenderReadPixels(__pyx_v_self->_renderer, __pyx_v_areaparam, __pyx_v_format, __pyx_v_surf->pixels, __pyx_v_surf->pitch) < 0); - /* "pygame/_sdl2/video.pyx":1244 + /* "pygame/_sdl2/video.pyx":1240 * raise TypeError("'surface' must be a surface or None") * * if SDL_RenderReadPixels(self._renderer, # <<<<<<<<<<<<<< @@ -20658,14 +20603,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1247 + /* "pygame/_sdl2/video.pyx":1243 * areaparam, * format, surf.pixels, surf.pitch) < 0: * raise error() # <<<<<<<<<<<<<< * return surface * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_3 = 0; @@ -20683,15 +20628,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ PyObject *__pyx_callargs[1] = {__pyx_t_5, }; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_3, 0+__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1247, __pyx_L1_error) + __PYX_ERR(0, 1243, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1244 + /* "pygame/_sdl2/video.pyx":1240 * raise TypeError("'surface' must be a surface or None") * * if SDL_RenderReadPixels(self._renderer, # <<<<<<<<<<<<<< @@ -20700,7 +20645,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1248 + /* "pygame/_sdl2/video.pyx":1244 * format, surf.pixels, surf.pitch) < 0: * raise error() * return surface # <<<<<<<<<<<<<< @@ -20712,7 +20657,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ __pyx_r = __pyx_v_surface; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":1173 + /* "pygame/_sdl2/video.pyx":1169 * raise error() * * def to_surface(self, surface=None, area=None): # <<<<<<<<<<<<<< @@ -20734,7 +20679,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1250 +/* "pygame/_sdl2/video.pyx":1246 * return surface * * @staticmethod # <<<<<<<<<<<<<< @@ -20788,19 +20733,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds switch (__pyx_nargs) { case 0: if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_color_mode)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1250, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_alpha_mode)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1250, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("compose_custom_blend_mode", 1, 2, 2, 1); __PYX_ERR(0, 1250, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compose_custom_blend_mode", 1, 2, 2, 1); __PYX_ERR(0, 1246, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compose_custom_blend_mode") < 0)) __PYX_ERR(0, 1250, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "compose_custom_blend_mode") < 0)) __PYX_ERR(0, 1246, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20813,7 +20758,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("compose_custom_blend_mode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1250, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compose_custom_blend_mode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1246, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.compose_custom_blend_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -20846,79 +20791,79 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend int __pyx_clineno = 0; __Pyx_RefNannySetupContext("compose_custom_blend_mode", 0); - /* "pygame/_sdl2/video.pyx":1263 + /* "pygame/_sdl2/video.pyx":1259 * """ * # https://wiki.libsdl.org/SDL_ComposeCustomBlendMode * cdef int res = SDL_ComposeCustomBlendMode(color_mode[0], # <<<<<<<<<<<<<< * color_mode[1], * color_mode[2], */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color_mode, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color_mode, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L1_error) + __pyx_t_2 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1264 + /* "pygame/_sdl2/video.pyx":1260 * # https://wiki.libsdl.org/SDL_ComposeCustomBlendMode * cdef int res = SDL_ComposeCustomBlendMode(color_mode[0], * color_mode[1], # <<<<<<<<<<<<<< * color_mode[2], * alpha_mode[0], */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color_mode, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color_mode, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L1_error) + __pyx_t_3 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1265 + /* "pygame/_sdl2/video.pyx":1261 * cdef int res = SDL_ComposeCustomBlendMode(color_mode[0], * color_mode[1], * color_mode[2], # <<<<<<<<<<<<<< * alpha_mode[0], * alpha_mode[1], */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color_mode, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color_mode, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = ((SDL_BlendOperation)__Pyx_PyInt_As_SDL_BlendOperation(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_4 = ((SDL_BlendOperation)__Pyx_PyInt_As_SDL_BlendOperation(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1266 + /* "pygame/_sdl2/video.pyx":1262 * color_mode[1], * color_mode[2], * alpha_mode[0], # <<<<<<<<<<<<<< * alpha_mode[1], * alpha_mode[2]) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_alpha_mode, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_alpha_mode, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1266, __pyx_L1_error) + __pyx_t_5 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1267 + /* "pygame/_sdl2/video.pyx":1263 * color_mode[2], * alpha_mode[0], * alpha_mode[1], # <<<<<<<<<<<<<< * alpha_mode[2]) * if res < 0: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_alpha_mode, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_alpha_mode, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1267, __pyx_L1_error) + __pyx_t_6 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1268 + /* "pygame/_sdl2/video.pyx":1264 * alpha_mode[0], * alpha_mode[1], * alpha_mode[2]) # <<<<<<<<<<<<<< * if res < 0: * raise error() */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_alpha_mode, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_alpha_mode, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = ((SDL_BlendOperation)__Pyx_PyInt_As_SDL_BlendOperation(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L1_error) + __pyx_t_7 = ((SDL_BlendOperation)__Pyx_PyInt_As_SDL_BlendOperation(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1263 + /* "pygame/_sdl2/video.pyx":1259 * """ * # https://wiki.libsdl.org/SDL_ComposeCustomBlendMode * cdef int res = SDL_ComposeCustomBlendMode(color_mode[0], # <<<<<<<<<<<<<< @@ -20927,7 +20872,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend */ __pyx_v_res = SDL_ComposeCustomBlendMode(__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7); - /* "pygame/_sdl2/video.pyx":1269 + /* "pygame/_sdl2/video.pyx":1265 * alpha_mode[1], * alpha_mode[2]) * if res < 0: # <<<<<<<<<<<<<< @@ -20937,13 +20882,13 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend __pyx_t_8 = (__pyx_v_res < 0); if (unlikely(__pyx_t_8)) { - /* "pygame/_sdl2/video.pyx":1270 + /* "pygame/_sdl2/video.pyx":1266 * alpha_mode[2]) * if res < 0: * raise error() # <<<<<<<<<<<<<< * return res */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1270, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; @@ -20961,15 +20906,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend PyObject *__pyx_callargs[1] = {__pyx_t_10, }; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1270, __pyx_L1_error) + __PYX_ERR(0, 1266, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1269 + /* "pygame/_sdl2/video.pyx":1265 * alpha_mode[1], * alpha_mode[2]) * if res < 0: # <<<<<<<<<<<<<< @@ -20978,19 +20923,19 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend */ } - /* "pygame/_sdl2/video.pyx":1271 + /* "pygame/_sdl2/video.pyx":1267 * if res < 0: * raise error() * return res # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":1250 + /* "pygame/_sdl2/video.pyx":1246 * return surface * * @staticmethod # <<<<<<<<<<<<<< @@ -22459,64 +22404,64 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * else: * raise TypeError('target must be a Texture or None') # <<<<<<<<<<<<<< * - * cpdef object blit(self, object source, Rect dest=None, Rect area=None, int special_flags=0): + * cpdef object blit(self, object source, object dest=None, object area=None, int special_flags=0): */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_target_must_be_a_Texture_or_None); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - /* "pygame/_sdl2/video.pyx":1018 - * (source).draw(area, dest) - * elif not hasattr(source, 'draw'): - * raise TypeError('source must be drawable') # <<<<<<<<<<<<<< - * else: + /* "pygame/_sdl2/video.pyx":1016 * source.draw(area, dest) + * else: + * raise TypeError('source must be drawable') # <<<<<<<<<<<<<< + * + * if not dest: */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_source_must_be_drawable); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_source_must_be_drawable); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - /* "pygame/_sdl2/video.pyx":1205 + /* "pygame/_sdl2/video.pyx":1201 * rectptr = pgRect_FromObject(area, &rarea) * if rectptr == NULL: * raise TypeError('area must be None or a rect') # <<<<<<<<<<<<<< * * # clip area */ - __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_area_must_be_None_or_a_rect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1205, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_area_must_be_None_or_a_rect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - /* "pygame/_sdl2/video.pyx":1233 + /* "pygame/_sdl2/video.pyx":1229 * format) * if surf == NULL: * raise MemoryError("not enough memory for the surface") # <<<<<<<<<<<<<< * * surface = pgSurface_New2(surf, 1) */ - __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_not_enough_memory_for_the_surfac); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_not_enough_memory_for_the_surfac); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1229, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - /* "pygame/_sdl2/video.pyx":1239 + /* "pygame/_sdl2/video.pyx":1235 * surf = pgSurface_AsSurface(surface) * if surf.w < rarea.w or surf.h < rarea.h: * raise ValueError("the surface is too small") # <<<<<<<<<<<<<< * format = surf.format.format * else: */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_the_surface_is_too_small); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_the_surface_is_too_small); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1235, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - /* "pygame/_sdl2/video.pyx":1242 + /* "pygame/_sdl2/video.pyx":1238 * format = surf.format.format * else: * raise TypeError("'surface' must be a surface or None") # <<<<<<<<<<<<<< * * if SDL_RenderReadPixels(self._renderer, */ - __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_surface_must_be_a_surface_or_No); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_surface_must_be_a_surface_or_No); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1238, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); @@ -22733,7 +22678,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { /* "pygame/_sdl2/video.pyx":1000 * raise TypeError('target must be a Texture or None') * - * cpdef object blit(self, object source, Rect dest=None, Rect area=None, int special_flags=0): # <<<<<<<<<<<<<< + * cpdef object blit(self, object source, object dest=None, object area=None, int special_flags=0): # <<<<<<<<<<<<<< * """Draw textures using a Surface-like API * */ @@ -22745,122 +22690,122 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); - /* "pygame/_sdl2/video.pyx":1026 + /* "pygame/_sdl2/video.pyx":1022 * return dest * * def draw_line(self, p1, p2): # <<<<<<<<<<<<<< * """Draw a line * */ - __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_res); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_res); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1022, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); - __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_line, 1026, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_line, 1022, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1022, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1039 + /* "pygame/_sdl2/video.pyx":1035 * raise error() * * def draw_point(self, point): # <<<<<<<<<<<<<< * """Draw a point * */ - __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_res); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_res); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); - __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_point, 1039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_point, 1035, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1035, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1051 + /* "pygame/_sdl2/video.pyx":1047 * raise error() * * def draw_rect(self, rect): # <<<<<<<<<<<<<< * """Draw a rectangle outline * */ - __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_rect, __pyx_n_s_frect, __pyx_n_s_frectptr, __pyx_n_s_res); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_tuple__70 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_rect, __pyx_n_s_frect, __pyx_n_s_frectptr, __pyx_n_s_res); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); - __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_rect, 1051, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_rect, 1047, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1047, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1070 + /* "pygame/_sdl2/video.pyx":1066 * raise error() * * def fill_rect(self, rect): # <<<<<<<<<<<<<< * """Draw a filled rectangle * */ - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_fill_rect, 1070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_fill_rect, 1066, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1066, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1090 + /* "pygame/_sdl2/video.pyx":1086 * raise error() * * def draw_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[4] */ - __pyx_tuple__73 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_fpoints, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_res); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_tuple__73 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_fpoints, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_res); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__73); __Pyx_GIVEREF(__pyx_tuple__73); - __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_triangle, 1090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_triangle, 1086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1086, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1103 + /* "pygame/_sdl2/video.pyx":1099 * raise error() * * def fill_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): */ - __pyx_tuple__75 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_rgba, __pyx_n_s_res, __pyx_n_s_vertices, __pyx_n_s_i, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_tuple__75 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_rgba, __pyx_n_s_res, __pyx_n_s_vertices, __pyx_n_s_i, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); - __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_fill_triangle, 1103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_fill_triangle, 1099, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 1099, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1132 + /* "pygame/_sdl2/video.pyx":1128 * raise error() * * def draw_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[5] */ - __pyx_tuple__77 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_p4, __pyx_n_s_fpoints, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_res); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_tuple__77 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_p4, __pyx_n_s_fpoints, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_res); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__77); __Pyx_GIVEREF(__pyx_tuple__77); - __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_quad, 1132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_quad, 1128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1128, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1144 + /* "pygame/_sdl2/video.pyx":1140 * raise error() * * def fill_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): */ - __pyx_tuple__79 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_p4, __pyx_n_s_rgba, __pyx_n_s_res, __pyx_n_s_vertices, __pyx_n_s_i, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_tuple__79 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_p4, __pyx_n_s_rgba, __pyx_n_s_res, __pyx_n_s_vertices, __pyx_n_s_i, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); - __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_fill_quad, 1144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_fill_quad, 1140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1140, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1173 + /* "pygame/_sdl2/video.pyx":1169 * raise error() * * def to_surface(self, surface=None, area=None): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderReadPixels * """Read pixels from current rendering target and create a Surface (slow operation, use sparingly) */ - __pyx_tuple__81 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_surface, __pyx_n_s_area, __pyx_n_s_format_2, __pyx_n_s_rarea, __pyx_n_s_tempviewport, __pyx_n_s_areaparam, __pyx_n_s_surf, __pyx_n_s_rectptr); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_tuple__81 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_surface, __pyx_n_s_area, __pyx_n_s_format_2, __pyx_n_s_rarea, __pyx_n_s_tempviewport, __pyx_n_s_areaparam, __pyx_n_s_surf, __pyx_n_s_rectptr); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); - __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_to_surface, 1173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_to_surface, 1169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1169, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1250 + /* "pygame/_sdl2/video.pyx":1246 * return surface * * @staticmethod # <<<<<<<<<<<<<< * def compose_custom_blend_mode(color_mode, alpha_mode): * """Compose a custom blend mode */ - __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_color_mode, __pyx_n_s_alpha_mode, __pyx_n_s_res); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_color_mode, __pyx_n_s_alpha_mode, __pyx_n_s_res); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); - __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_compose_custom_blend_mode, 1250, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_compose_custom_blend_mode, 1246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -23939,7 +23884,7 @@ if (!__Pyx_RefNanny) { /* "pygame/_sdl2/video.pyx":1000 * raise TypeError('target must be a Texture or None') * - * cpdef object blit(self, object source, Rect dest=None, Rect area=None, int special_flags=0): # <<<<<<<<<<<<<< + * cpdef object blit(self, object source, object dest=None, object area=None, int special_flags=0): # <<<<<<<<<<<<<< * """Draw textures using a Surface-like API * */ @@ -23950,142 +23895,142 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1026 + /* "pygame/_sdl2/video.pyx":1022 * return dest * * def draw_line(self, p1, p2): # <<<<<<<<<<<<<< * """Draw a line * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_17draw_line, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_line, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_17draw_line, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_line, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1022, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_line, __pyx_t_4) < 0) __PYX_ERR(0, 1026, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_line, __pyx_t_4) < 0) __PYX_ERR(0, 1022, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1039 + /* "pygame/_sdl2/video.pyx":1035 * raise error() * * def draw_point(self, point): # <<<<<<<<<<<<<< * """Draw a point * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_19draw_point, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_point, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_19draw_point, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_point, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_point, __pyx_t_4) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_point, __pyx_t_4) < 0) __PYX_ERR(0, 1035, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1051 + /* "pygame/_sdl2/video.pyx":1047 * raise error() * * def draw_rect(self, rect): # <<<<<<<<<<<<<< * """Draw a rectangle outline * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_21draw_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_rect, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1051, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_21draw_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_rect, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_rect, __pyx_t_4) < 0) __PYX_ERR(0, 1051, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_rect, __pyx_t_4) < 0) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1070 + /* "pygame/_sdl2/video.pyx":1066 * raise error() * * def fill_rect(self, rect): # <<<<<<<<<<<<<< * """Draw a filled rectangle * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_23fill_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_rect, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1070, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_23fill_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_rect, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_rect, __pyx_t_4) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_rect, __pyx_t_4) < 0) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1090 + /* "pygame/_sdl2/video.pyx":1086 * raise error() * * def draw_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[4] */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_25draw_triangle, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_triangle, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_25draw_triangle, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_triangle, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_triangle, __pyx_t_4) < 0) __PYX_ERR(0, 1090, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_triangle, __pyx_t_4) < 0) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1103 + /* "pygame/_sdl2/video.pyx":1099 * raise error() * * def fill_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_27fill_triangle, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_triangle, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_27fill_triangle, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_triangle, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_triangle, __pyx_t_4) < 0) __PYX_ERR(0, 1103, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_triangle, __pyx_t_4) < 0) __PYX_ERR(0, 1099, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1132 + /* "pygame/_sdl2/video.pyx":1128 * raise error() * * def draw_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[5] */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_29draw_quad, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_quad, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_29draw_quad, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_quad, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_quad, __pyx_t_4) < 0) __PYX_ERR(0, 1132, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_quad, __pyx_t_4) < 0) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1144 + /* "pygame/_sdl2/video.pyx":1140 * raise error() * * def fill_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_31fill_quad, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_quad, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_31fill_quad, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_quad, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_quad, __pyx_t_4) < 0) __PYX_ERR(0, 1144, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_quad, __pyx_t_4) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1173 + /* "pygame/_sdl2/video.pyx":1169 * raise error() * * def to_surface(self, surface=None, area=None): # <<<<<<<<<<<<<< * # https://wiki.libsdl.org/SDL_RenderReadPixels * """Read pixels from current rendering target and create a Surface (slow operation, use sparingly) */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_33to_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_to_surface, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_33to_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_to_surface, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__54); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_to_surface, __pyx_t_4) < 0) __PYX_ERR(0, 1173, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_to_surface, __pyx_t_4) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1250 + /* "pygame/_sdl2/video.pyx":1246 * return surface * * @staticmethod # <<<<<<<<<<<<<< * def compose_custom_blend_mode(color_mode, alpha_mode): * """Compose a custom blend mode */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_35compose_custom_blend_mode, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_compose_custom_blend_mo, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_35compose_custom_blend_mode, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_compose_custom_blend_mo, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_compose_custom_blend_mode, __pyx_t_4) < 0) __PYX_ERR(0, 1250, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_compose_custom_blend_mode, __pyx_t_4) < 0) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer, __pyx_n_s_compose_custom_blend_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_4, (PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer, __pyx_n_s_compose_custom_blend_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_compose_custom_blend_mode, __pyx_t_5) < 0) __PYX_ERR(0, 1250, __pyx_L1_error) + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_compose_custom_blend_mode, __pyx_t_5) < 0) __PYX_ERR(0, 1246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); diff --git a/src_c/cython/pygame/_sdl2/video.pxd b/src_c/cython/pygame/_sdl2/video.pxd index bedfb8b967..03a88e9554 100644 --- a/src_c/cython/pygame/_sdl2/video.pxd +++ b/src_c/cython/pygame/_sdl2/video.pxd @@ -464,7 +464,7 @@ cdef class Renderer: cdef int _is_borrowed cpdef object get_viewport(self) - cpdef object blit(self, object source, Rect dest=*, Rect area=*, int special_flags=*) + cpdef object blit(self, object source, object dest=*, object area=*, int special_flags=*) cdef class Texture: cdef SDL_Texture* _tex diff --git a/src_c/cython/pygame/_sdl2/video.pyx b/src_c/cython/pygame/_sdl2/video.pyx index 59a11a1851..727fdc0b2b 100644 --- a/src_c/cython/pygame/_sdl2/video.pyx +++ b/src_c/cython/pygame/_sdl2/video.pyx @@ -997,7 +997,7 @@ cdef class Renderer: else: raise TypeError('target must be a Texture or None') - cpdef object blit(self, object source, Rect dest=None, Rect area=None, int special_flags=0): + cpdef object blit(self, object source, object dest=None, object area=None, int special_flags=0): """Draw textures using a Surface-like API For compatibility purposes. Draws :class:`Texture` objects onto the @@ -1010,14 +1010,10 @@ cdef class Renderer: .. note:: Textures created by different Renderers cannot shared with each other! """ - if isinstance(source, Texture): - (source).draw(area, dest) - elif isinstance(source, Image): - (source).draw(area, dest) - elif not hasattr(source, 'draw'): - raise TypeError('source must be drawable') - else: + if isinstance(source, (Texture,Image)) or hasattr(source, 'draw'): source.draw(area, dest) + else: + raise TypeError('source must be drawable') if not dest: return self.get_viewport()