Skip to content

Commit 3b80257

Browse files
author
nitrocaster
committed
Refactor GameObject class hierarchy.
1 parent 96b2baa commit 3b80257

File tree

549 files changed

+2465
-2345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

549 files changed

+2465
-2345
lines changed

src/Layers/xrRender/LightTrack.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void CROS_impl::update (IRenderable* O)
183183
VERIFY (dynamic_cast<CROS_impl*> (O->renderable_ROS()));
184184
//float dt = Device.fTimeDelta;
185185

186-
CObject* _object = dynamic_cast<CObject*> (O);
186+
IGameObject* _object = dynamic_cast<IGameObject*> (O);
187187

188188
// select sample, randomize position inside object
189189
vis_data &vis = O->GetRenderData().visual->getVisData();
@@ -360,7 +360,7 @@ void CROS_impl::update_smooth (IRenderable* O)
360360
}
361361
}
362362

363-
void CROS_impl::calc_sun_value(Fvector& position, CObject* _object)
363+
void CROS_impl::calc_sun_value(Fvector& position, IGameObject* _object)
364364
{
365365

366366
#if RENDER==R_R1
@@ -377,7 +377,7 @@ void CROS_impl::calc_sun_value(Fvector& position, CObject* _object)
377377
}
378378
}
379379

