cleanup all the "#if 1" macro blocks

This commit is contained in:
DarthArgus
2016-03-24 21:27:54 +00:00
parent 01cdf52bc0
commit cd997925eb
9 changed files with 5 additions and 135 deletions
@@ -115,7 +115,6 @@ void DebugMonitor::install(void)
return;
}
#if 1
// NOTE: -TRF- I would not expect this chunk of termios setup
// code to be necessary. My expectation is that it should
// be handled by the curs_inopts (see man page) options I have
@@ -152,7 +151,6 @@ void DebugMonitor::install(void)
fclose(s_ttyInputFile);
return;
}
#endif
//-- Create a curses screen to represent the DebugMonitor output tty.
// NOTE: for now the curses input is hooked up to the application's
@@ -121,7 +121,6 @@ namespace PlayerCreationManagerNamespace
for (; iff.enterForm (Tags::PTMP, true); ++ptmp_count)
{
#if 1
std::string playerTemplateStr;
if (iff.enterChunk (TAG_NAME, true))
{
@@ -148,7 +147,6 @@ namespace PlayerCreationManagerNamespace
}
eq.insert (std::make_pair (playerTemplateStr, v));
#endif
iff.exitForm (true);
}
@@ -236,7 +236,6 @@ const StructureFootprint* SharedTangibleObjectTemplate::getStructureFootprint ()
*/
void SharedTangibleObjectTemplate::createCustomizationDataPropertyAsNeeded(Object &object, bool /* forceCreation */) const
{
#if 1
//-- Properties cannot be added while an object is in the world. Some callers may be in the world,
// so temporarily remove the object from the world if necessary.
bool shouldBeInWorld = object.isInWorld();
@@ -266,80 +265,6 @@ void SharedTangibleObjectTemplate::createCustomizationDataPropertyAsNeeded(Objec
//-- release local reference to the CustomizationData instance
customizationData->release();
}
#else
// @todo -TRF- remove this code as soon as asset customization manager is working properly.
const size_t paletteColorCount = getPaletteColorCustomizationVariablesCount();
const size_t rangedIntCount = getRangedIntCustomizationVariablesCount();
//-- Return if caller isn't forcing customization data creation and no customization variables are declared for the ObjectTemplate.
const bool makeCustomizationData = forceCreation || (paletteColorCount > 0) || (rangedIntCount > 0);
if (!makeCustomizationData)
return;
//-- Properties cannot be added while an object is in the world. Some callers may be in the world,
// so temporarily remove the object from the world if necessary.
bool shouldBeInWorld = object.isInWorld();
if (shouldBeInWorld)
object.removeFromWorld();
//-- create the CustomizationDataProperty, add to Object property collection
CustomizationDataProperty *const cdProperty = new CustomizationDataProperty(object);
object.addProperty(*cdProperty);
//-- Put object back in world if it was originally there.
if (shouldBeInWorld)
object.addToWorld();
//-- fetch the CustomizationData instance
CustomizationData *const customizationData = cdProperty->fetchCustomizationData();
//-- create PaletteColorCustomizationVariable variables as specified
{
SharedTangibleObjectTemplate::PaletteColorCustomizationVariable variableData;
for (int i = 0; i < static_cast<int>(paletteColorCount); ++i)
{
//-- get the palette variable data
getPaletteColorCustomizationVariables(variableData, i);
//-- fetch the palette
const PaletteArgb *const palette = PaletteArgbList::fetch(TemporaryCrcString(variableData.palettePathName.c_str(), true));
if (!palette)
{
DEBUG_WARNING(true, ("failed to retrieve color palette [%s] for [%s], skipping variable [%s].\n", variableData.palettePathName.c_str(), getName (), variableData.variableName.c_str()));
continue;
}
//-- create the variable, add to CustomizationData
::PaletteColorCustomizationVariable * const palColorVar = new ::PaletteColorCustomizationVariable(palette, variableData.defaultPaletteIndex);
if (variableData.defaultPaletteIndex != palColorVar->getValue ())
DEBUG_WARNING (true, ("Error loading PaletteColorCustomizationVariable [%s] for [%s]", variableData.variableName.c_str(), getName ()));
customizationData->addVariableTakeOwnership(variableData.variableName, palColorVar);
//-- release local palette reference
palette->release();
}
}
//-- create BasicRangedIntCustomizationVariable variables as specified
{
SharedTangibleObjectTemplate::RangedIntCustomizationVariable variableData;
for (int i = 0; i < static_cast<int>(rangedIntCount); ++i)
{
//-- get the palette variable data
getRangedIntCustomizationVariables(variableData, i);
//-- create the variable, add to CustomizationData
customizationData->addVariableTakeOwnership(variableData.variableName, new ::BasicRangedIntCustomizationVariable(variableData.minValueInclusive, variableData.defaultValue, variableData.maxValueExclusive));
}
}
//-- release local reference to the CustomizationData instance
customizationData->release();
#endif
}
//@BEGIN TFD
@@ -100,12 +100,7 @@ void AffectorShaderConstant::affect (const float worldX, const float worldZ, con
FastRandomGenerator randomGenerator(CoordinateHash::hashTuple(worldX, worldZ));
#if 1
if (amount >= featherClamp)
#else
//-- this causes better looking terrain, but more shader blends
if (randomGenerator.randomFloat() <= amount * featherClamp)
#endif
{
ShaderGroup::Info sgi = m_cachedSgi;
sgi.setChildChoice(randomGenerator.randomFloat());
@@ -128,12 +123,7 @@ void AffectorShaderConstant::_legacyAffect (const float /*worldX*/, const float
const float featherClamp = m_useFeatherClampOverride ? m_featherClampOverride : m_cachedFeatherClamp;
#if 1
if (amount >= featherClamp)
#else
//-- this causes better looking terrain, but more shader blends
if (generatorChunkData.randomGenerator.randomReal (0.f, 1.f) <= amount * featherClamp)
#endif
{
ShaderGroup::Info sgi = m_cachedSgi;
sgi.setChildChoice (generatorChunkData.m_legacyRandomGenerator->randomReal (0.0f, 1.0f));
@@ -321,12 +311,7 @@ void AffectorShaderReplace::affect (const float /*worldX*/, const float /*worldZ
const float featherClamp = m_useFeatherClampOverride ? m_featherClampOverride : m_cachedFeatherClamp;
#if 1
if (amount >= featherClamp)
#else
//-- this causes better looking terrain, but more shader blends
if (generatorChunkData.randomGenerator.randomReal (0.f, 1.f) <= amount * featherClamp)
#endif
{
m_cachedSgi.setChildChoice (sgi.getChildChoice ());
@@ -250,7 +250,6 @@ void FloraGroup::Family::addChild (const FamilyChildData& familyChildData)
FamilyChildData child = familyChildData;
child.familyId = familyId;
#if 1
//-- fixup fubar'ed names for a version
FileName baseName (FileName::P_none, familyChildData.appearanceTemplateName);
baseName.stripPathAndExt ();
@@ -281,9 +280,6 @@ void FloraGroup::Family::addChild (const FamilyChildData& familyChildData)
child.appearanceTemplateName = DuplicateString (familyChildData.appearanceTemplateName);
}
}
#else
child.appearanceTemplateName = DuplicateString (familyChildData.appearanceTemplateName);
#endif
childList.add (child);
}
@@ -100,17 +100,14 @@ bool HeightData::Segment::find (const Vector2d& oposition, float& result) const
{
Vector2d position = oposition;
#if 1
{
const float x0 = std::min (m_pointList.begin ()->x, m_pointList.back ().x);
const float z0 = std::min (m_pointList.begin ()->z, m_pointList.back ().z);
const float x1 = std::max (m_pointList.begin ()->x, m_pointList.back ().x);
const float z1 = std::max (m_pointList.begin ()->z, m_pointList.back ().z);
// DEBUG_FATAL (position.x < x0 || position.x > x1 || position.y < z0 || position.y > z1, ("position out of range"));
position.x = clamp (x0, position.x, x1);
position.y = clamp (z0, position.y, z1);
}
#endif
const float width = m_pointList.back ().x - m_pointList.begin ()->x;
const float height = m_pointList.back ().z - m_pointList.begin ()->z;