Files
firestorm/Gameleap/code/mw4/Libraries/Adept/VideoComponentWeb.cpp
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

153 lines
4.4 KiB
C++

//===========================================================================//
// File: cmpnnt.cc //
// Project: MUNGA Brick: Entity //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 12/14/94 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include "AdeptHeaders.hpp"
#include "VideoComponentWeb.hpp"
#include "ShapeComponent.hpp"
//#############################################################################
//########################### VideoComponentWeb #############################
//#############################################################################
VideoComponentWeb::ClassData*
VideoComponentWeb::DefaultData = NULL;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
VideoComponentWeb::InitializeClass()
{
Verify(!DefaultData);
DefaultData =
new ClassData(
VideoComponentWebClassID,
"Adept::VideoComponentWeb",
RendererComponentWeb::DefaultData
);
Register_Object(DefaultData);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
VideoComponentWeb::TerminateClass()
{
Unregister_Object(DefaultData);
delete DefaultData;
DefaultData = NULL;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
VideoComponentWeb::VideoComponentWeb(
ClassData *class_data,
Entity *entity,
Renderer *renderer,
const ResourceID &script_id,
VideoComponentWeb *parent_web
):
RendererComponentWeb(class_data, entity, renderer, script_id, parent_web)
{
Check_Object(renderer);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
VideoComponentWeb::~VideoComponentWeb()
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
VideoComponentWeb::SetInterest(bool rendered)
{
Check_Object(this);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
VideoComponentWeb::TestInstance()
{
Verify(IsDerivedFrom(DefaultData));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
VideoComponentWeb::CleanDamage()
{
Check_Object(this);
ChainIteratorOf<Component*> chillins(&ownedComponents);
Component *component;
while ((component = chillins.ReadAndNext()) != NULL)
{
if (component->GetClassID() == ShapeComponentClassID)
{
ShapeComponent *shape = Cast_Object(ShapeComponent*, component);
shape->CleanDamage();
}
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
VideoComponentWeb::ApplyDamage(
const Stuff::LinearMatrix4D &damage_spot,
Stuff::Scalar radius
)
{
Check_Object(this);
Check_Object(&damage_spot);
ChainIteratorOf<Component*> chillins(&ownedComponents);
Component *component;
while ((component = chillins.ReadAndNext()) != NULL)
{
if (component->GetClassID() == ShapeComponentClassID)
{
ShapeComponent *shape = Cast_Object(ShapeComponent*, component);
shape->ApplyDamage(damage_spot, radius);
}
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
VideoComponentWeb::ApplyDamageDecal(
const Stuff::LinearMatrix4D &damage_spot,
Stuff::Scalar radius,
MidLevelRenderer::MLRTexture *texture
)
{
Check_Object(this);
Check_Object(&damage_spot);
ChainIteratorOf<Component*> chillins(&ownedComponents);
Component *component;
while ((component = chillins.ReadAndNext()) != NULL)
{
if (component->GetClassID() == ShapeComponentClassID)
{
ShapeComponent *shape = Cast_Object(ShapeComponent*, component);
shape->ApplyDamageDecal(damage_spot, radius, texture);
}
}
}