[Scummvm-git-logs] scummvm master -> fa27fd7478f3326228cb16f4c0e392639aaed4a1
dreammaster
dreammaster at scummvm.org
Sun Apr 16 19:03:22 CEST 2017
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:
fa27fd7478 TITANIC: Extra debugging info for starfield movement
Commit: fa27fd7478f3326228cb16f4c0e392639aaed4a1
https://github.com/scummvm/scummvm/commit/fa27fd7478f3326228cb16f4c0e392639aaed4a1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-04-16T13:03:12-04:00
Commit Message:
TITANIC: Extra debugging info for starfield movement
Changed paths:
engines/titanic/star_control/fvector.cpp
engines/titanic/star_control/fvector.h
engines/titanic/star_control/star_camera.cpp
engines/titanic/star_control/star_camera.h
engines/titanic/star_control/star_control_sub13.cpp
engines/titanic/star_control/star_control_sub21.cpp
engines/titanic/star_control/star_view.cpp
engines/titanic/titanic.cpp
engines/titanic/titanic.h
diff --git a/engines/titanic/star_control/fvector.cpp b/engines/titanic/star_control/fvector.cpp
index 19fbefb..ff07b9b 100644
--- a/engines/titanic/star_control/fvector.cpp
+++ b/engines/titanic/star_control/fvector.cpp
@@ -82,4 +82,8 @@ FVector FVector::fn5(const FPose &pose) const {
return v;
}
+Common::String FVector::toString() const {
+ return Common::String::format("(%.3f,%.3f,%.3f)", _x, _y, _z);
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h
index 6ad2818..a9cb44a 100644
--- a/engines/titanic/star_control/fvector.h
+++ b/engines/titanic/star_control/fvector.h
@@ -122,6 +122,11 @@ public:
_x -= delta._x;
_y -= delta._y;
}
+
+ /**
+ * Converts the vector to a string
+ */
+ Common::String toString() const;
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp
index 071448a..adcc7e4 100644
--- a/engines/titanic/star_control/star_camera.cpp
+++ b/engines/titanic/star_control/star_camera.cpp
@@ -220,8 +220,8 @@ FVector CStarCamera::proc31(int index, const FVector &v) {
return _sub13.fn18(index, v);
}
-void CStarCamera::setViewportPosition(const FPoint &angles) {
- debug(DEBUG_INTERMEDIATE, "setViewportPosition %f %f", angles._x, angles._y);
+void CStarCamera::setViewportAngle(const FPoint &angles) {
+ debug(DEBUG_DETAILED, "setViewportAngle %f %f", angles._x, angles._y);
if (isLocked())
return;
diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h
index 4363606..e389f14 100644
--- a/engines/titanic/star_control/star_camera.h
+++ b/engines/titanic/star_control/star_camera.h
@@ -111,7 +111,7 @@ public:
/**
* Sets the viewport position within the starfield
*/
- virtual void setViewportPosition(const FPoint &angles);
+ virtual void setViewportAngle(const FPoint &angles);
virtual int getMatrixRow() const { return _matrixRow; }
virtual bool addMatrixRow(const FVector &v);
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index 74b3d72..8565d81 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -101,6 +101,7 @@ void CStarControlSub13::save(SimpleFile *file, int indent) {
}
void CStarControlSub13::setPosition(const FVector &v) {
+ debugC(DEBUG_INTERMEDIATE, kDebugStarfield, "Setting starmap position to %s", v.toString().c_str());
_position = v;
_flag = false;
}
diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp
index 4f95ad2..89ea3a1 100644
--- a/engines/titanic/star_control/star_control_sub21.cpp
+++ b/engines/titanic/star_control/star_control_sub21.cpp
@@ -23,6 +23,7 @@
#include "titanic/star_control/star_control_sub21.h"
#include "titanic/star_control/dmatrix.h"
#include "titanic/star_control/dvector.h"
+#include "titanic/titanic.h"
#include "common/textconsole.h"
namespace Titanic {
@@ -35,6 +36,8 @@ void CStarControlSub21::moveTo(const FVector &srcV, const FVector &destV, const
if (isLocked())
decLockCount();
+ debugC(DEBUG_BASIC, kDebugStarfield, "Starfield move %s to %s", srcV.toString().c_str(),
+ destV.toString().c_str());
_sub24.setPath(srcV, destV, srcM);
}
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 95c6a38..fd2c407 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -135,7 +135,7 @@ bool CStarView::MouseMoveMsg(int unused, const Point &pt) {
FPoint angle(tempPt._x * -2.0 * distance / threshold,
tempPt._y * -2.0 * distance / threshold);
- _camera.setViewportPosition(angle);
+ _camera.setViewportAngle(angle);
return true;
}
}
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 116c334..d95098c 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -66,7 +66,7 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
DebugMan.addDebugChannel(kDebugCore, "core", "Core engine debug level");
DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
- DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
+ DebugMan.addDebugChannel(kDebugStarfield, "starfield", "Starfield logic");
}
TitanicEngine::~TitanicEngine() {
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 90537e7..12a880e 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -55,7 +55,7 @@ enum TitanicDebugChannels {
kDebugCore = 1 << 0,
kDebugScripts = 1 << 1,
kDebugGraphics = 1 << 2,
- kDebugSound = 1 << 3
+ kDebugStarfield = 1 << 3
};
#define TITANIC_SAVEGAME_VERSION 1
More information about the Scummvm-git-logs
mailing list