uninitialized and unused value cleanups

(cherry picked from commit 1f08602cf0ad84409cd8b3520510f9c6ce7d5f9c)
This commit is contained in:
AzaezelX 2023-05-01 10:37:44 -05:00
parent 1230d0d280
commit 0d4221fa59
38 changed files with 176 additions and 360 deletions

View file

@ -13,10 +13,10 @@ class GuiInspectorTypeImageAssetPtr : public GuiInspectorTypeFileName
typedef GuiInspectorTypeFileName Parent; typedef GuiInspectorTypeFileName Parent;
public: public:
GuiTextCtrl* mLabel; GuiTextCtrl* mLabel = NULL;
GuiBitmapButtonCtrl* mPreviewBorderButton; GuiBitmapButtonCtrl* mPreviewBorderButton = NULL;
GuiBitmapCtrl* mPreviewImage; GuiBitmapCtrl* mPreviewImage = NULL;
GuiButtonCtrl* mEditButton; GuiButtonCtrl* mEditButton = NULL;
DECLARE_CONOBJECT(GuiInspectorTypeImageAssetPtr); DECLARE_CONOBJECT(GuiInspectorTypeImageAssetPtr);
static void consoleInit(); static void consoleInit();

View file

@ -592,9 +592,6 @@ const char* ShapeAsset::generateCachedPreviewImage(S32 resolution, String overri
// Animate the shape once. // Animate the shape once.
shape->animate(0); shape->animate(0);
// So we don't have to change it everywhere.
const GFXFormat format = GFXFormatR8G8B8A8;
GBitmap* imposter = NULL; GBitmap* imposter = NULL;
GBitmap* imposterNrml = NULL; GBitmap* imposterNrml = NULL;
@ -605,8 +602,6 @@ const char* ShapeAsset::generateCachedPreviewImage(S32 resolution, String overri
MatrixF angMat; MatrixF angMat;
S32 mip = 0;
PROFILE_START(ShapeAsset_generateCachedPreviewImage); PROFILE_START(ShapeAsset_generateCachedPreviewImage);
//dMemset(destBmp.getWritableBits(mip), 0, destBmp.getWidth(mip) * destBmp.getHeight(mip) * GFXFormat_getByteSize(format)); //dMemset(destBmp.getWritableBits(mip), 0, destBmp.getWidth(mip) * destBmp.getHeight(mip) * GFXFormat_getByteSize(format));

View file

@ -104,9 +104,6 @@ ConsoleSetType(TypeTerrainAssetId)
// Was a single argument specified? // Was a single argument specified?
if (argc == 1) if (argc == 1)
{ {
// Yes, so fetch field value.
const char* pFieldValue = argv[0];
*((const char**)dptr) = StringTable->insert(argv[0]); *((const char**)dptr) = StringTable->insert(argv[0]);
return; return;

View file

@ -638,7 +638,7 @@ AssetImportObject* AssetImporter::addImportingAsset(String assetType, Torque::Pa
U32 pos = dStrcspn(sanitizedStr, "-+*/%$&<26>=()[].?\\\"#,;!~<>|<7C>^{}"); U32 pos = dStrcspn(sanitizedStr, "-+*/%$&<26>=()[].?\\\"#,;!~<>|<7C>^{}");
while (pos < dStrlen(sanitizedStr)) while (pos < dStrlen(sanitizedStr))
{ {
dStrcpy(sanitizedStr + pos, sanitizedStr + pos + 1, len - pos); dStrcpy(sanitizedStr + pos, sanitizedStr + pos + 1, (dsize_t)(len - pos));
pos = dStrcspn(sanitizedStr, "-+*/%$&<26>=()[].?\\\"#,;!~<>|<7C>^{}"); pos = dStrcspn(sanitizedStr, "-+*/%$&<26>=()[].?\\\"#,;!~<>|<7C>^{}");
} }
@ -1903,7 +1903,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
//Check to see if our target module has a matching assetId for this slot already based on our trimmed mat name //Check to see if our target module has a matching assetId for this slot already based on our trimmed mat name
testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t"); testAssetId = targetModuleId + ":" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;\t");
bool localAssetFound = false; localAssetFound = false;
if (AssetDatabase.isDeclaredAsset(testAssetId.c_str())) if (AssetDatabase.isDeclaredAsset(testAssetId.c_str()))
localAssetFound = true; localAssetFound = true;
@ -2792,7 +2792,7 @@ void AssetImporter::acquireAssets(AssetImportObject* assetItem)
if (AssetDatabase.isDeclaredAsset(assetId)) if (AssetDatabase.isDeclaredAsset(assetId))
{ {
AssetBase* assetDef = AssetDatabase.acquireAsset<AssetBase>(assetId); AssetDatabase.acquireAsset<AssetBase>(assetId);
AssetDatabase.releaseAsset(assetId); AssetDatabase.releaseAsset(assetId);
} }
} }

View file

@ -1370,48 +1370,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
} }
//Build the buffer for our default material //Build the buffer for our default material
/*if (mVertCount > 0)
{
mVertexBuffer.set(GFX, mVertCount, GFXBufferTypeStatic);
VertexType *pVert = mVertexBuffer.lock();
for (S32 i = 0; i < faceList.size(); i++)
{
if (mSurfaceUVs[i].matID == -1)
{
const ConvexShape::Face &face = faceList[i];
const Vector< U32 > &facePntMap = face.points;
const Vector< ConvexShape::Triangle > &triangles = face.triangles;
const ColorI &faceColor = sgConvexFaceColors[i % sgConvexFaceColorCount];
const Point3F binormal = mCross(face.normal, face.tangent);
pVert++;
}
}
}
}
mVertexBuffer.unlock();
// Allocate PB
mPrimitiveBuffer.set(GFX, mPrimCount * 3, mPrimCount, GFXBufferTypeStatic);
U16 *pIndex;
mPrimitiveBuffer.lock(&pIndex);
for (U16 i = 0; i < mPrimCount * 3; i++)
{
*pIndex = i;
pIndex++;
}
mPrimitiveBuffer.unlock();
}*/
//
//
for (U32 i = 0; i < mSurfaceBuffers.size(); i++) for (U32 i = 0; i < mSurfaceBuffers.size(); i++)
{ {
if (mSurfaceBuffers[i].mVertCount > 0) if (mSurfaceBuffers[i].mVertCount > 0)
@ -1428,7 +1386,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
const ConvexShape::Face &face = faceList[f]; const ConvexShape::Face &face = faceList[f];
const Vector< U32 > &facePntMap = face.points; const Vector< U32 > &facePntMap = face.points;
const Vector< ConvexShape::Triangle > &triangles = face.triangles; const Vector< ConvexShape::Triangle > &triangles = face.triangles;
const ColorI &faceColor = sgConvexFaceColors[f % sgConvexFaceColorCount];
const Point3F binormal = mCross(face.normal, face.tangent); const Point3F binormal = mCross(face.normal, face.tangent);
@ -1439,7 +1396,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
pVert->normal = face.normal; pVert->normal = face.normal;
pVert->T = face.tangent; pVert->T = face.tangent;
pVert->B = mCross(face.normal,face.tangent); pVert->B = mCross(face.normal,face.tangent);
//pVert->color = faceColor;
pVert->point = pointList[facePntMap[triangles[j][k]]]; pVert->point = pointList[facePntMap[triangles[j][k]]];
pVert->texCoord = face.texcoords[triangles[j][k]]; pVert->texCoord = face.texcoords[triangles[j][k]];
pVert->texCoord2 = pVert->texCoord; pVert->texCoord2 = pVert->texCoord;
@ -1469,56 +1425,6 @@ void ConvexShape::_updateGeometry( bool updateCollision )
mSurfaceBuffers[i].mPrimitiveBuffer.unlock(); mSurfaceBuffers[i].mPrimitiveBuffer.unlock();
} }
} }
//
//
/*// Allocate VB and copy in data.
for (S32 i = 0; i < faceList.size(); i++)
{
mVertexBuffer.set(GFX, mVertCount, GFXBufferTypeStatic);
VertexType *pVert = mVertexBuffer.lock();
for (S32 i = 0; i < faceList.size(); i++)
{
const ConvexShape::Face &face = faceList[i];
const Vector< U32 > &facePntMap = face.points;
const Vector< ConvexShape::Triangle > &triangles = face.triangles;
const ColorI &faceColor = sgConvexFaceColors[i % sgConvexFaceColorCount];
const Point3F binormal = mCross(face.normal, face.tangent);
for (S32 j = 0; j < triangles.size(); j++)
{
for (S32 k = 0; k < 3; k++)
{
pVert->normal = face.normal;
pVert->tangent = face.tangent;
pVert->color = faceColor;
pVert->point = pointList[facePntMap[triangles[j][k]]];
pVert->texCoord = face.texcoords[triangles[j][k]];
pVert++;
}
}
}
mVertexBuffer.unlock();
// Allocate PB
mPrimitiveBuffer.set(GFX, mPrimCount * 3, mPrimCount, GFXBufferTypeStatic);
U16 *pIndex;
mPrimitiveBuffer.lock(&pIndex);
for (U16 i = 0; i < mPrimCount * 3; i++)
{
*pIndex = i;
pIndex++;
}
mPrimitiveBuffer.unlock();
}*/
} }
void ConvexShape::_updateCollision() void ConvexShape::_updateCollision()

