[Scummvm-git-logs] scummvm master -> 80dd7b2c0d72fbf4a0397808bcf590b21767e277

dreammaster dreammaster at scummvm.org
Mon Dec 25 06:05:04 CET 2017


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

Summary:
6b5eab62f6 XEEN: Fix animated text cursor partialy overlapping prior char
6f87fa97c1 XEEN: Fix scrolling crashes in Quest dialog when it's empty
7a8d99f332 XEEN: Fix transitioning to other maps in the overworld
eb067079bb XEEN: Fix Please Wait dialog not removing when changing maps
80dd7b2c0d XEEN: Fix updating party icons after drinking HP fountain


Commit: 6b5eab62f6146beda92b686f10797b8e28a2ffe3
    https://github.com/scummvm/scummvm/commit/6b5eab62f6146beda92b686f10797b8e28a2ffe3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-24T23:53:31-05:00

Commit Message:
XEEN: Fix animated text cursor partialy overlapping prior char

Changed paths:
    engines/xeen/dialogs_input.cpp
    engines/xeen/font.cpp
    engines/xeen/font.h
    engines/xeen/window.h


diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp
index a0573d2..8346c8e 100644
--- a/engines/xeen/dialogs_input.cpp
+++ b/engines/xeen/dialogs_input.cpp
@@ -120,14 +120,11 @@ Common::KeyCode Input::waitForKey(const Common::String &msg) {
 void Input::animateCursor() {
 	// Iterate through each frame
 	_cursorAnimIndex = _cursorAnimIndex ? _cursorAnimIndex - 1 : 5;
-	static const int CURSOR_ANIMATION_IDS[] = { 32, 124, 126, 127, 126, 124 };
+	static const char CURSOR_ANIMATION_IDS[] = { 32, 124, 126, 127, 126, 124 };
 
 	// Form a string for the cursor and write it out
-	Common::String cursorStr = Common::String::format("%c",
-		CURSOR_ANIMATION_IDS[_cursorAnimIndex]);
-
 	Common::Point writePos = _window->_writePos;
-	_window->writeString(cursorStr);
+	_window->writeCharacter(CURSOR_ANIMATION_IDS[_cursorAnimIndex]);
 	_window->_writePos = writePos;
 }
 
diff --git a/engines/xeen/font.cpp b/engines/xeen/font.cpp
index 1d7dab7..3a70c4c 100644
--- a/engines/xeen/font.cpp
+++ b/engines/xeen/font.cpp
@@ -247,6 +247,13 @@ const char *FontSurface::writeString(const Common::String &s, const Common::Rect
 	return _displayString;
 }
 
+void FontSurface::writeCharacter(char c, const Common::Rect &clipRect) {
+	Justify justify = _fontJustify;
+	_fontJustify = JUSTIFY_NONE;
+	writeString(Common::String::format("%c", c), clipRect);
+	_fontJustify = justify;
+}
+
 char FontSurface::getNextChar() {
 	return  *_displayString++ & 0x7f;
 }
diff --git a/engines/xeen/font.h b/engines/xeen/font.h
index d4f10d6..ca2cf87 100644
--- a/engines/xeen/font.h
+++ b/engines/xeen/font.h
@@ -96,6 +96,13 @@ public:
 	 *		justification is set, the message will be written at _writePos
 	 */
 	const char *writeString(const Common::String &s, const Common::Rect &clipRect);
+
+	/**
+	 * Write a charcter to the window
+	 * @param c			Character
+	 * @param clipRect	Window bounds to display string within
+	 */
+	void writeCharacter(char c, const Common::Rect &clipRect);
 };
 
 } // End of namespace Xeen
diff --git a/engines/xeen/window.h b/engines/xeen/window.h
index 2389065..b63943f 100644
--- a/engines/xeen/window.h
+++ b/engines/xeen/window.h
@@ -148,6 +148,14 @@ public:
 	const char *writeString(const Common::String &s) {
 		return FontSurface::writeString(s, _innerBounds);
 	}
+
+	/**
+	 * Write a charcter to the window
+	 * @param c			Character
+	 */
+	void writeCharacter(char c) {
+		FontSurface::writeCharacter(c, _innerBounds);
+	}
 };
 
 } // End of namespace Xeen


Commit: 6f87fa97c10f8b229be6ecc92a2d188164abd810
    https://github.com/scummvm/scummvm/commit/6f87fa97c10f8b229be6ecc92a2d188164abd810
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-24T23:53:31-05:00

Commit Message:
XEEN: Fix scrolling crashes in Quest dialog when it's empty

Changed paths:
    engines/xeen/dialogs_quests.cpp


