From 18795cf8fd443ce3cbaad60110c43fee98f75260 Mon Sep 17 00:00:00 2001 From: Ankith Date: Sun, 28 Apr 2024 15:41:08 +0530 Subject: [PATCH] Add SurfaceWindow, remove borrowed window logic --- buildconfig/stubs/pygame/_sdl2/video.pyi | 2 - docs/reST/ref/sdl2_video.rst | 5 - src_c/_sdl2/audio.c | 6 +- src_c/_sdl2/controller_old.c | 6 +- src_c/_sdl2/mixer.c | 6 +- src_c/_sdl2/sdl2.c | 6 +- src_c/_sdl2/video.c | 2758 +++++++++------------- src_c/cython/pygame/_sdl2/video.pxd | 2 - src_c/cython/pygame/_sdl2/video.pyx | 21 - src_c/doc/sdl2_video_doc.h | 1 - src_c/include/_pygame.h | 7 +- src_c/window.c | 146 +- src_py/__init__.py | 4 +- 13 files changed, 1216 insertions(+), 1754 deletions(-) diff --git a/buildconfig/stubs/pygame/_sdl2/video.pyi b/buildconfig/stubs/pygame/_sdl2/video.pyi index dd12ae5f80..684bdd3c21 100644 --- a/buildconfig/stubs/pygame/_sdl2/video.pyi +++ b/buildconfig/stubs/pygame/_sdl2/video.pyi @@ -134,8 +134,6 @@ class Renderer: vsync: bool = False, target_texture: bool = False, ) -> None: ... - @classmethod - def from_window(cls, window: Window) -> Renderer: ... draw_blend_mode: int @property def draw_color(self) -> Color: ... diff --git a/docs/reST/ref/sdl2_video.rst b/docs/reST/ref/sdl2_video.rst index bb499ef441..a0d5859a29 100644 --- a/docs/reST/ref/sdl2_video.rst +++ b/docs/reST/ref/sdl2_video.rst @@ -392,11 +392,6 @@ A value of ``None`` means that no custom rendering target was set and the Renderer's window will be used as the target. - .. classmethod:: from_window - - | :sl:`Create a Renderer from an existing window` - | :sg:`from_window(window) -> Renderer` - .. method:: clear | :sl:`Clear the current rendering target with the drawing color` diff --git a/src_c/_sdl2/audio.c b/src_c/_sdl2/audio.c index 134fb25f2d..17f56fcd1e 100644 --- a/src_c/_sdl2/audio.c +++ b/src_c/_sdl2/audio.c @@ -6,7 +6,7 @@ "depends": [], "name": "pygame._sdl2.audio", "sources": [ - "src_c\\cython\\pygame\\_sdl2\\audio.pyx" + "src_c/cython/pygame/_sdl2/audio.pyx" ] }, "module_name": "pygame._sdl2.audio" @@ -1356,7 +1356,7 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "src_c\\\\cython\\\\pygame\\\\_sdl2\\\\audio.pyx", + "src_c/cython/pygame/_sdl2/audio.pyx", "", }; /* #### Code section: utility_code_proto_before_types ### */ @@ -2861,7 +2861,7 @@ static const char __pyx_k_AUDIO_ALLOW_FREQUENCY_CHANGE[] = "AUDIO_ALLOW_FREQUENC static const char __pyx_k_Audio_system_not_initialised[] = "Audio system not initialised"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; -static const char __pyx_k_src_c_cython_pygame__sdl2_audio[] = "src_c\\cython\\pygame\\_sdl2\\audio.pyx"; +static const char __pyx_k_src_c_cython_pygame__sdl2_audio[] = "src_c/cython/pygame/_sdl2/audio.pyx"; static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; diff --git a/src_c/_sdl2/controller_old.c b/src_c/_sdl2/controller_old.c index 17bf9f711c..a05e2a75ed 100644 --- a/src_c/_sdl2/controller_old.c +++ b/src_c/_sdl2/controller_old.c @@ -6,7 +6,7 @@ "depends": [], "name": "pygame._sdl2.controller_old", "sources": [ - "src_c\\cython\\pygame\\_sdl2\\controller_old.pyx" + "src_c/cython/pygame/_sdl2/controller_old.pyx" ] }, "module_name": "pygame._sdl2.controller_old" @@ -1355,7 +1355,7 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "src_c\\\\cython\\\\pygame\\\\_sdl2\\\\controller_old.pyx", + "src_c/cython/pygame/_sdl2/controller_old.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* #### Code section: numeric_typedefs ### */ @@ -2227,7 +2227,7 @@ static const char __pyx_k_called_on_a_closed_controller[] = "called on a closed static const char __pyx_k_Index_is_invalid_or_not_a_suppor[] = "Index is invalid or not a supported joystick."; static const char __pyx_k_gamecontroller_system_not_initia[] = "gamecontroller system not initialized"; static const char __pyx_k_should_be_a_pygame_joystick_Joys[] = "should be a pygame.joystick.Joystick object."; -static const char __pyx_k_src_c_cython_pygame__sdl2_contro[] = "src_c\\cython\\pygame\\_sdl2\\controller_old.pyx"; +static const char __pyx_k_src_c_cython_pygame__sdl2_contro[] = "src_c/cython/pygame/_sdl2/controller_old.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_6pygame_5_sdl2_14controller_old__gamecontroller_init_check(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_14controller_old_2_internal_mod_init(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ diff --git a/src_c/_sdl2/mixer.c b/src_c/_sdl2/mixer.c index 3fb836fa2b..51f0e0bebc 100644 --- a/src_c/_sdl2/mixer.c +++ b/src_c/_sdl2/mixer.c @@ -6,7 +6,7 @@ "depends": [], "name": "pygame._sdl2.mixer", "sources": [ - "src_c\\cython\\pygame\\_sdl2\\mixer.pyx" + "src_c/cython/pygame/_sdl2/mixer.pyx" ] }, "module_name": "pygame._sdl2.mixer" @@ -1358,7 +1358,7 @@ static const char *__pyx_filename; static const char *__pyx_f[] = { "", - "src_c\\\\cython\\\\pygame\\\\_sdl2\\\\mixer.pyx", + "src_c/cython/pygame/_sdl2/mixer.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* ForceInitThreads.proto */ @@ -2793,7 +2793,7 @@ static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array"; static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data."; static const char __pyx_k_strided_and_direct_or_indirect[] = ""; -static const char __pyx_k_src_c_cython_pygame__sdl2_mixer[] = "src_c\\cython\\pygame\\_sdl2\\mixer.pyx"; +static const char __pyx_k_src_c_cython_pygame__sdl2_mixer[] = "src_c/cython/pygame/_sdl2/mixer.pyx"; static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced"; static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides"; static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory."; diff --git a/src_c/_sdl2/sdl2.c b/src_c/_sdl2/sdl2.c index a9bc30edcc..feaf093595 100644 --- a/src_c/_sdl2/sdl2.c +++ b/src_c/_sdl2/sdl2.c @@ -6,7 +6,7 @@ "depends": [], "name": "pygame._sdl2.sdl2", "sources": [ - "src_c\\cython\\pygame\\_sdl2\\sdl2.pyx" + "src_c/cython/pygame/_sdl2/sdl2.pyx" ] }, "module_name": "pygame._sdl2.sdl2" @@ -1354,7 +1354,7 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "src_c\\\\cython\\\\pygame\\\\_sdl2\\\\sdl2.pyx", + "src_c/cython/pygame/_sdl2/sdl2.pyx", }; /* #### Code section: utility_code_proto_before_types ### */ /* #### Code section: numeric_typedefs ### */ @@ -1985,7 +1985,7 @@ static const char __pyx_k_pygame__sdl2_sdl2[] = "pygame._sdl2.sdl2"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_INIT_GAMECONTROLLER[] = "INIT_GAMECONTROLLER"; -static const char __pyx_k_src_c_cython_pygame__sdl2_sdl2_p[] = "src_c\\cython\\pygame\\_sdl2\\sdl2.pyx"; +static const char __pyx_k_src_c_cython_pygame__sdl2_sdl2_p[] = "src_c/cython/pygame/_sdl2/sdl2.pyx"; /* #### Code section: decls ### */ static PyObject *__pyx_pf_6pygame_5_sdl2_4sdl2_5error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_4sdl2_init_subsystem(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags); /* proto */ diff --git a/src_c/_sdl2/video.c b/src_c/_sdl2/video.c index 0e403f5f41..82f2791f98 100644 --- a/src_c/_sdl2/video.c +++ b/src_c/_sdl2/video.c @@ -6,7 +6,7 @@ "depends": [], "name": "pygame._sdl2.video", "sources": [ - "src_c\\cython\\pygame\\_sdl2\\video.pyx" + "src_c/cython/pygame/_sdl2/video.pyx" ] }, "module_name": "pygame._sdl2.video" @@ -1414,12 +1414,12 @@ static const char *__pyx_filename; /* #### Code section: filename_table ### */ static const char *__pyx_f[] = { - "src_c\\\\cython\\\\pygame\\\\_sdl2\\\\video.pyx", - "venv\\\\lib\\\\site-packages\\\\Cython\\\\Includes\\\\cpython\\\\contextvars.pxd", - "src_c\\\\cython\\\\pygame\\\\_sdl2\\\\video.pxd", - "venv\\\\lib\\\\site-packages\\\\Cython\\\\Includes\\\\cpython\\\\type.pxd", - "venv\\\\lib\\\\site-packages\\\\Cython\\\\Includes\\\\cpython\\\\bool.pxd", - "venv\\\\lib\\\\site-packages\\\\Cython\\\\Includes\\\\cpython\\\\complex.pxd", + "src_c/cython/pygame/_sdl2/video.pyx", + "contextvars.pxd", + "src_c/cython/pygame/_sdl2/video.pxd", + "type.pxd", + "bool.pxd", + "complex.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ /* #### Code section: numeric_typedefs ### */ @@ -1461,7 +1461,7 @@ struct __pyx_opt_args_6pygame_5_sdl2_5video_8Renderer_blit; struct __pyx_opt_args_6pygame_5_sdl2_5video_7Texture_draw; struct __pyx_opt_args_6pygame_5_sdl2_5video_5Image_draw; -/* "pygame/_sdl2/video.pxd":467 +/* "pygame/_sdl2/video.pxd":465 * * cpdef object get_viewport(self) * cpdef object blit(self, object source, Rect dest=*, Rect area=*, int special_flags=*) # <<<<<<<<<<<<<< @@ -1475,7 +1475,7 @@ struct __pyx_opt_args_6pygame_5_sdl2_5video_8Renderer_blit { int special_flags; }; -/* "pygame/_sdl2/video.pxd":475 +/* "pygame/_sdl2/video.pxd":473 * cdef readonly int height * * cpdef void draw(self, srcrect=*, dstrect=*, float angle=*, origin=*, # <<<<<<<<<<<<<< @@ -1492,7 +1492,7 @@ struct __pyx_opt_args_6pygame_5_sdl2_5video_7Texture_draw { int flip_y; }; -/* "pygame/_sdl2/video.pxd":491 +/* "pygame/_sdl2/video.pxd":489 * cdef public Rect srcrect * * cpdef void draw(self, srcrect=*, dstrect=*) # <<<<<<<<<<<<<< @@ -1503,7 +1503,7 @@ struct __pyx_opt_args_6pygame_5_sdl2_5video_5Image_draw { PyObject *dstrect; }; -/* "pygame/_sdl2/video.pxd":460 +/* "pygame/_sdl2/video.pxd":459 * void import_pygame_window() * * cdef class Renderer: # <<<<<<<<<<<<<< @@ -1516,11 +1516,10 @@ struct __pyx_obj_6pygame_5_sdl2_5video_Renderer { SDL_Renderer *_renderer; struct __pyx_obj_6pygame_5_sdl2_5video_Texture *_target; pgWindowObject *_win; - int _is_borrowed; }; -/* "pygame/_sdl2/video.pxd":469 +/* "pygame/_sdl2/video.pxd":467 * cpdef object blit(self, object source, Rect dest=*, Rect area=*, int special_flags=*) * * cdef class Texture: # <<<<<<<<<<<<<< @@ -1537,7 +1536,7 @@ struct __pyx_obj_6pygame_5_sdl2_5video_Texture { }; -/* "pygame/_sdl2/video.pxd":478 +/* "pygame/_sdl2/video.pxd":476 * bint flip_x=*, bint flip_y=*) * * cdef class Image: # <<<<<<<<<<<<<< @@ -1583,7 +1582,7 @@ struct __pyx_obj_6pygame_5_sdl2_5video___pyx_scope_struct__get_drivers { * @cython.auto_pickle(False) * cdef class Renderer: # <<<<<<<<<<<<<< * - * @classmethod + * def __init__(self,Window window, int index=-1, */ struct __pyx_vtabstruct_6pygame_5_sdl2_5video_Renderer { @@ -2119,12 +2118,6 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice( PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); -/* tp_new.proto */ -#define __Pyx_tp_new(type_obj, args) __Pyx_tp_new_kwargs(type_obj, args, NULL) -static CYTHON_INLINE PyObject* __Pyx_tp_new_kwargs(PyObject* type_obj, PyObject* args, PyObject* kwargs) { - return (PyObject*) (((PyTypeObject*)type_obj)->tp_new((PyTypeObject*)type_obj, args, kwargs)); -} - /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); @@ -2355,10 +2348,6 @@ static PyObject* __Pyx_Globals(void); #define __Pyx_GetNameInClass(var, nmspace, name) (var) = __Pyx__GetNameInClass(nmspace, name) static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name); -/* ClassMethod.proto */ -#include "descrobject.h" -CYTHON_UNUSED static PyObject* __Pyx_Method_ClassMethod(PyObject *method); - /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) @@ -2685,9 +2674,8 @@ static const char __pyx_k_p4[] = "p4"; static const char __pyx_k_uv[] = "uv"; static const char __pyx_k_xy[] = "xy"; static const char __pyx_k__27[] = "."; -static const char __pyx_k__85[] = "?"; +static const char __pyx_k__83[] = "?"; static const char __pyx_k_but[] = "but"; -static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_ind[] = "ind"; static const char __pyx_k_key[] = "key"; @@ -2832,7 +2820,6 @@ static const char __pyx_k_renderer_2[] = "_renderer"; static const char __pyx_k_to_surface[] = "to_surface"; static const char __pyx_k_MemoryError[] = "MemoryError"; static const char __pyx_k_accelerated[] = "accelerated"; -static const char __pyx_k_from_window[] = "from_window"; static const char __pyx_k_get_drivers[] = "get_drivers"; static const char __pyx_k_Texture_draw[] = "Texture.draw"; static const char __pyx_k_buttons_utf8[] = "buttons_utf8"; @@ -2882,7 +2869,6 @@ static const char __pyx_k_Renderer_to_surface[] = "Renderer.to_surface"; static const char __pyx_k_SCALEQUALITY_LINEAR[] = "SCALEQUALITY_LINEAR"; static const char __pyx_k_WINDOWPOS_UNDEFINED[] = "WINDOWPOS_UNDEFINED"; static const char __pyx_k_num_texture_formats[] = "num_texture_formats"; -static const char __pyx_k_Renderer_from_window[] = "Renderer.from_window"; static const char __pyx_k_SCALEQUALITY_NEAREST[] = "SCALEQUALITY_NEAREST"; static const char __pyx_k_Texture_from_surface[] = "Texture.from_surface"; static const char __pyx_k_expected_a_rectangle[] = "expected a rectangle"; @@ -2903,7 +2889,7 @@ static const char __pyx_k_2nd_argument_must_be_a_surface[] = "2nd argument must static const char __pyx_k_dstrect_must_be_a_position_rect[] = "dstrect must be a position, rect, or None"; static const char __pyx_k_only_one_of_static_streaming_or[] = "only one of static, streaming, or target can be true"; static const char __pyx_k_s_name_s_flags_0x_02x_num_textu[] = "<%s(name: %s, flags: 0x%02x, num_texture_formats: %d, max_texture_width: %d, max_texture_height: %d)>"; -static const char __pyx_k_src_c_cython_pygame__sdl2_video[] = "src_c\\cython\\pygame\\_sdl2\\video.pyx"; +static const char __pyx_k_src_c_cython_pygame__sdl2_video[] = "src_c/cython/pygame/_sdl2/video.pyx"; static const char __pyx_k_surface_must_be_a_surface_or_No[] = "'surface' must be a surface or None"; static const char __pyx_k_the_argument_is_not_a_rectangle[] = "the argument is not a rectangle or None"; static const char __pyx_k_Renderer_compose_custom_blend_mo[] = "Renderer.compose_custom_blend_mode"; @@ -2964,34 +2950,33 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_7texture_4__del__(struct __pyx_ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_5Image_7srcrect___get__(struct __pyx_obj_6pygame_5_sdl2_5video_Image *__pyx_v_self); /* proto */ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_7srcrect_2__set__(struct __pyx_obj_6pygame_5_sdl2_5video_Image *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_7srcrect_4__del__(struct __pyx_obj_6pygame_5_sdl2_5video_Image *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_from_window(PyTypeObject *__pyx_v_cls, pgWindowObject *__pyx_v_window); /* proto */ -static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, pgWindowObject *__pyx_v_window, int __pyx_v_index, int __pyx_v_accelerated, int __pyx_v_vsync, int __pyx_v_target_texture); /* proto */ -static void __pyx_pf_6pygame_5_sdl2_5video_8Renderer_4__dealloc__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ +static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer___init__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, pgWindowObject *__pyx_v_window, int __pyx_v_index, int __pyx_v_accelerated, int __pyx_v_vsync, int __pyx_v_target_texture); /* proto */ +static void __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__dealloc__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___get__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode_2__set__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_blendMode); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_new_value); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_8present(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10get_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_area); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_4clear(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6present(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_8get_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10set_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_area); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size___get__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size_2__set__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_size); /* proto */ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale___get__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self); /* proto */ 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_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 */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_surface, PyObject *__pyx_v_area); /* proto */ -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend_mode(PyObject *__pyx_v_color_mode, PyObject *__pyx_v_alpha_mode); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12blit(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_14draw_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_16draw_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_18draw_rect(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20fill_rect(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22draw_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24fill_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26draw_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28fill_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30to_surface(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_surface, PyObject *__pyx_v_area); /* proto */ +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32compose_custom_blend_mode(PyObject *__pyx_v_color_mode, PyObject *__pyx_v_alpha_mode); /* proto */ static PyObject *__pyx_tp_new_6pygame_5_sdl2_5video_Renderer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6pygame_5_sdl2_5video_Texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_6pygame_5_sdl2_5video_Image(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3158,7 +3143,6 @@ typedef struct { PyObject *__pyx_n_s_Renderer_fill_quad; PyObject *__pyx_n_s_Renderer_fill_rect; PyObject *__pyx_n_s_Renderer_fill_triangle; - PyObject *__pyx_n_s_Renderer_from_window; PyObject *__pyx_n_s_Renderer_get_viewport; PyObject *__pyx_n_s_Renderer_present; PyObject *__pyx_n_s_Renderer_set_viewport; @@ -3180,7 +3164,7 @@ typedef struct { PyObject *__pyx_n_s_Window; PyObject *__pyx_n_s_Window_2; PyObject *__pyx_kp_u__27; - PyObject *__pyx_n_s__85; + PyObject *__pyx_n_s__83; PyObject *__pyx_n_s_a_mod; PyObject *__pyx_n_s_a_mod_2; PyObject *__pyx_n_s_accelerated; @@ -3209,7 +3193,6 @@ typedef struct { PyObject *__pyx_n_s_clear; PyObject *__pyx_n_s_cline_in_traceback; PyObject *__pyx_n_s_close; - PyObject *__pyx_n_s_cls; PyObject *__pyx_n_s_color; PyObject *__pyx_n_s_color_mode; PyObject *__pyx_n_s_compose_custom_blend_mode; @@ -3253,7 +3236,6 @@ typedef struct { PyObject *__pyx_n_s_frect; PyObject *__pyx_n_s_frectptr; PyObject *__pyx_n_s_from_surface; - PyObject *__pyx_n_s_from_window; PyObject *__pyx_n_s_g_mod; PyObject *__pyx_n_s_g_mod_2; PyObject *__pyx_kp_u_gc; @@ -3433,19 +3415,18 @@ typedef struct { PyObject *__pyx_tuple__52; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__55; - PyObject *__pyx_tuple__57; + PyObject *__pyx_tuple__59; PyObject *__pyx_tuple__61; PyObject *__pyx_tuple__63; - PyObject *__pyx_tuple__65; + PyObject *__pyx_tuple__64; PyObject *__pyx_tuple__66; PyObject *__pyx_tuple__68; - PyObject *__pyx_tuple__70; + PyObject *__pyx_tuple__71; PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__75; PyObject *__pyx_tuple__77; PyObject *__pyx_tuple__79; PyObject *__pyx_tuple__81; - PyObject *__pyx_tuple__83; PyObject *__pyx_codeobj__29; PyObject *__pyx_codeobj__32; PyObject *__pyx_codeobj__34; @@ -3458,21 +3439,20 @@ typedef struct { PyObject *__pyx_codeobj__51; PyObject *__pyx_codeobj__53; PyObject *__pyx_codeobj__56; + PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__58; - PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__60; PyObject *__pyx_codeobj__62; - PyObject *__pyx_codeobj__64; + PyObject *__pyx_codeobj__65; PyObject *__pyx_codeobj__67; PyObject *__pyx_codeobj__69; - PyObject *__pyx_codeobj__71; + PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__72; PyObject *__pyx_codeobj__74; PyObject *__pyx_codeobj__76; PyObject *__pyx_codeobj__78; PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__82; - PyObject *__pyx_codeobj__84; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -3552,7 +3532,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_fill_quad); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_fill_rect); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_fill_triangle); - Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_from_window); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_get_viewport); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_present); Py_CLEAR(clear_module_state->__pyx_n_s_Renderer_set_viewport); @@ -3574,7 +3553,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Window); Py_CLEAR(clear_module_state->__pyx_n_s_Window_2); Py_CLEAR(clear_module_state->__pyx_kp_u__27); - Py_CLEAR(clear_module_state->__pyx_n_s__85); + Py_CLEAR(clear_module_state->__pyx_n_s__83); Py_CLEAR(clear_module_state->__pyx_n_s_a_mod); Py_CLEAR(clear_module_state->__pyx_n_s_a_mod_2); Py_CLEAR(clear_module_state->__pyx_n_s_accelerated); @@ -3603,7 +3582,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_clear); Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); Py_CLEAR(clear_module_state->__pyx_n_s_close); - Py_CLEAR(clear_module_state->__pyx_n_s_cls); Py_CLEAR(clear_module_state->__pyx_n_s_color); Py_CLEAR(clear_module_state->__pyx_n_s_color_mode); Py_CLEAR(clear_module_state->__pyx_n_s_compose_custom_blend_mode); @@ -3647,7 +3625,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_frect); Py_CLEAR(clear_module_state->__pyx_n_s_frectptr); Py_CLEAR(clear_module_state->__pyx_n_s_from_surface); - Py_CLEAR(clear_module_state->__pyx_n_s_from_window); Py_CLEAR(clear_module_state->__pyx_n_s_g_mod); Py_CLEAR(clear_module_state->__pyx_n_s_g_mod_2); Py_CLEAR(clear_module_state->__pyx_kp_u_gc); @@ -3827,19 +3804,18 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_tuple__52); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__55); - Py_CLEAR(clear_module_state->__pyx_tuple__57); + Py_CLEAR(clear_module_state->__pyx_tuple__59); Py_CLEAR(clear_module_state->__pyx_tuple__61); Py_CLEAR(clear_module_state->__pyx_tuple__63); - Py_CLEAR(clear_module_state->__pyx_tuple__65); + Py_CLEAR(clear_module_state->__pyx_tuple__64); Py_CLEAR(clear_module_state->__pyx_tuple__66); Py_CLEAR(clear_module_state->__pyx_tuple__68); - Py_CLEAR(clear_module_state->__pyx_tuple__70); + Py_CLEAR(clear_module_state->__pyx_tuple__71); Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__75); Py_CLEAR(clear_module_state->__pyx_tuple__77); Py_CLEAR(clear_module_state->__pyx_tuple__79); Py_CLEAR(clear_module_state->__pyx_tuple__81); - Py_CLEAR(clear_module_state->__pyx_tuple__83); Py_CLEAR(clear_module_state->__pyx_codeobj__29); Py_CLEAR(clear_module_state->__pyx_codeobj__32); Py_CLEAR(clear_module_state->__pyx_codeobj__34); @@ -3852,21 +3828,20 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_codeobj__51); Py_CLEAR(clear_module_state->__pyx_codeobj__53); Py_CLEAR(clear_module_state->__pyx_codeobj__56); + Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__58); - Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__60); Py_CLEAR(clear_module_state->__pyx_codeobj__62); - Py_CLEAR(clear_module_state->__pyx_codeobj__64); + Py_CLEAR(clear_module_state->__pyx_codeobj__65); Py_CLEAR(clear_module_state->__pyx_codeobj__67); Py_CLEAR(clear_module_state->__pyx_codeobj__69); - Py_CLEAR(clear_module_state->__pyx_codeobj__71); + Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__72); Py_CLEAR(clear_module_state->__pyx_codeobj__74); Py_CLEAR(clear_module_state->__pyx_codeobj__76); Py_CLEAR(clear_module_state->__pyx_codeobj__78); Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__82); - Py_CLEAR(clear_module_state->__pyx_codeobj__84); return 0; } #endif @@ -3924,7 +3899,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_fill_quad); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_fill_rect); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_fill_triangle); - Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_from_window); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_get_viewport); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_present); Py_VISIT(traverse_module_state->__pyx_n_s_Renderer_set_viewport); @@ -3946,7 +3920,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Window); Py_VISIT(traverse_module_state->__pyx_n_s_Window_2); Py_VISIT(traverse_module_state->__pyx_kp_u__27); - Py_VISIT(traverse_module_state->__pyx_n_s__85); + Py_VISIT(traverse_module_state->__pyx_n_s__83); Py_VISIT(traverse_module_state->__pyx_n_s_a_mod); Py_VISIT(traverse_module_state->__pyx_n_s_a_mod_2); Py_VISIT(traverse_module_state->__pyx_n_s_accelerated); @@ -3975,7 +3949,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_clear); Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); Py_VISIT(traverse_module_state->__pyx_n_s_close); - Py_VISIT(traverse_module_state->__pyx_n_s_cls); Py_VISIT(traverse_module_state->__pyx_n_s_color); Py_VISIT(traverse_module_state->__pyx_n_s_color_mode); Py_VISIT(traverse_module_state->__pyx_n_s_compose_custom_blend_mode); @@ -4019,7 +3992,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_frect); Py_VISIT(traverse_module_state->__pyx_n_s_frectptr); Py_VISIT(traverse_module_state->__pyx_n_s_from_surface); - Py_VISIT(traverse_module_state->__pyx_n_s_from_window); Py_VISIT(traverse_module_state->__pyx_n_s_g_mod); Py_VISIT(traverse_module_state->__pyx_n_s_g_mod_2); Py_VISIT(traverse_module_state->__pyx_kp_u_gc); @@ -4199,19 +4171,18 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_tuple__52); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__55); - Py_VISIT(traverse_module_state->__pyx_tuple__57); + Py_VISIT(traverse_module_state->__pyx_tuple__59); Py_VISIT(traverse_module_state->__pyx_tuple__61); Py_VISIT(traverse_module_state->__pyx_tuple__63); - Py_VISIT(traverse_module_state->__pyx_tuple__65); + Py_VISIT(traverse_module_state->__pyx_tuple__64); Py_VISIT(traverse_module_state->__pyx_tuple__66); Py_VISIT(traverse_module_state->__pyx_tuple__68); - Py_VISIT(traverse_module_state->__pyx_tuple__70); + Py_VISIT(traverse_module_state->__pyx_tuple__71); Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__75); Py_VISIT(traverse_module_state->__pyx_tuple__77); Py_VISIT(traverse_module_state->__pyx_tuple__79); Py_VISIT(traverse_module_state->__pyx_tuple__81); - Py_VISIT(traverse_module_state->__pyx_tuple__83); Py_VISIT(traverse_module_state->__pyx_codeobj__29); Py_VISIT(traverse_module_state->__pyx_codeobj__32); Py_VISIT(traverse_module_state->__pyx_codeobj__34); @@ -4224,21 +4195,20 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_codeobj__51); Py_VISIT(traverse_module_state->__pyx_codeobj__53); Py_VISIT(traverse_module_state->__pyx_codeobj__56); + Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__58); - Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__60); Py_VISIT(traverse_module_state->__pyx_codeobj__62); - Py_VISIT(traverse_module_state->__pyx_codeobj__64); + Py_VISIT(traverse_module_state->__pyx_codeobj__65); Py_VISIT(traverse_module_state->__pyx_codeobj__67); Py_VISIT(traverse_module_state->__pyx_codeobj__69); - Py_VISIT(traverse_module_state->__pyx_codeobj__71); + Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__72); Py_VISIT(traverse_module_state->__pyx_codeobj__74); Py_VISIT(traverse_module_state->__pyx_codeobj__76); Py_VISIT(traverse_module_state->__pyx_codeobj__78); Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__82); - Py_VISIT(traverse_module_state->__pyx_codeobj__84); return 0; } #endif @@ -4402,7 +4372,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Renderer_fill_quad __pyx_mstate_global->__pyx_n_s_Renderer_fill_quad #define __pyx_n_s_Renderer_fill_rect __pyx_mstate_global->__pyx_n_s_Renderer_fill_rect #define __pyx_n_s_Renderer_fill_triangle __pyx_mstate_global->__pyx_n_s_Renderer_fill_triangle -#define __pyx_n_s_Renderer_from_window __pyx_mstate_global->__pyx_n_s_Renderer_from_window #define __pyx_n_s_Renderer_get_viewport __pyx_mstate_global->__pyx_n_s_Renderer_get_viewport #define __pyx_n_s_Renderer_present __pyx_mstate_global->__pyx_n_s_Renderer_present #define __pyx_n_s_Renderer_set_viewport __pyx_mstate_global->__pyx_n_s_Renderer_set_viewport @@ -4424,7 +4393,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Window __pyx_mstate_global->__pyx_n_s_Window #define __pyx_n_s_Window_2 __pyx_mstate_global->__pyx_n_s_Window_2 #define __pyx_kp_u__27 __pyx_mstate_global->__pyx_kp_u__27 -#define __pyx_n_s__85 __pyx_mstate_global->__pyx_n_s__85 +#define __pyx_n_s__83 __pyx_mstate_global->__pyx_n_s__83 #define __pyx_n_s_a_mod __pyx_mstate_global->__pyx_n_s_a_mod #define __pyx_n_s_a_mod_2 __pyx_mstate_global->__pyx_n_s_a_mod_2 #define __pyx_n_s_accelerated __pyx_mstate_global->__pyx_n_s_accelerated @@ -4453,7 +4422,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback #define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close -#define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls #define __pyx_n_s_color __pyx_mstate_global->__pyx_n_s_color #define __pyx_n_s_color_mode __pyx_mstate_global->__pyx_n_s_color_mode #define __pyx_n_s_compose_custom_blend_mode __pyx_mstate_global->__pyx_n_s_compose_custom_blend_mode @@ -4497,7 +4465,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_frect __pyx_mstate_global->__pyx_n_s_frect #define __pyx_n_s_frectptr __pyx_mstate_global->__pyx_n_s_frectptr #define __pyx_n_s_from_surface __pyx_mstate_global->__pyx_n_s_from_surface -#define __pyx_n_s_from_window __pyx_mstate_global->__pyx_n_s_from_window #define __pyx_n_s_g_mod __pyx_mstate_global->__pyx_n_s_g_mod #define __pyx_n_s_g_mod_2 __pyx_mstate_global->__pyx_n_s_g_mod_2 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc @@ -4677,19 +4644,18 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55 -#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57 +#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59 #define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61 #define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63 -#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 +#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 #define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 #define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68 -#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70 +#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 #define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 #define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 #define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 #define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 -#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83 #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 #define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 #define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 @@ -4702,21 +4668,20 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 #define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 #define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56 +#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58 -#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60 #define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62 -#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 +#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 #define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 #define __pyx_codeobj__69 __pyx_mstate_global->__pyx_codeobj__69 -#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71 +#define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 #define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76 #define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 #define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 -#define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84 /* #### Code section: module_code ### */ /* "cpython/complex.pxd":19 @@ -12258,7 +12223,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_7Texture_14update(struct __pyx_o return __pyx_r; } -/* "pygame/_sdl2/video.pxd":471 +/* "pygame/_sdl2/video.pxd":469 * cdef class Texture: * cdef SDL_Texture* _tex * cdef readonly Renderer renderer # <<<<<<<<<<<<<< @@ -12296,7 +12261,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_7Texture_8renderer___get__(struc return __pyx_r; } -/* "pygame/_sdl2/video.pxd":472 +/* "pygame/_sdl2/video.pxd":470 * cdef SDL_Texture* _tex * cdef readonly Renderer renderer * cdef readonly int width # <<<<<<<<<<<<<< @@ -12327,7 +12292,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_7Texture_5width___get__(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -12344,7 +12309,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_7Texture_5width___get__(struct _ return __pyx_r; } -/* "pygame/_sdl2/video.pxd":473 +/* "pygame/_sdl2/video.pxd":471 * cdef readonly Renderer renderer * cdef readonly int width * cdef readonly int height # <<<<<<<<<<<<<< @@ -12375,7 +12340,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_7Texture_6height___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 473, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13812,7 +13777,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_5Image_6draw(struct __pyx_obj_6p return __pyx_r; } -/* "pygame/_sdl2/video.pxd":480 +/* "pygame/_sdl2/video.pxd":478 * cdef class Image: * cdef Color _color * cdef public float angle # <<<<<<<<<<<<<< @@ -13843,7 +13808,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_5Image_5angle___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->angle); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->angle); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13882,7 +13847,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_5angle_2__set__(struct __pyx_ob const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 480, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 478, __pyx_L1_error) __pyx_v_self->angle = __pyx_t_1; /* function exit code */ @@ -13896,7 +13861,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_5angle_2__set__(struct __pyx_ob return __pyx_r; } -/* "pygame/_sdl2/video.pxd":483 +/* "pygame/_sdl2/video.pxd":481 * cdef SDL_Point _origin * cdef SDL_Point* _originptr * cdef public bint flip_x # <<<<<<<<<<<<<< @@ -13927,7 +13892,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_5Image_6flip_x___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->flip_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->flip_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -13966,7 +13931,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_6flip_x_2__set__(struct __pyx_o const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 481, __pyx_L1_error) __pyx_v_self->flip_x = __pyx_t_1; /* function exit code */ @@ -13980,7 +13945,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_6flip_x_2__set__(struct __pyx_o return __pyx_r; } -/* "pygame/_sdl2/video.pxd":484 +/* "pygame/_sdl2/video.pxd":482 * cdef SDL_Point* _originptr * cdef public bint flip_x * cdef public bint flip_y # <<<<<<<<<<<<<< @@ -14011,7 +13976,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_5Image_6flip_y___get__(struct __ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->flip_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 484, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->flip_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14050,7 +14015,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_6flip_y_2__set__(struct __pyx_o const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 484, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 482, __pyx_L1_error) __pyx_v_self->flip_y = __pyx_t_1; /* function exit code */ @@ -14064,7 +14029,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_6flip_y_2__set__(struct __pyx_o return __pyx_r; } -/* "pygame/_sdl2/video.pxd":485 +/* "pygame/_sdl2/video.pxd":483 * cdef public bint flip_x * cdef public bint flip_y * cdef public float alpha # <<<<<<<<<<<<<< @@ -14095,7 +14060,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_5Image_5alpha___get__(struct __p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->alpha); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 485, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->alpha); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14134,7 +14099,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_5alpha_2__set__(struct __pyx_ob const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 485, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 483, __pyx_L1_error) __pyx_v_self->alpha = __pyx_t_1; /* function exit code */ @@ -14148,7 +14113,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_5alpha_2__set__(struct __pyx_ob return __pyx_r; } -/* "pygame/_sdl2/video.pxd":486 +/* "pygame/_sdl2/video.pxd":484 * cdef public bint flip_y * cdef public float alpha * cdef public SDL_BlendMode blend_mode # <<<<<<<<<<<<<< @@ -14179,7 +14144,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_5Image_10blend_mode___get__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_SDL_BlendMode(__pyx_v_self->blend_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 486, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_SDL_BlendMode(__pyx_v_self->blend_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14218,7 +14183,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_10blend_mode_2__set__(struct __ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - __pyx_t_1 = ((SDL_BlendMode)__Pyx_PyInt_As_SDL_BlendMode(__pyx_v_value)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 486, __pyx_L1_error) + __pyx_t_1 = ((SDL_BlendMode)__Pyx_PyInt_As_SDL_BlendMode(__pyx_v_value)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 484, __pyx_L1_error) __pyx_v_self->blend_mode = __pyx_t_1; /* function exit code */ @@ -14232,7 +14197,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_10blend_mode_2__set__(struct __ return __pyx_r; } -/* "pygame/_sdl2/video.pxd":488 +/* "pygame/_sdl2/video.pxd":486 * cdef public SDL_BlendMode blend_mode * * cdef public Texture texture # <<<<<<<<<<<<<< @@ -14292,7 +14257,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_7texture_2__set__(struct __pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pygame_5_sdl2_5video_Texture))))) __PYX_ERR(2, 488, __pyx_L1_error) + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pygame_5_sdl2_5video_Texture))))) __PYX_ERR(2, 486, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -14343,7 +14308,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_7texture_4__del__(struct __pyx_ return __pyx_r; } -/* "pygame/_sdl2/video.pxd":489 +/* "pygame/_sdl2/video.pxd":487 * * cdef public Texture texture * cdef public Rect srcrect # <<<<<<<<<<<<<< @@ -14403,7 +14368,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_7srcrect_2__set__(struct __pyx_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pygame_5_sdl2_5video_Rect))))) __PYX_ERR(2, 489, __pyx_L1_error) + if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6pygame_5_sdl2_5video_Rect))))) __PYX_ERR(2, 487, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); @@ -14457,620 +14422,265 @@ static int __pyx_pf_6pygame_5_sdl2_5video_5Image_7srcrect_4__del__(struct __pyx_ /* "pygame/_sdl2/video.pyx":752 * cdef class Renderer: * - * @classmethod # <<<<<<<<<<<<<< - * def from_window(cls, Window window): - * cdef Renderer self = cls.__new__(cls) + * def __init__(self,Window window, int index=-1, # <<<<<<<<<<<<<< + * int accelerated=-1, bint vsync=False, + * bint target_texture=False): */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_1from_window(PyObject *__pyx_v_cls, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_1from_window = {"from_window", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_1from_window, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_1from_window(PyObject *__pyx_v_cls, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds +static int __pyx_pw_6pygame_5_sdl2_5video_8Renderer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer___init__, "pygame object wrapping a 2D rendering context for a window\n\n Creates a 2D rendering context for a window.\n\n :param Window window: The window onto which the rendering context should be\n placed.\n :param int index: The index of rendering driver to initialize, or ``-1`` to init\n the first supporting the requested options.\n :param int accelerated: If 1, the renderer uses hardware acceleration.\n if 0, the renderer is a software fallback.\n ``-1`` gives precedence to renderers using hardware\n acceleration.\n :param bool vsync: If ``True`` :meth:`Renderer.present` is synchronized with\n the refresh rate.\n :param bool target_texture: Whether the renderer should support setting\n :class:`Texture` objects as target textures, to\n enable drawing onto them. \n\n\n :class:`Renderer` objects provide a cross-platform API for rendering 2D\n graphics onto a :class:`Window`, by using either Metal (macOS), OpenGL\n (macOS, Windows, Linux) or Direct3D (Windows) rendering drivers, depending\n on what is set or is available on a system during their creation.\n\n They can be used to draw both :class:`Texture` objects and simple points,\n lines and rectangles (which are colored based on :attr:`Renderer.draw_color`).\n\n If configured correctly and supported by an underlying rendering driver, Renderer\n objects can have a :class:`Texture` object temporarily set as a target texture\n (the Texture object must have been created with target texture usage support),\n which allows those textures to be drawn onto. \n\n To present drawn content onto the window, :meth:`Renderer.present` should be\n called. :meth:`Renderer.clear` ""should be called to clear any drawn content\n with the set Renderer draw color.\n\n When things are drawn onto Renderer objects, an internal batching system is\n used by default to batch those \"draw calls\" together, to have all of them be\n processed in one go when :meth:`Renderer.present` is called. This is unlike\n :class:`pygame.Surface` objects, on which modifications via blitting occur\n immediately, but lends well to the behavior of GPUs, as draw calls can be\n expensive on lower-end models.\n "); +#if CYTHON_UPDATE_DESCRIPTOR_DOC +struct wrapperbase __pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer___init__; #endif -) { +static int __pyx_pw_6pygame_5_sdl2_5video_8Renderer_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { pgWindowObject *__pyx_v_window = 0; - #if !CYTHON_METH_FASTCALL + int __pyx_v_index; + int __pyx_v_accelerated; + int __pyx_v_vsync; + int __pyx_v_target_texture; CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - PyObject *__pyx_r = 0; + int __pyx_r; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("from_window (wrapper)", 0); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,0}; - PyObject* values[1] = {0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,&__pyx_n_s_index,&__pyx_n_s_accelerated,&__pyx_n_s_vsync,&__pyx_n_s_target_texture,0}; + PyObject* values[5] = {0,0,0,0,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window)) != 0)) kw_args--; + if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window)) != 0)) kw_args--; else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index); + if (value) { values[1] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_accelerated); + if (value) { values[2] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vsync); + if (value) { values[3] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_target_texture); + if (value) { values[4] = value; kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 752, __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, "from_window") < 0)) __PYX_ERR(0, 752, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 752, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + switch (__pyx_nargs) { + case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } __pyx_v_window = ((pgWindowObject *)values[0]); + if (values[1]) { + __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 752, __pyx_L3_error) + } else { + __pyx_v_index = ((int)-1); + } + if (values[2]) { + __pyx_v_accelerated = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_accelerated == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L3_error) + } else { + __pyx_v_accelerated = ((int)-1); + } + if (values[3]) { + __pyx_v_vsync = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_vsync == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L3_error) + } else { + + /* "pygame/_sdl2/video.pyx":753 + * + * def __init__(self,Window window, int index=-1, + * int accelerated=-1, bint vsync=False, # <<<<<<<<<<<<<< + * bint target_texture=False): + * """pygame object wrapping a 2D rendering context for a window + */ + __pyx_v_vsync = ((int)0); + } + if (values[4]) { + __pyx_v_target_texture = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_target_texture == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L3_error) + } else { + + /* "pygame/_sdl2/video.pyx":754 + * def __init__(self,Window window, int index=-1, + * int accelerated=-1, bint vsync=False, + * bint target_texture=False): # <<<<<<<<<<<<<< + * """pygame object wrapping a 2D rendering context for a window + * + */ + __pyx_v_target_texture = ((int)0); + } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("from_window", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 752, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 752, __pyx_L3_error) __pyx_L3_error:; - __Pyx_AddTraceback("pygame._sdl2.video.Renderer.from_window", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("pygame._sdl2.video.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); - return NULL; + return -1; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_6pygame_5_sdl2_5video_Window, 1, "window", 0))) __PYX_ERR(0, 753, __pyx_L1_error) - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_from_window(((PyTypeObject*)__pyx_v_cls), __pyx_v_window); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_6pygame_5_sdl2_5video_Window, 1, "window", 0))) __PYX_ERR(0, 752, __pyx_L1_error) + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer___init__(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_window, __pyx_v_index, __pyx_v_accelerated, __pyx_v_vsync, __pyx_v_target_texture); + + /* "pygame/_sdl2/video.pyx":752 + * cdef class Renderer: + * + * def __init__(self,Window window, int index=-1, # <<<<<<<<<<<<<< + * int accelerated=-1, bint vsync=False, + * bint target_texture=False): + */ /* function exit code */ goto __pyx_L0; __pyx_L1_error:; - __pyx_r = NULL; + __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_from_window(PyTypeObject *__pyx_v_cls, pgWindowObject *__pyx_v_window) { - struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self = 0; - PyObject *__pyx_r = NULL; +static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer___init__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, pgWindowObject *__pyx_v_window, int __pyx_v_index, int __pyx_v_accelerated, int __pyx_v_vsync, int __pyx_v_target_texture) { + PyObject *__pyx_v_flags = NULL; + CYTHON_UNUSED Uint8 __pyx_v_defaultColor[4]; + int __pyx_r; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + Uint32 __pyx_t_4; + PyObject *__pyx_t_5 = NULL; int __pyx_t_6; + Uint8 __pyx_t_7[4]; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("from_window", 0); + __Pyx_RefNannySetupContext("__init__", 0); - /* "pygame/_sdl2/video.pyx":754 - * @classmethod - * def from_window(cls, Window window): - * cdef Renderer self = cls.__new__(cls) # <<<<<<<<<<<<<< - * self._win = window - * if self._win._is_borrowed: + /* "pygame/_sdl2/video.pyx":801 + * # https://wiki.libsdl.org/SDL_CreateRenderer + * # https://wiki.libsdl.org/SDL_RendererFlags + * flags = 0 # <<<<<<<<<<<<<< + * if accelerated >= 0: + * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE */ - if (unlikely(((PyObject *)__pyx_v_cls) == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object.__new__(X): X is not a type object (NoneType)"); - __PYX_ERR(0, 754, __pyx_L1_error) - } - __pyx_t_1 = __Pyx_tp_new(((PyObject *)__pyx_v_cls), __pyx_empty_tuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pygame_5_sdl2_5video_Renderer)))) __PYX_ERR(0, 754, __pyx_L1_error) - __pyx_v_self = ((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_int_0); + __pyx_v_flags = __pyx_int_0; - /* "pygame/_sdl2/video.pyx":755 - * def from_window(cls, Window window): - * cdef Renderer self = cls.__new__(cls) - * self._win = window # <<<<<<<<<<<<<< - * if self._win._is_borrowed: - * self._is_borrowed=1 + /* "pygame/_sdl2/video.pyx":802 + * # https://wiki.libsdl.org/SDL_RendererFlags + * flags = 0 + * if accelerated >= 0: # <<<<<<<<<<<<<< + * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE + * if vsync: */ - __Pyx_INCREF((PyObject *)__pyx_v_window); - __Pyx_GIVEREF((PyObject *)__pyx_v_window); - __Pyx_GOTREF((PyObject *)__pyx_v_self->_win); - __Pyx_DECREF((PyObject *)__pyx_v_self->_win); - __pyx_v_self->_win = __pyx_v_window; + __pyx_t_1 = (__pyx_v_accelerated >= 0); + if (__pyx_t_1) { - /* "pygame/_sdl2/video.pyx":756 - * cdef Renderer self = cls.__new__(cls) - * self._win = window - * if self._win._is_borrowed: # <<<<<<<<<<<<<< - * self._is_borrowed=1 - * else: + /* "pygame/_sdl2/video.pyx":803 + * flags = 0 + * if accelerated >= 0: + * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE # <<<<<<<<<<<<<< + * if vsync: + * flags |= _SDL_RENDERER_PRESENTVSYNC */ - __pyx_t_2 = (__pyx_v_self->_win->_is_borrowed != 0); - if (likely(__pyx_t_2)) { + if ((__pyx_v_accelerated != 0)) { + __pyx_t_3 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_ACCELERATED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } else { + __pyx_t_3 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_SOFTWARE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __pyx_t_3 = 0; + } + __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3); + __pyx_t_3 = 0; - /* "pygame/_sdl2/video.pyx":757 - * self._win = window - * if self._win._is_borrowed: - * self._is_borrowed=1 # <<<<<<<<<<<<<< - * else: - * raise error() + /* "pygame/_sdl2/video.pyx":802 + * # https://wiki.libsdl.org/SDL_RendererFlags + * flags = 0 + * if accelerated >= 0: # <<<<<<<<<<<<<< + * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE + * if vsync: */ - __pyx_v_self->_is_borrowed = 1; + } - /* "pygame/_sdl2/video.pyx":756 - * cdef Renderer self = cls.__new__(cls) - * self._win = window - * if self._win._is_borrowed: # <<<<<<<<<<<<<< - * self._is_borrowed=1 - * else: + /* "pygame/_sdl2/video.pyx":804 + * if accelerated >= 0: + * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE + * if vsync: # <<<<<<<<<<<<<< + * flags |= _SDL_RENDERER_PRESENTVSYNC + * if target_texture: */ - goto __pyx_L3; - } + if (__pyx_v_vsync) { - /* "pygame/_sdl2/video.pyx":759 - * self._is_borrowed=1 - * else: - * raise error() # <<<<<<<<<<<<<< - * if not self._win: - * raise error() + /* "pygame/_sdl2/video.pyx":805 + * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE + * if vsync: + * flags |= _SDL_RENDERER_PRESENTVSYNC # <<<<<<<<<<<<<< + * if target_texture: + * flags |= _SDL_RENDERER_TARGETTEXTURE */ - /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_PRESENTVSYNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 759, __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, 759, __pyx_L1_error) - } - __pyx_L3:; - - /* "pygame/_sdl2/video.pyx":760 - * else: - * raise error() - * if not self._win: # <<<<<<<<<<<<<< - * raise error() - * - */ - __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->_win)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) - __pyx_t_6 = (!__pyx_t_2); - if (unlikely(__pyx_t_6)) { - - /* "pygame/_sdl2/video.pyx":761 - * raise error() - * if not self._win: - * raise error() # <<<<<<<<<<<<<< - * - * self._renderer = SDL_GetRenderer(self._win._win) - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 761, __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, 761, __pyx_L1_error) - - /* "pygame/_sdl2/video.pyx":760 - * else: - * raise error() - * if not self._win: # <<<<<<<<<<<<<< - * raise error() - * - */ - } - - /* "pygame/_sdl2/video.pyx":763 - * raise error() - * - * self._renderer = SDL_GetRenderer(self._win._win) # <<<<<<<<<<<<<< - * if not self._renderer: - * raise error() - */ - __pyx_v_self->_renderer = SDL_GetRenderer(__pyx_v_self->_win->_win); - - /* "pygame/_sdl2/video.pyx":764 - * - * self._renderer = SDL_GetRenderer(self._win._win) - * if not self._renderer: # <<<<<<<<<<<<<< - * raise error() - * - */ - __pyx_t_6 = (!(__pyx_v_self->_renderer != 0)); - if (unlikely(__pyx_t_6)) { - - /* "pygame/_sdl2/video.pyx":765 - * self._renderer = SDL_GetRenderer(self._win._win) - * if not self._renderer: - * raise error() # <<<<<<<<<<<<<< - * - * self._target = None - */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - { - PyObject *__pyx_callargs[1] = {__pyx_t_4, }; - __pyx_t_1 = __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_1)) __PYX_ERR(0, 765, __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, 765, __pyx_L1_error) - - /* "pygame/_sdl2/video.pyx":764 - * - * self._renderer = SDL_GetRenderer(self._win._win) - * if not self._renderer: # <<<<<<<<<<<<<< - * raise error() - * - */ - } - - /* "pygame/_sdl2/video.pyx":767 - * raise error() - * - * self._target = None # <<<<<<<<<<<<<< - * return self - * - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF((PyObject *)__pyx_v_self->_target); - __Pyx_DECREF((PyObject *)__pyx_v_self->_target); - __pyx_v_self->_target = ((struct __pyx_obj_6pygame_5_sdl2_5video_Texture *)Py_None); - - /* "pygame/_sdl2/video.pyx":768 - * - * self._target = None - * return self # <<<<<<<<<<<<<< - * - * def __init__(self,Window window, int index=-1, - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF((PyObject *)__pyx_v_self); - __pyx_r = ((PyObject *)__pyx_v_self); - goto __pyx_L0; - - /* "pygame/_sdl2/video.pyx":752 - * cdef class Renderer: - * - * @classmethod # <<<<<<<<<<<<<< - * def from_window(cls, Window window): - * cdef Renderer self = cls.__new__(cls) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("pygame._sdl2.video.Renderer.from_window", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_self); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "pygame/_sdl2/video.pyx":770 - * return self - * - * def __init__(self,Window window, int index=-1, # <<<<<<<<<<<<<< - * int accelerated=-1, bint vsync=False, - * bint target_texture=False): - */ - -/* Python wrapper */ -static int __pyx_pw_6pygame_5_sdl2_5video_8Renderer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_2__init__, "pygame object wrapping a 2D rendering context for a window\n\n Creates a 2D rendering context for a window.\n\n :param Window window: The window onto which the rendering context should be\n placed.\n :param int index: The index of rendering driver to initialize, or ``-1`` to init\n the first supporting the requested options.\n :param int accelerated: If 1, the renderer uses hardware acceleration.\n if 0, the renderer is a software fallback.\n ``-1`` gives precedence to renderers using hardware\n acceleration.\n :param bool vsync: If ``True`` :meth:`Renderer.present` is synchronized with\n the refresh rate.\n :param bool target_texture: Whether the renderer should support setting\n :class:`Texture` objects as target textures, to\n enable drawing onto them. \n\n\n :class:`Renderer` objects provide a cross-platform API for rendering 2D\n graphics onto a :class:`Window`, by using either Metal (macOS), OpenGL\n (macOS, Windows, Linux) or Direct3D (Windows) rendering drivers, depending\n on what is set or is available on a system during their creation.\n\n They can be used to draw both :class:`Texture` objects and simple points,\n lines and rectangles (which are colored based on :attr:`Renderer.draw_color`).\n\n If configured correctly and supported by an underlying rendering driver, Renderer\n objects can have a :class:`Texture` object temporarily set as a target texture\n (the Texture object must have been created with target texture usage support),\n which allows those textures to be drawn onto. \n\n To present drawn content onto the window, :meth:`Renderer.present` should be\n called. :meth:`Renderer.clear` ""should be called to clear any drawn content\n with the set Renderer draw color.\n\n When things are drawn onto Renderer objects, an internal batching system is\n used by default to batch those \"draw calls\" together, to have all of them be\n processed in one go when :meth:`Renderer.present` is called. This is unlike\n :class:`pygame.Surface` objects, on which modifications via blitting occur\n immediately, but lends well to the behavior of GPUs, as draw calls can be\n expensive on lower-end models.\n "); -#if CYTHON_UPDATE_DESCRIPTOR_DOC -struct wrapperbase __pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer_2__init__; -#endif -static int __pyx_pw_6pygame_5_sdl2_5video_8Renderer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - pgWindowObject *__pyx_v_window = 0; - int __pyx_v_index; - int __pyx_v_accelerated; - int __pyx_v_vsync; - int __pyx_v_target_texture; - CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_window,&__pyx_n_s_index,&__pyx_n_s_accelerated,&__pyx_n_s_vsync,&__pyx_n_s_target_texture,0}; - PyObject* values[5] = {0,0,0,0,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_window)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index); - if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_accelerated); - if (value) { values[2] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vsync); - if (value) { values[3] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_target_texture); - if (value) { values[4] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __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, "__init__") < 0)) __PYX_ERR(0, 770, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_window = ((pgWindowObject *)values[0]); - if (values[1]) { - __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) - } else { - __pyx_v_index = ((int)-1); - } - if (values[2]) { - __pyx_v_accelerated = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_accelerated == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L3_error) - } else { - __pyx_v_accelerated = ((int)-1); - } - if (values[3]) { - __pyx_v_vsync = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_vsync == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L3_error) - } else { - - /* "pygame/_sdl2/video.pyx":771 - * - * def __init__(self,Window window, int index=-1, - * int accelerated=-1, bint vsync=False, # <<<<<<<<<<<<<< - * bint target_texture=False): - * """pygame object wrapping a 2D rendering context for a window - */ - __pyx_v_vsync = ((int)0); - } - if (values[4]) { - __pyx_v_target_texture = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_target_texture == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L3_error) - } else { - - /* "pygame/_sdl2/video.pyx":772 - * def __init__(self,Window window, int index=-1, - * int accelerated=-1, bint vsync=False, - * bint target_texture=False): # <<<<<<<<<<<<<< - * """pygame object wrapping a 2D rendering context for a window - * - */ - __pyx_v_target_texture = ((int)0); - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 770, __pyx_L3_error) - __pyx_L3_error:; - __Pyx_AddTraceback("pygame._sdl2.video.Renderer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_6pygame_5_sdl2_5video_Window, 1, "window", 0))) __PYX_ERR(0, 770, __pyx_L1_error) - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_window, __pyx_v_index, __pyx_v_accelerated, __pyx_v_vsync, __pyx_v_target_texture); - - /* "pygame/_sdl2/video.pyx":770 - * return self - * - * def __init__(self,Window window, int index=-1, # <<<<<<<<<<<<<< - * int accelerated=-1, bint vsync=False, - * bint target_texture=False): - */ - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, pgWindowObject *__pyx_v_window, int __pyx_v_index, int __pyx_v_accelerated, int __pyx_v_vsync, int __pyx_v_target_texture) { - PyObject *__pyx_v_flags = NULL; - CYTHON_UNUSED Uint8 __pyx_v_defaultColor[4]; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Uint32 __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - Uint8 __pyx_t_7[4]; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 0); - - /* "pygame/_sdl2/video.pyx":819 - * # https://wiki.libsdl.org/SDL_CreateRenderer - * # https://wiki.libsdl.org/SDL_RendererFlags - * flags = 0 # <<<<<<<<<<<<<< - * if accelerated >= 0: - * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE - */ - __Pyx_INCREF(__pyx_int_0); - __pyx_v_flags = __pyx_int_0; - - /* "pygame/_sdl2/video.pyx":820 - * # https://wiki.libsdl.org/SDL_RendererFlags - * flags = 0 - * if accelerated >= 0: # <<<<<<<<<<<<<< - * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE - * if vsync: - */ - __pyx_t_1 = (__pyx_v_accelerated >= 0); - if (__pyx_t_1) { - - /* "pygame/_sdl2/video.pyx":821 - * flags = 0 - * if accelerated >= 0: - * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE # <<<<<<<<<<<<<< - * if vsync: - * flags |= _SDL_RENDERER_PRESENTVSYNC - */ - if ((__pyx_v_accelerated != 0)) { - __pyx_t_3 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_ACCELERATED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } else { - __pyx_t_3 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_SOFTWARE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __pyx_t_3 = 0; - } - __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3); - __pyx_t_3 = 0; - - /* "pygame/_sdl2/video.pyx":820 - * # https://wiki.libsdl.org/SDL_RendererFlags - * flags = 0 - * if accelerated >= 0: # <<<<<<<<<<<<<< - * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE - * if vsync: - */ - } - - /* "pygame/_sdl2/video.pyx":822 - * if accelerated >= 0: - * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE - * if vsync: # <<<<<<<<<<<<<< - * flags |= _SDL_RENDERER_PRESENTVSYNC - * if target_texture: - */ - if (__pyx_v_vsync) { - - /* "pygame/_sdl2/video.pyx":823 - * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE - * if vsync: - * flags |= _SDL_RENDERER_PRESENTVSYNC # <<<<<<<<<<<<<< - * if target_texture: - * flags |= _SDL_RENDERER_TARGETTEXTURE - */ - __pyx_t_3 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_PRESENTVSYNC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error) + __pyx_t_2 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_2); __pyx_t_2 = 0; - /* "pygame/_sdl2/video.pyx":822 + /* "pygame/_sdl2/video.pyx":804 * if accelerated >= 0: * flags |= _SDL_RENDERER_ACCELERATED if accelerated else _SDL_RENDERER_SOFTWARE * if vsync: # <<<<<<<<<<<<<< @@ -15079,7 +14689,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 */ } - /* "pygame/_sdl2/video.pyx":824 + /* "pygame/_sdl2/video.pyx":806 * if vsync: * flags |= _SDL_RENDERER_PRESENTVSYNC * if target_texture: # <<<<<<<<<<<<<< @@ -15088,22 +14698,22 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 */ if (__pyx_v_target_texture) { - /* "pygame/_sdl2/video.pyx":825 + /* "pygame/_sdl2/video.pyx":807 * flags |= _SDL_RENDERER_PRESENTVSYNC * if target_texture: * flags |= _SDL_RENDERER_TARGETTEXTURE # <<<<<<<<<<<<<< * * self._renderer = SDL_CreateRenderer(window._win, index, flags) */ - __pyx_t_2 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_TARGETTEXTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_Uint32(SDL_RENDERER_TARGETTEXTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_3); __pyx_t_3 = 0; - /* "pygame/_sdl2/video.pyx":824 + /* "pygame/_sdl2/video.pyx":806 * if vsync: * flags |= _SDL_RENDERER_PRESENTVSYNC * if target_texture: # <<<<<<<<<<<<<< @@ -15112,17 +14722,17 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 */ } - /* "pygame/_sdl2/video.pyx":827 + /* "pygame/_sdl2/video.pyx":809 * flags |= _SDL_RENDERER_TARGETTEXTURE * * self._renderer = SDL_CreateRenderer(window._win, index, flags) # <<<<<<<<<<<<<< * if not self._renderer: * raise error() */ - __pyx_t_4 = __Pyx_PyInt_As_Uint32(__pyx_v_flags); if (unlikely((__pyx_t_4 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 827, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_As_Uint32(__pyx_v_flags); if (unlikely((__pyx_t_4 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error) __pyx_v_self->_renderer = SDL_CreateRenderer(__pyx_v_window->_win, __pyx_v_index, __pyx_t_4); - /* "pygame/_sdl2/video.pyx":828 + /* "pygame/_sdl2/video.pyx":810 * * self._renderer = SDL_CreateRenderer(window._win, index, flags) * if not self._renderer: # <<<<<<<<<<<<<< @@ -15132,14 +14742,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 __pyx_t_1 = (!(__pyx_v_self->_renderer != 0)); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":829 + /* "pygame/_sdl2/video.pyx":811 * self._renderer = SDL_CreateRenderer(window._win, index, flags) * if not self._renderer: * raise error() # <<<<<<<<<<<<<< * * cdef Uint8[4] defaultColor = [255, 255, 255, 255] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -15157,15 +14767,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 PyObject *__pyx_callargs[1] = {__pyx_t_5, }; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 829, __pyx_L1_error) + __PYX_ERR(0, 811, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":828 + /* "pygame/_sdl2/video.pyx":810 * * self._renderer = SDL_CreateRenderer(window._win, index, flags) * if not self._renderer: # <<<<<<<<<<<<<< @@ -15174,7 +14784,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 */ } - /* "pygame/_sdl2/video.pyx":831 + /* "pygame/_sdl2/video.pyx":813 * raise error() * * cdef Uint8[4] defaultColor = [255, 255, 255, 255] # <<<<<<<<<<<<<< @@ -15187,12 +14797,12 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 __pyx_t_7[3] = 0xFF; memcpy(&(__pyx_v_defaultColor[0]), __pyx_t_7, sizeof(__pyx_v_defaultColor[0]) * (4)); - /* "pygame/_sdl2/video.pyx":832 + /* "pygame/_sdl2/video.pyx":814 * * cdef Uint8[4] defaultColor = [255, 255, 255, 255] * self._target = None # <<<<<<<<<<<<<< * self._win = window - * self._is_borrowed=0 + * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); @@ -15200,12 +14810,12 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 __Pyx_DECREF((PyObject *)__pyx_v_self->_target); __pyx_v_self->_target = ((struct __pyx_obj_6pygame_5_sdl2_5video_Texture *)Py_None); - /* "pygame/_sdl2/video.pyx":833 + /* "pygame/_sdl2/video.pyx":815 * cdef Uint8[4] defaultColor = [255, 255, 255, 255] * self._target = None * self._win = window # <<<<<<<<<<<<<< - * self._is_borrowed=0 * + * def __dealloc__(self): */ __Pyx_INCREF((PyObject *)__pyx_v_window); __Pyx_GIVEREF((PyObject *)__pyx_v_window); @@ -15213,17 +14823,8 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 __Pyx_DECREF((PyObject *)__pyx_v_self->_win); __pyx_v_self->_win = __pyx_v_window; - /* "pygame/_sdl2/video.pyx":834 - * self._target = None - * self._win = window - * self._is_borrowed=0 # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __pyx_v_self->_is_borrowed = 0; - - /* "pygame/_sdl2/video.pyx":770 - * return self + /* "pygame/_sdl2/video.pyx":752 + * cdef class Renderer: * * def __init__(self,Window window, int index=-1, # <<<<<<<<<<<<<< * int accelerated=-1, bint vsync=False, @@ -15245,62 +14846,34 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__init__(struct __pyx_obj_6 return __pyx_r; } -/* "pygame/_sdl2/video.pyx":836 - * self._is_borrowed=0 +/* "pygame/_sdl2/video.pyx":817 + * self._win = window * * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._is_borrowed: - * return + * if self._renderer: + * SDL_DestroyRenderer(self._renderer) */ /* Python wrapper */ -static void __pyx_pw_6pygame_5_sdl2_5video_8Renderer_5__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pw_6pygame_5_sdl2_5video_8Renderer_5__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pw_6pygame_5_sdl2_5video_8Renderer_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pw_6pygame_5_sdl2_5video_8Renderer_3__dealloc__(PyObject *__pyx_v_self) { CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs); __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); - __pyx_pf_6pygame_5_sdl2_5video_8Renderer_4__dealloc__(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); + __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__dealloc__(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } -static void __pyx_pf_6pygame_5_sdl2_5video_8Renderer_4__dealloc__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { +static void __pyx_pf_6pygame_5_sdl2_5video_8Renderer_2__dealloc__(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { __Pyx_RefNannyDeclarations int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "pygame/_sdl2/video.pyx":837 + /* "pygame/_sdl2/video.pyx":818 * * def __dealloc__(self): - * if self._is_borrowed: # <<<<<<<<<<<<<< - * return - * if self._renderer: - */ - __pyx_t_1 = (__pyx_v_self->_is_borrowed != 0); - if (__pyx_t_1) { - - /* "pygame/_sdl2/video.pyx":838 - * def __dealloc__(self): - * if self._is_borrowed: - * return # <<<<<<<<<<<<<< - * if self._renderer: - * SDL_DestroyRenderer(self._renderer) - */ - goto __pyx_L0; - - /* "pygame/_sdl2/video.pyx":837 - * - * def __dealloc__(self): - * if self._is_borrowed: # <<<<<<<<<<<<<< - * return - * if self._renderer: - */ - } - - /* "pygame/_sdl2/video.pyx":839 - * if self._is_borrowed: - * return * if self._renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self._renderer) * @@ -15308,8 +14881,8 @@ static void __pyx_pf_6pygame_5_sdl2_5video_8Renderer_4__dealloc__(struct __pyx_o __pyx_t_1 = (__pyx_v_self->_renderer != 0); if (__pyx_t_1) { - /* "pygame/_sdl2/video.pyx":840 - * return + /* "pygame/_sdl2/video.pyx":819 + * def __dealloc__(self): * if self._renderer: * SDL_DestroyRenderer(self._renderer) # <<<<<<<<<<<<<< * @@ -15317,29 +14890,28 @@ static void __pyx_pf_6pygame_5_sdl2_5video_8Renderer_4__dealloc__(struct __pyx_o */ SDL_DestroyRenderer(__pyx_v_self->_renderer); - /* "pygame/_sdl2/video.pyx":839 - * if self._is_borrowed: - * return + /* "pygame/_sdl2/video.pyx":818 + * + * def __dealloc__(self): * if self._renderer: # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self._renderer) * */ } - /* "pygame/_sdl2/video.pyx":836 - * self._is_borrowed=0 + /* "pygame/_sdl2/video.pyx":817 + * self._win = window * * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._is_borrowed: - * return + * if self._renderer: + * SDL_DestroyRenderer(self._renderer) */ /* function exit code */ - __pyx_L0:; __Pyx_RefNannyFinishContext(); } -/* "pygame/_sdl2/video.pyx":842 +/* "pygame/_sdl2/video.pyx":821 * SDL_DestroyRenderer(self._renderer) * * @property # <<<<<<<<<<<<<< @@ -15376,7 +14948,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___ge int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "pygame/_sdl2/video.pyx":848 + /* "pygame/_sdl2/video.pyx":827 * # https://wiki.libsdl.org/SDL_GetRenderDrawBlendMode * cdef SDL_BlendMode blendMode * cdef int res = SDL_GetRenderDrawBlendMode(self._renderer, &blendMode) # <<<<<<<<<<<<<< @@ -15385,7 +14957,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___ge */ __pyx_v_res = SDL_GetRenderDrawBlendMode(__pyx_v_self->_renderer, (&__pyx_v_blendMode)); - /* "pygame/_sdl2/video.pyx":849 + /* "pygame/_sdl2/video.pyx":828 * cdef SDL_BlendMode blendMode * cdef int res = SDL_GetRenderDrawBlendMode(self._renderer, &blendMode) * if res < 0: # <<<<<<<<<<<<<< @@ -15395,14 +14967,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___ge __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":850 + /* "pygame/_sdl2/video.pyx":829 * cdef int res = SDL_GetRenderDrawBlendMode(self._renderer, &blendMode) * if res < 0: * raise error() # <<<<<<<<<<<<<< * * return blendMode */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -15420,15 +14992,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___ge 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, 850, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __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, 850, __pyx_L1_error) + __PYX_ERR(0, 829, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":849 + /* "pygame/_sdl2/video.pyx":828 * cdef SDL_BlendMode blendMode * cdef int res = SDL_GetRenderDrawBlendMode(self._renderer, &blendMode) * if res < 0: # <<<<<<<<<<<<<< @@ -15437,7 +15009,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___ge */ } - /* "pygame/_sdl2/video.pyx":852 + /* "pygame/_sdl2/video.pyx":831 * raise error() * * return blendMode # <<<<<<<<<<<<<< @@ -15445,13 +15017,13 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___ge * @draw_blend_mode.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_From_SDL_BlendMode(__pyx_v_blendMode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_SDL_BlendMode(__pyx_v_blendMode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":842 + /* "pygame/_sdl2/video.pyx":821 * SDL_DestroyRenderer(self._renderer) * * @property # <<<<<<<<<<<<<< @@ -15472,7 +15044,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode___ge return __pyx_r; } -/* "pygame/_sdl2/video.pyx":854 +/* "pygame/_sdl2/video.pyx":833 * return blendMode * * @draw_blend_mode.setter # <<<<<<<<<<<<<< @@ -15509,17 +15081,17 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode_2__set__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "pygame/_sdl2/video.pyx":857 + /* "pygame/_sdl2/video.pyx":836 * def draw_blend_mode(self, blendMode): * # https://wiki.libsdl.org/SDL_SetRenderDrawBlendMode * cdef int res = SDL_SetRenderDrawBlendMode(self._renderer, blendMode) # <<<<<<<<<<<<<< * if res < 0: * raise error() */ - __pyx_t_1 = ((SDL_BlendMode)__Pyx_PyInt_As_SDL_BlendMode(__pyx_v_blendMode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 857, __pyx_L1_error) + __pyx_t_1 = ((SDL_BlendMode)__Pyx_PyInt_As_SDL_BlendMode(__pyx_v_blendMode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 836, __pyx_L1_error) __pyx_v_res = SDL_SetRenderDrawBlendMode(__pyx_v_self->_renderer, __pyx_t_1); - /* "pygame/_sdl2/video.pyx":858 + /* "pygame/_sdl2/video.pyx":837 * # https://wiki.libsdl.org/SDL_SetRenderDrawBlendMode * cdef int res = SDL_SetRenderDrawBlendMode(self._renderer, blendMode) * if res < 0: # <<<<<<<<<<<<<< @@ -15529,14 +15101,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode_2__set__(s __pyx_t_2 = (__pyx_v_res < 0); if (unlikely(__pyx_t_2)) { - /* "pygame/_sdl2/video.pyx":859 + /* "pygame/_sdl2/video.pyx":838 * cdef int res = SDL_SetRenderDrawBlendMode(self._renderer, blendMode) * if res < 0: * raise error() # <<<<<<<<<<<<<< * * @property */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -15554,15 +15126,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode_2__set__(s PyObject *__pyx_callargs[1] = {__pyx_t_5, }; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 859, __pyx_L1_error) + __PYX_ERR(0, 838, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":858 + /* "pygame/_sdl2/video.pyx":837 * # https://wiki.libsdl.org/SDL_SetRenderDrawBlendMode * cdef int res = SDL_SetRenderDrawBlendMode(self._renderer, blendMode) * if res < 0: # <<<<<<<<<<<<<< @@ -15571,7 +15143,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode_2__set__(s */ } - /* "pygame/_sdl2/video.pyx":854 + /* "pygame/_sdl2/video.pyx":833 * return blendMode * * @draw_blend_mode.setter # <<<<<<<<<<<<<< @@ -15593,7 +15165,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_15draw_blend_mode_2__set__(s return __pyx_r; } -/* "pygame/_sdl2/video.pyx":861 +/* "pygame/_sdl2/video.pyx":840 * raise error() * * @property # <<<<<<<<<<<<<< @@ -15630,7 +15202,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "pygame/_sdl2/video.pyx":867 + /* "pygame/_sdl2/video.pyx":846 * cdef Uint8[4] rgba * * cdef int res = SDL_GetRenderDrawColor(self._renderer, # <<<<<<<<<<<<<< @@ -15639,7 +15211,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(s */ __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":873 + /* "pygame/_sdl2/video.pyx":852 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -15649,14 +15221,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(s __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":874 + /* "pygame/_sdl2/video.pyx":853 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * return pgColor_NewLength(rgba, 4) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -15674,15 +15246,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(s 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, 874, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 853, __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, 874, __pyx_L1_error) + __PYX_ERR(0, 853, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":873 + /* "pygame/_sdl2/video.pyx":852 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -15691,7 +15263,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(s */ } - /* "pygame/_sdl2/video.pyx":876 + /* "pygame/_sdl2/video.pyx":855 * raise error() * * return pgColor_NewLength(rgba, 4) # <<<<<<<<<<<<<< @@ -15699,13 +15271,13 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(s * @draw_color.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = pgColor_NewLength(__pyx_v_rgba, 4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error) + __pyx_t_2 = pgColor_NewLength(__pyx_v_rgba, 4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":861 + /* "pygame/_sdl2/video.pyx":840 * raise error() * * @property # <<<<<<<<<<<<<< @@ -15726,7 +15298,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color___get__(s return __pyx_r; } -/* "pygame/_sdl2/video.pyx":878 +/* "pygame/_sdl2/video.pyx":857 * return pgColor_NewLength(rgba, 4) * * @draw_color.setter # <<<<<<<<<<<<<< @@ -15763,16 +15335,16 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "pygame/_sdl2/video.pyx":881 + /* "pygame/_sdl2/video.pyx":860 * def draw_color(self, new_value): * cdef Uint8[4] rgba * pg_RGBAFromObjEx(new_value, rgba, PG_COLOR_HANDLE_ALL) # <<<<<<<<<<<<<< * * # https://wiki.libsdl.org/SDL_SetRenderDrawColor */ - __pyx_t_1 = pg_RGBAFromObjEx(__pyx_v_new_value, __pyx_v_rgba, PG_COLOR_HANDLE_ALL); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 881, __pyx_L1_error) + __pyx_t_1 = pg_RGBAFromObjEx(__pyx_v_new_value, __pyx_v_rgba, PG_COLOR_HANDLE_ALL); if (unlikely(__pyx_t_1 == ((int)0))) __PYX_ERR(0, 860, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":884 + /* "pygame/_sdl2/video.pyx":863 * * # https://wiki.libsdl.org/SDL_SetRenderDrawColor * cdef int res = SDL_SetRenderDrawColor(self._renderer, # <<<<<<<<<<<<<< @@ -15781,7 +15353,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct */ __pyx_v_res = SDL_SetRenderDrawColor(__pyx_v_self->_renderer, (__pyx_v_rgba[0]), (__pyx_v_rgba[1]), (__pyx_v_rgba[2]), (__pyx_v_rgba[3])); - /* "pygame/_sdl2/video.pyx":890 + /* "pygame/_sdl2/video.pyx":869 * rgba[3]) * * if res < 0: # <<<<<<<<<<<<<< @@ -15791,14 +15363,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct __pyx_t_2 = (__pyx_v_res < 0); if (unlikely(__pyx_t_2)) { - /* "pygame/_sdl2/video.pyx":891 + /* "pygame/_sdl2/video.pyx":870 * * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def clear(self): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_1 = 0; @@ -15816,15 +15388,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct PyObject *__pyx_callargs[1] = {__pyx_t_5, }; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_1, 0+__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 891, __pyx_L1_error) + __PYX_ERR(0, 870, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":890 + /* "pygame/_sdl2/video.pyx":869 * rgba[3]) * * if res < 0: # <<<<<<<<<<<<<< @@ -15833,7 +15405,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct */ } - /* "pygame/_sdl2/video.pyx":878 + /* "pygame/_sdl2/video.pyx":857 * return pgColor_NewLength(rgba, 4) * * @draw_color.setter # <<<<<<<<<<<<<< @@ -15855,7 +15427,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":893 +/* "pygame/_sdl2/video.pyx":872 * raise error() * * def clear(self): # <<<<<<<<<<<<<< @@ -15864,16 +15436,16 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10draw_color_2__set__(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7clear(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_5clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_6clear, "Clear the current rendering target with the drawing color\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_7clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_6clear}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7clear(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_4clear, "Clear the current rendering target with the drawing color\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_5clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_5clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_4clear}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_5clear(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -15890,14 +15462,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("clear", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear", 0))) return NULL; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_4clear(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_4clear(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { int __pyx_v_res; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -15911,7 +15483,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear", 0); - /* "pygame/_sdl2/video.pyx":897 + /* "pygame/_sdl2/video.pyx":876 * """ * # https://wiki.libsdl.org/SDL_RenderClear * cdef int res = SDL_RenderClear(self._renderer) # <<<<<<<<<<<<<< @@ -15920,7 +15492,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_ob */ __pyx_v_res = SDL_RenderClear(__pyx_v_self->_renderer); - /* "pygame/_sdl2/video.pyx":898 + /* "pygame/_sdl2/video.pyx":877 * # https://wiki.libsdl.org/SDL_RenderClear * cdef int res = SDL_RenderClear(self._renderer) * if res < 0: # <<<<<<<<<<<<<< @@ -15930,14 +15502,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_ob __pyx_t_1 = (__pyx_v_res < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":899 + /* "pygame/_sdl2/video.pyx":878 * cdef int res = SDL_RenderClear(self._renderer) * if res < 0: * raise error() # <<<<<<<<<<<<<< * * def present(self): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -15955,15 +15527,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_ob 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, 899, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __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, 899, __pyx_L1_error) + __PYX_ERR(0, 878, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":898 + /* "pygame/_sdl2/video.pyx":877 * # https://wiki.libsdl.org/SDL_RenderClear * cdef int res = SDL_RenderClear(self._renderer) * if res < 0: # <<<<<<<<<<<<<< @@ -15972,7 +15544,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_ob */ } - /* "pygame/_sdl2/video.pyx":893 + /* "pygame/_sdl2/video.pyx":872 * raise error() * * def clear(self): # <<<<<<<<<<<<<< @@ -15995,7 +15567,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_ob return __pyx_r; } -/* "pygame/_sdl2/video.pyx":901 +/* "pygame/_sdl2/video.pyx":880 * raise error() * * def present(self): # <<<<<<<<<<<<<< @@ -16004,16 +15576,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6clear(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9present(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7present(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_8present, "Update the screen with any rendering performed since the previous call\n\n Presents the composed backbuffer to the screen.\n Updates the screen with any rendering performed since the previous call.\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_9present = {"present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_8present}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9present(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_6present, "Update the screen with any rendering performed since the previous call\n\n Presents the composed backbuffer to the screen.\n Updates the screen with any rendering performed since the previous call.\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_7present = {"present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_6present}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7present(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16030,19 +15602,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("present", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "present", 0))) return NULL; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_8present(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6present(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_8present(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6present(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("present", 0); - /* "pygame/_sdl2/video.pyx":908 + /* "pygame/_sdl2/video.pyx":887 * """ * # https://wiki.libsdl.org/SDL_RenderPresent * SDL_RenderPresent(self._renderer) # <<<<<<<<<<<<<< @@ -16051,7 +15623,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_8present(struct __pyx_ */ SDL_RenderPresent(__pyx_v_self->_renderer); - /* "pygame/_sdl2/video.pyx":901 + /* "pygame/_sdl2/video.pyx":880 * raise error() * * def present(self): # <<<<<<<<<<<<<< @@ -16066,7 +15638,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_8present(struct __pyx_ return __pyx_r; } -/* "pygame/_sdl2/video.pyx":910 +/* "pygame/_sdl2/video.pyx":889 * SDL_RenderPresent(self._renderer) * * cpdef get_viewport(self): # <<<<<<<<<<<<<< @@ -16074,7 +15646,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_8present(struct __pyx_ * """ */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11get_viewport(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9get_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16103,14 +15675,14 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(struct __p if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_viewport); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_viewport); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #ifdef __Pyx_CyFunction_USED if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1) #else if (!PyCFunction_Check(__pyx_t_1) #endif - || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11get_viewport)) { + || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9get_viewport)) { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL; @@ -16129,7 +15701,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(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, 910, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -16151,7 +15723,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(struct __p #endif } - /* "pygame/_sdl2/video.pyx":915 + /* "pygame/_sdl2/video.pyx":894 * # https://wiki.libsdl.org/SDL_RenderGetViewport * cdef SDL_Rect rect * SDL_RenderGetViewport(self._renderer, &rect) # <<<<<<<<<<<<<< @@ -16160,7 +15732,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(struct __p */ SDL_RenderGetViewport(__pyx_v_self->_renderer, (&__pyx_v_rect)); - /* "pygame/_sdl2/video.pyx":916 + /* "pygame/_sdl2/video.pyx":895 * cdef SDL_Rect rect * SDL_RenderGetViewport(self._renderer, &rect) * return pgRect_New(&rect) # <<<<<<<<<<<<<< @@ -16168,13 +15740,13 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(struct __p * def set_viewport(self, area): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = pgRect_New((&__pyx_v_rect)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) + __pyx_t_1 = pgRect_New((&__pyx_v_rect)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":910 + /* "pygame/_sdl2/video.pyx":889 * SDL_RenderPresent(self._renderer) * * cpdef get_viewport(self): # <<<<<<<<<<<<<< @@ -16197,16 +15769,16 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(struct __p } /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11get_viewport(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9get_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_10get_viewport, "Get the drawing area on the rendering target\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_11get_viewport = {"get_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11get_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_10get_viewport}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11get_viewport(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_8get_viewport, "Get the drawing area on the rendering target\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_9get_viewport = {"get_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9get_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_8get_viewport}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9get_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16223,14 +15795,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_viewport", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_viewport", 0))) return NULL; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10get_viewport(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_8get_viewport(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10get_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_8get_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -16239,7 +15811,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10get_viewport(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_viewport", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6pygame_5_sdl2_5video_8Renderer_get_viewport(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16256,7 +15828,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10get_viewport(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":918 +/* "pygame/_sdl2/video.pyx":897 * return pgRect_New(&rect) * * def set_viewport(self, area): # <<<<<<<<<<<<<< @@ -16265,16 +15837,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10get_viewport(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13set_viewport(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11set_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_12set_viewport, "Set the drawing area on the rendering target\n\n :param area: A :class:`pygame.Rect` or tuple representing the\n drawing area on the target, or ``None`` to use the\n entire area of the current rendering target. \n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_13set_viewport = {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_12set_viewport}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13set_viewport(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_10set_viewport, "Set the drawing area on the rendering target\n\n :param area: A :class:`pygame.Rect` or tuple representing the\n drawing area on the target, or ``None`` to use the\n entire area of the current rendering target. \n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_11set_viewport = {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_10set_viewport}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11set_viewport(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -16307,12 +15879,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_area)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 918, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 897, __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, "set_viewport") < 0)) __PYX_ERR(0, 918, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_viewport") < 0)) __PYX_ERR(0, 897, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -16323,20 +15895,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("set_viewport", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 918, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("set_viewport", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 897, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.set_viewport", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_area); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_10set_viewport(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_area); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_area) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_10set_viewport(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_area) { SDL_Rect __pyx_v_tmprect; SDL_Rect *__pyx_v_rectptr; PyObject *__pyx_r = NULL; @@ -16351,7 +15923,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("set_viewport", 0); - /* "pygame/_sdl2/video.pyx":926 + /* "pygame/_sdl2/video.pyx":905 * """ * # https://wiki.libsdl.org/SDL_RenderSetViewport * if area is None: # <<<<<<<<<<<<<< @@ -16361,7 +15933,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct __pyx_t_1 = (__pyx_v_area == Py_None); if (__pyx_t_1) { - /* "pygame/_sdl2/video.pyx":927 + /* "pygame/_sdl2/video.pyx":906 * # https://wiki.libsdl.org/SDL_RenderSetViewport * if area is None: * if SDL_RenderSetViewport(self._renderer, NULL) < 0: # <<<<<<<<<<<<<< @@ -16371,14 +15943,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct __pyx_t_1 = (SDL_RenderSetViewport(__pyx_v_self->_renderer, NULL) < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":928 + /* "pygame/_sdl2/video.pyx":907 * if area is None: * if SDL_RenderSetViewport(self._renderer, NULL) < 0: * raise error() # <<<<<<<<<<<<<< * return * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -16396,15 +15968,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(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, 928, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __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, 928, __pyx_L1_error) + __PYX_ERR(0, 907, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":927 + /* "pygame/_sdl2/video.pyx":906 * # https://wiki.libsdl.org/SDL_RenderSetViewport * if area is None: * if SDL_RenderSetViewport(self._renderer, NULL) < 0: # <<<<<<<<<<<<<< @@ -16413,7 +15985,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct */ } - /* "pygame/_sdl2/video.pyx":929 + /* "pygame/_sdl2/video.pyx":908 * if SDL_RenderSetViewport(self._renderer, NULL) < 0: * raise error() * return # <<<<<<<<<<<<<< @@ -16424,7 +15996,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":926 + /* "pygame/_sdl2/video.pyx":905 * """ * # https://wiki.libsdl.org/SDL_RenderSetViewport * if area is None: # <<<<<<<<<<<<<< @@ -16433,7 +16005,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct */ } - /* "pygame/_sdl2/video.pyx":932 + /* "pygame/_sdl2/video.pyx":911 * * cdef SDL_Rect tmprect * cdef SDL_Rect *rectptr = pgRect_FromObject(area, &tmprect) # <<<<<<<<<<<<<< @@ -16442,7 +16014,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct */ __pyx_v_rectptr = pgRect_FromObject(__pyx_v_area, (&__pyx_v_tmprect)); - /* "pygame/_sdl2/video.pyx":933 + /* "pygame/_sdl2/video.pyx":912 * cdef SDL_Rect tmprect * cdef SDL_Rect *rectptr = pgRect_FromObject(area, &tmprect) * if rectptr == NULL: # <<<<<<<<<<<<<< @@ -16452,20 +16024,20 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct __pyx_t_1 = (__pyx_v_rectptr == NULL); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":934 + /* "pygame/_sdl2/video.pyx":913 * cdef SDL_Rect *rectptr = pgRect_FromObject(area, &tmprect) * if rectptr == NULL: * raise TypeError('expected a rectangle') # <<<<<<<<<<<<<< * * if SDL_RenderSetViewport(self._renderer, rectptr) < 0: */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __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, 934, __pyx_L1_error) + __PYX_ERR(0, 913, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":933 + /* "pygame/_sdl2/video.pyx":912 * cdef SDL_Rect tmprect * cdef SDL_Rect *rectptr = pgRect_FromObject(area, &tmprect) * if rectptr == NULL: # <<<<<<<<<<<<<< @@ -16474,7 +16046,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct */ } - /* "pygame/_sdl2/video.pyx":936 + /* "pygame/_sdl2/video.pyx":915 * raise TypeError('expected a rectangle') * * if SDL_RenderSetViewport(self._renderer, rectptr) < 0: # <<<<<<<<<<<<<< @@ -16484,14 +16056,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct __pyx_t_1 = (SDL_RenderSetViewport(__pyx_v_self->_renderer, __pyx_v_rectptr) < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":937 + /* "pygame/_sdl2/video.pyx":916 * * if SDL_RenderSetViewport(self._renderer, rectptr) < 0: * raise error() # <<<<<<<<<<<<<< * * @property */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 937, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -16509,15 +16081,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(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, 937, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __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, 937, __pyx_L1_error) + __PYX_ERR(0, 916, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":936 + /* "pygame/_sdl2/video.pyx":915 * raise TypeError('expected a rectangle') * * if SDL_RenderSetViewport(self._renderer, rectptr) < 0: # <<<<<<<<<<<<<< @@ -16526,7 +16098,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct */ } - /* "pygame/_sdl2/video.pyx":918 + /* "pygame/_sdl2/video.pyx":897 * return pgRect_New(&rect) * * def set_viewport(self, area): # <<<<<<<<<<<<<< @@ -16549,7 +16121,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12set_viewport(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":939 +/* "pygame/_sdl2/video.pyx":918 * raise error() * * @property # <<<<<<<<<<<<<< @@ -16584,7 +16156,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size___get__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "pygame/_sdl2/video.pyx":945 + /* "pygame/_sdl2/video.pyx":924 * cdef int w * cdef int h * SDL_RenderGetLogicalSize(self._renderer, &w, &h) # <<<<<<<<<<<<<< @@ -16593,7 +16165,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size___get__ */ SDL_RenderGetLogicalSize(__pyx_v_self->_renderer, (&__pyx_v_w), (&__pyx_v_h)); - /* "pygame/_sdl2/video.pyx":946 + /* "pygame/_sdl2/video.pyx":925 * cdef int h * SDL_RenderGetLogicalSize(self._renderer, &w, &h) * return (w, h) # <<<<<<<<<<<<<< @@ -16601,11 +16173,11 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size___get__ * @logical_size.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -16617,7 +16189,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size___get__ __pyx_t_3 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":939 + /* "pygame/_sdl2/video.pyx":918 * raise error() * * @property # <<<<<<<<<<<<<< @@ -16638,7 +16210,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size___get__ return __pyx_r; } -/* "pygame/_sdl2/video.pyx":948 +/* "pygame/_sdl2/video.pyx":927 * return (w, h) * * @logical_size.setter # <<<<<<<<<<<<<< @@ -16675,33 +16247,33 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size_2__set__(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "pygame/_sdl2/video.pyx":950 + /* "pygame/_sdl2/video.pyx":929 * @logical_size.setter * def logical_size(self, size): * cdef int w = size[0] # <<<<<<<<<<<<<< * cdef int h = size[1] * if (SDL_RenderSetLogicalSize(self._renderer, w, h) != 0): */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 950, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_w = __pyx_t_2; - /* "pygame/_sdl2/video.pyx":951 + /* "pygame/_sdl2/video.pyx":930 * def logical_size(self, size): * cdef int w = size[0] * cdef int h = size[1] # <<<<<<<<<<<<<< * if (SDL_RenderSetLogicalSize(self._renderer, w, h) != 0): * raise error() */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 930, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_h = __pyx_t_2; - /* "pygame/_sdl2/video.pyx":952 + /* "pygame/_sdl2/video.pyx":931 * cdef int w = size[0] * cdef int h = size[1] * if (SDL_RenderSetLogicalSize(self._renderer, w, h) != 0): # <<<<<<<<<<<<<< @@ -16711,14 +16283,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size_2__set__(stru __pyx_t_3 = (SDL_RenderSetLogicalSize(__pyx_v_self->_renderer, __pyx_v_w, __pyx_v_h) != 0); if (unlikely(__pyx_t_3)) { - /* "pygame/_sdl2/video.pyx":953 + /* "pygame/_sdl2/video.pyx":932 * cdef int h = size[1] * if (SDL_RenderSetLogicalSize(self._renderer, w, h) != 0): * raise error() # <<<<<<<<<<<<<< * * @property */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 953, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_2 = 0; @@ -16736,15 +16308,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size_2__set__(stru PyObject *__pyx_callargs[1] = {__pyx_t_5, }; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_2, 0+__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 953, __pyx_L1_error) + __PYX_ERR(0, 932, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":952 + /* "pygame/_sdl2/video.pyx":931 * cdef int w = size[0] * cdef int h = size[1] * if (SDL_RenderSetLogicalSize(self._renderer, w, h) != 0): # <<<<<<<<<<<<<< @@ -16753,7 +16325,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size_2__set__(stru */ } - /* "pygame/_sdl2/video.pyx":948 + /* "pygame/_sdl2/video.pyx":927 * return (w, h) * * @logical_size.setter # <<<<<<<<<<<<<< @@ -16775,7 +16347,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12logical_size_2__set__(stru return __pyx_r; } -/* "pygame/_sdl2/video.pyx":955 +/* "pygame/_sdl2/video.pyx":934 * raise error() * * @property # <<<<<<<<<<<<<< @@ -16810,7 +16382,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale___get__(struct int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "pygame/_sdl2/video.pyx":961 + /* "pygame/_sdl2/video.pyx":940 * cdef float x * cdef float y * SDL_RenderGetScale(self._renderer, &x, &y) # <<<<<<<<<<<<<< @@ -16819,7 +16391,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale___get__(struct */ SDL_RenderGetScale(__pyx_v_self->_renderer, (&__pyx_v_x), (&__pyx_v_y)); - /* "pygame/_sdl2/video.pyx":962 + /* "pygame/_sdl2/video.pyx":941 * cdef float y * SDL_RenderGetScale(self._renderer, &x, &y) * return (x, y) # <<<<<<<<<<<<<< @@ -16827,11 +16399,11 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale___get__(struct * @scale.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); @@ -16843,7 +16415,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale___get__(struct __pyx_t_3 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":955 + /* "pygame/_sdl2/video.pyx":934 * raise error() * * @property # <<<<<<<<<<<<<< @@ -16864,7 +16436,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale___get__(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":964 +/* "pygame/_sdl2/video.pyx":943 * return (x, y) * * @scale.setter # <<<<<<<<<<<<<< @@ -16902,33 +16474,33 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale_2__set__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "pygame/_sdl2/video.pyx":966 + /* "pygame/_sdl2/video.pyx":945 * @scale.setter * def scale(self, scale): * cdef float x = scale[0] # <<<<<<<<<<<<<< * cdef float y = scale[1] * if (SDL_RenderSetScale(self._renderer, x, y) != 0): */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __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, 966, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_x = __pyx_t_2; - /* "pygame/_sdl2/video.pyx":967 + /* "pygame/_sdl2/video.pyx":946 * def scale(self, scale): * cdef float x = scale[0] * cdef float y = scale[1] # <<<<<<<<<<<<<< * if (SDL_RenderSetScale(self._renderer, x, y) != 0): * raise error() */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_scale, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __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, 967, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_y = __pyx_t_2; - /* "pygame/_sdl2/video.pyx":968 + /* "pygame/_sdl2/video.pyx":947 * cdef float x = scale[0] * cdef float y = scale[1] * if (SDL_RenderSetScale(self._renderer, x, y) != 0): # <<<<<<<<<<<<<< @@ -16938,14 +16510,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale_2__set__(struct __pyx __pyx_t_3 = (SDL_RenderSetScale(__pyx_v_self->_renderer, __pyx_v_x, __pyx_v_y) != 0); if (unlikely(__pyx_t_3)) { - /* "pygame/_sdl2/video.pyx":969 + /* "pygame/_sdl2/video.pyx":948 * cdef float y = scale[1] * if (SDL_RenderSetScale(self._renderer, x, y) != 0): * raise error() # <<<<<<<<<<<<<< * * # TODO ifdef */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -16963,15 +16535,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale_2__set__(struct __pyx PyObject *__pyx_callargs[1] = {__pyx_t_5, }; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 969, __pyx_L1_error) + __PYX_ERR(0, 948, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":968 + /* "pygame/_sdl2/video.pyx":947 * cdef float x = scale[0] * cdef float y = scale[1] * if (SDL_RenderSetScale(self._renderer, x, y) != 0): # <<<<<<<<<<<<<< @@ -16980,7 +16552,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale_2__set__(struct __pyx */ } - /* "pygame/_sdl2/video.pyx":964 + /* "pygame/_sdl2/video.pyx":943 * return (x, y) * * @scale.setter # <<<<<<<<<<<<<< @@ -17002,7 +16574,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_5scale_2__set__(struct __pyx return __pyx_r; } -/* "pygame/_sdl2/video.pyx":975 +/* "pygame/_sdl2/video.pyx":954 * # return SDL_RenderGetIntegerScale(self._renderer) * * @property # <<<<<<<<<<<<<< @@ -17029,7 +16601,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target___get__(struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); - /* "pygame/_sdl2/video.pyx":984 + /* "pygame/_sdl2/video.pyx":963 * """ * # https://wiki.libsdl.org/SDL_GetRenderTarget * return self._target # <<<<<<<<<<<<<< @@ -17041,7 +16613,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target___get__(struct __pyx_r = ((PyObject *)__pyx_v_self->_target); goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":975 + /* "pygame/_sdl2/video.pyx":954 * # return SDL_RenderGetIntegerScale(self._renderer) * * @property # <<<<<<<<<<<<<< @@ -17056,7 +16628,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target___get__(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":986 +/* "pygame/_sdl2/video.pyx":965 * return self._target * * @target.setter # <<<<<<<<<<<<<< @@ -17091,7 +16663,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "pygame/_sdl2/video.pyx":989 + /* "pygame/_sdl2/video.pyx":968 * def target(self, newtarget): * # https://wiki.libsdl.org/SDL_SetRenderTarget * if newtarget is None: # <<<<<<<<<<<<<< @@ -17101,7 +16673,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py __pyx_t_1 = (__pyx_v_newtarget == Py_None); if (__pyx_t_1) { - /* "pygame/_sdl2/video.pyx":990 + /* "pygame/_sdl2/video.pyx":969 * # https://wiki.libsdl.org/SDL_SetRenderTarget * if newtarget is None: * self._target = None # <<<<<<<<<<<<<< @@ -17114,7 +16686,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py __Pyx_DECREF((PyObject *)__pyx_v_self->_target); __pyx_v_self->_target = ((struct __pyx_obj_6pygame_5_sdl2_5video_Texture *)Py_None); - /* "pygame/_sdl2/video.pyx":991 + /* "pygame/_sdl2/video.pyx":970 * if newtarget is None: * self._target = None * if SDL_SetRenderTarget(self._renderer, NULL) < 0: # <<<<<<<<<<<<<< @@ -17124,14 +16696,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py __pyx_t_1 = (SDL_SetRenderTarget(__pyx_v_self->_renderer, NULL) < 0); if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":992 + /* "pygame/_sdl2/video.pyx":971 * self._target = None * if SDL_SetRenderTarget(self._renderer, NULL) < 0: * raise error() # <<<<<<<<<<<<<< * elif isinstance(newtarget, Texture): * self._target = newtarget */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -17149,15 +16721,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py 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, 992, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __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, 992, __pyx_L1_error) + __PYX_ERR(0, 971, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":991 + /* "pygame/_sdl2/video.pyx":970 * if newtarget is None: * self._target = None * if SDL_SetRenderTarget(self._renderer, NULL) < 0: # <<<<<<<<<<<<<< @@ -17166,7 +16738,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py */ } - /* "pygame/_sdl2/video.pyx":989 + /* "pygame/_sdl2/video.pyx":968 * def target(self, newtarget): * # https://wiki.libsdl.org/SDL_SetRenderTarget * if newtarget is None: # <<<<<<<<<<<<<< @@ -17176,7 +16748,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py goto __pyx_L3; } - /* "pygame/_sdl2/video.pyx":993 + /* "pygame/_sdl2/video.pyx":972 * if SDL_SetRenderTarget(self._renderer, NULL) < 0: * raise error() * elif isinstance(newtarget, Texture): # <<<<<<<<<<<<<< @@ -17186,14 +16758,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_newtarget, __pyx_ptype_6pygame_5_sdl2_5video_Texture); if (likely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":994 + /* "pygame/_sdl2/video.pyx":973 * raise error() * elif isinstance(newtarget, Texture): * self._target = newtarget # <<<<<<<<<<<<<< * if SDL_SetRenderTarget(self._renderer, * self._target._tex) < 0: */ - if (!(likely(((__pyx_v_newtarget) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_newtarget, __pyx_ptype_6pygame_5_sdl2_5video_Texture))))) __PYX_ERR(0, 994, __pyx_L1_error) + if (!(likely(((__pyx_v_newtarget) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_newtarget, __pyx_ptype_6pygame_5_sdl2_5video_Texture))))) __PYX_ERR(0, 973, __pyx_L1_error) __pyx_t_2 = __pyx_v_newtarget; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); @@ -17202,7 +16774,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py __pyx_v_self->_target = ((struct __pyx_obj_6pygame_5_sdl2_5video_Texture *)__pyx_t_2); __pyx_t_2 = 0; - /* "pygame/_sdl2/video.pyx":996 + /* "pygame/_sdl2/video.pyx":975 * self._target = newtarget * if SDL_SetRenderTarget(self._renderer, * self._target._tex) < 0: # <<<<<<<<<<<<<< @@ -17211,7 +16783,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py */ __pyx_t_1 = (SDL_SetRenderTarget(__pyx_v_self->_renderer, __pyx_v_self->_target->_tex) < 0); - /* "pygame/_sdl2/video.pyx":995 + /* "pygame/_sdl2/video.pyx":974 * elif isinstance(newtarget, Texture): * self._target = newtarget * if SDL_SetRenderTarget(self._renderer, # <<<<<<<<<<<<<< @@ -17220,14 +16792,14 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py */ if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":997 + /* "pygame/_sdl2/video.pyx":976 * if SDL_SetRenderTarget(self._renderer, * self._target._tex) < 0: * raise error() # <<<<<<<<<<<<<< * else: * raise TypeError('target must be a Texture or None') */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 997, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -17245,15 +16817,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py 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, 997, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __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, 997, __pyx_L1_error) + __PYX_ERR(0, 976, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":995 + /* "pygame/_sdl2/video.pyx":974 * elif isinstance(newtarget, Texture): * self._target = newtarget * if SDL_SetRenderTarget(self._renderer, # <<<<<<<<<<<<<< @@ -17262,7 +16834,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py */ } - /* "pygame/_sdl2/video.pyx":993 + /* "pygame/_sdl2/video.pyx":972 * if SDL_SetRenderTarget(self._renderer, NULL) < 0: * raise error() * elif isinstance(newtarget, Texture): # <<<<<<<<<<<<<< @@ -17272,7 +16844,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py goto __pyx_L3; } - /* "pygame/_sdl2/video.pyx":999 + /* "pygame/_sdl2/video.pyx":978 * raise error() * else: * raise TypeError('target must be a Texture or None') # <<<<<<<<<<<<<< @@ -17280,15 +16852,15 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py * cpdef object blit(self, object source, Rect dest=None, Rect 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, 999, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __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, 999, __pyx_L1_error) + __PYX_ERR(0, 978, __pyx_L1_error) } __pyx_L3:; - /* "pygame/_sdl2/video.pyx":986 + /* "pygame/_sdl2/video.pyx":965 * return self._target * * @target.setter # <<<<<<<<<<<<<< @@ -17310,7 +16882,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1001 +/* "pygame/_sdl2/video.pyx":980 * 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): # <<<<<<<<<<<<<< @@ -17318,7 +16890,7 @@ static int __pyx_pf_6pygame_5_sdl2_5video_8Renderer_6target_2__set__(struct __py * */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15blit(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13blit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17365,16 +16937,16 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_blit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_blit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #ifdef __Pyx_CyFunction_USED if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1) #else if (!PyCFunction_Check(__pyx_t_1) #endif - || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15blit)) { + || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13blit)) { __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_special_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_special_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL; @@ -17394,7 +16966,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 __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; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -17416,7 +16988,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 #endif } - /* "pygame/_sdl2/video.pyx":1014 + /* "pygame/_sdl2/video.pyx":993 * .. note:: Textures created by different Renderers cannot shared with each other! * """ * if isinstance(source, Texture): # <<<<<<<<<<<<<< @@ -17426,7 +16998,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_6pygame_5_sdl2_5video_Texture); if (__pyx_t_7) { - /* "pygame/_sdl2/video.pyx":1015 + /* "pygame/_sdl2/video.pyx":994 * """ * if isinstance(source, Texture): * (source).draw(area, dest) # <<<<<<<<<<<<<< @@ -17436,9 +17008,9 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 __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, 1015, __pyx_L1_error) + ((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, 994, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1014 + /* "pygame/_sdl2/video.pyx":993 * .. note:: Textures created by different Renderers cannot shared with each other! * """ * if isinstance(source, Texture): # <<<<<<<<<<<<<< @@ -17448,7 +17020,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 goto __pyx_L3; } - /* "pygame/_sdl2/video.pyx":1016 + /* "pygame/_sdl2/video.pyx":995 * if isinstance(source, Texture): * (source).draw(area, dest) * elif isinstance(source, Image): # <<<<<<<<<<<<<< @@ -17458,7 +17030,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_6pygame_5_sdl2_5video_Image); if (__pyx_t_7) { - /* "pygame/_sdl2/video.pyx":1017 + /* "pygame/_sdl2/video.pyx":996 * (source).draw(area, dest) * elif isinstance(source, Image): * (source).draw(area, dest) # <<<<<<<<<<<<<< @@ -17468,9 +17040,9 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 __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, 1017, __pyx_L1_error) + ((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, 996, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1016 + /* "pygame/_sdl2/video.pyx":995 * if isinstance(source, Texture): * (source).draw(area, dest) * elif isinstance(source, Image): # <<<<<<<<<<<<<< @@ -17480,31 +17052,31 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 goto __pyx_L3; } - /* "pygame/_sdl2/video.pyx":1018 + /* "pygame/_sdl2/video.pyx":997 * 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, 1018, __pyx_L1_error) + __pyx_t_7 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_s_draw); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 997, __pyx_L1_error) __pyx_t_10 = (!__pyx_t_7); if (unlikely(__pyx_t_10)) { - /* "pygame/_sdl2/video.pyx":1019 + /* "pygame/_sdl2/video.pyx":998 * (source).draw(area, dest) * elif not hasattr(source, 'draw'): * raise TypeError('source must be drawable') # <<<<<<<<<<<<<< * else: * 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, 1019, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __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, 1019, __pyx_L1_error) + __PYX_ERR(0, 998, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1018 + /* "pygame/_sdl2/video.pyx":997 * elif isinstance(source, Image): * (source).draw(area, dest) * elif not hasattr(source, 'draw'): # <<<<<<<<<<<<<< @@ -17513,7 +17085,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 */ } - /* "pygame/_sdl2/video.pyx":1021 + /* "pygame/_sdl2/video.pyx":1000 * raise TypeError('source must be drawable') * else: * source.draw(area, dest) # <<<<<<<<<<<<<< @@ -17521,7 +17093,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 * if not dest: */ /*else*/ { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_6 = 0; @@ -17539,7 +17111,7 @@ 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)}; __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, 1021, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -17547,18 +17119,18 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 } __pyx_L3:; - /* "pygame/_sdl2/video.pyx":1023 + /* "pygame/_sdl2/video.pyx":1002 * source.draw(area, dest) * * 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, 1023, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_dest)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1002, __pyx_L1_error) __pyx_t_7 = (!__pyx_t_10); if (__pyx_t_7) { - /* "pygame/_sdl2/video.pyx":1024 + /* "pygame/_sdl2/video.pyx":1003 * * if not dest: * return self.get_viewport() # <<<<<<<<<<<<<< @@ -17566,13 +17138,13 @@ 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, 1024, __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, 1003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":1023 + /* "pygame/_sdl2/video.pyx":1002 * source.draw(area, dest) * * if not dest: # <<<<<<<<<<<<<< @@ -17581,7 +17153,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 */ } - /* "pygame/_sdl2/video.pyx":1025 + /* "pygame/_sdl2/video.pyx":1004 * if not dest: * return self.get_viewport() * return dest # <<<<<<<<<<<<<< @@ -17593,7 +17165,7 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 __pyx_r = ((PyObject *)__pyx_v_dest); goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":1001 + /* "pygame/_sdl2/video.pyx":980 * 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): # <<<<<<<<<<<<<< @@ -17617,16 +17189,16 @@ static PyObject *__pyx_f_6pygame_5_sdl2_5video_8Renderer_blit(struct __pyx_obj_6 } /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15blit(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13blit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_14blit, "Draw textures using a Surface-like API\n\n For compatibility purposes. Draws :class:`Texture` objects onto the\n Renderer using a method signature similar to :meth:`pygame.Surface.blit`.\n\n :param source: A :class:`Texture` or :class:`Image` to draw.\n :param dest: The drawing destination on the rendering target.\n :param area: The portion of the source texture or image to draw from.\n :param special_flags: have no effect at this moment.\n\n .. note:: Textures created by different Renderers cannot shared with each other!\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_15blit = {"blit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15blit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_14blit}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15blit(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_12blit, "Draw textures using a Surface-like API\n\n For compatibility purposes. Draws :class:`Texture` objects onto the\n Renderer using a method signature similar to :meth:`pygame.Surface.blit`.\n\n :param source: A :class:`Texture` or :class:`Image` to draw.\n :param dest: The drawing destination on the rendering target.\n :param area: The portion of the source texture or image to draw from.\n :param special_flags: have no effect at this moment.\n\n .. note:: Textures created by different Renderers cannot shared with each other!\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_13blit = {"blit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13blit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_12blit}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13blit(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17670,33 +17242,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_source)) != 0)) kw_args--; - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1001, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 980, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dest); if (value) { values[1] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1001, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 980, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_area); if (value) { values[2] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1001, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 980, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_special_flags); if (value) { values[3] = value; kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1001, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 980, __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, "blit") < 0)) __PYX_ERR(0, 1001, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "blit") < 0)) __PYX_ERR(0, 980, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -17715,22 +17287,22 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_dest = ((pgRectObject *)values[1]); __pyx_v_area = ((pgRectObject *)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, 1001, __pyx_L3_error) + __pyx_v_special_flags = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_special_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 980, __pyx_L3_error) } else { __pyx_v_special_flags = ((int)0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("blit", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 1001, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("blit", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 980, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.blit", __pyx_clineno, __pyx_lineno, __pyx_filename); __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, 1001, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_area), __pyx_ptype_6pygame_5_sdl2_5video_Rect, 1, "area", 0))) __PYX_ERR(0, 1001, __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); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_6pygame_5_sdl2_5video_Rect, 1, "dest", 0))) __PYX_ERR(0, 980, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_area), __pyx_ptype_6pygame_5_sdl2_5video_Rect, 1, "area", 0))) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_12blit(((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; @@ -17741,7 +17313,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds 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_12blit(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) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -17755,7 +17327,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_ob __pyx_t_2.dest = __pyx_v_dest; __pyx_t_2.area = __pyx_v_area; __pyx_t_2.special_flags = __pyx_v_special_flags; - __pyx_t_1 = __pyx_vtabptr_6pygame_5_sdl2_5video_Renderer->blit(__pyx_v_self, __pyx_v_source, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_1 = __pyx_vtabptr_6pygame_5_sdl2_5video_Renderer->blit(__pyx_v_self, __pyx_v_source, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -17772,7 +17344,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_ob return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1027 +/* "pygame/_sdl2/video.pyx":1006 * return dest * * def draw_line(self, p1, p2): # <<<<<<<<<<<<<< @@ -17781,16 +17353,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14blit(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_line(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15draw_line(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_16draw_line, "Draw a line\n\n :param p1: The line start point.\n :param p2: The line end point.\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_17draw_line = {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_16draw_line}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_line(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_14draw_line, "Draw a line\n\n :param p1: The line start point.\n :param p2: The line end point.\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_15draw_line = {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_14draw_line}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15draw_line(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -17826,19 +17398,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, 1027, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1006, __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, 1027, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1006, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_line", 1, 2, 2, 1); __PYX_ERR(0, 1027, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_line", 1, 2, 2, 1); __PYX_ERR(0, 1006, __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, 1027, __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, 1006, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -17851,20 +17423,20 @@ 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, 1027, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_line", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1006, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_14draw_line(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -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) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_14draw_line(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2) { int __pyx_v_res; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -17882,39 +17454,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":1035 + /* "pygame/_sdl2/video.pyx":1014 * 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, 1035, __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, 1014, __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, 1035, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __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, 1035, __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, 1014, __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, 1035, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1036 + /* "pygame/_sdl2/video.pyx":1015 * 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, 1036, __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, 1015, __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, 1036, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1015, __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, 1036, __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, 1015, __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, 1036, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1015, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1034 + /* "pygame/_sdl2/video.pyx":1013 * """ * cdef int res * res = SDL_RenderDrawLineF(self._renderer, # <<<<<<<<<<<<<< @@ -17923,7 +17495,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":1037 + /* "pygame/_sdl2/video.pyx":1016 * p1[0], p1[1], * p2[0], p2[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -17933,14 +17505,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":1038 + /* "pygame/_sdl2/video.pyx":1017 * 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, 1038, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -17958,15 +17530,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, 1038, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __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, 1038, __pyx_L1_error) + __PYX_ERR(0, 1017, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1037 + /* "pygame/_sdl2/video.pyx":1016 * p1[0], p1[1], * p2[0], p2[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -17975,7 +17547,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p */ } - /* "pygame/_sdl2/video.pyx":1027 + /* "pygame/_sdl2/video.pyx":1006 * return dest * * def draw_line(self, p1, p2): # <<<<<<<<<<<<<< @@ -17998,7 +17570,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1040 +/* "pygame/_sdl2/video.pyx":1019 * raise error() * * def draw_point(self, point): # <<<<<<<<<<<<<< @@ -18007,16 +17579,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_line(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_point(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_point(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_18draw_point, "Draw a point\n\n :param point: The point's coordinate.\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_19draw_point = {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_18draw_point}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_point(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_16draw_point, "Draw a point\n\n :param point: The point's coordinate.\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_17draw_point = {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_16draw_point}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_point(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18049,12 +17621,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, 1040, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1019, __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, 1040, __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, 1019, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18065,20 +17637,20 @@ 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, 1040, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_point", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1019, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_point); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_point(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_point); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -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) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_16draw_point(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_point) { int __pyx_v_res; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -18094,23 +17666,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":1048 + /* "pygame/_sdl2/video.pyx":1027 * 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, 1048, __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, 1027, __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, 1048, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1027, __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, 1048, __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, 1027, __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, 1048, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1047 + /* "pygame/_sdl2/video.pyx":1026 * # https://wiki.libsdl.org/SDL_RenderDrawPointF * cdef int res * res = SDL_RenderDrawPointF(self._renderer, # <<<<<<<<<<<<<< @@ -18119,7 +17691,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":1049 + /* "pygame/_sdl2/video.pyx":1028 * res = SDL_RenderDrawPointF(self._renderer, * point[0], point[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -18129,14 +17701,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":1050 + /* "pygame/_sdl2/video.pyx":1029 * 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, 1050, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -18154,15 +17726,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, 1050, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __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, 1050, __pyx_L1_error) + __PYX_ERR(0, 1029, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1049 + /* "pygame/_sdl2/video.pyx":1028 * res = SDL_RenderDrawPointF(self._renderer, * point[0], point[1]) * if res < 0: # <<<<<<<<<<<<<< @@ -18171,7 +17743,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ */ } - /* "pygame/_sdl2/video.pyx":1040 + /* "pygame/_sdl2/video.pyx":1019 * raise error() * * def draw_point(self, point): # <<<<<<<<<<<<<< @@ -18194,7 +17766,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1052 +/* "pygame/_sdl2/video.pyx":1031 * raise error() * * def draw_rect(self, rect): # <<<<<<<<<<<<<< @@ -18203,16 +17775,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_point(struct __ */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21draw_rect(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_20draw_rect, "Draw a rectangle outline\n\n :param rect: The :class:`Rect`-like rectangle to draw.\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_21draw_rect = {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_20draw_rect}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21draw_rect(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_18draw_rect, "Draw a rectangle outline\n\n :param rect: The :class:`Rect`-like rectangle to draw.\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_19draw_rect = {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_18draw_rect}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18245,12 +17817,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, 1052, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1031, __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, 1052, __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, 1031, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18261,20 +17833,20 @@ 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, 1052, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1031, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_rect); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_rect(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_rect); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -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) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_18draw_rect(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_FRect __pyx_v__frect; SDL_FRect *__pyx_v_frectptr; int __pyx_v_res; @@ -18290,7 +17862,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":1062 + /* "pygame/_sdl2/video.pyx":1041 * cdef int res * * frectptr = pgFRect_FromObject(rect, &_frect) # <<<<<<<<<<<<<< @@ -18299,7 +17871,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":1063 + /* "pygame/_sdl2/video.pyx":1042 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18309,20 +17881,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":1064 + /* "pygame/_sdl2/video.pyx":1043 * 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, 1064, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __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, 1064, __pyx_L1_error) + __PYX_ERR(0, 1043, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1063 + /* "pygame/_sdl2/video.pyx":1042 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18331,7 +17903,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1066 + /* "pygame/_sdl2/video.pyx":1045 * raise TypeError('expected a rectangle') * * res = SDL_RenderDrawRectF(self._renderer, frectptr) # <<<<<<<<<<<<<< @@ -18340,7 +17912,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":1068 + /* "pygame/_sdl2/video.pyx":1047 * res = SDL_RenderDrawRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18350,14 +17922,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":1069 + /* "pygame/_sdl2/video.pyx":1048 * * 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, 1069, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -18375,15 +17947,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, 1069, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __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, 1069, __pyx_L1_error) + __PYX_ERR(0, 1048, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1068 + /* "pygame/_sdl2/video.pyx":1047 * res = SDL_RenderDrawRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18392,7 +17964,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1052 + /* "pygame/_sdl2/video.pyx":1031 * raise error() * * def draw_rect(self, rect): # <<<<<<<<<<<<<< @@ -18415,7 +17987,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1071 +/* "pygame/_sdl2/video.pyx":1050 * raise error() * * def fill_rect(self, rect): # <<<<<<<<<<<<<< @@ -18424,16 +17996,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20draw_rect(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23fill_rect(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21fill_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_22fill_rect, "Draw a filled rectangle\n\n :param rect: The :class:`Rect`-like rectangle to draw.\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_23fill_rect = {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_22fill_rect}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23fill_rect(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_20fill_rect, "Draw a filled rectangle\n\n :param rect: The :class:`Rect`-like rectangle to draw.\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_21fill_rect = {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_20fill_rect}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21fill_rect(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18466,12 +18038,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, 1071, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1050, __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, 1071, __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, 1050, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18482,20 +18054,20 @@ 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, 1071, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1050, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.fill_rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_rect); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_20fill_rect(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_rect); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_rect) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_20fill_rect(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_rect) { SDL_FRect __pyx_v__frect; SDL_FRect *__pyx_v_frectptr; int __pyx_v_res; @@ -18511,7 +18083,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":1082 + /* "pygame/_sdl2/video.pyx":1061 * * * frectptr = pgFRect_FromObject(rect, &_frect) # <<<<<<<<<<<<<< @@ -18520,7 +18092,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":1083 + /* "pygame/_sdl2/video.pyx":1062 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18530,20 +18102,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":1084 + /* "pygame/_sdl2/video.pyx":1063 * 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, 1084, __pyx_L1_error) + __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_GOTREF(__pyx_t_2); __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 1084, __pyx_L1_error) + __PYX_ERR(0, 1063, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1083 + /* "pygame/_sdl2/video.pyx":1062 * * frectptr = pgFRect_FromObject(rect, &_frect) * if frectptr == NULL: # <<<<<<<<<<<<<< @@ -18552,7 +18124,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1086 + /* "pygame/_sdl2/video.pyx":1065 * raise TypeError('expected a rectangle') * * res = SDL_RenderFillRectF(self._renderer, frectptr) # <<<<<<<<<<<<<< @@ -18561,7 +18133,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":1088 + /* "pygame/_sdl2/video.pyx":1067 * res = SDL_RenderFillRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18571,14 +18143,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":1089 + /* "pygame/_sdl2/video.pyx":1068 * * 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, 1089, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -18596,15 +18168,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, 1089, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __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, 1089, __pyx_L1_error) + __PYX_ERR(0, 1068, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1088 + /* "pygame/_sdl2/video.pyx":1067 * res = SDL_RenderFillRectF(self._renderer, frectptr) * * if res < 0: # <<<<<<<<<<<<<< @@ -18613,7 +18185,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p */ } - /* "pygame/_sdl2/video.pyx":1071 + /* "pygame/_sdl2/video.pyx":1050 * raise error() * * def fill_rect(self, rect): # <<<<<<<<<<<<<< @@ -18636,7 +18208,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1091 +/* "pygame/_sdl2/video.pyx":1070 * raise error() * * def draw_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -18645,15 +18217,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22fill_rect(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25draw_triangle(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23draw_triangle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_25draw_triangle = {"draw_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25draw_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25draw_triangle(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_23draw_triangle = {"draw_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23draw_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23draw_triangle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18692,26 +18264,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, 1091, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __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, 1091, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1091, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1070, __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, 1091, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1070, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1091, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1070, __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, 1091, __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, 1070, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -18726,20 +18298,20 @@ 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, 1091, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_triangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1070, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_triangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_22draw_triangle(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_22draw_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3) { _pgsdlFPoint __pyx_v_fpoints[4]; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_pos = NULL; @@ -18759,7 +18331,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":1095 + /* "pygame/_sdl2/video.pyx":1074 * cdef SDL_FPoint fpoints[4] * * for i, pos in enumerate((p1, p2, p3, p1)): # <<<<<<<<<<<<<< @@ -18768,7 +18340,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, 1095, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -18787,50 +18359,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, 1095, __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, 1074, __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, 1095, __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, 1074, __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, 1095, __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, 1074, __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":1096 + /* "pygame/_sdl2/video.pyx":1075 * * 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, 1096, __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, 1075, __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, 1075, __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, 1075, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).x = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1097 + /* "pygame/_sdl2/video.pyx":1076 * 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, 1097, __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, 1076, __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, 1097, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1076, __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, 1097, __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, 1076, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).y = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1095 + /* "pygame/_sdl2/video.pyx":1074 * cdef SDL_FPoint fpoints[4] * * for i, pos in enumerate((p1, p2, p3, p1)): # <<<<<<<<<<<<<< @@ -18841,7 +18413,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":1099 + /* "pygame/_sdl2/video.pyx":1078 * fpoints[i].y = pos[1] * * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 4) # <<<<<<<<<<<<<< @@ -18850,7 +18422,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":1101 + /* "pygame/_sdl2/video.pyx":1080 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 4) * * if res < 0: # <<<<<<<<<<<<<< @@ -18860,14 +18432,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":1102 + /* "pygame/_sdl2/video.pyx":1081 * * 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, 1102, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -18885,15 +18457,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, 1102, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __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, 1102, __pyx_L1_error) + __PYX_ERR(0, 1081, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1101 + /* "pygame/_sdl2/video.pyx":1080 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 4) * * if res < 0: # <<<<<<<<<<<<<< @@ -18902,7 +18474,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1091 + /* "pygame/_sdl2/video.pyx":1070 * raise error() * * def draw_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -18927,7 +18499,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1104 +/* "pygame/_sdl2/video.pyx":1083 * raise error() * * def fill_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -18936,15 +18508,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24draw_triangle(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27fill_triangle(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25fill_triangle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_27fill_triangle = {"fill_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27fill_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27fill_triangle(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_25fill_triangle = {"fill_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25fill_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25fill_triangle(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18983,26 +18555,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, 1104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1083, __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, 1104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 1); __PYX_ERR(0, 1083, __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, 1104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, 2); __PYX_ERR(0, 1083, __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, 1104, __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, 1083, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -19017,20 +18589,20 @@ 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, 1104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_triangle", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1083, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.fill_triangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_24fill_triangle(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_24fill_triangle(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3) { Uint8 __pyx_v_rgba[4]; int __pyx_v_res; _pgsdlVertex __pyx_v_vertices[3]; @@ -19051,7 +18623,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":1106 + /* "pygame/_sdl2/video.pyx":1085 * def fill_triangle(self, p1, p2, p3): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19061,14 +18633,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":1107 + /* "pygame/_sdl2/video.pyx":1086 * # 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, 1107, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1086, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19086,15 +18658,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, 1107, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __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, 1107, __pyx_L1_error) + __PYX_ERR(0, 1086, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1106 + /* "pygame/_sdl2/video.pyx":1085 * def fill_triangle(self, p1, p2, p3): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19103,7 +18675,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1111 + /* "pygame/_sdl2/video.pyx":1090 * cdef Uint8[4] rgba * * cdef int res = SDL_GetRenderDrawColor(self._renderer, # <<<<<<<<<<<<<< @@ -19112,7 +18684,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":1117 + /* "pygame/_sdl2/video.pyx":1096 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19122,14 +18694,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":1118 + /* "pygame/_sdl2/video.pyx":1097 * * 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, 1118, __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_4 = NULL; __pyx_t_5 = 0; @@ -19147,15 +18719,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, 1118, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1097, __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, 1118, __pyx_L1_error) + __PYX_ERR(0, 1097, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1117 + /* "pygame/_sdl2/video.pyx":1096 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19164,7 +18736,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1121 + /* "pygame/_sdl2/video.pyx":1100 * * cdef SDL_Vertex vertices[3] * for i, pos in enumerate((p1, p2, p3)): # <<<<<<<<<<<<<< @@ -19173,7 +18745,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, 1121, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -19189,90 +18761,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, 1121, __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, 1100, __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, 1121, __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, 1100, __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, 1121, __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, 1100, __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":1122 + /* "pygame/_sdl2/video.pyx":1101 * 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, 1122, __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, 1101, __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, 1101, __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, 1101, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.x = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1123 + /* "pygame/_sdl2/video.pyx":1102 * 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, 1123, __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, 1102, __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, 1123, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1102, __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, 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, 1102, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.y = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1124 + /* "pygame/_sdl2/video.pyx":1103 * 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, 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, 1103, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.r = (__pyx_v_rgba[0]); - /* "pygame/_sdl2/video.pyx":1125 + /* "pygame/_sdl2/video.pyx":1104 * 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, 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, 1104, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.g = (__pyx_v_rgba[1]); - /* "pygame/_sdl2/video.pyx":1126 + /* "pygame/_sdl2/video.pyx":1105 * 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, 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, 1105, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.b = (__pyx_v_rgba[2]); - /* "pygame/_sdl2/video.pyx":1127 + /* "pygame/_sdl2/video.pyx":1106 * 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, 1127, __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, 1106, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.a = (__pyx_v_rgba[3]); - /* "pygame/_sdl2/video.pyx":1121 + /* "pygame/_sdl2/video.pyx":1100 * * cdef SDL_Vertex vertices[3] * for i, pos in enumerate((p1, p2, p3)): # <<<<<<<<<<<<<< @@ -19283,7 +18855,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":1129 + /* "pygame/_sdl2/video.pyx":1108 * vertices[i].color.a = rgba[3] * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) # <<<<<<<<<<<<<< @@ -19292,7 +18864,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":1130 + /* "pygame/_sdl2/video.pyx":1109 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -19302,14 +18874,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":1131 + /* "pygame/_sdl2/video.pyx":1110 * 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, 1131, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -19327,15 +18899,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, 1131, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __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, 1131, __pyx_L1_error) + __PYX_ERR(0, 1110, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1130 + /* "pygame/_sdl2/video.pyx":1109 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 3, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -19344,7 +18916,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ } - /* "pygame/_sdl2/video.pyx":1104 + /* "pygame/_sdl2/video.pyx":1083 * raise error() * * def fill_triangle(self, p1, p2, p3): # <<<<<<<<<<<<<< @@ -19369,7 +18941,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1133 +/* "pygame/_sdl2/video.pyx":1112 * raise error() * * def draw_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -19378,15 +18950,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26fill_triangle(struct */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29draw_quad(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27draw_quad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_29draw_quad = {"draw_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29draw_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29draw_quad(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_27draw_quad = {"draw_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27draw_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27draw_quad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19428,33 +19000,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, 1133, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1112, __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, 1133, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 1); __PYX_ERR(0, 1133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 1); __PYX_ERR(0, 1112, __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, 1133, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 2); __PYX_ERR(0, 1133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 2); __PYX_ERR(0, 1112, __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, 1133, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1112, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 3); __PYX_ERR(0, 1133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, 3); __PYX_ERR(0, 1112, __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, 1133, __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, 1112, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; @@ -19471,20 +19043,20 @@ 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, 1133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("draw_quad", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1112, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.draw_quad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3, __pyx_v_p4); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_26draw_quad(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3, __pyx_v_p4); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_26draw_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4) { _pgsdlFPoint __pyx_v_fpoints[5]; PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_pos = NULL; @@ -19504,7 +19076,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":1136 + /* "pygame/_sdl2/video.pyx":1115 * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[5] * for i, pos in enumerate((p1, p2, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -19513,7 +19085,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, 1136, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -19535,50 +19107,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, 1136, __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, 1115, __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, 1136, __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, 1115, __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, 1136, __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, 1115, __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":1137 + /* "pygame/_sdl2/video.pyx":1116 * 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, 1137, __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, 1116, __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, 1116, __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, 1116, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).x = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1138 + /* "pygame/_sdl2/video.pyx":1117 * 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, 1138, __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, 1117, __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, 1138, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1117, __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, 1138, __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, 1117, __pyx_L1_error) (__pyx_v_fpoints[__pyx_t_6]).y = __pyx_t_5; - /* "pygame/_sdl2/video.pyx":1136 + /* "pygame/_sdl2/video.pyx":1115 * # https://wiki.libsdl.org/SDL_RenderDrawLinesF * cdef SDL_FPoint fpoints[5] * for i, pos in enumerate((p1, p2, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -19589,7 +19161,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":1140 + /* "pygame/_sdl2/video.pyx":1119 * fpoints[i].y = pos[1] * * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 5) # <<<<<<<<<<<<<< @@ -19598,7 +19170,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":1142 + /* "pygame/_sdl2/video.pyx":1121 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 5) * * if res < 0: # <<<<<<<<<<<<<< @@ -19608,14 +19180,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":1143 + /* "pygame/_sdl2/video.pyx":1122 * * 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, 1143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -19633,15 +19205,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, 1143, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __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, 1143, __pyx_L1_error) + __PYX_ERR(0, 1122, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1142 + /* "pygame/_sdl2/video.pyx":1121 * res = SDL_RenderDrawLinesF(self._renderer, fpoints, 5) * * if res < 0: # <<<<<<<<<<<<<< @@ -19650,7 +19222,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1133 + /* "pygame/_sdl2/video.pyx":1112 * raise error() * * def draw_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -19675,7 +19247,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1145 +/* "pygame/_sdl2/video.pyx":1124 * raise error() * * def fill_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -19684,15 +19256,15 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28draw_quad(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31fill_quad(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29fill_quad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_31fill_quad = {"fill_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31fill_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31fill_quad(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_29fill_quad = {"fill_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29fill_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29fill_quad(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19734,33 +19306,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, 1145, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1124, __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, 1145, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 1); __PYX_ERR(0, 1145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 1); __PYX_ERR(0, 1124, __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, 1145, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 2); __PYX_ERR(0, 1145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 2); __PYX_ERR(0, 1124, __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, 1145, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 3); __PYX_ERR(0, 1145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, 3); __PYX_ERR(0, 1124, __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, 1145, __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, 1124, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 4)) { goto __pyx_L5_argtuple_error; @@ -19777,20 +19349,20 @@ 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, 1145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fill_quad", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 1124, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.fill_quad", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3, __pyx_v_p4); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_28fill_quad(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_p1, __pyx_v_p2, __pyx_v_p3, __pyx_v_p4); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_28fill_quad(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3, PyObject *__pyx_v_p4) { Uint8 __pyx_v_rgba[4]; int __pyx_v_res; _pgsdlVertex __pyx_v_vertices[6]; @@ -19811,7 +19383,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":1147 + /* "pygame/_sdl2/video.pyx":1126 * def fill_quad(self, p1, p2, p3, p4): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19821,14 +19393,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":1148 + /* "pygame/_sdl2/video.pyx":1127 * # 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, 1148, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19846,15 +19418,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, 1148, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1127, __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, 1148, __pyx_L1_error) + __PYX_ERR(0, 1127, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1147 + /* "pygame/_sdl2/video.pyx":1126 * def fill_quad(self, p1, p2, p3, p4): * # https://wiki.libsdl.org/SDL_RenderGeometry * if not SDL_VERSION_ATLEAST(2, 0, 18): # <<<<<<<<<<<<<< @@ -19863,7 +19435,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1152 + /* "pygame/_sdl2/video.pyx":1131 * cdef Uint8[4] rgba * * cdef int res = SDL_GetRenderDrawColor(self._renderer, # <<<<<<<<<<<<<< @@ -19872,7 +19444,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":1158 + /* "pygame/_sdl2/video.pyx":1137 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19882,14 +19454,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":1159 + /* "pygame/_sdl2/video.pyx":1138 * * 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, 1159, __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_4 = NULL; __pyx_t_5 = 0; @@ -19907,15 +19479,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, 1159, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1138, __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, 1159, __pyx_L1_error) + __PYX_ERR(0, 1138, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1158 + /* "pygame/_sdl2/video.pyx":1137 * &(rgba[3])) * * if res < 0: # <<<<<<<<<<<<<< @@ -19924,7 +19496,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1162 + /* "pygame/_sdl2/video.pyx":1141 * * cdef SDL_Vertex vertices[6] * for i, pos in enumerate((p1, p2, p3, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -19933,7 +19505,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, 1162, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p1); __Pyx_GIVEREF(__pyx_v_p1); @@ -19958,90 +19530,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, 1162, __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, 1141, __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, 1162, __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, 1141, __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, 1162, __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, 1141, __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":1163 + /* "pygame/_sdl2/video.pyx":1142 * 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, 1163, __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, 1142, __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, 1142, __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, 1142, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.x = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1164 + /* "pygame/_sdl2/video.pyx":1143 * 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, 1164, __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, 1143, __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, 1164, __pyx_L1_error) + __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 1143, __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, 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, 1143, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).position.y = __pyx_t_7; - /* "pygame/_sdl2/video.pyx":1165 + /* "pygame/_sdl2/video.pyx":1144 * 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, 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, 1144, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.r = (__pyx_v_rgba[0]); - /* "pygame/_sdl2/video.pyx":1166 + /* "pygame/_sdl2/video.pyx":1145 * 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, 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, 1145, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.g = (__pyx_v_rgba[1]); - /* "pygame/_sdl2/video.pyx":1167 + /* "pygame/_sdl2/video.pyx":1146 * 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, 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, 1146, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.b = (__pyx_v_rgba[2]); - /* "pygame/_sdl2/video.pyx":1168 + /* "pygame/_sdl2/video.pyx":1147 * 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, 1168, __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, 1147, __pyx_L1_error) (__pyx_v_vertices[__pyx_t_8]).color.a = (__pyx_v_rgba[3]); - /* "pygame/_sdl2/video.pyx":1162 + /* "pygame/_sdl2/video.pyx":1141 * * cdef SDL_Vertex vertices[6] * for i, pos in enumerate((p1, p2, p3, p3, p4, p1)): # <<<<<<<<<<<<<< @@ -20052,7 +19624,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":1170 + /* "pygame/_sdl2/video.pyx":1149 * vertices[i].color.a = rgba[3] * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) # <<<<<<<<<<<<<< @@ -20061,7 +19633,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":1171 + /* "pygame/_sdl2/video.pyx":1150 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -20071,14 +19643,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":1172 + /* "pygame/_sdl2/video.pyx":1151 * 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, 1172, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -20096,15 +19668,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, 1172, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __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, 1172, __pyx_L1_error) + __PYX_ERR(0, 1151, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1171 + /* "pygame/_sdl2/video.pyx":1150 * * res = SDL_RenderGeometry(self._renderer, NULL, vertices, 6, NULL, 0) * if res < 0: # <<<<<<<<<<<<<< @@ -20113,7 +19685,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ } - /* "pygame/_sdl2/video.pyx":1145 + /* "pygame/_sdl2/video.pyx":1124 * raise error() * * def fill_quad(self, p1, p2, p3, p4): # <<<<<<<<<<<<<< @@ -20138,7 +19710,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1174 +/* "pygame/_sdl2/video.pyx":1153 * raise error() * * def to_surface(self, surface=None, area=None): # <<<<<<<<<<<<<< @@ -20147,16 +19719,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30fill_quad(struct __p */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33to_surface(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31to_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_32to_surface, "Read pixels from current rendering target and create a Surface (slow operation, use sparingly)\n\n Read pixel data from the current rendering target and return a\n :class:`pygame.Surface` containing it.\n\n :param Surface surface: A :class:`pygame.Surface` object to read the pixel\n data into. It must be large enough to fit the area, otherwise\n ``ValueError`` is raised.\n If set to ``None``, a new surface will be created.\n :param area: The area of the screen to read pixels from. The area is\n clipped to fit inside the viewport.\n If ``None``, the entire viewport is used.\n\n .. note::\n This is a very slow operation, due to the overhead of the VRAM to RAM\n data transfer and the cost of creating a potentially large\n :class:`pygame.Surface`. It should not be used frequently.\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_33to_surface = {"to_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33to_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_32to_surface}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33to_surface(PyObject *__pyx_v_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_30to_surface, "Read pixels from current rendering target and create a Surface (slow operation, use sparingly)\n\n Read pixel data from the current rendering target and return a\n :class:`pygame.Surface` containing it.\n\n :param Surface surface: A :class:`pygame.Surface` object to read the pixel\n data into. It must be large enough to fit the area, otherwise\n ``ValueError`` is raised.\n If set to ``None``, a new surface will be created.\n :param area: The area of the screen to read pixels from. The area is\n clipped to fit inside the viewport.\n If ``None``, the entire viewport is used.\n\n .. note::\n This is a very slow operation, due to the overhead of the VRAM to RAM\n data transfer and the cost of creating a potentially large\n :class:`pygame.Surface`. It should not be used frequently.\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_31to_surface = {"to_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31to_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_30to_surface}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31to_surface(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20196,19 +19768,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, 1174, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1153, __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, 1174, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1153, __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, 1174, __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, 1153, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -20225,20 +19797,20 @@ 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, 1174, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("to_surface", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 1153, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.to_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_surface, __pyx_v_area); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_30to_surface(((struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *)__pyx_v_self), __pyx_v_surface, __pyx_v_area); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_surface, PyObject *__pyx_v_area) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_30to_surface(struct __pyx_obj_6pygame_5_sdl2_5video_Renderer *__pyx_v_self, PyObject *__pyx_v_surface, PyObject *__pyx_v_area) { Uint32 __pyx_v_format; SDL_Rect __pyx_v_rarea; SDL_Rect __pyx_v_tempviewport; @@ -20261,7 +19833,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":1202 + /* "pygame/_sdl2/video.pyx":1181 * * # obtain area to use * if area is not None: # <<<<<<<<<<<<<< @@ -20271,7 +19843,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":1204 + /* "pygame/_sdl2/video.pyx":1183 * if area is not None: * * rectptr = pgRect_FromObject(area, &rarea) # <<<<<<<<<<<<<< @@ -20280,7 +19852,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":1205 + /* "pygame/_sdl2/video.pyx":1184 * * rectptr = pgRect_FromObject(area, &rarea) * if rectptr == NULL: # <<<<<<<<<<<<<< @@ -20290,20 +19862,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":1206 + /* "pygame/_sdl2/video.pyx":1185 * 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, 1206, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __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, 1206, __pyx_L1_error) + __PYX_ERR(0, 1185, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1205 + /* "pygame/_sdl2/video.pyx":1184 * * rectptr = pgRect_FromObject(area, &rarea) * if rectptr == NULL: # <<<<<<<<<<<<<< @@ -20312,7 +19884,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1209 + /* "pygame/_sdl2/video.pyx":1188 * * # clip area * SDL_RenderGetViewport(self._renderer, &tempviewport) # <<<<<<<<<<<<<< @@ -20321,7 +19893,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":1210 + /* "pygame/_sdl2/video.pyx":1189 * # clip area * SDL_RenderGetViewport(self._renderer, &tempviewport) * SDL_IntersectRect(rectptr, &tempviewport, rectptr) # <<<<<<<<<<<<<< @@ -20330,7 +19902,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":1212 + /* "pygame/_sdl2/video.pyx":1191 * SDL_IntersectRect(rectptr, &tempviewport, rectptr) * * areaparam = rectptr # <<<<<<<<<<<<<< @@ -20339,7 +19911,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ __pyx_v_areaparam = __pyx_v_rectptr; - /* "pygame/_sdl2/video.pyx":1213 + /* "pygame/_sdl2/video.pyx":1192 * * areaparam = rectptr * rarea.x = rectptr.x # <<<<<<<<<<<<<< @@ -20349,7 +19921,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":1214 + /* "pygame/_sdl2/video.pyx":1193 * areaparam = rectptr * rarea.x = rectptr.x * rarea.y = rectptr.y # <<<<<<<<<<<<<< @@ -20359,7 +19931,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":1215 + /* "pygame/_sdl2/video.pyx":1194 * rarea.x = rectptr.x * rarea.y = rectptr.y * rarea.w = rectptr.w # <<<<<<<<<<<<<< @@ -20369,7 +19941,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":1216 + /* "pygame/_sdl2/video.pyx":1195 * rarea.y = rectptr.y * rarea.w = rectptr.w * rarea.h = rectptr.h # <<<<<<<<<<<<<< @@ -20379,7 +19951,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":1202 + /* "pygame/_sdl2/video.pyx":1181 * * # obtain area to use * if area is not None: # <<<<<<<<<<<<<< @@ -20389,7 +19961,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ goto __pyx_L3; } - /* "pygame/_sdl2/video.pyx":1218 + /* "pygame/_sdl2/video.pyx":1197 * rarea.h = rectptr.h * else: * SDL_RenderGetViewport(self._renderer, &rarea) # <<<<<<<<<<<<<< @@ -20399,7 +19971,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":1219 + /* "pygame/_sdl2/video.pyx":1198 * else: * SDL_RenderGetViewport(self._renderer, &rarea) * areaparam = NULL # <<<<<<<<<<<<<< @@ -20410,7 +19982,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ } __pyx_L3:; - /* "pygame/_sdl2/video.pyx":1222 + /* "pygame/_sdl2/video.pyx":1201 * * # prepare surface * if surface is None: # <<<<<<<<<<<<<< @@ -20420,7 +19992,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":1224 + /* "pygame/_sdl2/video.pyx":1203 * if surface is None: * # create a new surface * format = SDL_GetWindowPixelFormat(self._win._win) # <<<<<<<<<<<<<< @@ -20429,7 +20001,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":1225 + /* "pygame/_sdl2/video.pyx":1204 * # create a new surface * format = SDL_GetWindowPixelFormat(self._win._win) * if format == SDL_PIXELFORMAT_UNKNOWN: # <<<<<<<<<<<<<< @@ -20439,14 +20011,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":1226 + /* "pygame/_sdl2/video.pyx":1205 * 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, 1226, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_3 = 0; @@ -20464,15 +20036,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, 1226, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1205, __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, 1226, __pyx_L1_error) + __PYX_ERR(0, 1205, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1225 + /* "pygame/_sdl2/video.pyx":1204 * # create a new surface * format = SDL_GetWindowPixelFormat(self._win._win) * if format == SDL_PIXELFORMAT_UNKNOWN: # <<<<<<<<<<<<<< @@ -20481,7 +20053,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1228 + /* "pygame/_sdl2/video.pyx":1207 * raise error() * * surf = SDL_CreateRGBSurfaceWithFormat( # <<<<<<<<<<<<<< @@ -20490,7 +20062,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":1233 + /* "pygame/_sdl2/video.pyx":1212 * SDL_BITSPERPIXEL(format), * format) * if surf == NULL: # <<<<<<<<<<<<<< @@ -20500,20 +20072,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":1234 + /* "pygame/_sdl2/video.pyx":1213 * 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, 1234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1213, __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, 1234, __pyx_L1_error) + __PYX_ERR(0, 1213, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1233 + /* "pygame/_sdl2/video.pyx":1212 * SDL_BITSPERPIXEL(format), * format) * if surf == NULL: # <<<<<<<<<<<<<< @@ -20522,7 +20094,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1236 + /* "pygame/_sdl2/video.pyx":1215 * raise MemoryError("not enough memory for the surface") * * surface = pgSurface_New2(surf, 1) # <<<<<<<<<<<<<< @@ -20535,7 +20107,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":1241 + /* "pygame/_sdl2/video.pyx":1220 * # we need to decrement that reference cython has added on top * # see https://github.com/cython/cython/issues/2589#issuecomment-417604249 for additional context * Py_DECREF(surface) # <<<<<<<<<<<<<< @@ -20544,7 +20116,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ Py_DECREF(__pyx_v_surface); - /* "pygame/_sdl2/video.pyx":1222 + /* "pygame/_sdl2/video.pyx":1201 * * # prepare surface * if surface is None: # <<<<<<<<<<<<<< @@ -20554,7 +20126,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":1221 * # see https://github.com/cython/cython/issues/2589#issuecomment-417604249 for additional context * Py_DECREF(surface) * elif pgSurface_Check(surface): # <<<<<<<<<<<<<< @@ -20564,7 +20136,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":1243 + /* "pygame/_sdl2/video.pyx":1222 * Py_DECREF(surface) * elif pgSurface_Check(surface): * surf = pgSurface_AsSurface(surface) # <<<<<<<<<<<<<< @@ -20573,7 +20145,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":1244 + /* "pygame/_sdl2/video.pyx":1223 * elif pgSurface_Check(surface): * surf = pgSurface_AsSurface(surface) * if surf.w < rarea.w or surf.h < rarea.h: # <<<<<<<<<<<<<< @@ -20591,20 +20163,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":1245 + /* "pygame/_sdl2/video.pyx":1224 * 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, 1245, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __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, 1245, __pyx_L1_error) + __PYX_ERR(0, 1224, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1244 + /* "pygame/_sdl2/video.pyx":1223 * elif pgSurface_Check(surface): * surf = pgSurface_AsSurface(surface) * if surf.w < rarea.w or surf.h < rarea.h: # <<<<<<<<<<<<<< @@ -20613,7 +20185,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1246 + /* "pygame/_sdl2/video.pyx":1225 * if surf.w < rarea.w or surf.h < rarea.h: * raise ValueError("the surface is too small") * format = surf.format.format # <<<<<<<<<<<<<< @@ -20623,7 +20195,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":1242 + /* "pygame/_sdl2/video.pyx":1221 * # see https://github.com/cython/cython/issues/2589#issuecomment-417604249 for additional context * Py_DECREF(surface) * elif pgSurface_Check(surface): # <<<<<<<<<<<<<< @@ -20633,7 +20205,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ goto __pyx_L5; } - /* "pygame/_sdl2/video.pyx":1248 + /* "pygame/_sdl2/video.pyx":1227 * format = surf.format.format * else: * raise TypeError("'surface' must be a surface or None") # <<<<<<<<<<<<<< @@ -20641,15 +20213,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, 1248, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __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, 1248, __pyx_L1_error) + __PYX_ERR(0, 1227, __pyx_L1_error) } __pyx_L5:; - /* "pygame/_sdl2/video.pyx":1252 + /* "pygame/_sdl2/video.pyx":1231 * if SDL_RenderReadPixels(self._renderer, * areaparam, * format, surf.pixels, surf.pitch) < 0: # <<<<<<<<<<<<<< @@ -20658,7 +20230,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":1250 + /* "pygame/_sdl2/video.pyx":1229 * raise TypeError("'surface' must be a surface or None") * * if SDL_RenderReadPixels(self._renderer, # <<<<<<<<<<<<<< @@ -20667,14 +20239,14 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ if (unlikely(__pyx_t_1)) { - /* "pygame/_sdl2/video.pyx":1253 + /* "pygame/_sdl2/video.pyx":1232 * 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, 1253, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_3 = 0; @@ -20692,15 +20264,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, 1253, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __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, 1253, __pyx_L1_error) + __PYX_ERR(0, 1232, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1250 + /* "pygame/_sdl2/video.pyx":1229 * raise TypeError("'surface' must be a surface or None") * * if SDL_RenderReadPixels(self._renderer, # <<<<<<<<<<<<<< @@ -20709,7 +20281,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ } - /* "pygame/_sdl2/video.pyx":1254 + /* "pygame/_sdl2/video.pyx":1233 * format, surf.pixels, surf.pitch) < 0: * raise error() * return surface # <<<<<<<<<<<<<< @@ -20721,7 +20293,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":1174 + /* "pygame/_sdl2/video.pyx":1153 * raise error() * * def to_surface(self, surface=None, area=None): # <<<<<<<<<<<<<< @@ -20743,7 +20315,7 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ return __pyx_r; } -/* "pygame/_sdl2/video.pyx":1256 +/* "pygame/_sdl2/video.pyx":1235 * return surface * * @staticmethod # <<<<<<<<<<<<<< @@ -20752,16 +20324,16 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32to_surface(struct __ */ /* Python wrapper */ -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_35compose_custom_blend_mode(CYTHON_UNUSED PyObject *__pyx_self, +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33compose_custom_blend_mode(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend_mode, "Compose a custom blend mode\n\n Compose a custom blend mode.\n See https://wiki.libsdl.org/SDL2/SDL_ComposeCustomBlendMode for more information.\n\n :param color_mode: A tuple ``(srcColorFactor, dstColorFactor, colorOperation)``\n :param alpha_mode: A tuple ``(srcAlphaFactor, dstAlphaFactor, alphaOperation)``\n\n :return: A blend mode to be used with :meth:`Renderer.set_draw_blend_mode` and :meth:`Texture.set_blend_mode`.\n "); -static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_35compose_custom_blend_mode = {"compose_custom_blend_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_35compose_custom_blend_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend_mode}; -static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_35compose_custom_blend_mode(CYTHON_UNUSED PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_6pygame_5_sdl2_5video_8Renderer_32compose_custom_blend_mode, "Compose a custom blend mode\n\n Compose a custom blend mode.\n See https://wiki.libsdl.org/SDL2/SDL_ComposeCustomBlendMode for more information.\n\n :param color_mode: A tuple ``(srcColorFactor, dstColorFactor, colorOperation)``\n :param alpha_mode: A tuple ``(srcAlphaFactor, dstAlphaFactor, alphaOperation)``\n\n :return: A blend mode to be used with :meth:`Renderer.set_draw_blend_mode` and :meth:`Texture.set_blend_mode`.\n "); +static PyMethodDef __pyx_mdef_6pygame_5_sdl2_5video_8Renderer_33compose_custom_blend_mode = {"compose_custom_blend_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33compose_custom_blend_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_32compose_custom_blend_mode}; +static PyObject *__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33compose_custom_blend_mode(CYTHON_UNUSED PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -20797,19 +20369,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, 1256, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1235, __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, 1256, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1235, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("compose_custom_blend_mode", 1, 2, 2, 1); __PYX_ERR(0, 1256, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compose_custom_blend_mode", 1, 2, 2, 1); __PYX_ERR(0, 1235, __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, 1256, __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, 1235, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20822,20 +20394,20 @@ 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, 1256, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("compose_custom_blend_mode", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1235, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pygame._sdl2.video.Renderer.compose_custom_blend_mode", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend_mode(__pyx_v_color_mode, __pyx_v_alpha_mode); + __pyx_r = __pyx_pf_6pygame_5_sdl2_5video_8Renderer_32compose_custom_blend_mode(__pyx_v_color_mode, __pyx_v_alpha_mode); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend_mode(PyObject *__pyx_v_color_mode, PyObject *__pyx_v_alpha_mode) { +static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_32compose_custom_blend_mode(PyObject *__pyx_v_color_mode, PyObject *__pyx_v_alpha_mode) { int __pyx_v_res; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -20855,79 +20427,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":1269 + /* "pygame/_sdl2/video.pyx":1248 * """ * # 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, 1269, __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, 1248, __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, 1269, __pyx_L1_error) + __pyx_t_2 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1270 + /* "pygame/_sdl2/video.pyx":1249 * # 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, 1270, __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, 1249, __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, 1270, __pyx_L1_error) + __pyx_t_3 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1249, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1271 + /* "pygame/_sdl2/video.pyx":1250 * 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, 1271, __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, 1250, __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, 1271, __pyx_L1_error) + __pyx_t_4 = ((SDL_BlendOperation)__Pyx_PyInt_As_SDL_BlendOperation(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1272 + /* "pygame/_sdl2/video.pyx":1251 * 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, 1272, __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, 1251, __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, 1272, __pyx_L1_error) + __pyx_t_5 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1273 + /* "pygame/_sdl2/video.pyx":1252 * 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, 1273, __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, 1252, __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, 1273, __pyx_L1_error) + __pyx_t_6 = ((SDL_BlendFactor)__Pyx_PyInt_As_SDL_BlendFactor(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1274 + /* "pygame/_sdl2/video.pyx":1253 * 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, 1274, __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, 1253, __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, 1274, __pyx_L1_error) + __pyx_t_7 = ((SDL_BlendOperation)__Pyx_PyInt_As_SDL_BlendOperation(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "pygame/_sdl2/video.pyx":1269 + /* "pygame/_sdl2/video.pyx":1248 * """ * # https://wiki.libsdl.org/SDL_ComposeCustomBlendMode * cdef int res = SDL_ComposeCustomBlendMode(color_mode[0], # <<<<<<<<<<<<<< @@ -20936,7 +20508,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":1275 + /* "pygame/_sdl2/video.pyx":1254 * alpha_mode[1], * alpha_mode[2]) * if res < 0: # <<<<<<<<<<<<<< @@ -20946,13 +20518,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":1276 + /* "pygame/_sdl2/video.pyx":1255 * 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, 1276, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; @@ -20970,15 +20542,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, 1276, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __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, 1276, __pyx_L1_error) + __PYX_ERR(0, 1255, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1275 + /* "pygame/_sdl2/video.pyx":1254 * alpha_mode[1], * alpha_mode[2]) * if res < 0: # <<<<<<<<<<<<<< @@ -20987,19 +20559,19 @@ static PyObject *__pyx_pf_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend */ } - /* "pygame/_sdl2/video.pyx":1277 + /* "pygame/_sdl2/video.pyx":1256 * 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, 1277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_res); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "pygame/_sdl2/video.pyx":1256 + /* "pygame/_sdl2/video.pyx":1235 * return surface * * @staticmethod # <<<<<<<<<<<<<< @@ -21056,7 +20628,7 @@ static void __pyx_tp_dealloc_6pygame_5_sdl2_5video_Renderer(PyObject *o) { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1); - __pyx_pw_6pygame_5_sdl2_5video_8Renderer_5__dealloc__(o); + __pyx_pw_6pygame_5_sdl2_5video_8Renderer_3__dealloc__(o); __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1); PyErr_Restore(etype, eval, etb); } @@ -21160,20 +20732,19 @@ static int __pyx_setprop_6pygame_5_sdl2_5video_8Renderer_target(PyObject *o, PyO } static PyMethodDef __pyx_methods_6pygame_5_sdl2_5video_Renderer[] = { - {"from_window", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_1from_window, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_6clear}, - {"present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_9present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_8present}, - {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_13set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_12set_viewport}, - {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_16draw_line}, - {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_18draw_point}, - {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_20draw_rect}, - {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_22fill_rect}, - {"draw_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25draw_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"fill_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27fill_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"draw_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29draw_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"fill_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31fill_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"to_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33to_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_32to_surface}, - {"compose_custom_blend_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_35compose_custom_blend_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_34compose_custom_blend_mode}, + {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_5clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_4clear}, + {"present", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_7present, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_6present}, + {"set_viewport", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_11set_viewport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_10set_viewport}, + {"draw_line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_15draw_line, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_14draw_line}, + {"draw_point", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_17draw_point, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_16draw_point}, + {"draw_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_19draw_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_18draw_rect}, + {"fill_rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_21fill_rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_20fill_rect}, + {"draw_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_23draw_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"fill_triangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_25fill_triangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"draw_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_27draw_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"fill_quad", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_29fill_quad, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"to_surface", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_31to_surface, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_30to_surface}, + {"compose_custom_blend_mode", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_33compose_custom_blend_mode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_6pygame_5_sdl2_5video_8Renderer_32compose_custom_blend_mode}, {0, 0, 0, 0} }; @@ -21192,7 +20763,7 @@ static PyType_Slot __pyx_type_6pygame_5_sdl2_5video_Renderer_slots[] = { {Py_tp_clear, (void *)__pyx_tp_clear_6pygame_5_sdl2_5video_Renderer}, {Py_tp_methods, (void *)__pyx_methods_6pygame_5_sdl2_5video_Renderer}, {Py_tp_getset, (void *)__pyx_getsets_6pygame_5_sdl2_5video_Renderer}, - {Py_tp_init, (void *)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_3__init__}, + {Py_tp_init, (void *)__pyx_pw_6pygame_5_sdl2_5video_8Renderer_1__init__}, {Py_tp_new, (void *)__pyx_tp_new_6pygame_5_sdl2_5video_Renderer}, {0, 0}, }; @@ -21253,7 +20824,7 @@ static PyTypeObject __pyx_type_6pygame_5_sdl2_5video_Renderer = { #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif - __pyx_pw_6pygame_5_sdl2_5video_8Renderer_3__init__, /*tp_init*/ + __pyx_pw_6pygame_5_sdl2_5video_8Renderer_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6pygame_5_sdl2_5video_Renderer, /*tp_new*/ 0, /*tp_free*/ @@ -22023,7 +21594,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Renderer_fill_quad, __pyx_k_Renderer_fill_quad, sizeof(__pyx_k_Renderer_fill_quad), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_fill_rect, __pyx_k_Renderer_fill_rect, sizeof(__pyx_k_Renderer_fill_rect), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_fill_triangle, __pyx_k_Renderer_fill_triangle, sizeof(__pyx_k_Renderer_fill_triangle), 0, 0, 1, 1}, - {&__pyx_n_s_Renderer_from_window, __pyx_k_Renderer_from_window, sizeof(__pyx_k_Renderer_from_window), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_get_viewport, __pyx_k_Renderer_get_viewport, sizeof(__pyx_k_Renderer_get_viewport), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_present, __pyx_k_Renderer_present, sizeof(__pyx_k_Renderer_present), 0, 0, 1, 1}, {&__pyx_n_s_Renderer_set_viewport, __pyx_k_Renderer_set_viewport, sizeof(__pyx_k_Renderer_set_viewport), 0, 0, 1, 1}, @@ -22045,7 +21615,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1}, {&__pyx_n_s_Window_2, __pyx_k_Window_2, sizeof(__pyx_k_Window_2), 0, 0, 1, 1}, {&__pyx_kp_u__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 1, 0, 0}, - {&__pyx_n_s__85, __pyx_k__85, sizeof(__pyx_k__85), 0, 0, 1, 1}, + {&__pyx_n_s__83, __pyx_k__83, sizeof(__pyx_k__83), 0, 0, 1, 1}, {&__pyx_n_s_a_mod, __pyx_k_a_mod, sizeof(__pyx_k_a_mod), 0, 0, 1, 1}, {&__pyx_n_s_a_mod_2, __pyx_k_a_mod_2, sizeof(__pyx_k_a_mod_2), 0, 0, 1, 1}, {&__pyx_n_s_accelerated, __pyx_k_accelerated, sizeof(__pyx_k_accelerated), 0, 0, 1, 1}, @@ -22074,7 +21644,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1}, - {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1}, {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1}, {&__pyx_n_s_color_mode, __pyx_k_color_mode, sizeof(__pyx_k_color_mode), 0, 0, 1, 1}, {&__pyx_n_s_compose_custom_blend_mode, __pyx_k_compose_custom_blend_mode, sizeof(__pyx_k_compose_custom_blend_mode), 0, 0, 1, 1}, @@ -22118,7 +21687,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_frect, __pyx_k_frect, sizeof(__pyx_k_frect), 0, 0, 1, 1}, {&__pyx_n_s_frectptr, __pyx_k_frectptr, sizeof(__pyx_k_frectptr), 0, 0, 1, 1}, {&__pyx_n_s_from_surface, __pyx_k_from_surface, sizeof(__pyx_k_from_surface), 0, 0, 1, 1}, - {&__pyx_n_s_from_window, __pyx_k_from_window, sizeof(__pyx_k_from_window), 0, 0, 1, 1}, {&__pyx_n_s_g_mod, __pyx_k_g_mod, sizeof(__pyx_k_g_mod), 0, 0, 1, 1}, {&__pyx_n_s_g_mod_2, __pyx_k_g_mod_2, sizeof(__pyx_k_g_mod_2), 0, 0, 1, 1}, {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0}, @@ -22452,80 +22020,80 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_slice__19); __Pyx_GIVEREF(__pyx_slice__19); - /* "pygame/_sdl2/video.pyx":934 + /* "pygame/_sdl2/video.pyx":913 * cdef SDL_Rect *rectptr = pgRect_FromObject(area, &tmprect) * if rectptr == NULL: * raise TypeError('expected a rectangle') # <<<<<<<<<<<<<< * * if SDL_RenderSetViewport(self._renderer, rectptr) < 0: */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_expected_a_rectangle); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 934, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_expected_a_rectangle); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - /* "pygame/_sdl2/video.pyx":999 + /* "pygame/_sdl2/video.pyx":978 * raise error() * 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): */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_target_must_be_a_Texture_or_None); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_target_must_be_a_Texture_or_None); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - /* "pygame/_sdl2/video.pyx":1019 + /* "pygame/_sdl2/video.pyx":998 * (source).draw(area, dest) * elif not hasattr(source, 'draw'): * raise TypeError('source must be drawable') # <<<<<<<<<<<<<< * else: * source.draw(area, dest) */ - __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_source_must_be_drawable); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1019, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_source_must_be_drawable); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - /* "pygame/_sdl2/video.pyx":1206 + /* "pygame/_sdl2/video.pyx":1185 * 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, 1206, __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, 1185, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - /* "pygame/_sdl2/video.pyx":1234 + /* "pygame/_sdl2/video.pyx":1213 * 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, 1234, __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, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - /* "pygame/_sdl2/video.pyx":1245 + /* "pygame/_sdl2/video.pyx":1224 * 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, 1245, __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, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - /* "pygame/_sdl2/video.pyx":1248 + /* "pygame/_sdl2/video.pyx":1227 * 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, 1248, __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, 1227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); @@ -22685,191 +22253,179 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); - /* "pygame/_sdl2/video.pyx":752 - * cdef class Renderer: - * - * @classmethod # <<<<<<<<<<<<<< - * def from_window(cls, Window window): - * cdef Renderer self = cls.__new__(cls) - */ - __pyx_tuple__55 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_window, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__55); - __Pyx_GIVEREF(__pyx_tuple__55); - __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_from_window, 752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 752, __pyx_L1_error) - - /* "pygame/_sdl2/video.pyx":893 + /* "pygame/_sdl2/video.pyx":872 * raise error() * * def clear(self): # <<<<<<<<<<<<<< * """Clear the current rendering target with the drawing color * """ */ - __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_res); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__57); - __Pyx_GIVEREF(__pyx_tuple__57); - __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_clear, 893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 893, __pyx_L1_error) + __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_res); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__55); + __Pyx_GIVEREF(__pyx_tuple__55); + __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_clear, 872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 872, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":901 + /* "pygame/_sdl2/video.pyx":880 * raise error() * * def present(self): # <<<<<<<<<<<<<< * """Update the screen with any rendering performed since the previous call * */ - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_present, 901, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 901, __pyx_L1_error) + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_present, 880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 880, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":910 + /* "pygame/_sdl2/video.pyx":889 * SDL_RenderPresent(self._renderer) * * cpdef get_viewport(self): # <<<<<<<<<<<<<< * """Get the drawing area on the rendering target * """ */ - __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_get_viewport, 910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 910, __pyx_L1_error) + __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_get_viewport, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 889, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":918 + /* "pygame/_sdl2/video.pyx":897 * return pgRect_New(&rect) * * def set_viewport(self, area): # <<<<<<<<<<<<<< * """Set the drawing area on the rendering target * */ - __pyx_tuple__61 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_area, __pyx_n_s_tmprect, __pyx_n_s_rectptr); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__61); - __Pyx_GIVEREF(__pyx_tuple__61); - __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_set_viewport, 918, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_tuple__59 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_area, __pyx_n_s_tmprect, __pyx_n_s_rectptr); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__59); + __Pyx_GIVEREF(__pyx_tuple__59); + __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_set_viewport, 897, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 897, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1001 + /* "pygame/_sdl2/video.pyx":980 * 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): # <<<<<<<<<<<<<< * """Draw textures using a Surface-like API * */ - __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_area, __pyx_n_s_special_flags); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_tuple__61 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_source, __pyx_n_s_dest, __pyx_n_s_area, __pyx_n_s_special_flags); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__61); + __Pyx_GIVEREF(__pyx_tuple__61); + __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_blit, 980, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 980, __pyx_L1_error) + __pyx_tuple__63 = PyTuple_Pack(3, Py_None, Py_None, __pyx_int_0); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_blit, 1001, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1001, __pyx_L1_error) - __pyx_tuple__65 = PyTuple_Pack(3, Py_None, Py_None, __pyx_int_0); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - /* "pygame/_sdl2/video.pyx":1027 + /* "pygame/_sdl2/video.pyx":1006 * 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, 1027, __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, 1027, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_res); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_line, 1006, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 1006, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1040 + /* "pygame/_sdl2/video.pyx":1019 * 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, 1040, __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, 1040, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1040, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_res); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 1019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 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_point, 1019, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1019, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1052 + /* "pygame/_sdl2/video.pyx":1031 * 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, 1052, __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, 1052, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 1052, __pyx_L1_error) + __pyx_tuple__68 = 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__68)) __PYX_ERR(0, 1031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__68); + __Pyx_GIVEREF(__pyx_tuple__68); + __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 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_rect, 1031, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1031, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1071 + /* "pygame/_sdl2/video.pyx":1050 * 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, 1071, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1071, __pyx_L1_error) + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 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_fill_rect, 1050, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 1050, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1091 + /* "pygame/_sdl2/video.pyx":1070 * 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, 1091, __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, 1091, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1091, __pyx_L1_error) + __pyx_tuple__71 = 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__71)) __PYX_ERR(0, 1070, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_c_cython_pygame__sdl2_video, __pyx_n_s_draw_triangle, 1070, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 1070, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1104 + /* "pygame/_sdl2/video.pyx":1083 * 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, 1104, __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, 1104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 1104, __pyx_L1_error) + __pyx_tuple__73 = 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__73)) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 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_fill_triangle, 1083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 1083, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1133 + /* "pygame/_sdl2/video.pyx":1112 * 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, 1133, __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, 1133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1133, __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_p4, __pyx_n_s_fpoints, __pyx_n_s_i, __pyx_n_s_pos, __pyx_n_s_res); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(5, 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_draw_quad, 1112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 1112, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1145 + /* "pygame/_sdl2/video.pyx":1124 * 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, 1145, __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, 1145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1145, __pyx_L1_error) + __pyx_tuple__77 = 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__77)) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__77); + __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 10, 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_fill_quad, 1124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 1124, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1174 + /* "pygame/_sdl2/video.pyx":1153 * 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, 1174, __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, 1174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_tuple__79 = 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__79)) __PYX_ERR(0, 1153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 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_to_surface, 1153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 1153, __pyx_L1_error) - /* "pygame/_sdl2/video.pyx":1256 + /* "pygame/_sdl2/video.pyx":1235 * 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, 1256, __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, 1256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 1256, __pyx_L1_error) + __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_color_mode, __pyx_n_s_alpha_mode, __pyx_n_s_res); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); + __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 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_compose_custom_blend_mode, 1235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 1235, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -22975,9 +22531,9 @@ static int __Pyx_modinit_type_init_code(void) { { PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 750, __pyx_L1_error) if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) { - __pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer_2__init__.doc = __pyx_doc_6pygame_5_sdl2_5video_8Renderer_2__init__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer_2__init__; + __pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; + __pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer___init__.doc = __pyx_doc_6pygame_5_sdl2_5video_8Renderer___init__; + ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pygame_5_sdl2_5video_8Renderer___init__; } } #endif @@ -23872,230 +23428,209 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Image); - /* "pygame/_sdl2/video.pyx":752 - * cdef class Renderer: - * - * @classmethod # <<<<<<<<<<<<<< - * def from_window(cls, Window window): - * cdef Renderer self = cls.__new__(cls) - */ - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_1from_window, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_from_window, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_from_window, __pyx_t_5) < 0) __PYX_ERR(0, 752, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - __Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer, __pyx_n_s_from_window); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_from_window, __pyx_t_4) < 0) __PYX_ERR(0, 752, __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":893 + /* "pygame/_sdl2/video.pyx":872 * raise error() * * def clear(self): # <<<<<<<<<<<<<< * """Clear the current rendering target with the drawing color * """ */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_7clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_clear, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_clear, __pyx_t_4) < 0) __PYX_ERR(0, 893, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_5clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_clear, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_clear, __pyx_t_5) < 0) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":901 + /* "pygame/_sdl2/video.pyx":880 * raise error() * * def present(self): # <<<<<<<<<<<<<< * """Update the screen with any rendering performed since the previous call * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_9present, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_present, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_present, __pyx_t_4) < 0) __PYX_ERR(0, 901, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_7present, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_present, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_present, __pyx_t_5) < 0) __PYX_ERR(0, 880, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":910 + /* "pygame/_sdl2/video.pyx":889 * SDL_RenderPresent(self._renderer) * * cpdef get_viewport(self): # <<<<<<<<<<<<<< * """Get the drawing area on the rendering target * """ */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_11get_viewport, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_get_viewport, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_get_viewport, __pyx_t_4) < 0) __PYX_ERR(0, 910, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_9get_viewport, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_get_viewport, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_get_viewport, __pyx_t_5) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":918 + /* "pygame/_sdl2/video.pyx":897 * return pgRect_New(&rect) * * def set_viewport(self, area): # <<<<<<<<<<<<<< * """Set the drawing area on the rendering target * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_13set_viewport, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_set_viewport, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 918, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_set_viewport, __pyx_t_4) < 0) __PYX_ERR(0, 918, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_11set_viewport, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_set_viewport, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_set_viewport, __pyx_t_5) < 0) __PYX_ERR(0, 897, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1001 + /* "pygame/_sdl2/video.pyx":980 * 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): # <<<<<<<<<<<<<< * """Draw textures using a Surface-like API * */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_15blit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_blit, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__65); - if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_blit, __pyx_t_4) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_13blit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_blit, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__63); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_blit, __pyx_t_5) < 0) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1027 + /* "pygame/_sdl2/video.pyx":1006 * 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, 1027, __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, 1027, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_15draw_line, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_line, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_line, __pyx_t_5) < 0) __PYX_ERR(0, 1006, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1040 + /* "pygame/_sdl2/video.pyx":1019 * 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, 1040, __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, 1040, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_17draw_point, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_point, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1019, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_point, __pyx_t_5) < 0) __PYX_ERR(0, 1019, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1052 + /* "pygame/_sdl2/video.pyx":1031 * 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, 1052, __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, 1052, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_19draw_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_rect, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1031, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_rect, __pyx_t_5) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1071 + /* "pygame/_sdl2/video.pyx":1050 * 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, 1071, __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, 1071, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_21fill_rect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_rect, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_rect, __pyx_t_5) < 0) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1091 + /* "pygame/_sdl2/video.pyx":1070 * 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, 1091, __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, 1091, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_23draw_triangle, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_triangle, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1070, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_triangle, __pyx_t_5) < 0) __PYX_ERR(0, 1070, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1104 + /* "pygame/_sdl2/video.pyx":1083 * 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, 1104, __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, 1104, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_25fill_triangle, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_triangle, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_triangle, __pyx_t_5) < 0) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1133 + /* "pygame/_sdl2/video.pyx":1112 * 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, 1133, __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, 1133, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_27draw_quad, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_draw_quad, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_draw_quad, __pyx_t_5) < 0) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1145 + /* "pygame/_sdl2/video.pyx":1124 * 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, 1145, __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, 1145, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_29fill_quad, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_fill_quad, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_fill_quad, __pyx_t_5) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1174 + /* "pygame/_sdl2/video.pyx":1153 * 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, 1174, __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, 1174, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_31to_surface, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Renderer_to_surface, NULL, __pyx_n_s_pygame__sdl2_video, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__54); + if (PyDict_SetItem((PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer->tp_dict, __pyx_n_s_to_surface, __pyx_t_5) < 0) __PYX_ERR(0, 1153, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; PyType_Modified(__pyx_ptype_6pygame_5_sdl2_5video_Renderer); - /* "pygame/_sdl2/video.pyx":1256 + /* "pygame/_sdl2/video.pyx":1235 * 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, 1256, __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, 1256, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6pygame_5_sdl2_5video_8Renderer_33compose_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__82)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + 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, 1235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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, 1256, __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, 1256, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_5, (PyObject *)__pyx_ptype_6pygame_5_sdl2_5video_Renderer, __pyx_n_s_compose_custom_blend_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1235, __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, 1256, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + 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, 1235, __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":1 @@ -24103,10 +23638,10 @@ if (!__Pyx_RefNanny) { * from cpython.ref cimport Py_DECREF * cimport cython */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /*--- Wrapped vars code ---*/ @@ -28320,47 +27855,6 @@ static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) { return result; } -/* ClassMethod */ -static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { -#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000 - if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) { - return PyClassMethod_New(method); - } -#else -#if CYTHON_COMPILING_IN_PYPY - if (PyMethodDescr_Check(method)) -#else - #if PY_MAJOR_VERSION == 2 - static PyTypeObject *methoddescr_type = NULL; - if (unlikely(methoddescr_type == NULL)) { - PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append"); - if (unlikely(!meth)) return NULL; - methoddescr_type = Py_TYPE(meth); - Py_DECREF(meth); - } - #else - PyTypeObject *methoddescr_type = &PyMethodDescr_Type; - #endif - if (__Pyx_TypeCheck(method, methoddescr_type)) -#endif - { - PyMethodDescrObject *descr = (PyMethodDescrObject *)method; - #if PY_VERSION_HEX < 0x03020000 - PyTypeObject *d_type = descr->d_type; - #else - PyTypeObject *d_type = descr->d_common.d_type; - #endif - return PyDescr_NewClassMethod(d_type, descr->d_method); - } -#endif - else if (PyMethod_Check(method)) { - return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); - } - else { - return PyClassMethod_New(method); - } -} - /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { @@ -30399,7 +29893,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) __pyx_n_s_name); if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); - Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__85)); + Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__83)); } return name; } diff --git a/src_c/cython/pygame/_sdl2/video.pxd b/src_c/cython/pygame/_sdl2/video.pxd index bedfb8b967..e96169a3c5 100644 --- a/src_c/cython/pygame/_sdl2/video.pxd +++ b/src_c/cython/pygame/_sdl2/video.pxd @@ -428,7 +428,6 @@ cdef extern from "pygame.h" nogil: ctypedef class pygame.window.Window [object pgWindowObject]: cdef SDL_Window *_win - cdef SDL_bool _is_borrowed ctypedef struct pgSurfaceObject @@ -461,7 +460,6 @@ cdef class Renderer: cdef SDL_Renderer* _renderer cdef Texture _target cdef Window _win - cdef int _is_borrowed cpdef object get_viewport(self) cpdef object blit(self, object source, Rect dest=*, Rect area=*, int special_flags=*) diff --git a/src_c/cython/pygame/_sdl2/video.pyx b/src_c/cython/pygame/_sdl2/video.pyx index 0dd2308b84..ee1c580609 100644 --- a/src_c/cython/pygame/_sdl2/video.pyx +++ b/src_c/cython/pygame/_sdl2/video.pyx @@ -749,24 +749,6 @@ cdef class Image: @cython.auto_pickle(False) cdef class Renderer: - @classmethod - def from_window(cls, Window window): - cdef Renderer self = cls.__new__(cls) - self._win = window - if self._win._is_borrowed: - self._is_borrowed=1 - else: - raise error() - if not self._win: - raise error() - - self._renderer = SDL_GetRenderer(self._win._win) - if not self._renderer: - raise error() - - self._target = None - return self - def __init__(self,Window window, int index=-1, int accelerated=-1, bint vsync=False, bint target_texture=False): @@ -831,11 +813,8 @@ cdef class Renderer: cdef Uint8[4] defaultColor = [255, 255, 255, 255] self._target = None self._win = window - self._is_borrowed=0 def __dealloc__(self): - if self._is_borrowed: - return if self._renderer: SDL_DestroyRenderer(self._renderer) diff --git a/src_c/doc/sdl2_video_doc.h b/src_c/doc/sdl2_video_doc.h index 64ee1d3367..b8c851edb6 100644 --- a/src_c/doc/sdl2_video_doc.h +++ b/src_c/doc/sdl2_video_doc.h @@ -36,7 +36,6 @@ #define DOC_SDL2_VIDEO_RENDERER_LOGICALSIZE "logical_size -> (int width, int height)\nGet or set the logical Renderer size (a device independent resolution for rendering)" #define DOC_SDL2_VIDEO_RENDERER_SCALE "scale -> (float, float)\nGet the drawing scale for the current rendering target" #define DOC_SDL2_VIDEO_RENDERER_TARGET "target -> Texture or None\nGet or set the current rendering target" -#define DOC_SDL2_VIDEO_RENDERER_FROMWINDOW "from_window(window) -> Renderer\nCreate a Renderer from an existing window" #define DOC_SDL2_VIDEO_RENDERER_CLEAR "clear() -> None\nClear the current rendering target with the drawing color" #define DOC_SDL2_VIDEO_RENDERER_PRESENT "present() -> None\nUpdate the screen with any rendering performed since the previous call" #define DOC_SDL2_VIDEO_RENDERER_GETVIEWPORT "get_viewport() -> Rect\nGet the drawing area on the rendering target" diff --git a/src_c/include/_pygame.h b/src_c/include/_pygame.h index f1011e74b4..2973477d15 100644 --- a/src_c/include/_pygame.h +++ b/src_c/include/_pygame.h @@ -495,10 +495,13 @@ typedef struct pgColorObject pgColorObject; */ typedef struct { PyObject_HEAD SDL_Window *_win; - SDL_bool _is_borrowed; - pgSurfaceObject *surf; } pgWindowObject; +typedef struct { + pgWindowObject base; + pgSurfaceObject *surf; +} pgSurfaceWindowObject; + #ifndef PYGAMEAPI_WINDOW_INTERNAL #define pgWindow_Type (*(PyTypeObject *)PYGAMEAPI_GET_SLOT(window, 0)) #define pgWindow_Check(x) \ diff --git a/src_c/window.c b/src_c/window.c index 60aa321018..77c48cd429 100644 --- a/src_c/window.c +++ b/src_c/window.c @@ -93,10 +93,14 @@ pg_display_resource(char *filename) } static PyTypeObject pgWindow_Type; +static PyTypeObject pgSurfaceWindow_Type; #define pgWindow_Check(x) \ (PyObject_IsInstance((x), (PyObject *)&pgWindow_Type)) +#define pgSurfaceWindow_Check(x) \ + (PyObject_IsInstance((x), (PyObject *)&pgSurfaceWindow_Type)) + static PyObject * get_grabbed_window(PyObject *self, PyObject *_null) { @@ -117,15 +121,15 @@ static PyObject * window_destroy(pgWindowObject *self, PyObject *_null) { if (self->_win) { - if (self->_is_borrowed && pg_GetDefaultWindow() == self->_win) { - pgSurface_AsSurface(pg_GetDefaultWindowSurface()) = NULL; - pg_SetDefaultWindowSurface(NULL); - pg_SetDefaultWindow(NULL); - } - SDL_DestroyWindow(self->_win); self->_win = NULL; } + Py_RETURN_NONE; +} + +static PyObject * +surfacewindow_destroy(pgSurfaceWindowObject *self, PyObject *_null) +{ if (self->surf) { // Set the internal surface to NULL to make pygame surface invalid // since this surface will be deallocated by SDL when the window is @@ -135,26 +139,15 @@ window_destroy(pgWindowObject *self, PyObject *_null) Py_DECREF(self->surf); self->surf = NULL; } - Py_RETURN_NONE; + return window_destroy((pgWindowObject *)self, _null); } static PyObject * -window_get_surface(pgWindowObject *self) +surfacewindow_get_surface(pgSurfaceWindowObject *self) { - PyObject *surf = NULL; SDL_Surface *_surf; - if (self->_is_borrowed) { - surf = (PyObject *)pg_GetDefaultWindowSurface(); - if (!surf) { - return RAISE(pgExc_SDLError, - "display.set_mode has not been called yet."); - } - Py_INCREF(surf); - return surf; - } - - _surf = SDL_GetWindowSurface(self->_win); + _surf = SDL_GetWindowSurface(self->base._win); if (!_surf) { return RAISE(pgExc_SDLError, SDL_GetError()); } @@ -179,7 +172,7 @@ window_get_surface(pgWindowObject *self) } static PyObject * -window_flip(pgWindowObject *self) +surfacewindow_flip(pgSurfaceWindowObject *self) { int result; @@ -190,7 +183,7 @@ window_flip(pgWindowObject *self) } Py_BEGIN_ALLOW_THREADS; - result = SDL_UpdateWindowSurface(self->_win); + result = SDL_UpdateWindowSurface(self->base._win); Py_END_ALLOW_THREADS; if (result) { return RAISE(pgExc_SDLError, SDL_GetError()); @@ -214,15 +207,13 @@ _resize_event_watch(void *userdata, SDL_Event *event) if (!event_window_pg) return 0; - if (event_window_pg->_is_borrowed) { - // have been handled by event watch in display.c - return 0; + if (pgSurfaceWindow_Check((PyObject *)event_window_pg)) { + pgSurfaceWindowObject *ev_surfwindow = + (pgSurfaceWindowObject *)event_window_pg; + if (ev_surfwindow->surf) { + ev_surfwindow->surf->surf = SDL_GetWindowSurface(event_window); + } } - - if (!event_window_pg->surf) - return 0; - - event_window_pg->surf->surf = SDL_GetWindowSurface(event_window); return 0; } @@ -723,13 +714,14 @@ static void window_dealloc(pgWindowObject *self, PyObject *_null) { if (self->_win) { - if (!self->_is_borrowed) { - SDL_DestroyWindow(self->_win); - } - else if (SDL_GetWindowData(self->_win, "pg_window") != NULL) { - SDL_SetWindowData(self->_win, "pg_window", NULL); - } + SDL_DestroyWindow(self->_win); } + Py_TYPE(self)->tp_free(self); +} + +static void +surfacewindow_dealloc(pgSurfaceWindowObject *self, PyObject *_null) +{ if (self->surf) { // Set the internal surface to NULL to make pygame surface invalid // since this surface will be deallocated by SDL when the window is @@ -739,7 +731,7 @@ window_dealloc(pgWindowObject *self, PyObject *_null) Py_DECREF(self->surf); } - Py_TYPE(self)->tp_free(self); + window_dealloc((pgWindowObject *)self, _null); } static int @@ -922,9 +914,6 @@ window_init(pgWindowObject *self, PyObject *args, PyObject *kwargs) return -1; } self->_win = _win; - self->_is_borrowed = SDL_FALSE; - self->surf = NULL; - SDL_SetWindowData(_win, "pg_window", self); PyObject *icon = pg_display_resource(icon_defaultname); @@ -943,35 +932,15 @@ window_init(pgWindowObject *self, PyObject *args, PyObject *kwargs) return 0; } -static PyObject * -window_from_display_module(PyTypeObject *cls, PyObject *_null) +static int +surfacewindow_init(pgSurfaceWindowObject *self, PyObject *args, + PyObject *kwargs) { - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "Please use Window.get_surface and Window.flip to use " - "surface-rendering with Window. This method will be " - "removed in a future version.", - 1) == -1) { - return NULL; - } - - SDL_Window *window = pg_GetDefaultWindow(); - if (!window) { - return RAISE(pgExc_SDLError, - "display.set_mode has not been called yet."); - } - - pgWindowObject *self = - (pgWindowObject *)SDL_GetWindowData(window, "pg_window"); - if (self != NULL) { - Py_INCREF(self); - return (PyObject *)self; + if (window_init((pgWindowObject *)self, args, kwargs) < 0) { + return -1; } - - self = (pgWindowObject *)(cls->tp_new(cls, NULL, NULL)); - self->_win = window; - self->_is_borrowed = SDL_TRUE; - SDL_SetWindowData(window, "pg_window", self); - return (PyObject *)self; + self->surf = NULL; + return 0; } PyObject * @@ -983,10 +952,6 @@ window_repr(pgWindowObject *self) return PyUnicode_FromString(""); } - if (self->_is_borrowed) { - return PyUnicode_FromString(""); - } - title = SDL_GetWindowTitle(self->_win); win_id = SDL_GetWindowID(self->_win); if (win_id == 0) { @@ -1028,11 +993,6 @@ static PyMethodDef window_methods[] = { {"set_modal_for", (PyCFunction)window_set_modal_for, METH_O, DOC_WINDOW_SETMODALFOR}, {"set_icon", (PyCFunction)window_set_icon, METH_O, DOC_WINDOW_SETICON}, - {"flip", (PyCFunction)window_flip, METH_NOARGS, DOC_WINDOW_FLIP}, - {"get_surface", (PyCFunction)window_get_surface, METH_NOARGS, - DOC_WINDOW_GETSURFACE}, - {"from_display_module", (PyCFunction)window_from_display_module, - METH_CLASS | METH_NOARGS, DOC_WINDOW_FROMDISPLAYMODULE}, {NULL, NULL, 0, NULL}}; static PyGetSetDef _window_getset[] = { @@ -1070,6 +1030,7 @@ static PyGetSetDef _window_getset[] = { static PyTypeObject pgWindow_Type = { PyVarObject_HEAD_INIT(NULL, 0).tp_name = "pygame.window.Window", + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_basicsize = sizeof(pgWindowObject), .tp_dealloc = (destructor)window_dealloc, .tp_doc = DOC_WINDOW, @@ -1079,6 +1040,26 @@ static PyTypeObject pgWindow_Type = { .tp_getset = _window_getset, .tp_repr = (reprfunc)window_repr}; +static PyMethodDef surfacewindow_methods[] = { + {"destroy", (PyCFunction)surfacewindow_destroy, METH_NOARGS, + DOC_WINDOW_DESTROY}, + {"flip", (PyCFunction)surfacewindow_flip, METH_NOARGS, DOC_WINDOW_FLIP}, + {"get_surface", (PyCFunction)surfacewindow_get_surface, METH_NOARGS, + DOC_WINDOW_GETSURFACE}, + {NULL, NULL, 0, NULL}}; + +static PyTypeObject pgSurfaceWindow_Type = { + PyVarObject_HEAD_INIT(NULL, 0).tp_name = "pygame.window.SurfaceWindow", + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + .tp_basicsize = sizeof(pgSurfaceWindowObject), + .tp_dealloc = (destructor)surfacewindow_dealloc, + .tp_doc = DOC_WINDOW, + .tp_methods = surfacewindow_methods, + .tp_init = (initproc)surfacewindow_init, + .tp_new = PyType_GenericNew, + .tp_getset = _window_getset, + .tp_repr = (reprfunc)window_repr}; + static PyMethodDef _window_methods[] = { {"get_grabbed_window", (PyCFunction)get_grabbed_window, METH_NOARGS, DOC_SDL2_VIDEO_GETGRABBEDWINDOW}, @@ -1125,6 +1106,11 @@ MODINIT_DEFINE(window) return NULL; } + pgSurfaceWindow_Type.tp_base = &pgWindow_Type; + if (PyType_Ready(&pgSurfaceWindow_Type) < 0) { + return NULL; + } + /* create the module */ module = PyModule_Create(&_module); if (module == 0) { @@ -1138,6 +1124,14 @@ MODINIT_DEFINE(window) return NULL; } + Py_INCREF(&pgSurfaceWindow_Type); + if (PyModule_AddObject(module, "SurfaceWindow", + (PyObject *)&pgSurfaceWindow_Type)) { + Py_DECREF(&pgSurfaceWindow_Type); + Py_DECREF(module); + return NULL; + } + c_api[0] = &pgWindow_Type; apiobj = encapsulate_api(c_api, "window"); if (PyModule_AddObject(module, PYGAMEAPI_LOCAL_ENTRY, apiobj)) { diff --git a/src_py/__init__.py b/src_py/__init__.py index 8338ad04bf..e34d91b86b 100644 --- a/src_py/__init__.py +++ b/src_py/__init__.py @@ -308,7 +308,7 @@ def PixelArray(surface): # pylint: disable=unused-argument system = MissingModule("system", urgent=0) try: - from pygame.window import Window + from pygame.window import Window, SurfaceWindow except (ImportError, OSError): def Window( @@ -316,6 +316,8 @@ def Window( ): # pylint: disable=unused-argument _attribute_undefined("pygame.Window") + SurfaceWindow = Window + # there's also a couple "internal" modules not needed # by users, but putting them here helps "dependency finder"