From be371233192a26611f4a36a30b81831a5bc0d8ef Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Thu, 13 Nov 2025 17:13:00 +1100 Subject: [PATCH 1/4] feat: Add ability to rotate the camera in 45 degree increments --- .../GameEngine/Include/Common/MessageStream.h | 2 ++ .../GameClient/MessageStream/CommandXlat.cpp | 8 ++++++++ .../GameClient/MessageStream/MetaEvent.cpp | 20 +++++++++++++++++++ .../GameEngine/Include/Common/MessageStream.h | 2 ++ .../GameClient/MessageStream/CommandXlat.cpp | 8 ++++++++ .../GameClient/MessageStream/MetaEvent.cpp | 20 +++++++++++++++++++ 6 files changed, 60 insertions(+) diff --git a/Generals/Code/GameEngine/Include/Common/MessageStream.h b/Generals/Code/GameEngine/Include/Common/MessageStream.h index a36aeed7ad..9f35506335 100644 --- a/Generals/Code/GameEngine/Include/Common/MessageStream.h +++ b/Generals/Code/GameEngine/Include/Common/MessageStream.h @@ -263,8 +263,10 @@ class GameMessage : public MemoryPoolObject MSG_META_BEGIN_CAMERA_ROTATE_LEFT, MSG_META_END_CAMERA_ROTATE_LEFT, + MSG_META_ALT_CAMERA_ROTATE_LEFT, MSG_META_BEGIN_CAMERA_ROTATE_RIGHT, MSG_META_END_CAMERA_ROTATE_RIGHT, + MSG_META_ALT_CAMERA_ROTATE_RIGHT, MSG_META_BEGIN_CAMERA_ZOOM_IN, MSG_META_END_CAMERA_ZOOM_IN, MSG_META_BEGIN_CAMERA_ZOOM_OUT, diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index f71498c242..1d4dd5189a 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -3271,6 +3271,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage DEBUG_ASSERTCRASH(TheInGameUI->isCameraRotatingLeft(), ("Clearing rotate camera left, but it's already clear!")); TheInGameUI->setCameraRotateLeft( false ); break; + case GameMessage::MSG_META_ALT_CAMERA_ROTATE_LEFT: + if (TheTacticalView->isCameraMovementFinished()) + TheTacticalView->rotateCamera(-1.0f / 8.0f, 500); + break; case GameMessage::MSG_META_BEGIN_CAMERA_ROTATE_RIGHT: DEBUG_ASSERTCRASH(!TheInGameUI->isCameraRotatingRight(), ("Setting rotate camera right, but it's already set!")); TheInGameUI->setCameraRotateRight( true ); @@ -3279,6 +3283,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage DEBUG_ASSERTCRASH(TheInGameUI->isCameraRotatingRight(), ("Clearing rotate camera right, but it's already clear!")); TheInGameUI->setCameraRotateRight( false ); break; + case GameMessage::MSG_META_ALT_CAMERA_ROTATE_RIGHT: + if (TheTacticalView->isCameraMovementFinished()) + TheTacticalView->rotateCamera(1.0f / 8.0f, 500); + break; case GameMessage::MSG_META_BEGIN_CAMERA_ZOOM_IN: DEBUG_ASSERTCRASH(!TheInGameUI->isCameraZoomingIn(), ("Setting zoom camera in, but it's already set!")); TheInGameUI->setCameraZoomIn( true ); diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index 2b8b0c18a0..42fc47022e 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -793,6 +793,26 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t) map->m_displayName = TheGameText->FETCH_OR_SUBSTITUTE("GUI:SelectNextIdleWorker", L"Next Idle Worker"); } } + { + MetaMapRec* map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_ALT_CAMERA_ROTATE_LEFT); + if (map->m_key == MK_NONE) { + map->m_key = MK_KP4; + map->m_transition = DOWN; + map->m_modState = CTRL; + map->m_usableIn = COMMANDUSABLE_GAME; + map->m_category = CATEGORY_SELECTION; + } + } + { + MetaMapRec* map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_ALT_CAMERA_ROTATE_RIGHT); + if (map->m_key == MK_NONE) { + map->m_key = MK_KP6; + map->m_transition = DOWN; + map->m_modState = CTRL; + map->m_usableIn = COMMANDUSABLE_GAME; + map->m_category = CATEGORY_SELECTION; + } + } #if defined(RTS_DEBUG) { diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index 324f28cfdc..92b17c66a8 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -263,8 +263,10 @@ class GameMessage : public MemoryPoolObject MSG_META_BEGIN_CAMERA_ROTATE_LEFT, MSG_META_END_CAMERA_ROTATE_LEFT, + MSG_META_ALT_CAMERA_ROTATE_LEFT, MSG_META_BEGIN_CAMERA_ROTATE_RIGHT, MSG_META_END_CAMERA_ROTATE_RIGHT, + MSG_META_ALT_CAMERA_ROTATE_RIGHT, MSG_META_BEGIN_CAMERA_ZOOM_IN, MSG_META_END_CAMERA_ZOOM_IN, MSG_META_BEGIN_CAMERA_ZOOM_OUT, diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 633474ef7f..042644dbe5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -3416,6 +3416,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage DEBUG_ASSERTCRASH(TheInGameUI->isCameraRotatingLeft(), ("Clearing rotate camera left, but it's already clear!")); TheInGameUI->setCameraRotateLeft( false ); break; + case GameMessage::MSG_META_ALT_CAMERA_ROTATE_LEFT: + if (TheTacticalView->isCameraMovementFinished()) + TheTacticalView->rotateCamera(-1.0f / 8.0f, 500, 99.9f, 399.9f); + break; case GameMessage::MSG_META_BEGIN_CAMERA_ROTATE_RIGHT: DEBUG_ASSERTCRASH(!TheInGameUI->isCameraRotatingRight(), ("Setting rotate camera right, but it's already set!")); TheInGameUI->setCameraRotateRight( true ); @@ -3424,6 +3428,10 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage DEBUG_ASSERTCRASH(TheInGameUI->isCameraRotatingRight(), ("Clearing rotate camera right, but it's already clear!")); TheInGameUI->setCameraRotateRight( false ); break; + case GameMessage::MSG_META_ALT_CAMERA_ROTATE_RIGHT: + if (TheTacticalView->isCameraMovementFinished()) + TheTacticalView->rotateCamera(1.0f / 8.0f, 500, 99.9f, 399.9f); + break; case GameMessage::MSG_META_BEGIN_CAMERA_ZOOM_IN: DEBUG_ASSERTCRASH(!TheInGameUI->isCameraZoomingIn(), ("Setting zoom camera in, but it's already set!")); TheInGameUI->setCameraZoomIn( true ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index 2a7f4097fc..c0fb3e98dc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -851,6 +851,26 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t) map->m_displayName = TheGameText->FETCH_OR_SUBSTITUTE("GUI:SelectNextIdleWorker", L"Next Idle Worker"); } } + { + MetaMapRec* map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_ALT_CAMERA_ROTATE_LEFT); + if (map->m_key == MK_NONE) { + map->m_key = MK_KP4; + map->m_transition = DOWN; + map->m_modState = CTRL; + map->m_usableIn = COMMANDUSABLE_GAME; + map->m_category = CATEGORY_SELECTION; + } + } + { + MetaMapRec* map = TheMetaMap->getMetaMapRec(GameMessage::MSG_META_ALT_CAMERA_ROTATE_RIGHT); + if (map->m_key == MK_NONE) { + map->m_key = MK_KP6; + map->m_transition = DOWN; + map->m_modState = CTRL; + map->m_usableIn = COMMANDUSABLE_GAME; + map->m_category = CATEGORY_SELECTION; + } + } #if defined(RTS_DEBUG) { From 55069d8a36302668008eb20db610215a9287beb7 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 14 Nov 2025 17:49:57 +1100 Subject: [PATCH 2/4] fix: Remove erroneous categories --- .../GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp | 2 -- .../GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index 42fc47022e..82e81e29f7 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -800,7 +800,6 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t) map->m_transition = DOWN; map->m_modState = CTRL; map->m_usableIn = COMMANDUSABLE_GAME; - map->m_category = CATEGORY_SELECTION; } } { @@ -810,7 +809,6 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t) map->m_transition = DOWN; map->m_modState = CTRL; map->m_usableIn = COMMANDUSABLE_GAME; - map->m_category = CATEGORY_SELECTION; } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp index c0fb3e98dc..aeaf2287b4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp @@ -858,7 +858,6 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t) map->m_transition = DOWN; map->m_modState = CTRL; map->m_usableIn = COMMANDUSABLE_GAME; - map->m_category = CATEGORY_SELECTION; } } { @@ -868,7 +867,6 @@ MetaMapRec *MetaMap::getMetaMapRec(GameMessage::Type t) map->m_transition = DOWN; map->m_modState = CTRL; map->m_usableIn = COMMANDUSABLE_GAME; - map->m_category = CATEGORY_SELECTION; } } From e39e6106f25018ab6aae5daa3e47398444ebf1e6 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 14 Nov 2025 17:52:41 +1100 Subject: [PATCH 3/4] docs: Add comments --- Generals/Code/GameEngine/Include/Common/MessageStream.h | 4 ++-- GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/MessageStream.h b/Generals/Code/GameEngine/Include/Common/MessageStream.h index 9f35506335..8c5e6c188e 100644 --- a/Generals/Code/GameEngine/Include/Common/MessageStream.h +++ b/Generals/Code/GameEngine/Include/Common/MessageStream.h @@ -263,10 +263,10 @@ class GameMessage : public MemoryPoolObject MSG_META_BEGIN_CAMERA_ROTATE_LEFT, MSG_META_END_CAMERA_ROTATE_LEFT, - MSG_META_ALT_CAMERA_ROTATE_LEFT, + MSG_META_ALT_CAMERA_ROTATE_LEFT, ///< TheSuperHackers @feature Rotate camera in 45 degree increments MSG_META_BEGIN_CAMERA_ROTATE_RIGHT, MSG_META_END_CAMERA_ROTATE_RIGHT, - MSG_META_ALT_CAMERA_ROTATE_RIGHT, + MSG_META_ALT_CAMERA_ROTATE_RIGHT, ///< TheSuperHackers @feature Rotate camera in 45 degree increments MSG_META_BEGIN_CAMERA_ZOOM_IN, MSG_META_END_CAMERA_ZOOM_IN, MSG_META_BEGIN_CAMERA_ZOOM_OUT, diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h index 92b17c66a8..b0ae5db5e4 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h @@ -263,10 +263,10 @@ class GameMessage : public MemoryPoolObject MSG_META_BEGIN_CAMERA_ROTATE_LEFT, MSG_META_END_CAMERA_ROTATE_LEFT, - MSG_META_ALT_CAMERA_ROTATE_LEFT, + MSG_META_ALT_CAMERA_ROTATE_LEFT, ///< TheSuperHackers @feature Rotate camera in 45 degree increments MSG_META_BEGIN_CAMERA_ROTATE_RIGHT, MSG_META_END_CAMERA_ROTATE_RIGHT, - MSG_META_ALT_CAMERA_ROTATE_RIGHT, + MSG_META_ALT_CAMERA_ROTATE_RIGHT, ///< TheSuperHackers @feature Rotate camera in 45 degree increments MSG_META_BEGIN_CAMERA_ZOOM_IN, MSG_META_END_CAMERA_ZOOM_IN, MSG_META_BEGIN_CAMERA_ZOOM_OUT, From e581044765ef07d25c3babea1e6afd864e42f132 Mon Sep 17 00:00:00 2001 From: Stubbjax Date: Fri, 14 Nov 2025 20:26:21 +1100 Subject: [PATCH 4/4] tweak: Streamline easing values --- .../Source/GameClient/MessageStream/CommandXlat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 042644dbe5..b401e979cf 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -3418,7 +3418,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage break; case GameMessage::MSG_META_ALT_CAMERA_ROTATE_LEFT: if (TheTacticalView->isCameraMovementFinished()) - TheTacticalView->rotateCamera(-1.0f / 8.0f, 500, 99.9f, 399.9f); + TheTacticalView->rotateCamera(-1.0f / 8.0f, 500, 100, 400); break; case GameMessage::MSG_META_BEGIN_CAMERA_ROTATE_RIGHT: DEBUG_ASSERTCRASH(!TheInGameUI->isCameraRotatingRight(), ("Setting rotate camera right, but it's already set!")); @@ -3430,7 +3430,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage break; case GameMessage::MSG_META_ALT_CAMERA_ROTATE_RIGHT: if (TheTacticalView->isCameraMovementFinished()) - TheTacticalView->rotateCamera(1.0f / 8.0f, 500, 99.9f, 399.9f); + TheTacticalView->rotateCamera(1.0f / 8.0f, 500, 100, 400); break; case GameMessage::MSG_META_BEGIN_CAMERA_ZOOM_IN: DEBUG_ASSERTCRASH(!TheInGameUI->isCameraZoomingIn(), ("Setting zoom camera in, but it's already set!"));