File tree Expand file tree Collapse file tree
GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream
Generals/Code/GameEngine/Source/GameClient/MessageStream Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -423,15 +423,15 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
423423 m_anchor.y = m_currentPos.y - maxY;
424424 }
425425
426- offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.x - m_anchor.x );
427- offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.y - m_anchor.y );
426+ // TheSuperHackers @fix Mauller 16/06/2025 fix RMB scrolling to allow it to scale with the user adjusted scroll factor
428427 Coord2D vec;
429- vec.x = offset.x ;
430- vec.y = offset.y ;
428+ vec.x = (m_currentPos.x - m_anchor.x );
429+ vec.y = (m_currentPos.y - m_anchor.y );
430+ // TheSuperHackers @info calculate the length of the vector to obtain the movement speed before the vector is normalized
431+ float vecLength = vec.length ();
431432 vec.normalize ();
432- // Add in the window scroll amount as the minimum.
433- offset.x += TheGlobalData->m_horizontalScrollSpeedFactor * vec.x * sqr (TheGlobalData->m_keyboardScrollFactor );
434- offset.y += TheGlobalData->m_verticalScrollSpeedFactor * vec.y * sqr (TheGlobalData->m_keyboardScrollFactor );
433+ offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.x * TheGlobalData->m_keyboardScrollFactor ;
434+ offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.y * TheGlobalData->m_keyboardScrollFactor ;
435435 }
436436 break ;
437437 case SCROLL_KEY :
Original file line number Diff line number Diff line change @@ -422,15 +422,15 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
422422 m_anchor.y = m_currentPos.y - maxY;
423423 }
424424
425- offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.x - m_anchor.x );
426- offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * (m_currentPos.y - m_anchor.y );
425+ // TheSuperHackers @fix Mauller 16/06/2025 fix RMB scrolling to allow it to scale with the user adjusted scroll factor
427426 Coord2D vec;
428- vec.x = offset.x ;
429- vec.y = offset.y ;
427+ vec.x = (m_currentPos.x - m_anchor.x );
428+ vec.y = (m_currentPos.y - m_anchor.y );
429+ // TheSuperHackers @info calculate the length of the vector to obtain the movement speed before the vector is normalized
430+ float vecLength = vec.length ();
430431 vec.normalize ();
431- // Add in the window scroll amount as the minimum.
432- offset.x += TheGlobalData->m_horizontalScrollSpeedFactor * vec.x * sqr (TheGlobalData->m_keyboardScrollFactor );
433- offset.y += TheGlobalData->m_verticalScrollSpeedFactor * vec.y * sqr (TheGlobalData->m_keyboardScrollFactor );
432+ offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.x * TheGlobalData->m_keyboardScrollFactor ;
433+ offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.y * TheGlobalData->m_keyboardScrollFactor ;
434434 }
435435 break ;
436436 case SCROLL_KEY :
You can’t perform that action at this time.
0 commit comments