From 2951dec4c1d137c82833756a50d0b6da036195c8 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 9 Aug 2004 08:08:37 +0000 Subject: [PATCH] special case 0.5 since the change was causing artifacts at other zoom factors --- stepmania/src/SDL_rotozoom.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/stepmania/src/SDL_rotozoom.cpp b/stepmania/src/SDL_rotozoom.cpp index d578086e5d..949eb22bcf 100644 --- a/stepmania/src/SDL_rotozoom.cpp +++ b/stepmania/src/SDL_rotozoom.cpp @@ -36,10 +36,11 @@ static void ZoomSurface( RageSurface * src, RageSurface * dst ) { float sax = sx*x + sx/2; - // Pixel alignment is off in the magnify case. - // This is an ugly hack to correct for it. - if( sx < 1 ) // magnifying - sax += SCALE(sx,0.5f,1.f,sx/2.f,0.f); + // HACK to improve pixel alignment in the 2x magnify case. + // I can't figure out a general solution that works with larger and + // scale factors, so this remains a special case. + if( sx == 0.5f ) // 2x magnify + sax += 0.5f; /* sx/2 is the distance from the start of the sample to the center; * sx/4 is the distance from the center of the sample to the center of @@ -72,10 +73,11 @@ static void ZoomSurface( RageSurface * src, RageSurface * dst ) { float say = sy*y + sy/2; - // Pixel alignment is off in the magnify case. - // This is an ugly hack to correct for it. - if( sy < 1 ) // magnifying - say += SCALE(sy,0.5f,1.f,sy/2.f,0.f); + // HACK to improve pixel alignment in the 2x magnify case. + // I can't figure out a general solution that works with larger and + // scale factors, so this remains a special case. + if( sy == 0.5f ) // 2x magnify + say += 0.5f; float ystep = sy/4;