[Scummvm-cvs-logs] scummvm master -> 4ebf52d3b34a1a65afd55a18be28d31d77d4c308

dreammaster dreammaster at scummvm.org
Sun Jun 29 03:37:25 CEST 2014


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:
4ebf52d3b3 MADS: Fix selection of lines in the difficulty dialog to match the original


Commit: 4ebf52d3b34a1a65afd55a18be28d31d77d4c308
    https://github.com/scummvm/scummvm/commit/4ebf52d3b34a1a65afd55a18be28d31d77d4c308
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-06-28T21:36:43-04:00

Commit Message:
MADS: Fix selection of lines in the difficulty dialog to match the original

Changed paths:
    engines/mads/nebular/dialogs_nebular.cpp
    engines/mads/nebular/dialogs_nebular.h



diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index a1459d5..86f9797 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -549,9 +549,9 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
 	Scene &scene = game._scene;
 
 	_v1 = 0;
-	_v2 = 0;
-	_v3 = false;
-	_selectedLine = 0;
+	_movedFlag = false;
+	_redrawFlag = false;
+	_selectedLine = -1;
 	_dirFlag = false;
 	_textLineCount = 0;
 	_screenId = 920;
@@ -622,7 +622,7 @@ ScreenDialog::~ScreenDialog() {
 
 void ScreenDialog::clearLines() {
 	Scene &scene = _vm->_game->_scene;
-	_v2 = 0;
+	_movedFlag = false;
 	_lines.clear();
 	scene._spriteSlots.fullRefresh(true);
 }
@@ -788,13 +788,13 @@ void ScreenDialog::show() {
 
 	while (_selectedLine < 1 && !_vm->shouldQuit()) {
 		handleEvents();
-		if (_v3) {
+		if (_redrawFlag) {
 			if (!_v1)
 				_v1 = -1;
 
 			refreshText();
 			scene.drawElements(_vm->_game->_fx, _vm->_game->_fx);
-			_v3 = false;
+			_redrawFlag = false;
 		}
 
 		_vm->_events->waitForNextFrame();
@@ -818,7 +818,7 @@ void ScreenDialog::handleEvents() {
 	// Scan for objects in the dialog
 	int objIndex = screenObjects.scan(events.currentPos() - _vm->_screen._offset, LAYER_GUI);
 
-	if (_v2) {
+	if (_movedFlag) {
 		int yp = events.currentPos().y - _vm->_screen._offset.y;
 		if (yp < screenObjects[1]._bounds.top) {
 			if (!events._mouseReleased)
@@ -834,7 +834,7 @@ void ScreenDialog::handleEvents() {
 	}
 
 	int line = -1;
-	if (objIndex > 0 /*|| events._mouseButtons*/) {
+	if (objIndex > 0 && (events._mouseStatus || events._mouseReleased)) {
 		line = screenObjects[objIndex]._descId;
 		if (dialogs._pendingDialog == DIALOG_SAVE || dialogs._pendingDialog == DIALOG_RESTORE) {
 			if (line > 7 && line <= 14) {
@@ -842,9 +842,9 @@ void ScreenDialog::handleEvents() {
 				line -= 7;
 			}
 
-			int v2 = (line > 0 && line < 8) ? 1 : 0;
+			bool movedFlag = line > 0 && line < 8;
 			if (events._mouseMoved)
-				_v2 = v2;
+				_movedFlag = movedFlag;
 		}
 
 		if (screenObjects[objIndex]._category == CAT_COMMAND) {
@@ -858,14 +858,14 @@ void ScreenDialog::handleEvents() {
 		line = -1;
 
 	if (events._mouseReleased) {
-		if (!_v2 || line <= 18)
+		if (!_movedFlag || line <= 18)
 			_selectedLine = line;
-		_v3 = true;
+		_redrawFlag = true;
 	}
 
 	_v1 = line;
-	if (v1 == line || _selectedLine >= 0)
-		_v3 = true;
+	if (v1 != line || _selectedLine >= 0)
+		_redrawFlag = true;
 }
 
 void ScreenDialog::refreshText() {
diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h
index 504359b..d7ad09e 100644
--- a/engines/mads/nebular/dialogs_nebular.h
+++ b/engines/mads/nebular/dialogs_nebular.h
@@ -124,8 +124,8 @@ protected:
 	MADSEngine *_vm;
 	Common::Array<DialogLine> _lines;
 	int _v1;
-	int _v2;
-	bool _v3;
+	bool _movedFlag;
+	bool _redrawFlag;
 	int _selectedLine;
 	bool _dirFlag;
 	int _screenId;






More information about the Scummvm-git-logs mailing list