From a19299d501e1130bc69fc2bf1d7a3cb466b1998d Mon Sep 17 00:00:00 2001 From: Krishty Date: Sat, 17 Apr 2021 00:32:04 +0200 Subject: [PATCH] moved MD2/MDC tables from BSS to const data Visual C++ is unable to identify them as constant data during optimization, so explicitly declare them const. --- code/AssetLib/MD2/MD2NormalTable.h | 2 +- code/AssetLib/MDC/MDCNormalTable.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/MD2/MD2NormalTable.h b/code/AssetLib/MD2/MD2NormalTable.h index 3eff0d666..b2330d862 100644 --- a/code/AssetLib/MD2/MD2NormalTable.h +++ b/code/AssetLib/MD2/MD2NormalTable.h @@ -51,7 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_MDL_NORMALTABLE_H_INC -float g_avNormals[162][3] = { +const float g_avNormals[162][3] = { { -0.525731f, 0.000000f, 0.850651f }, { -0.442863f, 0.238856f, 0.864188f }, { -0.295242f, 0.000000f, 0.955423f }, diff --git a/code/AssetLib/MDC/MDCNormalTable.h b/code/AssetLib/MDC/MDCNormalTable.h index f47e97f33..c96eba7bd 100644 --- a/code/AssetLib/MDC/MDCNormalTable.h +++ b/code/AssetLib/MDC/MDCNormalTable.h @@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define MDC_NORMAL_TABLE_INCLUDED /* mdc decoding normal table */ -float mdcNormals[ 256 ][ 3 ] = +const float mdcNormals[ 256 ][ 3 ] = { { 1.000000f, 0.000000f, 0.000000f }, { 0.980785f, 0.195090f, 0.000000f },