From 5739b4b024e80f7dff502bd7ac4d9b42082c56ae Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Jan 2020 21:48:01 +0100 Subject: [PATCH] - added savepic generation to Exhumed. --- source/exhumed/src/exhumed.h | 1 + source/exhumed/src/view.cpp | 41 ++++++++++++++++-------------------- source/exhumed/src/view.h | 2 +- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 1196ad70b..08863fb25 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -275,6 +275,7 @@ struct GameInterface : ::GameInterface { int app_main() override; void UpdateScreenSize() override; + bool GenerateSavePic() override; bool validate_hud(int) override { return true; } void set_hud_layout(int size) override {} void set_hud_scale(int size) override {} diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index df8c9891c..5e14f9509 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -357,7 +357,7 @@ static inline fix16_t q16angle_interpolate16(fix16_t a, fix16_t b, int smooth) return a + mulscale16(((b+F16(1024)-a)&0x7FFFFFF)-F16(1024), smooth); } -void DrawView(int smoothRatio) +void DrawView(int smoothRatio, bool sceneonly) { int playerX; int playerY; @@ -366,27 +366,14 @@ void DrawView(int smoothRatio) fix16_t nAngle; fix16_t pan; -#if 0 - if (bgpages <= 0) - { - if (textpages > 0) - { - textpages--; - FlushMessageLine(); - } - } - else + + if (!sceneonly) { RefreshBackground(); - bgpages--; - } -#else - //FlushMessageLine(); - RefreshBackground(); -#endif - if (!bFullScreen) { - MaskStatus(); + if (!bFullScreen) { + MaskStatus(); + } } zbob = Sin(2 * bobangle) >> 3; @@ -395,7 +382,7 @@ void DrawView(int smoothRatio) int nPlayerOldCstat = sprite[nPlayerSprite].cstat; int nDoppleOldCstat = sprite[nDoppleSprite[nLocalPlayer]].cstat; - if (nSnakeCam >= 0) + if (nSnakeCam >= 0 && !sceneonly) { int nSprite = SnakeList[nSnakeCam].nSprites[0]; @@ -438,9 +425,9 @@ void DrawView(int smoothRatio) nCameraa = nAngle; - if (!bCamera || nFreeze) + if (!bCamera || nFreeze || sceneonly) { - if (nSnakeCam >= 0) + if (nSnakeCam >= 0 && !sceneonly) { pan = F16(92); viewz = playerZ; @@ -602,7 +589,7 @@ void DrawView(int smoothRatio) } } } - else + else if (!sceneonly) { if (nSnakeCam < 0) { @@ -637,6 +624,14 @@ void DrawView(int smoothRatio) flash = 0; } +bool GameInterface::GenerateSavePic() +{ + DrawView(65536, true); + return true; +} + + + void NoClip() { videoSetViewableArea(0, 0, xdim - 1, ydim - 1); diff --git a/source/exhumed/src/view.h b/source/exhumed/src/view.h index b583e8031..40e4db297 100644 --- a/source/exhumed/src/view.h +++ b/source/exhumed/src/view.h @@ -35,7 +35,7 @@ extern short bCamera; void InitView(); void SetView1(); void RefreshBackground(); -void DrawView(int smoothRatio); +void DrawView(int smoothRatio, bool sceneonly = false); void MySetView(int x1, int y1, int x2, int y2); void ResetView(); void NoClip();