0
0
Fork 0
haikuports/games-engines/residualvm/patches/wintermute_int32_fix.patch

404 lines
16 KiB
Diff

diff --git a/engines/wintermute/ad/ad_actor_3dx.cpp b/engines/wintermute/ad/ad_actor_3dx.cpp
index 90d7b97..b167e4b 100644
--- a/engines/wintermute/ad/ad_actor_3dx.cpp
+++ b/engines/wintermute/ad/ad_actor_3dx.cpp
@@ -191,7 +191,7 @@ bool AdActor3DX::update() {
Math::Matrix4 newWorldMat;
getMatrix(&newWorldMat, &newPos);
- int newX, newY;
+ int32 newX, newY;
convert3DTo2D(&newWorldMat, &newX, &newY);
canWalk = !scene->isBlockedAt(newX, newY, false, this);
} else {
@@ -1257,7 +1257,7 @@ void AdActor3DX::talk(const char *text, const char *sound, uint32 duration, cons
}
//////////////////////////////////////////////////////////////////////////
-int AdActor3DX::getHeight() {
+int32 AdActor3DX::getHeight() {
if (!_modelX) {
return 0;
} else {
@@ -2262,13 +2262,13 @@ bool AdActor3DX::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferUint32(TMEMBER(_defaultStopTransTime));
if (persistMgr->getIsSaving()) {
- int numItems = _transitionTimes.size();
+ int32 numItems = _transitionTimes.size();
persistMgr->transferSint32(TMEMBER(numItems));
for (uint32 i = 0; i < _transitionTimes.size(); i++) {
_transitionTimes[i]->persist(persistMgr);
}
} else {
- int numItems = _transitionTimes.size();
+ int32 numItems = _transitionTimes.size();
persistMgr->transferSint32(TMEMBER(numItems));
for (int i = 0; i < numItems; i++) {
BaseAnimationTransitionTime *trans = new BaseAnimationTransitionTime();
@@ -2441,7 +2441,7 @@ bool AdActor3DX::updatePartEmitter() {
Math::Vector3d bonePos;
getBonePosition3D(_partBone.c_str(), &bonePos, &_partOffset);
- int x = 0, y = 0;
+ int32 x = 0, y = 0;
static_cast<AdGame *>(_gameRef)->_scene->_sceneGeometry->convert3Dto2D(&bonePos, &x, &y);
_partEmitter->_posX = x - _gameRef->_renderer->_drawOffsetX;
diff --git a/engines/wintermute/ad/ad_actor_3dx.h b/engines/wintermute/ad/ad_actor_3dx.h
index ecac126..e87f29d 100644
--- a/engines/wintermute/ad/ad_actor_3dx.h
+++ b/engines/wintermute/ad/ad_actor_3dx.h
@@ -51,9 +51,9 @@ public:
bool displayShadowVolume();
bool restoreDeviceObjects() override;
bool invalidateDeviceObjects() override;
- int _stateAnimChannel;
+ int32 _stateAnimChannel;
void talk(const char *text, const char *sound = nullptr, uint32 duration = 0, const char *stances = nullptr, TTextAlign align = TAL_CENTER) override;
- int getHeight() override;
+ int32 getHeight() override;
bool playAnim3DX(const char *name, bool setState);
bool playAnim3DX(int channel, const char *name, bool setState);
@@ -72,7 +72,7 @@ public:
Common::String _turnLeftAnimName;
Common::String _turnRightAnimName;
- int _talkAnimChannel;
+ int32 _talkAnimChannel;
TDirectWalkMode _directWalkMode;
TDirectTurnMode _directTurnMode;
@@ -81,7 +81,7 @@ public:
float _directWalkVelocity;
float _directTurnVelocity;
- int _goToTolerance;
+ int32 _goToTolerance;
DECLARE_PERSISTENT(AdActor3DX, AdObject3D)
bool _turningLeft;
diff --git a/engines/wintermute/ad/ad_object_3d.cpp b/engines/wintermute/ad/ad_object_3d.cpp
index bf09452..08127da 100644
--- a/engines/wintermute/ad/ad_object_3d.cpp
+++ b/engines/wintermute/ad/ad_object_3d.cpp
@@ -120,7 +120,7 @@ bool AdObject3D::update() {
}
//////////////////////////////////////////////////////////////////////////
-bool AdObject3D::convert3DTo2D(Math::Matrix4 *worldMat, int *posX, int *posY) {
+bool AdObject3D::convert3DTo2D(Math::Matrix4 *worldMat, int32 *posX, int32 *posY) {
Math::Vector3d origin(0.0f, 0.0f, 0.0f);
_gameRef->_renderer3D->project(*worldMat, origin, *posX, *posY);
@@ -152,8 +152,8 @@ bool AdObject3D::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "SkipTo") == 0) {
stack->correctParams(2);
- int x = stack->pop()->getInt();
- int y = stack->pop()->getInt();
+ int32 x = stack->pop()->getInt();
+ int32 y = stack->pop()->getInt();
skipTo(x, y);
stack->pushNULL();
@@ -180,7 +180,7 @@ bool AdObject3D::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSta
else if (strcmp(name, "GetBonePosition2D") == 0) {
stack->correctParams(1);
const char *boneName = stack->pop()->getString();
- int x = 0, y = 0;
+ int32 x = 0, y = 0;
getBonePosition2D(boneName, &x, &y);
ScValue *val = stack->getPushValue();
@@ -552,7 +552,7 @@ bool AdObject3D::persist(BasePersistenceManager *persistMgr) {
}
//////////////////////////////////////////////////////////////////////////
-bool AdObject3D::skipTo(int x, int y, bool tolerant) {
+bool AdObject3D::skipTo(int32 x, int32 y, bool tolerant) {
AdGame *adGame = (AdGame *)_gameRef;
Math::Vector3d pos;
@@ -583,7 +583,7 @@ ShadowVolume *AdObject3D::getShadowVolume() {
}
//////////////////////////////////////////////////////////////////////////
-bool AdObject3D::getBonePosition2D(const char *boneName, int *x, int *y) {
+bool AdObject3D::getBonePosition2D(const char *boneName, int32 *x, int32 *y) {
if (!_modelX) {
return false;
}
diff --git a/engines/wintermute/ad/ad_object_3d.h b/engines/wintermute/ad/ad_object_3d.h
index f75db25..e683375 100644
--- a/engines/wintermute/ad/ad_object_3d.h
+++ b/engines/wintermute/ad/ad_object_3d.h
@@ -40,8 +40,8 @@ class ShadowVolume;
class AdObject3D : public AdObject {
public:
bool setupLights();
- bool convert3DTo2D(Math::Matrix4 *worldMat, int *posX, int *posY);
- bool skipTo(int x, int y, bool tolerant = false);
+ bool convert3DTo2D(Math::Matrix4 *worldMat, int32 *posX, int32 *posY);
+ bool skipTo(int32 x, int32 y, bool tolerant = false);
char *_tempSkelAnim;
Math::Vector3d _lastPosVector;
DECLARE_PERSISTENT(AdObject3D, AdObject)
@@ -50,7 +50,7 @@ public:
bool update() override;
AdObject3D(BaseGame *inGame);
virtual ~AdObject3D();
- bool getBonePosition2D(const char *boneName, int *x, int *y);
+ bool getBonePosition2D(const char *boneName, int32 *x, int32 *y);
bool getBonePosition3D(const char *boneName, Math::Vector3d *pos, Math::Vector3d *offset = nullptr);
float _velocity;
diff --git a/engines/wintermute/ad/ad_path3d.cpp b/engines/wintermute/ad/ad_path3d.cpp
index 697bb79..61d1e9a 100644
--- a/engines/wintermute/ad/ad_path3d.cpp
+++ b/engines/wintermute/ad/ad_path3d.cpp
@@ -108,7 +108,7 @@ bool AdPath3D::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferBool(TMEMBER(_ready));
if (persistMgr->getIsSaving()) {
- int j = _points.size();
+ int32 j = _points.size();
persistMgr->transferSint32("ArraySize", &j);
for (int i = 0; i < j; i++) {
persistMgr->transferFloat("x", &_points[i]->x());
@@ -116,7 +116,7 @@ bool AdPath3D::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferFloat("z", &_points[i]->z());
}
} else {
- int j = 0;
+ int32 j = 0;
persistMgr->transferSint32("ArraySize", &j);
for (int i = 0; i < j; i++) {
float x, y, z;
diff --git a/engines/wintermute/ad/ad_path3d.h b/engines/wintermute/ad/ad_path3d.h
index 2569ad8..e072e9c 100644
--- a/engines/wintermute/ad/ad_path3d.h
+++ b/engines/wintermute/ad/ad_path3d.h
@@ -49,7 +49,7 @@ public:
virtual ~AdPath3D();
bool _ready;
BaseArray<Math::Vector3d *> _points;
- int _currIndex;
+ int32 _currIndex;
DECLARE_PERSISTENT(AdPath3D, BaseClass)
};
diff --git a/engines/wintermute/ad/ad_scene_geometry.cpp b/engines/wintermute/ad/ad_scene_geometry.cpp
index 1449863..9ae90a1 100644
--- a/engines/wintermute/ad/ad_scene_geometry.cpp
+++ b/engines/wintermute/ad/ad_scene_geometry.cpp
@@ -555,7 +555,7 @@ Math::Vector3d AdSceneGeometry::getBlockIntersection(Math::Vector3d *p1, Math::V
}
//////////////////////////////////////////////////////////////////////////
-bool AdSceneGeometry::convert2Dto3DTolerant(int x, int y, Math::Vector3d *pos) {
+bool AdSceneGeometry::convert2Dto3DTolerant(int32 x, int32 y, Math::Vector3d *pos) {
bool Ret = convert2Dto3D(x, y, pos);
if (Ret) {
return Ret;
@@ -639,7 +639,7 @@ bool AdSceneGeometry::convert2Dto3DTolerant(int x, int y, Math::Vector3d *pos) {
}
//////////////////////////////////////////////////////////////////////////
-bool AdSceneGeometry::convert2Dto3D(int x, int y, Math::Vector3d *pos) {
+bool AdSceneGeometry::convert2Dto3D(int32 x, int32 y, Math::Vector3d *pos) {
bool intFound = false;
float minDist = FLT_MAX;
@@ -1167,7 +1167,7 @@ bool AdSceneGeometry::persist(BasePersistenceManager *persistMgr) {
int i;
//////////////////////////////////////////////////////////////////////////
- int numLights = _lights.size();
+ int32 numLights = _lights.size();
persistMgr->transferSint32(TMEMBER(numLights));
for (i = 0; i < numLights; i++) {
if (persistMgr->getIsSaving()) {
@@ -1200,7 +1200,7 @@ bool AdSceneGeometry::persist(BasePersistenceManager *persistMgr) {
createLights();
//////////////////////////////////////////////////////////////////////////
- int numBlocks = _blocks.size();
+ int32 numBlocks = _blocks.size();
persistMgr->transferSint32(TMEMBER(numBlocks));
for (i = 0; i < numBlocks; i++) {
if (persistMgr->getIsSaving()) {
@@ -1230,7 +1230,7 @@ bool AdSceneGeometry::persist(BasePersistenceManager *persistMgr) {
}
//////////////////////////////////////////////////////////////////////////
- int numPlanes = _planes.size();
+ int32 numPlanes = _planes.size();
persistMgr->transferSint32(TMEMBER(numPlanes));
for (i = 0; i < numPlanes; i++) {
if (persistMgr->getIsSaving()) {
@@ -1260,7 +1260,7 @@ bool AdSceneGeometry::persist(BasePersistenceManager *persistMgr) {
}
//////////////////////////////////////////////////////////////////////////
- int numGenerics = _generics.size();
+ int32 numGenerics = _generics.size();
persistMgr->transferSint32(TMEMBER(numGenerics));
for (i = 0; i < numGenerics; i++) {
if (persistMgr->getIsSaving()) {
@@ -1297,7 +1297,7 @@ bool AdSceneGeometry::persist(BasePersistenceManager *persistMgr) {
}
//////////////////////////////////////////////////////////////////////////
-bool AdSceneGeometry::convert3Dto2D(Math::Vector3d *pos, int *x, int *y) {
+bool AdSceneGeometry::convert3Dto2D(Math::Vector3d *pos, int32 *x, int32 *y) {
Math::Matrix4 worldMat;
worldMat.setToIdentity();
diff --git a/engines/wintermute/ad/ad_scene_geometry.h b/engines/wintermute/ad/ad_scene_geometry.h
index faae71f..e06c514 100644
--- a/engines/wintermute/ad/ad_scene_geometry.h
+++ b/engines/wintermute/ad/ad_scene_geometry.h
@@ -79,9 +79,9 @@ public:
float getPointsDist(Math::Vector3d p1, Math::Vector3d p2);
void pathFinderStep();
bool getPath(Math::Vector3d source, Math::Vector3d target, AdPath3D *path, bool rerun = false);
- bool convert2Dto3D(int x, int y, Math::Vector3d *pos);
- bool convert2Dto3DTolerant(int x, int y, Math::Vector3d *pos);
- bool convert3Dto2D(Math::Vector3d *pos, int *x, int *y);
+ bool convert2Dto3D(int32 x, int32 y, Math::Vector3d *pos);
+ bool convert2Dto3DTolerant(int32 x, int32 y, Math::Vector3d *pos);
+ bool convert3Dto2D(Math::Vector3d *pos, int32 *x, int32 *y);
BaseSprite *_wptMarker;
float _waypointHeight;
bool directPathExists(Math::Vector3d *p1, Math::Vector3d *p2);
@@ -98,11 +98,11 @@ public:
//bool SetActiveCameraTwin(char* Camera);
//bool SetActiveCameraTwin(int Camera);
Camera3D *getActiveCamera();
- int _activeCamera;
+ int32 _activeCamera;
bool setActiveLight(char *light);
bool setActiveLight(int light);
- int _activeLight;
+ int32 _activeLight;
void cleanup();
AdSceneGeometry(BaseGame *inGame);
diff --git a/engines/wintermute/base/gfx/base_renderer3d.cpp b/engines/wintermute/base/gfx/base_renderer3d.cpp
index bc3d86a..12b5563 100644
--- a/engines/wintermute/base/gfx/base_renderer3d.cpp
+++ b/engines/wintermute/base/gfx/base_renderer3d.cpp
@@ -45,7 +45,7 @@ bool BaseRenderer3D::setDefaultAmbientLightColor() {
return true;
}
-void BaseRenderer3D::project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int &x, int &y) {
+void BaseRenderer3D::project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int32 &x, int32 &y) {
Math::Matrix4 tmp = worldMatrix;
tmp.transpose();
Math::Vector3d windowCoords;
diff --git a/engines/wintermute/base/gfx/base_renderer3d.h b/engines/wintermute/base/gfx/base_renderer3d.h
index adca76c..0c6c7dd 100644
--- a/engines/wintermute/base/gfx/base_renderer3d.h
+++ b/engines/wintermute/base/gfx/base_renderer3d.h
@@ -83,7 +83,7 @@ public:
virtual void resetModelViewTransform() = 0;
virtual void setWorldTransform(const Math::Matrix4 &transform) = 0;
- void project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int &x, int &y);
+ void project(const Math::Matrix4 &worldMatrix, const Math::Vector3d &point, int32 &x, int32 &y);
Math::Ray rayIntoScene(int x, int y);
Math::Matrix4 lastProjectionMatrix() {
diff --git a/engines/wintermute/base/gfx/x/active_animation.h b/engines/wintermute/base/gfx/x/active_animation.h
index fb2ac33..9e3ea50 100644
--- a/engines/wintermute/base/gfx/x/active_animation.h
+++ b/engines/wintermute/base/gfx/x/active_animation.h
@@ -63,7 +63,7 @@ public:
private:
ModelX *_model;
- int _currentFrame;
+ int32 _currentFrame;
uint32 _startTime;
bool _looping;
bool _finished;
diff --git a/engines/wintermute/base/gfx/x/animation_set.cpp b/engines/wintermute/base/gfx/x/animation_set.cpp
index 8dec7dd..27d5b8d 100644
--- a/engines/wintermute/base/gfx/x/animation_set.cpp
+++ b/engines/wintermute/base/gfx/x/animation_set.cpp
@@ -204,7 +204,7 @@ bool AnimationSet::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferBool(TMEMBER(_looping));
// persist events
- int numEvents;
+ int32 numEvents;
if (persistMgr->getIsSaving()) {
numEvents = _events.size();
}
diff --git a/engines/wintermute/base/gfx/x/modelx.cpp b/engines/wintermute/base/gfx/x/modelx.cpp
index 4d47d6e..b2aaccc 100644
--- a/engines/wintermute/base/gfx/x/modelx.cpp
+++ b/engines/wintermute/base/gfx/x/modelx.cpp
@@ -559,8 +559,8 @@ void ModelX::updateBoundingRect() {
float z1 = _BBoxStart.z();
float z2 = _BBoxEnd.z();
- int screenX = 0;
- int screenY = 0;
+ int32 screenX = 0;
+ int32 screenY = 0;
_gameRef->_renderer3D->project(_lastWorldMat, Math::Vector3d(x1, y1, z1), screenX, screenY);
updateRect(&_boundingRect, screenX, screenY);
@@ -588,7 +588,7 @@ void ModelX::updateBoundingRect() {
}
//////////////////////////////////////////////////////////////////////////
-void ModelX::updateRect(Rect32 *rc, int x, int y) {
+void ModelX::updateRect(Rect32 *rc, int32 x, int32 y) {
rc->left = MIN(rc->left, x);
rc->right = MAX(rc->right, x);
rc->top = MIN(rc->top, y);
@@ -855,7 +855,7 @@ bool ModelX::persist(BasePersistenceManager *persistMgr) {
persistMgr->transferPtr(TMEMBER(_parentModel));
// animation properties
- int numAnims;
+ int32 numAnims;
if (persistMgr->getIsSaving()) {
numAnims = _animationSets.size();
}
@@ -893,7 +893,7 @@ bool ModelX::persist(BasePersistenceManager *persistMgr) {
}
// persist material sprites
- int numMatSprites;
+ int32 numMatSprites;
if (persistMgr->getIsSaving()) {
numMatSprites = _matSprites.size();
}
diff --git a/engines/wintermute/base/gfx/x/modelx.h b/engines/wintermute/base/gfx/x/modelx.h
index 7fc6133..674ad8a 100644
--- a/engines/wintermute/base/gfx/x/modelx.h
+++ b/engines/wintermute/base/gfx/x/modelx.h
@@ -193,12 +193,12 @@ private:
void parseFrameDuringMerge(XFileLexer &lexer, const Common::String &filename);
void updateBoundingRect();
- void static inline updateRect(Rect32 *rc, int x, int y);
+ void static inline updateRect(Rect32 *rc, int32 x, int32 y);
Rect32 _drawingViewport;
Math::Matrix4 _lastViewMat;
Math::Matrix4 _lastProjMat;
- int _lastOffsetX;
- int _lastOffsetY;
+ int32 _lastOffsetX;
+ int32 _lastOffsetY;
Math::Vector3d _BBoxStart;
Math::Vector3d _BBoxEnd;