[sdljava-users] Aaaaaaargh...
Status: Beta
Brought to you by:
ivan_ganza
From: Rainer K. <ar...@gm...> - 2005-03-21 05:16:53
|
I've been checking my code over and over again for a bug (or rather undocumented feature?) which is actually in the native binding :/ This costed me hours and hours. Why isn't this documented? SDLBlitSurface doesn't behave as it should due to those changes below. int SWIG_SDL_BlitSurface_FAST(SDL_Surface * src, int sX, int sY, int sWidth, int sHeight, SDL_Surface *dst, int dX, int dY, int dWidth, int dHeight) { srcBlitRect.x = (sX > -1 ? sX : 0); srcBlitRect.y = (sY > -1 ? sY : 0); srcBlitRect.w = (sWidth > -1 ? sWidth : 0); srcBlitRect.h = (sHeight > -1 ? sHeight : 0); dstBlitRect.x = (dX > -1 ? dX : 0); dstBlitRect.y = (dY > -1 ? dY : 0); dstBlitRect.w = (dWidth > -1 ? dWidth : 0); dstBlitRect.h = (dHeight > -1 ? dHeight: 0); return SDL_BlitSurface(src, &srcBlitRect, dst, &dstBlitRect); } Positions _CAN_ be negative. Otherwise how are you supposed to move a sprite or image outside of the screen if it is nailed to position 0? srcBlitRect.x = sX; srcBlitRect.y = sY; srcBlitRect.w = (sWidth > -1 ? sWidth : 0); srcBlitRect.h = (sHeight > -1 ? sHeight : 0); dstBlitRect.x = dX; dstBlitRect.y = dY; dstBlitRect.w = (dWidth > -1 ? dWidth : 0); dstBlitRect.h = (dHeight > -1 ? dHeight: 0); Rainer |