Le mar 21/09/2004 à 10:47, Kenneth Gangstø a écrit :
> Thanks for the patch. I have no idea about how the SDL target should work,
> so I just have to trust you that it works.

The rotation angle and source size was uncorrect, it's more something
like that : (see attached patch)

TODO :
- Fix rotation hotspot
- Flip function (for negative scale)

> In OpenGL (and any other hardware accelerated platform)
> rotating and scaling is done on the fly. There is no need to cache a  
> rotated surface. In the software world of SDL, you might consider
> doing it otherwise.

Another thing to add in the TODO list :-D

Bye, Haypo
--- surface_sdl.cpp.old	2004-09-21 11:20:33.000000000 +0200
+++ surface_sdl.cpp	2004-09-21 14:06:37.000000000 +0200
@@ -278,11 +278,10 @@
 	else
 	{
 #ifdef HAVE_LIBSDL_GFX
-		source.w = dst.w;
-		source.h = dst.h;
+		SDL_Surface *zoom = rotozoomSurface (surface, -params2->rotate_angle, params2->scale_x, SMOOTHING_ON);
 
-		float angle=params2->rotate_angle*180/M_PI;
-		SDL_Surface *zoom = rotozoomSurface (surface, angle, params2->scale_x, SMOOTHING_ON);
+		source.w = zoom->w;
+		source.h = zoom->h;
 
 		if(zoom->format->BitsPerPixel > 8)
 		{

Répondre à