mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-28 19:13:47 +00:00
terrain-zodiacs -- Changes made for rendering zodiacs on regular terrain.
This commit is contained in:
parent
4ab89f637e
commit
8a6ac1fb0f
6 changed files with 194 additions and 0 deletions
|
|
@ -20,6 +20,11 @@
|
|||
// IN THE SOFTWARE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
|
||||
// Copyright (C) 2015 Faust Logic, Inc.
|
||||
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
|
||||
|
||||
#include "platform/platform.h"
|
||||
#include "terrain/terrData.h"
|
||||
|
||||
|
|
@ -200,6 +205,8 @@ TerrainBlock::TerrainBlock()
|
|||
{
|
||||
mTypeMask = TerrainObjectType | StaticObjectType | StaticShapeObjectType;
|
||||
mNetFlags.set(Ghostable | ScopeAlways);
|
||||
mIgnoreZodiacs = false;
|
||||
zode_primBuffer = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -218,6 +225,7 @@ TerrainBlock::~TerrainBlock()
|
|||
if (editor)
|
||||
editor->detachTerrain(this);
|
||||
#endif
|
||||
deleteZodiacPrimitiveBuffer();
|
||||
}
|
||||
|
||||
void TerrainBlock::_onTextureEvent( GFXTexCallbackCode code )
|
||||
|
|
@ -1006,6 +1014,7 @@ void TerrainBlock::_rebuildQuadtree()
|
|||
|
||||
// Build the shared PrimitiveBuffer.
|
||||
mCell->createPrimBuffer( &mPrimBuffer );
|
||||
deleteZodiacPrimitiveBuffer();
|
||||
}
|
||||
|
||||
void TerrainBlock::_updatePhysics()
|
||||
|
|
@ -1148,6 +1157,9 @@ void TerrainBlock::initPersistFields()
|
|||
|
||||
endGroup( "Misc" );
|
||||
|
||||
addGroup("AFX");
|
||||
addField("ignoreZodiacs", TypeBool, Offset(mIgnoreZodiacs, TerrainBlock));
|
||||
endGroup("AFX");
|
||||
Parent::initPersistFields();
|
||||
|
||||
removeField( "scale" );
|
||||
|
|
@ -1198,6 +1210,7 @@ U32 TerrainBlock::packUpdate(NetConnection* con, U32 mask, BitStream *stream)
|
|||
stream->write( mScreenError );
|
||||
|
||||
stream->writeInt(mBaseTexFormat, 32);
|
||||
stream->writeFlag(mIgnoreZodiacs);
|
||||
|
||||
return retMask;
|
||||
}
|
||||
|
|
@ -1267,6 +1280,7 @@ void TerrainBlock::unpackUpdate(NetConnection* con, BitStream *stream)
|
|||
stream->read( &mScreenError );
|
||||
|
||||
mBaseTexFormat = (BaseTexFormat)stream->readInt(32);
|
||||
mIgnoreZodiacs = stream->readFlag();
|
||||
}
|
||||
|
||||
void TerrainBlock::getMinMaxHeight( F32 *minHeight, F32 *maxHeight ) const
|
||||
|
|
@ -1405,3 +1419,19 @@ DefineConsoleFunction( getTerrainHeightBelowPosition, F32, (const char* ptOrX, c
|
|||
|
||||
return height;
|
||||
}
|
||||
const U16* TerrainBlock::getZodiacPrimitiveBuffer()
|
||||
{
|
||||
if (!zode_primBuffer && !mIgnoreZodiacs)
|
||||
TerrCell::createZodiacPrimBuffer(&zode_primBuffer);
|
||||
return zode_primBuffer;
|
||||
}
|
||||
|
||||
void TerrainBlock::deleteZodiacPrimitiveBuffer()
|
||||
{
|
||||
if (zode_primBuffer != 0)
|
||||
{
|
||||
delete [] zode_primBuffer;
|
||||
zode_primBuffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue