Skip to content

Commit

Permalink
fix drawing position of nearest scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
soarqin committed Dec 11, 2019
1 parent 8d9a451 commit 7ff04f6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/gpu/gpulib/vout_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,20 +468,17 @@ void vout_update(void)

if (Config.VideoScaling == 1) {
// Height centering
int sizeShift = 0;
int sizeShift = 1;
if (h0 == 256) {
h0 = 240;
} else if (h0 == 480) {
sizeShift = 1;
sizeShift = 2;
}
if (h1 > h0) {
src16_offs = (src16_offs + (((h1 - h0) / 2) * 1024)) & src16_offs_msk;
src16_offs = (src16_offs + (((h1 - h0) >> 1) * 1024)) & src16_offs_msk;
h1 = h0;
} else if (h1 < h0) {
if (y0 + h1 > h0)
dst16 += ((h0 - h1) >> sizeShift) * SCREEN_WIDTH;
else
dst16 += (y0 >> sizeShift) * SCREEN_WIDTH;
dst16 += ((h0 - h1) >> sizeShift) * SCREEN_WIDTH;
}

int incY = (h0 == 480) ? 2 : 1;
Expand Down

0 comments on commit 7ff04f6

Please sign in to comment.