[Scummvm-cvs-logs] scummvm master -> f83de4fbfe655591186eb0c4e2df87b1695e9fe9

urukgit urukgit at users.noreply.github.com
Fri Dec 20 08:47:24 CET 2013


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:
f83de4fbfe AVALANCHE: Implement Nim::endOfGame().


Commit: f83de4fbfe655591186eb0c4e2df87b1695e9fe9
    https://github.com/scummvm/scummvm/commit/f83de4fbfe655591186eb0c4e2df87b1695e9fe9
Author: uruk (koppirnyo at gmail.com)
Date: 2013-12-19T23:46:47-08:00

Commit Message:
AVALANCHE: Implement Nim::endOfGame().

Changed paths:
    engines/avalanche/nim.cpp
    engines/avalanche/nim.h



diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index 256c713..a7abfa3 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -226,6 +226,7 @@ bool Nim::checkMouse() {
 	Common::Point cursorPos = _vm->getMousePos();
 	_vm->_graphics->refreshScreen();
 	Common::Event event;
+	// This loop needs "some" revision!!!
 	while (_vm->getEvent(event)) {
 		_vm->_graphics->refreshScreen();
 		if (event.type == Common::EVENT_LBUTTONUP) {
@@ -283,7 +284,24 @@ void Nim::takeSome() {
 }
 
 void Nim::endOfGame() {
-	warning("STUB: Nim::endOfGame()");
+	CursorMan.showMouse(false);
+
+	chalk(595, 55 + _turns * 10, "Wins!");
+	_vm->_graphics->drawNormalText("- - -   Press any key...  - - -", _vm->_font, 8, 100, 190, kColorYellow);
+
+	Common::Event event;
+	bool escape = false;
+	while (!_vm->shouldQuit() && !escape) {
+		_vm->_graphics->refreshScreen();
+		while (_vm->getEvent(event)) {
+			if ((event.type == Common::EVENT_LBUTTONUP) || (event.type == Common::EVENT_KEYDOWN)) {
+				escape = true;
+				break;
+			}
+		}
+	}
+
+	CursorMan.showMouse(true);
 }
 
 bool Nim::find(byte x) {
diff --git a/engines/avalanche/nim.h b/engines/avalanche/nim.h
index b756460..6afb915 100644
--- a/engines/avalanche/nim.h
+++ b/engines/avalanche/nim.h
@@ -71,7 +71,7 @@ private:
 	void endOfGame();
 	bool find(byte x); // This gives TRUE if there's a pile with x stones in.
 	void findAp(byte start, byte stepSize);
-	void dogFood();
+	void dogFood(); // AI procedure to play the game.
 };
 
 } // End of namespace Avalanche






More information about the Scummvm-git-logs mailing list