[Scummvm-git-logs] scummvm master -> 10766eb46f00c2ed9b3550242ff8463659f5326c

waltervn walter at vanniftrik-it.nl
Fri Jan 27 23:49:37 CET 2017


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

Summary:
5a79b99564 ADL: Fix word wrapping when last line is full
d87b4b3f18 ADL: Remove word wrapping from hires5 item check
10766eb46f ADL: Add support for printing bell character


Commit: 5a79b9956471247392e47014a28a53ab0eeede1e
    https://github.com/scummvm/scummvm/commit/5a79b9956471247392e47014a28a53ab0eeede1e
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2017-01-27T23:14:19+01:00

Commit Message:
ADL: Fix word wrapping when last line is full

Changed paths:
    engines/adl/adl_v2.cpp


diff --git a/engines/adl/adl_v2.cpp b/engines/adl/adl_v2.cpp
index c3e8211..e78366f 100644
--- a/engines/adl/adl_v2.cpp
+++ b/engines/adl/adl_v2.cpp
@@ -183,30 +183,29 @@ Common::String AdlEngine_v2::loadMessage(uint idx) const {
 void AdlEngine_v2::printString(const Common::String &str) {
 	Common::String s(str);
 	uint endPos = TEXT_WIDTH - 1;
+	uint startPos = 0;
 	uint pos = 0;
 
-	while (true) {
-		while (pos <= endPos && pos != s.size()) {
-			s.setChar(APPLECHAR(s[pos]), pos);
-			++pos;
-		}
+	while (pos < s.size()) {
+		s.setChar(APPLECHAR(s[pos]), pos);
 
-		if (pos == s.size())
-			break;
+		if (pos == endPos) {
+			while (s[pos] != APPLECHAR(' ') && s[pos] != APPLECHAR('\r')) {
+				if (pos-- == startPos)
+					error("Word wrapping failed");
+			}
 
-		while (s[pos] != APPLECHAR(' ') && s[pos] != APPLECHAR('\r'))
-			--pos;
+			s.setChar(APPLECHAR('\r'), pos);
+			endPos = pos + TEXT_WIDTH;
+			startPos = pos + 1;
+		}
 
-		s.setChar(APPLECHAR('\r'), pos);
-		endPos = pos + TEXT_WIDTH;
 		++pos;
 	}
 
-	pos = 0;
-	while (pos != s.size()) {
+	for (pos = 0; pos < s.size(); ++pos) {
 		checkTextOverflow(s[pos]);
 		_display->printChar(s[pos]);
-		++pos;
 	}
 
 	checkTextOverflow(APPLECHAR('\r'));


Commit: d87b4b3f1804eb38ea170540335c05b1dff455c5
    https://github.com/scummvm/scummvm/commit/d87b4b3f1804eb38ea170540335c05b1dff455c5
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2017-01-27T23:14:19+01:00

Commit Message:
ADL: Remove word wrapping from hires5 item check

Changed paths:
    engines/adl/hires5.cpp


diff --git a/engines/adl/hires5.cpp b/engines/adl/hires5.cpp
index a1af394..e0f61ba 100644
--- a/engines/adl/hires5.cpp
+++ b/engines/adl/hires5.cpp
@@ -271,7 +271,7 @@ int HiRes5Engine::o_checkItemTimeLimits(ScriptEnv &e) {
 	}
 
 	if (lostAnItem) {
-		printString(_gameStrings.itemTimeLimit);
+		_display->printString(_gameStrings.itemTimeLimit);
 		inputString();
 	}
 


Commit: 10766eb46f00c2ed9b3550242ff8463659f5326c
    https://github.com/scummvm/scummvm/commit/10766eb46f00c2ed9b3550242ff8463659f5326c
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2017-01-27T23:14:19+01:00

Commit Message:
ADL: Add support for printing bell character

Changed paths:
    engines/adl/adl.h
    engines/adl/display.cpp


diff --git a/engines/adl/adl.h b/engines/adl/adl.h
index 543c190..3f26636 100644
--- a/engines/adl/adl.h
+++ b/engines/adl/adl.h
@@ -231,6 +231,7 @@ public:
 	virtual ~AdlEngine();
 
 	bool pollEvent(Common::Event &event) const;
+	void bell(uint count = 1) const;
 
 protected:
 	AdlEngine(OSystem *syst, const AdlGameDescription *gd);
@@ -312,7 +313,6 @@ protected:
 	void drawPic(byte pic, Common::Point pos = Common::Point()) const;
 
 	// Sound
-	void bell(uint count = 1) const;
 	bool playTones(const Tones &tones, bool isMusic, bool allowSkip = false) const;
 
 	// Game state functions
diff --git a/engines/adl/display.cpp b/engines/adl/display.cpp
index e18de6a..c630d03 100644
--- a/engines/adl/display.cpp
+++ b/engines/adl/display.cpp
@@ -33,6 +33,7 @@
 #include "engines/util.h"
 
 #include "adl/display.h"
+#include "adl/adl.h"
 
 namespace Adl {
 
@@ -294,7 +295,10 @@ void Display::moveCursorTo(const Common::Point &pos) {
 void Display::printChar(char c) {
 	if (c == APPLECHAR('\r'))
 		_cursorPos = (_cursorPos / TEXT_WIDTH + 1) * TEXT_WIDTH;
-	else if ((byte)c < 0x80 || (byte)c >= 0xa0) {
+	else if (c == APPLECHAR('\a')) {
+		updateTextScreen();
+		static_cast<AdlEngine *>(g_engine)->bell();
+	} else if ((byte)c < 0x80 || (byte)c >= 0xa0) {
 		setCharAtCursor(c);
 		++_cursorPos;
 	}





More information about the Scummvm-git-logs mailing list