380-
void CROS_impl::calc_sky_hemi_value(Fvector& position, CObject* _object)
380+
void CROS_impl::calc_sky_hemi_value(Fvector& position, IGameObject* _object)
381381
{
382382
// hemi-tracing
383383
if (MODE & IRender_ObjectSpecific::TRACE_HEMI)
@@ -419,7 +419,7 @@ void CROS_impl::calc_sky_hemi_value(Fvector& position, CObject* _object)
419419

420420
void CROS_impl::prepare_lights(Fvector& position, IRenderable* O)
421421
{
422-
CObject* _object = dynamic_cast<CObject*> (O);
422+
IGameObject* _object = dynamic_cast<IGameObject*> (O);
423423
float dt = Device.fTimeDelta;
424424

425425
vis_data &vis = O->GetRenderData().visual->getVisData();

src/Layers/xrRender/LightTrack.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ class CROS_impl : public IRender_ObjectSpecific
111111
static inline void accum_hemi(float* hemi_cube, Fvector3& dir, float scale);
112112

113113
//Calculates sun part of ambient occlusion
114-
void calc_sun_value(Fvector& position, CObject* _object);
114+
void calc_sun_value(Fvector& position, IGameObject* _object);
115115

116116
//Calculates sky part of ambient occlusion
117-
void calc_sky_hemi_value(Fvector& position, CObject* _object);
117+
void calc_sky_hemi_value(Fvector& position, IGameObject* _object);
118118

119119
//prepares static or hemisphere lights for ambient occlusion calculations
120120
void prepare_lights(Fvector& position, IRenderable* O);

src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void dx103DFluidObstacles::ProcessDynamicObstacles( const dx103DFluidData &Fluid
204204
// renderable
205205
//IRenderable* renderable = spatial->dcast_Renderable ();
206206
//if (0==renderable) continue; // unknown, but renderable object (r1_glow???)
207-
CObject* pObject = spatial->dcast_CObject();
207+
IGameObject* pObject = spatial->dcast_GameObject();
208208
if (!pObject) continue;
209209

210210
const IObjectPhysicsCollision* pCollision = pObject->physics_collision();

src/Layers/xrRenderPC_R1/FStaticRender.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void CRender::set_Object (IRenderable* O )
266266
VERIFY (g_bRendering);
267267
val_pObject = O; // NULL is OK, trust me :)
268268
if (val_pObject) {
269-
VERIFY(dynamic_cast<CObject*>(O)||dynamic_cast<CPS_Instance*>(O));
269+
VERIFY(dynamic_cast<IGameObject*>(O)||dynamic_cast<CPS_Instance*>(O));
270270
if (O->GetRenderData().pROS) { VERIFY(dynamic_cast<CROS_impl*>(O->GetRenderData().pROS)); }
271271
}
272272
if (PHASE_NORMAL==phase) {
@@ -288,7 +288,7 @@ void CRender::apply_object (IRenderable* O )
288288
if (0==O) return ;
289289
if (PHASE_NORMAL==phase && O->renderable_ROS()) {
290290
CROS_impl& LT = *((CROS_impl*)O->GetRenderData().pROS);
291-
VERIFY(dynamic_cast<CObject*>(O)||dynamic_cast<CPS_Instance*>(O));
291+
VERIFY(dynamic_cast<IGameObject*>(O)||dynamic_cast<CPS_Instance*>(O));
292292
VERIFY(dynamic_cast<CROS_impl*>(O->GetRenderData().pROS));
293293
float o_hemi = 0.5f*LT.get_hemi ();
294294
float o_sun = 0.5f*LT.get_sun ();
@@ -445,7 +445,7 @@ void CRender::Calculate ()
445445
if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size();
446446

447447
// update light-vis for current entity / actor
448-
CObject* O = g_pGameLevel->CurrentViewEntity();
448+
IGameObject* O = g_pGameLevel->CurrentViewEntity();
449449
if (O) {
450450
CROS_impl* R = (CROS_impl*) O->ROS();
451451
if (R) R->update (O);

src/Layers/xrRenderPC_R1/GlowManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void CGlowManager::Render ()
197197
void CGlowManager::render_sw ()
198198
{
199199
// 0. save main view and disable
200-
CObject* o_main = g_pGameLevel->CurrentViewEntity();
200+
IGameObject* o_main = g_pGameLevel->CurrentViewEntity();
201201

202202
// 1. Test some number of glows
203203
Fvector start = Device.vCameraPosition;

src/Layers/xrRenderPC_R1/LightProjector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void CLightProjector::set_object (IRenderable* O)
8080
else {
8181
spatial->spatial_updatesector ();
8282
if (0==spatial->GetSpatialData().sector) {
83-
CObject* obj = dynamic_cast<CObject*>(O);
83+
IGameObject* obj = dynamic_cast<IGameObject*>(O);
8484
if (obj) Msg ("! Invalid object '%s' position. Outside of sector structure.",obj->cName().c_str());
8585
current = 0;
8686
}
@@ -218,7 +218,7 @@ void CLightProjector::calculate ()
218218
v.sub (v_Cs,v_C);;
219219
#ifdef DEBUG
220220
if ((v.x*v.x+v.y*v.y+v.z*v.z)<=flt_zero) {
221-
CObject* OO = dynamic_cast<CObject*>(R.O);
221+
IGameObject* OO = dynamic_cast<IGameObject*>(R.O);
222222
Msg("Object[%s] Visual[%s] has invalid position. ",*OO->cName(),*OO->cNameVisual());
223223
Fvector cc;
224224
OO->Center(cc);

src/Layers/xrRenderPC_R2/r2_R_render.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void CRender::render_main (Fmatrix& m_ViewProjection, bool _fportals)
4242
if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size();
4343

4444
// update light-vis for current entity / actor
45-
CObject* O = g_pGameLevel->CurrentViewEntity();
45+
IGameObject* O = g_pGameLevel->CurrentViewEntity();
4646
if (O) {
4747
CROS_impl* R = (CROS_impl*) O->ROS();
4848
if (R) R->update (O);

src/Layers/xrRenderPC_R3/r3_R_render.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void CRender::render_main (Fmatrix& m_ViewProjection, bool _fportals)
4444
if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size();
4545

4646
// update light-vis for current entity / actor
47-
CObject* O = g_pGameLevel->CurrentViewEntity();
47+
IGameObject* O = g_pGameLevel->CurrentViewEntity();
4848
if (O) {
4949
CROS_impl* R = (CROS_impl*) O->ROS();
5050
if (R) R->update (O);

src/Layers/xrRenderPC_R4/r4_R_render.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void CRender::render_main (Fmatrix& m_ViewProjection, bool _fportals)
4545
if (lstRenderables.size()) uID_LTRACK = uLastLTRACK%lstRenderables.size();
4646

4747
// update light-vis for current entity / actor
48-
CObject* O = g_pGameLevel->CurrentViewEntity();
48+
IGameObject* O = g_pGameLevel->CurrentViewEntity();
4949
if (O) {
5050
CROS_impl* R = (CROS_impl*) O->ROS();
5151
if (R) R->update (O);

src/xrCDB/ISpatial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void ISpatial_DB::insert (ISpatial* S)
260260
BOOL bValid = _valid(S->GetSpatialData().sphere.R) && _valid(S->GetSpatialData().sphere.P);
261261
if (!bValid)
262262
{
263-
CObject* O = dynamic_cast<CObject*>(S);
263+
IGameObject* O = dynamic_cast<IGameObject*>(S);
264264
if (O) Debug.fatal(DEBUG_INFO,"Invalid OBJECT position or radius (%s)",O->cName().c_str());
265265
else {
266266
CPS_Instance* P = dynamic_cast<CPS_Instance*>(S);

0 commit comments

Comments
 (0)