WINTERMUTE: WME3D: Restore missing check, matching original

This commit is contained in:
Paweł Kołodziejski
2022-06-26 00:22:19 +02:00
parent 0c3baef631
commit aa37cd7f4e
3 changed files with 12 additions and 2 deletions
+5 -2
View File
@@ -1908,8 +1908,11 @@ bool AdActor3DX::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
stack->pop();
warning("AdActor3DX::scCallMethod D3DX effects are not supported");
stack->pushBool(false);
if (_modelX) {
stack->pushBool(true);
} else {
stack->pushBool(false);
}
return true;
}
+3
View File
@@ -411,6 +411,9 @@ bool MeshX::pickPoly(Math::Vector3d *pickRayOrig, Math::Vector3d *pickRayDir) {
Math::Vector3d v2;
v2.setData(&_vertexData[index3 * kVertexComponentCount + kPositionOffset]);
if (isnan(v0.x()))
continue;
Math::Vector3d intersection;
if (lineIntersectsTriangle(*pickRayOrig, *pickRayDir, v0, v1, v2, intersection.x(), intersection.y(), intersection.z())) {
res = true;
+4
View File
@@ -246,6 +246,10 @@ bool ModelX::loadFromFile(const Common::String &filename, ModelX *parentModel) {
}
bool ModelX::mergeFromFile(const Common::String &filename) {
if (!_rootFrame) {
return false;
}
uint32 fileSize = 0;
byte *buffer = BaseFileManager::getEngineInstance()->getEngineInstance()->readWholeFile(filename, &fileSize);
XFileLexer lexer = createXFileLexer(buffer, fileSize);