From 9118b55e877501b642e73d0e4c1dca9897da26a2 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 14 Mar 2018 22:06:03 +1100 Subject: [PATCH] very minorly optimise BlockInfo.CalcCulling --- src/Client/Block.c | 6 +++--- src/Client/BlockID.h | 2 +- src/Client/Builder.c | 4 ++-- src/Client/Client.vcxproj | 1 - src/Client/Client.vcxproj.filters | 3 --- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Client/Block.c b/src/Client/Block.c index f7bff128d..40022c5f5 100644 --- a/src/Client/Block.c +++ b/src/Client/Block.c @@ -328,7 +328,7 @@ void Block_RecalculateBB(BlockID block) { void Block_CalcStretch(BlockID block) { /* faces which can be stretched on X axis */ if (Block_MinBB[block].X == 0.0f && Block_MaxBB[block].X == 1.0f) { - Block_CanStretch[block] |= 0x3C; + Block_CanStretch[block] |= 0x3C; } else { 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; return canSkip; } - + void Block_CalcCulling(BlockID block, BlockID other) { if (!Block_IsHidden(block, other)) { /* 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) { - return (Block_Hidden[(block * BLOCK_COUNT) | other] & (1 << face)) != 0; + return (Block_Hidden[(block * BLOCK_COUNT) | other] & (1 << face)) != 0; } void Block_UpdateCullingAll(void) { diff --git a/src/Client/BlockID.h b/src/Client/BlockID.h index 1da45bec7..eada79efd 100644 --- a/src/Client/BlockID.h +++ b/src/Client/BlockID.h @@ -84,7 +84,7 @@ #define BLOCK_CPE_COUNT (BLOCK_MAX_CPE + 1) #if USE16_BIT -#define BLOCK_MAX_DEFINED 0x3FF +#define BLOCK_MAX_DEFINED 0x3FF #else #define BLOCK_MAX_DEFINED 0xFF #endif diff --git a/src/Client/Builder.c b/src/Client/Builder.c index 2f242df06..ce9b56323 100644 --- a/src/Client/Builder.c +++ b/src/Client/Builder.c @@ -152,8 +152,8 @@ void Builder_Stretch(Int32 x1, Int32 y1, Int32 z1) { } Builder_X = x; Builder_Y = y; Builder_Z = z; - Builder_FullBright = Block_FullBright[b]; - UInt32 tileIdx = b * BLOCK_COUNT; + Builder_FullBright = Block_FullBright[b]; + 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. */ if (Builder_Counts[index] == 0 || diff --git a/src/Client/Client.vcxproj b/src/Client/Client.vcxproj index f9faaac3d..838240b2e 100644 --- a/src/Client/Client.vcxproj +++ b/src/Client/Client.vcxproj @@ -216,7 +216,6 @@ - diff --git a/src/Client/Client.vcxproj.filters b/src/Client/Client.vcxproj.filters index 3759ba328..1ddb94ee8 100644 --- a/src/Client/Client.vcxproj.filters +++ b/src/Client/Client.vcxproj.filters @@ -231,9 +231,6 @@ Header Files\Utils - - Header Files\Network - Header Files\Math