Merge pull request #1379 from Azaezel/C4189

C4189 warning cleanups
This commit is contained in:
Areloch 2015-09-02 19:46:28 -05:00
commit b1d2ba8412
8 changed files with 16 additions and 21 deletions

View file

@ -258,7 +258,6 @@ void IfStmtNode::propagateSwitchExpr(ExprNode *left, bool string)
U32 IfStmtNode::compileStmt(CodeStream &codeStream, U32 ip) U32 IfStmtNode::compileStmt(CodeStream &codeStream, U32 ip)
{ {
U32 start = ip;
U32 endifIp, elseIp; U32 endifIp, elseIp;
addBreakLine(codeStream); addBreakLine(codeStream);
@ -340,7 +339,6 @@ U32 LoopStmtNode::compileStmt(CodeStream &codeStream, U32 ip)
addBreakLine(codeStream); addBreakLine(codeStream);
codeStream.pushFixScope(true); codeStream.pushFixScope(true);
U32 start = ip;
if(initExpr) if(initExpr)
ip = initExpr->compile(codeStream, ip, TypeReqNone); ip = initExpr->compile(codeStream, ip, TypeReqNone);
@ -1565,8 +1563,6 @@ U32 FunctionDeclStmtNode::compileStmt(CodeStream &codeStream, U32 ip)
CodeBlock::smInFunction = false; CodeBlock::smInFunction = false;
U32 start = ip;
codeStream.emit(OP_FUNC_DECL); codeStream.emit(OP_FUNC_DECL);
codeStream.emitSTE(fnName); codeStream.emitSTE(fnName);
codeStream.emitSTE(nameSpace); codeStream.emitSTE(nameSpace);

View file

@ -435,7 +435,8 @@ static void setFieldComponent( SimObject* object, StringTableEntry field, const
ConsoleValueRef CodeBlock::exec(U32 ip, const char *functionName, Namespace *thisNamespace, U32 argc, ConsoleValueRef *argv, bool noCalls, StringTableEntry packageName, S32 setFrame) ConsoleValueRef CodeBlock::exec(U32 ip, const char *functionName, Namespace *thisNamespace, U32 argc, ConsoleValueRef *argv, bool noCalls, StringTableEntry packageName, S32 setFrame)
{ {
#ifdef TORQUE_DEBUG
#ifdef TORQUE_VALIDATE_STACK
U32 stackStart = STR.mStartStackSize; U32 stackStart = STR.mStartStackSize;
U32 consoleStackStart = CSTK.mStackPos; U32 consoleStackStart = CSTK.mStackPos;
#endif #endif
@ -2245,9 +2246,9 @@ execFinished:
decRefCount(); decRefCount();
#ifdef TORQUE_DEBUG #ifdef TORQUE_VALIDATE_STACK
//AssertFatal(!(STR.mStartStackSize > stackStart), "String stack not popped enough in script exec"); AssertFatal(!(STR.mStartStackSize > stackStart), "String stack not popped enough in script exec");
//AssertFatal(!(STR.mStartStackSize < stackStart), "String stack popped too much in script exec"); AssertFatal(!(STR.mStartStackSize < stackStart), "String stack popped too much in script exec");
#endif #endif
return returnValue; return returnValue;

View file

@ -578,14 +578,12 @@ void GuiTSCtrl::onRender(Point2I offset, const RectI &updateRect)
GFXTextureObject *texObject = mStereoGuiTarget->getTexture(0); GFXTextureObject *texObject = mStereoGuiTarget->getTexture(0);
const FovPort *currentFovPort = GFX->getStereoFovPort(); const FovPort *currentFovPort = GFX->getStereoFovPort();
const MatrixF *eyeTransforms = GFX->getStereoEyeTransforms(); const MatrixF *eyeTransforms = GFX->getStereoEyeTransforms();
const MatrixF *worldEyeTransforms = GFX->getInverseStereoEyeTransforms();
const Point3F *eyeOffset = GFX->getStereoEyeOffsets(); const Point3F *eyeOffset = GFX->getStereoEyeOffsets();
Frustum gfxFrustum = originalFrustum;
for (U32 i=0; i<2; i++) for (U32 i=0; i<2; i++)
{ {
GFX->activateStereoTarget(i); GFX->activateStereoTarget(i);
Frustum gfxFrustum = originalFrustum;
const F32 frustumDepth = gfxFrustum.getNearDist();
MathUtils::makeFovPortFrustum(&gfxFrustum, true, gfxFrustum.getNearDist(), gfxFrustum.getFarDist(), currentFovPort[i], eyeTransforms[i]); MathUtils::makeFovPortFrustum(&gfxFrustum, true, gfxFrustum.getNearDist(), gfxFrustum.getFarDist(), currentFovPort[i], eyeTransforms[i]);
GFX->setFrustum(gfxFrustum); GFX->setFrustum(gfxFrustum);
@ -618,11 +616,11 @@ void GuiTSCtrl::onRender(Point2I offset, const RectI &updateRect)
F32 screenBottom = rectHeight * 0.5; F32 screenBottom = rectHeight * 0.5;
const F32 fillConv = 0.0f; const F32 fillConv = 0.0f;
const F32 frustumDepth = gfxFrustum.getNearDist() + 0.012; const F32 frustumDepthAdjusted = gfxFrustum.getNearDist() + 0.012;
verts[0].point.set( screenLeft - fillConv, frustumDepth, screenTop - fillConv ); verts[0].point.set( screenLeft - fillConv, frustumDepthAdjusted, screenTop - fillConv );
verts[1].point.set( screenRight - fillConv, frustumDepth, screenTop - fillConv ); verts[1].point.set( screenRight - fillConv, frustumDepthAdjusted, screenTop - fillConv );
verts[2].point.set( screenLeft - fillConv, frustumDepth, screenBottom - fillConv ); verts[2].point.set( screenLeft - fillConv, frustumDepthAdjusted, screenBottom - fillConv );
verts[3].point.set( screenRight - fillConv, frustumDepth, screenBottom - fillConv ); verts[3].point.set( screenRight - fillConv, frustumDepthAdjusted, screenBottom - fillConv );
verts[0].color = verts[1].color = verts[2].color = verts[3].color = ColorI(255,255,255,255); verts[0].color = verts[1].color = verts[2].color = verts[3].color = ColorI(255,255,255,255);

View file

@ -77,8 +77,11 @@ bool SphereF::intersectsRay( const Point3F &start, const Point3F &end ) const
// value for getting the exact // value for getting the exact
// intersection point, by interpolating // intersection point, by interpolating
// start to end by t. // start to end by t.
/*
F32 t = 0; F32 t = 0;
TORQUE_UNUSED(t); TORQUE_UNUSED(t);
*/
// if t1 is less than zero, the object is in the ray's negative direction // if t1 is less than zero, the object is in the ray's negative direction
// and consequently the ray misses the sphere // and consequently the ray misses the sphere

View file

@ -308,7 +308,6 @@ void GuiNavEditorCtrl::on3DMouseDown(const Gui3DMouseEvent & event)
U8 keys = Input::getModifierKeys(); U8 keys = Input::getModifierKeys();
bool shift = keys & SI_LSHIFT; bool shift = keys & SI_LSHIFT;
bool ctrl = keys & SI_LCTRL; bool ctrl = keys & SI_LCTRL;
bool alt = keys & SI_LALT;
if(mMode == mLinkMode && !mMesh.isNull()) if(mMode == mLinkMode && !mMesh.isNull())
{ {

View file

@ -820,12 +820,10 @@ void TerrainMacroMapFeatGLSL::processPix( Vector<ShaderComponent*> &componentL
meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n", meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n",
detailColor, detailInfo, inDet ) ); detailColor, detailInfo, inDet ) );
Var *baseColor = (Var*)LangElement::find( "baseColor" );
Var *outColor = (Var*)LangElement::find( "col" ); Var *outColor = (Var*)LangElement::find( "col" );
meta->addStatement( new GenOp( " @ = lerp( @, @ + @, @ );\r\n", meta->addStatement( new GenOp( " @ = lerp( @, @ + @, @ );\r\n",
outColor, outColor, outColor, detailColor, detailBlend ) ); outColor, outColor, outColor, detailColor, detailBlend ) );
//outColor, outColor, baseColor, detailColor, detailBlend ) );
meta->addStatement( new GenOp( " }\r\n" ) ); meta->addStatement( new GenOp( " }\r\n" ) );

View file

@ -550,7 +550,6 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n", meta->addStatement( new GenOp( " @ *= @.y * @.w;\r\n",
detailColor, detailInfo, inDet ) ); detailColor, detailInfo, inDet ) );
Var *baseColor = (Var*)LangElement::find( "baseColor" );
Var *outColor = (Var*)LangElement::find( "col" ); Var *outColor = (Var*)LangElement::find( "col" );
meta->addStatement( new GenOp( " @ += @ * @;\r\n", meta->addStatement( new GenOp( " @ += @ * @;\r\n",

View file

@ -224,7 +224,7 @@ void TSMesh::innerRender( TSMaterialList *materials, const TSRenderState &rdata,
if ( draw.matIndex & TSDrawPrimitive::NoMaterial ) if ( draw.matIndex & TSDrawPrimitive::NoMaterial )
continue; continue;
#ifdef TORQUE_DEBUG #ifdef TORQUE_DEBUG_BREAK_INSPECT
// for inspection if you happen to be running in a debugger and can't do bit // for inspection if you happen to be running in a debugger and can't do bit
// operations in your head. // operations in your head.
S32 triangles = draw.matIndex & TSDrawPrimitive::Triangles; S32 triangles = draw.matIndex & TSDrawPrimitive::Triangles;
@ -237,6 +237,7 @@ void TSMesh::innerRender( TSMaterialList *materials, const TSRenderState &rdata,
TORQUE_UNUSED(fan); TORQUE_UNUSED(fan);
TORQUE_UNUSED(indexed); TORQUE_UNUSED(indexed);
TORQUE_UNUSED(type); TORQUE_UNUSED(type);
//define TORQUE_DEBUG_BREAK_INSPECT, and insert debug break here to inspect the above elements at runtime
#endif #endif
const U32 matIndex = draw.matIndex & TSDrawPrimitive::MaterialMask; const U32 matIndex = draw.matIndex & TSDrawPrimitive::MaterialMask;