From 8f94e124b00f972f8a1f797a00673d89af4f3e17 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 11:59:29 +0100 Subject: [PATCH 01/11] set the highscore page length to 20 -- 40 does not fit on my screen --- FeLib/Source/hscore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FeLib/Source/hscore.cpp b/FeLib/Source/hscore.cpp index bf6e1c363..497c2300d 100644 --- a/FeLib/Source/hscore.cpp +++ b/FeLib/Source/hscore.cpp @@ -95,7 +95,7 @@ void highscore::Draw() const } List.SetFlags(FADE); - List.SetPageLength(40); + List.SetPageLength(20); List.Draw(); } From b7afe4275bf739c997d86ee959e5ca61ca3fe4ff Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:01:06 +0100 Subject: [PATCH 02/11] fixed a crash bug when pressing 'gg' with incorrect route in memory --- Main/Source/command.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Main/Source/command.cpp b/Main/Source/command.cpp index 8a766499c..7c6fb2599 100644 --- a/Main/Source/command.cpp +++ b/Main/Source/command.cpp @@ -1951,6 +1951,9 @@ truth commandsystem::SpawnRoute(character* Char, v2 Pos) std::set Illegal; node* Node = Char->GetLevel()->FindRoute(Char->GetPos(), Pos, Illegal, 0, Char); + + if(!Node) return false; + if(Node){ RouteGoOn.clear(); while(Node->Last) From 88b692511aa13f58b2575c281e0315595ca97e7a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:02:02 +0100 Subject: [PATCH 03/11] fixed cursors showing console direction not disappearing --- Main/Source/game.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Main/Source/game.cpp b/Main/Source/game.cpp index 0bdbff7d4..689ad27b7 100644 --- a/Main/Source/game.cpp +++ b/Main/Source/game.cpp @@ -3040,10 +3040,11 @@ void game::DrawEverythingNoBlit(truth AnimationDraw) if(globalwindowhandler::ControllerEnabled()) { auto Pos1 = Pos + globalwindowhandler::GetControllerDirection(); - if(OnScreen(Pos1)) + if(OnScreen(Pos1) && GetCurrentArea()->GetSquare(Pos1)) { v2 ScreenCoord1 = CalculateScreenCoordinates(Pos1); igraph::DrawCursor(ScreenCoord1, Player->GetCursorData()); + GetCurrentArea()->GetSquare(Pos1)->SendStrongNewDrawRequest(); if(!DoZoom())UpdatePosAroundForXBRZ(Pos1); } } @@ -3064,10 +3065,11 @@ void game::DrawEverythingNoBlit(truth AnimationDraw) if(globalwindowhandler::ControllerEnabled()) { auto Pos1 = Pos + globalwindowhandler::GetControllerDirection(); - if(OnScreen(Pos1)) + if(OnScreen(Pos1) && GetCurrentArea()->GetSquare(Pos1)) { v2 ScreenCoord1 = CalculateScreenCoordinates(Pos1); igraph::DrawCursor(ScreenCoord1, Player->GetCursorData()|CURSOR_BIG); + GetCurrentArea()->GetSquare(Pos1)->SendStrongNewDrawRequest(); if(!DoZoom())UpdatePosAroundForXBRZ(Pos1); } } From 7e42989ff68123f7a477431acbda562d41e2af16 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:02:14 +0100 Subject: [PATCH 04/11] set AltAdventureInfo to true by default --- Main/Source/iconf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main/Source/iconf.cpp b/Main/Source/iconf.cpp index f008bca3a..9a54c8589 100644 --- a/Main/Source/iconf.cpp +++ b/Main/Source/iconf.cpp @@ -206,7 +206,7 @@ truthoption ivanconfig::LookZoom( "LookZoom", truthoption ivanconfig::AltAdentureInfo( "AltAdentureInfo", "Enhanced message review mode after death", "", - false); + true); truthoption ivanconfig::DescriptiveHP( "DescriptiveHP", "Use health level descriptions", "Display description of your relative health rather than numeric value of your hit points.", From 4d554e648109c641dbf51336a0a2cf95d9c86311 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:02:29 +0100 Subject: [PATCH 05/11] improved the writing in ShowAdventureInfoAlt --- Main/Source/char.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main/Source/char.cpp b/Main/Source/char.cpp index b340c2ba2..b76a045ee 100644 --- a/Main/Source/char.cpp +++ b/Main/Source/char.cpp @@ -9502,8 +9502,8 @@ void character::ShowAdventureInfoAlt() const game::GetCurrentArea()->SendNewDrawRequest(); game::DrawEverything(); while(true) { - felist List(CONST_S("What do you want to see?")); - List.AddEntry("n = nothing", LIGHT_GRAY, 0, NO_IMAGE, true); + felist List(CONST_S("Unfortunately you died. What do you want to see?")); + List.AddEntry("n = nothing (end the game)", LIGHT_GRAY, 0, NO_IMAGE, true); List.AddEntry("i = inventory", LIGHT_GRAY, 0, NO_IMAGE, true); List.AddEntry("m = message history", LIGHT_GRAY, 0, NO_IMAGE, true); List.AddEntry("k = kill list", LIGHT_GRAY, 0, NO_IMAGE, true); From 8de066f4dec569cc224d9deb5e0f49803ca971c4 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 11:59:56 +0100 Subject: [PATCH 06/11] [3D] fixed the warning about reusing variable names in PerformPlayerCommand --- Main/Source/char.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main/Source/char.cpp b/Main/Source/char.cpp index b76a045ee..9d5a902f3 100644 --- a/Main/Source/char.cpp +++ b/Main/Source/char.cpp @@ -3673,7 +3673,7 @@ void character::PerformPlayerCommand(int Key, bool& HasActed, bool& ValidKeyPres }; int c; - for(c = 0; c < DIRECTION_COMMAND_KEYS; ++c) + for(int c = 0; c < DIRECTION_COMMAND_KEYS; ++c) if(Key == game::GetMoveCommandKey(c)){ if(ivanconfig::Mode3FPP() && !game::IsInWilderness()) @@ -3700,7 +3700,7 @@ void character::PerformPlayerCommand(int Key, bool& HasActed, bool& ValidKeyPres if(ivanconfig::GetMode3()) { auto v = game::GetDirectionVectorForKey(Key); - for(int c = 0; c < DIRECTION_COMMAND_KEYS; ++c) + for(c = 0; c < DIRECTION_COMMAND_KEYS; ++c) if(game::GetMoveVector(c) == v) MoveByVector(game::GetMoveVector(game::AdjustForFacing(c))); } From 73c9e457ecb60f9b390c880e3ae3f3e837cd905f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:03:21 +0100 Subject: [PATCH 07/11] [3D] improved the variable names in the 3D mode implementation, to silence bot warnings --- Main/Source/igraph.cpp | 46 ++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Main/Source/igraph.cpp b/Main/Source/igraph.cpp index 351540623..ebfeaf10f 100644 --- a/Main/Source/igraph.cpp +++ b/Main/Source/igraph.cpp @@ -796,7 +796,9 @@ static inline float cross(fpoint a, fpoint b, int x, int y) { #include "char.h" -int currEye, cc, currAY; +/* currEye is 0 for non-anaglyph mode, 1 for left (red), 2 for right (cyan) */ + +int currEyePosition, currEye, currAY; fpoint::fpoint(fpoint4 i) { @@ -808,11 +810,11 @@ fpoint::fpoint(fpoint4 i) { if(y <= 0) {ok = false; return;} x = i.x - i.y; x = igraph::defx * (16+x); - if(cc == 1) x -= 2; - if(cc == 2) x += 2; + if(currEye == 1) x -= 2; + if(currEye == 2) x += 2; x = sx*8 + sy*2*x/y; y = sy*8 + sy*32/y; - x += sx * currEye / 10.0; + x += sx * currEyePosition / 10.0; ok = true; return; } @@ -832,8 +834,8 @@ fpoint::fpoint(fpoint4 i) { x = tx * C - ty * S + i.ax; y = tx * S + ty * C + currAY; - if(cc == 1) x += 2; - if(cc == 2) x -= 2; + if(currEye == 1) x += 2; + if(currEye == 2) x -= 2; ok = y < -1e-6; if(!ok) return; @@ -847,16 +849,16 @@ fpoint::fpoint(fpoint4 i) { eyelevel = i.z - eyelevel; if(PLAYER -> TemporaryStateIsActivated(CONFUSED)) { - float angle = GET_TICK() * M_PI / 64; + float spin_angle = GET_TICK() * M_PI / 64; tx = x; ty = eyelevel; - S = -sin(angle); - C = cos(angle); + S = -sin(spin_angle); + C = cos(spin_angle); x = C * tx + S * ty; eyelevel = -S * tx + C * ty; } x = sx * 8 - sy * 8 * x / y - 0.5; - x += sx * currEye / 10.0; + x += sx * currEyePosition / 10.0; y = sy * 8 + sy * 8 * eyelevel / y - 0.5; } else { @@ -873,12 +875,12 @@ static inline col16 apply(col16 SrcCol, col16 DestCol, alpha Alpha) { int Green = (SrcCol & 0x7E0 ) + NewGreenLuminance; int Blue = (SrcCol & 0x1F ) + NewBlueLuminance; - if(cc == 2) + if(currEye == 2) { Green += (Red >> 14) << 5; Blue += (Red >> 15); } - if(cc == 1) + if(currEye == 1) Red += ((Green >> 10) + (Blue >> 5)) << 11; if(Red >= 0) {if(Red > 0xF800) Red = 0xF800;} else Red = 0; @@ -889,11 +891,11 @@ static inline col16 apply(col16 SrcCol, col16 DestCol, alpha Alpha) { int DestGreen = (DestCol & 0x7E0); int DestBlue = (DestCol & 0x1F); - if(cc != 2) + if(currEye != 2) Red = (((Red - DestRed) * Alpha >> 8) + DestRed) & 0xF800; else Red = DestRed; - if(cc != 1) + if(currEye != 1) { Green = (((Green - DestGreen) * Alpha >> 8) + DestGreen) & 0x7E0; Blue = ((Blue - DestBlue) * Alpha >> 8) + DestBlue; @@ -963,13 +965,13 @@ void fDrawRect(fpoint a, fpoint b, fpoint c, fpoint d, col16 SrcCol, alpha Alpha void tileRect(const bitmap *b, blitdata &B, int mode, fpoint4 corner, fpoint4 dx, fpoint4 dy, bool mirror, int non) { - if(ivanconfig::GetAnaglyph() && (currEye == 0)) + if(ivanconfig::GetAnaglyph() && (currEyePosition == 0)) { - currEye = ivanconfig::GetAnaglyph(); cc = 1; + currEyePosition = ivanconfig::GetAnaglyph(); currEye = 1; tileRect(b,B,mode,corner,dx,dy,mirror,non); - currEye = -ivanconfig::GetAnaglyph(); cc = 2; + currEyePosition = -ivanconfig::GetAnaglyph(); currEye = 2; tileRect(b,B,mode,corner,dx,dy,mirror,non); - currEye = 0; cc = 0; + currEyePosition = 0; currEye = 0; return; } if(igraph::defy != -1) { @@ -994,9 +996,9 @@ void tileRect(const bitmap *b, blitdata &B, int mode, if((!pt[0][0].ok) && (!pt[0][16].ok) && (!pt[16][0].ok) && (!pt[16][16].ok)) return; if(pt[0][0].ok && pt[0][16].ok && pt[16][0].ok && pt[16][16].ok) { - fpoint p[4]; - p[0] = pt[0][0]; p[1] = pt[0][16]; p[2] = pt[16][0]; p[3] = pt[16][16]; - boundbox bb(p); + fpoint p1[4]; + p1[0] = pt[0][0]; p1[1] = pt[0][16]; p1[2] = pt[16][0]; p1[3] = pt[16][16]; + boundbox bb(p1); for(int x=bb.xmin; x<=bb.xmax; x++) for(int y=bb.ymin; y<=bb.ymax; y++) { int px, py; if(mirror) { @@ -1222,7 +1224,7 @@ void igraph::Blit3(const bitmap *b, blitdata &B, int mode) { return; } - currEye = 0; + currEyePosition = 0; if(mode & MF_FLOOR) tileFloor (b, B, mode); if(mode & MF_CEIL) tileCeil (b, B, mode); From 0a5482d9b5df87cd5094304b5437641fd1d6656c Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:03:50 +0100 Subject: [PATCH 08/11] [3D] render explosions --- Main/Source/level.cpp | 57 +++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/Main/Source/level.cpp b/Main/Source/level.cpp index 718d8cd9a..f530e65df 100644 --- a/Main/Source/level.cpp +++ b/Main/Source/level.cpp @@ -1080,8 +1080,29 @@ void level::Explosion(character* Terrorist, cfestring& DeathMsg, v2 Pos, int Str } } +struct explosioncontroller +{ + static truth Handler(int x, int y) + { + lsquare* Square = Map[x][y]; + Square->GetHitByExplosion(CurrentExplosion); + return Square->IsFlyable(); + } + static lsquare*** Map; + static const explosion* CurrentExplosion; +}; + truth level::DrawExplosion(const explosion* Explosion) const { + + if(ivanconfig::Mode3FPP() || ivanconfig::Mode3Iso()) { + printf("DrawExplosion called, redirecting to the 3D mode\n"); + explosioncontroller::CurrentExplosion = Explosion; + game::DrawEverything(); + explosioncontroller::CurrentExplosion = nullptr; + return true; + } + static v2 StrengthPicPos[7] = { v2(176, 176), v2(0, 144), v2(256, 32), v2(144, 32), v2(64, 32), v2(16, 32), v2(0, 32) }; v2 BPos = game::CalculateScreenCoordinates(Explosion->Pos) - v2((6 - Explosion->Size) << 4, @@ -1157,20 +1178,8 @@ truth level::DrawExplosion(const explosion* Explosion) const return true; } -struct explosioncontroller -{ - static truth Handler(int x, int y) - { - lsquare* Square = Map[x][y]; - Square->GetHitByExplosion(CurrentExplosion); - return Square->IsFlyable(); - } - static lsquare*** Map; - static explosion* CurrentExplosion; -}; - lsquare*** explosioncontroller::Map; -explosion* explosioncontroller::CurrentExplosion; +const explosion* explosioncontroller::CurrentExplosion; int level::TriggerExplosions(int MinIndex) { @@ -1238,6 +1247,8 @@ int level::TriggerExplosions(int MinIndex) if(GetLSquare(Explosion->Pos)->IsFlyable()) GetLSquare(Explosion->Pos)->AddSmoke(gas::Spawn(SMOKE, 1000)); + + explosioncontroller::CurrentExplosion = nullptr; } for(c = MinIndex; c < LastExplosion; ++c) @@ -1368,6 +1379,26 @@ void level::Draw3(int x, int y, truth esp, blitdata& BlitData) const { Square->DrawMemorizedCharacter(BlitData); } } + + auto Exp = explosioncontroller::CurrentExplosion; + if(Exp && (Exp->Pos - v2(x, y)).GetLengthSquare() <= (6 - Exp->Size) * (6 - Exp->Size)) + { + v2 PicPos(0, 32); + v2 SizeVect(16, 16); + + blitdata BlitData = { 0, + { PicPos.X, PicPos.Y }, + { 0, 0 }, + { SizeVect.X, SizeVect.Y }, + { 0 }, + TRANSPARENT_COLOR, + 0 }; + + BlitData.Bitmap = DOUBLE_BUFFER; + BlitData.Luminance = ivanconfig::GetContrastLuminance(); + BlitData.CustomData = DO_BLIT3; + igraph::Blit3(igraph::GetSymbolGraphic(), BlitData, MF_BLIT_LUMINANCE_MASKED | MF_OBJECT); + } } void level::Draw(truth AnimationDraw) const From d75c8aad9bdc2c4540ab93279ddf4d859b482cec Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:04:06 +0100 Subject: [PATCH 09/11] [3D] disable lightning in 3D modes since not implemented --- Main/Source/lsquare.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Main/Source/lsquare.cpp b/Main/Source/lsquare.cpp index e35b54e2e..15246d208 100644 --- a/Main/Source/lsquare.cpp +++ b/Main/Source/lsquare.cpp @@ -1428,6 +1428,9 @@ void lsquare::AddItem(item* Item) v2 lsquare::DrawLightning(v2 StartPos, long Color, int Direction, truth DrawHere) { + /* not yet implemented in 3D */ + if(ivanconfig::Mode3FPP() || ivanconfig::Mode3Iso()) return StartPos; + if(!game::PosCurrentlyOnScreen(GetPos()) || !CanBeSeenByPlayer(true)) switch(Direction) { From 7d36e49851cd2aa5dc3f1b1316668662293af23a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 12:01:30 +0100 Subject: [PATCH 10/11] [3D] fixed animated drips (fluid Animate) in 3D modes --- Main/Source/fluid.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Main/Source/fluid.cpp b/Main/Source/fluid.cpp index 98b573346..dea0c90d6 100644 --- a/Main/Source/fluid.cpp +++ b/Main/Source/fluid.cpp @@ -486,13 +486,20 @@ void fluid::imagedata::Animate(blitdata& BlitData, int CurrentFlags) const Rotate(TrueDripPos, 16, CurrentFlags); TrueDripPos.Y -= DripTimer; - if(TrueDripPos.Y < 16) - BlitData.Bitmap->AlphaPutPixel(TrueDripPos + BlitData.Dest, DripColor, BlitData.Luminance, DripAlpha); + if(TrueDripPos.Y < 16) { + if(BlitData.CustomData & DO_BLIT3) + igraph::fDrawRainPixel(TrueDripPos, DripColor); + else + BlitData.Bitmap->AlphaPutPixel(TrueDripPos + BlitData.Dest, DripColor, BlitData.Luminance, DripAlpha); + } if(TrueDripPos.Y < 15) { ++TrueDripPos.Y; - BlitData.Bitmap->AlphaPutPixel(TrueDripPos + BlitData.Dest, DripColor, BlitData.Luminance, DripAlpha); + if(BlitData.CustomData & DO_BLIT3) + igraph::fDrawRainPixel(TrueDripPos, DripColor); + else + BlitData.Bitmap->AlphaPutPixel(TrueDripPos + BlitData.Dest, DripColor, BlitData.Luminance, DripAlpha); } else DripTimer = Min(RAND() % (500000 / AlphaSum), 25000); From 88492590db2d5c503b39c3c747fb4fa8f7b5ae0f Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 25 Oct 2026 14:03:58 +0100 Subject: [PATCH 11/11] fixed two more reused variable names --- Main/Source/char.cpp | 2 +- Main/Source/level.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Main/Source/char.cpp b/Main/Source/char.cpp index 9d5a902f3..4530d8411 100644 --- a/Main/Source/char.cpp +++ b/Main/Source/char.cpp @@ -3673,7 +3673,7 @@ void character::PerformPlayerCommand(int Key, bool& HasActed, bool& ValidKeyPres }; int c; - for(int c = 0; c < DIRECTION_COMMAND_KEYS; ++c) + for(c = 0; c < DIRECTION_COMMAND_KEYS; ++c) if(Key == game::GetMoveCommandKey(c)){ if(ivanconfig::Mode3FPP() && !game::IsInWilderness()) diff --git a/Main/Source/level.cpp b/Main/Source/level.cpp index f530e65df..8cb7d8b3c 100644 --- a/Main/Source/level.cpp +++ b/Main/Source/level.cpp @@ -1386,7 +1386,7 @@ void level::Draw3(int x, int y, truth esp, blitdata& BlitData) const { v2 PicPos(0, 32); v2 SizeVect(16, 16); - blitdata BlitData = { 0, + blitdata BlitDataEx = { 0, { PicPos.X, PicPos.Y }, { 0, 0 }, { SizeVect.X, SizeVect.Y }, @@ -1394,10 +1394,10 @@ void level::Draw3(int x, int y, truth esp, blitdata& BlitData) const { TRANSPARENT_COLOR, 0 }; - BlitData.Bitmap = DOUBLE_BUFFER; - BlitData.Luminance = ivanconfig::GetContrastLuminance(); - BlitData.CustomData = DO_BLIT3; - igraph::Blit3(igraph::GetSymbolGraphic(), BlitData, MF_BLIT_LUMINANCE_MASKED | MF_OBJECT); + BlitDataEx.Bitmap = DOUBLE_BUFFER; + BlitDataEx.Luminance = ivanconfig::GetContrastLuminance(); + BlitDataEx.CustomData = DO_BLIT3; + igraph::Blit3(igraph::GetSymbolGraphic(), BlitDataEx, MF_BLIT_LUMINANCE_MASKED | MF_OBJECT); } }