Futher work on ensuring that all datatypes are initilizaed in OSG objects.

This commit is contained in:
Robert Osfield
2002-07-21 10:04:33 +00:00
parent 389dd8adbb
commit b23aea5173
5 changed files with 16 additions and 5 deletions

View File

@@ -4,13 +4,13 @@ using namespace osg;
CullStack::CullStack()
{
_cullingMode = ENABLE_ALL_CULLING;
_LODBias = 1.0f;
_smallFeatureCullingPixelSize = 2.0f;
_frustumVolume=-1.0f;
_bbCornerNear = 0;
_bbCornerFar = 7;
_currentReuseMatrixIndex=0;
}

View File

@@ -169,7 +169,7 @@ sMStats m_getMemoryStatistics()
static bool alwaysValidateAll = false;
static bool alwaysLogAll = false;
static bool alwaysWipeAll = true;
static bool checkOnAllocations = true;
static bool checkOnAllocations = false;
static bool checkForUnitialized = false;
static bool cleanupLogOnFirstRun = true;
static const unsigned int paddingSize = 4;
@@ -269,6 +269,10 @@ sMStats m_getMemoryStatistics()
{
checkOnAllocations=true;
}
else
{
checkOnAllocations=false;
}
}
@@ -1010,7 +1014,7 @@ sMStats m_getMemoryStatistics()
{
// check that exists allocated units havn't been damaged.
if (checkOnAllocations || checkForUnitialized) m_validateAllAllocUnits();
if (checkOnAllocations) m_validateAllAllocUnits();
try
{

View File

@@ -13,6 +13,8 @@ DriveManipulator::DriveManipulator()
{
_modelScale = 0.01f;
_velocity = 0.0f;
_height = 1.0f;
_buffer = 1.0f;
//_speedMode = USE_MOUSE_Y_FOR_SPEED;
_speedMode = USE_MOUSE_BUTTONS_FOR_SPEED;
}

View File

@@ -137,10 +137,11 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
if (!fr[1].getInt(capacity)) capacity=100;
int size = 0;
int* list = osgNew int [capacity];
memset(list,0,capacity*sizeof(int));
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
{
int primLength;
if (fr[0].getInt(primLength))
{
@@ -150,6 +151,7 @@ bool GeoSet_readLocalData(Object& obj, Input& fr)
while(capacity<=size) capacity *= 2;
int* oldList = list;
list = osgNew int[capacity];
memset(list,0,capacity*sizeof(int));
for(int i=0;i<oldCapacity;++i)
{
list[i] = oldList[i];

View File

@@ -116,6 +116,7 @@ void SceneView::setDefaults()
void SceneView::init()
{
_initCalled = true;
if (_sceneData.valid() && _initVisitor.valid())
@@ -138,7 +139,9 @@ void SceneView::app()
if (!_initCalled) init();
#ifdef OSG_USE_MEMORY_MANAGER
m_validateAllAllocUnits();
#endif
//std::cout<<std::endl;
//std::cout<<std::endl;
//std::cout<<"*************************** New frame ************"<<std::endl;