Thread: [sdljava-users] Small patch to SDLVideo.mapRGBA
Status: Beta
Brought to you by:
ivan_ganza
From: Flavio C. <fl...@li...> - 2005-01-24 09:42:27
|
Hi, the mapRGBA method switch the green and blue component (the mapRGB method works well). While the right order should be RGBA, the native method is called with RBGA. This little patch fixes the problem (I took the file from cvs on the 21st of this month): 457c457 < return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), (short)r, (short)g, (short)b, (short)a); --- > return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), (short)r, (short)b, (short)g, (short)a); Thanks for the excellent work, Flavio -- Flavio Chierichetti http://lightless.org/ |
From: Ivan Z. G. <iva...@ya...> - 2005-01-25 02:18:34
|
Thanks for the patch. I've applied it to SDLVideo and CVS has been updated. Glad to be of service ;-) -Ivan/ Flavio Chierichetti wrote: >Hi, > the mapRGBA method switch the green and blue component (the mapRGB >method works well). While the right order should be RGBA, the native >method is called with RBGA. > >This little patch fixes the problem (I took the file from cvs on the >21st of this month): > >457c457 >< return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), >(short)r, (short)g, (short)b, (short)a); >--- > > >> return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), >> >> >(short)r, (short)b, (short)g, (short)a); > > >Thanks for the excellent work, > Flavio > > > |
From: LEBOEUF B. <bar...@ya...> - 2005-01-25 20:09:18
|
Hi, Here a patch for SDLVideo native code correcting init of jobject variable, because the compilation failed with VisualC. If someone has trouble with it, let me know it. /Bart. |
From: Ivan Z. G. <iva...@ya...> - 2005-01-26 02:29:02
|
Nice! Thanks for the patch. We now have Direct NIO access to the pixel data. This is pretty damn fast!! The only problem appears to be that I tried to create the variable like I was in java -- I wish there would have been a compilier error... BTW: When sending patches for the native code the patch for the .i is enough. You don't need to send the patch info for the C file as it is always regenerated by swig... Commiting this to CVS as well as updated testcase: SDLDirectBufferPixelDataTest Thanks again, -Ivan/ LEBOEUF Bart wrote: >Hi, > > Here a patch for SDLVideo native code correcting init of jobject >variable, because the compilation failed with VisualC. If someone has >trouble with it, let me know it. > >/Bart. > > |
From: Flavio C. <fl...@li...> - 2005-01-25 08:36:19
|
On Mon, 2005-01-24 at 10:42 +0100, Flavio Chierichetti wrote: > Hi, > the mapRGBA method switch the green and blue component (the mapRGB > method works well). While the right order should be RGBA, the native > method is called with RBGA. > > This little patch fixes the problem (I took the file from cvs on the > 21st of this month): > > 457c457 > < return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), > (short)r, (short)g, (short)b, (short)a); > --- > > return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), > (short)r, (short)b, (short)g, (short)a); The same problem can be found in SDLSurface.java : 939c939 < return SDLVideo.mapRGBA(getFormat(), r, b, g, a); --- > return SDLVideo.mapRGBA(getFormat(), r, g, b, a); Ciao! Flavio P.S.: I've made the previous patch the wrong way around *blush*. I hope this one is good ;) -- Flavio Chierichetti http://lightless.org/ |
From: Ivan Z. G. <iva...@ya...> - 2005-01-26 02:43:15
|
No worries. I see to have applied it correctly anyhow. It was so small I typed it in. I have also applied to fix to SDLSurface at this time. CVS on sourceforge is slugish right now but it will be checked in next time I can access the repository. Thanks for finding these! -Ivan/ Flavio Chierichetti wrote: >On Mon, 2005-01-24 at 10:42 +0100, Flavio Chierichetti wrote: > > >>Hi, >> the mapRGBA method switch the green and blue component (the mapRGB >>method works well). While the right order should be RGBA, the native >>method is called with RBGA. >> >>This little patch fixes the problem (I took the file from cvs on the >>21st of this month): >> >>457c457 >>< return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), >>(short)r, (short)g, (short)b, (short)a); >>--- >> >> >>> return SWIG_SDLVideo.SDL_MapRGBA(format.getSwigPixelFormat(), >>> >>> >>(short)r, (short)b, (short)g, (short)a); >> >> > >The same problem can be found in SDLSurface.java : > >939c939 >< return SDLVideo.mapRGBA(getFormat(), r, b, g, a); >--- > > >> return SDLVideo.mapRGBA(getFormat(), r, g, b, a); >> >> > > >Ciao! > Flavio > >P.S.: I've made the previous patch the wrong way around *blush*. I hope >this one is good ;) > > > |