PINK: implemented text drawing in ActionText for English version

This commit is contained in:
Andrei Prykhodko 2018-08-05 22:08:54 +03:00
parent ca54a72072
commit c255de107d
4 changed files with 9 additions and 11 deletions

View File

@ -77,6 +77,11 @@ void ActionText::start() {
findColorsInPalette();
Director *director = _actor->getPage()->getGame()->getDirector();
Graphics::TextAlign align = _centered ? Graphics::kTextAlignCenter : Graphics::kTextAlignLeft;
Common::SeekableReadStream *stream = _actor->getPage()->getResourceStream(_fileName);
char *str = new char[stream->size()];
stream->read(str, stream->size());
delete stream;
if (_scrollBar) {
Graphics::MacFont *font = new Graphics::MacFont;
@ -85,10 +90,12 @@ void ActionText::start() {
_txtWnd->move(_xLeft, _yTop);
_txtWnd->resize(_xRight - _xLeft, _yBottom - _yTop);
_txtWnd->appendText("Testing ActionText", font);
if (_actor->getPage()->getGame()->getGameDesc().language == Common::EN_ANY)
_txtWnd->appendText(str, font);
} else {
director->addTextAction(this);
}
delete[] str;
}
void ActionText::end() {

View File

@ -115,6 +115,7 @@ public:
void executeMenuCommand(uint id);
const ADGameDescription &getGameDesc() { return _desc; }
OrbFile *getOrb() { return &_orb; }
BroFile *getBro() { return _bro; }
Common::RandomSource &getRnd() { return _rnd; };

View File

@ -55,14 +55,6 @@ void ResourceMgr::clear() {
_resDescTable = nullptr;
}
Common::String ResourceMgr::loadText(Common::String &name) {
Common::SeekableReadStream *stream = getResourceStream(name);
char *txt = new char[stream->size()];
Common::String str(txt, stream->size());
delete [] txt;
return str;
}
static int resDescComp(const void *a, const void *b) {
return scumm_stricmp((const char *)a, (const char *)b);
}

View File

@ -52,8 +52,6 @@ public:
Common::SafeSeekableSubReadStream *getResourceStream(const Common::String &name);
Common::String loadText(Common::String &name);
PinkEngine *getGame() const { return _game; }
private: