aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cge/snail.cpp2
-rw-r--r--engines/cge/text.cpp16
-rw-r--r--engines/cge/text.h4
3 files changed, 8 insertions, 14 deletions
diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp
index 2d4c28c0ab..6a5556ca58 100644
--- a/engines/cge/snail.cpp
+++ b/engines/cge/snail.cpp
@@ -995,7 +995,7 @@ void Snail::runCom() {
if (spr && _talkEnable) {
if (spr == _hero && spr->seqTest(-1))
spr->step(kSeqHTalk);
- sayTime(spr);
+ _text->sayTime(spr);
}
break;
case kSnCave:
diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp
index 699bd5bcc1..0e77bb8955 100644
--- a/engines/cge/text.cpp
+++ b/engines/cge/text.cpp
@@ -234,16 +234,12 @@ void CGEEngine::inf(const char *text) {
}
}
-void sayTime(Sprite *spr) {
- /*
- static char t[] = "00:00";
- struct time ti;
- gettime(&ti);
- wtom(ti.ti_hour, t+0, 10, 2);
- wtom(ti.ti_min, t+3, 10, 2);
- Say((*t == '0') ? (t+1) : t, spr);
- */
- warning("STUB: sayTime");
+void Text::sayTime(Sprite *spr) {
+ TimeDate curTime;
+ char t[6];
+ _vm->_system->getTimeAndDate(curTime);
+ sprintf(t, "%d:%02d", curTime.tm_hour, curTime.tm_min);
+ say(t, spr);
}
void killText() {
diff --git a/engines/cge/text.h b/engines/cge/text.h
index bb905ac655..d6845f4361 100644
--- a/engines/cge/text.h
+++ b/engines/cge/text.h
@@ -60,6 +60,7 @@ public:
void preload(int from = 1, int upto = 0x7FFF);
char *getText(int ref);
void say(const char *text, Sprite *spr);
+ void sayTime(Sprite *spr);
private:
CGEEngine *_vm;
};
@@ -67,9 +68,6 @@ private:
extern Talk *_talk;
extern Text *_text;
-void say(const char *text, Sprite *spr);
-void sayTime(Sprite *spr);
-void inf(const char *text);
void killText();
} // End of namespace CGE