This looks like a pretty major change, but in reality,
80% of it is just renames of types and corresponding
methods.
The config parsing code has been completely replaced
with a boost::program_options based version. This
means that the config file format slightly changed
(checkout the updated README).
I still expect there to be bugs / unforseen events.
Those should be fixed in follow up commits.
Also, finally reverted back to using pkg-config to
locate and link libruby. Yay for less hacks!
With this we now link to libvorbis/ogg directly.
When this is enabled, one can theoretically also
build SDL_sound without ogg support, although I
doubt it makes much of a difference.
Adittionally, count frames instead of samples
for playback offset calculation.
This is a major change in the Audio module that comes with
many changes throughout the codebase and dependency list.
The main gist is that we're finally nuking the last pieces
of SFML from the project. sfml-audio brought with itself
unneeded and big dependencies (libsndfile, libvorbisenc)
while at the same time limiting the amount of audio formats
mkxp can support (eg. we now get mp3 for free, and wma/midi
can be implemented by extending SDL_sound directly).
The increased control gained by interfacing with OpenAL directly
will also allow for easy integration of a dedicated audio
stretcher (librubberband), as well as enable us to implement
looped ogg vorbis (via the 'LOOPSTART'/'LOOPLENGTH' tags),
as required by RGSS2, in the future.
The FileSystem class has had its SFML parts removed.
Aditionally, audio file extensions to be supplemented are
now automatically detected based on how SDL_sound was
built (ie. if no mp3 support was built, mkxp won't try
to look for *.mp3 files). The final used extension
can be optionally returned by 'openRead' calls so
SDL_sound and SDL2_image can immediately choose the
right decoder.
The OpenAL context is created and destroyed in main.cpp
along side the GL context.
This implementation is also heaps better than the old
one as it doesn't use a (differently sized) aux texture,
meaning the Bitmap discards its old texture and aquires
one of same size, making reuse through the TexPool a
lot more likely. It also saves on the aux texture blits
and binding switches.
As the setup / resource acquisition far outweighs the
actual rendering cost, operation time is relatively
constant no matter how many divisions are used.
This should make graphics.cpp somewhat easier to navigate/read.
GL_EXT_timer_query is also made optional, and if it's not present
dummy functions will be called instead.
The 'tainted' area of a Bitmap describes what parts are no
longer in a 'cleared' state. When we blit to a fully cleared
are of a Bitmap at full opacity, we can completely disregard
the existing pixels in the operation, meaning we can skip any
blending calculations and just blit / upload straight to the
texture. This greatly speeds up text message rendering.
In the process, pixman has become a new dependency for mkxp,
but the results of this optimization are well worth it!
The atlas packing algorithm has been reworked to pack autotiles
and tileset very efficiently into a texture, splitting the tileset
in multiple ways and eliminating the previous duplication of image
data in the atlas across "frames". Animation, which these frames
were designed for, is now done via duplicated buffer frames,
ie. each animation frame has its own VBO and IBO data. This was
not done to save on VRAM (hardly less memory is used), but to
make place for the new atlas layout.
Thanks to this new layout, even with a max texture size of 2048,
one can use tilesets with up to 15000 height. Of course, such
a tileset couldn't be stored in a regular Bitmap to begin with,
which is why I also introduced a hack called "mega surfaces":
software surfaces stored in RAM and wrapped inside a Bitmap,
whose sole purpose is to be passed to a Tilemap as tilesets.
Various other minor changes and fixes are included.