Skip to content

Commit

Permalink
Removed camera override to fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Nov 10, 2024
1 parent 2ccf9a7 commit 55afa27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Sources/Jazz2/PlayerViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ namespace Jazz2
PlayerViewport::PlayerViewport(LevelHandler* levelHandler, Actors::Player* targetPlayer)
: _levelHandler(levelHandler), _targetPlayer(targetPlayer),
_downsamplePass(this), _blurPass1(this), _blurPass2(this), _blurPass3(this), _blurPass4(this),
_cameraOverridePos(INFINITY, INFINITY), _cameraResponsiveness(1.0f, 1.0f), _shakeDuration(0.0f)
_cameraResponsiveness(1.0f, 1.0f), _shakeDuration(0.0f)
{
_ambientLight = levelHandler->_defaultAmbientLight;
_ambientLightTarget = _ambientLight.W;
Expand Down Expand Up @@ -357,7 +357,8 @@ namespace Jazz2
Vector2f focusPos = _targetPlayer->GetPos();

bool overridePosX = false, overridePosY = false;
if (!std::isinf(_cameraOverridePos.X)) {
// TODO: Not working correctly on some platforms
/*if (!std::isinf(_cameraOverridePos.X)) {
overridePosX = true;
focusPos.X = _cameraOverridePos.X;
if (focusPos.X <= 0.0f) {
Expand All @@ -370,7 +371,7 @@ namespace Jazz2
if (focusPos.Y <= 0.0f) {
focusPos.Y = halfView.Y - 1.0f - focusPos.Y;
}
}
}*/

// If player doesn't move but has some speed, it's probably stuck, so reset the speed
Vector2f focusSpeed = _targetPlayer->GetSpeed();
Expand Down Expand Up @@ -455,14 +456,15 @@ namespace Jazz2

void PlayerViewport::OverrideCamera(float x, float y, bool topLeft)
{
if (topLeft) {
// TODO: Not working correctly on some platforms
/*if (topLeft) {
// Use negative values for top-left alignment
_cameraOverridePos.X = -x;
_cameraOverridePos.Y = -y;
} else {
_cameraOverridePos.X = x;
_cameraOverridePos.Y = y;
}
}*/
}

void PlayerViewport::WarpCameraToTarget(bool fast)
Expand Down
1 change: 0 additions & 1 deletion Sources/Jazz2/PlayerViewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ namespace Jazz2
Rectf _viewBounds;
Vector2f _cameraPos;
Vector2f _cameraLastPos;
Vector2f _cameraOverridePos;
Vector2f _cameraDistanceFactor;
Vector2f _cameraResponsiveness;
float _shakeDuration;
Expand Down

0 comments on commit 55afa27

Please sign in to comment.