[Scummvm-git-logs] scummvm master -> c569e4d5c6034d06d72d07535f6ab5e38dd49213

sev- noreply at scummvm.org
Sun Mar 5 20:18:41 UTC 2023


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:
7a05a2d709 GRAPHICS: Add an XBM decoder
c569e4d5c6 GLK: Embed the Infocom fonts in the executable


Commit: 7a05a2d709895d7a2e362a97bda6606d61f0cdae
    https://github.com/scummvm/scummvm/commit/7a05a2d709895d7a2e362a97bda6606d61f0cdae
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2023-03-05T21:18:36+01:00

Commit Message:
GRAPHICS: Add an XBM decoder

Changed paths:
  A image/xbm.cpp
  A image/xbm.h
    image/module.mk


diff --git a/image/module.mk b/image/module.mk
index fa78a362761..442750c37d4 100644
--- a/image/module.mk
+++ b/image/module.mk
@@ -10,6 +10,7 @@ MODULE_OBJS := \
 	pict.o \
 	png.o \
 	tga.o \
+	xbm.o \
 	codecs/bmp_raw.o \
 	codecs/cdtoons.o \
 	codecs/cinepak.o \
diff --git a/image/xbm.cpp b/image/xbm.cpp
new file mode 100644
index 00000000000..c67e3986eb6
--- /dev/null
+++ b/image/xbm.cpp
@@ -0,0 +1,83 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "image/xbm.h"
+
+#include "common/textconsole.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
+
+namespace Image {
+
+const byte XBMDecoder::_palette[2 * 3] = {
+	0xFF, 0xFF, 0xFF,
+	0x00, 0x00, 0x00
+};
+
+XBMDecoder::XBMDecoder() {
+	_surface = 0;
+}
+
+XBMDecoder::~XBMDecoder() {
+	destroy();
+}
+
+void XBMDecoder::destroy() {
+	if (_surface) {
+		_surface->free();
+		delete _surface;
+		_surface = 0;
+	}
+
+}
+
+bool XBMDecoder::loadStream(Common::SeekableReadStream &stream) {
+	destroy();
+
+	warning("External XBM files are not yet supported");
+	return false;
+}
+
+bool XBMDecoder::loadBits(const unsigned char *bits, int width, int height) {
+	destroy();
+
+	_surface = new Graphics::Surface();
+	_surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+
+	for (int i = 0; i < height; i++) {
+		byte *dst = (byte *)_surface->getBasePtr(0, i);
+		for (int j = 0; j != width;) {
+			byte color = *bits++;
+			for (int k = 0; k < 8; k++) {
+				*dst++ = (color & 1);
+				color >>= 1;
+				j++;
+				if (j == width) {
+					break;
+				}
+			}
+		}
+	}
+
+	return true;
+}
+
+} // End of namespace Image
diff --git a/image/xbm.h b/image/xbm.h
new file mode 100644
index 00000000000..44e3955d2be
--- /dev/null
+++ b/image/xbm.h
@@ -0,0 +1,76 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IMAGE_XBM_H
+#define IMAGE_XBM_H
+
+#include "image/image_decoder.h"
+
+namespace Image {
+
+/**
+ * @defgroup image_xbm XBM decoder
+ * @ingroup image
+ *
+ * @brief Decoder for XBM images.
+ *
+ * Used in engines:
+ * - Glk
+ * @{
+ */
+
+class XBMDecoder : public ImageDecoder {
+public:
+	XBMDecoder();
+	virtual ~XBMDecoder();
+
+	// ImageDecoder API
+	void destroy() override;
+	bool loadStream(Common::SeekableReadStream &stream) override;
+	const Graphics::Surface *getSurface() const override { return _surface; }
+	const byte *getPalette() const override { return _palette; }
+	uint16 getPaletteColorCount() const override { return 2; }
+
+	/**
+	 * Load an image from an embedded XBM file.
+	 *
+	 * loadStream() should implicitly call destroy() to free the memory
+	 * of the last loadStream() call.
+	 *
+	 * @param bits    Image data.
+	 * @param width   Image width.
+	 * @param height  Image height.
+	 *
+	 * @return Whether loading the image succeeded.
+	 *
+	 * @see getSurface
+	 */
+	bool loadBits(const unsigned char *bits, int width, int height);
+
+private:
+	Graphics::Surface *_surface;
+	static const byte _palette[2 * 3];
+};
+
+/** @} */
+} // End of namespace Image
+
+#endif


