mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-22 18:30:27 +01:00
168 lines
7.4 KiB
C++
168 lines
7.4 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
|
|
#include "StdH.h"
|
|
|
|
#include <EntitiesMP/HazeMarker.h>
|
|
#include <EntitiesMP/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 40 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
const CTString & CHazeMarker::GetHazeName(void)
|
|
#line 41 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
{
|
|
#line 42 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
return m_strName ;
|
|
#line 43 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
|
|
#line 46 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
void CHazeMarker::GetHaze(class CHazeParameters & hpHaze,FLOAT3D & vViewDir)
|
|
#line 47 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
{
|
|
#line 49 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
COLOR colDir = C_BLACK , colMul ;
|
|
#line 50 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
FLOAT fR = 0.0f , fG = 0.0f , fB = 0.0f , fA = 0.0f;
|
|
#line 51 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
FLOAT fSum = 255.0f / (Abs (vViewDir (1)) + Abs (vViewDir (2)) + Abs (vViewDir (3)));
|
|
#line 53 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(vViewDir (1) < 0.0f){
|
|
#line 54 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (COLOR) (- vViewDir (1) * fSum );
|
|
#line 55 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT );
|
|
#line 56 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colDir = AddColors (colDir , MulColors (m_colWest , colMul ));
|
|
#line 57 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 58 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(vViewDir (1) > 0.0f){
|
|
#line 59 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (COLOR) (+ vViewDir (1) * fSum );
|
|
#line 60 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT );
|
|
#line 61 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colDir = AddColors (colDir , MulColors (m_colEast , colMul ));
|
|
#line 62 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 63 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(vViewDir (2) < 0.0f){
|
|
#line 64 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (COLOR) (- vViewDir (2) * fSum );
|
|
#line 65 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT );
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colDir = AddColors (colDir , MulColors (m_colDown , colMul ));
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(vViewDir (2) > 0.0f){
|
|
#line 69 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (COLOR) (+ vViewDir (2) * fSum );
|
|
#line 70 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT );
|
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colDir = AddColors (colDir , MulColors (m_colUp , colMul ));
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 73 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(vViewDir (3) < 0.0f){
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (COLOR) (- vViewDir (3) * fSum );
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT );
|
|
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colDir = AddColors (colDir , MulColors (m_colNorth , colMul ));
|
|
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(vViewDir (3) > 0.0f){
|
|
#line 79 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (COLOR) (+ vViewDir (3) * fSum );
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colMul = (colMul << CT_RSHIFT ) | (colMul << CT_GSHIFT ) | (colMul << CT_BSHIFT ) | (colMul << CT_ASHIFT );
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colDir = AddColors (colDir , MulColors (m_colSouth , colMul ));
|
|
#line 82 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
colDir = AddColors (colDir , m_colBase );
|
|
#line 88 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_colColor = colDir ;
|
|
#line 89 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_atType = (AttenuationType ) m_faType ;
|
|
#line 90 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_fDensity = m_fDensity ;
|
|
#line 91 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_fNear = m_fNear ;
|
|
#line 92 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_fFar = m_fFar ;
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_iSize = m_iSize ;
|
|
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_ulFlags = 0;
|
|
#line 95 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(m_bVisibleFromOutside ){
|
|
#line 96 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
hpHaze . hp_ulFlags |= HPF_VISIBLEFROMOUTSIDE ;
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
BOOL CHazeMarker::
|
|
#line 102 "D:/SE1_GPL/Sources/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 104 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
InitAsEditorModel ();
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
SetPhysicsFlags (EPF_MODEL_IMMATERIAL );
|
|
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
SetCollisionFlags (ECF_IMMATERIAL );
|
|
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
SetModel (MODEL_MARKER );
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
SetModelMainTexture (TEXTURE_MARKER );
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
if(m_strName == "Marker"){
|
|
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
m_strName = "Haze marker";
|
|
#line 115 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
}
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
m_fDensity = ClampDn (m_fDensity , 1E-6f);
|
|
#line 119 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
m_fFar = ClampDn (m_fFar , 0.001f);
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
m_fNear = Clamp (m_fNear , 0.0f , m_fFar - 0.0005f);
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
ASSERT (m_fNear >= 0 && m_fNear < m_fFar );
|
|
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
m_iSize = 1 << INDEX (Log2 (m_iSize ));
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
m_iSize = Clamp (m_iSize , INDEX (2) , INDEX (256));
|
|
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 126 "D:/SE1_GPL/Sources/EntitiesMP/HazeMarker.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;}; |