Skip to content
Open
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
1 change: 1 addition & 0 deletions Core/GameEngine/Include/GameClient/View.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ enum FilterModes CPP_11(: Int);

// ------------------------------------------------------------------------------------------------
constexpr const Real ViewDefaultPitchRadians = DEG_TO_RADF(37.5f);
constexpr const Real ViewDefaultLowPitchRadians = DEG_TO_RADF(37.0f);
constexpr const Real ViewDefaultYawRadians = DEG_TO_RADF(0.0f);
constexpr const Real ViewDefaultMaxHeightAboveTerrain = 310.0f;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ class BaseHeightMapRenderObjClass : public RenderObjClass, public DX8_CleanupHoo
///allocate resources needed to render heightmap
virtual int initHeightData(Int width, Int height, WorldHeightMap *pMap, RefRenderObjListIterator *pLightsIterator, Bool updateExtraPassTiles=TRUE);
virtual Int freeMapResources(); ///< free resources used to render heightmap
virtual void updateCenter(CameraClass *camera, RefRenderObjListIterator *pLightsIterator);
virtual void updateCenter(CameraClass *camera, const Vector3 *cameraPivot, RefRenderObjListIterator *pLightsIterator);
virtual void adjustTerrainLOD(Int adj);
virtual void doPartialUpdate(const IRegion2D &partialRange, WorldHeightMap *htMap, RefRenderObjListIterator *pLightsIterator) = 0;
virtual void staticLightingChanged();
virtual void oversizeTerrain(Int tilesToOversize);
virtual void oversizeTerrain(Int tilesToOversize) = 0; ///< Oversize the visible terrain area.
virtual void setTerrainDrawSize(Int width, Int height) = 0; ///< Resize the visible terrain area. Always defaults to oversize dimensions when oversize is set.
virtual void reset();

void redirectToHeightmap( WorldHeightMap *pMap )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ class FlatHeightMapRenderObjClass : public BaseHeightMapRenderObjClass
///allocate resources needed to render heightmap
virtual int initHeightData(Int width, Int height, WorldHeightMap *pMap, RefRenderObjListIterator *pLightsIterator,Bool updateExtraPassTiles=TRUE) override;
virtual Int freeMapResources() override; ///< free resources used to render heightmap
virtual void updateCenter(CameraClass *camera, RefRenderObjListIterator *pLightsIterator) override;
virtual void updateCenter(CameraClass *camera, const Vector3 *cameraPivot, RefRenderObjListIterator *pLightsIterator) override;
virtual void adjustTerrainLOD(Int adj) override;
virtual void reset() override;
virtual void oversizeTerrain(Int tilesToOversize) override;
virtual void oversizeTerrain(Int tilesToOversize) override; ///< Oversize the visible terrain area.
virtual void setTerrainDrawSize(Int width, Int height) override; ///< Resize the visible terrain area. Always defaults to oversize dimensions when oversize is set.
virtual void staticLightingChanged() override;
virtual void doPartialUpdate(const IRegion2D &partialRange, WorldHeightMap *htMap, RefRenderObjListIterator *pLightsIterator) override;
virtual int updateBlock(Int x0, Int y0, Int x1, Int y1, WorldHeightMap *pMap, RefRenderObjListIterator *pLightsIterator) override {return 0;};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ class HeightMapRenderObjClass : public BaseHeightMapRenderObjClass
///allocate resources needed to render heightmap
virtual int initHeightData(Int width, Int height, WorldHeightMap *pMap, RefRenderObjListIterator *pLightsIterator, Bool updateExtraPassTiles=TRUE) override;
virtual Int freeMapResources() override; ///< free resources used to render heightmap
virtual void updateCenter(CameraClass *camera, RefRenderObjListIterator *pLightsIterator) override;
virtual void updateCenter(CameraClass *camera, const Vector3 *cameraPivot, RefRenderObjListIterator *pLightsIterator) override;

virtual void staticLightingChanged() override;
virtual void adjustTerrainLOD(Int adj) override;
virtual void reset() override;
virtual void doPartialUpdate(const IRegion2D &partialRange, WorldHeightMap *htMap, RefRenderObjListIterator *pLightsIterator) override;

virtual void oversizeTerrain(Int tilesToOversize) override;
virtual void oversizeTerrain(Int tilesToOversize) override; ///< Oversize the visible terrain area.
virtual void setTerrainDrawSize(Int width, Int height) override; ///< Resize the visible terrain area. Always defaults to oversize dimensions when oversize is set.

virtual int updateBlock(Int x0, Int y0, Int x1, Int y1, WorldHeightMap *pMap, RefRenderObjListIterator *pLightsIterator) override;

Expand All @@ -93,6 +94,8 @@ class HeightMapRenderObjClass : public BaseHeightMapRenderObjClass
VERTEX_FORMAT *m_vertexBufferBackup; ///< In memory copy of the vertex buffer data for quick update of dynamic lighting.
Int m_originX; ///< Origin point in the grid. Slides around.
Int m_originY; ///< Origin point in the grid. Slides around.
Int m_oversizeDrawWidth; // Oversize draw width required by mission scripts for cinematic sequences.
Int m_oversizeDrawHeight; // Oversize draw height required by mission scripts for cinematic sequences.
DX8IndexBufferClass *m_indexBuffer; ///<indices defining triangles in a VB tile.
Int m_numVBTilesX; ///<dimensions of array containing all the vertex buffers
Int m_numVBTilesY; ///<dimensions of array containing all the vertex buffers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class W3DView : public View, public SubsystemInterface
Real getMaxHeight(Real x, Real y) const;
Real getMaxZoom(Real x, Real y) const;
void updateCameraTransform(); ///< update the transform matrix of m_3DCamera, based on m_pos & m_angle
void updateCameraClipPlanes();
void updateCameraClipPlanes(const Matrix3D &transform);
void setCameraTransform(const Matrix3D &transform);
void buildCameraPosition(Vector3 &sourcePos, Vector3 &targetPos);
void buildCameraTransform(Matrix3D *transform, const Vector3 &sourcePos, const Vector3 &targetPos); ///< calculate (but do not set) the transform matrix of m_3DCamera, based on m_pos & m_angle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class WorldHeightMap : public RefCountClass,
#define NO_EVAL_TILING_MODES

public:

struct DrawArea
{
Int originX;
Int originY;
Int sizeX;
Int sizeY;
};

#ifdef EVAL_TILING_MODES
enum {TILE_4x4, TILE_6x6, TILE_8x8} m_tileMode;
#endif
Expand All @@ -116,6 +125,8 @@ class WorldHeightMap : public RefCountClass,
NORMAL_DRAW_HEIGHT = 1 + 4*VERTEX_BUFFER_TILE_LENGTH,
STRETCH_DRAW_WIDTH = 1 + 2*VERTEX_BUFFER_TILE_LENGTH,
STRETCH_DRAW_HEIGHT = 1 + 2*VERTEX_BUFFER_TILE_LENGTH,
LOW_ANGLE_DRAW_WIDTH = 1 + (NORMAL_DRAW_WIDTH-1) * 2,
LOW_ANGLE_DRAW_HEIGHT = 1 + (NORMAL_DRAW_HEIGHT-1) * 2,
};

protected:
Expand Down Expand Up @@ -241,8 +252,8 @@ class WorldHeightMap : public RefCountClass,

Int getDrawWidth() {return m_drawWidthX;}
Int getDrawHeight() {return m_drawHeightY;}
void setDrawWidth(Int width) {m_drawWidthX = width; if (m_drawWidthX>m_width) m_drawWidthX = m_width;}
void setDrawHeight(Int height) {m_drawHeightY = height; if (m_drawHeightY>m_height) m_drawHeightY = m_height;}
void setDrawWidth(Int width) {DEBUG_ASSERTCRASH(width <= m_width, ("Draw width must not exceed map width")); m_drawWidthX = width;}
void setDrawHeight(Int height) {DEBUG_ASSERTCRASH(height <= m_height, ("Draw height must not exceed map height")); m_drawHeightY = height;}
virtual Int getBorderSize() override {return m_borderSize;}
Int getBorderSizeInline() const { return m_borderSize; }
/// Get height with the offset that HeightMapRenderObjClass uses built in.
Expand All @@ -260,6 +271,8 @@ class WorldHeightMap : public RefCountClass,

void getUVForBlend(Int edgeClass, Region2D *range);

DrawArea createDrawArea(Int xOrg, Int yOrg);
Bool setDrawArea(const DrawArea& drawArea);
Bool setDrawOrg(Int xOrg, Int yOrg);

static void freeListOfMapObjects();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1318,18 +1318,6 @@ Bool BaseHeightMapRenderObjClass::evaluateAsVisibleCliff(Int xIndex, Int yIndex,
return anyImpassable;
}

//=============================================================================
// BaseHeightMapRenderObjClass::oversizeTerrain
//=============================================================================
/** Sets the terrain oversize amount. */
//=============================================================================
void BaseHeightMapRenderObjClass::oversizeTerrain(Int tilesToOversize)
{
// Not needed with flat version. [3/20/2003]
}



//=============================================================================
// BaseHeightMapRenderObjClass::Get_Obj_Space_Bounding_Sphere
//=============================================================================
Expand Down Expand Up @@ -2394,7 +2382,7 @@ rendered portion of the terrain. Only a 96x96 section is rendered at any time,
even though maps can be up to 1024x1024. This function determines which subset
is rendered. */
//=============================================================================
void BaseHeightMapRenderObjClass::updateCenter(CameraClass *camera , RefRenderObjListIterator *pLightsIterator)
void BaseHeightMapRenderObjClass::updateCenter(CameraClass *camera, const Vector3 *cameraPivot, RefRenderObjListIterator *pLightsIterator)
{
if (m_map==nullptr) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ void FlatHeightMapRenderObjClass::oversizeTerrain(Int tilesToOversize)
// Not needed with flat version. [3/20/2003]
}


void FlatHeightMapRenderObjClass::setTerrainDrawSize(Int width, Int height)
Comment thread
Skyaero42 marked this conversation as resolved.
{
// Not needed with flat version.
}

//=============================================================================
// HeightMapRenderObjClass::doPartialUpdate
Expand Down Expand Up @@ -405,13 +408,13 @@ rendered portion of the terrain. Only a 96x96 section is rendered at any time,
even though maps can be up to 1024x1024. This function determines which subset
is rendered. */
//=============================================================================
void FlatHeightMapRenderObjClass::updateCenter(CameraClass *camera , RefRenderObjListIterator *pLightsIterator)
void FlatHeightMapRenderObjClass::updateCenter(CameraClass *camera, const Vector3 *cameraPivot, RefRenderObjListIterator *pLightsIterator)
{
#ifdef DO_UNIT_TIMINGS
#pragma MESSAGE("*** WARNING *** DOING DO_UNIT_TIMINGS!!!!")
return;
#endif
BaseHeightMapRenderObjClass::updateCenter(camera, pLightsIterator);
BaseHeightMapRenderObjClass::updateCenter(camera, cameraPivot, pLightsIterator);
m_needFullUpdate = false;
Int i, j;
Int culled = 0;
Expand Down
Loading
Loading