View file

@ -56,7 +56,7 @@
extern bool gEditingMission; extern bool gEditingMission;
extern ColorI gCanvasClearColor; extern ColorI gCanvasClearColor;
bool ReflectionProbe::smRenderPreviewProbes = true; bool ReflectionProbe::smRenderPreviewProbes = true;
static MatrixF sEditingTransformMat;
IMPLEMENT_CO_NETOBJECT_V1(ReflectionProbe); IMPLEMENT_CO_NETOBJECT_V1(ReflectionProbe);
ConsoleDocClass(ReflectionProbe, ConsoleDocClass(ReflectionProbe,
@ -371,10 +371,10 @@ const MatrixF& ReflectionProbe::getTransform() const
return mObjToWorld; return mObjToWorld;
else else
{ {
MatrixF transformMat = MatrixF::Identity; sEditingTransformMat = MatrixF::Identity;
transformMat.setPosition(mProbeRefOffset); sEditingTransformMat.setPosition(mProbeRefOffset);
return transformMat; return sEditingTransformMat;
} }
} }

View file

@ -112,7 +112,18 @@ public:
bool mCanDamp; bool mCanDamp;
public: public:
ProbeInfo() : mScore(0) {} ProbeInfo()
{
mScore = 0;
mAtten = 0.0f;
mCanDamp = false;
mDirty = false;
mIsEnabled = true;
mObject = NULL;
mPriority = 0;
mProbeShapeType = Box;
mRadius = 10.0f;
}
~ProbeInfo() {} ~ProbeInfo() {}
// Copies data passed in from light // Copies data passed in from light

View file

