[Scummvm-git-logs] scummvm master -> 22ee8519a9872faabdf863c44df79d5f0452affd

bluegr bluegr at gmail.com
Sun Oct 4 01:27:31 UTC 2020


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:
22ee8519a9 TINSEL: Fix compilation with non-C++11 compilers. Some renaming


Commit: 22ee8519a9872faabdf863c44df79d5f0452affd
    https://github.com/scummvm/scummvm/commit/22ee8519a9872faabdf863c44df79d5f0452affd
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-10-04T04:26:42+03:00

Commit Message:
TINSEL: Fix compilation with non-C++11 compilers. Some renaming

Changed paths:
    engines/tinsel/dialogs.cpp
    engines/tinsel/dialogs.h


diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 7c82ae6e44..40d20a1982 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -746,7 +746,9 @@ static void InvTinselEvent(INV_OBJECT *pinvo, TINSEL_EVENT event, PLR_EVENT be,
 static void InvPdProcess(CORO_PARAM, const void *param);
 
 Dialogs::Dialogs() {
-	g_buttonEffect = {false, 0, false};
+	_buttonEffect.bButAnim = false;
+	_buttonEffect.box = nullptr;
+	_buttonEffect.press = false;
 
 	_hWinParts = 0;
 	_flagFilm = 0;
@@ -832,6 +834,10 @@ Dialogs::Dialogs() {
 	_lastChosenScene = 0;
 	_bRemember = false;
 
+	_invCursor = IC_NORMAL;
+	_inventoryState = IDLE_INV;
+	_invDragging = ID_NONE;
+
 	*_saveGameDesc = 0;
 }
 
@@ -3010,7 +3016,7 @@ void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
 
 	switch (fn) {
 	case IC_DROP:
-		ICursor = IC_NORMAL;
+		_invCursor = IC_NORMAL;
 		InvCursor(IC_AREA, CurX, CurY);
 		break;
 
@@ -3038,9 +3044,9 @@ void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
 		case I_BRIGHT:
 			if (!_invD[_activeInv].resizable)
 				restoreMain = true;
-			else if (ICursor != IC_DR) {
+			else if (_invCursor != IC_DR) {
 				AlterCursor(IX_CURDD);
-				ICursor = IC_DR;
+				_invCursor = IC_DR;
 			}
 			break;
 
@@ -3048,9 +3054,9 @@ void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
 		case I_BLEFT:
 			if (!_invD[_activeInv].resizable)
 				restoreMain = true;
-			else if (ICursor != IC_UR) {
+			else if (_invCursor != IC_UR) {
 				AlterCursor(IX_CURDU);
-				ICursor = IC_UR;
+				_invCursor = IC_UR;
 			}
 			break;
 
@@ -3060,9 +3066,9 @@ void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
 				restoreMain = true;
 				break;
 			}
-			if (ICursor != IC_TB) {
+			if (_invCursor != IC_TB) {
 				AlterCursor(IX_CURUD);
-				ICursor = IC_TB;
+				_invCursor = IC_TB;
 			}
 			break;
 
@@ -3070,9 +3076,9 @@ void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
 		case I_RIGHT:
 			if (!_invD[_activeInv].resizable)
 				restoreMain = true;
-			else if (ICursor != IC_LR) {
+			else if (_invCursor != IC_LR) {
 				AlterCursor(IX_CURLR);
-				ICursor = IC_LR;
+				_invCursor = IC_LR;
 			}
 			break;
 
@@ -3095,9 +3101,9 @@ void Dialogs::InvCursor(InvCursorFN fn, int CurX, int CurY) {
 		break;
 	}
 
-	if (restoreMain && ICursor != IC_NORMAL) {
+	if (restoreMain && _invCursor != IC_NORMAL) {
 		_vm->_cursor->RestoreMainCursor();
-		ICursor = IC_NORMAL;
+		_invCursor = IC_NORMAL;
 	}
 }
 
@@ -4409,10 +4415,10 @@ void Dialogs::MenuAction(int i, bool dbl) {
 		case TOGGLE:
 		case TOGGLE1:
 		case TOGGLE2:
-			if (!g_buttonEffect.bButAnim) {
-				g_buttonEffect.bButAnim = true;
-				g_buttonEffect.box = &cd.box[i];
-				g_buttonEffect.press = false;
+			if (!_buttonEffect.bButAnim) {
+				_buttonEffect.bButAnim = true;
+				_buttonEffect.box = &cd.box[i];
+				_buttonEffect.press = false;
 			}
 			break;
 
@@ -4459,12 +4465,12 @@ void Dialogs::MenuAction(int i, bool dbl) {
 		case ARSBUT:
 		case AABUT:
 		case AATBUT:
-			if (g_buttonEffect.bButAnim)
+			if (_buttonEffect.bButAnim)
 				break;
 
-			g_buttonEffect.bButAnim = true;
-			g_buttonEffect.box = &cd.box[i];
-			g_buttonEffect.press = true;
+			_buttonEffect.bButAnim = true;
+			_buttonEffect.box = &cd.box[i];
+			_buttonEffect.press = true;
 			break;
 		default:
 			break;
@@ -5542,16 +5548,16 @@ extern void InventoryProcess(CORO_PARAM, const void *) {
 
 		_vm->_dialogs->Redraw();
 
-		if (g_buttonEffect.bButAnim) {
-			assert(g_buttonEffect.box);
-			if (g_buttonEffect.press) {
-				if (g_buttonEffect.box->boxType == AAGBUT || g_buttonEffect.box->boxType == ARSGBUT)
-					CORO_INVOKE_1(ButtonPress, g_buttonEffect.box);
-				_vm->_dialogs->CallFunction(g_buttonEffect.box->boxFunc);
+		if (_vm->_dialogs->_buttonEffect.bButAnim) {
+			assert(_vm->_dialogs->_buttonEffect.box);
+			if (_vm->_dialogs->_buttonEffect.press) {
+				if (_vm->_dialogs->_buttonEffect.box->boxType == AAGBUT || _vm->_dialogs->_buttonEffect.box->boxType == ARSGBUT)
+					CORO_INVOKE_1(ButtonPress, _vm->_dialogs->_buttonEffect.box);
+				_vm->_dialogs->CallFunction(_vm->_dialogs->_buttonEffect.box->boxFunc);
 			} else
-				CORO_INVOKE_1(ButtonToggle, g_buttonEffect.box);
+				CORO_INVOKE_1(ButtonToggle, _vm->_dialogs->_buttonEffect.box);
 
-			g_buttonEffect.bButAnim = false;
+			_vm->_dialogs->_buttonEffect.bButAnim = false;
 		}
 	}
 	CORO_END_CODE;
diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h
index 2191f742ab..af8f42464d 100644
--- a/engines/tinsel/dialogs.h
+++ b/engines/tinsel/dialogs.h
@@ -94,8 +94,8 @@ enum InvCursorFN { IC_AREA,
 #define SG_DESC_LEN 40   // Max. saved game description length
 
 // Number of objects that makes up an empty window
-#define MAX_WCOMP 21 // 4 corners + (3+3) sides + (2+2) extra sides \
-	                 // + Bground + title + slider                  \
+#define MAX_WCOMP 21 // 4 corners + (3+3) sides + (2+2) extra sides
+	                 // + Bground + title + slider
 	                 // + more Needed for save game window
 
 #define MAX_ICONS MAXHICONS *MAXVICONS
@@ -254,11 +254,11 @@ struct CONFBOX {
 };
 
 // Data for button press/toggle effects
-struct {
+struct BUTTONEFFECT {
 	bool bButAnim;
 	CONFBOX *box;
 	bool press; // true = button press; false = button toggle
-} g_buttonEffect;
+};
 
 class Dialogs {
 public:
@@ -363,6 +363,7 @@ public:
 	char _saveGameDesc[SG_DESC_LEN + 2];
 
 	OBJECT *_iconArray[MAX_ICONS]; // Current display objects (icons)
+	BUTTONEFFECT _buttonEffect;
 
 private:
 	int WhichMenuBox(int curX, int curY, bool bSlides);
@@ -440,7 +441,7 @@ private:
 	DIRECTION _initialDirection;
 
 	//----- Permanent data (updated, valid while inventory closed) -----
-	int _heldItem = INV_NOICON; // Current held item
+	int _heldItem; // Current held item
 
 	SCNHANDLE _heldFilm;
 	SCNHANDLE _hWinParts; // Window members and cursors' graphic data
@@ -500,7 +501,7 @@ private:
 	// Icon clicked on to cause an event
 	// - Passed to conversation polygon or actor code via Topic()
 	// - (sometimes) Passed to inventory icon code via OtherObject()
-	int _thisIcon = 0;
+	int _thisIcon;
 
 	CONV_PARAM _thisConvFn;             // Top, 'Middle' or Bottom
 	HPOLYGON _thisConvPoly;         // Conversation code is in a polygon code block
@@ -529,7 +530,7 @@ private:
 		          IC_LR,
 		          IC_INV,
 		          IC_UP,
-		          IC_DN } ICursor = IC_NORMAL;
+		          IC_DN } _invCursor;
 
 	enum { NO_INV,
 		   IDLE_INV,




More information about the Scummvm-git-logs mailing list