Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ This page lists all the individual contributions to the project by their author.
- MP saves support for quicksave command and savegame trigger action
- Ported XNA CnCNet Client MP save handling
- Retint fix toggle
- Voxel drawing invisible sections skip
- **Uranusian (Thrifinesma)**:
- Mind Control enhancement
- Custom warhead splash list
Expand Down Expand Up @@ -546,6 +547,7 @@ This page lists all the individual contributions to the project by their author.
- Fix a jumpjet crash related to voxel shadow drawing
- Replace `BLOWFISH.DLL` using Red Alert source code
- Adjust the dehardcoding of the 255 `OverlayType` limit to a different format
- Voxel drawing invisible sections skip
- **CrimRecya**:
- Fix `LimboKill` not working reliably
- Allow using waypoints, area guard and attack move with aircraft
Expand Down
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed the bug that `DeploysInto` and `UndeploysInto` will make damaged techno lose 1 health.
- Fixed the issue that the Jumpjet must end its movement before starting the next mission.
- Fixed an issue where parachute units would die upon landing if bridges were destroyed during their descent.
- Voxel drawing code now skips sections that are invisible (have all zeros in the transform matrix main diagonal, meaning that the scale is 0% on all axes), thus increasing drawing performance for some voxels.
Copy link
Copy Markdown
Member Author

@Metadorius Metadorius Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Voxel drawing code now skips sections that are invisible (have all zeros in the transform matrix main diagonal, meaning that the scale is 0% on all axes), thus increasing drawing performance for some voxels.
- Voxel drawing code now skips sections that are invisible (have all zeros in the transform matrix main diagonal, meaning that the scale is 0% on all axes), thus increasing drawing performance for uncached voxels which are animated using section swap method.


## Fixes / interactions with other extensions

Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ Vanilla fixes:
- Fixed the bug that `DeploysInto` and `UndeploysInto` will make damaged techno lose 1 health (by CrimRecya)
- Fixed the issue that the Jumpjet must end its movement before starting the next mission (by TaranDahl)
- Fixed an issue where parachute units would die upon landing if bridges were destroyed during their descent (by FlyStar)
- Voxel drawing code now skips sections that are invisible (have all zeros in the transform matrix main diagonal, meaning that the scale is 0% on all axes), thus increasing drawing performance for some voxels (by Kerbiter, ZivDero)

Phobos fixes:
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)
Expand Down
25 changes: 25 additions & 0 deletions src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <EventClass.h>
#include <JumpjetLocomotionClass.h>
#include <TunnelLocomotionClass.h>
#include <FileFormats/HVA.h>

#include <Ext/BuildingType/Body.h>
#include <Ext/Techno/Body.h>
Expand Down Expand Up @@ -3164,3 +3165,27 @@ DEFINE_HOOK(0x7442AB, UnitClass_ReadyToNextMission_FallingDown, 0x6)
GET(FootClass*, pThis, ESI);
return pThis->IsFallingDown ? ReturnZero : 0;
}

// sadly, useful for uncached voxels specifically, but no reason for the code to go to waste
DEFINE_HOOK(0x706F64, TechnoClass_RenderVoxelObject_SkipInvisibleSections, 0x0)
Comment thread
Metadorius marked this conversation as resolved.
{
enum { SkipLayer = 0x706FDF };

GET(MotLib* const, pMotLib, EDI);

// stolen code
if (!pMotLib)
return 0x706FBD;

GET(int const, layer, EBX);
GET_STACK(unsigned int const, frame, STACK_OFFSET(0x13C, 0x18));

auto mtx = pMotLib->GetLayerMatrix(layer, frame);

if (mtx.row[0][0] == 0.0 && mtx.row[1][1] == 0.0 && mtx.row[2][2] == 0.0)
return SkipLayer;

// stolen code
R->EAX(frame);
return 0x706F6F;
}