[Scummvm-git-logs] scummvm master -> c255de107d3dc57e210857a7bf34847e36f3dc0c

whiterandrek whiterandrek at gmail.com
Sun Aug 5 21:11:35 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c255de107d PINK: implemented text drawing in ActionText for English version


Commit: c255de107d3dc57e210857a7bf34847e36f3dc0c
    https://github.com/scummvm/scummvm/commit/c255de107d3dc57e210857a7bf34847e36f3dc0c
Author: Andrei Prykhodko (whiterandrek at gmail.com)
Date: 2018-08-05T22:08:54+03:00

Commit Message:
PINK: implemented text drawing in ActionText for English version

Changed paths:
    engines/pink/objects/actions/action_text.cpp
    engines/pink/pink.h
    engines/pink/resource_mgr.cpp
    engines/pink/resource_mgr.h


diff --git a/engines/pink/objects/actions/action_text.cpp b/engines/pink/objects/actions/action_text.cpp
index 174ad8c..ea7d486 100644
--- a/engines/pink/objects/actions/action_text.cpp
+++ b/engines/pink/objects/actions/action_text.cpp
@@ -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() {
diff --git a/engines/pink/pink.h b/engines/pink/pink.h
index b46d4f0..bafe15f 100644
--- a/engines/pink/pink.h
+++ b/engines/pink/pink.h
@@ -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; };
diff --git a/engines/pink/resource_mgr.cpp b/engines/pink/resource_mgr.cpp
index 52f9283..dbbfd01 100644
--- a/engines/pink/resource_mgr.cpp
+++ b/engines/pink/resource_mgr.cpp
@@ -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);
 }
diff --git a/engines/pink/resource_mgr.h b/engines/pink/resource_mgr.h
index 7cfd2fb..9f199f8 100644
--- a/engines/pink/resource_mgr.h
+++ b/engines/pink/resource_mgr.h
@@ -52,8 +52,6 @@ public:
 
 	Common::SafeSeekableSubReadStream *getResourceStream(const Common::String &name);
 
-	Common::String loadText(Common::String &name);
-
 	PinkEngine *getGame() const { return _game; }
 
 private:





More information about the Scummvm-git-logs mailing list