aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/agi.cpp21
-rw-r--r--engines/agi/cycle.cpp2
-rw-r--r--engines/agi/detection.cpp2
-rw-r--r--engines/agi/detection_tables.h66
-rw-r--r--engines/agi/loader_v1.cpp2
-rw-r--r--engines/agi/loader_v2.cpp2
-rw-r--r--engines/agi/loader_v3.cpp2
-rw-r--r--engines/agi/op_cmd.cpp6
-rw-r--r--engines/agi/preagi_winnie.cpp9
-rw-r--r--engines/agi/saveload.cpp4
-rw-r--r--engines/agi/sound.cpp27
-rw-r--r--engines/agi/sound.h9
-rw-r--r--engines/agi/sound_2gs.cpp4
-rw-r--r--engines/agi/sound_2gs.h4
-rw-r--r--engines/agi/sound_midi.cpp2
-rw-r--r--engines/agi/sound_midi.h4
-rw-r--r--engines/agi/wagparser.cpp2
17 files changed, 84 insertions, 84 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 98ffca22ed..1c342183cd 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -513,10 +513,7 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys
AgiBase::~AgiBase() {
delete _rnd;
- if (_sound) {
- _sound->deinitSound();
- delete _sound;
- }
+ delete _sound;
}
void AgiBase::initRenderMode() {
@@ -588,6 +585,21 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
setupOpcodes();
_game._curLogic = NULL;
_timerHack = 0;
+
+ _lastSaveTime = 0;
+ _lastTick = 0;
+
+ memset(_keyQueue, 0, sizeof(_keyQueue));
+ memset(_predictiveResult, 0, sizeof(_predictiveResult));
+
+ _sprites = NULL;
+ _picture = NULL;
+ _loader = NULL;
+ _console = NULL;
+
+ _egoHoldKey = false;
+
+
}
void AgiEngine::initialize() {
@@ -650,7 +662,6 @@ void AgiEngine::initialize() {
_game.sbuf = _game.sbuf16c; // Make sbuf point to the 16 color (+control line & priority info) AGI screen by default
_gfx->initVideo();
- _sound->initSound();
_lastSaveTime = 0;
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 5daadbd1df..86f0b9e9db 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -412,7 +412,7 @@ int AgiEngine::runGame() {
else
setvar(vSoundgen, kAgiSoundTandy);
break;
- case Common::kPlatformPC:
+ case Common::kPlatformDOS:
default:
setvar(vComputer, kAgiComputerPC);
setvar(vSoundgen, kAgiSoundPC);
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 5f7780bfe3..54a8b9e8b9 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -350,7 +350,7 @@ const ADGameDescription *AgiMetaEngine::fallbackDetect(const FileMap &allFilesXX
// Set the default values for the fallback descriptor's ADGameDescription part.
g_fallbackDesc.desc.language = Common::UNK_LANG;
- g_fallbackDesc.desc.platform = Common::kPlatformPC;
+ g_fallbackDesc.desc.platform = Common::kPlatformDOS;
g_fallbackDesc.desc.flags = ADGF_NO_FLAGS;
// Set default values for the fallback descriptor's AGIGameDescription part.
diff --git a/engines/agi/detection_tables.h b/engines/agi/detection_tables.h
index 9d67b15adb..0c2c3ed3be 100644
--- a/engines/agi/detection_tables.h
+++ b/engines/agi/detection_tables.h
@@ -54,14 +54,14 @@ namespace Agi {
ver \
}
-#define BOOTER2(id,extra,fname,md5,size,ver,gid) GAME_LVFPN(id,extra,fname,md5,size,Common::EN_ANY,ver,0,gid,Common::kPlatformPC,GType_V2)
-#define GAME(id,extra,md5,ver,gid) GAME_LVFPN(id,extra,"logdir",md5,-1,Common::EN_ANY,ver,0,gid,Common::kPlatformPC,GType_V2)
-#define GAME3(id,extra,fname,md5,ver,gid) GAME_LVFPN(id,extra,fname,md5,-1,Common::EN_ANY,ver,0,gid,Common::kPlatformPC,GType_V3)
+#define BOOTER2(id,extra,fname,md5,size,ver,gid) GAME_LVFPN(id,extra,fname,md5,size,Common::EN_ANY,ver,0,gid,Common::kPlatformDOS,GType_V2)
+#define GAME(id,extra,md5,ver,gid) GAME_LVFPN(id,extra,"logdir",md5,-1,Common::EN_ANY,ver,0,gid,Common::kPlatformDOS,GType_V2)
+#define GAME3(id,extra,fname,md5,ver,gid) GAME_LVFPN(id,extra,fname,md5,-1,Common::EN_ANY,ver,0,gid,Common::kPlatformDOS,GType_V3)
#define GAME_P(id,extra,md5,ver,gid,platform) GAME_LVFPN(id,extra,"logdir",md5,-1,Common::EN_ANY,ver,0,gid,platform,GType_V2)
#define GAME_FP(id,extra,md5,ver,flags,gid,platform) GAME_LVFPN(id,extra,"logdir",md5,-1,Common::EN_ANY,ver,flags,gid,platform,GType_V2)
-#define GAME_F(id,extra,md5,ver,flags,gid) GAME_FP(id,extra,md5,ver,flags,gid,Common::kPlatformPC)
+#define GAME_F(id,extra,md5,ver,flags,gid) GAME_FP(id,extra,md5,ver,flags,gid,Common::kPlatformDOS)
#define GAME_PS(id,extra,md5,size,ver,gid,platform) GAME_LVFPN(id,extra,"logdir",md5,size,Common::EN_ANY,ver,0,gid,platform,GType_V2)
@@ -77,7 +77,7 @@ namespace Agi {
#define GAME3_PS(id,extra,fname,md5,size,ver,flags,gid,platform) GAME_LVFPN(id,extra,fname,md5,size,Common::EN_ANY,ver,flags,gid,platform,GType_V3)
-#define FANMADE_ILVF(id,name,md5,lang,ver,features) GAME_LVFPNF(id,name,"logdir",md5,-1,lang,ver,(GF_FANMADE|features),GID_FANMADE,Common::kPlatformPC,GType_V2)
+#define FANMADE_ILVF(id,name,md5,lang,ver,features) GAME_LVFPNF(id,name,"logdir",md5,-1,lang,ver,(GF_FANMADE|features),GID_FANMADE,Common::kPlatformDOS,GType_V2)
#define FANMADE_ISVP(id,name,md5,size,ver,platform) GAME_LVFPNF(id,name,"logdir",md5,size,Common::EN_ANY,ver,GF_FANMADE,GID_FANMADE,platform,GType_V2)
#define FANMADE_SVP(name,md5,size,ver,platform) FANMADE_ISVP("agi-fanmade",name,md5,size,ver,platform)
@@ -128,7 +128,7 @@ static const AGIGameDescription gameDescriptions[] = {
{ NULL, 0, NULL, 0}
},
Common::EN_ANY,
- Common::kPlatformPC,
+ Common::kPlatformDOS,
ADGF_NO_FLAGS,
GUIO0()
},
@@ -149,7 +149,7 @@ static const AGIGameDescription gameDescriptions[] = {
{ NULL, 0, NULL, 0}
},
Common::EN_ANY,
- Common::kPlatformPC,
+ Common::kPlatformDOS,
ADGF_NO_FLAGS,
GUIO0()
},
@@ -170,7 +170,7 @@ static const AGIGameDescription gameDescriptions[] = {
{ NULL, 0, NULL, 0}
},
Common::EN_ANY,
- Common::kPlatformPC,
+ Common::kPlatformDOS,
ADGF_NO_FLAGS,
GUIO0()
},
@@ -191,7 +191,7 @@ static const AGIGameDescription gameDescriptions[] = {
GAME("bc", "2.00 1987-06-14", "7f598d4712319b09d7bd5b3be10a2e4a", 0x2440, GID_BC),
// Black Cauldron (Russian)
- GAME_LPS("bc", "", "b7de782dfdf8ea7dde8064f09804bcf5", 357, Common::RU_RUS, 0x2440, GID_BC, Common::kPlatformPC),
+ GAME_LPS("bc", "", "b7de782dfdf8ea7dde8064f09804bcf5", 357, Common::RU_RUS, 0x2440, GID_BC, Common::kPlatformDOS),
// Black Cauldron (PC 5.25") 2.10 11/10/88 [AGI 3.002.098]
GAME3("bc", "2.10 1988-11-10 5.25\"", "bcdir", "0c5a9acbcc7e51127c34818e75806df6", 0x3149, GID_BC),
@@ -218,7 +218,7 @@ static const AGIGameDescription gameDescriptions[] = {
// reported by Filippos (thebluegr) in bugreport #1654500
// Menus not tested
- GAME_PS("ddp", "1.0C 1986-06-09", "550971d196f65190a5c760d2479406ef", 132, 0x2272, GID_DDP, Common::kPlatformPC),
+ GAME_PS("ddp", "1.0C 1986-06-09", "550971d196f65190a5c760d2479406ef", 132, 0x2272, GID_DDP, Common::kPlatformDOS),
// Gold Rush! (Amiga) 1.01 1/13/89 aka 2.05 3/9/89 # 2.316
GAME3_PS("goldrush", "1.01 1989-01-13 aka 2.05 1989-03-09", "dirs", "a1d4de3e75c2688c1e2ca2634ffc3bd8", 2399, 0x3149, 0, GID_GOLDRUSH, Common::kPlatformAmiga),
@@ -311,7 +311,7 @@ static const AGIGameDescription gameDescriptions[] = {
GAME("kq2", "2.2 1987-05-07 5.25\"/3.5\"", "b944c4ff18fb8867362dc21cc688a283", 0x2917, GID_KQ2),
// King's Quest 2 (Russian)
- GAME_LPS("kq2", "", "35211c574ececebdc723b23e35f99275", 543, Common::RU_RUS, 0x2917, GID_KQ2, Common::kPlatformPC),
+ GAME_LPS("kq2", "", "35211c574ececebdc723b23e35f99275", 543, Common::RU_RUS, 0x2917, GID_KQ2, Common::kPlatformDOS),
// King's Quest 2 (CoCo3 360k) [AGI 2.023]
GAME_PS("kq2", "", "b944c4ff18fb8867362dc21cc688a283", 543, 0x2440, GID_KQ2, Common::kPlatformCoCo3),
@@ -344,10 +344,10 @@ static const AGIGameDescription gameDescriptions[] = {
// King's Quest 3 (PC) 1.01 11/08/86 [AGI 2.272]
// Does not have menus, crashes if menus are enforced. Therefore, ESC pauses the game
- GAME_FP("kq3", "1.01 1986-11-08", "9c2b34e7ffaa89c8e2ecfeb3695d444b", 0x2272, GF_ESCPAUSE, GID_KQ3, Common::kPlatformPC),
+ GAME_FP("kq3", "1.01 1986-11-08", "9c2b34e7ffaa89c8e2ecfeb3695d444b", 0x2272, GF_ESCPAUSE, GID_KQ3, Common::kPlatformDOS),
// King's Quest 3 (Russian)
- GAME_LFPS("kq3", "", "5856dec6ccb9c4b70aee21044a19270a", 390, Common::RU_RUS, 0x2272, GF_ESCPAUSE, GID_KQ3, Common::kPlatformPC),
+ GAME_LFPS("kq3", "", "5856dec6ccb9c4b70aee21044a19270a", 390, Common::RU_RUS, 0x2272, GF_ESCPAUSE, GID_KQ3, Common::kPlatformDOS),
// King's Quest 3 (PC 5.25") 2.00 5/25/87 [AGI 2.435]
GAME("kq3", "2.00 1987-05-25 5.25\"", "18aad8f7acaaff760720c5c6885b6bab", 0x2440, GID_KQ3),
@@ -396,10 +396,10 @@ static const AGIGameDescription gameDescriptions[] = {
GAME("lsl1", "1.00 1987-06-01 5.25\"/3.5\"", "1fe764e66857e7f305a5f03ca3f4971d", 0x2440, GID_LSL1),
// Leisure Suit Larry 1 Polish
- GAME_LPS("lsl1", "2.00 2001-12-11", "7ba1fccc46d27c141e704706c1d0a85f", 303, Common::PL_POL, 0x2440, GID_LSL1, Common::kPlatformPC),
+ GAME_LPS("lsl1", "2.00 2001-12-11", "7ba1fccc46d27c141e704706c1d0a85f", 303, Common::PL_POL, 0x2440, GID_LSL1, Common::kPlatformDOS),
// Leisure Suit Larry 1 Polish - Demo
- GAME_LPS("lsl1", "Demo", "3b2f564306c401dff6334441df967ddd", 666, Common::PL_POL, 0x2917, GID_LSL1, Common::kPlatformPC),
+ GAME_LPS("lsl1", "Demo", "3b2f564306c401dff6334441df967ddd", 666, Common::PL_POL, 0x2917, GID_LSL1, Common::kPlatformDOS),
// Leisure Suit Larry 1 (ST) 1.04 6/18/87
GAME_P("lsl1", "1.04 1987-06-18", "8b579f8673fe9448c2538f5ed9887cf0", 0x2440, GID_LSL1, Common::kPlatformAtariST),
@@ -427,10 +427,10 @@ static const AGIGameDescription gameDescriptions[] = {
// reported by Filippos (thebluegr) in bugreport #1654500
// Manhunter NY (PC 5.25") 1.22 8/31/88 [AGI 3.002.107]
- GAME3_PS("mh1", "1.22 1988-08-31", "mhdir", "0c7b86f05fe02c2e26cff1b07450b82a", 2123, 0x3149, 0, GID_MH1, Common::kPlatformPC),
+ GAME3_PS("mh1", "1.22 1988-08-31", "mhdir", "0c7b86f05fe02c2e26cff1b07450b82a", 2123, 0x3149, 0, GID_MH1, Common::kPlatformDOS),
// Manhunter NY (PC 3.5") 1.22 8/31/88 [AGI 3.002.102]
- GAME3_PS("mh1", "1.22 1988-08-31", "mhdir", "5b625329021ad49fd0c1d6f2d6f54bba", 2141, 0x3149, 0, GID_MH1, Common::kPlatformPC),
+ GAME3_PS("mh1", "1.22 1988-08-31", "mhdir", "5b625329021ad49fd0c1d6f2d6f54bba", 2141, 0x3149, 0, GID_MH1, Common::kPlatformDOS),
// Manhunter NY (CoCo3 720k) [AGI 2.023]
GAME_PS("mh1", "", "b968285caf2f591c78dd9c9e26ab8974", 495, 0x2440, GID_MH1, Common::kPlatformCoCo3),
@@ -458,7 +458,7 @@ static const AGIGameDescription gameDescriptions[] = {
// Mickey's Space Adventure
// Preagi game
- GAMEpre_P("mickey", "", "1.pic", "b6ec04c91a05df374792872c4d4ce66d", 0x0000, GID_MICKEY, Common::kPlatformPC),
+ GAMEpre_P("mickey", "", "1.pic", "b6ec04c91a05df374792872c4d4ce66d", 0x0000, GID_MICKEY, Common::kPlatformDOS),
#if 0
// Mixed-Up Mother Goose (Amiga) 1.1
@@ -495,7 +495,7 @@ static const AGIGameDescription gameDescriptions[] = {
GAME("pq1", "2.0A 1987-10-23", "b9dbb305092851da5e34d6a9f00240b1", 0x2917, GID_PQ1),
// Police Quest 1 (Russian)
- GAME_LPS("pq1", "", "604cc8041d24c4c7e5fa8baf386ef76e", 360, Common::RU_RUS, 0x2917, GID_PQ1, Common::kPlatformPC),
+ GAME_LPS("pq1", "", "604cc8041d24c4c7e5fa8baf386ef76e", 360, Common::RU_RUS, 0x2917, GID_PQ1, Common::kPlatformDOS),
// Police Quest 1 2.0G 12/3/87
GAME("pq1", "2.0G 1987-12-03 5.25\"/ST", "231f3e28170d6e982fc0ced4c98c5c1c", 0x2440, GID_PQ1),
@@ -516,11 +516,11 @@ static const AGIGameDescription gameDescriptions[] = {
// Space Quest 1 (PC 360k) 1.1A [AGI 2.272]
// The original game did not have menus, they are enabled under ScummVM
- GAME_FP("sq1", "1.1A 1986-11-13", "8d8c20ab9f4b6e4817698637174a1cb6", 0x2272, GF_MENUS, GID_SQ1, Common::kPlatformPC),
+ GAME_FP("sq1", "1.1A 1986-11-13", "8d8c20ab9f4b6e4817698637174a1cb6", 0x2272, GF_MENUS, GID_SQ1, Common::kPlatformDOS),
// Space Quest 1 (PC 720k) 1.1A [AGI 2.272]
// The original game did not have menus, they are enabled under ScummVM
- GAME_FP("sq1", "1.1A 720kb", "0a92b1be7daf3bb98caad3f849868aeb", 0x2272, GF_MENUS, GID_SQ1, Common::kPlatformPC),
+ GAME_FP("sq1", "1.1A 720kb", "0a92b1be7daf3bb98caad3f849868aeb", 0x2272, GF_MENUS, GID_SQ1, Common::kPlatformDOS),
// Space Quest 1 (Amiga) 1.2 # 2.082
// The original game did not have menus, they are enabled under ScummVM
@@ -534,10 +534,10 @@ static const AGIGameDescription gameDescriptions[] = {
// Space Quest 1 (PC) 1.0X [AGI 2.089]
// Does not have menus, crashes if menus are enforced. Therefore, ESC pauses the game
- GAME_FP("sq1", "1.0X 1986-09-24", "af93941b6c51460790a9efa0e8cb7122", 0x2089, GF_ESCPAUSE, GID_SQ1, Common::kPlatformPC),
+ GAME_FP("sq1", "1.0X 1986-09-24", "af93941b6c51460790a9efa0e8cb7122", 0x2089, GF_ESCPAUSE, GID_SQ1, Common::kPlatformDOS),
// Space Quest 1 (Russian)
- GAME_LFPS("sq1", "", "a279eb8ddbdefdb1ea6adc827a1d632a", 372, Common::RU_RUS, 0x2089, GF_ESCPAUSE, GID_SQ1, Common::kPlatformPC),
+ GAME_LFPS("sq1", "", "a279eb8ddbdefdb1ea6adc827a1d632a", 372, Common::RU_RUS, 0x2089, GF_ESCPAUSE, GID_SQ1, Common::kPlatformDOS),
// Space Quest 1 (PC 5.25"/3.5") 2.2 [AGI 2.426/2.917]
GAME("sq1", "2.2 1987-05-07 5.25\"/3.5\"", "5d67630aba008ec5f7f9a6d0a00582f4", 0x2440, GID_SQ1),
@@ -584,17 +584,17 @@ static const AGIGameDescription gameDescriptions[] = {
// reported by Filippos (thebluegr) in bugreport #1654500
// Space Quest 2 (PC 5.25") 2.0A [AGI 2.912]
- GAME_PS("sq2", "2.0A 1987-11-06 5.25\"", "ad7ce8f800581ecc536f3e8021d7a74d", 423, 0x2917, GID_SQ2, Common::kPlatformPC),
+ GAME_PS("sq2", "2.0A 1987-11-06 5.25\"", "ad7ce8f800581ecc536f3e8021d7a74d", 423, 0x2917, GID_SQ2, Common::kPlatformDOS),
// reported by RadG (radg123) in bug report #3260349
// Space Quest 2 (Spanish)
- GAME_LPS("sq2", "", "1ae7640dd4d253c3ac2d708d61a35379", 426, Common::ES_ESP, 0x2917, GID_SQ2, Common::kPlatformPC),
+ GAME_LPS("sq2", "", "1ae7640dd4d253c3ac2d708d61a35379", 426, Common::ES_ESP, 0x2917, GID_SQ2, Common::kPlatformDOS),
// Space Quest 2 (Russian)
- GAME_LPS("sq2", "", "ba21c8934caf28e3ba45ce7d1cd6b041", 423, Common::RU_RUS, 0x2917, GID_SQ2, Common::kPlatformPC),
+ GAME_LPS("sq2", "", "ba21c8934caf28e3ba45ce7d1cd6b041", 423, Common::RU_RUS, 0x2917, GID_SQ2, Common::kPlatformDOS),
// Space Quest 2 (PC 3.5") 2.0A [AGI 2.912]
- GAME_PS("sq2", "2.0A 1987-11-06 3.5\"", "6c25e33d23b8bed42a5c7fa63d588e5c", 423, 0x2917, GID_SQ2, Common::kPlatformPC),
+ GAME_PS("sq2", "2.0A 1987-11-06 3.5\"", "6c25e33d23b8bed42a5c7fa63d588e5c", 423, 0x2917, GID_SQ2, Common::kPlatformDOS),
// Space Quest 2 (PC 5.25"/ST) 2.0C/A [AGI 2.915]
// Menus not tested
@@ -610,10 +610,10 @@ static const AGIGameDescription gameDescriptions[] = {
GAME_PS("sq2", "updated", "d24f19b047e65e1763eff4b46f3d50df", 768, 0x2440, GID_SQ2, Common::kPlatformCoCo3),
// Troll's Tale
- GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformPC),
+ GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformDOS),
// Winnie the Pooh in the Hundred Acre Wood
- GAMEpre_P("winnie", "", "title.pic", "2e7900c1ccaa7671d65405f6d1efed30", 0x0000, GID_WINNIE, Common::kPlatformPC),
+ GAMEpre_P("winnie", "", "title.pic", "2e7900c1ccaa7671d65405f6d1efed30", 0x0000, GID_WINNIE, Common::kPlatformDOS),
// Winnie the Pooh in the Hundred Acre Wood (Amiga)
GAMEpre_P("winnie", "", "title", "2e7900c1ccaa7671d65405f6d1efed30", 0x0000, GID_WINNIE, Common::kPlatformAmiga),
@@ -707,10 +707,10 @@ static const AGIGameDescription gameDescriptions[] = {
FANMADE("Good Man (demo v3.41)", "3facd8a8f856b7b6e0f6c3200274d88c"),
GAME_LVFPNF("agi-fanmade", "Groza (russian) [AGDS sample]", "logdir", "421da3a18004122a966d64ab6bd86d2e", -1,
- Common::RU_RUS, 0x2440, GF_AGDS, GID_FANMADE, Common::kPlatformPC,GType_V2),
+ Common::RU_RUS, 0x2440, GF_AGDS, GID_FANMADE, Common::kPlatformDOS,GType_V2),
GAME_LVFPNF("agi-fanmade", "Get Outta Space Quest", "logdir", "aaea5b4a348acb669d13b0e6f22d4dc9", -1,
- Common::EN_ANY, 0x2440, GF_FANMADE, GID_GETOUTTASQ, Common::kPlatformPC,GType_V2),
+ Common::EN_ANY, 0x2440, GF_FANMADE, GID_GETOUTTASQ, Common::kPlatformDOS,GType_V2),
FANMADE_F("Half-Death - Terror At White-Mesa", "b62c05d0ace878261392073f57ae788c", GF_AGIMOUSE),
FANMADE("Hank's Quest (v1.0 English) - Victim of Society", "64c15b3d0483d17888129100dc5af213"),
@@ -857,7 +857,7 @@ static const AGIGameDescription gameDescriptions[] = {
"V - The Graphical Adventure (Demo 2)",
AD_ENTRY1s("vdir", "c71f5c1e008d352ae9040b77fcf79327", 3080),
Common::EN_ANY,
- Common::kPlatformPC,
+ Common::kPlatformDOS,
ADGF_USEEXTRAASTITLE,
GUIO0()
},
@@ -885,7 +885,7 @@ static AGIGameDescription g_fallbackDesc = {
"",
AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
Common::UNK_LANG,
- Common::kPlatformPC,
+ Common::kPlatformDOS,
ADGF_NO_FLAGS,
GUIO0()
},
diff --git a/engines/agi/loader_v1.cpp b/engines/agi/loader_v1.cpp
index 189c98ee98..33e956af41 100644
--- a/engines/agi/loader_v1.cpp
+++ b/engines/agi/loader_v1.cpp
@@ -254,7 +254,7 @@ int AgiLoader_v1::loadResource(int t, int n) {
if (data != NULL) {
// Freeing of the raw resource from memory is delegated to the createFromRawResource-function
- _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound, _vm->_soundemu);
+ _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, _vm->_soundemu);
_vm->_game.dirSound[n].flags |= RES_LOADED;
} else {
ec = errBadResource;
diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp
index a2ac6f0111..ee69bb5b27 100644
--- a/engines/agi/loader_v2.cpp
+++ b/engines/agi/loader_v2.cpp
@@ -230,7 +230,7 @@ int AgiLoader_v2::loadResource(int t, int n) {
if (data != NULL) {
// Freeing of the raw resource from memory is delegated to the createFromRawResource-function
- _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound, _vm->_soundemu);
+ _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, _vm->_soundemu);
_vm->_game.dirSound[n].flags |= RES_LOADED;
} else {
ec = errBadResource;
diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp
index 29635f935b..250d8e7615 100644
--- a/engines/agi/loader_v3.cpp
+++ b/engines/agi/loader_v3.cpp
@@ -314,7 +314,7 @@ int AgiLoader_v3::loadResource(int t, int n) {
data = loadVolRes(&_vm->_game.dirSound[n]);
if (data != NULL) {
// Freeing of the raw resource from memory is delegated to the createFromRawResource-function
- _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, *_vm->_sound, _vm->_soundemu);
+ _vm->_game.sounds[n] = AgiSound::createFromRawResource(data, _vm->_game.dirSound[n].len, n, _vm->_soundemu);
_vm->_game.dirSound[n].flags |= RES_LOADED;
} else {
ec = errBadResource;
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 9d899b1855..2366d97a82 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1219,7 +1219,7 @@ void cmdWander(AgiGame *state, uint8 *p) {
void cmdSetGameID(AgiGame *state, uint8 *p) {
if (state->_curLogic->texts && (p0 - 1) <= state->_curLogic->numTexts)
- strncpy(state->id, state->_curLogic->texts[p0 - 1], 8);
+ Common::strlcpy(state->id, state->_curLogic->texts[p0 - 1], 8);
else
state->id[0] = 0;
@@ -1705,7 +1705,9 @@ void cmdCallV1(AgiGame *state, uint8 *p) {
// FIXME: The following instruction looks incomplete.
// Maybe something is meant to be assigned to, or read from,
// the logic_list entry?
- state->logic_list[++state->max_logics];
+// state->logic_list[++state->max_logics];
+ // For now, just do the increment, to silence a clang warning
+ ++state->max_logics;
_v[13] = 1;
}
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
index 53863a8c7e..bbe9ddd0c6 100644
--- a/engines/agi/preagi_winnie.cpp
+++ b/engines/agi/preagi_winnie.cpp
@@ -90,7 +90,7 @@ void WinnieEngine::parseObjHeader(WTP_OBJ_HDR *objHdr, byte *buffer, int len) {
uint32 WinnieEngine::readRoom(int iRoom, uint8 *buffer, WTP_ROOM_HDR &roomHdr) {
Common::String fileName;
- if (getPlatform() == Common::kPlatformPC)
+ if (getPlatform() == Common::kPlatformDOS)
fileName = Common::String::format(IDS_WTP_ROOM_DOS, iRoom);
else if (getPlatform() == Common::kPlatformAmiga)
fileName = Common::String::format(IDS_WTP_ROOM_AMIGA, iRoom);
@@ -123,7 +123,7 @@ uint32 WinnieEngine::readRoom(int iRoom, uint8 *buffer, WTP_ROOM_HDR &roomHdr) {
uint32 WinnieEngine::readObj(int iObj, uint8 *buffer) {
Common::String fileName;
- if (getPlatform() == Common::kPlatformPC)
+ if (getPlatform() == Common::kPlatformDOS)
fileName = Common::String::format(IDS_WTP_OBJ_DOS, iObj);
else if (getPlatform() == Common::kPlatformAmiga)
fileName = Common::String::format(IDS_WTP_OBJ_AMIGA, iObj);
@@ -1118,7 +1118,7 @@ void WinnieEngine::drawRoomPic() {
bool WinnieEngine::playSound(ENUM_WTP_SOUND iSound) {
// TODO: Only DOS sound is supported, currently
- if (getPlatform() != Common::kPlatformPC) {
+ if (getPlatform() != Common::kPlatformDOS) {
warning("STUB: playSound(%d)", iSound);
return false;
}
@@ -1134,7 +1134,7 @@ bool WinnieEngine::playSound(ENUM_WTP_SOUND iSound) {
file.read(data, size);
file.close();
- _game.sounds[0] = AgiSound::createFromRawResource(data, size, 0, *_sound, _soundemu);
+ _game.sounds[0] = AgiSound::createFromRawResource(data, size, 0, _soundemu);
_sound->startSound(0, 0);
bool cursorShowing = CursorMan.showMouse(false);
@@ -1334,7 +1334,6 @@ void WinnieEngine::init() {
}
_sound = new SoundMgr(this, _mixer);
- _sound->initSound();
setflag(fSoundOn, true); // enable sound
memset(&_gameStateWinnie, 0, sizeof(_gameStateWinnie));
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index d451a799a0..c449f076e7 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -316,7 +316,7 @@ int AgiEngine::loadGame(const Common::String &fileName, bool checkId) {
return errBadFileOpen;
}
- strncpy(_game.id, loadId, 8);
+ Common::strlcpy(_game.id, loadId, 8);
if (saveVersion >= 5) {
char md5[32 + 1];
@@ -678,7 +678,7 @@ int AgiEngine::selectSlot() {
switch (key) {
case KEY_ENTER:
rc = active;
- strncpy(_game.strings[MAX_STRINGS], desc[i], MAX_STRINGLEN);
+ Common::strlcpy(_game.strings[MAX_STRINGS], desc[i], MAX_STRINGLEN);
debugC(8, kDebugLevelMain | kDebugLevelInput, "Button pressed: %d", rc);
exitSelectSlot = true;
break;
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index ca3d799ecc..56c7ebcb0b 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -36,25 +36,25 @@ namespace Agi {
// TODO: add support for variable sampling rate in the output device
//
-AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, SoundMgr &manager, int soundemu) {
+AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, int soundemu) {
if (data == NULL || len < 2) // Check for too small resource or no resource at all
return NULL;
uint16 type = READ_LE_UINT16(data);
// For V1 sound resources
if (type != AGI_SOUND_SAMPLE && (type & 0xFF) == 0x01)
- return new PCjrSound(data, len, resnum, manager);
+ return new PCjrSound(data, len, resnum);
switch (type) { // Create a sound object based on the type
case AGI_SOUND_SAMPLE:
- return new IIgsSample(data, len, resnum, manager);
+ return new IIgsSample(data, len, resnum);
case AGI_SOUND_MIDI:
- return new IIgsMidi(data, len, resnum, manager);
+ return new IIgsMidi(data, len, resnum);
case AGI_SOUND_4CHN:
if (soundemu == SOUND_EMU_MIDI) {
- return new MIDISound(data, len, resnum, manager);
+ return new MIDISound(data, len, resnum);
} else {
- return new PCjrSound(data, len, resnum, manager);
+ return new PCjrSound(data, len, resnum);
}
}
@@ -62,7 +62,7 @@ AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, S
return NULL;
}
-PCjrSound::PCjrSound(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) {
+PCjrSound::PCjrSound(uint8 *data, uint32 len, int resnum) : AgiSound() {
_data = data; // Save the resource pointer
_len = len; // Save the resource's length
_type = READ_LE_UINT16(data); // Read sound resource's type
@@ -167,16 +167,6 @@ void SoundMgr::stopSound() {
_endflag = -1;
}
-int SoundMgr::initSound() {
- return -1;
-}
-
-void SoundMgr::deinitSound() {
- stopSound();
-
- delete _soundGen;
-}
-
void SoundMgr::soundIsFinished() {
if (_endflag != -1)
_vm->setflag(_endflag, true);
@@ -219,6 +209,9 @@ void SoundMgr::setVolume(uint8 volume) {
}
SoundMgr::~SoundMgr() {
+ stopSound();
+
+ delete _soundGen;
}
} // End of namespace Agi
diff --git a/engines/agi/sound.h b/engines/agi/sound.h
index 6fd8dd516e..f300af83a3 100644
--- a/engines/agi/sound.h
+++ b/engines/agi/sound.h
@@ -93,7 +93,7 @@ public:
*/
class AgiSound {
public:
- AgiSound(SoundMgr &manager) : _manager(manager), _isPlaying(false), _isValid(false) {}
+ AgiSound() : _isPlaying(false), _isValid(false) {}
virtual ~AgiSound() {}
virtual void play() { _isPlaying = true; }
virtual void stop() { _isPlaying = false; }
@@ -108,17 +108,16 @@ public:
* from memory using free() or delegate the responsibility onwards to some other
* function!
*/
- static AgiSound *createFromRawResource(uint8 *data, uint32 len, int resnum, SoundMgr &manager, int soundemu);
+ static AgiSound *createFromRawResource(uint8 *data, uint32 len, int resnum, int soundemu);
protected:
- SoundMgr &_manager; ///< AGI sound manager object
bool _isPlaying; ///< Is the sound playing?
bool _isValid; ///< Is this a valid sound object?
};
class PCjrSound : public AgiSound {
public:
- PCjrSound(uint8 *data, uint32 len, int resnum, SoundMgr &manager);
+ PCjrSound(uint8 *data, uint32 len, int resnum);
~PCjrSound() { free(_data); }
virtual uint16 type() { return _type; }
const uint8 *getVoicePointer(uint voiceNum);
@@ -140,8 +139,6 @@ public:
void unloadSound(int);
void playSound();
- int initSound();
- void deinitSound();
void startSound(int, int);
void stopSound();
diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp
index bfc8d4d8f3..f088ad3a01 100644
--- a/engines/agi/sound_2gs.cpp
+++ b/engines/agi/sound_2gs.cpp
@@ -447,7 +447,7 @@ void SoundGen2GS::setProgramChangeMapping(const IIgsMidiProgramMapping *mapping)
_progToInst = mapping;
}
-IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) {
+IIgsMidi::IIgsMidi(uint8 *data, uint32 len, int resnum) : AgiSound() {
_data = data; // Save the resource pointer
_ptr = _data + 2; // Set current position to just after the header
_len = len; // Save the resource's length
@@ -472,7 +472,7 @@ static bool convertWave(Common::SeekableReadStream &source, int8 *dest, uint len
return !(source.eos() || source.err());
}
-IIgsSample::IIgsSample(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) {
+IIgsSample::IIgsSample(uint8 *data, uint32 len, int resnum) : AgiSound() {
Common::MemoryReadStream stream(data, len, DisposeAfterUse::YES);
// Check that the header was read ok and that it's of the correct type
diff --git a/engines/agi/sound_2gs.h b/engines/agi/sound_2gs.h
index 404f4a47a1..12e7b7b951 100644
--- a/engines/agi/sound_2gs.h
+++ b/engines/agi/sound_2gs.h
@@ -144,7 +144,7 @@ public:
class IIgsMidi : public AgiSound {
public:
- IIgsMidi(uint8 *data, uint32 len, int resnum, SoundMgr &manager);
+ IIgsMidi(uint8 *data, uint32 len, int resnum);
~IIgsMidi() { if (_data != NULL) free(_data); }
virtual uint16 type() { return _type; }
virtual const uint8 *getPtr() { return _ptr; }
@@ -161,7 +161,7 @@ public:
class IIgsSample : public AgiSound {
public:
- IIgsSample(uint8 *data, uint32 len, int resnum, SoundMgr &manager);
+ IIgsSample(uint8 *data, uint32 len, int resnum);
~IIgsSample() { delete[] _sample; }
virtual uint16 type() { return _header.type; }
const IIgsSampleHeader &getHeader() const { return _header; }
diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index 47d354093b..24e3ca8fb7 100644
--- a/engines/agi/sound_midi.cpp
+++ b/engines/agi/sound_midi.cpp
@@ -59,7 +59,7 @@ namespace Agi {
static uint32 convertSND2MIDI(byte *snddata, byte **data);
-MIDISound::MIDISound(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : AgiSound(manager) {
+MIDISound::MIDISound(uint8 *data, uint32 len, int resnum) : AgiSound() {
_data = data; // Save the resource pointer
_len = len; // Save the resource's length
_type = READ_LE_UINT16(data); // Read sound resource's type
diff --git a/engines/agi/sound_midi.h b/engines/agi/sound_midi.h
index 36bd66ee76..ac1b100b12 100644
--- a/engines/agi/sound_midi.h
+++ b/engines/agi/sound_midi.h
@@ -33,7 +33,7 @@ namespace Agi {
class MIDISound : public AgiSound {
public:
- MIDISound(uint8 *data, uint32 len, int resnum, SoundMgr &manager);
+ MIDISound(uint8 *data, uint32 len, int resnum);
~MIDISound() { free(_data); }
virtual uint16 type() { return _type; }
uint8 *_data; ///< Raw sound resource data
@@ -61,8 +61,6 @@ public:
private:
bool _isGM;
-
- SoundMgr *_manager;
};
} // End of namespace Agi
diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp
index 61feac5d17..8dee6545c0 100644
--- a/engines/agi/wagparser.cpp
+++ b/engines/agi/wagparser.cpp
@@ -98,7 +98,7 @@ void WagProperty::setDefaults() {
}
void WagProperty::deleteData() {
- delete _propData;
+ delete[] _propData;
_propData = NULL;
}