@ -202,7 +202,7 @@ public:
void remove( DelegateSig dlg ) void remove( DelegateSig dlg )
{ {
for( DelegateLink* ptr = mList.next;ptr != &mList; ptr = ptr->next ) for( DelegateLink* ptr = mList.next;(ptr != &mList)&& (ptr!= NULL); ptr = ptr->next )
{ {
if( DelegateLinkImpl* del = static_cast< DelegateLinkImpl* >( ptr ) ) if( DelegateLinkImpl* del = static_cast< DelegateLinkImpl* >( ptr ) )
{ {

View file

@ -70,7 +70,11 @@ namespace Torque
UUID() UUID()
{ {
dMemset( this, 0, sizeof( UUID ) ); a = b = c = d = e = 0;
for (U32 i = 0; i < 6; i++)
{
f [i]=0;
}
} }
/// ///

View file

@ -2452,9 +2452,9 @@ void MeshRoad::_generateSlices()
profileMat2.setRow(1, slicePtr->uvec); profileMat2.setRow(1, slicePtr->uvec);
profileMat2.setRow(2, slicePtr->fvec); profileMat2.setRow(2, slicePtr->fvec);
for(U32 i = 0; i < 2; i++) for(U32 profile = 0; profile < 2; profile++)
{ {
if(i) if(profile)
mSideProfile.setTransform(profileMat2, slicePtr->p0); mSideProfile.setTransform(profileMat2, slicePtr->p0);
else else
mSideProfile.setTransform(profileMat1, slicePtr->p2); mSideProfile.setTransform(profileMat1, slicePtr->p2);
@ -2470,7 +2470,7 @@ void MeshRoad::_generateSlices()
slicePtr->verts.push_back(pos); slicePtr->verts.push_back(pos);
box.extend( pos ); box.extend( pos );
if(i) if(profile)
slicePtr->pb0 = pos; slicePtr->pb0 = pos;
else else
slicePtr->pb2 = pos; slicePtr->pb2 = pos;

View file

@ -319,7 +319,7 @@ void SkySphere::_initRender()
U32 height = 16; U32 height = 16;
U32 radius = 1; U32 radius = 1;
F32 x, y, z, xy; // vertex position F32 x, y; // vertex position
F32 nx, ny, nz, lengthInv = 1.0f / radius; // normal F32 nx, ny, nz, lengthInv = 1.0f / radius; // normal
F32 s, t; // texCoord F32 s, t; // texCoord

View file

@ -107,7 +107,8 @@ public:
{ {
Point3F pos; Point3F pos;
Point3F nor; Point3F nor;
F32 s, t; F32 s = 0.0f;
F32 t = 0.0f;
}; };
Vector<SphereVertex> tmpVertices; Vector<SphereVertex> tmpVertices;
@ -119,8 +120,8 @@ public:
{ {
Point3F pos; Point3F pos;
Point3F nor; Point3F nor;
F32 s; F32 s = 0.0f;
F32 t; F32 t = 0.0f;
}; };
Vector<FinalVertexData> finalVertData; Vector<FinalVertexData> finalVertData;

View file

@ -150,7 +150,7 @@ static bool sReadJPG(Stream &stream, GBitmap *bitmap)
U8* pBase = (U8*)bitmap->getBits(); U8* pBase = (U8*)bitmap->getBits();
for (U32 i = 0; i < bitmap->getHeight(); i++) for (U32 i = 0; i < bitmap->getHeight(); i++)
{ {
JSAMPROW rowPointer = pBase + (i * rowBytes); JSAMPROW rowPointer = pBase + (U64)(i * rowBytes);
jpeg_read_scanlines(&cinfo, &rowPointer, 1); jpeg_read_scanlines(&cinfo, &rowPointer, 1);
} }

View file

@ -357,7 +357,6 @@ void GFXGLCubemapArray::init(GFXCubemapHandle *cubemaps, const U32 cubemapCount)
const U32 mipSize = getMax(U32(1), mSize >> currentMip); const U32 mipSize = getMax(U32(1), mSize >> currentMip);
if (isCompressed) if (isCompressed)
{ {
const U32 mipDataSize = getCompressedSurfaceSize(mFormat, mSize, mSize, currentMip);
glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, i * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData); glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, i * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData);
} }
else else
@ -378,7 +377,6 @@ void GFXGLCubemapArray::init(const U32 cubemapCount, const U32 cubemapFaceSize,
setCubeTexSize(cubemapFaceSize); setCubeTexSize(cubemapFaceSize);
mFormat = format; mFormat = format;
mNumCubemaps = cubemapCount; mNumCubemaps = cubemapCount;
const bool isCompressed = ImageUtil::isCompressedFormat(mFormat);
glGenTextures(1, &mCubemap); glGenTextures(1, &mCubemap);
PRESERVE_CUBEMAP_ARRAY_TEXTURE(); PRESERVE_CUBEMAP_ARRAY_TEXTURE();
@ -416,7 +414,6 @@ void GFXGLCubemapArray::updateTexture(const GFXCubemapHandle &cubemap, const U32
const U32 mipSize = getMax(U32(1), mSize >> currentMip); const U32 mipSize = getMax(U32(1), mSize >> currentMip);
if (isCompressed) if (isCompressed)
{ {
const U32 mipDataSize = getCompressedSurfaceSize(mFormat, mSize, mSize, currentMip);
glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, slot * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData); glCompressedTexSubImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, currentMip, 0, 0, slot * 6 + face, mipSize, mipSize, 1, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], pixelData);
} }
else else

View file

@ -118,7 +118,6 @@ void GuiGameSettingsCtrl::onRender(Point2I offset, const RectI &updateRect)
Point2I iconExtent, iconOffset(0.0f, 0.0f); Point2I iconExtent, iconOffset(0.0f, 0.0f);
bool highlight = mHighlighted; bool highlight = mHighlighted;
bool depressed = mDepressed;
ColorI fontColor = mActive ? (highlight ? mProfile->mFontColorHL : mProfile->mFontColor) : mProfile->mFontColorNA; ColorI fontColor = mActive ? (highlight ? mProfile->mFontColorHL : mProfile->mFontColor) : mProfile->mFontColorNA;
ColorI fillColor = mActive ? (highlight ? mProfile->mFillColorHL : mProfile->mFillColor) : mProfile->mFillColorNA; ColorI fillColor = mActive ? (highlight ? mProfile->mFillColorHL : mProfile->mFillColor) : mProfile->mFillColorNA;
@ -182,52 +181,51 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset)
bool hasOptions = (mOptions.size() > 0) && mSelectedOption > -1; bool hasOptions = (mOptions.size() > 0) && mSelectedOption > -1;
if (hasOptions) if (hasOptions)
{ {
if (mPreviousBitmapAsset.notNull()) // do we render the left or right arrows?
bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
bool arrowOnR = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption < mOptions.size() - 1));
if (arrowOnL)
{ {
// render the left arrow if (mPreviousBitmapAsset.notNull())
bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0)); {
arrowOffset.x = currentOffset.x + mColumnSplit; arrowOffset.x = currentOffset.x + mColumnSplit;
arrowOffset.y = currentOffset.y + arrowOffsetY; arrowOffset.y = currentOffset.y + arrowOffsetY;
drawer->clearBitmapModulation(); drawer->clearBitmapModulation();
drawer->drawBitmapStretch(mPreviousBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false); drawer->drawBitmapStretch(mPreviousBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
}
else
{
arrowOffset.x = currentOffset.x + mColumnSplit;
arrowOffset.y = currentOffset.y + height / 2;
drawer->clearBitmapModulation();
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y), ColorI::WHITE);
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y + height), ColorI::WHITE);
}
} }
else if (arrowOnR)
{ {
// render the left arrow if (mNextBitmapAsset.notNull())
bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0)); {
arrowOffset.x = currentOffset.x + mColumnSplit; arrowOffset.x = currentOffset.x + getWidth() - mRightPad - mArrowSize;
arrowOffset.y = currentOffset.y + height/2; arrowOffset.y = currentOffset.y + arrowOffsetY;
drawer->clearBitmapModulation(); drawer->clearBitmapModulation();
drawer->drawBitmapStretch(mNextBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
}
else
{
arrowOffset.x = currentOffset.x + getWidth() - mRightPad;
arrowOffset.y = currentOffset.y + height / 2;
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y), ColorI::WHITE); drawer->clearBitmapModulation();
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y + height), ColorI::WHITE);
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y), ColorI::WHITE);
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y + height), ColorI::WHITE);
}
} }
if (mNextBitmapAsset.notNull())
{
// render the right arrow
bool arrowOnR = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption < mOptions.size() - 1));
arrowOffset.x = currentOffset.x + getWidth() - mRightPad - mArrowSize;
arrowOffset.y = currentOffset.y + arrowOffsetY;
drawer->clearBitmapModulation();
drawer->drawBitmapStretch(mNextBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
}
else
{
// render the left arrow
bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
arrowOffset.x = currentOffset.x + getWidth() - mRightPad;
arrowOffset.y = currentOffset.y + height / 2;
drawer->clearBitmapModulation();
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y), ColorI::WHITE);
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y + height), ColorI::WHITE);
}
// get the appropriate font color // get the appropriate font color
ColorI fontColor; ColorI fontColor;
if (!mEnabled) if (!mEnabled)
@ -265,65 +263,13 @@ void GuiGameSettingsCtrl::onRenderListOption(Point2I currentOffset)
void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset) void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
{ {
F32 xScale = (float)getWidth();
S32 height = getHeight(); S32 height = getHeight();
S32 arrowOffsetY = 0;
GFXDrawUtil* drawer = GFX->getDrawUtil(); GFXDrawUtil* drawer = GFX->getDrawUtil();
Point2I arrowOffset; //Point2I arrowOffset;
S32 columnSplit = mColumnSplit; S32 columnSplit = mColumnSplit;
/*if (mPreviousBitmapAsset.notNull())
{
// render the left arrow
bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
arrowOffset.x = currentOffset.x + columnSplit;
arrowOffset.y = currentOffset.y + arrowOffsetY;
drawer->clearBitmapModulation();
drawer->drawBitmapStretch(mPreviousBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
}
else
{
// render the left arrow
bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
arrowOffset.x = currentOffset.x + mColumnSplit;
arrowOffset.y = currentOffset.y + height / 2;
drawer->clearBitmapModulation();
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y), ColorI::WHITE);
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x + mArrowSize, currentOffset.y + height), ColorI::WHITE);
}
if (mNextBitmapAsset.notNull())
{
// render the right arrow
bool arrowOnR = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption < mOptions.size() - 1));
arrowOffset.x = currentOffset.x + mRightPad * xScale - mArrowSize;
arrowOffset.y = currentOffset.y + arrowOffsetY;
drawer->clearBitmapModulation();
drawer->drawBitmapStretch(mNextBitmap, RectI(arrowOffset, Point2I(mArrowSize, mArrowSize)), GFXBitmapFlip_None, GFXTextureFilterLinear, false);
}
else
{
// render the left arrow
bool arrowOnL = (isSelected() || isHighlighted()) && (mWrapOptions || (mSelectedOption > 0));
arrowOffset.x = currentOffset.x + getWidth() - mRightPad;
arrowOffset.y = currentOffset.y + height / 2;
drawer->clearBitmapModulation();
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y), ColorI::WHITE);
drawer->drawLine(arrowOffset, Point2I(arrowOffset.x - mArrowSize, currentOffset.y + height), ColorI::WHITE);
}*/
//Draw the slider bar //Draw the slider bar
RectI sliderRect; RectI sliderRect;
@ -389,13 +335,10 @@ void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
fontColor = mProfile->mFontColor; fontColor = mProfile->mFontColor;
} }
// calculate text to be at the center between the arrows
GFont* font = mProfile->mFont;
char stringVal[32]; char stringVal[32];
dSprintf(stringVal, 32, "%.1f", mValue); dSprintf(stringVal, 32, "%.1f", mValue);
S32 stringWidth = font->getStrWidth(stringVal); //S32 stringWidth = font->getStrWidth(stringVal); //adaptive width
Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0); Point2I textOffset(sliderRect.point.x + sliderRect.extent.x, 0);
// render the option text itself // render the option text itself
@ -413,7 +356,6 @@ void GuiGameSettingsCtrl::onRenderSliderOption(Point2I currentOffset)
void GuiGameSettingsCtrl::onRenderKeybindOption(Point2I currentOffset) void GuiGameSettingsCtrl::onRenderKeybindOption(Point2I currentOffset)
{ {
F32 xScale = (float)getWidth();
S32 columnSplit = mColumnSplit; S32 columnSplit = mColumnSplit;
S32 height = getHeight(); S32 height = getHeight();
@ -696,8 +638,6 @@ void GuiGameSettingsCtrl::addOption(const char* displayText, const char* keyText
void GuiGameSettingsCtrl::clickOption(S32 xPos) void GuiGameSettingsCtrl::clickOption(S32 xPos)
{ {
F32 xScale = (float)getWidth();
S32 leftArrowX1 = mColumnSplit; S32 leftArrowX1 = mColumnSplit;
S32 leftArrowX2 = leftArrowX1 + mArrowSize; S32 leftArrowX2 = leftArrowX1 + mArrowSize;
@ -814,8 +754,6 @@ void GuiGameSettingsCtrl::clickSlider(S32 xPos)
void GuiGameSettingsCtrl::clickKeybind(S32 xPos) void GuiGameSettingsCtrl::clickKeybind(S32 xPos)
{ {
S32 columnSplit = mColumnSplit;
S32 height = getHeight(); S32 height = getHeight();
S32 width = getWidth(); S32 width = getWidth();

View file

@ -573,8 +573,8 @@ void DeferredSubSurfaceGLSL::processPix( Vector<ShaderComponent*> &componentLis
subSurfaceParams->uniform = true; subSurfaceParams->uniform = true;
subSurfaceParams->constSortPos = cspPotentialPrimitive; subSurfaceParams->constSortPos = cspPotentialPrimitive;
Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" ); //Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" );
Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" ); //Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
MultiLine *meta = new MultiLine; MultiLine *meta = new MultiLine;
Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget)); Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));

View file

@ -613,8 +613,8 @@ void DeferredSubSurfaceHLSL::processPix( Vector<ShaderComponent*> &componentLis
subSurfaceParams->uniform = true; subSurfaceParams->uniform = true;
subSurfaceParams->constSortPos = cspPotentialPrimitive; subSurfaceParams->constSortPos = cspPotentialPrimitive;
Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" ); //Var *d_lightcolor = (Var*)LangElement::find( "d_lightcolor" );
Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" ); //Var *d_NL_Att = (Var*)LangElement::find( "d_NL_Att" );
MultiLine *meta = new MultiLine; MultiLine *meta = new MultiLine;
Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget)); Var* targ = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));