Commit: c569e4d5c6034d06d72d07535f6ab5e38dd49213
    https://github.com/scummvm/scummvm/commit/c569e4d5c6034d06d72d07535f6ab5e38dd49213
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2023-03-05T21:18:36+01:00

Commit Message:
GLK: Embed the Infocom fonts in the executable

Changed paths:
  A engines/glk/zcode/infocom6x8.xbm
  A engines/glk/zcode/infocom_graphics.xbm
  R gui/themes/fonts/infocom6x8.bmp
  R gui/themes/fonts/infocom_graphics.bmp
    engines/glk/zcode/bitmap_font.cpp
    engines/glk/zcode/screen.cpp


diff --git a/engines/glk/zcode/bitmap_font.cpp b/engines/glk/zcode/bitmap_font.cpp
index 22c8f8fbb6d..7615efd15ba 100644
--- a/engines/glk/zcode/bitmap_font.cpp
+++ b/engines/glk/zcode/bitmap_font.cpp
@@ -44,7 +44,7 @@ BitmapFont::BitmapFont(const Graphics::Surface &src, const Common::Point &size,
 		Common::Rect charBounds(r.left, r.top, r.left + srcCharWidth, r.bottom);
 
 		_chars[idx].create(destCharWidth, size.y, src.format);
-		_chars[idx].transBlitFrom(src, charBounds, Common::Rect(0, 0, _chars[idx].w, _chars[idx].h));
+		_chars[idx].blitFrom(src, charBounds, Common::Rect(0, 0, _chars[idx].w, _chars[idx].h));
 	}
 }
 
@@ -54,7 +54,7 @@ void BitmapFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint
 		const byte *srcP = (const byte *)c.getBasePtr(0, yCtr);
 
 		for (int xCtr = 0; xCtr < c.w; ++xCtr, ++srcP) {
-			if (!*srcP)
+			if (*srcP)
 				dst->hLine(x + xCtr, y + yCtr, x + xCtr, color);
 		}
 	}
