[Scummvm-git-logs] scummvm master -> e28fc6ee90fec49b55f28062abdefbf9e0c8a2a9

dreammaster dreammaster at scummvm.org
Sun Mar 14 00:48:36 UTC 2021


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

Summary:
43778457ad AGS: Move guidialog.cpp globals to Globals
cc332b5f75 AGS: Move timer.cpp globals to Globals
6ee633dc8a AGS: Change global strings to const char *
e28fc6ee90 AGS: Move FilterInfo statics to Globals


Commit: 43778457ad988422ee95e15ff13246dc105c169b
    https://github.com/scummvm/scummvm/commit/43778457ad988422ee95e15ff13246dc105c169b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-13T16:46:24-08:00

Commit Message:
AGS: Move guidialog.cpp globals to Globals

Changed paths:
    engines/ags/engine/gui/guidialog.cpp
    engines/ags/globals.cpp
    engines/ags/globals.h


diff --git a/engines/ags/engine/gui/guidialog.cpp b/engines/ags/engine/gui/guidialog.cpp
index 6294eaa07a..881ad850f0 100644
--- a/engines/ags/engine/gui/guidialog.cpp
+++ b/engines/ags/engine/gui/guidialog.cpp
@@ -39,31 +39,8 @@ namespace AGS3 {
 using namespace AGS::Shared;
 using namespace AGS::Engine;
 
-namespace {
-
-// TODO: store drawing surface inside old gui classes instead
-int windowPosX, windowPosY, windowPosWidth, windowPosHeight;
-Bitmap *windowBuffer;
-IDriverDependantBitmap *dialogDDB;
-
-#undef MAXSAVEGAMES
-#define MAXSAVEGAMES 20
-//DisplayProperties dispp;
-char *lpTemp, *lpTemp2;
-char bufTemp[260], buffer2[260];
-int numsaves = 0, toomanygames;
-int filenumbers[MAXSAVEGAMES];
-unsigned long filedates[MAXSAVEGAMES];
-
-CSCIMessage smes;
-
-char buff[200];
-int myscrnwid = 320, myscrnhit = 200;
-
-}
-
 char *get_gui_dialog_buffer() {
-	return buffer2;
+	return _G(buffer2);
 }
 
 //
@@ -71,42 +48,42 @@ char *get_gui_dialog_buffer() {
 //
 
 Bitmap *prepare_gui_screen(int x, int y, int width, int height, bool opaque) {
-	windowPosX = x;
-	windowPosY = y;
-	windowPosWidth = width;
-	windowPosHeight = height;
-	if (windowBuffer) {
-		windowBuffer = recycle_bitmap(windowBuffer, windowBuffer->GetColorDepth(), windowPosWidth, windowPosHeight, !opaque);
+	_G(windowPosX) = x;
+	_G(windowPosY) = y;
+	_G(windowPosWidth) = width;
+	_G(windowPosHeight) = height;
+	if (_G(windowBuffer)) {
+		_G(windowBuffer) = recycle_bitmap(_G(windowBuffer), _G(windowBuffer)->GetColorDepth(), _G(windowPosWidth), _G(windowPosHeight), !opaque);
 	} else {
-		windowBuffer = BitmapHelper::CreateBitmap(windowPosWidth, windowPosHeight, _GP(game).GetColorDepth());
-		windowBuffer = ReplaceBitmapWithSupportedFormat(windowBuffer);
+		_G(windowBuffer) = BitmapHelper::CreateBitmap(_G(windowPosWidth), _G(windowPosHeight), _GP(game).GetColorDepth());
+		_G(windowBuffer) = ReplaceBitmapWithSupportedFormat(_G(windowBuffer));
 	}
-	dialogDDB = recycle_ddb_bitmap(dialogDDB, windowBuffer, false, opaque);
-	return windowBuffer;
+	_G(dialogDDB) = recycle_ddb_bitmap(_G(dialogDDB), _G(windowBuffer), false, opaque);
+	return _G(windowBuffer);
 }
 
 Bitmap *get_gui_screen() {
-	return windowBuffer;
+	return _G(windowBuffer);
 }
 
 void clear_gui_screen() {
-	if (dialogDDB)
-		_G(gfxDriver)->DestroyDDB(dialogDDB);
-	dialogDDB = nullptr;
-	delete windowBuffer;
-	windowBuffer = nullptr;
+	if (_G(dialogDDB))
+		_G(gfxDriver)->DestroyDDB(_G(dialogDDB));
+	_G(dialogDDB) = nullptr;
+	delete _G(windowBuffer);
+	_G(windowBuffer) = nullptr;
 }
 
 void refresh_gui_screen() {
-	_G(gfxDriver)->UpdateDDBFromBitmap(dialogDDB, windowBuffer, false);
-	render_graphics(dialogDDB, windowPosX, windowPosY);
+	_G(gfxDriver)->UpdateDDBFromBitmap(_G(dialogDDB), _G(windowBuffer), false);
+	render_graphics(_G(dialogDDB), _G(windowPosX), _G(windowPosY));
 }
 
 int loadgamedialog() {
 	const int wnd_width = 200;
 	const int wnd_height = 120;
-	const int boxleft = myscrnwid / 2 - wnd_width / 2;
-	const int boxtop = myscrnhit / 2 - wnd_height / 2;
+	const int boxleft = _G(myscrnwid) / 2 - wnd_width / 2;
+	const int boxtop = _G(myscrnhit) / 2 - wnd_height / 2;
 	const int buttonhit = _GP(usetup).textheight + 5;
 
 	int handl = CSCIDrawWindow(boxleft, boxtop, wnd_width, wnd_height);
@@ -121,23 +98,23 @@ int loadgamedialog() {
 
 	preparesavegamelist(ctrllist);
 	CSCIMessage mes;
-	lpTemp = nullptr;
+	_G(lpTemp) = nullptr;
 	int toret = -1;
 	while (1) {
 		CSCIWaitMessage(&mes);      //printf("mess: %d, id %d ",mes.code,mes.id);
 		if (mes.code == CM_COMMAND) {
 			if (mes.id == ctrlok) {
 				int cursel = CSCISendControlMessage(ctrllist, CLB_GETCURSEL, 0, 0);
-				if ((cursel >= numsaves) | (cursel < 0))
-					lpTemp = nullptr;
+				if ((cursel >= _G(numsaves)) | (cursel < 0))
+					_G(lpTemp) = nullptr;
 				else {
-					toret = filenumbers[cursel];
+					toret = _G(filenumbers)[cursel];
 					String path = get_save_game_path(toret);
-					strcpy(bufTemp, path);
-					lpTemp = &bufTemp[0];
+					strcpy(_G(bufTemp), path);
+					_G(lpTemp) = &_G(bufTemp)[0];
 				}
 			} else if (mes.id == ctrlcancel) {
-				lpTemp = nullptr;
+				_G(lpTemp) = nullptr;
 			}
 
 			break;
@@ -159,8 +136,8 @@ int savegamedialog() {
 	strcpy(labeltext, get_global_message(MSG_SAVEDIALOG));
 	const int wnd_width = 200;
 	const int wnd_height = 120;
-	const int boxleft = myscrnwid / 2 - wnd_width / 2;
-	const int boxtop = myscrnhit / 2 - wnd_height / 2;
+	const int boxleft = _G(myscrnwid) / 2 - wnd_width / 2;
+	const int boxtop = _G(myscrnhit) / 2 - wnd_height / 2;
 	const int buttonhit = _GP(usetup).textheight + 5;
 	int labeltop = 5;
 
@@ -173,7 +150,7 @@ int savegamedialog() {
 
 	CSCISendControlMessage(ctrllist, CLB_CLEAR, 0, 0);    // clear the list box
 	preparesavegamelist(ctrllist);
-	if (toomanygames) {
+	if (_G(toomanygames)) {
 		strcpy(okbuttontext, get_global_message(MSG_REPLACE));
 		strcpy(labeltext, get_global_message(MSG_MUSTREPLACE));
 		labeltop = 2;
@@ -184,13 +161,13 @@ int savegamedialog() {
 	int ctrltex1 = CSCICreateControl(CNT_LABEL, 10, labeltop, 120, 0, labeltext);
 	CSCIMessage mes;
 
-	lpTemp = nullptr;
-	if (numsaves > 0)
-		CSCISendControlMessage(ctrllist, CLB_GETTEXT, 0,  &buffer2[0]);
+	_G(lpTemp) = nullptr;
+	if (_G(numsaves) > 0)
+		CSCISendControlMessage(ctrllist, CLB_GETTEXT, 0,  &_G(buffer2)[0]);
 	else
-		buffer2[0] = 0;
+		_G(buffer2)[0] = 0;
 
-	CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &buffer2[0]);
+	CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &_G(buffer2)[0]);
 
 	int toret = -1;
 	while (1) {
@@ -198,21 +175,21 @@ int savegamedialog() {
 		if (mes.code == CM_COMMAND) {
 			if (mes.id == ctrlok) {
 				int cursell = CSCISendControlMessage(ctrllist, CLB_GETCURSEL, 0, 0);
-				CSCISendControlMessage(ctrltbox, CTB_GETTEXT, 0, &buffer2[0]);
+				CSCISendControlMessage(ctrltbox, CTB_GETTEXT, 0, &_G(buffer2)[0]);
 
-				if (numsaves > 0)
-					CSCISendControlMessage(ctrllist, CLB_GETTEXT, cursell, &bufTemp[0]);
+				if (_G(numsaves) > 0)
+					CSCISendControlMessage(ctrllist, CLB_GETTEXT, cursell, &_G(bufTemp)[0]);
 				else
-					strcpy(bufTemp, "_NOSAVEGAMENAME");
+					strcpy(_G(bufTemp), "_NOSAVEGAMENAME");
 
-				if (toomanygames) {
+				if (_G(toomanygames)) {
 					int nwhand = CSCIDrawWindow(boxleft + 5, boxtop + 20, 190, 65);
 					int lbl1 =
 						CSCICreateControl(CNT_LABEL, 15, 5, 160, 0, get_global_message(MSG_REPLACEWITH1));
-					int lbl2 = CSCICreateControl(CNT_LABEL, 25, 14, 160, 0, bufTemp);
+					int lbl2 = CSCICreateControl(CNT_LABEL, 25, 14, 160, 0, _G(bufTemp));
 					int lbl3 =
 						CSCICreateControl(CNT_LABEL, 15, 25, 160, 0, get_global_message(MSG_REPLACEWITH2));
-					int txt1 = CSCICreateControl(CNT_TEXTBOX, 15, 35, 160, 0, bufTemp);
+					int txt1 = CSCICreateControl(CNT_TEXTBOX, 15, 35, 160, 0, _G(bufTemp));
 					int btnOk =
 						CSCICreateControl(CNT_PUSHBUTTON | CNF_DEFAULT, 25, 50, 60, 10,
 							get_global_message(MSG_REPLACE));
@@ -225,7 +202,7 @@ int savegamedialog() {
 						CSCIWaitMessage(&cmes);
 					} while (cmes.code != CM_COMMAND);
 
-					CSCISendControlMessage(txt1, CTB_GETTEXT, 0, &buffer2[0]);
+					CSCISendControlMessage(txt1, CTB_GETTEXT, 0, &_G(buffer2)[0]);
 					CSCIDeleteControl(btnCancel);
 					CSCIDeleteControl(btnOk);
 					CSCIDeleteControl(txt1);
@@ -233,19 +210,19 @@ int savegamedialog() {
 					CSCIDeleteControl(lbl2);
 					CSCIDeleteControl(lbl1);
 					CSCIEraseWindow(nwhand);
-					bufTemp[0] = 0;
+					_G(bufTemp)[0] = 0;
 
 					if (cmes.id == btnCancel) {
-						lpTemp = nullptr;
+						_G(lpTemp) = nullptr;
 						break;
 					} else
-						toret = filenumbers[cursell];
+						toret = _G(filenumbers)[cursell];
 
-				} else if (strcmp(buffer2, bufTemp) != 0) {   // create a new game (description different)
+				} else if (strcmp(_G(buffer2), _G(bufTemp)) != 0) {   // create a new game (description different)
 					int highestnum = 0;
-					for (int pp = 0; pp < numsaves; pp++) {
-						if (filenumbers[pp] > highestnum)
-							highestnum = filenumbers[pp];
+					for (int pp = 0; pp < _G(numsaves); pp++) {
+						if (_G(filenumbers)[pp] > highestnum)
+							highestnum = _G(filenumbers)[pp];
 					}
 
 					if (highestnum > 90)
@@ -253,28 +230,28 @@ int savegamedialog() {
 
 					toret = highestnum + 1;
 					String path = get_save_game_path(toret);
-					strcpy(bufTemp, path);
+					strcpy(_G(bufTemp), path);
 				} else {
-					toret = filenumbers[cursell];
-					bufTemp[0] = 0;
+					toret = _G(filenumbers)[cursell];
+					_G(bufTemp)[0] = 0;
 				}
 
-				if (bufTemp[0] == 0) {
+				if (_G(bufTemp)[0] == 0) {
 					String path = get_save_game_path(toret);
-					strcpy(bufTemp, path);
+					strcpy(_G(bufTemp), path);
 				}
 
-				lpTemp = &bufTemp[0];
-				lpTemp2 = &buffer2[0];
+				_G(lpTemp) = &_G(bufTemp)[0];
+				_G(lpTemp2) = &_G(buffer2)[0];
 			} else if (mes.id == ctrlcancel) {
-				lpTemp = nullptr;
+				_G(lpTemp) = nullptr;
 			}
 			break;
 		} else if (mes.code == CM_SELCHANGE) {
 			int cursel = CSCISendControlMessage(ctrllist, CLB_GETCURSEL, 0, 0);
 			if (cursel >= 0) {
-				CSCISendControlMessage(ctrllist, CLB_GETTEXT, cursel, &buffer2[0]);
-				CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &buffer2[0]);
+				CSCISendControlMessage(ctrllist, CLB_GETTEXT, cursel, &_G(buffer2)[0]);
+				CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &_G(buffer2)[0]);
 			}
 		}
 	}
@@ -289,8 +266,8 @@ int savegamedialog() {
 }
 
 void preparesavegamelist(int ctrllist) {
-	numsaves = 0;
-	toomanygames = 0;
+	_G(numsaves) = 0;
+	_G(toomanygames) = 0;
 
 	// Get a list of savegames
 	SaveStateList saveList = ::AGS::g_vm->listSaves();
@@ -304,28 +281,28 @@ void preparesavegamelist(int ctrllist) {
 
 		// Select the first item
 		CSCISendControlMessage(ctrllist, CLB_SETCURSEL, 0, 0);
-		filenumbers[numsaves] = it->getSaveSlot();
-		filedates[numsaves] = 0;		// TODO: How to handle file dates in ScummVM
+		_G(filenumbers)[_G(numsaves)] = it->getSaveSlot();
+		_G(filedates)[_G(numsaves)] = 0;		// TODO: How to handle file dates in ScummVM
 
-		++numsaves;
+		++_G(numsaves);
 	}
 
-	if (numsaves >= MAXSAVEGAMES)
-		toomanygames = 1;
-
-	for (int nn = 0; nn < numsaves - 1; nn++) {
-		for (int kk = 0; kk < numsaves - 1; kk++) { // Date order the games
-			if (filedates[kk] < filedates[kk + 1]) {  // swap them round
-				CSCISendControlMessage(ctrllist, CLB_GETTEXT, kk, &buff[0]);
-				CSCISendControlMessage(ctrllist, CLB_GETTEXT, kk + 1, &buffer2[0]);
-				CSCISendControlMessage(ctrllist, CLB_SETTEXT, kk + 1, &buff[0]);
-				CSCISendControlMessage(ctrllist, CLB_SETTEXT, kk, &buffer2[0]);
-				int numtem = filenumbers[kk];
-				filenumbers[kk] = filenumbers[kk + 1];
-				filenumbers[kk + 1] = numtem;
-				long numted = filedates[kk];
-				filedates[kk] = filedates[kk + 1];
-				filedates[kk + 1] = numted;
+	if (_G(numsaves) >= MAXSAVEGAMES)
+		_G(toomanygames) = 1;
+
+	for (int nn = 0; nn < _G(numsaves) - 1; nn++) {
+		for (int kk = 0; kk < _G(numsaves) - 1; kk++) { // Date order the games
+			if (_G(filedates)[kk] < _G(filedates)[kk + 1]) {  // swap them round
+				CSCISendControlMessage(ctrllist, CLB_GETTEXT, kk, &_G(buff)[0]);
+				CSCISendControlMessage(ctrllist, CLB_GETTEXT, kk + 1, &_G(buffer2)[0]);
+				CSCISendControlMessage(ctrllist, CLB_SETTEXT, kk + 1, &_G(buff)[0]);
+				CSCISendControlMessage(ctrllist, CLB_SETTEXT, kk, &_G(buffer2)[0]);
+				int numtem = _G(filenumbers)[kk];
+				_G(filenumbers)[kk] = _G(filenumbers)[kk + 1];
+				_G(filenumbers)[kk + 1] = numtem;
+				long numted = _G(filedates)[kk];
+				_G(filedates)[kk] = _G(filedates)[kk + 1];
+				_G(filedates)[kk + 1] = numted;
 			}
 		}
 	}
@@ -354,9 +331,9 @@ void enterstringwindow(const char *prompttext, char *stouse) {
 		CSCIWaitMessage(&mes);
 		if (mes.code == CM_COMMAND) {
 			if (mes.id == ctrlcancel)
-				buffer2[0] = 0;
+				_G(buffer2)[0] = 0;
 			else
-				CSCISendControlMessage(ctrltbox, CTB_GETTEXT, 0, &buffer2[0]);
+				CSCISendControlMessage(ctrltbox, CTB_GETTEXT, 0, &_G(buffer2)[0]);
 			break;
 		}
 	}
@@ -367,7 +344,7 @@ void enterstringwindow(const char *prompttext, char *stouse) {
 	if (wantCancel)
 		CSCIDeleteControl(ctrlcancel);
 	CSCIEraseWindow(handl);
-	strcpy(stouse, buffer2);
+	strcpy(stouse, _G(buffer2));
 }
 
 int enternumberwindow(char *prompttext) {
@@ -383,8 +360,8 @@ int roomSelectorWindow(int currentRoom, int numRooms, int *roomNumbers, char **r
 	strcpy(labeltext, get_global_message(MSG_SAVEDIALOG));
 	const int wnd_width = 240;
 	const int wnd_height = 160;
-	const int boxleft = myscrnwid / 2 - wnd_width / 2;
-	const int boxtop = myscrnhit / 2 - wnd_height / 2;
+	const int boxleft = _G(myscrnwid) / 2 - wnd_width / 2;
+	const int boxtop = _G(myscrnhit) / 2 - wnd_height / 2;
 	const int labeltop = 5;
 
 	int handl = CSCIDrawWindow(boxleft, boxtop, wnd_width, wnd_height);
@@ -394,8 +371,8 @@ int roomSelectorWindow(int currentRoom, int numRooms, int *roomNumbers, char **r
 
 	CSCISendControlMessage(ctrllist, CLB_CLEAR, 0, 0);    // clear the list box
 	for (int aa = 0; aa < numRooms; aa++) {
-		sprintf(buff, "%3d %s", roomNumbers[aa], roomNames[aa]);
-		CSCISendControlMessage(ctrllist, CLB_ADDITEM, 0, &buff[0]);
+		sprintf(_G(buff), "%3d %s", roomNumbers[aa], roomNames[aa]);
+		CSCISendControlMessage(ctrllist, CLB_ADDITEM, 0, &_G(buff)[0]);
 		if (roomNumbers[aa] == currentRoom) {
 			CSCISendControlMessage(ctrllist, CLB_SETCURSEL, aa, 0);
 		}
@@ -405,20 +382,20 @@ int roomSelectorWindow(int currentRoom, int numRooms, int *roomNumbers, char **r
 	int ctrltex1 = CSCICreateControl(CNT_LABEL, 10, labeltop, 180, 0, "Choose which room to go to:");
 	CSCIMessage mes;
 
-	lpTemp = nullptr;
-	buffer2[0] = 0;
+	_G(lpTemp) = nullptr;
+	_G(buffer2)[0] = 0;
 
 	int ctrltbox = CSCICreateControl(CNT_TEXTBOX, 10, 29, 120, 0, nullptr);
-	CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &buffer2[0]);
+	CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &_G(buffer2)[0]);
 
 	int toret = -1;
 	while (1) {
 		CSCIWaitMessage(&mes);      //printf("mess: %d, id %d ",mes.code,mes.id);
 		if (mes.code == CM_COMMAND) {
 			if (mes.id == ctrlok) {
-				CSCISendControlMessage(ctrltbox, CTB_GETTEXT, 0, &buffer2[0]);
-				if (Common::isDigit(buffer2[0])) {
-					toret = atoi(buffer2);
+				CSCISendControlMessage(ctrltbox, CTB_GETTEXT, 0, &_G(buffer2)[0]);
+				if (Common::isDigit(_G(buffer2)[0])) {
+					toret = atoi(_G(buffer2));
 				}
 			} else if (mes.id == ctrlcancel) {
 			}
@@ -426,8 +403,8 @@ int roomSelectorWindow(int currentRoom, int numRooms, int *roomNumbers, char **r
 		} else if (mes.code == CM_SELCHANGE) {
 			int cursel = CSCISendControlMessage(ctrllist, CLB_GETCURSEL, 0, 0);
 			if (cursel >= 0) {
-				sprintf(buffer2, "%d", roomNumbers[cursel]);
-				CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &buffer2[0]);
+				sprintf(_G(buffer2), "%d", roomNumbers[cursel]);
+				CSCISendControlMessage(ctrltbox, CTB_SETTEXT, 0, &_G(buffer2)[0]);
 			}
 		}
 	}
@@ -462,11 +439,11 @@ int myscimessagebox(const char *lpprompt, char *btn1, char *btn2) {
 	if (btn2 != nullptr)
 		btnPlay = CSCICreateControl(CNT_PUSHBUTTON | CNF_CANCEL, 85, 25, 60, 10, btn2);
 
-	smes.code = 0;
+	_GP(smes).code = 0;
 
 	do {
-		CSCIWaitMessage(&smes);
-	} while (smes.code != CM_COMMAND);
+		CSCIWaitMessage(&_GP(smes));
+	} while (_GP(smes).code != CM_COMMAND);
 
 	if (btnPlay)
 		CSCIDeleteControl(btnPlay);
@@ -475,7 +452,7 @@ int myscimessagebox(const char *lpprompt, char *btn1, char *btn2) {
 	CSCIDeleteControl(lbl1);
 	CSCIEraseWindow(windl);
 
-	if (smes.id == btnQuit)
+	if (_GP(smes).id == btnQuit)
 		return 1;
 
 	return 0;
diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp
index e60eacf4ba..8cb86e41b4 100644
--- a/engines/ags/globals.cpp
+++ b/engines/ags/globals.cpp
@@ -223,6 +223,14 @@ Globals::Globals() {
 	// guibutton.cpp globals
 	_guibuts = new std::vector<AGS::Shared::GUIButton>();
 
+	// guidlaog.cpp globals
+	Common::fill(_filenumbers, _filenumbers + MAXSAVEGAMES_20, 0);
+	Common::fill(_filedates, _filedates + MAXSAVEGAMES_20, 0);
+	Common::fill(_bufTemp, _bufTemp + 260, 0);
+	Common::fill(_buffer2, _buffer2 + 260, 0);
+	Common::fill(_buff, _buff + 200, 0);
+	_smes = new CSCIMessage();
+
 	// guiinv.cpp globals
 	_guiinv = new std::vector<AGS::Shared::GUIInvWindow>();
 
@@ -419,6 +427,9 @@ Globals::~Globals() {
 	// guibutton.cpp globals
 	delete _guibuts;
 
+	// guidlaog.cpp globals
+	delete _smes;
+
 	// guiinv.cpp globals
 	delete _guiinv;
 
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index f40d5ba2cb..324d52e3eb 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -108,6 +108,7 @@ struct CharacterExtras;
 struct CharacterInfo;
 struct color;
 struct COLOR_MAP;
+struct CSCIMessage;
 struct DialogTopic;
 struct DirtyRects;
 struct ExecutingScript;
@@ -766,6 +767,28 @@ public:
 
 	/**@}*/
 
+	/**
+	 * \defgroup guidialog globals
+	 * @{
+	 */
+
+	// TODO: store drawing surface inside old gui classes instead
+	int _windowPosX = 0, _windowPosY = 0, _windowPosWidth = 0, _windowPosHeight = 0;
+	AGS::Shared::Bitmap *_windowBuffer = nullptr;
+	AGS::Engine::IDriverDependantBitmap *_dialogDDB = nullptr;
+
+	#define MAXSAVEGAMES_20 20
+	int _myscrnwid = 320, _myscrnhit = 200;
+	char *_lpTemp = nullptr, *_lpTemp2 = nullptr;
+	int _numsaves = 0, _toomanygames = 0;
+	int _filenumbers[MAXSAVEGAMES_20];
+	unsigned long _filedates[MAXSAVEGAMES_20];
+	char _bufTemp[260], _buffer2[260];
+	char _buff[200];
+	CSCIMessage *_smes;
+
+	/**@}*/
+
 	/**
 	 * \defgroup guiinv globals
 	 * @{


Commit: cc332b5f75d464453baaf1dc61f3c3cc13c59c90
    https://github.com/scummvm/scummvm/commit/cc332b5f75d464453baaf1dc61f3c3cc13c59c90
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-13T16:46:24-08:00

Commit Message:
AGS: Move timer.cpp globals to Globals

Changed paths:
    engines/ags/engine/ac/timer.cpp
    engines/ags/globals.h


diff --git a/engines/ags/engine/ac/timer.cpp b/engines/ags/engine/ac/timer.cpp
index e958287ffd..4481abbe39 100644
--- a/engines/ags/engine/ac/timer.cpp
+++ b/engines/ags/engine/ac/timer.cpp
@@ -24,45 +24,31 @@
 #include "ags/shared/core/platform.h"
 #include "ags/lib/std/chrono.h"
 #include "ags/lib/std/thread.h"
-#if AGS_PLATFORM_DEBUG && defined (__GNUC__)
-//include <stdio.h>
-//include <execinfo.h>
-//include <unistd.h>
-#endif
 #include "ags/engine/platform/base/agsplatformdriver.h"
 #include "ags/ags.h"
+#include "ags/globals.h"
 
 namespace AGS3 {
 
-namespace {
-
 const auto MAXIMUM_FALL_BEHIND = 3;
 
-auto tick_duration = std::chrono::microseconds(1000000LL / 40);
-auto framerate_maxed = false;
-
-uint32 last_tick_time = 0; // AGS_Clock::now();
-uint32 next_frame_timestamp = 0; // AGS_Clock::now();
-
-}
-
 std::chrono::microseconds GetFrameDuration() {
-	if (framerate_maxed) {
+	if (_G(framerate_maxed)) {
 		return std::chrono::microseconds(0);
 	}
-	return tick_duration;
+	return _G(tick_duration);
 }
 
 void setTimerFps(int new_fps) {
-	tick_duration = std::chrono::microseconds(1000000LL / new_fps);
-	framerate_maxed = new_fps >= 1000;
+	_G(tick_duration) = std::chrono::microseconds(1000000LL / new_fps);
+	_G(framerate_maxed) = new_fps >= 1000;
 
-	last_tick_time = AGS_Clock::now();
-	next_frame_timestamp = AGS_Clock::now();
+	_G(last_tick_time) = AGS_Clock::now();
+	_G(next_frame_timestamp) = AGS_Clock::now();
 }
 
 bool isTimerFpsMaxed() {
-	return framerate_maxed;
+	return _G(framerate_maxed);
 }
 
 void WaitForNextFrame() {
@@ -71,21 +57,21 @@ void WaitForNextFrame() {
 
 	// early exit if we're trying to maximise framerate
 	if (frameDuration <= std::chrono::milliseconds::zero()) {
-		next_frame_timestamp = now;
+		_G(next_frame_timestamp) = now;
 		return;
 	}
 
 	// jump ahead if we're lagging
-	if (next_frame_timestamp < (now - MAXIMUM_FALL_BEHIND * frameDuration)) {
-		next_frame_timestamp = now;
+	if (_G(next_frame_timestamp) < (now - MAXIMUM_FALL_BEHIND * frameDuration)) {
+		_G(next_frame_timestamp) = now;
 	}
 
-	if (next_frame_timestamp > now) {
-		auto frame_time_remaining = next_frame_timestamp - now;
+	if (_G(next_frame_timestamp) > now) {
+		auto frame_time_remaining = _G(next_frame_timestamp) - now;
 		std::this_thread::sleep_for(frame_time_remaining);
 	}
 
-	next_frame_timestamp += frameDuration;
+	_G(next_frame_timestamp) += frameDuration;
 
 	::AGS::g_vm->_rawScreen->update();
 }
@@ -93,15 +79,15 @@ void WaitForNextFrame() {
 bool waitingForNextTick() {
 	auto now = AGS_Clock::now();
 
-	if (framerate_maxed) {
-		last_tick_time = now;
+	if (_G(framerate_maxed)) {
+		_G(last_tick_time) = now;
 		return false;
 	}
 
-	auto is_lagging = (now - last_tick_time) > (MAXIMUM_FALL_BEHIND * tick_duration);
+	auto is_lagging = (now - _G(last_tick_time)) > (MAXIMUM_FALL_BEHIND * _G(tick_duration));
 	if (is_lagging) {
 #if AGS_PLATFORM_DEBUG && defined (__GNUC__)
-		auto missed_ticks = ((now - last_tick_time) / tick_duration);
+		auto missed_ticks = ((now - _G(last_tick_time)) / _G(tick_duration));
 		warning("Lagging! Missed %lld ticks!\n", (long long)missed_ticks);
 /*		void *array[10];
 		auto size = backtrace(array, 10);
@@ -109,13 +95,13 @@ bool waitingForNextTick() {
 */
 		warning("\n");
 #endif
-		last_tick_time = now;
+		_G(last_tick_time) = now;
 		return false;
 	}
 
-	auto next_tick_time = last_tick_time + tick_duration;
+	auto next_tick_time = _G(last_tick_time) + _G(tick_duration);
 	if (next_tick_time <= now) {
-		last_tick_time = next_tick_time;
+		_G(last_tick_time) = next_tick_time;
 		return false;
 	}
 
@@ -123,8 +109,8 @@ bool waitingForNextTick() {
 }
 
 void skipMissedTicks() {
-	last_tick_time = AGS_Clock::now();
-	next_frame_timestamp = AGS_Clock::now();
+	_G(last_tick_time) = AGS_Clock::now();
+	_G(next_frame_timestamp) = AGS_Clock::now();
 }
 
 } // namespace AGS3
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index 324d52e3eb..65bf318eec 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -35,6 +35,7 @@
 #include "ags/engine/script/script.h"
 #include "ags/engine/script/script_runtime.h"
 #include "ags/lib/std/array.h"
+#include "ags/lib/std/chrono.h"
 #include "ags/lib/std/set.h"
 #include "ags/lib/allegro/color.h"
 #include "ags/lib/allegro/fixed.h"
@@ -1131,6 +1132,19 @@ public:
 
 	/**@}*/
 
+	/**
+	 * \defgroup timer globals
+	 * @{
+	 */
+
+	std::chrono::microseconds _tick_duration = std::chrono::microseconds(1000000LL / 40);
+	bool _framerate_maxed = false;
+
+	uint32 _last_tick_time = 0; // AGS_Clock::now();
+	uint32 _next_frame_timestamp = 0; // AGS_Clock::now();
+
+	/**@}*/
+
 	/**
 	 * \defgroup translation globals
 	 * @{


Commit: 6ee633dc8a018cc12b1ead51cbc63ff97976e2f6
    https://github.com/scummvm/scummvm/commit/6ee633dc8a018cc12b1ead51cbc63ff97976e2f6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-13T16:46:24-08:00

Commit Message:
AGS: Change global strings to const char *

Changed paths:
    engines/ags/engine/game/savegame.cpp
    engines/ags/engine/game/savegame.h
    engines/ags/engine/game/savegame_components.cpp
    engines/ags/engine/main/config.cpp
    engines/ags/shared/util/misc.cpp


diff --git a/engines/ags/engine/game/savegame.cpp b/engines/ags/engine/game/savegame.cpp
index 939560f085..1b06c99571 100644
--- a/engines/ags/engine/game/savegame.cpp
+++ b/engines/ags/engine/game/savegame.cpp
@@ -75,8 +75,8 @@ HSaveError restore_game_data(Stream *in, SavegameVersion svg_version, const Pres
 namespace AGS {
 namespace Engine {
 
-const String SavegameSource::LegacySignature = "Adventure Game Studio saved game";
-const String SavegameSource::Signature = "Adventure Game Studio saved game v2";
+const char *SavegameSource::LegacySignature = "Adventure Game Studio saved game";
+const char *SavegameSource::Signature = "Adventure Game Studio saved game v2";
 
 SavegameSource::SavegameSource()
 	: Version(kSvgVersion_Undefined) {
@@ -262,12 +262,12 @@ HSaveError OpenSavegameBase(const String &filename, SavegameSource *src, Savegam
 	// Check saved game signature
 	bool is_new_save = false;
 	size_t pre_sig_pos = in->GetPosition();
-	String svg_sig = String::FromStreamCount(in.get(), SavegameSource::Signature.GetLength());
+	String svg_sig = String::FromStreamCount(in.get(), strlen(SavegameSource::Signature));
 	if (svg_sig.Compare(SavegameSource::Signature) == 0) {
 		is_new_save = true;
 	} else {
 		in->Seek(pre_sig_pos, kSeekBegin);
-		svg_sig = String::FromStreamCount(in.get(), SavegameSource::LegacySignature.GetLength());
+		svg_sig = String::FromStreamCount(in.get(), strlen(SavegameSource::LegacySignature));
 		if (svg_sig.Compare(SavegameSource::LegacySignature) != 0)
 			return new SavegameError(kSvgErr_SignatureFailed);
 	}
@@ -703,7 +703,7 @@ PStream StartSavegame(const String &filename, const String &user_text, const Bit
 	vistaHeader.WriteToFile(out);
 
 	// Savegame signature
-	out->Write(SavegameSource::Signature.GetCStr(), SavegameSource::Signature.GetLength());
+	out->Write(SavegameSource::Signature, strlen(SavegameSource::Signature));
 
 	// CHECKME: what is this plugin hook suppose to mean, and if it is called here correctly
 	pl_run_plugin_hooks(AGSE_PRESAVEGAME, 0);
diff --git a/engines/ags/engine/game/savegame.h b/engines/ags/engine/game/savegame.h
index ff0804025d..46c967aebd 100644
--- a/engines/ags/engine/game/savegame.h
+++ b/engines/ags/engine/game/savegame.h
@@ -100,9 +100,9 @@ typedef std::unique_ptr<Bitmap> UBitmap;
 // SavegameSource defines a successfully opened savegame stream
 struct SavegameSource {
 	// Signature of the current savegame format
-	static const String Signature;
+	static const char *Signature;
 	// Signature of the legacy savegame format
-	static const String LegacySignature;
+	static const char *LegacySignature;
 
 	// Name of the savefile
 	String              Filename;
diff --git a/engines/ags/engine/game/savegame_components.cpp b/engines/ags/engine/game/savegame_components.cpp
index 798d223ab2..f3f3d191e3 100644
--- a/engines/ags/engine/game/savegame_components.cpp
+++ b/engines/ags/engine/game/savegame_components.cpp
@@ -68,7 +68,7 @@ namespace Engine {
 
 namespace SavegameComponents {
 
-const String ComponentListTag = "Components";
+static const char *ComponentListTag = "Components";
 
 void WriteFormatTag(PStream out, const String &tag, bool open = true) {
 	String full_tag = String::FromFormat(open ? "<%s>" : "</%s>", tag.GetCStr());
@@ -1000,15 +1000,15 @@ HSaveError ReadPluginData(PStream in, int32_t cmp_ver, const PreservedParams &pp
 
 // Description of a supported game state serialization component
 struct ComponentHandler {
-	String             Name;    // internal component's ID
-	int32_t            Version; // current version to write and the highest supported version
-	int32_t            LowestVersion; // lowest supported version that the engine can read
+	const char *Name;      // internal component's ID
+	int32_t Version;       // current version to write and the highest supported version
+	int32_t LowestVersion; // lowest supported version that the engine can read
 	HSaveError(*Serialize)(PStream);
 	HSaveError(*Unserialize)(PStream, int32_t cmp_ver, const PreservedParams &, RestoredData &);
 };
 
 // Array of supported components
-ComponentHandler ComponentHandlers[] = {
+static const ComponentHandler ComponentHandlers[] = {
 	{
 		"Game State",
 		kGSSvgVersion_3510,
@@ -1128,8 +1128,8 @@ ComponentHandler ComponentHandlers[] = {
 typedef std::map<String, ComponentHandler> HandlersMap;
 void GenerateHandlersMap(HandlersMap &map) {
 	map.clear();
-	for (int i = 0; !ComponentHandlers[i].Name.IsEmpty(); ++i)
-		map[ComponentHandlers[i].Name] = ComponentHandlers[i];
+	for (int i = 0; !strlen(ComponentHandlers[i].Name); ++i)
+		map[String(ComponentHandlers[i].Name)] = ComponentHandlers[i];
 }
 
 // A helper struct to pass to (de)serialization handlers
@@ -1218,7 +1218,7 @@ HSaveError ReadAll(PStream in, SavegameVersion svg_version, const PreservedParam
 	return new SavegameError(kSvgErr_ComponentListClosingTagMissing);
 }
 
-HSaveError WriteComponent(PStream out, ComponentHandler &hdlr) {
+HSaveError WriteComponent(PStream out, const ComponentHandler &hdlr) {
 	WriteFormatTag(out, hdlr.Name, true);
 	out->WriteInt32(hdlr.Version);
 	soff_t ref_pos = out->GetPosition();
@@ -1235,11 +1235,11 @@ HSaveError WriteComponent(PStream out, ComponentHandler &hdlr) {
 
 HSaveError WriteAllCommon(PStream out) {
 	WriteFormatTag(out, ComponentListTag, true);
-	for (int type = 0; !ComponentHandlers[type].Name.IsEmpty(); ++type) {
+	for (int type = 0; !strlen(ComponentHandlers[type].Name); ++type) {
 		HSaveError err = WriteComponent(out, ComponentHandlers[type]);
 		if (!err) {
 			return new SavegameError(kSvgErr_ComponentSerialization,
-			                         String::FromFormat("Component: (#%d) %s", type, ComponentHandlers[type].Name.GetCStr()),
+			                         String::FromFormat("Component: (#%d) %s", type, ComponentHandlers[type].Name),
 			                         err);
 		}
 		update_polled_stuff_if_runtime();
diff --git a/engines/ags/engine/main/config.cpp b/engines/ags/engine/main/config.cpp
index 4c1672beef..49c26e0f93 100644
--- a/engines/ags/engine/main/config.cpp
+++ b/engines/ags/engine/main/config.cpp
@@ -52,7 +52,7 @@ using namespace AGS::Shared;
 using namespace AGS::Engine;
 
 // Filename of the default config file, the one found in the game installation
-const String DefaultConfigFileName = "acsetup.cfg";
+static const char *DefaultConfigFileName = "acsetup.cfg";
 
 // Replace the filename part of complete path WASGV with INIFIL
 // TODO: get rid of this and use proper lib path function instead
@@ -211,7 +211,9 @@ void graphics_mode_get_defaults(bool windowed, ScreenSizeSetup &scsz_setup, Game
 
 String find_default_cfg_file(const char *alt_cfg_file) {
 	// Try current directory for config first; else try exe dir
-	String filename = String::FromFormat("%s/%s", Directory::GetCurrentDirectory().GetCStr(), DefaultConfigFileName.GetCStr());
+	String filename = String::FromFormat("%s/%s",
+		Directory::GetCurrentDirectory().GetCStr(),
+		DefaultConfigFileName);
 	if (!Shared::File::TestReadFile(filename)) {
 		char conffilebuf[512];
 		strcpy(conffilebuf, alt_cfg_file);
@@ -225,12 +227,12 @@ String find_default_cfg_file(const char *alt_cfg_file) {
 
 String find_user_global_cfg_file() {
 	String parent_dir = PathOrCurDir(_G(platform)->GetUserGlobalConfigDirectory());
-	return String::FromFormat("%s/%s", parent_dir.GetCStr(), DefaultConfigFileName.GetCStr());
+	return String::FromFormat("%s/%s", parent_dir.GetCStr(), DefaultConfigFileName);
 }
 
 String find_user_cfg_file() {
 	String parent_dir = MakeSpecialSubDir(PathOrCurDir(_G(platform)->GetUserConfigDirectory()));
-	return String::FromFormat("%s/%s", parent_dir.GetCStr(), DefaultConfigFileName.GetCStr());
+	return String::FromFormat("%s/%s", parent_dir.GetCStr(), DefaultConfigFileName);
 }
 
 void config_defaults() {
diff --git a/engines/ags/shared/util/misc.cpp b/engines/ags/shared/util/misc.cpp
index d82ffee28f..a261420bd1 100644
--- a/engines/ags/shared/util/misc.cpp
+++ b/engines/ags/shared/util/misc.cpp
@@ -50,11 +50,6 @@
 */
 
 #include "ags/shared/core/platform.h"
-
-#if !AGS_PLATFORM_OS_WINDOWS
-//include <dirent.h>
-#endif
-
 #include "ags/lib/allegro.h"
 #include "ags/shared/util/file.h"
 #include "ags/shared/util/stream.h"


Commit: e28fc6ee90fec49b55f28062abdefbf9e0c8a2a9
    https://github.com/scummvm/scummvm/commit/e28fc6ee90fec49b55f28062abdefbf9e0c8a2a9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-03-13T16:46:24-08:00

Commit Message:
AGS: Move FilterInfo statics to Globals

Changed paths:
    engines/ags/engine/gfx/ali3dscummvm.cpp
    engines/ags/engine/gfx/gfxfilter_allegro.cpp
    engines/ags/engine/gfx/gfxfilter_allegro.h
    engines/ags/engine/gfx/gfxfilter_hqx.cpp
    engines/ags/engine/gfx/gfxfilter_hqx.h
    engines/ags/globals.cpp
    engines/ags/globals.h
    engines/ags/shared/util/mutifilelib.cpp


diff --git a/engines/ags/engine/gfx/ali3dscummvm.cpp b/engines/ags/engine/gfx/ali3dscummvm.cpp
index 93417fe402..b1bc0ba1ca 100644
--- a/engines/ags/engine/gfx/ali3dscummvm.cpp
+++ b/engines/ags/engine/gfx/ali3dscummvm.cpp
@@ -727,16 +727,16 @@ size_t ALScummVMGraphicsFactory::GetFilterCount() const {
 const GfxFilterInfo *ALScummVMGraphicsFactory::GetFilterInfo(size_t index) const {
 	switch (index) {
 	case 0:
-		return &AllegroGfxFilter::FilterInfo;
+		return &_GP(allegroFilterInfo);
 	case 1:
-		return &HqxGfxFilter::FilterInfo;
+		return &_GP(hqxFilterInfo);
 	default:
 		return nullptr;
 	}
 }
 
 String ALScummVMGraphicsFactory::GetDefaultFilterID() const {
-	return AllegroGfxFilter::FilterInfo.Id;
+	return _GP(allegroFilterInfo).Id;
 }
 
 /* static */ ALScummVMGraphicsFactory *ALScummVMGraphicsFactory::GetFactory() {
@@ -752,9 +752,9 @@ ALScummVMGraphicsDriver *ALScummVMGraphicsFactory::EnsureDriverCreated() {
 }
 
 AllegroGfxFilter *ALScummVMGraphicsFactory::CreateFilter(const String &id) {
-	if (AllegroGfxFilter::FilterInfo.Id.CompareNoCase(id) == 0)
+	if (_GP(allegroFilterInfo).Id.CompareNoCase(id) == 0)
 		return new AllegroGfxFilter();
-	else if (HqxGfxFilter::FilterInfo.Id.CompareNoCase(id) == 0)
+	else if (_GP(hqxFilterInfo).Id.CompareNoCase(id) == 0)
 		return new HqxGfxFilter();
 	return nullptr;
 }
diff --git a/engines/ags/engine/gfx/gfxfilter_allegro.cpp b/engines/ags/engine/gfx/gfxfilter_allegro.cpp
index 0392f173fe..19845c3cc3 100644
--- a/engines/ags/engine/gfx/gfxfilter_allegro.cpp
+++ b/engines/ags/engine/gfx/gfxfilter_allegro.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "ags/engine/gfx/gfxfilter_allegro.h"
+#include "ags/globals.h"
 
 namespace AGS3 {
 namespace AGS {
@@ -29,8 +30,6 @@ namespace ALGfx {
 
 using namespace Shared;
 
-const GfxFilterInfo AllegroGfxFilter::FilterInfo = GfxFilterInfo("StdScale", "Nearest-neighbour");
-
 AllegroGfxFilter::AllegroGfxFilter()
 	: realScreen(nullptr)
 	, virtualScreen(nullptr)
@@ -41,7 +40,7 @@ AllegroGfxFilter::AllegroGfxFilter()
 }
 
 const GfxFilterInfo &AllegroGfxFilter::GetInfo() const {
-	return FilterInfo;
+	return _GP(allegroFilterInfo);
 }
 
 Bitmap *AllegroGfxFilter::InitVirtualScreen(Bitmap *screen, const Size src_size, const Rect dst_rect) {
diff --git a/engines/ags/engine/gfx/gfxfilter_allegro.h b/engines/ags/engine/gfx/gfxfilter_allegro.h
index 0a1f953c66..6a1c380ea3 100644
--- a/engines/ags/engine/gfx/gfxfilter_allegro.h
+++ b/engines/ags/engine/gfx/gfxfilter_allegro.h
@@ -54,8 +54,6 @@ public:
 	virtual void GetCopyOfScreenIntoBitmap(Bitmap *copyBitmap);
 	virtual void GetCopyOfScreenIntoBitmap(Bitmap *copyBitmap, bool copy_with_yoffset);
 
-	static const GfxFilterInfo FilterInfo;
-
 protected:
 	virtual Bitmap *PreRenderPass(Bitmap *toRender);
 
diff --git a/engines/ags/engine/gfx/gfxfilter_hqx.cpp b/engines/ags/engine/gfx/gfxfilter_hqx.cpp
index 54ee188ee8..bc435576b8 100644
--- a/engines/ags/engine/gfx/gfxfilter_hqx.cpp
+++ b/engines/ags/engine/gfx/gfxfilter_hqx.cpp
@@ -23,6 +23,7 @@
 #include "ags/shared/gfx/bitmap.h"
 #include "ags/engine/gfx/gfxfilter_hqx.h"
 #include "ags/engine/gfx/hq2x3x.h"
+#include "ags/globals.h"
 
 namespace AGS3 {
 namespace AGS {
@@ -31,8 +32,6 @@ namespace ALGfx {
 
 using namespace Shared;
 
-const GfxFilterInfo HqxGfxFilter::FilterInfo = GfxFilterInfo("Hqx", "Hqx (High Quality)", 2, 3);
-
 HqxGfxFilter::HqxGfxFilter()
 	: _pfnHqx(nullptr)
 	, _hqxScalingBuffer(nullptr) {
@@ -43,7 +42,7 @@ HqxGfxFilter::~HqxGfxFilter() {
 }
 
 const GfxFilterInfo &HqxGfxFilter::GetInfo() const {
-	return FilterInfo;
+	return _GP(hqxFilterInfo);
 }
 
 bool HqxGfxFilter::Initialize(const int color_depth, String &err_str) {
diff --git a/engines/ags/engine/gfx/gfxfilter_hqx.h b/engines/ags/engine/gfx/gfxfilter_hqx.h
index 2a1bfe8455..57ae93d884 100644
--- a/engines/ags/engine/gfx/gfxfilter_hqx.h
+++ b/engines/ags/engine/gfx/gfxfilter_hqx.h
@@ -47,8 +47,6 @@ public:
 	Bitmap *InitVirtualScreen(Bitmap *screen, const Size src_size, const Rect dst_rect) override;
 	Bitmap *ShutdownAndReturnRealScreen() override;
 
-	static const GfxFilterInfo FilterInfo;
-
 protected:
 	Bitmap *PreRenderPass(Bitmap *toRender) override;
 
diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp
index 8cb86e41b4..de388e3431 100644
--- a/engines/ags/globals.cpp
+++ b/engines/ags/globals.cpp
@@ -77,6 +77,7 @@
 #include "ags/engine/debugging/logfile.h"
 #include "ags/engine/debugging/messagebuffer.h"
 #include "ags/engine/device/mousew32.h"
+#include "ags/engine/gfx/gfxfilter.h"
 #include "ags/engine/gui/animatingguibutton.h"
 #include "ags/engine/gui/cscidialog.h"
 #include "ags/engine/gui/guidialogdefines.h"
@@ -211,6 +212,13 @@ Globals::Globals() {
 	_StaticInventoryArray = new StaticArray();
 	_StaticDialogArray = new StaticArray();
 
+	// gfxfilter_allegro.cpp globals
+	_allegroFilterInfo = new AGS::Engine::GfxFilterInfo("StdScale", "Nearest-neighbour");
+
+	// gfxfilter_hqx.cpp globals
+	_hqxFilterInfo = new AGS::Engine::GfxFilterInfo("Hqx", "Hqx (High Quality)", 2, 3);
+
+
 	// global_dialog.cpp globals
 	_last_in_dialog_request_script_pos = new ScriptPosition();
 
@@ -415,6 +423,12 @@ Globals::~Globals() {
 	delete _StaticInventoryArray;
 	delete _StaticDialogArray;
 
+	// gfxfilter_allegro.cpp globals
+	delete _allegroFilterInfo;
+
+	// gfxfilter_hqx.cpp globals
+	delete _hqxFilterInfo;
+
 	// global_dialog.cpp globals
 	delete _last_in_dialog_request_script_pos;
 
diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index 65bf318eec..a227146390 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -69,6 +69,7 @@ class RoomStruct;
 namespace Engine {
 
 class ConsoleOutputTarget;
+struct GfxFilterInfo;
 class IDriverDependantBitmap;
 class IGfxDriverFactory;
 class IGraphicsDriver;
@@ -708,6 +709,24 @@ public:
 
 	 /**@}*/
 
+	/**
+	 * \defgroup gfxfilter_allegro globals
+	 * @{
+	 */
+
+	const AGS::Engine::GfxFilterInfo *_allegroFilterInfo;
+
+	/**@}*/
+
+	/**
+	 * \defgroup gfxfilter_allegro globals
+	 * @{
+	 */
+
+	const AGS::Engine::GfxFilterInfo *_hqxFilterInfo;
+
+	/**@}*/
+
 	/**
 	 * \defgroup global_dialog globals
 	 * @{
diff --git a/engines/ags/shared/util/mutifilelib.cpp b/engines/ags/shared/util/mutifilelib.cpp
index 2f51655541..bff6a14f36 100644
--- a/engines/ags/shared/util/mutifilelib.cpp
+++ b/engines/ags/shared/util/mutifilelib.cpp
@@ -42,7 +42,7 @@ static const size_t V10LibFileLen = 20;
 static const size_t V10AssetFileLen = 25;
 
 static const int EncryptionRandSeed = 9338638;
-static const String EncryptionString = "My\x1\xde\x4Jibzle";
+static const char *EncryptionString = "My\x1\xde\x4Jibzle";
 
 MFLError ReadSigsAndVersion(Stream *in, MFLVersion *p_lib_version, soff_t *p_abs_offset);
 MFLError ReadSingleFileLib(AssetLibInfo &lib, Stream *in, MFLVersion lib_version);




More information about the Scummvm-git-logs mailing list