EXL / NXEngine

A port of the open-source rewrite Cave Story game engine for various platforms. Original author is Caitlin "rogueeve" Shaw, https://nxengine.sourceforge.io/
https://exlmoto.ru/nxengine/
GNU General Public License v3.0
170 stars 35 forks source link

Fix crash in LoadFXCache #13

Closed xordspar0 closed 1 year ago

xordspar0 commented 1 year ago

LoadFXCache scans the file until if hits in EOF, so it requires a way of knowing when the end of the file is reached. Previously, loading the sound effects cache would always crash the program. The new fgeti and fgetl variants provide a way for callers to handle EOF manually instead of aborting the program.

As a sidenote, I'm not sure that the relatively new behavior aborting on any EOF is desirable, but if that's what we're going to do, we at least need a way of detecting EOF without causing the program to exit.

Also, I'm not sure where to get a copy of Caitlin Shaw's Makegen program, so I just manually added function declarations to the fdh files.

EXL commented 1 year ago

Thank you!