[Scummvm-git-logs] scummvm master -> c42e2a3243838d717e8a17387bbecb830a92415b
dreammaster
paulfgilbert at gmail.com
Wed Feb 20 04:52:13 CET 2019
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
d6e7ea794d GLK: FROTZ: Fix erasing windows that don't have an associated GLK window
c42e2a3243 GLK: Better error messages for failing to load fonts
Commit: d6e7ea794d97e0525615939a935ea952c74b03e1
https://github.com/scummvm/scummvm/commit/d6e7ea794d97e0525615939a935ea952c74b03e1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-02-19T19:44:48-08:00
Commit Message:
GLK: FROTZ: Fix erasing windows that don't have an associated GLK window
Changed paths:
engines/glk/frotz/processor_screen.cpp
Commit: c42e2a3243838d717e8a17387bbecb830a92415b
https://github.com/scummvm/scummvm/commit/c42e2a3243838d717e8a17387bbecb830a92415b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-02-19T19:51:15-08:00
Commit Message:
GLK: Better error messages for failing to load fonts
Changed paths:
engines/glk/screen.cpp
engines/glk/screen.h
diff --git a/engines/glk/screen.cpp b/engines/glk/screen.cpp
index c460a21..df2a288 100644
--- a/engines/glk/screen.cpp
+++ b/engines/glk/screen.cpp
@@ -39,8 +39,7 @@ Screen::~Screen() {
}
void Screen::initialize() {
- if (!loadFonts())
- error("Could not load fonts.dat");
+ loadFonts();
for (int idx = 0; idx < 2; ++idx) {
FontInfo *i = (idx == 0) ? &g_conf->_monoInfo : &g_conf->_propInfo;
@@ -68,17 +67,17 @@ void Screen::fillRect(const Rect &box, uint color) {
Graphics::Screen::fillRect(box, color);
}
-bool Screen::loadFonts() {
+void Screen::loadFonts() {
Common::Archive *archive = nullptr;
if (!Common::File::exists(FONTS_FILENAME) || (archive = Common::makeZipArchive(FONTS_FILENAME)) == nullptr)
- return false;
+ error("Could not locate %s", FONTS_FILENAME);
// Open the version.txt file within it to validate the version
Common::File f;
if (!f.open("version.txt", *archive)) {
delete archive;
- return false;
+ error("Could not get version of fonts data. Possibly malformed");
}
// Validate the version
@@ -89,13 +88,12 @@ bool Screen::loadFonts() {
double version = atof(buffer);
if (version < 1.2) {
delete archive;
- return false;
+ error("Out of date fonts. Expected at least %f, but got version %f", 1.2, version);
}
loadFonts(archive);
delete archive;
- return true;
}
void Screen::loadFonts(Common::Archive *archive) {
diff --git a/engines/glk/screen.h b/engines/glk/screen.h
index 34192d1..031e58f 100644
--- a/engines/glk/screen.h
+++ b/engines/glk/screen.h
@@ -46,7 +46,7 @@ private:
/**
* Open the fonts archive and load all the fonts
*/
- bool loadFonts();
+ void loadFonts();
/**
* Load a single font
More information about the Scummvm-git-logs
mailing list