Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRIFFON: Adding TTS to intro story #2907

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 56 additions & 2 deletions engines/griffon/cutscenes.cpp
Expand Up @@ -38,6 +38,10 @@

#include "griffon/griffon.h"

#ifdef USE_TTS
#include "common/text-to-speech.h"
#endif

namespace Griffon {

#define POLL_AND_CHECK_QUIT() if (g_system->getEventManager()->pollEvent(_event)) { \
Expand Down Expand Up @@ -133,6 +137,49 @@ const char *story2[27] = {
"and I am free to die as I please."
};

const char *story3 =
"Story"
" "
"Ever since I was a child"
"I remember being told the"
"Legend of the Griffon Knights,"
"who rid the world of the"
"Dragon Empire. These great"
"heroes inspired us to become"
"knights as well."
" "
"Now, 500 years after the war"
"ended, the Dragons have"
"returned. Cities are falling"
"from the lack of knights to"
"protect them."
" "
"We never saw it coming."
" "
"And now, here I am, making"
"my way into the lower town"
"of Fidelis, a small city on"
"the main continent. The rest"
"of my men have died over"
"the last couple days from"
"aerial attacks."
" "
"We believed we could find"
"shelter here, only to find"
"every last griffon dead,"
// "the town burned to the ground,"
// "and transformed into a garrison"
// "for the Dragon forces."
// " "
// "In these dark times, I try to"
// "draw strength from the stories"
// "of those knights that risked"
// "everything to protect their homeland,"
// " "
// "and hope that I can die"
// "with that honor as well."
;

void GriffonEngine::showLogos() {
_ticks = g_system->getMillis();
int ticks1 = _ticks;
Expand Down Expand Up @@ -182,6 +229,11 @@ void GriffonEngine::showLogos() {
}

void GriffonEngine::intro() {
#ifdef USE_TTS
Common::TextToSpeechManager *_ttsMan = g_system->getTextToSpeechManager();
_ttsMan->say(story3);
#endif

_videoBuffer2->fillRect(Common::Rect(0, 0, _videoBuffer2->w, _videoBuffer2->h), 0);
_videoBuffer3->fillRect(Common::Rect(0, 0, _videoBuffer3->w, _videoBuffer3->h), 0);

Expand Down Expand Up @@ -233,7 +285,7 @@ void GriffonEngine::intro() {
cnt = 0;
y--;
}

for (int i = 0; i <= 37; i++) {
int yy = y + i * 10;
if (yy > -8 && yy < 240) {
Expand Down Expand Up @@ -368,14 +420,16 @@ void GriffonEngine::endOfGame() {

y = y - spd * _fpsr;
for (int i = 0; i <= 26; i++) {

int yy = y + i * 10;
if (yy > -8 && yy < 240) {
int x = 160 - strlen(story2[i]) * 4;
drawString(_videoBuffer, story2[i], x, yy, 4);
drawString(_videoBuffer, story2[i], x, yy, 4);
}

if (yy < 10 && i == 25)
break;

}

ya = 255;
Expand Down