View file

@ -56,7 +56,10 @@ struct SceneData
/// @afxRenderHighlightMgr /// @afxRenderHighlightMgr
HighlightBin, HighlightBin,
}; };
enum
{
MAX_LIGHTS = 8
};
/// This defines when we're rendering a special bin /// This defines when we're rendering a special bin
/// type that the material or lighting system needs /// type that the material or lighting system needs
/// to know about. /// to know about.
@ -71,7 +74,7 @@ struct SceneData
/// The current lights to use in rendering /// The current lights to use in rendering
/// in order of the light importance. /// in order of the light importance.
LightInfo* lights[8]; LightInfo* lights[MAX_LIGHTS];
/// ///
LinearColorF ambientLightColor; LinearColorF ambientLightColor;
@ -98,9 +101,24 @@ struct SceneData
Vector<CustomShaderBindingData*> customShaderData; Vector<CustomShaderBindingData*> customShaderData;
/// Constructor. /// Constructor.
SceneData() SceneData()
{ {
dMemset( this, 0, sizeof( SceneData ) ); accuTex = NULL;
backBuffTex = NULL;
binType = RegularBin;
cubemap = NULL;
fogDensity = 0.0f;
fogDensityOffset = 0.0f;
fogHeightFalloff = 0.0f;
lightmap = NULL;
for (U32 i = 0; i < MAX_LIGHTS; i++)
{
lights[i] = NULL;
}
materialHint = NULL;
miscTex = NULL;
reflectTex = NULL;
wireframe = false;
objTrans = &MatrixF::Identity; objTrans = &MatrixF::Identity;
visibility = 1.0f; visibility = 1.0f;
} }

