aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2011-08-13 09:33:39 +0200
committerStrangerke2011-08-13 09:33:39 +0200
commitb02e34cade624362bee157dab364094c1710e548 (patch)
tree08f6c57d7740cd0914eec9645d3cef9b672034e0 /engines
parent58229750ccf6ede03332aec6b8c888fdca2917a0 (diff)
downloadscummvm-rg350-b02e34cade624362bee157dab364094c1710e548.tar.gz
scummvm-rg350-b02e34cade624362bee157dab364094c1710e548.tar.bz2
scummvm-rg350-b02e34cade624362bee157dab364094c1710e548.zip
CGE: Implement sayTime()
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