aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge/fonttext.cpp
diff options
context:
space:
mode:
authorSimei Yin2018-04-01 18:02:14 +0200
committerSimei Yin2018-04-01 18:02:14 +0200
commit2ea485579932e9e470cb825ed107eba2a86a85c9 (patch)
treeea972e29e84f35b4dce3fb7fd51e203145313593 /engines/sludge/fonttext.cpp
parent506ed95cdcf11523efb06f8816c4f99a32a6a243 (diff)
downloadscummvm-rg350-2ea485579932e9e470cb825ed107eba2a86a85c9.tar.gz
scummvm-rg350-2ea485579932e9e470cb825ed107eba2a86a85c9.tar.bz2
scummvm-rg350-2ea485579932e9e470cb825ed107eba2a86a85c9.zip
SLUDGE: Move global variable pastePalette to TextManager and refactor a little
Diffstat (limited to 'engines/sludge/fonttext.cpp')
-rw-r--r--engines/sludge/fonttext.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/engines/sludge/fonttext.cpp b/engines/sludge/fonttext.cpp
index 0f63c6e24f..da380f4f0b 100644
--- a/engines/sludge/fonttext.cpp
+++ b/engines/sludge/fonttext.cpp
@@ -48,11 +48,13 @@ void TextManager::init() {
_loadedFontNum = 0;
_fontSpace = -1;
+ _pastePalette.init();
_fontTable.clear();
}
void TextManager::kill() {
GraphicsManager::forgetSpriteBank(_theFont);
+ _pastePalette.kill();
}
bool TextManager::isInFont(const Common::String &theText) {
@@ -110,7 +112,7 @@ void TextManager::pasteString(const Common::String &theText, int xOff, int y, Sp
}
}
-void TextManager::pasteStringToBackdrop(const Common::String &theText, int xOff, int y, SpritePalette &thePal) {
+void TextManager::pasteStringToBackdrop(const Common::String &theText, int xOff, int y) {
if (_fontTable.empty())
return;
@@ -120,12 +122,12 @@ void TextManager::pasteStringToBackdrop(const Common::String &theText, int xOff,
for (uint32 i = 0; i < str32.size(); ++i) {
uint32 c = str32[i];
Sprite *mySprite = &_theFont.sprites[fontInTable(c)];
- g_sludge->_gfxMan->pasteSpriteToBackDrop(xOff, y, *mySprite, thePal);
+ g_sludge->_gfxMan->pasteSpriteToBackDrop(xOff, y, *mySprite, _pastePalette);
xOff += mySprite->surface.w + _fontSpace;
}
}
-void TextManager::burnStringToBackdrop(const Common::String &theText, int xOff, int y, SpritePalette &thePal) {
+void TextManager::burnStringToBackdrop(const Common::String &theText, int xOff, int y) {
if (_fontTable.empty())
return;
@@ -135,17 +137,11 @@ void TextManager::burnStringToBackdrop(const Common::String &theText, int xOff,
for (uint i = 0; i < str32.size(); ++i) {
uint32 c = str32[i];
Sprite *mySprite = &_theFont.sprites[fontInTable(c)];
- g_sludge->_gfxMan->burnSpriteToBackDrop(xOff, y, *mySprite, thePal);
+ g_sludge->_gfxMan->burnSpriteToBackDrop(xOff, y, *mySprite, _pastePalette);
xOff += mySprite->surface.w + _fontSpace;
}
}
-void setFontColour(SpritePalette &sP, byte r, byte g, byte b) {
- sP.originalRed = r;
- sP.originalGreen = g;
- sP.originalBlue = b;
-}
-
bool TextManager::loadFont(int filenum, const Common::String &charOrder, int h) {
_fontOrder.setUTF8String(charOrder);