Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Ruby tutorial game.rb:41:in `initialize': Unknown error (Run
- - By jumpingcloud Date 2013-07-14 18:52
Hey,

I'm trying to get the Gosu tutorial working and I'm getting this error:
game.rb:41:in initialize': Unknown error (RuntimeError)
  from game.rb:41:in
new'
  from game.rb:41:in initialize'
  from game.rb:10:in
new'
  from game.rb:10:in initialize'
  from game.rb:79:in
new'
  from game.rb:79:in `<main>'

I threw the project up on GitHub
https://github.com/jumpingcloud/gosu-tutorial

Here's a direct link to my code:
https://github.com/jumpingcloud/gosu-tutorial/blob/master/game.rb

Any ideas?
Parent - - By jumpingcloud Date 2013-07-14 19:06
Okay!   Awesome,

I figured it out!

I made the graphics in Gimp, and when you "Export..." to make the .bmp
you need to check the box in "Compatibility Options" to
"Do no write color space information"

Now, I'm -oh- so happy!
Parent - - By jlnr (dev) Date 2013-07-14 19:39
BMP files support colour space information?!?! Wikipedia says yes :) Can you please upload a "broken" file so I can take a look at it? Anyway, glad that you've figured it out!
Attachment: Starfighter.bmp - Weird broken BMP (5k)
Parent - - By jumpingcloud Date 2013-07-14 21:46
Here, is the broken bmp.  Apparently it's -not- the Color space info that's breaking it.  I've started just using Png's because I can't figure the BMP thing out.
Parent - By jlnr (dev) Date 2013-07-15 16:30
All the system libraries on OS X can display the file just fine, … if you meant to draw a dark green thing on a brown background ;)

For reference, it seems to use a BITMAPV4HEADER (introduced in Windows 95), whereas the rest of the world seems to be stuck with BITMAPINFOHEADER (introduced in Windows 3).
Parent - - By Spooner Date 2013-07-15 10:00
Just use PNGs instead of BMPs. They are much smaller and still lossless (and, unlike BMPs, I've never heard of them not being loaded by Gosu).
Parent - By jlnr (dev) Date 2013-07-15 16:27
I could tell you plenty of anecdotes about broken PNG files, but I think all of these were caused by libpng's terrible design. Not to mention the horrors of PNG files in which transparent pixels have the wrong colour value, which then bleed into other pixels when rotated. :)

It's curious that most bug reports mention The GIMP though. It seems to be a good stress-test for every image loading library!
Up Topic Gosu / Gosu Exchange / Ruby tutorial game.rb:41:in `initialize': Unknown error (Run

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill