Merge remote-tracking branch 'upstream/development' into ShaderConstBuffer-CleanupRefactor

This commit is contained in:
marauder2k7 2024-03-01 17:52:37 +00:00
commit d8636f754b
9 changed files with 58 additions and 70 deletions

View file

@ -97,7 +97,7 @@ endif (WIN32 AND TORQUE_D3D11)
# Handle core
torqueAddSourceDirectories("core" "core/stream" "core/strings" "core/util"
"core/util/journal" "core/util/zip" "core/util/compressors")
"core/util/journal" "core/util/zip" "core/util/zip/compressors")
# Handle GUI
torqueAddSourceDirectories("gui" "gui/buttons" "gui/containers" "gui/controls" "gui/core"
"gui/game" "gui/shiny" "gui/utility" "gui/3d")

View file

@ -1279,9 +1279,14 @@ template<> void *Resource<GBitmap>::create(const Torque::Path &path)
const String extension = path.getExtension();
if( !bmp->readBitmap( extension, path ) )
{
Con::errorf( "Resource<GBitmap>::create - error reading '%s'", path.getFullPath().c_str() );
delete bmp;
bmp = NULL;
// we can only get here if the stream was successful, so attempt to read the stream.
Con::warnf("Was unable to load as file, going to try the stream instead.");
if (!bmp->readBitmapStream(extension, stream, stream.getStreamSize()))
{
Con::errorf("Resource<GBitmap>::create - error reading '%s'", path.getFullPath().c_str());
delete bmp;
bmp = NULL;
}
}
return bmp;

View file

@ -195,7 +195,12 @@ bool sReadSTB(const Torque::Path& path, GBitmap* bitmap)
if (!stbi_info(path.getFullPath().c_str(), &x, &y, &channels))
{
FrameAllocator::setWaterMark(prevWaterMark);
return false;
const char* stbErr = stbi_failure_reason();
if (!stbErr)
stbErr = "Unknown Error!";
Con::errorf("STB get file info: %s", stbErr);
}
// do this to map 2 channels to 4, 2 channel not supported by gbitmap yet..
@ -325,8 +330,7 @@ bool sReadStreamSTB(Stream& stream, GBitmap* bitmap, U32 len)
if (!stbErr)
stbErr = "Unknown Error!";
Con::errorf("STB failed to get image info: %s", stbErr);
return false;
Con::errorf("STB get memory info: %s", stbErr);
}
S32 reqCom = comp;

View file

@ -261,38 +261,40 @@ void AssimpShapeLoader::processAnimations()
Vector<aiNodeAnim*> ambientChannels;
F32 duration = 0.0f;
for (U32 i = 0; i < mScene->mNumAnimations; ++i)
if (mScene->mNumAnimations > 0)
{
aiAnimation* anim = mScene->mAnimations[i];
for (U32 j = 0; j < anim->mNumChannels; j++)
for (U32 i = 0; i < mScene->mNumAnimations; ++i)
{
aiNodeAnim* nodeAnim = anim->mChannels[j];
// Determine the maximum keyframe time for this animation
F32 maxKeyTime = 0.0f;
for (U32 k = 0; k < nodeAnim->mNumPositionKeys; k++) {
maxKeyTime = getMax(maxKeyTime, (F32)nodeAnim->mPositionKeys[k].mTime);
}
for (U32 k = 0; k < nodeAnim->mNumRotationKeys; k++) {
maxKeyTime = getMax(maxKeyTime, (F32)nodeAnim->mRotationKeys[k].mTime);
}
for (U32 k = 0; k < nodeAnim->mNumScalingKeys; k++) {
maxKeyTime = getMax(maxKeyTime, (F32)nodeAnim->mScalingKeys[k].mTime);
}
aiAnimation* anim = mScene->mAnimations[i];
for (U32 j = 0; j < anim->mNumChannels; j++)
{
aiNodeAnim* nodeAnim = anim->mChannels[j];
// Determine the maximum keyframe time for this animation
F32 maxKeyTime = 0.0f;
for (U32 k = 0; k < nodeAnim->mNumPositionKeys; k++) {
maxKeyTime = getMax(maxKeyTime, (F32)nodeAnim->mPositionKeys[k].mTime);
}
for (U32 k = 0; k < nodeAnim->mNumRotationKeys; k++) {
maxKeyTime = getMax(maxKeyTime, (F32)nodeAnim->mRotationKeys[k].mTime);
}
for (U32 k = 0; k < nodeAnim->mNumScalingKeys; k++) {
maxKeyTime = getMax(maxKeyTime, (F32)nodeAnim->mScalingKeys[k].mTime);
}
ambientChannels.push_back(nodeAnim);
ambientChannels.push_back(nodeAnim);
duration = getMax(duration, maxKeyTime);
duration = getMax(duration, maxKeyTime);
}
}
ambientSeq->mNumChannels = ambientChannels.size();
ambientSeq->mChannels = ambientChannels.address();
ambientSeq->mDuration = duration;
ambientSeq->mTicksPerSecond = 24.0;
AssimpAppSequence* defaultAssimpSeq = new AssimpAppSequence(ambientSeq);
appSequences.push_back(defaultAssimpSeq);
}
ambientSeq->mNumChannels = ambientChannels.size();
ambientSeq->mChannels = ambientChannels.address();
ambientSeq->mDuration = duration;
ambientSeq->mTicksPerSecond = 24.0;
AssimpAppSequence* defaultAssimpSeq = new AssimpAppSequence(ambientSeq);
appSequences.push_back(defaultAssimpSeq);
}
void AssimpShapeLoader::computeBounds(Box3F& bounds)