X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions video/qt_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class QuickTimeDecoder : public VideoDecoder, public Audio::QuickTimeAudioDecode
// QTVR stuff
////////////////
void setTargetSize(uint16 w, uint16 h);
void setOrigin(int left, int top) { _origin = Common::Point(left, top); }

void handleMouseMove(int16 x, int16 y);
void handleMouseButton(bool isDown, int16 x = -1, int16 y = -1, bool repeat = false);
Expand All @@ -96,6 +97,7 @@ class QuickTimeDecoder : public VideoDecoder, public Audio::QuickTimeAudioDecode
float getTiltAngle() const { return _tiltAngle; }
void setTiltAngle(float tiltAngle);
float getFOV() const { return _fov; }
float getHFOV() const { return _hfov; }
bool setFOV(float fov);
int getCurrentNodeID() { return _currentSample == -1 ? 0 : _panoTrack->panoSamples[_currentSample].hdr.nodeID; }
Common::String getCurrentNodeName();
Expand Down Expand Up @@ -182,6 +184,11 @@ class QuickTimeDecoder : public VideoDecoder, public Audio::QuickTimeAudioDecode
void computeInteractivityZones();

uint16 _width, _height;
// _origin is the top left corner point of the panorama video being played
// by director engine or whichever engine is using QTVR decoder currently
// decoder handles swing transitions (in QTVR xtra) internally
// Hence, it needs to know where to blit the projected panorama during transition
Common::Point _origin;

public:
int _currentSample = -1;
Expand Down Expand Up @@ -409,19 +416,34 @@ class QuickTimeDecoder : public VideoDecoder, public Audio::QuickTimeAudioDecode
QuickTimeDecoder *_decoder;
Common::QuickTimeParser::Track *_parent;

void projectPanorama();
void projectPanorama(uint8 scaleFactor, float fov, float hfov, float panAngle, float tiltAngle);
void swingTransitionHandler();
void boxAverage(Graphics::Surface *sourceSurface, uint8 scaleFactor);
Graphics::Surface* upscalePanorama(Graphics::Surface *sourceSurface, int8 level);

const Graphics::Surface *bufferNextFrame();

public:
Graphics::Surface *_constructedPano;
Graphics::Surface *_upscaledConstructedPano;
Graphics::Surface *_constructedHotspots;
Graphics::Surface *_projectedPano;
Graphics::Surface *_planarProjection;

// Current upscale level (1 or 2) of _upscaledConstructedPanorama compared to _constructedPano
// Level 1 means only upscaled height (2x pixels), level 2 means upscaled height and width (4x pixels)
uint8 _upscaleLevel = 0;

// Defining these to make the swing transition happen
// which requires storing the previous point during every change in FOV, Pan Angle and Tilt Angle
// If swing transition is called, this will be the start point of the transition
float _currentFOV = 0;
float _currentHFOV = 0;
float _currentPanAngle = 0;
float _currentTiltAngle = 0;

private:
bool _isPanoConstructed;

bool _dirty;
};
};
Expand Down
Loading
Loading
X Tutup