Permalink
Browse files

PINK: implemented text drawing in ActionText for English version

  • Loading branch information...
whiterandrek committed Aug 5, 2018
1 parent ca54a72 commit c255de107d3dc57e210857a7bf34847e36f3dc0c
@@ -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
@@ -115,6 +115,7 @@ class PinkEngine : public Engine {
void executeMenuCommand(uint id);
const ADGameDescription &getGameDesc() { return _desc; }
OrbFile *getOrb() { return &_orb; }
BroFile *getBro() { return _bro; }
Common::RandomSource &getRnd() { return _rnd; };
@@ -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);
}
@@ -52,8 +52,6 @@ class ResourceMgr {
Common::SafeSeekableSubReadStream *getResourceStream(const Common::String &name);
Common::String loadText(Common::String &name);
PinkEngine *getGame() const { return _game; }
private:

0 comments on commit c255de1

Please sign in to comment.