Closed ashes999 closed 11 years ago
Thanks for the code, I meant to do it myself but I had totally forgotten it.
Glad to be able to help. This is a fantastic project and I wish I could do more.
I've just realised that I might have merge this pull request without thinking too much about the code changes. Why would you require ruboto/util/toast if RUBY_PLATFORM is not java? Since Gosu is originaly written in C++ it will never be interoperable with gosu_android, gosu_android is in fact a reimplementation of Gosu from top to bottom, not an extension.
=~
means "regex match." So RUBY_VERSION =~ /java/
means "if the RUBY_VERSION value matches the regex java
, then include the ruboto toast.
Anyway, you're right that it's nonsensical; I have this change in my proof-of-concept code, and this was required to make it run. I'll check and see if I can remove it, because I should be including gosu
instead on non-Java platforms.
Also, how is this a complete reimplementation? I thought you just rewrote some parts in Java, not necessarily the entire framework.
If you don't mind I'll just correct and commit instead of reversing the pull request. About the code, as I said Gosu is almost entirely written in c++ and uses swig so it can be called from ruby. So what I've done is translate to java/ruby the logic and then use the android api to mimic the behaviour of events, drawing and sound. Of course since Gosu is such a large engine I've simplified many modules.
Fascinating. An interesting (but hard) alternative would be to make it run with mruby instead. But mruby has its own challenges (like no require
functionality, and lots of standard ruby functionality as gems instead of core Ruby) so you probably picked the fastest/easiest of the (many, hard) possibilities...
Sure, go ahead and reverse the change. I'll verify tonight and let you know how it plays out on my end.
Confirmed: this is not needed.