/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see .
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: W3DTerrainBackground.h //////////////////////////////////////////////////
//-----------------------------------------------------------------------------
//
// Westwood Studios Pacific.
//
// Confidential Information
// Copyright (C) 2001 - All Rights Reserved
//
//-----------------------------------------------------------------------------
//
// Project: RTS3
//
// File name: W3DTerrainBackground.h
//
// Created: John Ahlquist, May 2001
//
// Desc: Draw buffer to handle all the bibs in a scene.
//
//-----------------------------------------------------------------------------
#pragma once
#ifndef __W3DTERRAIN_BUFFER_H_
#define __W3DTERRAIN_BUFFER_H_
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include "always.h"
#include "rendobj.h"
#include "w3d_file.h"
#include "dx8vertexbuffer.h"
#include "dx8indexbuffer.h"
#include "shader.h"
#include "vertmaterial.h"
#include "Lib/BaseType.h"
#include "common/GameType.h"
#include "Common/AsciiString.h"
//-----------------------------------------------------------------------------
// Forward References
//-----------------------------------------------------------------------------
class MeshClass;
class WorldHeightMap;
class TerrainTextureClass;
//-----------------------------------------------------------------------------
// Type Defines
//-----------------------------------------------------------------------------
//
// W3DTerrainBackground: Draw buffer for the bibs.
//
//
class W3DTerrainBackground
{
friend class HeightMapRenderObjClass;
public:
W3DTerrainBackground(void);
~W3DTerrainBackground(void);
/// Draws the terrain.
void drawVisiblePolys(RenderInfoClass & rinfo, Bool disableTextures);
void setFlip(WorldHeightMap *htMap); ///< Sets the flip bit for required vertices.
void doPartialUpdate(const IRegion2D &partialRange, WorldHeightMap *htMap, Bool doTextures );
void doTesselatedUpdate(const IRegion2D &partialRange, WorldHeightMap *htMap, Bool doTextures );
void allocateTerrainBuffers(WorldHeightMap *htMap, Int xOrigin, Int yOrigin, Int width); ///< Allocates the buffers.
void updateCenter(CameraClass *camera); // notify camera moved [3/24/2003]
void updateTexture(void); // notify camera moved [3/24/2003]
Bool isCulled(void) {return m_cullStatus==CULL_STATUS_INVISIBLE;}
Int getTexMultiplier(void) {return m_texMultiplier;}
protected:
enum {CULL_STATUS_UNKNOWN, CULL_STATUS_VISIBLE, CULL_STATUS_INVISIBLE} m_cullStatus;
AABoxClass m_bounds;
DX8VertexBufferClass *m_vertexTerrain; ///