This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
The idea here is that if two voices are generating the same tone,
the square wave generator should be in sync so that the wave forms
amplify each other, rather than cancelling each other out.
In AGI games, the numeric keypad is used as an alias for cursor keys to
allow stationary and 8 directional input, but while the predictive
dialog is open, this is more sensibly mapped to numeric input to
allow use of the predictive input on desktop ports.
This fixes a leak in PreAGI games (which never deleted their
RandomSource), ensures that PreAGI's RandomSource has a name (and hence
is registered with the event recorder) and even slightly simplifies the
AgiEngine destructor.
This also removes the dependency of engines on the event recorder header
and API, and will make it easier to RandomSources that are not properly
registered.
This unifies the engine names in MetaEngine::getName() and the
credits. In particular drop "Engine" or "engine" from the names when
it was present and use expanded names in credits when the
MetaEngine uses it (e.g. "Beneath a Steel Sky" instead of "BASS").
Right now, a few places in the frontend code still use printf and
consorts. We mark the affected files with a FIXME for now, and
add a dedicated exception for each. To be fixed!
Also tweak FORBIDDEN_SYMBOL_REPLACEMENT to hopefully really always
enforce a compiler error
MKID_BE relied on unspecified behavior of the C++ compiler,
and as such was always a bit unsafe. The new MKTAG macro
is slightly less elegant, but does no longer depend on the
behavior of the compiler.
Inspired by FFmpeg, which has an almost identical macro.
Make the player be centered on a fixed number of "generators" instead of
MIDI channels that arbitrarily allocate generators for notes.
Make the audio stream to be stereo and for sample rate use _sampleRate.
Rewrite the synthesis core:
* Make generators use both oscillators
* Implement swap mode for oscillators
* Fix envelope update frequency
This also should fix some regressions from the previous
commits, related to MidiParser's either being leaked,
or being deleted and then used again (i.e., crashing).
I tested as many games as I had available, but further
testing of all affected engines is called for anyway.