Dragging Gunroar into 2014
Ben Boeckel
mathstuf+dlang at gmail.com
Mon Mar 24 11:35:46 PDT 2014
[ Originally posted to Reddit:
<https://pay.reddit.com/r/d_language/comments/217fas/dragging_gunroar_into_2014/>.
]
I got an itch recently and started to port my favorite game from
ABA Games[1] to 2014: gunroar[1]. Currently, it has been ported
to using Derelict3 rather than Kenta Cho's manual wrapping of SDL
and OpenGL. It now uses SDL2 and D2 rather than the (apparently)
very ancient dialect of D it used back in 2005.
When first starting out, the first problem was getting the code
to build. I'm a CMake guy, and after looking around, I
was…unsatisfied with the D support files I found (for various
reasons). They all seemed to copy the C++ support files too
closely which seemed unnecessary since dmd, ldc, and gdc are much
closer to each other than many of the C++ compilers. They also
all seem to have come from the scream make era when commands were
in all caps, copied things around without realizing what they're
there for (e.g., CMakeCompilerId.d.in is copied by most of them,
but used by none and CMakeDCompilerABI.d is useless since what
CMake looks for (compiled-in strings) isn't in the file), and
were missing support for things like DEPFILE and such for proper
dependency resolution. In this process, two patches were made
that should help: one for Ninja[3] if LDC is used and one for
CMake[4] so that you get proper recompilation when files change
(other generators are not supported yet since I don't think
anything else reads the -deps file format of LDC; GDC will work
as-is since it's GCC-compatible here). Even without these
patches, one-off builds will be correct, but incremental builds
are not guaranteed.
After that was the fun of getting LDC to actually accept the
code. Luckily its errors are helpful even for initiates to D (the
only other time I've done things with D is poking the source of
various ABA Games years ago also trying to get them to compile on
Linux with mixed results). Other than issues with replacing the
deprecated glu* function usages, (most) things work on my machine
(Fedora x86_64). I'd be interested to know how things work on
other platforms and setups.
Ultimately, I'd like to get some of these games on my tablet, so
Android support is on the table (though help would be
appreciated!). I've opened some issues for things on the
repository already.
(The other ABA Games I'm interested in are Mu-cade and Torus
Troopers, so those are on my list as well.)
[1]http://www.asahi-net.or.jp/~cs8k-cyu/games/index.html#windows
[2]https://github.com/mathstuf/abagames-gunroar
[3]https://github.com/martine/ninja/pull/721
[4]https://github.com/mathstuf/CMake/commit/9523d2a55c99fb0910531ae7160b099faeab6638
More information about the Digitalmars-d-announce
mailing list