Files
RP411/MUNGA/INTORGN.cpp
T
CydandClaude Opus 4.8 4abbf8879f Initial import of Red Planet v4.10 Win32 source
Imports the current Win32 source for the pod-racing game 'Red Planet',
built on the MUNGA engine and its L4 (Win32/DirectX) platform layer:

- MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend
- RP / RP_L4: Red Planet game logic and Win32 application
- DivLoader, Setup1: asset loader and installer project
- lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies

Removed stale Subversion metadata and added .gitignore/.gitattributes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 07:59:51 -05:00

152 lines
3.8 KiB
C++

#include "munga.h"
#pragma hdrstop
#include "intorgn.h"
#include "app.h"
#include "interest.h"
//#############################################################################
//####################### InterestOrigin ################################
//#############################################################################
//
//#############################################################################
// InterestOrigin
//#############################################################################
//
InterestOrigin::InterestOrigin(
InterestZoneID interest_zone_ID,
InterestType interest_type,
InterestDepth depth_calibration
):
interestArenaSocket(NULL)
{
interestZoneID = interest_zone_ID;
interestType = interest_type;
depthCalibration = depth_calibration;
}
//
//#############################################################################
// ~InterestOrigin
//#############################################################################
//
InterestOrigin::~InterestOrigin()
{
InterestArena *interest_arena;
Check(&interestArenaSocket);
if ((interest_arena = interestArenaSocket.GetCurrent()) != NULL)
{
Unregister_Object(interest_arena);
delete interest_arena;
}
}
//
//#############################################################################
// TestInstance
//#############################################################################
//
Logical
InterestOrigin::TestInstance() const
{
Node::TestInstance();
Verify(interestZoneID != NullInterestZoneID);
Verify(
interestType == VisualInterestType ||
interestType == AudioInterestType ||
interestType == GaugeInterestType ||
interestType == CollisionInterestType
);
Check(&interestArenaSocket);
return True;
}
//
//#############################################################################
// Update
//#############################################################################
//
void
InterestOrigin::Update(
#if DEBUG_LEVEL>0
InterestZoneID interest_zone_ID
#else
InterestZoneID
#endif
)
{
Check(this);
Verify(interest_zone_ID != NullInterestZoneID);
#if 0
//
// If (the interest zone has changed)
//
//
// Calculate the new interest arena for this interest origin
//
//
// Add this interest origin to a "changed" list
//
#else
//
// HACK - there is only one interest zone right now...
//
if (interestArenaSocket.GetCurrent() == NULL)
{
InterestManager *interest_manager;
Check(application);
interest_manager = application->GetInterestManager();
Check(interest_manager);
Check(interest_manager->GetInterestLatticeManager());
InterestArena *interest_arena =
interest_manager->GetInterestLatticeManager()->MakeInterestArena(
(InterestZoneID)0,
(InterestType)0,
(InterestDepth)0
);
Register_Object(interest_arena);
interestArenaSocket.Add(interest_arena);
Verify(interest_arena == interestArenaSocket.GetCurrent());
}
#endif
}
//
//#############################################################################
//#############################################################################
//
void
InterestOrigin::AddInterestingEntity(Entity*)
{
Fail("InterestOrigin::AddInterestingEntity - Should never reach here\n");
}
//
//#############################################################################
//#############################################################################
//
void
InterestOrigin::RemoveUninterestingEntity(Entity*)
{
Fail("InterestOrigin::RemoveUninterestingEntity - Should never reach here\n");
}
//
//#############################################################################
//#############################################################################
//
void
InterestOrigin::RemoveUninterestingEntities()
{
Fail("InterestOrigin::RemoveUninterestingEntities - Should never reach here\n");
}