Have simplified the parsing of the COMPUTAN.TXT file prior to looking at
supporting the Polish file format variant.
These change should have no functional difference, but improve the code
by removing a set-but-unused bool in the MenuItem structure, fixing a
number of repeated "magic" values to be explicit as various buffer sizes
and replacing usage of strcpy with the safer version from our Common
code etc.
This previously crashed on the Polish version due to a variant file
format causing the parsing to make several invalid memory accesses.
This prevents this crash and any other in future, though it does not
fix the parsing of the variant file format.
This shouldn't be a problem, as current client code either must find a
terminator when parsing the byte buffer or have preknowledge of the
buffer size from a file size or fixed call, so the appended null
termination will not cause issues. This change thus allows client code
to add sanity checks to prevent reading off the end of the buffer.
The SoundManager filled the sound handles with zeroes, which made
the mixer confuse them with active sound handle zero. In my case,
this happened to be the intro music, and the music was stopped when
playWavSample() wrongly thought its sound handle was in use.
Each engine now only has to provide a single configure.engine file
adding the engine into the configure script, which then produces the
required other files automatically.
This is the third and final commit enabling fully pluggable engines.
Now providing an engine folder contains a configure.engine, engine.mk
and engine-plugin.h file, it will be picked up automatically by the
configure script.
This is the second part of allowing engines to be added dynamically.
Each folder in engines/ which must contain a file named "engine.mk"
containing the make definitions for that engine.
This is the first part of allowing engines to be added dynamically.
They are placed into a folder in engines/ which must contain a file
named "configure.engine" to add the engine, which is pulled into the
top level configure script automatically.
This renames HopkinsEngine::targetName to HopkinsEngine::getTargetName. This
is more consistent with the name scheme of the remaining getters.
It also makes getTargetName return a const reference instead of a copy.