I missed the Monday with a weekly update, didn’t I? Also, most of the rest of the week. Not that I’m really on a tight schedule here, since I guess I have about two regular readers. But it’ a slippery slope, which ends with only writing to this blog two times a year, and I’m hoping to avoid it. So, here’s the latest news.
We’ve made some more progress on UI, and now have a final variant. I’m now waiting for Oleg to create a texture atlas out of it, so I can finally begin programming.
Since there wasn’t much to do on coding front last week, I concentrated on two thing: making Return of Dr Destructo easier to compile and checking out a new feature of Emscripten called Asyncify.
On the subject of CMake, I should say thay even though I like it far, FAR more than plain old unix makefiles or, god forbid, autotools, it’s still sometimes a pain. I know that many people dislike CMake because of its syntax, which leaves a lot of margin for errors, and staggering amount of commands, which make it seem bloated. But so far, I haven’t seen a better alternative. The only real problem I have with it, is that it’s quite hard to add a new generator to support a new type of project, even if it’s based on the old one. There is no scripting or templating, everything is in code.
On the bright side, CMake already support a great number of different project types. There is even a generator for NVidia NSight Tegra projects, which allows Android development in Visual Studio. I’m awaiting that one eagerly. The other Visual Studio-based generator, unfortunately, isn’t there: the one for Emscripten’s vs-tool. But I think that vs-android (on which NSight is based) and vs-tool should be similar enough that one should be add support for vs-tool based on changes made for vs-android.
So, anyway, I now have a CMake project for Return of Dr. Destructo. I have already used it to create a Visual Studio project and Linux makefile, which means I now (again) have Linux build! For some challenge, I used old CentOS 5 on VirtualBox to build it, and I’m hoping to make it possible to run pre-built binaries of my game to run on most modern Linux distributions. I’m not there yet, so there will be more reports on this theme.
So, I switched to ‘master’ branch of Emscripten’s git, and tried the latest compiler. I was able to compile a simple test without any problems, and it worked just as expected! It was nice to see a simple looped Hello World running without any need for emscripten_set_main_loop. However, when I tried to compile Allegro’s skater game with the same arguments, the compiler simply crashed. Since then, I’ve tried this and that, but nothing helped. On Emscripten’s mailing list, it was discovered that such crash happens and an Asyncified functio is called from try/catch block. However, both Skater and Allegro itself are a strictly C code, without any exceptions. Still, I’m now waiting for a fix to this bug to be merged into ‘master’. Maybe my problem would go away then. However, if it won’t, then I’m in troubles, because I’ll need to provide a simplified example of code on which compiler crashes, but the problem seems to be with Allegro library. Compiler crashes whenever I link it. And I can see no way to simplify THAT.