[Scummvm-git-logs] scummvm master -> 4d8091d19887505a8a5551738a83841c9734768e
bluegr
noreply at scummvm.org
Wed Mar 16 01:28:30 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
060eb2627b CHEWY: Remove superfluous save slot related code
4d8091d198 CHEWY: Remove dead code
Commit: 060eb2627bb09bff6211efcb034d4ad23801d815
https://github.com/scummvm/scummvm/commit/060eb2627bb09bff6211efcb034d4ad23801d815
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-16T03:28:04+02:00
Commit Message:
CHEWY: Remove superfluous save slot related code
Changed paths:
engines/chewy/defines.h
engines/chewy/dialogs/files.cpp
engines/chewy/globals.h
engines/chewy/inits.cpp
engines/chewy/io_game.cpp
engines/chewy/io_game.h
engines/chewy/ngstypes.h
diff --git a/engines/chewy/defines.h b/engines/chewy/defines.h
index 9f6b73887f7..1085c8e6cb7 100644
--- a/engines/chewy/defines.h
+++ b/engines/chewy/defines.h
@@ -158,7 +158,6 @@ enum SetupScreenMode {
#define CH_SPZ_FILE "misc/ch_spez.taf"
#define OPTION_TAF "MISC/OPTION.TAF"
-#define SAVEDIR "save/savegame."
#define DETAILTEST "room/test.rdi"
#define GBOOK "BACK/GBOOK.TGP"
diff --git a/engines/chewy/dialogs/files.cpp b/engines/chewy/dialogs/files.cpp
index 53757a57de5..8f97a94c5e4 100644
--- a/engines/chewy/dialogs/files.cpp
+++ b/engines/chewy/dialogs/files.cpp
@@ -68,7 +68,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));
- char *fnames = _G(iog)->io_init(&_G(ioptr));
+ char *fnames = _G(iog)->io_init();
fnames += 1;
_G(fx)->blende1(_G(workptr), _G(screen0), _G(pal), 150, 0, 0);
@@ -258,11 +258,16 @@ int16 Files::execute(bool isInGame) {
case Common::KEYCODE_RETURN + ALT:
enter:
if (mode[LOAD]) {
- tmp = fnames + ((text_off + active_slot) * 40);
- if (tmp[0]) {
- _G(currentSong) = -1;
- _G(iog)->load(text_off + active_slot, _G(ioptr).save_path);
- key = Common::KEYCODE_ESCAPE;
+ const int16 slotNum = text_off + active_slot;
+ SaveStateList saveList = g_engine->listSaves();
+ for (uint j = 0; j < saveList.size(); ++j) {
+ if (saveList[j].getSaveSlot() == slotNum) {
+ _G(currentSong) = -1;
+ _G(cur)->hide_cur();
+ g_engine->loadGameState(slotNum);
+ key = Common::KEYCODE_ESCAPE;
+ break;
+ }
}
} else if (mode[SAVE]) {
_G(out)->back2screen(_G(workpage));
@@ -272,8 +277,7 @@ enter:
255, 42, 14, 0, "%36s36", tmp);
_G(out)->setPointer(_G(workptr));
if (key != Common::KEYCODE_ESCAPE) {
- _G(iog)->save_entry(text_off + active_slot,
- _G(ioptr).save_path);
+ _G(iog)->save_entry(text_off + active_slot);
}
key = Common::KEYCODE_ESCAPE;
}
diff --git a/engines/chewy/globals.h b/engines/chewy/globals.h
index dff41023121..e00d72c20af 100644
--- a/engines/chewy/globals.h
+++ b/engines/chewy/globals.h
@@ -217,7 +217,6 @@ public:
MouseInfo _minfo;
CurBlk _curblk;
CurAni _curani;
- IogInit _ioptr;
RaumBlk _room_blk;
Flags _flags = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 };
diff --git a/engines/chewy/inits.cpp b/engines/chewy/inits.cpp
index 16cd27da017..60424f65016 100644
--- a/engines/chewy/inits.cpp
+++ b/engines/chewy/inits.cpp
@@ -63,10 +63,7 @@ void standard_init() {
_G(cur) = new Cursor(&_G(curblk));
_G(cur)->set_cur_ani(&_G(curani));
- _G(iog) = new IOGame(_G(out), _G(in), _G(cur));
- strcpy(_G(ioptr).id, "CHE");
- strcpy(_G(ioptr).save_path, SAVEDIR);
- _G(ioptr).delay = 8;
+ _G(iog) = new IOGame();
alloc_buffers();
_G(pal)[765] = 63;
_G(pal)[766] = 63;
diff --git a/engines/chewy/io_game.cpp b/engines/chewy/io_game.cpp
index fe8f6535abb..81ca573f2c2 100644
--- a/engines/chewy/io_game.cpp
+++ b/engines/chewy/io_game.cpp
@@ -27,14 +27,7 @@
namespace Chewy {
-IOGame::IOGame(McgaGraphics *out, InputMgr *in, Cursor *cur) {
- _out = out;
- _in = in;
- _cur = cur;
-}
-
-char *IOGame::io_init(IogInit *iostruc) {
- _io = iostruc;
+char *IOGame::io_init() {
for (int16 i = 0; i < 20; i++)
_fileFind[i][0] = 0;
get_savegame_files();
@@ -42,20 +35,11 @@ char *IOGame::io_init(IogInit *iostruc) {
return &_fileFind[0][0];
}
-void IOGame::save_entry(int16 slotNum, char *fname) {
+void IOGame::save_entry(int16 slotNum) {
Common::String desc(&_fileFind[slotNum][1]);
g_engine->saveGameState(slotNum, desc);
}
-void IOGame::load(int16 slotNum, char *fname) {
- get_savegame_files();
-
- _cur->hide_cur();
- if (_fileFind[slotNum][0] == 1) {
- (void)g_engine->loadGameState(slotNum);
- }
-}
-
int16 IOGame::get_savegame_files() {
SaveStateList saveList = g_engine->listSaves();
int ret = 0;
diff --git a/engines/chewy/io_game.h b/engines/chewy/io_game.h
index c9f40e7b31f..36a20ebe2f2 100644
--- a/engines/chewy/io_game.h
+++ b/engines/chewy/io_game.h
@@ -29,30 +29,20 @@
namespace Chewy {
#define IOG_END 1
-#define IOG_LOAD 2
-#define IOG_SAVE 3
-#define IOG_BACK 4
#define USER_NAME 36
-#define DOPPEL_KLICK 0.5
-
class IOGame {
private:
- Cursor *_cur;
- IogInit *_io;
- InputMgr *_in;
- McgaGraphics *_out;
char _fileFind[20][USER_NAME + 4];
private:
int16 get_savegame_files();
public:
- IOGame(McgaGraphics *out, InputMgr *in, Cursor *cur);
+ IOGame() {}
- char *io_init(IogInit *iostruc);
- void load(int16 nr, char *fname);
- void save_entry(int16 nr, char *fname);
+ char *io_init();
+ void save_entry(int16 nr);
};
} // namespace Chewy
diff --git a/engines/chewy/ngstypes.h b/engines/chewy/ngstypes.h
index 4d540f9b245..e6b7c737b87 100644
--- a/engines/chewy/ngstypes.h
+++ b/engines/chewy/ngstypes.h
@@ -83,21 +83,6 @@ struct musik_info {
char *cur_pattern = nullptr;
};
-struct IogInit {
- char id[4] = { 0 };
- char save_path[30] = { 0 };
-
- int16 popx = 0;
- int16 popy = 0;
- const byte *m_col = nullptr;
- uint8 f1 = 0;
- uint8 f2 = 0;
- uint8 f3 = 0;
- uint8 f4 = 0;
- uint8 key_nr = 0;
- int16 delay = 0;
-};
-
struct GedPoolHeader {
char _id[4] = { 0 };
int16 _nr = 0;
Commit: 4d8091d19887505a8a5551738a83841c9734768e
https://github.com/scummvm/scummvm/commit/4d8091d19887505a8a5551738a83841c9734768e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-03-16T03:28:04+02:00
Commit Message:
CHEWY: Remove dead code
Changed paths:
engines/chewy/mcga.cpp
engines/chewy/mcga.h
engines/chewy/mcga_graphics.cpp
engines/chewy/mcga_graphics.h
diff --git a/engines/chewy/mcga.cpp b/engines/chewy/mcga.cpp
index 74e8860b218..74f31dda470 100644
--- a/engines/chewy/mcga.cpp
+++ b/engines/chewy/mcga.cpp
@@ -219,11 +219,6 @@ void mspr_set_mcga(byte *sptr, int16 x, int16 y, int16 scrWidth) {
}
}
-void upd_scr() {
- g_screen->markAllDirty();
- g_screen->update();
-}
-
void vors() {
_G(gcurx) += _G(fontMgr)->getFont()->getDataWidth();
_G(gcury) += _G(fontMgr)->getFont()->getDataHeight();
diff --git a/engines/chewy/mcga.h b/engines/chewy/mcga.h
index c70b05d4264..16cc6b44eee 100644
--- a/engines/chewy/mcga.h
+++ b/engines/chewy/mcga.h
@@ -51,8 +51,6 @@ void putcxy(int16 x, int16 y, unsigned char c, int16 fgCol, int16 bgCol, int16 s
void putz(unsigned char c, int16 fgCol, int16 bgCol, int16 scrWidth);
void vors();
-void upd_scr();
-
} // namespace Chewy
#endif
diff --git a/engines/chewy/mcga_graphics.cpp b/engines/chewy/mcga_graphics.cpp
index 46dbbba3b21..8918add31b5 100644
--- a/engines/chewy/mcga_graphics.cpp
+++ b/engines/chewy/mcga_graphics.cpp
@@ -380,8 +380,6 @@ int16 McgaGraphics::scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_c
break;
}
}
- if (_svga == ON)
- upd_scr();
for (delay_flag = 0; (delay_flag < 10) && (!kbhit()); delay_flag++) {
izahl = devices();
@@ -395,8 +393,6 @@ int16 McgaGraphics::scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_c
}
const uint16 fontWidth = _G(fontMgr)->getFont()->getDataWidth();
plot_scan_cur((x + (disp_akt)*fontWidth), _G(gcury), cur_col, 300, scrwidth, cursor_z);
- if (_svga == ON)
- upd_scr();
for (delay_flag = 0; (delay_flag < 10) && (!kbhit()); delay_flag++) {
izahl = devices();
if (izahl == Common::KEYCODE_RETURN) {
@@ -434,8 +430,6 @@ int16 McgaGraphics::scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_c
const uint16 fontWidth = _G(fontMgr)->getFont()->getDataWidth();
strcpy(zstring + stelle - 1, zstring + stelle);
plot_scan_cur((x + disp_akt * fontWidth), _G(gcury), bcol, bcol, scrwidth, cursor_z);
- if (_svga == ON)
- upd_scr();
--stelle;
--stellemax;
if (disp_stelle > 0)
@@ -619,9 +613,6 @@ int16 McgaGraphics::scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_c
}
}
- if (_svga == ON)
- upd_scr();
-
va_end(parptr);
return ret;
}
diff --git a/engines/chewy/mcga_graphics.h b/engines/chewy/mcga_graphics.h
index 0fe115ba704..b656e463e2c 100644
--- a/engines/chewy/mcga_graphics.h
+++ b/engines/chewy/mcga_graphics.h
@@ -69,7 +69,6 @@ private:
int16 devices();
byte _palTable[PALETTE_SIZE];
- uint8 _svga = 0;
uint8 _einfuegen = 0;
};
More information about the Scummvm-git-logs
mailing list