Maescool / Catacomb-Snatch

Mojang's Humble bundle source
Other
295 stars 99 forks source link

Update src/com/mojang/mojam/MojamComponent.java #879

Closed joeyismusic closed 12 years ago

joeyismusic commented 12 years ago

This speeds up Java2D by silently converting all image operations to OpenGL calls. The Java2D buffer strategy cannot be used with OpenGL acceleration, so someone would need to write a custom back buffer flipping class.

joeyismusic commented 12 years ago

More information that should be considered: http://docs.oracle.com/javase/7/docs/technotes/guides/2d/flags.html

master-lincoln commented 12 years ago

This slows down the game as hell for me running Linux although I should have OpenGL support.

joeyismusic commented 12 years ago

Perhaps an older JVM? I've heard there are problems with linux as well...

danielduner commented 12 years ago

Is the slowdown a result from not using a proper buffer?

And how does this relate to #858, #870, #872?

joeyismusic commented 12 years ago

This is built-in supported by the JVM, so you don't need native libraries to take advantage of the implementation.

Stuessy commented 12 years ago

Woah! Unplayable on my Linux machine. I got between 1 and 2 FPS. (Ubuntu 10.04 64bit / OpenJDK 1.6.0_20 and Sun Java 1.6.0_26)

master-lincoln commented 12 years ago

Also unplayable under Ubuntu 11.10 64bit Sun/Oracle Java 6 and 7

master-lincoln commented 12 years ago

Could be related: http://stackoverflow.com/questions/196890/java2d-performance-issues

Update Just tested and confirmed. The proposed fix at stackoverflow works. Though framerates are similar and not much increased. Could you integrate the toCompatibleImage in MojamComponent line around line 517

Update 2 Nevermind...I commited it.

KBaluh commented 12 years ago

has bug https://github.com/Maescool/Catacomb-Snatch/issues/881