latebit / latebit-engine

Pixel based game engine integrated in your IDE
3 stars 0 forks source link

Lack of font file causes Segmentation Fault #23

Closed shikaan closed 8 months ago

shikaan commented 8 months ago

If you try running a game without a local font.ttf file you would see something like

09:03:36 [INFO] WorldManager::startUp(): Started successfully
09:03:36 [ERROR] DisplayManager::startUp(): Cannot open font font.ttf. Couldn't open font.ttf

And then a segmentation fault, gdb backtrace for reference

#0  0x00007ffff5d7bea0 in ?? ()
#1  0x00007ffff70f656c in GLES2_DestroyRenderer (renderer=0x555555694380) at /home/runner/vcpkg/buildtrees/sdl2/src/ase-2.30.0-3ceee4a14f.clean/src/render/opengles2/SDL_render_gles2.c:1373
#2  0x00007ffff70ece3d in SDL_DestroyRenderer_REAL (renderer=0x555555694380) at /home/runner/vcpkg/buildtrees/sdl2/src/ase-2.30.0-3ceee4a14f.clean/src/render/SDL_render.c:4354
#3  0x00007ffff70af049 in SDL_DestroyRenderer (a=0x555555694380) at /home/runner/vcpkg/buildtrees/sdl2/src/ase-2.30.0-3ceee4a14f.clean/src/dynapi/SDL_dynapi_procs.h:382
#4  0x00007ffff70940c4 in lb::DisplayManager::shutDown() () from [REDACTED]/latebit-template/lib/liblatebit.so
#5  0x00007ffff7093ea5 in lb::DisplayManager::startUp() () from [REDACTED]/latebit-template/lib/liblatebit.so
#6  0x00007ffff7097a97 in lb::GameManager::startUp() () from [REDACTED]/latebit-template/lib/liblatebit.so
#7  0x0000555555556296 in main ()

Desired behaviour

  1. We should not segfault
  2. We could bundle the default font with the engine
  3. We could allow people to specify the font path