@@ -73,7 +73,7 @@ int BitmapFont::getSourceCharacterWidth(uint charIndex, const Graphics::Surface
 		const byte *srcP = (const byte *)src.getBasePtr(charBounds.left, y);
 
 		for (int x = 0; x < charBounds.width(); ++x, ++srcP) {
-			if (!*srcP)
+			if (*srcP)
 				rowX = x;
 		}
 
diff --git a/engines/glk/zcode/infocom6x8.xbm b/engines/glk/zcode/infocom6x8.xbm
new file mode 100644
index 00000000000..af506c483a6
--- /dev/null
+++ b/engines/glk/zcode/infocom6x8.xbm
@@ -0,0 +1,42 @@
+#define infocom6x8_width 192
+#define infocom6x8_height 24
+static unsigned char infocom6x8_bits[] = {
+ 0x40,0x50,0x28,0x44,0x22,0x08,0x44,0x90,0x00,0x00,0x00,0x20,0x86,0x60,0x18,
+ 0xc5,0xe3,0x3c,0x86,0x01,0x00,0x00,0x00,0x38,0x40,0x50,0x7c,0x1f,0x52,0x08,
+ 0x82,0x60,0x10,0x00,0x00,0x20,0xc9,0x90,0x24,0x45,0x10,0x20,0x49,0x02,0x00,
+ 0x04,0x10,0x44,0x40,0x00,0x28,0x05,0x21,0x04,0x01,0xf1,0x10,0x00,0x00,0x10,
+ 0x89,0x40,0x10,0xcf,0x71,0x10,0x46,0x12,0x08,0xc2,0x23,0x20,0x40,0x00,0x7c,
+ 0x9f,0x50,0x01,0x01,0x61,0x7c,0xc0,0x03,0x08,0x89,0x20,0x20,0x04,0x92,0x08,
+ 0x89,0x03,0x00,0x01,0x40,0x10,0x00,0x00,0x28,0x54,0x90,0x00,0x01,0x91,0x10,
+ 0x02,0x00,0x04,0x89,0x10,0x24,0x04,0x92,0x08,0x09,0x12,0x08,0xc2,0x23,0x00,
+ 0x40,0x00,0x00,0x5f,0x62,0x01,0x82,0x00,0x10,0x02,0x10,0x04,0xc6,0xf1,0x18,
+ 0xc4,0x61,0x08,0xc6,0x01,0x08,0x04,0x10,0x10,0x00,0x00,0x00,0x04,0x00,0x00,
+ 0x44,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x86,0x71,0x38,
+ 0xc7,0xf3,0x38,0xc9,0x81,0x24,0x41,0x94,0x18,0x87,0x71,0x38,0x5f,0x12,0x45,
+ 0x51,0xf4,0x0c,0xc1,0x40,0x00,0x49,0x92,0x04,0x49,0x10,0x04,0x89,0x80,0x14,
+ 0xc1,0xb6,0x24,0x49,0x92,0x04,0x44,0x12,0x45,0x4a,0x84,0x04,0x81,0xa0,0x00,
+ 0x4d,0x72,0x04,0xc9,0x71,0x04,0x89,0x80,0x0c,0x41,0xd5,0x24,0x49,0x92,0x18,
+ 0x44,0x12,0x45,0x84,0x42,0x04,0x82,0x10,0x01,0xcd,0x93,0x04,0x49,0x10,0x34,
+ 0x8f,0x80,0x14,0x41,0x94,0x24,0x47,0x72,0x20,0x44,0xa2,0x54,0x04,0x21,0x04,
+ 0x84,0x00,0x00,0x41,0x92,0x04,0x49,0x10,0x24,0x89,0x90,0x24,0x41,0x94,0x24,
+ 0x41,0x33,0x24,0x44,0xa2,0x6c,0x0a,0x11,0x04,0x88,0x00,0x00,0x4e,0x72,0x38,
+ 0xc7,0x13,0x38,0xc9,0x61,0x24,0x4f,0x94,0x18,0x81,0xd3,0x18,0x84,0x41,0x44,
+ 0x11,0xf1,0x0c,0xc8,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0x00,0x04,0x60,0x00,
+ 0x41,0x20,0x04,0x01,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x10,
+ 0x41,0x00,0x00,0xc1,0x71,0x1c,0xc7,0x21,0x1c,0x07,0x00,0x14,0xc1,0x77,0x1c,
+ 0xc7,0x71,0x1c,0x47,0x51,0x54,0x45,0x71,0x08,0x81,0x00,0x00,0x02,0x51,0x04,
+ 0x45,0x71,0x14,0x45,0x20,0x14,0x41,0x55,0x14,0x45,0x11,0x04,0x42,0x51,0x54,
+ 0x45,0x41,0x08,0x81,0x20,0x00,0xc0,0x51,0x04,0xc5,0x21,0x14,0x45,0x20,0x0c,
+ 0x41,0x55,0x14,0x45,0x11,0x1c,0x42,0x51,0x54,0x42,0x21,0x04,0x00,0x51,0x01,
+ 0x40,0x51,0x04,0x45,0x20,0x14,0x45,0x20,0x14,0x41,0x55,0x14,0x45,0x11,0x10,
+ 0x42,0x51,0x54,0x45,0x11,0x08,0x81,0x80,0x00,0xc0,0x71,0x1c,0xc7,0x21,0x1c,
+ 0x45,0x20,0x14,0x41,0x55,0x1c,0xc7,0x11,0x1c,0xc2,0x21,0x7c,0xc5,0x71,0x08,
+ 0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x20,0x00,0x00,0x00,0x00,
+ 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x10,0x41,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x1c,0x00,0x30,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,
+ 0xc0,0x01,0x00,0x00,0x00,0x00};
diff --git a/engines/glk/zcode/infocom_graphics.xbm b/engines/glk/zcode/infocom_graphics.xbm
new file mode 100644
index 00000000000..3d71e27d2b7
--- /dev/null
+++ b/engines/glk/zcode/infocom_graphics.xbm
@@ -0,0 +1,55 @@
+#define infocom_graphics_width 256
+#define infocom_graphics_height 24
+static unsigned char infocom_graphics_bits[] = {
+ 0x00,0x00,0x00,0x80,0x01,0x00,0x00,0x00,0x10,0x08,0x10,0x00,0x10,0x08,0x08,
+ 0x00,0x00,0x10,0x08,0x01,0x80,0x10,0xff,0xff,0x00,0x1f,0xf8,0x10,0xff,0x1f,
+ 0xf8,0xf8,0x00,0x0c,0x30,0x40,0x02,0x00,0x00,0x00,0x10,0x08,0x10,0x00,0x10,
+ 0x08,0x08,0x00,0x00,0x10,0x08,0x02,0x40,0x10,0xff,0xff,0x00,0x1f,0xf8,0x10,
+ 0xff,0x1f,0xf8,0xf8,0x00,0x0e,0x70,0x20,0x04,0x00,0x00,0x00,0x10,0x08,0x10,
+ 0x00,0x10,0x08,0x08,0x00,0x00,0x10,0x08,0x04,0x20,0x10,0xff,0xff,0x00,0x1f,
+ 0xf8,0x10,0xff,0x1f,0xf8,0xf8,0x00,0xff,0xff,0x10,0x08,0x00,0x00,0xff,0x10,
+ 0x08,0xff,0x00,0x10,0x08,0x08,0xf8,0x1f,0x10,0x08,0xf8,0x1f,0x10,0xff,0xff,
+ 0xff,0x1f,0xf8,0xff,0xff,0x1f,0xf8,0xf8,0x00,0x0e,0x70,0x08,0x10,0x00,0xff,
+ 0x00,0x10,0x08,0x00,0xff,0xf0,0x0f,0xf8,0x08,0x10,0x1f,0xf8,0x08,0x10,0x1f,
+ 0xff,0xff,0xff,0x1f,0xf8,0xff,0xff,0xff,0xff,0xf8,0x00,0x0c,0x30,0x04,0x20,
+ 0x00,0x00,0x00,0x10,0x08,0x00,0x10,0x10,0x08,0x00,0x08,0x10,0x00,0x04,0x08,
+ 0x10,0x20,0xff,0x00,0xff,0x1f,0xf8,0xff,0x10,0x1f,0xf8,0x00,0x00,0x00,0x00,
+ 0x02,0x40,0x00,0x00,0x00,0x10,0x08,0x00,0x10,0x10,0x08,0x00,0x08,0x10,0x00,
+ 0x02,0x08,0x10,0x40,0xff,0x00,0xff,0x1f,0xf8,0xff,0x10,0x1f,0xf8,0x00,0x00,
+ 0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x10,0x08,0x00,0x10,0x10,0x08,0x00,0x08,
+ 0x10,0x00,0x01,0x08,0x10,0x80,0xff,0x00,0xff,0x1f,0xf8,0xff,0x10,0x1f,0xf8,
+ 0x00,0x00,0x00,0x1f,0xf8,0x01,0x80,0x1f,0x80,0x00,0x00,0x01,0xff,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x10,0x18,
+ 0x00,0x18,0xff,0x00,0x00,0x1f,0xf8,0x02,0x40,0x1f,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x01,0x42,
+ 0x10,0x3c,0x18,0x3c,0x81,0x00,0x00,0x1f,0xf8,0x04,0x20,0x1f,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x01,0x80,0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,0xff,0x80,
+ 0x01,0x24,0x10,0x7e,0x18,0x7e,0x81,0xf8,0x1f,0x1f,0xf8,0xf8,0x1f,0x1f,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01,0x03,0x07,0x0f,0x1f,0x3f,0x7f,
+ 0xff,0x80,0x01,0x18,0x10,0x18,0x18,0x18,0x81,0xf8,0x1f,0x1f,0xf8,0xf8,0x1f,
+ 0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01,0x03,0x07,0x0f,0x1f,
+ 0x3f,0x7f,0xff,0x80,0x01,0x18,0xff,0x18,0x18,0x18,0x81,0xf8,0x1f,0x00,0x04,
+ 0xf8,0x1f,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01,0x03,0x07,
+ 0x0f,0x1f,0x3f,0x7f,0xff,0x80,0x01,0x24,0x10,0x18,0x7e,0x7e,0x81,0xf8,0x1f,
+ 0x00,0x02,0xf8,0x1f,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x01,0x42,0x10,0x18,0x3c,0x3c,0x81,
+ 0xf8,0x1f,0x00,0x01,0xf8,0x1f,0x80,0x00,0x80,0x01,0x00,0x00,0xff,0x01,0x80,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x10,0x00,0x18,
+ 0x18,0xff,0x00,0xc6,0x1e,0x00,0xc6,0xc6,0x92,0x00,0xc6,0x0c,0x18,0x06,0x1c,
+ 0xee,0x18,0x8e,0x06,0x18,0x3e,0x06,0x18,0x0e,0x7e,0x0e,0xdb,0x1e,0x06,0xe7,
+ 0xff,0xe7,0xff,0x00,0x3c,0x6e,0x76,0x78,0xc6,0xee,0x4a,0xc6,0xca,0x0c,0x18,
+ 0x06,0x3c,0xd6,0x1b,0x56,0x06,0x18,0xc6,0xc6,0x3c,0x1e,0xc0,0x36,0x5a,0x26,
+ 0xc6,0xc3,0xe7,0xc3,0xc3,0x00,0x66,0x3a,0xc6,0xd8,0xee,0xd6,0x26,0x6c,0xf2,
+ 0x0c,0x7e,0x1e,0x6c,0xee,0x1e,0x26,0xc6,0x18,0xc6,0xe6,0x5a,0x36,0x7e,0xc6,
+ 0x3c,0x4a,0x66,0x81,0xe7,0x81,0x99,0x00,0x60,0x06,0x3e,0x18,0x92,0xd6,0x16,
+ 0x38,0xc6,0x0c,0x99,0x36,0x0c,0xc6,0x3c,0x8e,0xe6,0x18,0x3e,0xf6,0x99,0x66,
+ 0xc0,0x36,0x18,0x92,0x36,0xe7,0xe7,0xe7,0x9f,0x00,0x18,0x1e,0xc6,0x18,0xee,
+ 0xc6,0x0e,0x38,0x9e,0x0c,0x7e,0xe6,0x0c,0xc6,0x78,0x56,0xf6,0x3c,0x66,0xde,
+ 0x18,0xc6,0xc0,0x1e,0x18,0xf2,0x1e,0xe7,0xe7,0xe7,0xe7,0x00,0x00,0x66,0x76,
+ 0x1b,0xc6,0xc6,0x06,0x6c,0xa6,0x0c,0x18,0xc6,0x0c,0xc6,0xd8,0x26,0xde,0x5a,
+ 0xc6,0xce,0x18,0xc6,0xc0,0x06,0x18,0x92,0x06,0xe7,0x81,0x81,0xff,0x00,0x18,
+ 0x06,0x1e,0x1e,0xc6,0xc6,0x06,0xc6,0xc6,0x0c,0x18,0xc6,0x0c,0xc6,0x18,0x06,
+ 0xce,0xdb,0xc6,0xc0,0x18,0xc6,0x3e,0x06,0x18,0x92,0x06,0xe7,0xc3,0xc3,0xe7,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xe7,
+ 0xe7,0xff,0x00};
diff --git a/engines/glk/zcode/screen.cpp b/engines/glk/zcode/screen.cpp
index 32374a394c1..97d9e46b87f 100644
--- a/engines/glk/zcode/screen.cpp
+++ b/engines/glk/zcode/screen.cpp
@@ -25,7 +25,10 @@
 #include "glk/conf.h"
 #include "common/file.h"
 #include "graphics/fonts/ttf.h"
-#include "image/bmp.h"
+#include "image/xbm.h"
+
+#include "glk/zcode/infocom6x8.xbm"
+#include "glk/zcode/infocom_graphics.xbm"
 
 namespace Glk {
 namespace ZCode {
@@ -77,14 +80,10 @@ void FrotzScreen::loadVersion6Fonts(Common::Archive *archive) {
 	_fonts.resize(8);
 
 	// Load up the 8x8 Infocom font
-	Image::BitmapDecoder decoder;
-	Common::File f;
-	if (!f.open("infocom6x8.bmp", *archive))
-		error("Could not load font");
+	Image::XBMDecoder decoder;
+	decoder.loadBits(infocom6x8_bits, infocom6x8_width, infocom6x8_height);
 
 	Common::Point fontSize(6, 8);
-	decoder.loadStream(f);
-	f.close();
 
 	// Add normal fonts
 	_fonts[MONOR] = new FixedWidthBitmapFont(*decoder.getSurface(), fontSize, 6, 8);
@@ -99,7 +98,7 @@ void FrotzScreen::loadVersion6Fonts(Common::Archive *archive) {
 
 	for (int y = 8 - 2; y < emph.h; y += 8) {
 		byte *lineP = (byte *)emph.getBasePtr(0, y);
-		Common::fill(lineP, lineP + emph.w, 0);
+		Common::fill(lineP, lineP + emph.w, 1);
 	}
 
 	// Add them to the font list
@@ -110,18 +109,15 @@ void FrotzScreen::loadVersion6Fonts(Common::Archive *archive) {
 }
 
 void FrotzScreen::loadExtraFonts(Common::Archive *archive) {
-	Image::BitmapDecoder decoder;
-	Common::File f;
-	if (!f.open("infocom_graphics.bmp", *archive))
-		error("Could not load font");
+	Image::XBMDecoder decoder;
+	decoder.loadBits(infocom_graphics_bits, infocom_graphics_width, infocom_graphics_height);
 
 	Common::Point fontSize(_fonts[0]->getMaxCharWidth(), _fonts[0]->getFontHeight());
-	decoder.loadStream(f);
 	_fonts.push_back(new FixedWidthBitmapFont(*decoder.getSurface(), fontSize));
-	f.close();
 
 	// Add Runic font. It provides cleaner versions of the runic characters in the
 	// character graphics font
+	Common::File f;
 	if (!f.open("NotoSansRunic-Regular.ttf", *archive))
 		error("Could not load font");
 
diff --git a/gui/themes/fonts/infocom6x8.bmp b/gui/themes/fonts/infocom6x8.bmp
deleted file mode 100644
index 878b8955a05..00000000000
Binary files a/gui/themes/fonts/infocom6x8.bmp and /dev/null differ
diff --git a/gui/themes/fonts/infocom_graphics.bmp b/gui/themes/fonts/infocom_graphics.bmp
deleted file mode 100644
index cb748fe5122..00000000000
Binary files a/gui/themes/fonts/infocom_graphics.bmp and /dev/null differ




More information about the Scummvm-git-logs mailing list