[SDL] RotoZoom is great, but...

SlntHero at aol.com SlntHero at aol.com
Sat Sep 2 09:39:49 PDT 2006


MORE INFORMATION FROM TESTING:
 
game crashes ONLY when the new RotoZoomed BMP is NOT completely on  screen
(ie: entire BMP does not fit completely in SDL screen w,h)
 
 
any thoughts ?
 
 
 
void Visuals::DisplayBMPonScreenBufferRotoZoom(Sint8 spriteNumber, Sint16  
xScreenPos, Sint16 yScreenPos, double angle, double zoom)
{
SDL_Rect  destinationRectangle;
 
 destinationRectangle.x = xScreenPos;
destinationRectangle.y  = yScreenPos;
 
 SDL_Surface *temp = SpriteBMP[spriteNumber];
SDL_Surface  *temp2 = rotozoomSurface(temp, angle, zoom, 0);
 
 temp->clip_rect.x = 0;
temp->clip_rect.y =  0;
temp->clip_rect.w = 640;
temp->clip_rect.h =  480;

temp2->clip_rect.x =  0;
temp2->clip_rect.y = 0;
temp2->clip_rect.w =  640;
temp2->clip_rect.h = 480;
 
 destinationRectangle.w = temp2->w;
destinationRectangle.h  = temp2->h;
 
 destinationRectangle.x -= (temp2->w /  2);
destinationRectangle.y -= (temp2->h / 2);
 
 SDL_BlitSurface(temp2, NULL, Screen,  &destinationRectangle);
 
// SDL_FreeSurface(temp);
// SDL_FreeSurface(temp2);
 
 
 
JeZ+Lee
_SLNTHERO at AOL.com_ (mailto:SLNTHERO at AOL.com) 
_www.SilentHeroProductions.com_ (http://www.SilentHeroProductions.com) 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060902/6f9f226b/attachment-0008.htm>


More information about the SDL mailing list