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
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,8 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
// rotate the view up/down
if (m_isPitching)
{
const Real FACTOR = 0.01f;

Real angle = FACTOR * (m_currentPos.y - m_anchor.y);

constexpr const Real Scale = 0.01f;
const Real angle = Scale * (m_currentPos.y - m_anchor.y);
TheTacticalView->setPitch( TheTacticalView->getPitch() + angle );
m_anchor = msg->getArgument( 0 )->pixel;
}
Expand All @@ -393,10 +391,8 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
// adjust the field of view
if (m_isChangingFOV)
{
const Real FACTOR = 0.01f;

Real angle = FACTOR * (m_currentPos.y - m_anchor.y);

constexpr const Real Scale = 0.01f;
const Real angle = Scale * (m_currentPos.y - m_anchor.y);
TheTacticalView->setFieldOfView( TheTacticalView->getFieldOfView() + angle );
m_anchor = msg->getArgument( 0 )->pixel;
}
Expand All @@ -409,18 +405,9 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
{
m_lastMouseMoveTimeMsec = timeGetTime();

Int spin = msg->getArgument( 1 )->integer;

if (spin > 0)
{
for ( ; spin > 0; spin--)
TheTacticalView->zoom( -View::ZoomHeightPerSecond );
}
else
{
for ( ;spin < 0; spin++ )
TheTacticalView->zoom( +View::ZoomHeightPerSecond );
}
const Int spin = msg->getArgument( 1 )->integer;
const Real zoom = -spin * View::ZoomHeightPerSecond;
TheTacticalView->zoom(zoom);

break;
}
Expand All @@ -440,17 +427,15 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
{
Coord2D offset = {0, 0};

// If we've been forced to stop scrolling (script action?) then stop
if (m_isScrolling && !TheInGameUI->isScrolling())
{
// If we've been forced to stop scrolling (script action?)
TheInGameUI->setScrollAmount(offset);
stopScrolling();
}
else
// scroll the view
if (m_isScrolling)
else if (m_isScrolling)
{

// Scroll the view
// TheSuperHackers @bugfix Mauller 07/06/2025 The camera scrolling is now decoupled from the render update.
const Real fpsRatio = TheFramePacer->getBaseOverUpdateFpsRatio();

Expand Down Expand Up @@ -532,8 +517,11 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
TheInGameUI->setScrollAmount(offset);
TheTacticalView->scrollBy( &offset );
}
else //not scrolling so reset amount
else
{
//not scrolling so reset amount
TheInGameUI->setScrollAmount(offset);
}

//if (TheGlobalData->m_saveCameraInReplay /*&& TheRecorder->getMode() != RECORDERMODETYPE_PLAYBACK *//**/&& (TheGameLogic->isInSinglePlayerGame() || TheGameLogic->isInSkirmishGame())/**/)
//if (TheGlobalData->m_saveCameraInReplay && (TheGameLogic->isInMultiplayerGame() || TheGameLogic->isInSinglePlayerGame() || TheGameLogic->isInSkirmishGame()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,8 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
// rotate the view up/down
if (m_isPitching)
{
const Real FACTOR = 0.01f;

Real angle = FACTOR * (m_currentPos.y - m_anchor.y);

constexpr const Real Scale = 0.01f;
const Real angle = Scale * (m_currentPos.y - m_anchor.y);
TheTacticalView->setPitch( TheTacticalView->getPitch() + angle );
m_anchor = msg->getArgument( 0 )->pixel;
}
Expand All @@ -392,10 +390,8 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
// adjust the field of view
if (m_isChangingFOV)
{
const Real FACTOR = 0.01f;

Real angle = FACTOR * (m_currentPos.y - m_anchor.y);

constexpr const Real Scale = 0.01f;
const Real angle = Scale * (m_currentPos.y - m_anchor.y);
TheTacticalView->setFieldOfView( TheTacticalView->getFieldOfView() + angle );
m_anchor = msg->getArgument( 0 )->pixel;
}
Expand All @@ -408,18 +404,9 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
{
m_lastMouseMoveTimeMsec = timeGetTime();

Int spin = msg->getArgument( 1 )->integer;

if (spin > 0)
{
for ( ; spin > 0; spin--)
TheTacticalView->zoom( -View::ZoomHeightPerSecond );
}
else
{
for ( ;spin < 0; spin++ )
TheTacticalView->zoom( +View::ZoomHeightPerSecond );
Comment thread
xezon marked this conversation as resolved.
}
const Int spin = msg->getArgument( 1 )->integer;
const Real zoom = -spin * View::ZoomHeightPerSecond;
TheTacticalView->zoom(zoom);

break;
}
Expand All @@ -439,17 +426,15 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
{
Coord2D offset = {0, 0};

// If we've been forced to stop scrolling (script action?) then stop
if (m_isScrolling && !TheInGameUI->isScrolling())
{
// If we've been forced to stop scrolling (script action?)
TheInGameUI->setScrollAmount(offset);
stopScrolling();
}
else
// scroll the view
if (m_isScrolling)
else if (m_isScrolling)
{

// Scroll the view
// TheSuperHackers @bugfix Mauller 07/06/2025 The camera scrolling is now decoupled from the render update.
const Real fpsRatio = TheFramePacer->getBaseOverUpdateFpsRatio();

Expand Down Expand Up @@ -531,8 +516,11 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
TheInGameUI->setScrollAmount(offset);
TheTacticalView->scrollBy( &offset );
}
else //not scrolling so reset amount
else
{
//not scrolling so reset amount
TheInGameUI->setScrollAmount(offset);
}

//if (TheGlobalData->m_saveCameraInReplay /*&& TheRecorder->getMode() != RECORDERMODETYPE_PLAYBACK *//**/&& (TheGameLogic->isInSinglePlayerGame() || TheGameLogic->isInSkirmishGame())/**/)
//if (TheGlobalData->m_saveCameraInReplay && (TheGameLogic->isInMultiplayerGame() || TheGameLogic->isInSinglePlayerGame() || TheGameLogic->isInSkirmishGame()))
Expand Down
Loading