Skip to content

Commit 1b6bf68

Browse files
authored
Merge branch 'TheSuperHackers:main' into fix/nvidia-microwave-aa-clean
2 parents 130d6f2 + 56ecbad commit 1b6bf68

36 files changed

Lines changed: 403 additions & 226 deletions

File tree

Core/GameEngine/Include/Common/GameDefines.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
#define RETAIL_COMPATIBLE_PATHFINDING_ALLOCATION (1)
4646
#endif
4747

48+
#ifndef RETAIL_COMPATIBLE_CIRCLE_FILL_ALGORITHM
49+
#define RETAIL_COMPATIBLE_CIRCLE_FILL_ALGORITHM (1) // Use the original circle fill algorithm, which is more efficient but less accurate
50+
#endif
51+
4852
// Disable non retail fixes in the networking, such as putting more data per UDP packet
4953
#ifndef RETAIL_COMPATIBLE_NETWORKING
5054
#define RETAIL_COMPATIBLE_NETWORKING (1)

Core/GameEngine/Include/Common/RandomValue.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
extern void InitRandom();
3434
extern void InitRandom( UnsignedInt seed );
35-
extern void InitGameLogicRandom( UnsignedInt seed ); ///< Set the GameLogic seed to a known value at game start
3635
extern UnsignedInt GetGameLogicRandomSeed(); ///< Get the seed (used for replays)
3736
extern UnsignedInt GetGameLogicRandomSeedCRC();///< Get the seed (used for CRCs)
3837

Core/GameEngine/Include/GameClient/View.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ class View : public Snapshot
172172
virtual void zoomCamera( Real finalZoom, Int milliseconds, Real easeIn=0.0f, Real easeOut=0.0f ) {};
173173
virtual void pitchCamera( Real finalPitch, Int milliseconds, Real easeIn=0.0f, Real easeOut=0.0f ) {};
174174

175+
virtual Bool isDoingScriptedCamera() = 0;
176+
virtual void stopDoingScriptedCamera() = 0;
177+
175178
virtual void setAngle( Real radians ); ///< Rotate the view around the vertical axis to the given angle (yaw)
176179
virtual Real getAngle() { return m_angle; } ///< Return current camera angle
177180
virtual void setPitch( Real radians ); ///< Rotate the view around the horizontal axis to the given angle (pitch)

Core/GameEngine/Source/Common/RandomValue.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,6 @@ DEBUG_LOG(( "InitRandom %08lx",seed));
177177
#endif
178178
}
179179

180-
void InitGameLogicRandom( UnsignedInt seed )
181-
{
182-
#ifdef DETERMINISTIC
183-
// needs to be the same every time
184-
seedRandom(0, theGameLogicSeed);
185-
theGameLogicBaseSeed = 0;
186-
#else
187-
seedRandom(seed, theGameLogicSeed);
188-
theGameLogicBaseSeed = seed;
189-
#endif
190-
#ifdef DEBUG_RANDOM_LOGIC
191-
DEBUG_LOG(( "InitRandom Logic %08lx",seed));
192-
#endif
193-
}
194-
195180
//
196181
// Integer random value
197182
//

Core/GameEngine/Source/GameNetwork/GameSpy/StagingRoomGameInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -852,9 +852,9 @@ void GameSpyStagingRoom::launchGame()
852852

853853
TheWritableGlobalData->m_useFpsLimit = false;
854854

855-
// Set the random seed
856-
InitGameLogicRandom( getSeed() );
857-
DEBUG_LOG(("InitGameLogicRandom( %d )", getSeed()));
855+
// Set the seeds
856+
InitRandom( getSeed() );
857+
DEBUG_LOG(("InitRandom( %d )", getSeed()));
858858

859859
// mark us as "Loading" in the buddy list
860860
BuddyRequest req;

Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ void LANAPI::OnGameStart()
256256

257257
TheWritableGlobalData->m_useFpsLimit = false;
258258

