diff --git a/Core/GameEngine/Include/GameClient/View.h b/Core/GameEngine/Include/GameClient/View.h index 16d7171755b..251bfe42019 100644 --- a/Core/GameEngine/Include/GameClient/View.h +++ b/Core/GameEngine/Include/GameClient/View.h @@ -178,7 +178,8 @@ class View : public Snapshot virtual Real getPitch() { return m_pitch; } ///< Return current camera pitch virtual void setAngleToDefault(); ///< Set the view angle back to default virtual void setPitchToDefault(); ///< Set the view pitch back to default - virtual void getPosition(Coord3D *pos) { *pos=m_pos;} ///< Returns position camera is looking at (z will be zero) + void setPosition( const Coord3D *pos ) { m_pos = *pos; } + void getPosition(Coord3D *pos) { *pos = m_pos;} ///< Returns position camera is looking at (z will be zero) virtual const Coord3D& get3DCameraPosition() const = 0; ///< Returns the actual camera position @@ -205,14 +206,10 @@ class View : public Snapshot virtual void getLocation ( ViewLocation *location ); ///< write the view's current location in to the view location object virtual void setLocation ( const ViewLocation *location ); ///< set the view's current location from to the view location object - virtual void drawView() = 0; ///< Render the world visible in this view. virtual void updateView() = 0; ///isCameraMovementFinished()) { - ViewLocation loc; - Coord3D pos; - Real pitch, angle, zoom; - pos = msg->getArgument( 0 )->location; - angle = msg->getArgument( 1 )->real; - pitch = msg->getArgument( 2 )->real; - zoom = msg->getArgument( 3 )->real; - loc.init(pos.x, pos.y, pos.z, angle, pitch, zoom); - TheTacticalView->setLocation( &loc ); + const Coord3D pos = msg->getArgument( 0 )->location; + const Real angle = msg->getArgument( 1 )->real; + const Real pitch = msg->getArgument( 2 )->real; + const Real zoom = msg->getArgument( 3 )->real; + + TheTacticalView->setPosition(&pos); + TheTacticalView->setAngle(angle); + TheTacticalView->setPitch(pitch); + TheTacticalView->setZoom(zoom); // TheSuperHackers @fix xezon 18/09/2025 Lock the new location to avoid user input from changing the camera in this frame. TheTacticalView->lockViewUntilFrame( getFrame() + 1 ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp index 291d269f276..6fe151a8d1d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp @@ -1889,15 +1889,15 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, void *userData ) { if (TheTacticalView->isCameraMovementFinished()) { - ViewLocation loc; - Coord3D pos; - Real pitch, angle, zoom; - pos = msg->getArgument( 0 )->location; - angle = msg->getArgument( 1 )->real; - pitch = msg->getArgument( 2 )->real; - zoom = msg->getArgument( 3 )->real; - loc.init(pos.x, pos.y, pos.z, angle, pitch, zoom); - TheTacticalView->setLocation( &loc ); + const Coord3D pos = msg->getArgument( 0 )->location; + const Real angle = msg->getArgument( 1 )->real; + const Real pitch = msg->getArgument( 2 )->real; + const Real zoom = msg->getArgument( 3 )->real; + + TheTacticalView->setPosition(&pos); + TheTacticalView->setAngle(angle); + TheTacticalView->setPitch(pitch); + TheTacticalView->setZoom(zoom); // TheSuperHackers @fix xezon 18/09/2025 Lock the new location to avoid user input from changing the camera in this frame. TheTacticalView->lockViewUntilFrame( getFrame() + 1 );