[Scummvm-git-logs] scummvm master -> 785c52b18b557ef77a191dadde9a133c63331d45

athrxx noreply at scummvm.org
Mon Sep 19 22:47:06 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
785c52b18b KYRA: (EOB) - minor font load cleanup


Commit: 785c52b18b557ef77a191dadde9a133c63331d45
    https://github.com/scummvm/scummvm/commit/785c52b18b557ef77a191dadde9a133c63331d45
Author: athrxx (athrxx at scummvm.org)
Date: 2022-09-20T00:46:52+02:00

Commit Message:
KYRA: (EOB) - minor font load cleanup

Changed paths:
    engines/kyra/graphics/screen_eob.cpp


diff --git a/engines/kyra/graphics/screen_eob.cpp b/engines/kyra/graphics/screen_eob.cpp
index 692581cd136..219fc43f30c 100644
--- a/engines/kyra/graphics/screen_eob.cpp
+++ b/engines/kyra/graphics/screen_eob.cpp
@@ -1534,8 +1534,10 @@ const uint8 *Screen_EoB::getEGADitheringTable() {
 bool Screen_EoB::loadFont(FontId fontId, const char *filename) {
 	Font *&fnt = _fonts[fontId];
 	int temp = 0;
-	if (fnt)
+	if (fnt) {
 		delete fnt;
+		fnt = nullptr;
+	}
 
 	if (fontId == FID_SJIS_SMALL_FNT) {
 		if (_vm->gameFlags().platform == Common::kPlatformFMTowns)
@@ -1559,8 +1561,12 @@ bool Screen_EoB::loadFont(FontId fontId, const char *filename) {
 	if (!file)
 		error("Font file '%s' is missing", filename);
 
-	bool ret = fnt->load(*file);
-	fnt->setColorMap(_textColorsMap);
+	bool ret = false;
+	if (fnt) {
+		ret = fnt->load(*file);
+		fnt->setColorMap(_textColorsMap);
+	}
+
 	delete file;
 	return ret;
 }




More information about the Scummvm-git-logs mailing list