Open hex007 opened 6 years ago
@nikita36078 This also affects your application.
@hex007 Buffer clearing fixes this issue in J2ME Loader, but it also makes menus invisible(gameplay looks ok), so another solution is needed.
@nikita36078 I think this might be a clipping issue. The previous graphics are not being cleared.
Where are you clearing the buffer to get the partial result. Could you paste some code?
Was able to achieve this by commenting gc.setClip(int, int, int, int);
and drawing a rectangular boundary over the clip area. Including gc.setClip causes the problem
@recompileorg @nikita36078 any insights ?
I'd guess that there is some difference between setClip on j2se vs j2me.
Tower Blocks doesn't seem to run at all on the AWT build on Windows. I can't reproduce the problem there.
I tried it on Kemulator just to test and It works as expected.
EDIT: The AWT build on linux works but persons and clouds are not rendered. On the next screen the grid and buildings are not shown.
@recompileorg Are we using double buffering? @nikita36078 Suggests that might help solve this issue.
Yes, though I don't see why that would make a difference here.
Tower Blocks doesn't seem to run at all on the AWT build on Windows. I can't reproduce the problem there.
Did you try the SDL build?
No, nor did I try the libretro build. Though the differences reported here, and some other oddities I've seen, lead me to believe there is an incompatibility between java implementations that is leading to the difference in behavior as the front end shouldn't have any effect on those issues.
It might not be a good idea to rely on graphics2d clipping, and instead handle it in other ways, like rendering to a temporary area and copying the area inside the clipping region over.
Can you compare between Oracle JDK and openJDK on Windows?
Technically both frames should look the same but they dont. The binaries are from the same build on the same system using freej2me-sdl.jar and freej2me.jar respectively.
On Linux (Fedora x64 Open/JDK) SDL frame is different than AWT frame at the same instance of the game; Tower Bloxx > Build City
SDL Screenshot
Awt screenshot
That is curious, as the exact same data is being sent to the AWT UI as the SDL UI.
I checked KEmulator code, it uses Graphics2D methods for clipping and as we can see, it works properly.
@nikita36078 Where did you get Kemulator source from?
I decompiled it with Bytecode Viewer, KEmulator isnt open source unfortunately
@recompileorg Are you able to reproduce this?
@nikita36078 Smali code?
@hex007 No, Bytecode Viewer can generate Java pseudocode and it is readable enough.
@nikita36078 Do you use Windows or Linux? Can you try comparing SDL interfave vs awt
@hex007 I use Windows, and TowerBloxx stucks at game logo, I dont know why.
Game : TowerBloxx
Graphics are torn as shown below.