STARK: Fix a property type for the Camera resource

This commit is contained in:
Bastien Bouclet 2015-01-02 17:57:43 +01:00
parent 495e8e2611
commit 4ab64b7a1d
4 changed files with 12 additions and 8 deletions

View File

@ -41,7 +41,7 @@ void Camera::readData(XRCReadStream *stream) {
_lookAt = stream->readVector3();
_fov = stream->readFloat();
_f2 = stream->readFloat();
_v3 = stream->readVector4();
_viewport = stream->readRect();
_v4 = stream->readVector3();
}
@ -51,7 +51,7 @@ void Camera::printData() {
debug << "lookAt: " << _lookAt << "\n";
debug << "fov: " << _fov << "\n";
debug << "f1: " << _f2 << "\n";
debug << "v3: " << _v3 << "\n";
_viewport.debugPrint(0, "viewport:");
debug << "v4: " << _v4 << "\n";
}

View File

@ -24,6 +24,7 @@
#define STARK_RESOURCES_CAMERA_H
#include "common/array.h"
#include "common/rect.h"
#include "common/str.h"
#include "math/vector3d.h"
@ -48,7 +49,7 @@ protected:
Math::Vector3d _lookAt;
float _fov;
float _f2;
Math::Vector4d _v3;
Common::Rect _viewport;
Math::Vector3d _v4;
};

View File

@ -90,10 +90,13 @@ Math::Vector3d XRCReadStream::readVector3() {
return v;
}
Math::Vector4d XRCReadStream::readVector4() {
Math::Vector4d v;
v.readFromStream(this);
return v;
Common::Rect XRCReadStream::readRect() {
Common::Rect r;
r.left = readSint32LE();
r.top = readSint32LE();
r.right = readSint32LE();
r.bottom = readSint32LE();
return r;
}
Common::Point XRCReadStream::readPoint() {

View File

@ -54,7 +54,7 @@ public:
ResourceType readResourceType();
ResourceReference readResourceReference();
Math::Vector3d readVector3();
Math::Vector4d readVector4();
Common::Rect readRect();
Common::Point readPoint();
float readFloat();
bool readBool();