@@ -281,7 +281,7 @@ static REBXYF Zero_Pair = {0, 0};
281
281
282
282
case GOBT_IMAGE :
283
283
//RL_Print("draw image gob\n");
284
- OS_Blit_Gob_Image (gob , ctx , offset , top_left , bottom_right );
284
+ OS_Blit_Gob_Image (gob , ctx , offset , gob_clip . top , gob_clip . left , gob_clip . bottom , gob_clip . right );
285
285
break ;
286
286
287
287
#ifdef HAS_WIDGET_GOB
@@ -501,7 +501,7 @@ static REBXYF Zero_Pair = {0, 0};
501
501
502
502
/***********************************************************************
503
503
**
504
- */ void OS_Blit_Gob_Image (REBGOB * gob , REBCMP * ctx , REBXYI abs_oft , REBXYI dst_oft , REBXYI dst_siz )
504
+ */ void OS_Blit_Gob_Image (REBGOB * gob , REBCMP * ctx , REBXYI abs_oft , REBINT top , REBINT left , REBINT bottom , REBINT right )
505
505
/*
506
506
** This routine copies a rectangle from a PAN structure to the
507
507
** current output device.
@@ -510,11 +510,12 @@ static REBXYF Zero_Pair = {0, 0};
510
510
{
511
511
//if (!gob || GOB_TYPE(gob) != GOBT_IMAGE || !GOB_CONTENT(gob)) return;
512
512
513
+ REBSER * img = (REBSER * )GOB_CONTENT (gob );
513
514
HDC hdc = ctx -> back_DC ;
514
515
BITMAPINFO BitmapInfo = ctx -> bmpInfo ;
515
516
REBINT mode ;
516
- REBINT src_siz_x = ROUND_TO_INT ( gob -> size . x );
517
- REBINT src_siz_y = ROUND_TO_INT ( gob -> size . y );
517
+ REBINT src_siz_x = IMG_WIDE ( img ); // real image size
518
+ REBINT src_siz_y = IMG_HIGH ( img );
518
519
519
520
mode = SetStretchBltMode (hdc , COLORONCOLOR ); // returns previous mode
520
521
BitmapInfo .bmiHeader .biSize = sizeof (BITMAPINFOHEADER );
@@ -523,13 +524,13 @@ static REBXYF Zero_Pair = {0, 0};
523
524
524
525
StretchDIBits (
525
526
hdc ,
526
- dst_oft . x , dst_oft . y ,
527
- dst_siz . x , dst_siz . y ,
527
+ left , top ,
528
+ right - left , bottom - top ,
528
529
0 , 0 , // always at 0x0 so far; should we support image atlases?
529
530
src_siz_x , src_siz_y ,
530
531
GOB_BITMAP (gob ),
531
532
& BitmapInfo ,
532
- DIB_PAL_COLORS ,
533
+ DIB_RGB_COLORS ,
533
534
SRCCOPY
534
535
);
535
536
SetStretchBltMode (hdc , mode );
0 commit comments