View file

@ -61,7 +61,7 @@ class ThreadSafeRefCount
ThreadSafeRefCount() ThreadSafeRefCount()
: mRefCount( 0 ) {} : mRefCount( 0 ) {}
ThreadSafeRefCount( bool noSet ) {} ThreadSafeRefCount( bool noSet ) : mRefCount(0) {}
bool isShared() const; bool isShared() const;
U32 getRefCount() const; U32 getRefCount() const;

View file

@ -78,7 +78,7 @@ static void detectCpuFeatures(Platform::SystemInfo_struct::Processor &processor)
{ {
S32 cpuInfo[4]; S32 cpuInfo[4];
__cpuid(cpuInfo, 1); __cpuid(cpuInfo, 1);
U32 eax = cpuInfo[0]; // eax //U32 eax = cpuInfo[0]; // eax
U32 edx = cpuInfo[3]; // edx U32 edx = cpuInfo[3]; // edx
U32 ecx = cpuInfo[2]; // ecx U32 ecx = cpuInfo[2]; // ecx

View file

@ -77,7 +77,7 @@ S32 SFXALDevice::getMaxSources()
S32 SFXALDevice::getMaxSourcesOld() S32 SFXALDevice::getMaxSourcesOld()
{ {
ALuint uiSource[256]; ALuint uiSource[256] = {};
S32 sourceCount = 0; S32 sourceCount = 0;
// clear errors. // clear errors.
@ -148,7 +148,7 @@ SFXALDevice::SFXALDevice( SFXProvider *provider,
#if defined(AL_ALEXT_PROTOTYPES) #if defined(AL_ALEXT_PROTOTYPES)
mOpenAL.alcGetIntegerv(mDevice, ALC_MAX_AUXILIARY_SENDS, 1, &iSends); mOpenAL.alcGetIntegerv(mDevice, ALC_MAX_AUXILIARY_SENDS, 1, &iSends);
#endif #endif
U32 err = mOpenAL.alcGetError( mDevice ); err = mOpenAL.alcGetError( mDevice );
if( err != ALC_NO_ERROR ) if( err != ALC_NO_ERROR )
Con::errorf( "SFXALDevice - Context Initialization Error: %s", mOpenAL.alcGetString( mDevice, err ) ); Con::errorf( "SFXALDevice - Context Initialization Error: %s", mOpenAL.alcGetString( mDevice, err ) );

View file

@ -60,7 +60,7 @@ MODULE_BEGIN( OpenAL )
MODULE_INIT_BEFORE( SFX ) MODULE_INIT_BEFORE( SFX )
MODULE_SHUTDOWN_AFTER( SFX ) MODULE_SHUTDOWN_AFTER( SFX )
SFXALProvider* mProvider; SFXALProvider* mProvider = NULL;
MODULE_INIT MODULE_INIT
{ {
@ -91,9 +91,8 @@ void SFXALProvider::init()
} }
// Cool, loop through them, and caps em // Cool, loop through them, and caps em
const char *deviceFormat = "OpenAL v%d.%d %s"; //const char *deviceFormat = "OpenAL v%d.%d %s";
char temp[256];
for( S32 i = 0; i < mALDL->GetNumDevices(); i++ ) for( S32 i = 0; i < mALDL->GetNumDevices(); i++ )
{ {
ALDeviceInfo* info = new ALDeviceInfo; ALDeviceInfo* info = new ALDeviceInfo;

View file

@ -37,8 +37,8 @@ struct SFXDeviceInfo
String driver; String driver;
String internalName; String internalName;
String name; String name;
bool hasHardware; bool hasHardware = false;
S32 maxBuffers; S32 maxBuffers =0;
virtual ~SFXDeviceInfo() {} virtual ~SFXDeviceInfo() {}
}; };

View file

@ -1620,7 +1620,6 @@ DefineEngineFunction( sfxPlayOnce, S32, (StringTableEntry assetId, const char* a
"Create a new play-once source for the given profile or description+filename and start playback of the source.\n" "Create a new play-once source for the given profile or description+filename and start playback of the source.\n"
"@hide" ) "@hide" )
{ {
SFXDescription* description = NULL;
if (assetId == StringTable->EmptyString()) if (assetId == StringTable->EmptyString())
{ {
Con::errorf( "sfxPlayOnce - Must Define a sound asset"); Con::errorf( "sfxPlayOnce - Must Define a sound asset");

View file

@ -184,7 +184,7 @@ void CustomFeatureGLSL::addVariable(String name, String type, String defaultValu
void CustomFeatureGLSL::addConnector(String name, String type, String elementName) void CustomFeatureGLSL::addConnector(String name, String type, String elementName)
{ {
// grab connector texcoord register // grab connector texcoord register
ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]); //ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]);
//Get element //Get element
S32 element = -1; S32 element = -1;

View file

@ -2139,16 +2139,8 @@ void RTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] ) if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
return; return;
ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
MultiLine *meta = new MultiLine; MultiLine *meta = new MultiLine;
// Now the wsPosition and wsView.
Var *wsPosition = getInWsPosition( componentList );
Var* worldToTangent = getInWorldToTangent(componentList);
Var* wsNormal = getInWorldNormal(componentList);
Var *wsView = getWsView( wsPosition, meta );
// Look for a light mask generated from a previous // Look for a light mask generated from a previous
// feature (this is done for BL terrain lightmaps). // feature (this is done for BL terrain lightmaps).
LangElement *lightMask = LangElement::find( "lightMask" ); LangElement *lightMask = LangElement::find( "lightMask" );
@ -2202,10 +2194,7 @@ void RTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
{ {
Con::errorf("ShaderGen::RTLightingFeatGLSL() - failed to generate surface!"); Con::errorf("ShaderGen::RTLightingFeatGLSL() - failed to generate surface!");
return; return;
} }
Var *roughness = (Var*)LangElement::find("roughness");
Var *metalness = (Var*)LangElement::find("metalness");
Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget)); Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
@ -2957,16 +2946,8 @@ void ReflectionProbeFeatGLSL::processPix(Vector<ShaderComponent*>& componentList
if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit]) if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
return; return;
ShaderConnector * connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
MultiLine * meta = new MultiLine; MultiLine * meta = new MultiLine;
// Now the wsPosition and wsView.
Var *wsPosition = getInWsPosition(componentList);
Var *worldToTangent = getInWorldToTangent(componentList);
Var *wsNormal = getInWorldNormal(componentList);
Var *wsView = getWsView(wsPosition, meta);
//Reflection Probe WIP //Reflection Probe WIP
U32 MAX_FORWARD_PROBES = 4; U32 MAX_FORWARD_PROBES = 4;

View file

@ -201,7 +201,7 @@ void CustomFeatureHLSL::addVariable(String name, String type, String defaultValu
void CustomFeatureHLSL::addConnector(String name, String type, String elementName) void CustomFeatureHLSL::addConnector(String name, String type, String elementName)
{ {
// grab connector texcoord register // grab connector texcoord register
ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]); //ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(mComponentList[C_CONNECTOR]);
//Get element //Get element
S32 element = -1; S32 element = -1;

View file

@ -122,19 +122,6 @@ void DebugVizHLSL::processPix(Vector<ShaderComponent*>& componentList,
if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit]) if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
return; return;
ShaderConnector* connectComp = dynamic_cast<ShaderConnector*>(componentList[C_CONNECTOR]);
MultiLine* meta = new MultiLine;
// Now the wsPosition and wsView.
Var* worldToTangent = getInWorldToTangent(componentList);
Var* wsNormal = getInWorldNormal(componentList);
Var* wsPosition = getInWsPosition(componentList);
Var* wsView = getWsView(wsPosition, meta);
//Reflection Probe WIP
U32 MAX_FORWARD_PROBES = 4;
Var* numProbes = (Var*)LangElement::find("inNumProbes"); Var* numProbes = (Var*)LangElement::find("inNumProbes");
Var* cubeMips = (Var*)LangElement::find("cubeMips"); Var* cubeMips = (Var*)LangElement::find("cubeMips");
Var* skylightCubemapIdx = (Var*)LangElement::find("inSkylightCubemapIdx"); Var* skylightCubemapIdx = (Var*)LangElement::find("inSkylightCubemapIdx");
@ -146,21 +133,10 @@ void DebugVizHLSL::processPix(Vector<ShaderComponent*>& componentList,
Var* worldToObjArray = (Var*)LangElement::find("inWorldToObjArray"); Var* worldToObjArray = (Var*)LangElement::find("inWorldToObjArray");
Var* BRDFTexture = (Var*)LangElement::find("BRDFTexture"); Var* BRDFTexture = (Var*)LangElement::find("BRDFTexture");
Var* BRDFTextureTex = (Var*)LangElement::find("texture_BRDFTexture");
Var* specularCubemapAR = (Var*)LangElement::find("SpecularCubemapAR"); Var* specularCubemapAR = (Var*)LangElement::find("SpecularCubemapAR");
Var* specularCubemapARTex = (Var*)LangElement::find("texture_SpecularCubemapAR");
Var* irradianceCubemapAR = (Var*)LangElement::find("IrradianceCubemapAR"); Var* irradianceCubemapAR = (Var*)LangElement::find("IrradianceCubemapAR");
Var* irradianceCubemapARTex = (Var*)LangElement::find("texture_IrradianceCubemapAR");
Var* matinfo = (Var*)LangElement::find("ORMConfig");
Var* metalness = (Var*)LangElement::find("metalness");
Var* roughness = (Var*)LangElement::find("roughness");
Var* wsEyePos = (Var*)LangElement::find("eyePosWorld");
Var* ibl = (Var*)LangElement::find("ibl");
//Reflection vec //Reflection vec
Var* showAttenVar = new Var("showAttenVar", "int"); Var* showAttenVar = new Var("showAttenVar", "int");

View file

@ -2217,16 +2217,10 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] ) if ( fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit] )
return; return;
ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] ); //ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>( componentList[C_CONNECTOR] );
MultiLine *meta = new MultiLine; MultiLine *meta = new MultiLine;
// Now the wsPosition and wsView.
Var *wsPosition = getInWsPosition( componentList );
Var* worldToTangent = getInWorldToTangent(componentList);
Var* wsNormal = getInWorldNormal(componentList);
Var *wsView = getWsView( wsPosition, meta );
// Look for a light mask generated from a previous // Look for a light mask generated from a previous
// feature (this is done for BL terrain lightmaps). // feature (this is done for BL terrain lightmaps).
LangElement *lightMask = LangElement::find( "lightMask" ); LangElement *lightMask = LangElement::find( "lightMask" );
@ -2280,10 +2274,7 @@ void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
{ {
Con::errorf("ShaderGen::RTLightingFeatHLSL() - failed to generate surface!"); Con::errorf("ShaderGen::RTLightingFeatHLSL() - failed to generate surface!");
return; return;
} }
Var *roughness = (Var*)LangElement::find("roughness");
Var *metalness = (Var*)LangElement::find("metalness");
Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget)); Var *curColor = (Var*)LangElement::find(getOutputTargetVarName(ShaderFeature::DefaultTarget));
@ -3035,16 +3026,10 @@ void ReflectionProbeFeatHLSL::processPix(Vector<ShaderComponent*> &componentList
if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit]) if (fd.features[MFT_LightMap] || fd.features[MFT_ToneMap] || fd.features[MFT_VertLit])
return; return;
ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>(componentList[C_CONNECTOR]); //ShaderConnector *connectComp = dynamic_cast<ShaderConnector *>(componentList[C_CONNECTOR]);
MultiLine *meta = new MultiLine; MultiLine *meta = new MultiLine;
// Now the wsPosition and wsView.
Var* wsPosition = getInWsPosition(componentList);
Var* worldToTangent = getInWorldToTangent(componentList);
Var *wsNormal = getInWorldNormal(componentList);
Var *wsView = getWsView(wsPosition, meta);
//Reflection Probe WIP //Reflection Probe WIP
U32 MAX_FORWARD_PROBES = 4; U32 MAX_FORWARD_PROBES = 4;

