Gpx2Plus is the graphics library used in Big Bang Age (which predates
SACT2). Fortunately the underlying graphics primitives are mostly in
common with SACT2, so many functions just call gfx counterparts.
This implementation covers all Gpx2Plus functions used in Big Bang Age.
Caveats:
- Gpx2Plus.EffectCopy() does not apply any effect yet.
- Some markup commands for Gpx2Plus.Msg*() are not implemented yet.
xsystem4 can now be run from within a game directory with no arguments.
Alternatively, the game directory can be passed instead of the path to
System40.ini.
If the user-provided font can't be loaded, try to load the default font.
If the default font can't be loaded (e.g. xsystem4 isn't installed), try
to load the default font from the project directory.
MacOS does not support OpenGL compatibility profile, so the following
changes had to be made:
- Replaced deprecated texture2D() with texture() in shaders
- Renamed `texture` uniform variable to `tex`, to avoid name conflict
- Use VAO, which is mandatory in OpenGL 3 core profile
These functions should NEVER return a pointer into the ain object, since
its storage can be realloc'd. Now all get/add functions return an index
which can safely be stored for later use.
Stack traces now list addresses in addition to function names.
Additionally, debugger stack traces number each frame, and the numbers
can be used together with the PRINT-LOCALS function to print the values
of local variables for any frame on the stack.
This is implemented by inserting special opcodes into the game's code.
When the breakpoint handler is finished, it returns the original opcode
so that execute_instruction can continue executing normally.
E.g.
* start xsystem4 with --debug option to drop into debugger immediately
* run (bp "game_main")
* ^d or \exit to close debugger REPL
* ...drop into a debugger REPL again at the game_main function
global config in $XSYSTEM4_HOME/.xsys4rc (default ~/.xsys4rc)
game-specific config in <game-dir>/.xsys4rc
Supported options so far are "font-mincho" and "font-gothic". Syntax is
the same as System40.ini. E.g.
font-mincho = "/home/user/.fonts/msmincho.ttc"
MS Mincho/MS Gothic are have the nice property that latin characters are
exactly half the size of full-width characters. English translated games
depend on this to determine where line breaks are placed. We now force
text to be rendered with this spacing to prevent overflow issues.
Most open source mincho/gothic fonts do not even have fixed width latin
glyphs. The two fonts included in this commit are the closest I could
find, and the mincho font is still not quite good enough (there is a bit
of overlap on adjacent characters sometimes).