diff --git a/engines/xeen/dialogs_quests.cpp b/engines/xeen/dialogs_quests.cpp
index 6e337aa..5cfd9ef 100644
--- a/engines/xeen/dialogs_quests.cpp
+++ b/engines/xeen/dialogs_quests.cpp
@@ -204,13 +204,13 @@ void Quests::execute() {
 			topRow = 0;
 			break;
 		case Common::KEYCODE_END:
-			topRow = count - 1;
+			topRow = MAX(count - 1, 0);
 			break;
 		case Common::KEYCODE_PAGEUP:
 			topRow = MAX(topRow - 3, 0);
 			break;
 		case Common::KEYCODE_PAGEDOWN:
-			topRow = CLIP(topRow + 3, 0, count - 1);
+			topRow = CLIP(topRow + 3, 0, MAX(count - 1, 0));
 			break;
 		case Common::KEYCODE_UP:
 		case Common::KEYCODE_KP8:
@@ -218,7 +218,7 @@ void Quests::execute() {
 			break;
 		case Common::KEYCODE_DOWN:
 		case Common::KEYCODE_KP2:
-			topRow = CLIP(topRow + 1, 0, count - 1);
+			topRow = CLIP(topRow + 1, 0, MAX(count - 1, 0));
 			break;
 		default:
 			break;


Commit: 7a8d99f33292a00f9d654341abf4189dc3bd71d3
    https://github.com/scummvm/scummvm/commit/7a8d99f33292a00f9d654341abf4189dc3bd71d3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-24T23:53:32-05:00

Commit Message:
XEEN: Fix transitioning to other maps in the overworld

Changed paths:
    engines/xeen/map.cpp


diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 6a442be..688e46a 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -1636,7 +1636,7 @@ void Map::getNewMaze() {
 
 	// Get the correct map to use from the cached list
 	_mazeDataIndex = 0;
-	while (_mazeData[_mazeDataIndex]._mazeId == mapId)
+	while (_mazeData[_mazeDataIndex]._mazeId != mapId)
 		++_mazeDataIndex;
 
 	// Adjust Y and X to be in the 0-15 range, and on the correct surrounding


Commit: eb067079bbf5baa3251ab462a85f68154f8c992f
    https://github.com/scummvm/scummvm/commit/eb067079bbf5baa3251ab462a85f68154f8c992f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-25T00:03:37-05:00

Commit Message:
XEEN: Fix Please Wait dialog not removing when changing maps

Technically, the dialog now doesn't even show up, since loading
the new maps are so fast these days. I've decided against adding
in an explicit delay, because it's less jarring for players to
now be able to walk transparently between maps without interruption

Changed paths:
    engines/xeen/dialogs.cpp
    engines/xeen/dialogs.h
    engines/xeen/map.cpp


diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index d44a361..3062bec 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -201,13 +201,22 @@ void CreditsScreen::execute() {
 
 /*------------------------------------------------------------------------*/
 
-void PleaseWait::show(XeenEngine *vm) {
-	Windows &windows = *vm->_windows;
+PleaseWait::PleaseWait(bool isOops) {
+	_msg = isOops ? Res.OOPS : Res.PLEASE_WAIT;
+}
+
+PleaseWait::~PleaseWait() {
+	Windows &windows = *g_vm->_windows;
+	windows[9].close();
+}
+
+void PleaseWait::show() {
+	Windows &windows = *g_vm->_windows;
 	Window &w = windows[9];
 
-	if (vm->_mode != MODE_0) {
+	if (g_vm->_mode != MODE_0) {
 		w.open();
-		w.writeString(Res.PLEASE_WAIT);
+		w.writeString(_msg);
 		w.update();
 	}
 }
diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h
index 680963f..92e2d3b 100644
--- a/engines/xeen/dialogs.h
+++ b/engines/xeen/dialogs.h
@@ -113,8 +113,13 @@ public:
 };
 
 class PleaseWait {
+private:
+	Common::String _msg;
 public:
-	static void show(XeenEngine *vm);
+	PleaseWait(bool isOops = false);
+	~PleaseWait();
+
+	void show();
 };
 
 } // End of namespace Xeen
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 688e46a..369202b 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -949,17 +949,11 @@ void Map::load(int mapId) {
 	Interface &intf = *g_vm->_interface;
 	Party &party = *g_vm->_party;
 	Sound &sound = *g_vm->_sound;
-	Windows &windows = *g_vm->_windows;
 	IndoorDrawList &indoorList = intf._indoorList;
 	OutdoorDrawList &outdoorList = intf._outdoorList;
 
-	if (intf._falling) {
-		Window &w = windows[9];
-		w.open();
-		w.writeString(Res.OOPS);
-	} else {
-		PleaseWait::show(_vm);
-	}
+	PleaseWait waitMsg(intf._falling);
+	waitMsg.show();
 
 	intf._objNumber = 0;
 	party._stepped = true;
@@ -1313,8 +1307,6 @@ void Map::load(int mapId) {
 	loadSky();
 
 	files.setGameCc(isDarkCc);
-	if (windows[9]._enabled)
-		windows[9].close();
 }
 
 int Map::mazeLookup(const Common::Point &pt, int layerShift, int wallMask) {


Commit: 80dd7b2c0d72fbf4a0397808bcf590b21767e277
    https://github.com/scummvm/scummvm/commit/80dd7b2c0d72fbf4a0397808bcf590b21767e277
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-12-25T00:03:50-05:00

Commit Message:
XEEN: Fix updating party icons after drinking HP fountain

Changed paths:
    engines/xeen/interface.cpp
    engines/xeen/scripts.cpp


diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 968ddbb..0cc509a 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -1898,6 +1898,7 @@ void Interface::spellFX(Character *c) {
 
 	drawParty(true);
 	_tillMove = tillMove;
+	++_charFX[charIndex];
 }
 
 void Interface::obscureScene(Obscurity obscurity) {
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 8314631..75338eb 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -593,6 +593,7 @@ bool Scripts::cmdTakeOrGive(ParamsIterator &params) {
 	int mode1, mode2, mode3, param2;
 	uint32 val1, val2, val3;
 
+	_refreshIcons = true;
 	mode1 = params.readByte();
 	switch (mode1) {
 	case 16:
@@ -876,6 +877,7 @@ bool Scripts::cmdGiveExtended(ParamsIterator &params) {
 	int newLineNum;
 	bool result;
 
+	_refreshIcons = true;
 	int mode = params.readByte();
 	switch (mode) {
 	case 16:





More information about the Scummvm-git-logs mailing list