My scaling algorithm

Here it is - can you make it better?
(no floats, everything is int, surface is 8bit, w and h are shifted <<16, start
points on MainScreen->pixels)

dx=w/MainScreen->w;
dy=h/MainScreen->h;

y=0;
for (j=0;jh;j++)
{
x=0;
pos=start;
for (i=0;iw;i++)
{
c=screen[w*(y>>16)+(x>>16)];
*pos=c;
x=x+dx;
pos=pos+1;
}
start=start+MainScreen->pitch;
y=y+dy;
}–
Same story, different eyes
Here’s where the hero never, never dies

                                      "Hollywood Black" - Ronnie James Dio
  • Jacek Pop?awski on Wed, Nov 14, 2001:

Here it is - can you make it better?
(no floats, everything is int, surface is 8bit, w and h are shifted <<16, start
points on MainScreen->pixels)

C’mon Jacek - I don’t think anyone has a problem helping you solve
SDL-related issues, but when you post clearly off-topic nonsense then it
does become a problem. The SDL mailing list is for SDL issues only, and
the question above nor the code you posted fits the topic.

Please, use google to search for “scaling algo”, “how to scale” or
whatever, or find other SDL projects that implement scaling (that’s how I
found a image rotation algorithm, using Google led me to Phorus). But if
it’s not about SDL, please take it elsewhere.

Thanks,

M. R.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20011114/a4f25699/attachment.pgp