[Scummvm-git-logs] scummvm master -> 8f6a0040e4fcedf98708f9feb722e2e5d2504dfd
aquadran
noreply at scummvm.org
Sat Oct 19 21:11:20 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8f6a0040e4 WINTERMUTE: Small sync with original code
Commit: 8f6a0040e4fcedf98708f9feb722e2e5d2504dfd
https://github.com/scummvm/scummvm/commit/8f6a0040e4fcedf98708f9feb722e2e5d2504dfd
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2024-10-19T23:11:16+02:00
Commit Message:
WINTERMUTE: Small sync with original code
Changed paths:
engines/wintermute/base/gfx/xanimation.cpp
engines/wintermute/base/gfx/xframe_node.cpp
engines/wintermute/base/gfx/xmodel.cpp
diff --git a/engines/wintermute/base/gfx/xanimation.cpp b/engines/wintermute/base/gfx/xanimation.cpp
index c511baedc0e..8252b1b52b2 100644
--- a/engines/wintermute/base/gfx/xanimation.cpp
+++ b/engines/wintermute/base/gfx/xanimation.cpp
@@ -73,11 +73,14 @@ bool Animation::load(XFileData *xobj, AnimationSet *parentAnimSet) {
bool result;
XClassType objectType;
+ // Query the child for it's FileDataReference
if (xobj->isReference()) {
// The original data is found
result = xobj->getType(objectType);
- if (!result)
+ if (!result) {
+ BaseEngine::LOG(0, "Couldn't retrieve object type while loading animation");
return result;
+ }
// The object must be a frame
if (objectType == kXClassFrame) {
diff --git a/engines/wintermute/base/gfx/xframe_node.cpp b/engines/wintermute/base/gfx/xframe_node.cpp
index 4179405c239..e1ad7b98874 100644
--- a/engines/wintermute/base/gfx/xframe_node.cpp
+++ b/engines/wintermute/base/gfx/xframe_node.cpp
@@ -107,6 +107,10 @@ bool FrameNode::loadFromXData(const Common::String &filename, XModel *model, XFi
// get the type of the object
XClassType objectType = kXClassUnknown;
res = xobj->getType(objectType);
+ if (!res) {
+ BaseEngine::LOG(0, "Error getting object type");
+ return res;
+ }
if (objectType == kXClassMesh) { // load a child mesh
XMesh *mesh = _gameRef->_renderer3D->createXMesh();
@@ -280,7 +284,6 @@ bool FrameNode::updateMatrices(DXMatrix *parentMat) {
DXMatrixTranspose(&posMat, &posMat);
DXMatrixMultiply(&_transformationMatrix, &posMat, &_transformationMatrix);
}
-
_transUsed[0] = _transUsed[1] = false;
// multiply by parent transformation
diff --git a/engines/wintermute/base/gfx/xmodel.cpp b/engines/wintermute/base/gfx/xmodel.cpp
index fa12db8b382..27857d441d0 100644
--- a/engines/wintermute/base/gfx/xmodel.cpp
+++ b/engines/wintermute/base/gfx/xmodel.cpp
@@ -133,6 +133,7 @@ bool XModel::loadFromFile(const Common::String &filename, XModel *parentModel) {
return false;
}
+ // get top level objects
_rootFrame = new FrameNode(_gameRef);
uint32 numChildren = 0;
@@ -208,6 +209,7 @@ bool XModel::mergeFromFile(const Common::String &filename) {
res = findBones(true);
}
+ // remember path for save/load purposes
bool found = false;
for (uint i = 0; i < _mergedModels.size(); ++i) {
if (scumm_stricmp(_mergedModels[i], filename.c_str()) == 0) {
@@ -242,6 +244,7 @@ bool XModel::loadAnimationSet(const Common::String &filename, XFileData *xobj) {
animSet->setName(PathUtil::getFileName(filename).c_str());
}
+ // query through the child objects to load the animations
XFileData xchildData;
XClassType objectType;
@@ -290,6 +293,7 @@ bool XModel::loadAnimation(const Common::String &filename, XFileData *xobj, Anim
// create the new object
Animation *anim = new Animation(_gameRef);
+ // load the animation
uint32 numChildren = 0;
xobj->getChildren(numChildren);
@@ -392,7 +396,6 @@ bool XModel::playAnim(int channel, const Common::String &name, uint32 transition
if (anim) {
char *currentAnim = _channels[channel]->getName();
if (_owner && currentAnim) {
- // clean this up later
transitionTime = _owner->getAnimTransitionTime(currentAnim, const_cast<char *>(name.c_str()));
}
More information about the Scummvm-git-logs
mailing list