From fca8ac60ded82ed6c34c0260199d4ac572a85acb Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 16 Oct 2011 21:49:43 +0100 Subject: CRUISE: Fix For Unresponsive Mouse Movement noted in Bug #3423955. This patch was supplied on the bug by Ignaz Forster (ifo). --- engines/cruise/cruise_main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/cruise') diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index ff4669607d..8092f57c67 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1804,6 +1804,8 @@ void CruiseEngine::mainLoop() { bool skipEvents = false; do { + g_system->updateScreen(); + g_system->delayMillis(10); currentTick = g_system->getMillis(); @@ -1976,9 +1978,6 @@ void CruiseEngine::mainLoop() { removeCell(&cellHead, autoOvl, autoMsg, 5, masterScreen); autoMsg = -1; } - } else { - // Keep ScummVM being responsive even when displayOn is false - g_system->updateScreen(); } } while (!playerDontAskQuit && quitValue2 && quitValue != 7); -- cgit v1.2.3 From 3b71a3a7fbfc5a1c7d039610b4fc73476651c24e Mon Sep 17 00:00:00 2001 From: D G Turner Date: Tue, 18 Oct 2011 01:59:08 +0100 Subject: CRUISE: Revert part of mouse movement patch applied from Bug #3423955. The removal of updateScreen() when DisplayOn is not set may cause a regression and is not related to fixing of the mouse jerkiness. --- engines/cruise/cruise_main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/cruise') diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 8092f57c67..d0340238cd 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1978,6 +1978,9 @@ void CruiseEngine::mainLoop() { removeCell(&cellHead, autoOvl, autoMsg, 5, masterScreen); autoMsg = -1; } + } else { + // Keep ScummVM being responsive even when displayOn is false + g_system->updateScreen(); } } while (!playerDontAskQuit && quitValue2 && quitValue != 7); -- cgit v1.2.3 From 32972a5ffb180c9e8a6a9eae51d0e7564ce76d9e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 23 Oct 2011 17:52:43 +0100 Subject: AD: Switched rest of the engines to new GUIO --- engines/cruise/detection.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'engines/cruise') diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index a68b14d986..a482e263a2 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -66,8 +66,6 @@ static const PlainGameDescriptor cruiseGames[] = { namespace Cruise { -using Common::GUIO_NONE; - static const CRUISEGameDescription gameDescriptions[] = { { { @@ -77,7 +75,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_GRB, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -90,7 +88,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -103,7 +101,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -116,7 +114,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -129,7 +127,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -142,7 +140,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -155,7 +153,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformAmiga, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -168,7 +166,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformAmiga, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -181,7 +179,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformAtariST, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -194,7 +192,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -207,7 +205,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO_NONE + GUIO1(GUIO_NONE) }, GType_CRUISE, 0, @@ -221,7 +219,7 @@ class CruiseMetaEngine : public AdvancedMetaEngine { public: CruiseMetaEngine() : AdvancedMetaEngine(Cruise::gameDescriptions, sizeof(Cruise::CRUISEGameDescription), cruiseGames) { _singleid = "cruise"; - _guioptions = Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI; + _guioptions = GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI); } virtual const char *getName() const { -- cgit v1.2.3 From b849f5485f59cb9896ad66c7f8b1b44678011554 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 4 Nov 2011 00:40:50 +0200 Subject: CRUISE: Removed duplicate variable assignment --- engines/cruise/mainDraw.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'engines/cruise') diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index 14b6daf4bb..9a5df69cae 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -621,11 +621,9 @@ void buildSegment() { unsigned char *drawPolyMode1(unsigned char *dataPointer, int linesToDraw) { int index; - int16 *pBufferDest; + int16 *pBufferDest = polyBuffer4 + nbseg * 2; - pBufferDest = polyBuffer4 + nbseg * 2; nbseg = linesToDraw; - A2ptr = polyBuffer4; index = *(dataPointer++); polyXMin = polyXMax = pBufferDest[-2] = pBufferDest[-2 + linesToDraw * 2] = polyBuffer2[index * 2]; -- cgit v1.2.3 From c79b6afcad0f463e7e1ab4ebe50e36f65abd8e16 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 10 Nov 2011 23:44:00 +0100 Subject: CRUISE: Fix OOM checks --- engines/cruise/overlay.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/cruise') diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp index 2f4b375865..d618ab5599 100644 --- a/engines/cruise/overlay.cpp +++ b/engines/cruise/overlay.cpp @@ -185,11 +185,10 @@ int loadOverlay(const char *scriptName) { // This memory block will be later passed to a MemoryReadStream, which will dispose of it unpackedBuffer = (byte *)malloc(unpackedSize); - memset(unpackedBuffer, 0, unpackedSize); - if (!unpackedBuffer) { return (-2); } + memset(unpackedBuffer, 0, unpackedSize); if (volumePtrToFileDescriptor[fileIdx].size + 2 != unpackedSize) { char *pakedBuffer = @@ -566,11 +565,10 @@ int loadOverlay(const char *scriptName) { // This memory block will be later passed to a MemoryReadStream, which will dispose of it unpackedBuffer = (byte *)malloc(unpackedSize); - memset(unpackedBuffer, 0, unpackedSize); - if (!unpackedBuffer) { return (-2); } + memset(unpackedBuffer, 0, unpackedSize); if (volumePtrToFileDescriptor[fileIdx].size + 2 != unpackedSize) { -- cgit v1.2.3 From f51116bb4615b629cf008caa71d4a536457cfb6d Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 14 Nov 2011 22:21:56 +0200 Subject: CRUISE: Remove unused variables --- engines/cruise/cruise_main.cpp | 6 +++--- engines/cruise/volume.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/cruise') diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index d0340238cd..a1337aefa7 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -998,7 +998,7 @@ bool findRelation(int objOvl, int objIdx, int x, int y) { ovlDataStruct *ovl2 = NULL; ovlDataStruct *ovl3 = NULL; - ovlDataStruct *ovl4 = NULL; + //ovlDataStruct *ovl4 = NULL; if (verbeOvl > 0) ovl2 = overlayTable[verbeOvl].ovlData; @@ -1006,8 +1006,8 @@ bool findRelation(int objOvl, int objIdx, int x, int y) { if (obj1Ovl > 0) ovl3 = overlayTable[obj1Ovl].ovlData; - if (obj2Ovl > 0) - ovl4 = overlayTable[obj2Ovl].ovlData; + //if (obj2Ovl > 0) + // ovl4 = overlayTable[obj2Ovl].ovlData; if ((ovl3) && (ptrHead->obj1Number >= 0)) { testState = ptrHead->obj1OldState; diff --git a/engines/cruise/volume.cpp b/engines/cruise/volume.cpp index 773a146b9a..4b64d4ff77 100644 --- a/engines/cruise/volume.cpp +++ b/engines/cruise/volume.cpp @@ -326,7 +326,7 @@ int closeCnf() { int16 readVolCnf() { int i; Common::File fileHandle; - short int sizeHEntry; + //short int sizeHEntry; volumeDataLoaded = 0; @@ -344,7 +344,7 @@ int16 readVolCnf() { } numOfDisks = fileHandle.readSint16BE(); - sizeHEntry = fileHandle.readSint16BE(); // size of one header entry - 20 bytes + /*sizeHEntry =*/ fileHandle.readSint16BE(); // size of one header entry - 20 bytes for (i = 0; i < numOfDisks; i++) { // fread(&volumeData[i],20,1,fileHandle); -- cgit v1.2.3 From 61795739f8f45c5de4cfd0fe57af459146c5173c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 16 Nov 2011 18:06:30 +0100 Subject: COMMON: Rename Common::set_to to Common::fill. This makes the name match with the name of the STL function with the same behavior. --- engines/cruise/gfxModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/cruise') diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 7bbcae2259..aa2dbc5370 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -326,7 +326,7 @@ void flip() { void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color) { for (int y = y1; y < y2; ++y) { byte *p = &gfxModuleData.pPage00[y * 320 + x1]; - Common::set_to(p, p + (x2 - x1), color); + Common::fill(p, p + (x2 - x1), color); } } -- cgit v1.2.3 From bab4b6f7295f6fb960ebbf44b009bd6adbd0d33e Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 16 Nov 2011 22:38:58 +0100 Subject: LAUNCHER: Introduce GUIO0() in order to replace GUIO1(GUIO_NONE) --- engines/cruise/detection.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'engines/cruise') diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index a482e263a2..eb7c1c524f 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -75,7 +75,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_GRB, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -88,7 +88,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -101,7 +101,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -114,7 +114,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::FR_FRA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -127,7 +127,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -140,7 +140,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -153,7 +153,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::DE_DEU, Common::kPlatformAmiga, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -166,7 +166,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformAmiga, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -179,7 +179,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformAtariST, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -192,7 +192,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::IT_ITA, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, @@ -205,7 +205,7 @@ static const CRUISEGameDescription gameDescriptions[] = { Common::ES_ESP, Common::kPlatformPC, ADGF_NO_FLAGS, - GUIO1(GUIO_NONE) + GUIO0() }, GType_CRUISE, 0, -- cgit v1.2.3 From 1e80ac08858ecbf2c32f906f4eb0552bf5bee666 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 21 Nov 2011 19:38:52 +1100 Subject: CRUISE: Added explicit freeing of thumbnail surface pixels --- engines/cruise/saveload.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/cruise') diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index c3d1ea6643..e2bd1ebc34 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -84,6 +84,7 @@ void writeSavegameHeader(Common::OutSaveFile *out, CruiseSavegameHeader &header) Graphics::Surface *thumb = new Graphics::Surface(); ::createThumbnail(thumb, globalScreen, 320, 200, workpal); Graphics::saveThumbnail(*out, *thumb); + thumb->free(); delete thumb; } -- cgit v1.2.3