For its age and complexity, Sphere's code is easy to read.
if (!m_Engine->IsScriptBeingUsed(m_DefaultMapScripts[which])) { std::string error; if (!ExecuteScript(m_DefaultMapScripts[which], error)) { m_ErrorMessage = "Could not execute default " + list[which] + " map script\n" + error; return false; } }
Nonetheless, some of the algorithms used in it are pretty dumb, like reading strings from a file one character at a time or similar nonsense.
It also violates DRY a lot. This, for example, happens way too often:Code: (cpp) [Select] if (!m_Engine->IsScriptBeingUsed(m_DefaultMapScripts[which])) { std::string error; if (!ExecuteScript(m_DefaultMapScripts[which], error)) { m_ErrorMessage = "Could not execute default " + list[which] + " map script\n" + error; return false; } }In minisphere, that functionality is centralized in script.c, so from outside all you see is run_script(s_update_script, false);, which makes the intent much clearer and cuts down on the boilerplate.
There is no sound with Audiere anymore, since OSS doesn't really exist on Linux anymore. But other than that it works fine.
fbnil@tortuga:~/JUMP/minisphere/minisphere$ gcc -o obj/animation.o -c obj/animation.cIn file included from /usr/include/allegro5/internal/alconfig.h:57:0, from /usr/include/allegro5/base.h:50, from /usr/include/allegro5/allegro.h:26, from obj/minisphere.h:23, from obj/animation.c:1:/usr/include/allegro5/platform/alucfg.h:53:2: error: #error Unix Allegro now REQUIRES pthreads #error Unix Allegro now REQUIRES pthreads ^
git clone git://git.code.sf.net/p/alleg/allegrocd allegrogit checkout 5.1.3
galileo.c:(.text+0x70a): undefined reference to `al_destroy_vertex_buffer'