aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge/statusba.cpp
diff options
context:
space:
mode:
authorSimei Yin2017-07-21 00:11:17 +0200
committerSimei Yin2017-07-21 11:21:45 +0200
commit4a54a027607cd41255406b8d82d0bf54ecd5fa14 (patch)
tree5db3bb83d8fec6fa889bc7ac6cf021bd197f6405 /engines/sludge/statusba.cpp
parent73a81a5089627599d9adbedf6d2d4dc0122d48c5 (diff)
downloadscummvm-rg350-4a54a027607cd41255406b8d82d0bf54ecd5fa14.tar.gz
scummvm-rg350-4a54a027607cd41255406b8d82d0bf54ecd5fa14.tar.bz2
scummvm-rg350-4a54a027607cd41255406b8d82d0bf54ecd5fa14.zip
SLUDGE: Objectify text manager
Diffstat (limited to 'engines/sludge/statusba.cpp')
-rw-r--r--engines/sludge/statusba.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/engines/sludge/statusba.cpp b/engines/sludge/statusba.cpp
index e46736a07d..9e8546a3ff 100644
--- a/engines/sludge/statusba.cpp
+++ b/engines/sludge/statusba.cpp
@@ -39,7 +39,6 @@ SpritePalette litVerbLinePalette;
StatusStuff mainStatus;
StatusStuff *nowStatus = & mainStatus;
-extern int fontHeight;
void setLitStatus(int i) {
nowStatus->litStatus = i;
@@ -93,18 +92,24 @@ void drawStatusBar() {
while (stat) {
switch (nowStatus->alignStatus) {
case IN_THE_CENTRE:
- pasteString(stat->text, ((g_system->getWidth() - stringWidth(stat->text)) >> 1) / cameraZoom, y / cameraZoom, (n++ == nowStatus->litStatus) ? litVerbLinePalette : verbLinePalette);
+ g_sludge->_txtMan->pasteString(stat->text,
+ ((g_system->getWidth() - g_sludge->_txtMan->stringWidth(stat->text)) >> 1) / cameraZoom, y / cameraZoom,
+ (n++ == nowStatus->litStatus) ? litVerbLinePalette : verbLinePalette);
break;
case 1001:
- pasteString(stat->text, (g_system->getWidth() - stringWidth(stat->text)) - nowStatus->statusX / cameraZoom, y / cameraZoom, (n ++ == nowStatus->litStatus) ? litVerbLinePalette : verbLinePalette);
+ g_sludge->_txtMan->pasteString(stat->text,
+ (g_system->getWidth() - g_sludge->_txtMan->stringWidth(stat->text)) - nowStatus->statusX / cameraZoom, y / cameraZoom,
+ (n ++ == nowStatus->litStatus) ? litVerbLinePalette : verbLinePalette);
break;
default:
- pasteString(stat->text, nowStatus->statusX / cameraZoom, y / cameraZoom, (n ++ == nowStatus->litStatus) ? litVerbLinePalette : verbLinePalette);
+ g_sludge->_txtMan->pasteString(stat->text,
+ nowStatus->statusX / cameraZoom, y / cameraZoom,
+ (n ++ == nowStatus->litStatus) ? litVerbLinePalette : verbLinePalette);
}
stat = stat->next;
- y -= fontHeight;
+ y -= g_sludge->_txtMan->getFontHeight();
}
}
@@ -122,7 +127,7 @@ void statusBarLitColour(byte r, byte g, byte b) {
nowStatus->statusLB = b;
}
-StatusStuff *copyStatusBarStuff(StatusStuff *here) {
+StatusStuff *copyStatusBarStuff(StatusStuff *here) {
// Things we want to keep
here->statusLR = nowStatus->statusLR;
@@ -145,7 +150,7 @@ StatusStuff *copyStatusBarStuff(StatusStuff *here) {
return old;
}
-void restoreBarStuff(StatusStuff *here) {
+void restoreBarStuff(StatusStuff *here) {
delete nowStatus;
setFontColour(verbLinePalette, here->statusR, here->statusG, here->statusB);
setFontColour(litVerbLinePalette, here->statusLR, here->statusLG, here->statusLB);