Strings are embedded in the rows, making them variable length. So we now
deserialize the whole ACX file in ACXLoader.Load and store them such
that they can be indexed by row/col in constant time.
Even though this game is still ain v14, it makes an incompatible change
to the file format: struct definitions now contain a list of functions
at the end (I believe this is a listing of the struct's vtable).
There is now a system for tracking the minor version of the ain file
format. This is a made up value, determined by the file name of the ain
file.
This commit also fixes an issue where the empty string was being added
as a new string to the string table when rebuilding ain files with
ainedit.
SDL_mixer reads loop information from WAV files if you use the Mix_Music
interface, but NOT the Mix_Chunk interface. So bgm now uses the
Mix_Music interface to get proper looping.
There's also some code here for reading bgi files (taken from xsystem35)
but it's not actually used. There doesn't seem to be a simple way to set
up custom loops with SDL_mixer.
Fixes#2.
The problem here was that init_member_functions assumed ASCII or SJIS
encoding of function/struct names in the ain file. Now it will convert
to UTF-8 when analyzing member functions.
This commit also removes the --ain-encoding option to ainedit.
--output-encoding should always match the encoding of the input ain
file. --transcode can be used to change the encoding before running
running further ainedit commands.
struct definitions are now a type of declaration, instead of being part
of a type specifier. They can only be declared at top-level, and
variables can no longer be attached to the declaration.
This is mainly for testing purposes. Defaults to creating an ain v4
file, which is the same version produced by the SDK compiler.
Also various small improvements so that output matches the SDK compiler:
* add "0" function (currently does nothing)
* add "NULL" function
* compile null return at the end of every function
* set main function index in ain file