mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
commit
b257ac3d1e
15 changed files with 19 additions and 11 deletions
|
|
@ -456,7 +456,7 @@ F32 GameBase::getUpdatePriority(CameraScopeQuery *camInfo, U32 updateMask, S32 u
|
||||||
|
|
||||||
// Weight by interest.
|
// Weight by interest.
|
||||||
F32 wInterest;
|
F32 wInterest;
|
||||||
if (getTypeMask() & (PlayerObjectType || VehicleObjectType ))
|
if (getTypeMask() & (PlayerObjectType | VehicleObjectType ))
|
||||||
wInterest = 0.75f;
|
wInterest = 0.75f;
|
||||||
else if (getTypeMask() & ProjectileObjectType)
|
else if (getTypeMask() & ProjectileObjectType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -709,7 +709,7 @@ void ReflectionProbe::processStaticCubemap()
|
||||||
IBLUtilities::SaveCubeMap(prefilterFileName, mPrefilterMap->mCubemap);
|
IBLUtilities::SaveCubeMap(prefilterFileName, mPrefilterMap->mCubemap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mIrridianceMap != nullptr || !mIrridianceMap->mCubemap.isNull()) && (mPrefilterMap != nullptr || !mPrefilterMap->mCubemap.isNull()))
|
if ((mIrridianceMap != nullptr && !mIrridianceMap->mCubemap.isNull()) && (mPrefilterMap != nullptr && !mPrefilterMap->mCubemap.isNull()))
|
||||||
{
|
{
|
||||||
mProbeInfo.mPrefilterCubemap = mPrefilterMap->mCubemap;
|
mProbeInfo.mPrefilterCubemap = mPrefilterMap->mCubemap;
|
||||||
mProbeInfo.mIrradianceCubemap = mIrridianceMap->mCubemap;
|
mProbeInfo.mIrradianceCubemap = mIrridianceMap->mCubemap;
|
||||||
|
|
|
||||||
|
|
@ -576,7 +576,7 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr)
|
||||||
|
|
||||||
void ShapeBaseImageData::handleStateSoundTrack(const U32& stateId)
|
void ShapeBaseImageData::handleStateSoundTrack(const U32& stateId)
|
||||||
{
|
{
|
||||||
if (stateId > MaxStates)
|
if (stateId >= MaxStates)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
StateData& s = state[stateId];
|
StateData& s = state[stateId];
|
||||||
|
|
|
||||||
|
|
@ -1302,7 +1302,8 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript)
|
||||||
CodeBlock *newCodeBlock = new CodeBlock();
|
CodeBlock *newCodeBlock = new CodeBlock();
|
||||||
newCodeBlock->compileExec(scriptFileName, script, noCalls, 0);
|
newCodeBlock->compileExec(scriptFileName, script, noCalls, 0);
|
||||||
delete[] script;
|
delete[] script;
|
||||||
|
delete newCodeBlock;
|
||||||
|
|
||||||
execDepth--;
|
execDepth--;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1476,6 +1477,7 @@ bool executeFile(const char* fileName, bool noCalls, bool journalScript)
|
||||||
code->read(scriptFileName, *compiledStream);
|
code->read(scriptFileName, *compiledStream);
|
||||||
delete compiledStream;
|
delete compiledStream;
|
||||||
code->exec(0, scriptFileName, NULL, 0, NULL, noCalls, NULL, 0);
|
code->exec(0, scriptFileName, NULL, 0, NULL, noCalls, NULL, 0);
|
||||||
|
delete code;
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -490,8 +490,8 @@ DefineEngineFunction(getDirectoryList, String, ( const char* path, S32 depth ),
|
||||||
if (fullpath[dStrlen(fullpath) - 1] != '/')
|
if (fullpath[dStrlen(fullpath) - 1] != '/')
|
||||||
{
|
{
|
||||||
S32 pos = dStrlen(fullpath);
|
S32 pos = dStrlen(fullpath);
|
||||||
fullpath[pos] = '/';
|
fullpath[pos - 1] = '/';
|
||||||
fullpath[pos + 1] = '\0';
|
fullpath[pos] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dump the directories.
|
// Dump the directories.
|
||||||
|
|
|
||||||
|
|
@ -925,6 +925,7 @@ void TelnetDebugger::evaluateExpression(const char *tag, S32 frame, const char *
|
||||||
dSprintf( buffer, len, format, tag, result.getString()[0] ? result.getString() : "\"\"" );
|
dSprintf( buffer, len, format, tag, result.getString()[0] ? result.getString() : "\"\"" );
|
||||||
|
|
||||||
send( buffer );
|
send( buffer );
|
||||||
|
delete newCodeBlock;
|
||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ void GFXD3D11Device::enumerateAdapters(Vector<GFXAdapter*> &adapterList)
|
||||||
SAFE_DELETE_ARRAY(str);
|
SAFE_DELETE_ARRAY(str);
|
||||||
|
|
||||||
dStrncpy(toAdd->mName, Description.c_str(), GFXAdapter::MaxAdapterNameLen);
|
dStrncpy(toAdd->mName, Description.c_str(), GFXAdapter::MaxAdapterNameLen);
|
||||||
dStrncat(toAdd->mName, " (D3D11)", GFXAdapter::MaxAdapterNameLen);
|
dStrncat(toAdd->mName, " (D3D11)", sizeof(toAdd->mName) - strlen(toAdd->mName) - 1);
|
||||||
|
|
||||||
IDXGIOutput* pOutput = NULL;
|
IDXGIOutput* pOutput = NULL;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
|
||||||
|
|
@ -744,6 +744,7 @@ DDSFile *DDSFile::createDDSCubemapFileFromGBitmaps(GBitmap **gbmps)
|
||||||
GFXFormat fmt = pBitmap->getFormat();
|
GFXFormat fmt = pBitmap->getFormat();
|
||||||
if (fmt != GFXFormatR8G8B8A8 && fmt != GFXFormatR16G16B16A16F)
|
if (fmt != GFXFormatR8G8B8A8 && fmt != GFXFormatR16G16B16A16F)
|
||||||
{
|
{
|
||||||
|
delete ret;
|
||||||
Con::errorf("createDDSCubemapFileFromGBitmaps: unsupported format");
|
Con::errorf("createDDSCubemapFileFromGBitmaps: unsupported format");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1436,6 +1436,7 @@ DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const cha
|
||||||
if (!fs.open(destinationPath.getFullPath(), Torque::FS::File::Write))
|
if (!fs.open(destinationPath.getFullPath(), Torque::FS::File::Write))
|
||||||
{
|
{
|
||||||
Con::errorf("saveScaledImage() - Failed to open output file '%s'!", bitmapDest);
|
Con::errorf("saveScaledImage() - Failed to open output file '%s'!", bitmapDest);
|
||||||
|
delete image;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1443,6 +1444,7 @@ DefineEngineFunction(saveScaledImage, bool, (const char* bitmapSource, const cha
|
||||||
image->writeBitmap("png", fs);
|
image->writeBitmap("png", fs);
|
||||||
|
|
||||||
fs.close();
|
fs.close();
|
||||||
|
delete image;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -2704,7 +2704,7 @@ SceneObject* GuiConvexEditorCtrl::createPolyhedralObject(const char* className,
|
||||||
// Create the object.
|
// Create the object.
|
||||||
|
|
||||||
SceneObject* object = dynamic_cast< SceneObject* >(classRep->create());
|
SceneObject* object = dynamic_cast< SceneObject* >(classRep->create());
|
||||||
if (!Object)
|
if (!object)
|
||||||
{
|
{
|
||||||
Con::errorf("WorldEditor::createPolyhedralObject - Could not create SceneObject with class '%s'", className);
|
Con::errorf("WorldEditor::createPolyhedralObject - Could not create SceneObject with class '%s'", className);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
|
|
@ -395,7 +395,7 @@ void ProjectedShadow::_calcScore( const SceneRenderState *state )
|
||||||
F32 secs = mFloor( (F32)msSinceLastRender / 1000.0f );
|
F32 secs = mFloor( (F32)msSinceLastRender / 1000.0f );
|
||||||
|
|
||||||
mScore = pct + secs;
|
mScore = pct + secs;
|
||||||
mClampF( mScore, 0.0f, 2000.0f );
|
mScore = mClampF( mScore, 0.0f, 2000.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectedShadow::update( const SceneRenderState *state )
|
void ProjectedShadow::update( const SceneRenderState *state )
|
||||||
|
|
|
||||||
|
|
@ -798,7 +798,7 @@ void RenderProbeMgr::_update4ProbeConsts(const SceneData& sgData,
|
||||||
shaderConsts->setSafe(probeShaderConsts->mProbeConfigDataArraySC, probeConfigAlignedArray);
|
shaderConsts->setSafe(probeShaderConsts->mProbeConfigDataArraySC, probeConfigAlignedArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mBRDFTexture.isValid(), probeShaderConsts->mBRDFTextureMap->getSamplerRegister() != -1)
|
if (mBRDFTexture.isValid() && probeShaderConsts->mBRDFTextureMap->getSamplerRegister() != -1)
|
||||||
GFX->setTexture(probeShaderConsts->mBRDFTextureMap->getSamplerRegister(), mBRDFTexture);
|
GFX->setTexture(probeShaderConsts->mBRDFTextureMap->getSamplerRegister(), mBRDFTexture);
|
||||||
|
|
||||||
if (mWetnessTexture.isValid() && probeShaderConsts->mWetnessTextureMap->getSamplerRegister() != -1)
|
if (mWetnessTexture.isValid() && probeShaderConsts->mWetnessTextureMap->getSamplerRegister() != -1)
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,7 @@ void ShaderGen::generateShader( const MaterialFeatureData &featureData,
|
||||||
if(!s->open(pixShaderName, Torque::FS::File::Write ))
|
if(!s->open(pixShaderName, Torque::FS::File::Write ))
|
||||||
{
|
{
|
||||||
AssertFatal(false, "Failed to open Shader Stream" );
|
AssertFatal(false, "Failed to open Shader Stream" );
|
||||||
|
delete s;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -980,7 +980,7 @@ bool NetConnection::readDemoStartBlock(BitStream* stream)
|
||||||
|
|
||||||
bool NetConnection::startDemoRecord(const char *fileName)
|
bool NetConnection::startDemoRecord(const char *fileName)
|
||||||
{
|
{
|
||||||
FileStream *fs = new FileStream;
|
FileStream *fs = NULL;
|
||||||
|
|
||||||
if((fs = FileStream::createAndOpen( fileName, Torque::FS::File::Write )) == NULL)
|
if((fs = FileStream::createAndOpen( fileName, Torque::FS::File::Write )) == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ DefineEngineStaticMethod( TerrainBlock, createNew, S32, (String terrainName, U32
|
||||||
if( !terrain->setFile( terrFileName ) )
|
if( !terrain->setFile( terrFileName ) )
|
||||||
{
|
{
|
||||||
Con::errorf( "TerrainBlock::createNew - error creating '%s'", terrFileName.c_str() );
|
Con::errorf( "TerrainBlock::createNew - error creating '%s'", terrFileName.c_str() );
|
||||||
|
delete terrain;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue