Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/Module/BeaconClientUpdate.h
# Include/GameClient/Module/SwayClientUpdate.h
# Include/GameClient/Mouse.h
# Include/GameClient/ParabolicEase.h
Include/GameClient/ParabolicEase.h
# Include/GameClient/ParticleSys.h
# Include/GameClient/PlaceEventTranslator.h
# Include/GameClient/ProcessAnimateWindow.h
Expand All @@ -228,7 +228,7 @@ set(GAMEENGINE_SRC
# Include/GameClient/TerrainRoads.h
# Include/GameClient/TerrainVisual.h
Include/GameClient/VideoPlayer.h
# Include/GameClient/View.h
Include/GameClient/View.h
# Include/GameClient/Water.h
# Include/GameClient/WindowLayout.h
Include/GameClient/WindowVideoManager.h
Expand Down Expand Up @@ -815,7 +815,7 @@ set(GAMEENGINE_SRC
# Source/GameClient/MessageStream/PlaceEventTranslator.cpp
# Source/GameClient/MessageStream/SelectionXlat.cpp
# Source/GameClient/MessageStream/WindowXlat.cpp
# Source/GameClient/ParabolicEase.cpp
Source/GameClient/ParabolicEase.cpp
# Source/GameClient/RadiusDecal.cpp
# Source/GameClient/SelectionInfo.cpp
# Source/GameClient/Snow.cpp
Expand All @@ -832,7 +832,7 @@ set(GAMEENGINE_SRC
# Source/GameClient/Terrain/TerrainVisual.cpp
Source/GameClient/VideoPlayer.cpp
Source/GameClient/VideoStream.cpp
# Source/GameClient/View.cpp
Source/GameClient/View.cpp
# Source/GameClient/Water.cpp
# Source/GameLogic/AI/AI.cpp
# Source/GameLogic/AI/AIDock.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ class View : public Snapshot
virtual void initHeightForMap( void ) {}; ///< Init the camera height for the map at the current position.
virtual void scrollBy( Coord2D *delta ); ///< Shift the view by the given delta

virtual void moveCameraTo(const Coord3D *o, Int frames, Int shutter, Bool orient, Real easeIn, Real easeOut) { lookAt( o ); }
virtual void moveCameraAlongWaypointPath(Waypoint *way, Int frames, Int shutter, Bool orient, Real easeIn, Real easeOut) { }
virtual void moveCameraTo(const Coord3D *o, Int frames, Int shutter, Bool orient, Real easeIn=0.0f, Real easeOut=0.0f) { lookAt( o ); }
virtual void moveCameraAlongWaypointPath(Waypoint *way, Int frames, Int shutter, Bool orient, Real easeIn=0.0f, Real easeOut=0.0f) { }
virtual Bool isCameraMovementFinished( void ) { return TRUE; }
virtual void cameraModFinalZoom(Real finalZoom, Real easeIn, Real easeOut){}; ///< Final zoom for current camera movement.
virtual void cameraModFinalZoom(Real finalZoom, Real easeIn=0.0f, Real easeOut=0.0f){}; ///< Final zoom for current camera movement.
virtual void cameraModRollingAverage(Int framesToAverage){}; ///< Number of frames to average movement for current camera movement.
virtual void cameraModFinalTimeMultiplier(Int finalMultiplier){}; ///< Final time multiplier for current camera movement.
virtual void cameraModFinalPitch(Real finalPitch, Real easeIn, Real easeOut){}; ///< Final pitch for current camera movement.
virtual void cameraModFinalPitch(Real finalPitch, Real easeIn=0.0f, Real easeOut=0.0f){}; ///< Final pitch for current camera movement.
virtual void cameraModFreezeTime(void){ } ///< Freezes time during the next camera movement.
virtual void cameraModFreezeAngle(void){ } ///< Freezes time during the next camera movement.
virtual void cameraModLookToward(Coord3D *pLoc){} ///< Sets a look at point during camera movement.
Expand All @@ -161,16 +161,16 @@ class View : public Snapshot
virtual void setFadeParameters(Int fadeFrames, Int direction) { };
virtual void set3DWireFrameMode(Bool enable) { };

virtual void resetCamera(const Coord3D *location, Int frames, Real easeIn, Real easeOut) {}; ///< Move camera to location, and reset to default angle & zoom.
virtual void rotateCamera(Real rotations, Int frames, Real easeIn, Real easeOut) {}; ///< Rotate camera about current viewpoint.
virtual void rotateCameraTowardObject(ObjectID id, Int milliseconds, Int holdMilliseconds, Real easeIn, Real easeOut) {}; ///< Rotate camera to face an object, and hold on it
virtual void rotateCameraTowardPosition(const Coord3D *pLoc, Int milliseconds, Real easeIn, Real easeOut, Bool reverseRotation) {}; ///< Rotate camera to face a location.
virtual void resetCamera(const Coord3D *location, Int frames, Real easeIn=0.0f, Real easeOut=0.0f) {}; ///< Move camera to location, and reset to default angle & zoom.
virtual void rotateCamera(Real rotations, Int frames, Real easeIn=0.0f, Real easeOut=0.0f) {}; ///< Rotate camera about current viewpoint.
virtual void rotateCameraTowardObject(ObjectID id, Int milliseconds, Int holdMilliseconds, Real easeIn=0.0f, Real easeOut=0.0f) {}; ///< Rotate camera to face an object, and hold on it
virtual void rotateCameraTowardPosition(const Coord3D *pLoc, Int milliseconds, Real easeIn=0.0f, Real easeOut=0.0f, Bool reverseRotation=FALSE) {}; ///< Rotate camera to face a location.
virtual Bool isTimeFrozen(void){ return false;} ///< Freezes time during the next camera movement.
virtual Int getTimeMultiplier(void) {return 1;}; ///< Get the time multiplier.
virtual void setTimeMultiplier(Int multiple) {}; ///< Set the time multiplier.
virtual void setDefaultView(Real pitch, Real angle, Real maxHeight) {};
virtual void zoomCamera( Real finalZoom, Int milliseconds, Real easeIn, Real easeOut ) {};
virtual void pitchCamera( Real finalPitch, Int milliseconds, Real easeIn, Real easeOut ) {};
virtual void zoomCamera( Real finalZoom, Int milliseconds, Real easeIn=0.0f, Real easeOut=0.0f ) {};
virtual void pitchCamera( Real finalPitch, Int milliseconds, Real easeIn=0.0f, Real easeOut=0.0f ) {};

virtual void setAngle( Real angle ); ///< Rotate the view around the up axis to the given angle
virtual Real getAngle( void ) { return m_angle; }
Expand Down
6 changes: 3 additions & 3 deletions Core/GameEngineDevice/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ set(GAMEENGINEDEVICE_SRC
# Include/W3DDevice/GameClient/W3DTerrainVisual.h
# Include/W3DDevice/GameClient/W3DTreeBuffer.h
Include/W3DDevice/GameClient/W3DVideoBuffer.h
# Include/W3DDevice/GameClient/W3DView.h
Include/W3DDevice/GameClient/W3DView.h
# Include/W3DDevice/GameClient/W3DVolumetricShadow.h
# Include/W3DDevice/GameClient/W3DWater.h
# Include/W3DDevice/GameClient/W3DWaterTracks.h
Expand All @@ -98,7 +98,7 @@ set(GAMEENGINEDEVICE_SRC
# Source/W3DDevice/Common/Thing/W3DThingFactory.cpp
# Source/W3DDevice/Common/W3DConvert.cpp
# Source/W3DDevice/GameClient/BaseHeightMap.cpp
# Source/W3DDevice/GameClient/camerashakesystem.cpp
Source/W3DDevice/GameClient/CameraShakeSystem.cpp
# Source/W3DDevice/GameClient/Drawable/Draw/W3DDebrisDraw.cpp
# Source/W3DDevice/GameClient/Drawable/Draw/W3DDefaultDraw.cpp
# Source/W3DDevice/GameClient/Drawable/Draw/W3DDependencyModelDraw.cpp
Expand Down Expand Up @@ -173,7 +173,7 @@ set(GAMEENGINEDEVICE_SRC
# Source/W3DDevice/GameClient/W3DTerrainVisual.cpp
# Source/W3DDevice/GameClient/W3DTreeBuffer.cpp
Source/W3DDevice/GameClient/W3DVideoBuffer.cpp
# Source/W3DDevice/GameClient/W3DView.cpp
Source/W3DDevice/GameClient/W3DView.cpp
# Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp
# Source/W3DDevice/GameClient/W3DWebBrowser.cpp
# Source/W3DDevice/GameClient/Water/W3DWater.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#include "W3DDevice/GameClient/W3DPoly.h"
#include "W3DDevice/GameClient/W3DCustomScene.h"

#include "W3DDevice/GameClient/camerashakesystem.h"
#include "W3DDevice/GameClient/CameraShakeSystem.h"
#include "WW3D2/camera.h"

//#include "W3DDevice/GameClient/camera.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
#include "WW3D2/predlod.h"
#include "WW3D2/ww3d.h"

#include "W3DDevice/GameClient/camerashakesystem.h"
#include "W3DDevice/GameClient/CameraShakeSystem.h"

#include "WinMain.h" /** @todo Remove this, it's only here because we
are using timeGetTime, but we can remove that
Expand Down Expand Up @@ -377,6 +377,14 @@ void W3DView::buildCameraTransform( Matrix3D *transform )
}
else
{
// TheSuperHackers @todo Investigate whether the non Generals code is correct for Zero Hour.
// It certainly is incorrect for Generals when m_FXPitch goes above 1:
// Seen in USA mission 1 second cut scene with SCUD Storm.
#if RTS_GENERALS
Real height = sourcePos.Z - targetPos.Z;
height *= m_FXPitch;
targetPos.Z = sourcePos.Z - height;
#else
if (m_FXPitch <= 1.0f)
{
Real height = sourcePos.Z - targetPos.Z;
Expand All @@ -388,6 +396,7 @@ void W3DView::buildCameraTransform( Matrix3D *transform )
sourcePos.X = targetPos.X + ((sourcePos.X - targetPos.X) / m_FXPitch);
sourcePos.Y = targetPos.Y + ((sourcePos.Y - targetPos.Y) / m_FXPitch);
}
#endif
}

//m_3DCamera->Set_View_Plane(DEG_TO_RADF(50.0f));
Expand Down Expand Up @@ -2512,7 +2521,13 @@ void W3DView::rotateCameraTowardPosition(const Coord3D *pLoc, Int milliseconds,
m_rcInfo.curFrame = 0;
m_doingRotateCamera = true;
m_rcInfo.angle.startAngle = m_angle;
// TheSuperHackers @todo Investigate if the non Generals code is correct for Zero Hour.
// It certainly is incorrect for Generals: Seen in GLA mission 1 opening cut scene.
#if RTS_GENERALS
m_rcInfo.angle.endAngle = m_angle + angle;
#else
m_rcInfo.angle.endAngle = angle;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZH code seems to be the correct one here, angle is absolute here, not a delta.

#endif
m_rcInfo.startTimeMultiplier = m_timeMultiplier;
m_rcInfo.endTimeMultiplier = m_timeMultiplier;
m_rcInfo.ease.setEaseTimes(easeIn/milliseconds, easeOut/milliseconds);
Expand Down Expand Up @@ -3130,8 +3145,14 @@ void W3DView::moveAlongWaypointPath(Real milliseconds)
const Real deltaTime = m_mcwpInfo.ease(m_mcwpInfo.elapsedTimeMilliseconds/totalTime) -
m_mcwpInfo.ease((m_mcwpInfo.elapsedTimeMilliseconds - milliseconds)/totalTime);
m_mcwpInfo.curSegDistance += deltaTime*m_mcwpInfo.totalDistance;
while (m_mcwpInfo.curSegDistance >= m_mcwpInfo.waySegLength[m_mcwpInfo.curSegment]) {

// TheSuperHacker @todo Investigate which one is really correct.
// The non Generals condition causes camera bug in Generals Shell Map.
#if RTS_GENERALS
while (m_mcwpInfo.curSegDistance > m_mcwpInfo.waySegLength[m_mcwpInfo.curSegment])
#else
while (m_mcwpInfo.curSegDistance >= m_mcwpInfo.waySegLength[m_mcwpInfo.curSegment])
#endif
{
if ( m_doingMoveCameraOnWaypointPath )
{
//WWDEBUG_SAY(( "MBL TEST: Camera waypoint along path reached!" ));
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ set(GAMEENGINE_SRC
Include/GameClient/TerrainRoads.h
Include/GameClient/TerrainVisual.h
# Include/GameClient/VideoPlayer.h
Include/GameClient/View.h
# Include/GameClient/View.h
Include/GameClient/Water.h
Include/GameClient/WindowLayout.h
# Include/GameClient/WindowVideoManager.h
Expand Down Expand Up @@ -776,7 +776,7 @@ set(GAMEENGINE_SRC
Source/GameClient/Terrain/TerrainRoads.cpp
Source/GameClient/Terrain/TerrainVisual.cpp
# Source/GameClient/VideoPlayer.cpp
Source/GameClient/View.cpp
# Source/GameClient/View.cpp
Source/GameClient/Water.cpp
Source/GameLogic/AI/AI.cpp
Source/GameLogic/AI/AIDock.cpp
Expand Down
5 changes: 5 additions & 0 deletions Generals/Code/GameEngine/Include/Common/DrawModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
class Matrix3D;
class RenderCost;
class OBBoxClass;

// TYPES //////////////////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -154,6 +155,10 @@ class ObjectDrawInterface

// this method must ONLY be called from the client, NEVER From the logic, not even indirectly.
virtual Bool clientOnly_getRenderObjInfo(Coord3D* pos, Real* boundingSphereRadius, Matrix3D* transform) const = 0;

// (gth) C&C3 adding these accessors to render object properties
virtual Bool clientOnly_getRenderObjBoundBox(OBBoxClass * boundbox) const = 0;
virtual Bool clientOnly_getRenderObjBoneTransform(const AsciiString & boneName,Matrix3D * set_tm) const = 0;
/**
Find the bone(s) with the given name and return their positions and/or transforms in the given arrays.
We look for a bone named "boneNamePrefixQQ", where QQ is 01, 02, 03, etc, starting at the
Expand Down
5 changes: 2 additions & 3 deletions Generals/Code/GameEngine/Include/GameClient/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@
#pragma once

#include "Common/SubsystemInterface.h"
#include "View.h"
#include "GameClient/Color.h"
#include "GameClient/GameFont.h"

class View;
#include "GameClient/View.h"

struct ShroudLevel
{
Expand Down Expand Up @@ -173,6 +171,7 @@ class Display : public SubsystemInterface
virtual void toggleLetterBox(void) = 0; ///< enabled letter-boxed display
virtual void enableLetterBox(Bool enable) = 0; ///< forces letter-boxed display on/off
virtual Bool isLetterBoxFading( void ) { return FALSE; } ///< returns true while letterbox fades in/out
virtual Bool isLetterBoxed( void ) { return FALSE; } //WST 10/2/2002. Added query interface

virtual void setCinematicText( AsciiString string ) { m_cinematicText = string; }
virtual void setCinematicFont( GameFont *font ) { m_cinematicFont = font; }
Expand Down
Loading
Loading