<filename>EntitiesMP/HazeMarker.cpp
/*
 * This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
 */

#line 2 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"

#include "StdH.h"
ENGINE_API extern FLOAT ter_fLODMul;

#include <HazeMarker.h>
#include <HazeMarker_tables.h>
void CHazeMarker::SetDefaultProperties(void) {
	m_faType = FA_EXP ;
	m_fDensity = 0.1f;
	m_fNear = 100.0f;
	m_fFar = 1000.0f;
	m_bVisibleFromOutside = FALSE ;
	m_iSize = 32;
	m_colBase = (C_WHITE  | CT_OPAQUE );
	m_colUp = (C_BLACK  | CT_TRANSPARENT );
	m_colDown = (C_BLACK  | CT_TRANSPARENT );
	m_colNorth = (C_BLACK  | CT_TRANSPARENT );
	m_colSouth = (C_BLACK  | CT_TRANSPARENT );
	m_colEast = (C_BLACK  | CT_TRANSPARENT );
	m_colWest = (C_BLACK  | CT_TRANSPARENT );
	CMarker::SetDefaultProperties();
}

#line 39 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
const CTString & CHazeMarker::GetHazeName(void) 
#line 40 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
{
#line 41 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
return m_strName ;
#line 42 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}

#line 45 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
void CHazeMarker::GetHaze(class CHazeParameters & hpHaze,FLOAT3D & vViewDir) 
#line 46 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
{
#line 48 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
COLOR colDir  = C_BLACK  , colMul ;
#line 49 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
FLOAT fR  = 0.0f , fG  = 0.0f , fB  = 0.0f , fA  = 0.0f;
#line 50 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
FLOAT fSum  = 255.0f / (Abs  (vViewDir  (1)) + Abs  (vViewDir  (2)) + Abs  (vViewDir  (3)));
#line 52 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(vViewDir  (1) < 0.0f){
#line 53 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (COLOR) (- vViewDir  (1) * fSum );
#line 54 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (colMul  << CT_RSHIFT ) | (colMul  << CT_GSHIFT ) | (colMul  << CT_BSHIFT ) | (colMul  << CT_ASHIFT );
#line 55 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colDir  = AddColors  (colDir  , MulColors  (m_colWest  , colMul ));
#line 56 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 57 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(vViewDir  (1) > 0.0f){
#line 58 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (COLOR) (+ vViewDir  (1) * fSum );
#line 59 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (colMul  << CT_RSHIFT ) | (colMul  << CT_GSHIFT ) | (colMul  << CT_BSHIFT ) | (colMul  << CT_ASHIFT );
#line 60 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colDir  = AddColors  (colDir  , MulColors  (m_colEast  , colMul ));
#line 61 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 62 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(vViewDir  (2) < 0.0f){
#line 63 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (COLOR) (- vViewDir  (2) * fSum );
#line 64 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (colMul  << CT_RSHIFT ) | (colMul  << CT_GSHIFT ) | (colMul  << CT_BSHIFT ) | (colMul  << CT_ASHIFT );
#line 65 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colDir  = AddColors  (colDir  , MulColors  (m_colDown  , colMul ));
#line 66 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 67 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(vViewDir  (2) > 0.0f){
#line 68 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (COLOR) (+ vViewDir  (2) * fSum );
#line 69 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (colMul  << CT_RSHIFT ) | (colMul  << CT_GSHIFT ) | (colMul  << CT_BSHIFT ) | (colMul  << CT_ASHIFT );
#line 70 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colDir  = AddColors  (colDir  , MulColors  (m_colUp  , colMul ));
#line 71 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 72 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(vViewDir  (3) < 0.0f){
#line 73 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (COLOR) (- vViewDir  (3) * fSum );
#line 74 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (colMul  << CT_RSHIFT ) | (colMul  << CT_GSHIFT ) | (colMul  << CT_BSHIFT ) | (colMul  << CT_ASHIFT );
#line 75 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colDir  = AddColors  (colDir  , MulColors  (m_colNorth  , colMul ));
#line 76 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 77 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(vViewDir  (3) > 0.0f){
#line 78 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (COLOR) (+ vViewDir  (3) * fSum );
#line 79 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colMul  = (colMul  << CT_RSHIFT ) | (colMul  << CT_GSHIFT ) | (colMul  << CT_BSHIFT ) | (colMul  << CT_ASHIFT );
#line 80 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colDir  = AddColors  (colDir  , MulColors  (m_colSouth  , colMul ));
#line 81 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 84 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
colDir  = AddColors  (colDir  , m_colBase );
#line 87 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_colColor  = colDir ;
#line 88 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_atType  = (AttenuationType ) m_faType ;
#line 89 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_fDensity  = m_fDensity ;
#line 90 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_fNear  = m_fNear  * ter_fLODMul ;
#line 91 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_fFar  = m_fFar  * ter_fLODMul ;
#line 92 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_iSize  = m_iSize ;
#line 93 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_ulFlags  = 0;
#line 94 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(m_bVisibleFromOutside ){
#line 95 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
hpHaze  . hp_ulFlags  |= HPF_VISIBLEFROMOUTSIDE ;
#line 96 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 97 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
BOOL CHazeMarker::
#line 101 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
Main(const CEntityEvent &__eeInput) {
#undef STATE_CURRENT
#define STATE_CURRENT STATE_CHazeMarker_Main
	ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CHazeMarker::Main expects 'EVoid' as input!");	const EVoid &e = (const EVoid &)__eeInput;
#line 103 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
InitAsEditorModel  ();
#line 104 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
SetPhysicsFlags  (EPF_MODEL_IMMATERIAL );
#line 105 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
SetCollisionFlags  (ECF_IMMATERIAL );
#line 108 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
SetModel  (MODEL_MARKER );
#line 109 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
SetModelMainTexture  (TEXTURE_MARKER );
#line 112 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
if(m_strName  == "Marker"){
#line 113 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
m_strName  = "Haze marker";
#line 114 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
}
#line 117 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
m_fDensity  = ClampDn  (m_fDensity  , 1E-6f);
#line 118 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
m_fFar  = ClampDn  (m_fFar  , 0.001f);
#line 119 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
m_fNear  = Clamp  (m_fNear  , 0.0f , m_fFar  - 0.0005f);
#line 120 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
ASSERT  (m_fNear  >= 0 && m_fNear  < m_fFar );
#line 122 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
m_iSize  = 1 << INDEX (Log2  (m_iSize ));
#line 123 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
m_iSize  = Clamp  (m_iSize  , INDEX (2) , INDEX (256));
#line 125 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
Return(STATE_CURRENT,EVoid());
#line 125 "C:/Users/pwesty/Desktop/SD-Source/nov-source/Reco_Csrc/EntitiesMP/HazeMarker.es"
return TRUE; ASSERT(FALSE); return TRUE;};