Files
firestorm/Gameleap/code/mw4/Libraries/elementrenderer/LightElement.hpp
T
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

147 lines
3.4 KiB
C++

#pragma once
#include "ElementRenderer.hpp"
#include <gosFX\PointLight.hpp>
namespace gosFX
{
//########################################################################
//############################# Light ##################################
//########################################################################
class __declspec(novtable) Light:
public Stuff::Plug
{
protected:
Light(MidLevelRenderer::MLRLight* light);
public:
virtual ~Light();
virtual void ChangeLight(gosFX::LightManager::Info *info);
virtual void GetInfo(gosFX::LightManager::Info *info);
MidLevelRenderer::MLRLight *m_light;
};
}
namespace ElementRenderer {
//############################################################################
//######################## LightElementManager #############################
//############################################################################
class LightElementManager:
public gosFX::LightManager
{
public:
static LightElementManager* &Instance;
LightElementManager();
~LightElementManager();
virtual gosFX::Light* MakeLight(MidLevelRenderer::MLRLight *light)=0;
void ChangeLight(
gosFX::Light* light,
Info *info
);
void DeleteLight(gosFX::Light *light);
};
//#########################################################################
//######################### LightElement ################################
//#########################################################################
class LightElement:
public Element
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Initialization
//
public:
static void InitializeClass();
static void TerminateClass();
static ClassData *DefaultData;
typedef Element BaseClass;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Constructors/Destructors
//
protected:
LightElement(
Stuff::MemoryStream *stream,
int version
);
public:
LightElement();
~LightElement();
static LightElement* Make(
Stuff::MemoryStream *stream,
int version,
ShapeHolder shapes=NULL
);
void Save(Stuff::MemoryStream *stream);
static HGOSHEAP s_Heap;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Testing
//
public:
void TestInstance();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Hierarchy
//
protected:
void AttachChild(Element *child);
void DetachChild(Element *child);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Sync support
//
protected:
void SetSyncState();
void LightSync();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Collision
//
protected:
bool CastCulledRay(CollisionQuery *query);
Element* FindSmallestElementContainingCulled(SphereTest *test);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Drawing
//
protected:
void SetDrawState();
void Draw(
CameraElement *camera,
const StateChange *inherited_state,
int clipping_state
);
int CountTriangles();
public:
gosFX::Light* GetLight()
{Check_Object(this); return m_light;}
void AdoptLight(gosFX::Light* light);
LightElementManager::Info m_lightInfo;
protected:
gosFX::Light *m_light;
};
}