259-
// Set the random seed
260-
InitGameLogicRandom( m_currentGame->getSeed() );
261-
DEBUG_LOG(("InitGameLogicRandom( %d )", m_currentGame->getSeed()));
259+
// Set the seeds
260+
InitRandom( m_currentGame->getSeed() );
261+
DEBUG_LOG(("InitRandom( %d )", m_currentGame->getSeed()));
262262
}
263263
}
264264

Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ typedef struct
128128
// ------------------------------------------------------------------------------------------------
129129
class W3DView : public View, public SubsystemInterface
130130
{
131+
enum Scripted
132+
{
133+
Scripted_Rotate = 1<<0, // Set when rotating the camera
134+
Scripted_Pitch = 1<<1, // Set when pitching the camera
135+
Scripted_Zoom = 1<<2, // Set when zooming the camera
136+
Scripted_CameraLock = 1<<3, // Set when following a unit via script
137+
Scripted_MoveOnWaypointPath = 1<<4, // Set when moving camera along waypoint path
138+
};
139+
typedef UnsignedInt ScriptedState;
131140

132141
public:
133142
W3DView();
@@ -157,6 +166,9 @@ class W3DView : public View, public SubsystemInterface
157166

158167
virtual void forceRedraw();
159168

169+
virtual Bool isDoingScriptedCamera();
170+
virtual void stopDoingScriptedCamera();
171+
160172
virtual void setAngle( Real radians ); ///< Rotate the view around the vertical axis to the given angle (yaw)
161173
virtual void setPitch( Real radians ); ///< Rotate the view around the horizontal axis to the given angle (pitch)
162174
virtual void setAngleToDefault(); ///< Set the view angle back to default
@@ -246,22 +258,16 @@ class W3DView : public View, public SubsystemInterface
246258
Real m_shakeIntensity; ///< the intensity of the oscillation
247259
Vector3 m_shakerAngles; //WST 11/12/2002 new multiple instance camera shaker system
248260

249-
TRotateCameraInfo m_rcInfo;
250-
Bool m_doingRotateCamera; ///< True if we are doing a camera rotate.
261+
ScriptedState m_scriptedState; ///< Flags for scripted camera movements. Use functions addScriptedState, removeScriptedState for write.
251262

263+
TRotateCameraInfo m_rcInfo;
252264
TPitchCameraInfo m_pcInfo;
253-
Bool m_doingPitchCamera;
254265
TZoomCameraInfo m_zcInfo;
255-
Bool m_doingZoomCamera;
256-
257-
Bool m_doingScriptedCameraLock; ///< True if we are following a unit via script
266+
TMoveAlongWaypointPathInfo m_mcwpInfo; ///< Move camera along waypoint path info.
267+
Bool m_CameraArrivedAtWaypointOnPathFlag;
258268

259269
Real m_FXPitch; ///< Camera effects pitch. 0 = flat, infinite = look down, 1 = normal.
260270

261-
TMoveAlongWaypointPathInfo m_mcwpInfo; ///< Move camera along waypoint path info.
262-
Bool m_doingMoveCameraOnWaypointPath; ///< If true, moving camera along waypoint path.
263-
Bool m_CameraArrivedAtWaypointOnPathFlag;
264-
265271
Bool m_freezeTimeForCameraMovement;
266272
Int m_timeMultiplier; ///< Time speedup multiplier.
267273

@@ -283,6 +289,9 @@ class W3DView : public View, public SubsystemInterface
283289
void buildCameraTransform(Matrix3D *transform); ///< calculate (but do not set) the transform matrix of m_3DCamera, based on m_pos & m_angle
284290
void calcCameraAreaConstraints(); ///< Recalculates the camera area constraints
285291
Bool isWithinCameraHeightConstraints() const;
292+
Bool hasScriptedState(ScriptedState state) const;
293+
void addScriptedState(ScriptedState state);
294+
void removeScriptedState(ScriptedState state);
286295
void moveAlongWaypointPath(Real milliseconds); ///< Move camera along path.
287296
void getPickRay(const ICoord2D *screen, Vector3 *rayStart, Vector3 *rayEnd); ///<returns a line segment (ray) originating at the given screen position
288297
void setupWaypointPath(Bool orient); ///< Calculates distances & angles for moving along a waypoint path.

0 commit comments

Comments
 (0)