Skip to content
  • Jake Stine's avatar
    audio: remove native pointer dependency on Source (#193) · 29ae5cbf
    Jake Stine authored
    * Added new build types: Debug, Tool, and Player.
    
     Debug is -O0 compiled with all assertions enabled.
     Tool is -O1 compiled with debug assertions disabled entirely.
     Player is -O3 compiled with tool assertions disabled, and all ignorable assertions demoted to log-only.
    
    Implementation of ignorable asserts is still partial, but as it stands this change is OK to go live (can add features later). On the todo list:
      - add popup to allow content creator to ignore the assert
      - add lua stacktrace information when lua context seems relevant
    
    * GHActions updated to be aware of new player and tool build configs
    
    * makefile: allow changing config from CLI without having to make clean
    
    Also force rebuild of vcxproj target since dep checking is currently insufficient. it should be checking dirs of all globbed source file includes for modifications, but it's not. and this is a really fast step, no point in not running it for now
    
    * Added lutro_errorf and lutro_alertf for logging errors and popup alerts, respectively.
    
     - Cleans up macros and keeps assertions clearly in the domain of Debug and Tooling builds.
     - removed play_assert and friends, which were both confusing terminology and not practical in design
    
    * audio: remove native pointer dependency on Source
    
    We can't store pointers to lua userdata in C. Lua may move the pointers at any time. So instead we must dereference the lua_ref to obtain the pointer at the point it is used, for example while mixing.
    
    Fixes a problem where the engine can crash after some amount of time, depending wildly on game behaviors and memory usage. In many cases no crash may ever occur. I have a test locally (still WIP) that verifies this problem/fix.
    29ae5cbf