Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualServant of the Lord

Posted 28 March 2013 - 03:55 PM

The innards of your for() statement should be ((x * scale) + sx) not (x + sx)

Otherwise, you're overwriting most of your pixels multiple times. smile.png

 

for(int y = 0; y != Surface->h; ++y)
{
    for(int x = 0; x != Surface->w; ++x)
    {
        for(int sy = 0; sy != Scale; ++sy)
        {
            for(int sx = 0; sx != Scale; ++sx)
            {
                PutPixel(tempScaledSurface, ((x * scale) + sx), ((y * scale) + sy), GetPixel(Surface, x, y));
            }
        }
    }
}

#1Servant of the Lord

Posted 28 March 2013 - 03:54 PM

The innards of your for() statement should be ((x * scale) + sx) not (x + sx)

for(int y = 0; y != Surface->h; ++y)
{
    for(int x = 0; x != Surface->w; ++x)
    {
        for(int sy = 0; sy != Scale; ++sy)
        {
            for(int sx = 0; sx != Scale; ++sx)
            {
                PutPixel(tempScaledSurface, ((x * scale) + sx), ((y * scale) + sy), GetPixel(Surface, x, y));
            }
        }
    }
}

Otherwise, you're overwriting most of your pixels multiple times.


PARTNERS