Thread: [sdljava-users] (no subject)
Status: Beta
Brought to you by:
ivan_ganza
From: Thomas B. <19...@gm...> - 2007-05-23 09:05:25
|
Hi @all! My name is Thomas, I'm a german software engeneer and I've got a problem with sdljava.I didn't get solved by extensively searching the web. Question: Why is it not allowed to blit a surface onto another (surface.blitsurface(SrcRect,screen,DestRect)by giving the rectangle negative values. For example: my Position on the main-surface where to blit is DestRect.x=-200; DestRect.y=-10; DestRect.w=100;DestRect.h=100 I read in the sdljava-doc that if the blitting succeeds the blitted coordinates are written back to the DestRect. When I do the blit, my DestRect.x is at -200 so I would think that the blitting was done without any errors - but the blitting was done on (0|0) - no matter what negative values I choose...it's erverytime on (0|0) This blitting with negative values is very important for scrolling and is no problem in the c++ binding or the sdl.net binding..so is there a cause to do so? Or is it a bug (and if so.. will it be fixed) Greetings to all of you, Thomas -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser |
From: Andrew.du <yi...@gm...> - 2007-08-08 22:55:13
|
From: Andrew.du <yi...@gm...> - 2007-08-08 23:03:28
|
From: Samuel S. <sam...@ya...> - 2012-04-03 01:57:34
|
<a href="http://simonahm.dk/wp-content/plugins/extended-comment-options/02efpk.html"> http://simonahm.dk/wp-content/plugins/extended-comment-options/02efpk.html</a> |
From: Samuel S. <sam...@ya...> - 2012-04-04 05:05:09
|
<a href="http://d3.hgyifu.com/blog.old/wp-content/plugins/extended-comment-options/jrklre.html"> http://d3.hgyifu.com/blog.old/wp-content/plugins/extended-comment-options/jrklre.html</a> |
From: Samuel S. <sam...@ya...> - 2012-04-05 02:45:25
|
<a href="http://bellais.com/download/assets/smarty/templates_c/fjgvkd.html"> http://bellais.com/download/assets/smarty/templates_c/fjgvkd.html</a> |
From: Samuel S. <sam...@ya...> - 2012-04-06 13:36:18
|
<a href="http://spartan5.com/images/CampJune09/115_0616/rmngl.html"> http://spartan5.com/images/CampJune09/115_0616/rmngl.html</a> |
From: Samuel S. <sam...@ya...> - 2012-12-13 03:27:45
|
http://socialsmokesignals.com/wp-content/plugins/akismet/google.html |
From: C W <wa...@ya...> - 2013-01-15 11:50:37
|
http://timucinrezidanstalas.com/images/maincl.php ! |
From: Ivan Z. G. <iva...@ya...> - 2007-05-27 22:44:03
|
Hi Thomas, I see the problem. The culprit is the code in SDLSurface.java: public int blitSurface(SDLRect src, SDLSurface dstSurface, SDLRect dst) throws SDLException { if(src == null) { src = new SDLRect(0, 0, getWidth(), getHeight()); } if (dst == null) { dst = new SDLRect(0, 0, -1, -1); } return SWIG_SDLVideo.SWIG_SDL_BlitSurface_FAST(swigSurface, src.getX(), src.getY(), src.getWidth(), src.getHeight(), dstSurface.getSwigSurface(), dst.getX(), dst.getY(), dst.getWidth(), dst.getHeight() ); } As you can see in the code I'm unwrapping the Rect, for speed, and only passing the values -- after the call there is only a status of the blit returned so SDLJava has no knowledge about updating the positions in the rect that you passed in the call. Hrrmmm....I have to admit I did not consider your scenerio. However I do think we need to support it. If the original SDL works that way, we should be doing the same thing in the java world. Its not clear to me how this can be done while still being fast. If we want to update the rect passed intot the java call, the rect has to be passed to the C code, _by value_, and then it will be updated in C and passed back again to java by value once again. This won't be very efficient. I could be wrong but right now I am fairly sure it will all by pass by value in this case. If I can figure out a way to fix this and still be efficient I will get the code in within a week or two. Not sure if you have the time but feel free to dig into the code if you wish....I'm happy to accept contributions. Cheers, -Ivan/ Thomas Beck wrote: >Hi @all! > >My name is Thomas, I'm a german software engeneer and I've got a problem with sdljava.I didn't get solved by extensively searching the web. > >Question: >Why is it not allowed to blit a surface onto another (surface.blitsurface(SrcRect,screen,DestRect)by giving the rectangle negative values. For example: my Position on the main-surface where to blit is DestRect.x=-200; DestRect.y=-10; DestRect.w=100;DestRect.h=100 > >I read in the sdljava-doc that if the blitting succeeds the blitted coordinates are written back to the DestRect. When I do the blit, my DestRect.x is at -200 so I would think that the blitting was done without any errors - but the blitting was done on (0|0) - no matter what negative values I choose...it's erverytime on (0|0) > >This blitting with negative values is very important for scrolling and is no problem in the c++ binding or the sdl.net binding..so is there a cause to do so? Or is it a bug (and if so.. will it be fixed) > >Greetings to all of you, Thomas > > |