[Scummvm-git-logs] scummvm master -> 8c8517cfd406e7ebcbf8a53ce91473aec329543c
bluegr
noreply at scummvm.org
Fri Mar 25 15:46:32 UTC 2022
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fbe73b6544 CHEWY: Fix extra game options
30e2f84075 CHEWY: Refactor the save slots in the original save/load dialog
8c8517cfd4 CHEWY: Fix display during text input in the save dialog
Commit: fbe73b654429b2facd75d6f6fc38097d24bd22bd
https://github.com/scummvm/scummvm/commit/fbe73b654429b2facd75d6f6fc38097d24bd22bd
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-25T17:46:10+02:00
Commit Message:
CHEWY: Fix extra game options
Changed paths:
engines/chewy/detection.cpp
diff --git a/engines/chewy/detection.cpp b/engines/chewy/detection.cpp
index 4e3aed9e68f..05ad381910a 100644
--- a/engines/chewy/detection.cpp
+++ b/engines/chewy/detection.cpp
@@ -122,7 +122,7 @@ static const ADExtraGuiOptionsMap optionsList[] = {
class ChewyMetaEngineDetection : public AdvancedMetaEngineDetection {
public:
- ChewyMetaEngineDetection() : AdvancedMetaEngineDetection(Chewy::gameDescriptions, sizeof(Chewy::ChewyGameDescription), chewyGames) {
+ ChewyMetaEngineDetection() : AdvancedMetaEngineDetection(Chewy::gameDescriptions, sizeof(Chewy::ChewyGameDescription), chewyGames, Chewy::optionsList) {
_maxScanDepth = 2;
_flags = kADFlagMatchFullPaths;
}
Commit: 30e2f840756f81c9c1e6e10bffcc9d3c34becdc0
https://github.com/scummvm/scummvm/commit/30e2f840756f81c9c1e6e10bffcc9d3c34becdc0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-25T17:46:10+02:00
Commit Message:
CHEWY: Refactor the save slots in the original save/load dialog
Now, 1000 save slots are supported. Also, we are using a string array,
which helps us simplify the save slot processing code
Changed paths:
engines/chewy/dialogs/files.cpp
engines/chewy/io_game.cpp
engines/chewy/io_game.h
diff --git a/engines/chewy/dialogs/files.cpp b/engines/chewy/dialogs/files.cpp
index a15603e0314..787bea35aba 100644
--- a/engines/chewy/dialogs/files.cpp
+++ b/engines/chewy/dialogs/files.cpp
@@ -70,7 +70,7 @@ int16 Files::execute(bool isInGame) {
_G(out)->map_spr2screen(_G(ablage)[_G(room_blk).AkAblage], 0, 0);
_G(out)->setPointer(_G(screen0));
_G(room)->set_ak_pal(&_G(room_blk));
- FileFind *fnames = _G(iog)->io_init();
+ Common::StringArray &fnames = _G(iog)->io_init();
_G(fx)->blende1(_G(workptr), _G(screen0), _G(pal), 150, 0, 0);
_G(out)->setPointer(_G(workptr));
@@ -114,16 +114,15 @@ int16 Files::execute(bool isInGame) {
}
// Write the list of savegame slots
- FileFind *tmp = &fnames[text_off];
- for (int16 i = 0; i < NUM_VISIBLE_SLOTS; i++, ++tmp) {
+ for (int16 i = 0; i < NUM_VISIBLE_SLOTS; i++) {
Common::String slot = Common::String::format("%2d.", text_off + i);
if (i != active_slot) {
_G(out)->printxy(40, 68 + (i * 10), 14, 300, 0, slot.c_str());
- _G(out)->printxy(70, 68 + (i * 10), 14, 300, 0, tmp->_name.c_str());
+ _G(out)->printxy(70, 68 + (i * 10), 14, 300, 0, fnames[i + text_off].c_str());
} else {
_G(out)->boxFill(40, 68 + (i * 10), 308, 68 + 8 + (i * 10), 42);
_G(out)->printxy(40, 68 + (i * 10), 255, 300, 0, slot.c_str());
- _G(out)->printxy(70, 68 + (i * 10), 255, 300, 0, tmp->_name.c_str());
+ _G(out)->printxy(70, 68 + (i * 10), 255, 300, 0, fnames[i + text_off].c_str());
}
}
@@ -251,7 +250,7 @@ int16 Files::execute(bool isInGame) {
mode[SCROLL_DOWN] = 10;
if (active_slot < (NUM_VISIBLE_SLOTS - 1))
++active_slot;
- else if (text_off < (20 - NUM_VISIBLE_SLOTS))
+ else if (text_off < (999 - NUM_VISIBLE_SLOTS))
++text_off;
break;
@@ -273,9 +272,12 @@ enter:
} else if (mode[SAVE]) {
_G(out)->back2screen(_G(workpage));
_G(out)->setPointer(_G(screen0));
- tmp = fnames + ((text_off + active_slot) * 40);
+ char tmp[81];
+ tmp[0] = '\0';
key = _G(out)->scanxy(70, 68 + (active_slot * 10),
255, 42, 14, 0, "%36s36", tmp);
+ fnames[text_off + active_slot] = tmp;
+
_G(out)->setPointer(_G(workptr));
if (key != Common::KEYCODE_ESCAPE) {
_G(iog)->save_entry(text_off + active_slot);
diff --git a/engines/chewy/io_game.cpp b/engines/chewy/io_game.cpp
index 3f836c1aae8..de597a931a4 100644
--- a/engines/chewy/io_game.cpp
+++ b/engines/chewy/io_game.cpp
@@ -26,36 +26,29 @@
namespace Chewy {
-FileFind *IOGame::io_init() {
- get_savegame_files();
- return &_fileFind[0];
-}
-
-void IOGame::save_entry(int16 slotNum) {
- Common::String desc = _fileFind[slotNum]._name;
- g_engine->saveGameState(slotNum, desc);
-}
-
-int16 IOGame::get_savegame_files() {
+Common::StringArray &IOGame::io_init() {
SaveStateList saveList = g_engine->listSaves();
- int ret = 0;
- for (int i = 0; i < 20; i++) {
- _fileFind[i]._found = false;
- _fileFind[i]._name = "";
+ _fileFind.resize(1000);
+
+ for (int i = 0; i < saveList.size(); i++) {
+ _fileFind[i] = "";
for (uint j = 0; j < saveList.size(); ++j) {
if (saveList[j].getSaveSlot() == i) {
Common::String name = saveList[j].getDescription();
- _fileFind[i]._found = true;
- _fileFind[i]._name = name;
- ++ret;
+ _fileFind[i] = name;
break;
}
}
}
- return ret;
+ return _fileFind;
+}
+
+void IOGame::save_entry(int16 slotNum) {
+ Common::String desc = _fileFind[slotNum];
+ g_engine->saveGameState(slotNum, desc);
}
} // namespace Chewy
diff --git a/engines/chewy/io_game.h b/engines/chewy/io_game.h
index 8d5bc650cc9..854061a9a59 100644
--- a/engines/chewy/io_game.h
+++ b/engines/chewy/io_game.h
@@ -27,21 +27,11 @@ namespace Chewy {
#define IOG_END 1
#define USER_NAME 36
-struct FileFind {
- bool _found;
- Common::String _name;
-
- FileFind() {
- _found = false;
- }
-};
-
class IOGame {
- FileFind _fileFind[20];
- int16 get_savegame_files();
+ Common::StringArray _fileFind;
public:
- FileFind *io_init();
+ Common::StringArray &io_init();
void save_entry(int16 nr);
};
Commit: 8c8517cfd406e7ebcbf8a53ce91473aec329543c
https://github.com/scummvm/scummvm/commit/8c8517cfd406e7ebcbf8a53ce91473aec329543c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-25T17:46:10+02:00
Commit Message:
CHEWY: Fix display during text input in the save dialog
Changed paths:
engines/chewy/mcga.cpp
diff --git a/engines/chewy/mcga.cpp b/engines/chewy/mcga.cpp
index 74f31dda470..c5672befd43 100644
--- a/engines/chewy/mcga.cpp
+++ b/engines/chewy/mcga.cpp
@@ -221,7 +221,6 @@ void mspr_set_mcga(byte *sptr, int16 x, int16 y, int16 scrWidth) {
void vors() {
_G(gcurx) += _G(fontMgr)->getFont()->getDataWidth();
- _G(gcury) += _G(fontMgr)->getFont()->getDataHeight();
}
void putcxy(int16 x, int16 y, unsigned char c, int16 fgCol, int16 bgCol, int16 scrWidth) {
More information about the Scummvm-git-logs
mailing list