aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/cursorman.cpp22
-rw-r--r--graphics/cursorman.h4
-rw-r--r--graphics/font.h12
-rw-r--r--graphics/fontman.cpp100
-rw-r--r--graphics/fontman.h24
-rw-r--r--graphics/fonts/scummfont.cpp313
-rw-r--r--graphics/module.mk1
-rw-r--r--graphics/scaler/Normal2xARM.s1
-rw-r--r--graphics/scaler/aspect.cpp25
-rw-r--r--graphics/scaler/downscaler.cpp2
10 files changed, 136 insertions, 368 deletions
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp
index 297b583d54..a5498903e2 100644
--- a/graphics/cursorman.cpp
+++ b/graphics/cursorman.cpp
@@ -86,7 +86,7 @@ void CursorManager::popAllCursors() {
delete cur;
}
- if (g_system->hasFeature(OSystem::kFeatureCursorHasPalette)) {
+ if (g_system->hasFeature(OSystem::kFeatureCursorPalette)) {
while (!_cursorPaletteStack.empty()) {
Palette *pal = _cursorPaletteStack.pop();
delete pal;
@@ -141,11 +141,11 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX,
}
bool CursorManager::supportsCursorPalettes() {
- return g_system->hasFeature(OSystem::kFeatureCursorHasPalette);
+ return g_system->hasFeature(OSystem::kFeatureCursorPalette);
}
void CursorManager::disableCursorPalette(bool disable) {
- if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+ if (!g_system->hasFeature(OSystem::kFeatureCursorPalette))
return;
if (_cursorPaletteStack.empty())
@@ -154,11 +154,11 @@ void CursorManager::disableCursorPalette(bool disable) {
Palette *pal = _cursorPaletteStack.top();
pal->_disabled = disable;
- g_system->disableCursorPalette(disable);
+ g_system->setFeatureState(OSystem::kFeatureCursorPalette, !disable);
}
void CursorManager::pushCursorPalette(const byte *colors, uint start, uint num) {
- if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+ if (!g_system->hasFeature(OSystem::kFeatureCursorPalette))
return;
Palette *pal = new Palette(colors, start, num);
@@ -167,11 +167,11 @@ void CursorManager::pushCursorPalette(const byte *colors, uint start, uint num)
if (num)
g_system->setCursorPalette(colors, start, num);
else
- g_system->disableCursorPalette(true);
+ g_system->setFeatureState(OSystem::kFeatureCursorPalette, false);
}
void CursorManager::popCursorPalette() {
- if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+ if (!g_system->hasFeature(OSystem::kFeatureCursorPalette))
return;
if (_cursorPaletteStack.empty())
@@ -181,7 +181,7 @@ void CursorManager::popCursorPalette() {
delete pal;
if (_cursorPaletteStack.empty()) {
- g_system->disableCursorPalette(true);
+ g_system->setFeatureState(OSystem::kFeatureCursorPalette, false);
return;
}
@@ -190,11 +190,11 @@ void CursorManager::popCursorPalette() {
if (pal->_num && !pal->_disabled)
g_system->setCursorPalette(pal->_data, pal->_start, pal->_num);
else
- g_system->disableCursorPalette(true);
+ g_system->setFeatureState(OSystem::kFeatureCursorPalette, false);
}
void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint num) {
- if (!g_system->hasFeature(OSystem::kFeatureCursorHasPalette))
+ if (!g_system->hasFeature(OSystem::kFeatureCursorPalette))
return;
if (_cursorPaletteStack.empty()) {
@@ -219,7 +219,7 @@ void CursorManager::replaceCursorPalette(const byte *colors, uint start, uint nu
memcpy(pal->_data, colors, size);
g_system->setCursorPalette(pal->_data, pal->_start, pal->_num);
} else {
- g_system->disableCursorPalette(true);
+ g_system->setFeatureState(OSystem::kFeatureCursorPalette, false);
}
}
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index 1e7ce83611..543a5d0a5c 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -108,9 +108,9 @@ public:
* Test whether cursor palettes are supported.
*
* This is just an convenience wrapper for checking for
- * OSystem::kFeatureCursorHasPalette to be supported by OSystem.
+ * OSystem::kFeatureCursorPalette to be supported by OSystem.
*
- * @see OSystem::kFeatureCursorHasPalette
+ * @see OSystem::kFeatureCursorPalette
* @see OSystem::hasFeature
*/
bool supportsCursorPalettes();
diff --git a/graphics/font.h b/graphics/font.h
index 7a992674d2..dc75f86e1f 100644
--- a/graphics/font.h
+++ b/graphics/font.h
@@ -114,18 +114,6 @@ public:
int wordWrapText(const Common::String &str, int maxWidth, Common::Array<Common::String> &lines) const;
};
-/**
- * A SCUMM style font.
- */
-class ScummFont : public Font {
-public:
- virtual int getFontHeight() const { return 8; }
- virtual int getMaxCharWidth() const { return 8; }
-
- virtual int getCharWidth(byte chr) const;
- virtual void drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const;
-};
-
typedef uint16 bitmap_t; /* bitmap image unit size*/
struct BBX {
diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp
index f937e55b69..f40cf97602 100644
--- a/graphics/fontman.cpp
+++ b/graphics/fontman.cpp
@@ -21,12 +21,12 @@
#include "graphics/font.h"
#include "graphics/fontman.h"
+#include "common/translation.h"
DECLARE_SINGLETON(Graphics::FontManager);
namespace Graphics {
-const ScummFont *g_scummfont = 0;
FORWARD_DECLARE_FONT(g_sysfont);
FORWARD_DECLARE_FONT(g_sysfont_big);
FORWARD_DECLARE_FONT(g_consolefont);
@@ -34,18 +34,15 @@ FORWARD_DECLARE_FONT(g_consolefont);
FontManager::FontManager() {
// This assert should *never* trigger, because
// FontManager is a singleton, thus there is only
- // one instance of it per time. (g_scummfont gets
+ // one instance of it per time. (g_sysfont gets
// reset to 0 in the desctructor of this class).
- assert(g_scummfont == 0);
- g_scummfont = new ScummFont;
+ assert(g_sysfont == 0);
INIT_FONT(g_sysfont);
INIT_FONT(g_sysfont_big);
INIT_FONT(g_consolefont);
}
FontManager::~FontManager() {
- delete g_scummfont;
- g_scummfont = 0;
delete g_sysfont;
g_sysfont = 0;
delete g_sysfont_big;
@@ -58,7 +55,6 @@ const struct {
const char *name;
FontManager::FontUsage id;
} builtinFontNames[] = {
- { "builtinOSD", FontManager::kOSDFont },
{ "builtinConsole", FontManager::kConsoleFont },
{ "fixed5x8.bdf", FontManager::kConsoleFont },
{ "fixed5x8-iso-8859-1.bdf", FontManager::kConsoleFont },
@@ -69,32 +65,112 @@ const struct {
{ "helvB12.bdf", FontManager::kBigGUIFont },
{ "helvB12-iso-8859-1.bdf", FontManager::kBigGUIFont },
{ "helvB12-ascii.bdf", FontManager::kBigGUIFont },
- { 0, FontManager::kOSDFont }
+ { 0, FontManager::kConsoleFont }
};
+bool FontManager::assignFontToName(const Common::String &name, const Font *font) {
+ Common::String lowercaseName = name;
+ lowercaseName.toLowercase();
+ _fontMap[lowercaseName] = font;
+ return true;
+}
+
+void FontManager::removeFontName(const Common::String &name) {
+ Common::String lowercaseName = name;
+ lowercaseName.toLowercase();
+ _fontMap.erase(lowercaseName);
+}
+
const Font *FontManager::getFontByName(const Common::String &name) const {
for (int i = 0; builtinFontNames[i].name; i++)
if (!scumm_stricmp(name.c_str(), builtinFontNames[i].name))
return getFontByUsage(builtinFontNames[i].id);
- if (!_fontMap.contains(name))
+ Common::String lowercaseName = name;
+ lowercaseName.toLowercase();
+ if (!_fontMap.contains(lowercaseName))
return 0;
- return _fontMap[name];
+ return _fontMap[lowercaseName];
}
const Font *FontManager::getFontByUsage(FontUsage usage) const {
switch (usage) {
- case kOSDFont:
- return g_scummfont;
case kConsoleFont:
return g_consolefont;
case kGUIFont:
return g_sysfont;
case kBigGUIFont:
return g_sysfont_big;
+ case kLocalizedFont:
+ {
+ // First try to find a kBigGUIFont
+ Common::String fontName = getLocalizedFontNameByUsage(kBigGUIFont);
+ if (!fontName.empty()) {
+ const Font *font = getFontByName(fontName);
+ if (font)
+ return font;
+ }
+ // Try kGUIFont
+ fontName = getLocalizedFontNameByUsage(kGUIFont);
+ if (!fontName.empty()) {
+ const Font *font = getFontByName(fontName);
+ if (font)
+ return font;
+ }
+#ifdef USE_TRANSLATION
+ // Accept any other font that has the charset in its name
+ for (Common::HashMap<Common::String, const Font *>::const_iterator it = _fontMap.begin() ; it != _fontMap.end() ; ++it) {
+ if (it->_key.contains(TransMan.getCurrentCharset()))
+ return it->_value;
+ }
+#endif
+ // Fallback: return a non localized kGUIFont.
+ // Maybe we should return a null pointer instead?
+ return g_sysfont;
+ }
}
return 0;
}
+Common::String FontManager::getLocalizedFontNameByUsage(FontUsage usage) const {
+ // We look for a name that matches the usage and that ends in .bdf.
+ // It should also not contain "-ascii" or "-iso-" in its name.
+ // We take the first name that matches.
+ for (int i = 0; builtinFontNames[i].name; i++) {
+ if (builtinFontNames[i].id == usage) {
+ Common::String fontName(builtinFontNames[i].name);
+ if (!fontName.contains("-ascii") && !fontName.contains("-iso-") && fontName.contains(".bdf"))
+ return genLocalizedFontFilename(fontName);
+ }
+ }
+ return Common::String();
+}
+
+Common::String FontManager::genLocalizedFontFilename(const Common::String &filename) const {
+#ifndef USE_TRANSLATION
+ return filename;
+#else
+ // We will transform the font filename in the following way:
+ // name.bdf
+ // will become:
+ // name-charset.bdf
+ // Note that name should not contain any dot here!
+
+ // In the first step we look for the dot. In case there is none we will
+ // return the normal filename.
+ Common::String::const_iterator dot = Common::find(filename.begin(), filename.end(), '.');
+ if (dot == filename.end())
+ return filename;
+
+ // Put the translated font filename string back together.
+ Common::String result(filename.begin(), dot);
+ result += '-';
+ result += TransMan.getCurrentCharset();
+ result += dot;
+
+ return result;
+#endif
+}
+
} // End of namespace Graphics
diff --git a/graphics/fontman.h b/graphics/fontman.h
index d3b84ffa7c..858a733d45 100644
--- a/graphics/fontman.h
+++ b/graphics/fontman.h
@@ -36,7 +36,7 @@ class Font;
class FontManager : public Common::Singleton<FontManager> {
public:
enum FontUsage {
- kOSDFont = 0,
+ kLocalizedFont = 0,
kConsoleFont = 1,
kGUIFont = 2,
kBigGUIFont = 3
@@ -57,14 +57,14 @@ public:
* @param font the font object
* @return true on success, false on failure
*/
- bool assignFontToName(const Common::String &name, const Font *font) { _fontMap[name] = font; return true; }
+ bool assignFontToName(const Common::String &name, const Font *font);
/**
* Removes binding from name to font
*
* @param name name which should be removed
*/
- void removeFontName(const Common::String &name) { _fontMap.erase(name); }
+ void removeFontName(const Common::String &name);
/**
* Retrieve a font object based on what it is supposed
@@ -75,8 +75,26 @@ public:
*/
const Font *getFontByUsage(FontUsage usage) const;
+ /**
+ * Get the localized font for the current TranslationManager charset from the
+ * non localized font name
+ *
+ * @param filename the non-localized font file name.
+ * @return The localized font file name.
+ */
+ Common::String genLocalizedFontFilename(const Common::String &filename) const;
+
//const Font *getFontBySize(int size???) const;
+protected:
+ /**
+ * Get the name of the localized font for the given usage. There is no garanty that
+ * the font exists. If the usage is kLocalizedFont it returns an empty string.
+ *
+ * @param usage a FontUsage enum value indicating what the font will be used for.
+ * @return the name of a localized font or an empty string if no suitable font was found.
+ */
+ Common::String getLocalizedFontNameByUsage(FontUsage usage) const;
private:
friend class Common::Singleton<SingletonBaseType>;
diff --git a/graphics/fonts/scummfont.cpp b/graphics/fonts/scummfont.cpp
deleted file mode 100644
index 1ff1e51fdc..0000000000
--- a/graphics/fonts/scummfont.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-/* 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 2
- * 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, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "graphics/font.h"
-#include "graphics/surface.h"
-
-namespace Graphics {
-
-// Built-in font
-static const byte guifont[] = {
- // Header
- 0, 0, 99, 1, 226, 8,
- // Character width table
- 4, 8, 6, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8, 2, 1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 3, 7, 8, 7, 7, 8, 4, 5, 5, 8, 7, 4, 7, 3, 8,
- 7, 7, 7, 7, 8, 7, 7, 7, 7, 7, 3, 4, 7, 5, 7, 7,
- 8, 7, 7, 7, 7, 7, 7, 7, 7, 5, 7, 7, 7, 8, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 5, 8, 5, 8, 8,
- 7, 7, 7, 6, 7, 7, 7, 7, 7, 5, 6, 7, 5, 8, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 8, 7, 7, 7, 5, 3, 5, 7, 8,
- 7, 7, 7, 7, 7, 7, 0, 6, 7, 7, 7, 5, 5, 5, 7, 0,
- 6, 8, 8, 7, 7, 7, 7, 7, 0, 7, 7, 0, 0, 0, 0, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7,
- // Character table
- 0, 0, 0, 0, 0, 0, 0, 0, // 0
- 1, 3, 6, 12, 24, 62, 3, 0, // 1
- 128, 192, 96, 48, 24, 124, 192, 0, // 2
- 0, 3, 62, 24, 12, 6, 3, 1, // 3
- 0, 192, 124, 24, 48, 96, 192, 128, // 4
- 0, 0, 0, 0, 0, 0, 0, 0, // 5
- 0, 0, 0, 0, 0, 0, 0, 0, // 6
- 0, 0, 0, 0, 0, 0, 0, 0, // 7
- 0, 0, 0, 0, 0, 0, 0, 0, // 8
- 0, 0, 0, 0, 0, 0, 0, 0, // 9
- 0, 0, 0, 0, 0, 0, 0, 0, // 10
- 0, 0, 0, 0, 0, 0, 0, 0, // 11
- 0, 0, 0, 0, 0, 0, 0, 0, // 12
- 0, 0, 0, 0, 0, 0, 0, 0, // 13
- 0, 0, 0, 0, 0, 0, 0, 0, // 14
- 0, 0, 0, 0, 0, 0, 0, 0, // 15
- 237, 74, 72, 0, 0, 0, 0, 0, // 16
- 128, 128, 128, 0, 0, 0, 0, 0, // 17
- 0, 0, 0, 0, 0, 0, 0, 0, // 18
- 60, 66, 153, 161, 161, 153, 66, 60, // 19
- 0, 0, 0, 0, 0, 0, 0, 0, // 20
- 0, 0, 0, 0, 0, 0, 0, 0, // 21
- 0, 0, 0, 0, 0, 0, 0, 0, // 22
- 0, 0, 0, 0, 0, 0, 0, 0, // 23
- 0, 0, 0, 0, 0, 0, 0, 0, // 24
- 0, 0, 0, 0, 0, 0, 0, 0, // 25
- 0, 0, 0, 0, 0, 0, 0, 0, // 26
- 0, 0, 0, 0, 0, 0, 0, 0, // 27
- 0, 0, 0, 0, 0, 0, 0, 0, // 28
- 0, 0, 0, 0, 0, 0, 0, 0, // 29
- 0, 0, 0, 0, 0, 0, 0, 0, // 30
- 0, 0, 0, 0, 0, 0, 0, 0, // 31
- 0, 0, 0, 0, 0, 0, 0, 0, // 32
- 96, 96, 96, 96, 0, 0, 96, 0, // 33
- 102, 102, 102, 0, 0, 0, 0, 0, // 34
- 102, 102, 255, 102, 255, 102, 102, 0, // 35
- 24, 62, 96, 60, 6, 124, 24, 0, // 36
- 98, 102, 12, 24, 48, 102, 70, 0, // 37
- 60, 102, 60, 56, 103, 102, 63, 0, // 38
- 96, 48, 16, 0, 0, 0, 0, 0, // 39
- 24, 48, 96, 96, 96, 48, 24, 0, // 40
- 96, 48, 24, 24, 24, 48, 96, 0, // 41
- 0, 102, 60, 255, 60, 102, 0, 0, // 42
- 0, 24, 24, 126, 24, 24, 0, 0, // 43
- 0, 0, 0, 0, 0, 48, 48, 96, // 44
- 0, 0, 0, 126, 0, 0, 0, 0, // 45
- 0, 0, 0, 0, 0, 96, 96, 0, // 46
- 0, 3, 6, 12, 24, 48, 96, 0, // 47
- 60, 102, 102, 102, 102, 102, 60, 0, // 48
- 24, 24, 56, 24, 24, 24, 126, 0, // 49
- 60, 102, 6, 12, 48, 96, 126, 0, // 50
- 60, 102, 6, 28, 6, 102, 60, 0, // 51
- 6, 14, 30, 102, 127, 6, 6, 0, // 52
- 126, 96, 124, 6, 6, 102, 60, 0, // 53
- 60, 102, 96, 124, 102, 102, 60, 0, // 54
- 126, 102, 12, 24, 24, 24, 24, 0, // 55
- 60, 102, 102, 60, 102, 102, 60, 0, // 56
- 60, 102, 102, 62, 6, 102, 60, 0, // 57
- 0, 0, 96, 0, 0, 96, 0, 0, // 58
- 0, 0, 48, 0, 0, 48, 48, 96, // 59
- 14, 24, 48, 96, 48, 24, 14, 0, // 60
- 0, 0, 120, 0, 120, 0, 0, 0, // 61
- 112, 24, 12, 6, 12, 24, 112, 0, // 62
- 60, 102, 6, 12, 24, 0, 24, 0, // 63
- 0, 0, 0, 255, 255, 0, 0, 0, // 64
- 24, 60, 102, 126, 102, 102, 102, 0, // 65
- 124, 102, 102, 124, 102, 102, 124, 0, // 66
- 60, 102, 96, 96, 96, 102, 60, 0, // 67
- 120, 108, 102, 102, 102, 108, 120, 0, // 68
- 126, 96, 96, 120, 96, 96, 126, 0, // 69
- 126, 96, 96, 120, 96, 96, 96, 0, // 70
- 60, 102, 96, 110, 102, 102, 60, 0, // 71
- 102, 102, 102, 126, 102, 102, 102, 0, // 72
- 120, 48, 48, 48, 48, 48, 120, 0, // 73
- 30, 12, 12, 12, 12, 108, 56, 0, // 74
- 102, 108, 120, 112, 120, 108, 102, 0, // 75
- 96, 96, 96, 96, 96, 96, 126, 0, // 76
- 99, 119, 127, 107, 99, 99, 99, 0, // 77
- 102, 118, 126, 126, 110, 102, 102, 0, // 78
- 60, 102, 102, 102, 102, 102, 60, 0, // 79
- 124, 102, 102, 124, 96, 96, 96, 0, // 80
- 60, 102, 102, 102, 102, 60, 14, 0, // 81
- 124, 102, 102, 124, 120, 108, 102, 0, // 82
- 60, 102, 96, 60, 6, 102, 60, 0, // 83
- 126, 24, 24, 24, 24, 24, 24, 0, // 84
- 102, 102, 102, 102, 102, 102, 60, 0, // 85
- 102, 102, 102, 102, 102, 60, 24, 0, // 86
- 99, 99, 99, 107, 127, 119, 99, 0, // 87
- 102, 102, 60, 24, 60, 102, 102, 0, // 88
- 102, 102, 102, 60, 24, 24, 24, 0, // 89
- 126, 6, 12, 24, 48, 96, 126, 0, // 90
- 120, 96, 96, 96, 96, 96, 120, 0, // 91
- 3, 6, 12, 24, 48, 96, 192, 0, // 92
- 120, 24, 24, 24, 24, 24, 120, 0, // 93
- 0, 0, 0, 0, 0, 219, 219, 0, // 94
- 0, 0, 0, 0, 0, 0, 0, 255, // 95
- 102, 102, 102, 0, 0, 0, 0, 0, // 96
- 0, 0, 60, 6, 62, 102, 62, 0, // 97
- 0, 96, 96, 124, 102, 102, 124, 0, // 98
- 0, 0, 60, 96, 96, 96, 60, 0, // 99
- 0, 6, 6, 62, 102, 102, 62, 0, // 100
- 0, 0, 60, 102, 126, 96, 60, 0, // 101
- 0, 14, 24, 62, 24, 24, 24, 0, // 102
- 0, 0, 62, 102, 102, 62, 6, 124, // 103
- 0, 96, 96, 124, 102, 102, 102, 0, // 104
- 0, 48, 0, 112, 48, 48, 120, 0, // 105
- 0, 12, 0, 12, 12, 12, 12, 120, // 106
- 0, 96, 96, 108, 120, 108, 102, 0, // 107
- 0, 112, 48, 48, 48, 48, 120, 0, // 108
- 0, 0, 102, 127, 127, 107, 99, 0, // 109
- 0, 0, 124, 102, 102, 102, 102, 0, // 110
- 0, 0, 60, 102, 102, 102, 60, 0, // 111
- 0, 0, 124, 102, 102, 124, 96, 96, // 112
- 0, 0, 62, 102, 102, 62, 6, 6, // 113
- 0, 0, 124, 102, 96, 96, 96, 0, // 114
- 0, 0, 62, 96, 60, 6, 124, 0, // 115
- 0, 24, 126, 24, 24, 24, 14, 0, // 116
- 0, 0, 102, 102, 102, 102, 62, 0, // 117
- 0, 0, 102, 102, 102, 60, 24, 0, // 118
- 0, 0, 99, 107, 127, 62, 54, 0, // 119
- 0, 0, 102, 60, 24, 60, 102, 0, // 120
- 0, 0, 102, 102, 102, 62, 12, 120, // 121
- 0, 0, 126, 12, 24, 48, 126, 0, // 122
- 24, 48, 48, 96, 48, 48, 24, 0, // 123
- 96, 96, 96, 0, 96, 96, 96, 0, // 124
- 96, 48, 48, 24, 48, 48, 96, 0, // 125
- 0, 0, 97, 153, 134, 0, 0, 0, // 126
- 8, 12, 14, 255, 255, 14, 12, 8, // 127
- 60, 102, 96, 96, 102, 60, 24, 56, // 128
- 102, 0, 102, 102, 102, 102, 62, 0, // 129
- 12, 24, 60, 102, 126, 96, 60, 0, // 130
- 24, 36, 60, 6, 62, 102, 62, 0, // 131
- 102, 0, 60, 6, 62, 102, 62, 0, // 132
- 48, 24, 60, 6, 62, 102, 62, 0, // 133
- 0, 0, 0, 0, 0, 0, 0, 0, // 134
- 0, 60, 96, 96, 96, 60, 24, 56, // 135
- 24, 36, 60, 102, 126, 96, 60, 0, // 136
- 102, 0, 60, 102, 126, 96, 60, 0, // 137
- 48, 24, 60, 102, 126, 96, 60, 0, // 138
- 0, 216, 0, 112, 48, 48, 120, 0, // 139
- 48, 72, 0, 112, 48, 48, 120, 0, // 140
- 96, 48, 0, 112, 48, 48, 120, 0, // 141
- 102, 24, 60, 102, 126, 102, 102, 0, // 142
- 0, 0, 0, 0, 0, 0, 0, 0, // 143
- 24, 48, 124, 96, 120, 96, 124, 0, // 144
- 0, 0, 108, 26, 126, 216, 110, 0, // 145
- 30, 40, 40, 126, 72, 136, 142, 0, // 146
- 24, 36, 60, 102, 102, 102, 60, 0, // 147
- 102, 0, 60, 102, 102, 102, 60, 0, // 148
- 48, 24, 60, 102, 102, 102, 60, 0, // 149
- 24, 36, 0, 102, 102, 102, 62, 0, // 150
- 48, 24, 102, 102, 102, 102, 62, 0, // 151
- 0, 0, 0, 0, 0, 0, 0, 0, // 152
- 102, 60, 102, 102, 102, 102, 60, 0, // 153
- 102, 0, 102, 102, 102, 102, 60, 0, // 154
- 0, 0, 0, 0, 0, 0, 0, 0, // 155
- 0, 0, 0, 0, 0, 0, 0, 0, // 156
- 0, 0, 0, 0, 0, 0, 0, 0, // 157
- 0, 0, 0, 0, 0, 0, 0, 0, // 158
- 0, 0, 0, 0, 0, 0, 0, 0, // 159
- 12, 24, 60, 6, 62, 102, 62, 0, // 160
- 0, 0, 0, 0, 0, 0, 0, 0, // 161
- 0, 0, 0, 0, 0, 0, 0, 0, // 162
- 0, 0, 0, 0, 0, 0, 0, 0, // 163
- 0, 0, 0, 0, 0, 0, 0, 0, // 164
- 0, 0, 0, 0, 0, 0, 0, 0, // 165
- 0, 0, 0, 0, 0, 0, 0, 0, // 166
- 0, 0, 0, 0, 0, 0, 0, 0, // 167
- 0, 0, 0, 0, 0, 0, 0, 0, // 168
- 0, 0, 0, 0, 0, 0, 0, 0, // 169
- 0, 0, 0, 0, 0, 0, 0, 0, // 170
- 0, 0, 0, 0, 0, 0, 0, 0, // 171
- 0, 0, 0, 0, 0, 0, 0, 0, // 172
- 0, 0, 0, 0, 0, 0, 0, 0, // 173
- 0, 0, 0, 0, 0, 0, 0, 0, // 174
- 0, 0, 0, 0, 0, 0, 0, 0, // 175
- 0, 0, 0, 0, 0, 0, 0, 0, // 176
- 0, 0, 0, 0, 0, 0, 0, 0, // 177
- 0, 0, 0, 0, 0, 0, 0, 0, // 178
- 0, 0, 0, 0, 0, 0, 0, 0, // 179
- 0, 0, 0, 0, 0, 0, 0, 0, // 180
- 0, 0, 0, 0, 0, 0, 0, 0, // 181
- 0, 0, 0, 0, 0, 0, 0, 0, // 182
- 0, 0, 0, 0, 0, 0, 0, 0, // 183
- 0, 0, 0, 0, 0, 0, 0, 0, // 184
- 0, 0, 0, 0, 0, 0, 0, 0, // 185
- 0, 0, 0, 0, 0, 0, 0, 0, // 186
- 0, 0, 0, 0, 0, 0, 0, 0, // 187
- 0, 0, 0, 0, 0, 0, 0, 0, // 188
- 0, 0, 0, 0, 0, 0, 0, 0, // 189
- 0, 0, 0, 0, 0, 0, 0, 0, // 190
- 0, 0, 0, 0, 0, 0, 0, 0, // 191
- 0, 0, 0, 0, 0, 0, 0, 0, // 192
- 0, 0, 0, 0, 0, 0, 0, 0, // 193
- 0, 0, 0, 0, 0, 0, 0, 0, // 194
- 0, 0, 0, 0, 0, 0, 0, 0, // 195
- 0, 0, 0, 0, 0, 0, 0, 0, // 196
- 0, 0, 0, 0, 0, 0, 0, 0, // 197
- 0, 0, 0, 0, 0, 0, 0, 0, // 198
- 0, 0, 0, 0, 0, 0, 0, 0, // 199
- 0, 0, 0, 0, 0, 0, 0, 0, // 200
- 0, 0, 0, 0, 0, 0, 0, 0, // 201
- 0, 0, 0, 0, 0, 0, 0, 0, // 202
- 0, 0, 0, 0, 0, 0, 0, 0, // 203
- 0, 0, 0, 0, 0, 0, 0, 0, // 204
- 0, 0, 0, 0, 0, 0, 0, 0, // 205
- 0, 0, 0, 0, 0, 0, 0, 0, // 206
- 0, 0, 0, 0, 0, 0, 0, 0, // 207
- 0, 0, 0, 0, 0, 0, 0, 0, // 208
- 0, 0, 0, 0, 0, 0, 0, 0, // 209
- 0, 0, 0, 0, 0, 0, 0, 0, // 210
- 0, 0, 0, 0, 0, 0, 0, 0, // 211
- 0, 0, 0, 0, 0, 0, 0, 0, // 212
- 0, 0, 0, 0, 0, 0, 0, 0, // 213
- 0, 0, 0, 0, 0, 0, 0, 0, // 214
- 0, 0, 0, 0, 0, 0, 0, 0, // 215
- 0, 0, 0, 0, 0, 0, 0, 0, // 216
- 0, 0, 0, 0, 0, 0, 0, 0, // 217
- 0, 0, 0, 0, 0, 0, 0, 0, // 218
- 0, 0, 0, 0, 0, 0, 0, 0, // 219
- 0, 0, 0, 0, 0, 0, 0, 0, // 220
- 0, 0, 0, 0, 0, 0, 0, 0, // 221
- 0, 0, 0, 0, 0, 0, 0, 0, // 222
- 0, 0, 0, 0, 0, 0, 0, 0, // 223
- 0, 0, 0, 0, 0, 0, 0, 0, // 224
- 28, 54, 54, 124, 102, 102, 124, 64, // 225
- 0, 0, 0 // ???
-};
-
-int ScummFont::getCharWidth(byte chr) const {
- return guifont[chr+6];
-}
-
-void ScummFont::drawChar(Surface *dst, byte chr, int tx, int ty, uint32 color) const {
- assert(dst != 0);
- byte *ptr = (byte *)dst->getBasePtr(tx, ty);
-
- const byte *tmp = guifont + 6 + guifont[4] + chr * 8;
- uint buffer = 0;
- uint mask = 0;
-
- for (int y = 0; y < 8; y++) {
- if (ty + y < 0 || ty + y >= dst->h)
- continue;
- for (int x = 0; x < 8; x++) {
- if (tx + x < 0 || tx + x >= dst->w)
- continue;
- unsigned char c;
- mask >>= 1;
- if (mask == 0) {
- buffer = *tmp++;
- mask = 0x80;
- }
- c = ((buffer & mask) != 0);
- if (c) {
- if (dst->format.bytesPerPixel == 1)
- ptr[x] = color;
- else if (dst->format.bytesPerPixel == 2)
- ((uint16 *)ptr)[x] = color;
- }
- }
- ptr += dst->pitch;
- }
-}
-
-} // End of namespace Graphics
diff --git a/graphics/module.mk b/graphics/module.mk
index a9051c868a..32658c96bd 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -9,7 +9,6 @@ MODULE_OBJS := \
fonts/consolefont.o \
fonts/newfont_big.o \
fonts/newfont.o \
- fonts/scummfont.o \
fonts/winfont.o \
iff.o \
imagedec.o \
diff --git a/graphics/scaler/Normal2xARM.s b/graphics/scaler/Normal2xARM.s
index 9afe3f34f0..e3592295e0 100644
--- a/graphics/scaler/Normal2xARM.s
+++ b/graphics/scaler/Normal2xARM.s
@@ -44,6 +44,7 @@ Normal2xARM:
ADD r3, r3, r6
yloop:
SUBS r14,r4, #4
+ ADDLT r14,r14, #4
BLT thin
xloop:
LDRH r6, [r0], #2
diff --git a/graphics/scaler/aspect.cpp b/graphics/scaler/aspect.cpp
index 64a1cd1534..943395aff3 100644
--- a/graphics/scaler/aspect.cpp
+++ b/graphics/scaler/aspect.cpp
@@ -57,19 +57,6 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1
template<typename ColorMask, int scale>
static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint16 *srcB, int width) {
- // For efficiency reasons we blit two pixels at a time, so it is important
- // that makeRectStretchable() guarantees that the width is even and that
- // the rect starts on a well-aligned address. (Even where unaligned memory
- // access is allowed there may be a speed penalty for it.)
-
- // These asserts are disabled for maximal speed; but I leave them in here
- // in case other people want to test if the memory alignment (to an
- // address divisible by 4) is really working properly.
- //assert(((int)dst & 3) == 0);
- //assert(((int)srcA & 3) == 0);
- //assert(((int)srcB & 3) == 0);
- //assert((width & 1) == 0);
-
if (scale == 1) {
while (width--) {
*dst++ = interpolate16_7_1<ColorMask>(*srcB++, *srcA++);
@@ -86,6 +73,18 @@ static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint1
template<typename ColorMask, int scale>
static inline void interpolate5Line(uint16 *dst, const uint16 *srcA, const uint16 *srcB, int width) {
+ // For efficiency reasons we blit two pixels at a time, so it is important
+ // that makeRectStretchable() guarantees that the width is even and that
+ // the rect starts on a well-aligned address. (Even where unaligned memory
+ // access is allowed there may be a speed penalty for it.)
+
+ // These asserts are disabled for maximal speed; but I leave them in here
+ // in case other people want to test if the memory alignment (to an
+ // address divisible by 4) is really working properly.
+ //assert(((int)dst & 3) == 0);
+ //assert(((int)srcA & 3) == 0);
+ //assert(((int)srcB & 3) == 0);
+ //assert((width & 1) == 0);
width /= 2;
const uint32 *sA = (const uint32 *)srcA;
diff --git a/graphics/scaler/downscaler.cpp b/graphics/scaler/downscaler.cpp
index fa17490475..65400ccd46 100644
--- a/graphics/scaler/downscaler.cpp
+++ b/graphics/scaler/downscaler.cpp
@@ -22,7 +22,7 @@
#include "graphics/scaler/downscaler.h"
#include "graphics/scaler/intern.h"
-#ifdef ARM
+#ifdef USE_ARM_SCALER_ASM
extern "C" {
void DownscaleAllByHalfARM(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int mask, int round);
}