@@ -2205,8 +2205,8 @@ _surf_fblits_multiblit_item_check_and_blit(PyObject *src_surf,
2205
2205
/* manage destinations memory */
2206
2206
Py_ssize_t new_size = PySequence_Fast_GET_SIZE (pos_sequence );
2207
2207
if (new_size > destinations -> alloc_size ) {
2208
- destinations -> sequence = (CachedBlitDest * )realloc (
2209
- destinations -> sequence , new_size * sizeof (CachedBlitDest ));
2208
+ destinations -> sequence = (BlitDestination * )realloc (
2209
+ destinations -> sequence , new_size * sizeof (BlitDestination ));
2210
2210
2211
2211
if (!destinations -> sequence )
2212
2212
return FBLITS_ERR_NO_MEMORY ;
@@ -2222,9 +2222,6 @@ _surf_fblits_multiblit_item_check_and_blit(PyObject *src_surf,
2222
2222
return FBLITS_ERR_INVALID_SEQUENCE_LENGTH ;
2223
2223
}
2224
2224
2225
- if (destinations -> size == 0 )
2226
- return 0 ;
2227
-
2228
2225
if (self -> subsurface ) {
2229
2226
PyObject * owner ;
2230
2227
struct pgSubSurface_Data * subdata ;
@@ -2281,7 +2278,7 @@ _surf_fblits_multiblit_item_check_and_blit(PyObject *src_surf,
2281
2278
if (!SDL_IntersectRect (clip_rect , & src_dest , & clipped ))
2282
2279
continue ; /* Skip out of bounds destinations */
2283
2280
2284
- CachedBlitDest * d_item = & destinations -> sequence [current_size ++ ];
2281
+ BlitDestination * d_item = & destinations -> sequence [current_size ++ ];
2285
2282
2286
2283
d_item -> pixels =
2287
2284
(Uint32 * )dst -> pixels + clipped .y * dst -> pitch / 4 + clipped .x ;
@@ -2323,6 +2320,7 @@ _surf_fblits_blit(pgSurfaceObject *self, PyObject *item, int blend_flags,
2323
2320
{
2324
2321
PyObject * src_surf , * pos_or_seq ;
2325
2322
SDL_Surface * src , * dst = pgSurface_AsSurface (self );
2323
+ SDL_Rect temp , * argrect = NULL ;
2326
2324
if (!dst ) {
2327
2325
* error = BLITS_ERR_DISPLAY_SURF_QUIT ;
2328
2326
return ;
@@ -2350,23 +2348,12 @@ _surf_fblits_blit(pgSurfaceObject *self, PyObject *item, int blend_flags,
2350
2348
return ;
2351
2349
}
2352
2350
2353
- if (pgRect_Check (pos_or_seq )) {
2354
- SDL_Rect * r = & pgRect_AsRect (pos_or_seq );
2355
- x = r -> x ;
2356
- y = r -> y ;
2357
- * error = _surf_fblits_item_check_and_blit (src_surf , src , self , x , y ,
2358
- blend_flags );
2359
- return ;
2360
- }
2361
- else if (pgFRect_Check (pos_or_seq )) {
2362
- SDL_FRect * r = & pgFRect_AsRect (pos_or_seq );
2363
- x = (int )r -> x ;
2364
- y = (int )r -> y ;
2365
- * error = _surf_fblits_item_check_and_blit (src_surf , src , self , x , y ,
2366
- blend_flags );
2367
- return ;
2368
- }
2369
- else if (pg_TwoIntsFromObj (pos_or_seq , & x , & y )) {
2351
+ if (pg_TwoIntsFromObj (pos_or_seq , & x , & y ) ||
2352
+ (argrect = pgRect_FromObject (pos_or_seq , & temp ))) {
2353
+ if (argrect ) {
2354
+ x = argrect -> x ;
2355
+ y = argrect -> y ;
2356
+ }
2370
2357
* error = _surf_fblits_item_check_and_blit (src_surf , src , self , x , y ,
2371
2358
blend_flags );
2372
2359
return ;
0 commit comments