mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 12:05:14 -04:00
very minorly optimise BlockInfo.CalcCulling
This commit is contained in:
parent
3cea320efc
commit
9118b55e87
@ -328,7 +328,7 @@ void Block_RecalculateBB(BlockID block) {
|
|||||||
void Block_CalcStretch(BlockID block) {
|
void Block_CalcStretch(BlockID block) {
|
||||||
/* faces which can be stretched on X axis */
|
/* faces which can be stretched on X axis */
|
||||||
if (Block_MinBB[block].X == 0.0f && Block_MaxBB[block].X == 1.0f) {
|
if (Block_MinBB[block].X == 0.0f && Block_MaxBB[block].X == 1.0f) {
|
||||||
Block_CanStretch[block] |= 0x3C;
|
Block_CanStretch[block] |= 0x3C;
|
||||||
} else {
|
} else {
|
||||||
Block_CanStretch[block] &= 0xC3; /* ~0x3C */
|
Block_CanStretch[block] &= 0xC3; /* ~0x3C */
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ bool Block_IsHidden(BlockID block, BlockID other) {
|
|||||||
bool canSkip = (bType == COLLIDE_SOLID && oType == COLLIDE_SOLID) || bType != COLLIDE_SOLID;
|
bool canSkip = (bType == COLLIDE_SOLID && oType == COLLIDE_SOLID) || bType != COLLIDE_SOLID;
|
||||||
return canSkip;
|
return canSkip;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Block_CalcCulling(BlockID block, BlockID other) {
|
void Block_CalcCulling(BlockID block, BlockID other) {
|
||||||
if (!Block_IsHidden(block, other)) {
|
if (!Block_IsHidden(block, other)) {
|
||||||
/* Block is not hidden at all, so we can just entirely skip per-face check */
|
/* Block is not hidden at all, so we can just entirely skip per-face check */
|
||||||
@ -393,7 +393,7 @@ void Block_CalcCulling(BlockID block, BlockID other) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Block_IsFaceHidden(BlockID block, BlockID other, Face face) {
|
bool Block_IsFaceHidden(BlockID block, BlockID other, Face face) {
|
||||||
return (Block_Hidden[(block * BLOCK_COUNT) | other] & (1 << face)) != 0;
|
return (Block_Hidden[(block * BLOCK_COUNT) | other] & (1 << face)) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Block_UpdateCullingAll(void) {
|
void Block_UpdateCullingAll(void) {
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
#define BLOCK_CPE_COUNT (BLOCK_MAX_CPE + 1)
|
#define BLOCK_CPE_COUNT (BLOCK_MAX_CPE + 1)
|
||||||
|
|
||||||
#if USE16_BIT
|
#if USE16_BIT
|
||||||
#define BLOCK_MAX_DEFINED 0x3FF
|
#define BLOCK_MAX_DEFINED 0x3FF
|
||||||
#else
|
#else
|
||||||
#define BLOCK_MAX_DEFINED 0xFF
|
#define BLOCK_MAX_DEFINED 0xFF
|
||||||
#endif
|
#endif
|
||||||
|
@ -152,8 +152,8 @@ void Builder_Stretch(Int32 x1, Int32 y1, Int32 z1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Builder_X = x; Builder_Y = y; Builder_Z = z;
|
Builder_X = x; Builder_Y = y; Builder_Z = z;
|
||||||
Builder_FullBright = Block_FullBright[b];
|
Builder_FullBright = Block_FullBright[b];
|
||||||
UInt32 tileIdx = b * BLOCK_COUNT;
|
UInt32 tileIdx = b * BLOCK_COUNT;
|
||||||
/* All of these function calls are inlined as they can be called tens of millions to hundreds of millions of times. */
|
/* All of these function calls are inlined as they can be called tens of millions to hundreds of millions of times. */
|
||||||
|
|
||||||
if (Builder_Counts[index] == 0 ||
|
if (Builder_Counts[index] == 0 ||
|
||||||
|
@ -216,7 +216,6 @@
|
|||||||
<ClInclude Include="MapGenerator.h" />
|
<ClInclude Include="MapGenerator.h" />
|
||||||
<ClInclude Include="MapRenderer.h" />
|
<ClInclude Include="MapRenderer.h" />
|
||||||
<ClInclude Include="ModelCache.h" />
|
<ClInclude Include="ModelCache.h" />
|
||||||
<ClInclude Include="NetworkEnums.h" />
|
|
||||||
<ClInclude Include="Options.h" />
|
<ClInclude Include="Options.h" />
|
||||||
<ClInclude Include="Particle.h" />
|
<ClInclude Include="Particle.h" />
|
||||||
<ClInclude Include="Physics.h" />
|
<ClInclude Include="Physics.h" />
|
||||||
|
@ -231,9 +231,6 @@
|
|||||||
<ClInclude Include="Camera.h">
|
<ClInclude Include="Camera.h">
|
||||||
<Filter>Header Files\Utils</Filter>
|
<Filter>Header Files\Utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="NetworkEnums.h">
|
|
||||||
<Filter>Header Files\Network</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="AABB.h">
|
<ClInclude Include="AABB.h">
|
||||||
<Filter>Header Files\Math</Filter>
|
<Filter>Header Files\Math</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user