[sdljava-users] fatal bug in SWIG_SDL_BlitSurface_FAST
Status: Beta
Brought to you by:
ivan_ganza
From: MJS <mj...@ir...> - 2005-12-11 22:57:56
|
I've started using sdljava a few days ago. First i used the last release, but the lack of a working SDLEventManager leaded me to using the cvs version. however, little did I suspect, what other dangers are lurking there... Seems like the fix from this thread: http://sourceforge.net/mailarchive/forum.php?thread_id=6850242&forum_id=43388 wasn't put in the cvs the way it was meant. Setting x/y of the src and dst rects always to 0 is even worse than ignoring negative values. Result of cvs diff -u: cvs diff: Diffing . Index: SDLVideo.i =================================================================== RCS file: /cvsroot/sdljava/sdljava/src/sdljava/native/SDLVideo.i,v retrieving revision 1.30 diff -u -r1.30 SDLVideo.i --- SDLVideo.i 19 Jul 2005 22:33:09 -0000 1.30 +++ SDLVideo.i 11 Dec 2005 22:53:41 -0000 @@ -33,13 +33,13 @@ // during the blit! This means only one thread should be doing the blits! 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 = 0; - srcBlitRect.y = 0; + srcBlitRect.x = sX; + srcBlitRect.y = sY; srcBlitRect.w = (sWidth > -1 ? sWidth : 0); srcBlitRect.h = (sHeight > -1 ? sHeight : 0); - dstBlitRect.x = 0; - dstBlitRect.y = 0; + dstBlitRect.x = dX; + dstBlitRect.y = dY; dstBlitRect.w = (dWidth > -1 ? dWidth : 0); dstBlitRect.h = (dHeight > -1 ? dHeight: 0); Index: SDLVideo_wrap.c =================================================================== RCS file: /cvsroot/sdljava/sdljava/src/sdljava/native/SDLVideo_wrap.c,v retrieving revision 1.22 diff -u -r1.22 SDLVideo_wrap.c --- SDLVideo_wrap.c 19 Jul 2005 22:33:09 -0000 1.22 +++ SDLVideo_wrap.c 11 Dec 2005 22:53:48 -0000 @@ -99,13 +99,13 @@ // during the blit! This means only one thread should be doing the blits! 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 = 0; - srcBlitRect.y = 0; - srcBlitRect.w = (sWidth > -1 ? sWidth : 0); + srcBlitRect.x = sX; + srcBlitRect.y = sY; + srcBlitRect.w = sWidth > -1 ? sWidth : 0); srcBlitRect.h = (sHeight > -1 ? sHeight : 0); - dstBlitRect.x = 0; - dstBlitRect.y = 0; + dstBlitRect.x = dX; + dstBlitRect.y = dY; dstBlitRect.w = (dWidth > -1 ? dWidth : 0); dstBlitRect.h = (dHeight > -1 ? dHeight: 0); -- mjs |