summaryrefslogtreecommitdiff
path: root/src/video/sdlgenblit.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/sdlgenblit.pl')
-rwxr-xr-xsrc/video/sdlgenblit.pl21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/video/sdlgenblit.pl b/src/video/sdlgenblit.pl
index e26730249..63d6dc9b4 100755
--- a/src/video/sdlgenblit.pl
+++ b/src/video/sdlgenblit.pl
@@ -452,13 +452,12 @@ __EOF__
if ( $scale ) {
print FILE <<__EOF__;
int srcy, srcx;
- int posy, posx;
+ Uint32 posy, posx;
int incy, incx;
__EOF__
print FILE <<__EOF__;
- srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
@@ -467,22 +466,14 @@ __EOF__
$format_type{$src} *src = 0;
$format_type{$dst} *dst = ($format_type{$dst} *)info->dst;
int n = info->dst_w;
- srcx = -1;
- posx = 0x10000L;
- while (posy >= 0x10000L) {
- ++srcy;
- posy -= 0x10000L;
- }
+ posx = 0;
+
+ srcy = posy >> 16;
while (n--) {
- if (posx >= 0x10000L) {
- while (posx >= 0x10000L) {
- ++srcx;
- posx -= 0x10000L;
- }
- src = ($format_type{$src} *)(info->src + (srcy * info->src_pitch) + (srcx * $format_size{$src}));
+ srcx = posx >> 16;
+ src = ($format_type{$src} *)(info->src + (srcy * info->src_pitch) + (srcx * $format_size{$src}));
__EOF__
print FILE <<__EOF__;
- }
__EOF__
output_copycore($src, $dst, $modulate, $blend, $is_modulateA_done, $A_is_const_FF);
print FILE <<__EOF__;