From 086a0fd4bc3ab718f65df6c07e4da36920ced8a5 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Wed, 29 Dec 2010 10:57:38 +0100 Subject: [PATCH] Add new PIE flag 0x00001000 that specifies that the PIE model should not be stretched to fit to terrain. --- lib/ivis_common/imd.h | 5 +++-- src/display3d.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ivis_common/imd.h b/lib/ivis_common/imd.h index 35f718a3e..4944e707e 100644 --- a/lib/ivis_common/imd.h +++ b/lib/ivis_common/imd.h @@ -37,12 +37,13 @@ //************************************************************************* // PIE model flags -#define iV_IMD_TCMASK 0x00010000 +#define iV_IMD_NOSTRETCH 0x00001000 +#define iV_IMD_TCMASK 0x00010000 // polygon flags b0..b7: col, b24..b31: anim index -#define iV_IMD_TEX 0x00000200 +#define iV_IMD_TEX 0x00000200 // this is both a polygon and pie flag #define iV_IMD_TEXANIM 0x00004000 // iV_IMD_TEX must be set also //************************************************************************* diff --git a/src/display3d.cpp b/src/display3d.cpp index 6ab506c8d..7c67b2e09 100644 --- a/src/display3d.cpp +++ b/src/display3d.cpp @@ -2232,7 +2232,7 @@ void renderStructure(STRUCTURE *psStructure) pieFlag = pie_STATIC_SHADOW; pieFlagData = 0; } - if (defensive && !structureIsBlueprint(psStructure)) + if (defensive && !structureIsBlueprint(psStructure) && !(strImd->flags & iV_IMD_NOSTRETCH)) { pie_SetShaderStretchDepth(psStructure->pos.z - psStructure->foundationDepth); }