View file

@ -130,8 +130,8 @@ public:
//************************************************************************** //**************************************************************************
struct Resources struct Resources
{ {
U32 numTex; U32 numTex = 0;
U32 numTexReg; U32 numTexReg = 0;
Resources() Resources()
{ {

View file

@ -347,8 +347,6 @@ void TerrainBaseMapFeatGLSL::processPix( Vector<ShaderComponent*> &componentLis
meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig)); meta->addStatement(new GenOp(" @ = float4(1.0f/255.0f, 1.0, 1.0, 0.0);\r\n", ormConfig));
output = meta; output = meta;
Var* viewToTangent = getInViewToTangent(componentList);
} }
ShaderFeature::Resources TerrainBaseMapFeatGLSL::getResources( const MaterialFeatureData &fd ) ShaderFeature::Resources TerrainBaseMapFeatGLSL::getResources( const MaterialFeatureData &fd )
@ -544,9 +542,6 @@ void TerrainDetailMapFeatGLSL::processPix( Vector<ShaderComponent*> &component
// Get the detail id. // Get the detail id.
Var *detailInfo = _getDetailIdStrengthParallax(); Var *detailInfo = _getDetailIdStrengthParallax();
// This is done here to make sure the macro arrays are the correct size
Var* macroInfo = _getMacroIdStrengthParallax();
// Create the detail blend var. // Create the detail blend var.
Var *detailBlend = new Var; Var *detailBlend = new Var;
detailBlend->setType( "float" ); detailBlend->setType( "float" );
@ -1324,7 +1319,6 @@ void TerrainHeightMapBlendGLSL::processPix(Vector<ShaderComponent*>& componentLi
{ {
for (S32 idx = 0; idx < detailCount; ++idx) for (S32 idx = 0; idx < detailCount; ++idx)
{ {
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", idx));
Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx)); Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx));
Var* blendHardness = (Var*)LangElement::find(String::ToString("blendHardness%d", idx)); Var* blendHardness = (Var*)LangElement::find(String::ToString("blendHardness%d", idx));
if (!blendHardness) if (!blendHardness)

View file

@ -624,7 +624,7 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
Var *detailInfo = _getDetailIdStrengthParallax(); Var *detailInfo = _getDetailIdStrengthParallax();
// Done here to keep array indexes aligned // Done here to keep array indexes aligned
Var* macroInfo = _getMacroIdStrengthParallax(); _getMacroIdStrengthParallax();
// Create the detail blend var. // Create the detail blend var.
Var *detailBlend = new Var; Var *detailBlend = new Var;
@ -1414,7 +1414,6 @@ void TerrainHeightMapBlendHLSL::processPix(Vector<ShaderComponent*>& componentLi
{ {
for (S32 idx = 0; idx < detailCount; ++idx) for (S32 idx = 0; idx < detailCount; ++idx)
{ {
Var* detailBlend = (Var*)LangElement::find(String::ToString("detailBlend%d", idx));
Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx)); Var* detailH = (Var*)LangElement::find(String::ToString("detailH%d", idx));
Var* blendHardness = (Var*)LangElement::find(String::ToString("blendHardness%d", idx)); Var* blendHardness = (Var*)LangElement::find(String::ToString("blendHardness%d", idx));
if (!blendHardness) if (!blendHardness)

View file

@ -1172,7 +1172,7 @@ void TerrainBlock::_updatePhysics()
SAFE_DELETE( mPhysicsRep ); SAFE_DELETE( mPhysicsRep );
PhysicsCollision *colShape; PhysicsCollision *colShape = NULL;
// If we can steal the collision shape from the local server // If we can steal the collision shape from the local server
// object then do so as it saves us alot of cpu time and memory. // object then do so as it saves us alot of cpu time and memory.
@ -1187,22 +1187,31 @@ void TerrainBlock::_updatePhysics()
} }
else else
{ {
// Get empty state of each vert if (getBlockSize() > 0)
bool *holes = new bool[ getBlockSize() * getBlockSize() ]; {
for ( U32 row = 0; row < getBlockSize(); row++ ) // Get empty state of each vert
for ( U32 column = 0; column < getBlockSize(); column++ ) bool* holes = new bool[getBlockSize() * getBlockSize()];
holes[ row + (column * getBlockSize()) ] = mFile->isEmptyAt( row, column ); for (U32 row = 0; row < getBlockSize(); row++)
for (U32 column = 0; column < getBlockSize(); column++)
holes[row + (column * getBlockSize())] = mFile->isEmptyAt(row, column);
colShape = PHYSICSMGR->createCollision(); colShape = PHYSICSMGR->createCollision();
colShape->addHeightfield( mFile->getHeightMap().address(), holes, getBlockSize(), mSquareSize, MatrixF::Identity ); colShape->addHeightfield(mFile->getHeightMap().address(), holes, getBlockSize(), mSquareSize, MatrixF::Identity);
delete [] holes; delete[] holes;
}
}
if (getBlockSize() > 0)
{
PhysicsWorld* world = PHYSICSMGR->getWorld(isServerObject() ? "server" : "client");
mPhysicsRep = PHYSICSMGR->createBody();
mPhysicsRep->init(colShape, 0, 0, this, world);
mPhysicsRep->setTransform(getTransform());
}
else
{
SAFE_DELETE(mPhysicsRep);
} }
PhysicsWorld *world = PHYSICSMGR->getWorld( isServerObject() ? "server" : "client" );
mPhysicsRep = PHYSICSMGR->createBody();
mPhysicsRep->init( colShape, 0, 0, this, world );
mPhysicsRep->setTransform( getTransform() );
} }
void TerrainBlock::onRemove() void TerrainBlock::onRemove()
@ -1470,7 +1479,6 @@ bool TerrainBlock::renameTerrainMaterial(StringTableEntry oldMatName, StringTabl
{ {
if (mFile->mMaterials[i]->getInternalName() == oldMatName) if (mFile->mMaterials[i]->getInternalName() == oldMatName)
{ {
TerrainMaterial* oldMat = mFile->mMaterials[i];
mFile->mMaterials[i] = newMat; mFile->mMaterials[i] = newMat;
} }
} }

View file

@ -224,8 +224,7 @@ void TSLastDetail::update( bool forceUpdate )
// Do we need to update the imposter? // Do we need to update the imposter?
const String diffuseMapPath = _getDiffuseMapPath(); const String diffuseMapPath = _getDiffuseMapPath();
bool isFile = Platform::isFile(diffuseMapPath.c_str()); bool isFile = Platform::isFile(diffuseMapPath.c_str());
if ( forceUpdate || !Platform::isFile(diffuseMapPath.c_str()) || if ( forceUpdate || !isFile || Platform::compareModifiedTimes( diffuseMapPath, shapeFile ) <= 0 )
Platform::compareModifiedTimes( diffuseMapPath, shapeFile ) <= 0 )
_update(); _update();
// If the time check fails now then the update must have not worked. // If the time check fails now then the update must have not worked.

View file

@ -294,8 +294,6 @@ void TSShapeInstance::reSkin( String newBaseName, String oldBaseName )
if ( newBaseName.equal( oldBaseName, String::NoCase ) ) if ( newBaseName.equal( oldBaseName, String::NoCase ) )
return; return;
const U32 oldBaseNameLength = oldBaseName.length();
// Make our own copy of the materials list from the resource if necessary // Make our own copy of the materials list from the resource if necessary
if (ownMaterialList() == false) if (ownMaterialList() == false)
cloneMaterialList(); cloneMaterialList();

View file

@ -740,25 +740,25 @@ class TSThread
/// if in transition... /// if in transition...
struct TransitionData struct TransitionData
{ {
bool inTransition; bool inTransition = false;
F32 duration; F32 duration = 0.0f;
F32 pos; F32 pos = 0.0f;
F32 direction; F32 direction = 1.0f;
F32 targetScale; ///< time scale for sequence we are transitioning to (during transition only) F32 targetScale = 1.0f; ///< time scale for sequence we are transitioning to (during transition only)
///< this is either 1 or 0 (if 1 target sequence plays as we transition, if 0 it doesn't) ///< this is either 1 or 0 (if 1 target sequence plays as we transition, if 0 it doesn't)
TSIntegerSet oldRotationNodes; ///< nodes controlled by this thread pre-transition TSIntegerSet oldRotationNodes; ///< nodes controlled by this thread pre-transition
TSIntegerSet oldTranslationNodes; ///< nodes controlled by this thread pre-transition TSIntegerSet oldTranslationNodes; ///< nodes controlled by this thread pre-transition
TSIntegerSet oldScaleNodes; ///< nodes controlled by this thread pre-transition TSIntegerSet oldScaleNodes; ///< nodes controlled by this thread pre-transition
U32 oldSequence; ///< sequence that was set before transition began U32 oldSequence = 0; ///< sequence that was set before transition began
F32 oldPos; ///< position of sequence before transition began F32 oldPos = 0.0f; ///< position of sequence before transition began
} transitionData; } transitionData;
struct struct
{ {
F32 start; F32 start = 0.0f;
F32 end; F32 end = 0.0f;
S32 loop; S32 loop = 0.0f;
} path; } path;
bool makePath; bool makePath;
@ -781,7 +781,18 @@ class TSThread
/// @} /// @}
TSThread(TSShapeInstance*); TSThread(TSShapeInstance*);
TSThread() {} TSThread() {
blendDisabled = true;
keyNum1 = 0;
keyNum2 = 0;
keyPos = 0;
mSeqPos = 0;
mShapeInstance = NULL;
makePath = NULL;
priority = 0;
sequence = 0;
timeScale = 1.0f;
}
void setSequence(S32 seq, F32 pos); void setSequence(S32 seq, F32 pos);
void transitionToSequence(S32 seq, F32 pos, F32 duration, bool continuePlay); void transitionToSequence(S32 seq, F32 pos, F32 duration, bool continuePlay);

View file

@ -109,7 +109,7 @@ protected:
mSuppressReset = false; mSuppressReset = false;
mOffscreenRender = false; mOffscreenRender = false;
mDisplayWindow = false; mDisplayWindow = false;
mWindowId = 0;
// This controller maps window input (Mouse/Keyboard) to a generic input consumer // This controller maps window input (Mouse/Keyboard) to a generic input consumer
mWindowInputGenerator = new WindowInputGenerator( this ); mWindowInputGenerator = new WindowInputGenerator( this );
} }

View file

@ -66,10 +66,10 @@ class WindowInputGenerator
/// Accelerator key map /// Accelerator key map
struct AccKeyMap struct AccKeyMap
{ {
void *hnd; void *hnd = NULL;
String cmd; String cmd;
U32 keyCode; U32 keyCode = 0x000;
U32 modifier; U32 modifier = 0x000;
}; };
Vector <AccKeyMap> mAcceleratorMap; Vector <AccKeyMap> mAcceleratorMap;
@ -128,4 +128,4 @@ class WindowInputGenerator
} }
}; };
#endif // _WINDOW_INPUTGENERATOR_H_ #endif // _WINDOW_INPUTGENERATOR_H_