Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions src_c/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -2139,25 +2139,24 @@ surf_fblits(pgSurfaceObject *self, PyObject *const *args, Py_ssize_t nargs)
SURF_INIT_CHECK(dest)

SDL_Rect *src_rect, temp, dest_rect;
PyObject *item = NULL, *src_surf = NULL, *blit_pos = NULL;
PyObject *blit_sequence;
int error = 0, flags_numeric = 0;
PyObject *blit_sequence, *item, *src_surf, *blit_pos;
int blend_flags = 0; /* Default flag is 0, opaque */
int error = 0;

if (nargs == 0 || nargs > 2) {
error = FBLITS_ERR_INCORRECT_ARGS_NUM;
goto on_error;
}
/* Get the blend flags if they are passed */
else if (nargs == 2) {
if (PyLong_Check(args[1])) {
flags_numeric = PyLong_AsLong(args[1]);
if (PyErr_Occurred()) {
return NULL;
}
}
else {
if (!PyLong_Check(args[1])) {
error = FBLITS_ERR_FLAG_NOT_NUMERIC;
goto on_error;
}
blend_flags = PyLong_AsLong(args[1]);
if (PyErr_Occurred()) {
return NULL;
}
}

blit_sequence = args[0];
Expand Down Expand Up @@ -2206,7 +2205,7 @@ surf_fblits(pgSurfaceObject *self, PyObject *const *args, Py_ssize_t nargs)

/* Perform the blit */
if (pgSurface_Blit(self, (pgSurfaceObject *)src_surf, &dest_rect,
NULL, flags_numeric)) {
NULL, blend_flags)) {
error = BLITS_ERR_BLIT_FAIL;
goto on_error;
}
Expand Down Expand Up @@ -2256,7 +2255,7 @@ surf_fblits(pgSurfaceObject *self, PyObject *const *args, Py_ssize_t nargs)

/* Perform the blit */
if (pgSurface_Blit(self, (pgSurfaceObject *)src_surf, &dest_rect,
NULL, flags_numeric)) {
NULL, blend_flags)) {
error = BLITS_ERR_BLIT_FAIL;
goto on_error;
}
Expand Down