File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed
GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream
Generals/Code/GameEngine/Source/GameClient/MessageStream Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -423,15 +423,17 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
423
423
m_anchor.y = m_currentPos.y - maxY;
424
424
}
425
425
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
428
427
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 ();
431
432
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
+ // TheSuperHackers @tweak Rescale the scroll factor so the default scroll speed at 50 will result in the RMB scrolling being identical to the original 30FPS retail behavior
434
+ const float scrollRescalingFactor = 0.50 ;
435
+ offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.x * (scrollRescalingFactor + TheGlobalData->m_keyboardScrollFactor );
436
+ offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.y * (scrollRescalingFactor + TheGlobalData->m_keyboardScrollFactor );
435
437
}
436
438
break ;
437
439
case SCROLL_KEY:
Original file line number Diff line number Diff line change @@ -422,15 +422,17 @@ GameMessageDisposition LookAtTranslator::translateGameMessage(const GameMessage
422
422
m_anchor.y = m_currentPos.y - maxY;
423
423
}
424
424
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
427
426
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 ();
430
431
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
+ // TheSuperHackers @tweak Rescale the scroll factor so the default scroll speed at 50 will result in the RMB scrolling being identical to the original 30FPS retail behavior
433
+ const float scrollRescalingFactor = 0.50 ;
434
+ offset.x = TheGlobalData->m_horizontalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.x * (scrollRescalingFactor + TheGlobalData->m_keyboardScrollFactor );
435
+ offset.y = TheGlobalData->m_verticalScrollSpeedFactor * logicToFpsRatio * vecLength * vec.y * (scrollRescalingFactor + TheGlobalData->m_keyboardScrollFactor );
434
436
}
435
437
break ;
436
438
case SCROLL_KEY:
You can’t perform that action at this time.
0 commit comments