mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 05:50:31 +00:00
more merge conflicts
fixed more merge conflicts (afxZodiac and MaterialDefinition) Updated cubemapdata to use refactor asset added new part to image_asset macro to create a private asset if the file exists. updated reflectionProbe errors to actual function name where the error occurs.
This commit is contained in:
parent
0da0903599
commit
b2fe48ab8d
6 changed files with 50 additions and 75 deletions
|
|
@ -41,13 +41,6 @@ IMPLEMENT_CONOBJECT( CubemapData );
|
|||
CubemapData::CubemapData()
|
||||
{
|
||||
mCubemap = NULL;
|
||||
|
||||
for (U32 i = 0; i < 6; i++)
|
||||
{
|
||||
INIT_IMAGEASSET_ARRAY(CubeMapFace, GFXStaticTextureSRGBProfile, i);
|
||||
}
|
||||
|
||||
INIT_ASSET(CubeMap);
|
||||
}
|
||||
|
||||
CubemapData::~CubemapData()
|
||||
|
|
@ -77,17 +70,7 @@ ConsoleDocClass( CubemapData,
|
|||
void CubemapData::initPersistFields()
|
||||
{
|
||||
docsURL;
|
||||
addProtectedField( "cubeFace", TypeStringFilename, Offset(mCubeMapFaceName, CubemapData), _setCubeMapFaceData, defaultProtectedGetFn, 6,
|
||||
"@brief The 6 cubemap face textures for a static cubemap.\n\n"
|
||||
"They are in the following order:\n"
|
||||
" - cubeFace[0] is -X\n"
|
||||
" - cubeFace[1] is +X\n"
|
||||
" - cubeFace[2] is -Z\n"
|
||||
" - cubeFace[3] is +Z\n"
|
||||
" - cubeFace[4] is -Y\n"
|
||||
" - cubeFace[5] is +Y\n", AbstractClassRep::FIELD_HideInInspectors );
|
||||
|
||||
INITPERSISTFIELD_IMAGEASSET_ARRAY(CubeMapFace, 6, CubemapData, "@brief The 6 cubemap face textures for a static cubemap.\n\n"
|
||||
INITPERSISTFIELD_IMAGEASSET_ARRAY_REFACTOR(CubeMapFace, 6, CubemapData, "@brief The 6 cubemap face textures for a static cubemap.\n\n"
|
||||
"They are in the following order:\n"
|
||||
" - cubeFace[0] is -X\n"
|
||||
" - cubeFace[1] is +X\n"
|
||||
|
|
@ -96,7 +79,7 @@ void CubemapData::initPersistFields()
|
|||
" - cubeFace[4] is -Y\n"
|
||||
" - cubeFace[5] is +Y\n");
|
||||
|
||||
INITPERSISTFIELD_IMAGEASSET(CubeMap, CubemapData, "@brief Cubemap dds Image Asset.\n\n");
|
||||
INITPERSISTFIELD_IMAGEASSET_REFACTOR(CubeMap, CubemapData, "@brief Cubemap dds Image Asset.\n\n");
|
||||
}
|
||||
|
||||
bool CubemapData::onAdd()
|
||||
|
|
@ -116,19 +99,26 @@ void CubemapData::createMap()
|
|||
{
|
||||
bool initSuccess = true;
|
||||
//check mCubeMapFile first
|
||||
if (getCubeMap() != StringTable->EmptyString())
|
||||
if (mCubeMapAsset.notNull())
|
||||
{
|
||||
mCubemap = TEXMGR->createCubemap(getCubeMap());
|
||||
mCubemap = TEXMGR->createCubemap(mCubeMapAsset->getImageFile());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (U32 i = 0; i < 6; i++)
|
||||
{
|
||||
if (!_setCubeMapFace(getCubeMapFace(i), i))
|
||||
if (mCubeMapFaceAsset[i].notNull())
|
||||
{
|
||||
Con::errorf("CubemapData::createMap - Failed to load texture '%s'", getCubeMapFace(i));
|
||||
initSuccess = false;
|
||||
if (!getCubeMapFace(i))
|
||||
{
|
||||
Con::errorf("CubemapData::createMap - Failed to load texture '%s'", getCubeMapFace(i));
|
||||
initSuccess = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCubeMapFaceTex[i] = getCubeMapFace(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -136,9 +126,10 @@ void CubemapData::createMap()
|
|||
if( initSuccess )
|
||||
{
|
||||
mCubemap = GFX->createCubemap();
|
||||
if (!mCubeMapFace || mCubeMapFace->isNull())
|
||||
if (mCubeMapFaceAsset->isNull())
|
||||
return;
|
||||
mCubemap->initStatic(mCubeMapFace);
|
||||
|
||||
mCubemap->initStatic(mCubeMapFaceTex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -150,18 +141,22 @@ void CubemapData::updateFaces()
|
|||
for( U32 i=0; i<6; i++ )
|
||||
{
|
||||
//check mCubeMapFile first
|
||||
if (getCubeMap() != StringTable->EmptyString())
|
||||
if (mCubeMapAsset.notNull())
|
||||
{
|
||||
mCubemap = TEXMGR->createCubemap(getCubeMap());
|
||||
mCubemap = TEXMGR->createCubemap(mCubeMapAsset->getImageFile());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_setCubeMapFace(getCubeMapFace(i), i))
|
||||
if (!getCubeMapFace(i))
|
||||
{
|
||||
Con::errorf("CubemapData::createMap - Failed to load texture '%s'", getCubeMapFace(i));
|
||||
initSuccess = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mCubeMapFaceTex[i] = getCubeMapFace(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -170,13 +165,13 @@ void CubemapData::updateFaces()
|
|||
mCubemap = NULL;
|
||||
mCubemap = GFX->createCubemap();
|
||||
|
||||
mCubemap->initStatic( mCubeMapFace );
|
||||
mCubemap->initStatic(mCubeMapFaceTex);
|
||||
}
|
||||
}
|
||||
|
||||
void CubemapData::setCubemapFile(FileName newCubemapFile)
|
||||
{
|
||||
mCubeMapName = newCubemapFile;
|
||||
_setCubeMap(newCubemapFile);
|
||||
}
|
||||
|
||||
void CubemapData::setCubeFaceFile(U32 index, FileName newFaceFile)
|
||||
|
|
@ -184,7 +179,7 @@ void CubemapData::setCubeFaceFile(U32 index, FileName newFaceFile)
|
|||
if (index >= 6)
|
||||
return;
|
||||
|
||||
mCubeMapFaceName[index] = newFaceFile;
|
||||
_setCubeMapFace(newFaceFile, index);
|
||||
}
|
||||
|
||||
void CubemapData::setCubeFaceTexture(U32 index, GFXTexHandle newFaceTexture)
|
||||
|
|
@ -192,7 +187,7 @@ void CubemapData::setCubeFaceTexture(U32 index, GFXTexHandle newFaceTexture)
|
|||
if (index >= 6)
|
||||
return;
|
||||
|
||||
mCubeMapFace[index] = newFaceTexture;
|
||||
mCubeMapFaceTex[index] = newFaceTexture;
|
||||
}
|
||||
|
||||
DefineEngineMethod( CubemapData, updateFaces, void, (),,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue