Skip to content

Commit 5e0874f

Browse files
authored
Merge pull request #1 from Beyley/main
Fix rendering of non zero src rect
2 parents 2edb69e + 6995a84 commit 5e0874f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/render/psl1ght/SDL_PSL1GHTrender.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,12 @@ PSL1GHT_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
558558
scale.outY = final_rect.y;
559559
scale.outW = final_rect.w;
560560
scale.outH = final_rect.h;
561-
scale.ratioX = (srcrect->w << 20) / final_rect.w;
562-
scale.ratioY = (srcrect->h << 20) / final_rect.h;
563-
scale.inX = srcrect->x;
564-
scale.inY = srcrect->y;
565-
scale.inW = srcrect->w;
566-
scale.inH = srcrect->h;
561+
scale.ratioX = rsxGetFixedSint32(1);
562+
scale.ratioY = rsxGetFixedSint32(1);
563+
scale.inX = rsxGetFixedUint16(srcrect->x);
564+
scale.inY = rsxGetFixedUint16(srcrect->y);
565+
scale.inW = srcrect->x + srcrect->w;
566+
scale.inH = srcrect->y + srcrect->h;
567567
scale.offset = src_offset;
568568
scale.pitch = src->pitch;
569569
scale.origin = GCM_TRANSFER_ORIGIN_CORNER;

0 commit comments

Comments
 (0)