From 49476a1bc3cf4f9e7aceac2c21fb30dcfcacfa3a Mon Sep 17 00:00:00 2001 From: Le Philousophe Date: Sat, 19 Oct 2019 20:29:56 +0200 Subject: [PATCH] CRYOMNI3D: Fix default cases to raise errors --- engines/cryomni3d/versailles/logic.cpp | 6 +++++- engines/cryomni3d/video/hnm_decoder.cpp | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/engines/cryomni3d/versailles/logic.cpp b/engines/cryomni3d/versailles/logic.cpp index 248226c7a86..10e96d14134 100644 --- a/engines/cryomni3d/versailles/logic.cpp +++ b/engines/cryomni3d/versailles/logic.cpp @@ -2683,7 +2683,6 @@ IMG_CB(88003) { FixedImgCallback callback = nullptr; switch (_gameVariables[GameVariables::kBombState]) { case 1: - default: callback = &CryOmni3DEngine_Versailles::img_88003b; break; case 2: @@ -2698,6 +2697,9 @@ IMG_CB(88003) { case 5: callback = &CryOmni3DEngine_Versailles::img_88003f; break; + default: + error("BUG: Invalid bomb state"); + break; } ZonFixedImage::CallbackFunctor *functor = new Common::Functor1Mem(this, callback); @@ -4310,6 +4312,7 @@ void CryOmni3DEngine_Versailles::filterEventLevel5UpdatePlaceStates() { setPlaceState(16, 5); break; default: + error("BUG: Invalid ladder state"); break; } } else { @@ -4328,6 +4331,7 @@ void CryOmni3DEngine_Versailles::filterEventLevel5UpdatePlaceStates() { setPlaceState(16, 6); break; default: + error("BUG: Invalid ladder state"); break; } } diff --git a/engines/cryomni3d/video/hnm_decoder.cpp b/engines/cryomni3d/video/hnm_decoder.cpp index bd548e42945..e139f997165 100644 --- a/engines/cryomni3d/video/hnm_decoder.cpp +++ b/engines/cryomni3d/video/hnm_decoder.cpp @@ -286,10 +286,12 @@ void HNMDecoder::HNM4VideoTrack::decodeInterframe(Common::SeekableReadStream *st currentPos += width; break; case 3: - default: // End of picture eop = true; break; + default: + error("BUG: Shouldn't be here"); + break; } } else { if (size < 2) {