DGDS: Avoid crashing on Dragon EGA

This commit is contained in:
Matthew Duggan authored and Filippos Karapetis committed 2024-06-30 22:49:18 +03:00
1 parent 80becfc075
commit 04f97efdcd
2 files changed
+7 -4

No files matched your search

+5 -3
View File
@@ -33,8 +33,10 @@ namespace Dgds {
Font *Font::load(const Common::String &filename, ResourceManager *resourceManager, Decompressor *decompressor) {
Common::SeekableReadStream *fontFile = resourceManager->getResource(filename);
if (!fontFile)
error("Font file %s not found", filename.c_str());
if (!fontFile) {
warning("Font file %s not found", filename.c_str());
return nullptr;
}
DgdsChunkReader chunk(fontFile);
@@ -208,7 +210,7 @@ void FontManager::tryLoadFont(const char *fname, ResourceManager *resMgr, Decomp
if (font)
_fonts.setVal(ftype, font);
else
error("Failed to load font %s", fname);
warning("Failed to load font %s", fname);
}
FontManager::FontType FontManager::fontTypeByName(const Common::String &filename) const {
+2 -1
View File
@@ -37,7 +37,8 @@ static const int FILENAME_LENGTH = 12;
ResourceManager::ResourceManager() {
const char *indexFiles[] = {
"volume.vga", // early Dragon versions
"volume.vga", // Dragon VGA versions
"volume.ega", // Dragon EGA versions
"volume.rmf", // Beamish / HoC
"volume.map" // Beamish CD
};