/*
** Command & Conquer Generals(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. //
// //
////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __W3DSHROUD_H_
#define __W3DSHROUD_H_
#include "WW3D2/matpass.h"
#include "WW3D2/dx8wrapper.h"
class AABoxClass;
class WorldHeightMap;
typedef UnsignedByte W3DShroudLevel;
// In Global Data now
//const W3DShroudLevel FULL_SHROUD_LEVEL=0;
//const W3DShroudLevel FOG_SHROUD_LEVEL=127;
//const W3DShroudLevel NO_SHROUD_LEVEL=255;
/** Custom W3D material pass which has been modified to apply
a shroud texture projection.
*/
class W3DShroudMaterialPassClass : public MaterialPassClass
{
public:
W3DShroudMaterialPassClass(void) : m_isTransparentObjectPass(FALSE) {}
virtual void Install_Materials(void) const;
virtual void UnInstall_Materials(void) const;
void enableTransparentObjectPass(Bool enable) {m_isTransparentObjectPass = enable;}
protected:
//customized version to deal with transparent (alpha-tested) polys.
Bool m_isTransparentObjectPass;
};
/** Custom W3D material pass which has been modified to apply
a texture projection. Similar to the above code except
that it's more generic so could be used for non-shroud
projection of various masks.
*/
class W3DMaskMaterialPassClass : public MaterialPassClass
{
public:
W3DMaskMaterialPassClass(void) : m_texture(NULL), m_allowUninstall(TRUE) {}
virtual void Install_Materials(void) const;
virtual void UnInstall_Materials(void) const;
void setTexture(TextureClass *texture) {m_texture=texture;}
void setAllowUninstall(Bool state) { m_allowUninstall = state;}
protected:
TextureClass *m_texture; ///