Thread: [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 |
From: Ivan Z. G. <iva...@ya...> - 2005-12-13 04:03:50
|
Sorry about this! I've applied the fix in CVS. Let me know if you have any more problems. -Ivan/ MJS wrote: >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 > > >------------------------------------------------------- >This SF.net email is sponsored by: Splunk Inc. Do you grep through log files >for problems? Stop! Download the new AJAX search engine that makes >searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! >http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click >_______________________________________________ >sdljava-users mailing list >sdl...@li... >https://lists.sourceforge.net/lists/listinfo/sdljava-users > > |