Maescool / Catacomb-Snatch

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

Fixed problem with Fonts in DownloadScreen. #949

Closed Shephiroth closed 12 years ago

Shephiroth commented 12 years ago

Even if this fix was fast, this is a signal of a worst problems comming: 1- we have 2 static AbstractScreen objects (MojamComponent & MojamStartup). 2- Fonts are instanciated statically. If some class try to use Fonts before MojamComponent.screen is set, NullPointerException will come.

For now, im giving priority to MojamComponent.screen one. MojamStartup will use it if set, or create and set. MojamComponent will overwrite regardless if its set or not.

To avoid exception, an easy solution would be create a static void CreateFonts(AbstractScreen) and call it from *Screen constructors.

I think it is a big matter to do it w/o asking first.

kylecbrodie commented 12 years ago

I'm working on a different graphics abstraction, that will hopefully allow us to move away from screens and bitmaps and towards having both OpenGL (probably slick) and Java2D implementations. Though with the end of the school year I've been pretty busy. I should be able to finish it this weekend.

Maescool commented 12 years ago

ok, so add this temporary?