Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)

Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-02 13:21:58 -05:00
co-authored by Claude Fable 5
commit fdd9ac9d97
8682 changed files with 419927 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# Archival repository: preserve all files byte-for-byte.
# No line-ending conversion, no diff/merge text munging.
* -text
View File
View File
BIN
View File
Binary file not shown.
Binary file not shown.
+58
View File
@@ -0,0 +1,58 @@
@echo off
echo **************************************************************
echo * first argument is "a" to build an all new archive or *
echo * "f" to freshen an existing one. Second argument is the *
echo * directory to place the archive (default is root) The files *
echo * to be archived are located in "arcfiles.lst" which MUST *
echo * also be on your disk or this won't work. GAC 6/23/95 *
echo **************************************************************
set a3=arcfiles.lst
set s1=exclude.lst
if not "%3"=="" set a3=%3
if not exist %a3% goto NOLISTFILE
if not exist %s1% goto NOEXCLUDEFILE
if "%1"=="a" goto BUILD
if "%1"=="f" goto FRESHEN
goto USAGE
:BUILD
echo on
pkzip -a -P -eX -x@%s1% %2\bt.zip @%a3%
@echo off
goto END
:FRESHEN
echo on
pkzip -u -P -eX -x@%s1% %2\bt.zip @%a3%
@echo off
goto END
:NOLISTFILE
echo.
echo Listfile '%a3%' not in current directory.
echo.
goto END
:NOEXCLUDEFILE
echo.
echo Excludefile '%s1%' not in current directory.
echo.
goto END
:USAGE
echo.
echo usage: arcbt mode [[drive] listfile]
echo mode a build archive from scratch
echo f freshen existing archive
echo drive for archive file
echo listfile specifies what files to store in archive
echo.
goto END
:END
set s1=
set a3=
+41
View File
@@ -0,0 +1,41 @@
btl4tool.exe
readme.txt
btdpl.ini
btl4opt.exe
btl4d0.exe
btl4d2s.exe
btl4d3s.exe
btl4.res
netnub.exe
setenv.bat
dpmi32vm.ovl
32*.exe
l4gauge.ini
vr*.*
*.386
test.egg
video\*.*
video\mat\*.*
video\mat\arena\*.*
video\mat\polar\*.*
video\mat\morning\*.*
video\mat\day\*.*
video\mat\evening\*.*
video\mat\night\*.*
video\geo\*.*
video\geo\arena\*.*
video\geo\polar\*.*
video\geo\morning\*.*
video\geo\day\*.*
video\geo\evening\*.*
video\geo\night\*.*
video\tex\*.*
gauge\*.cfg
gauge\*.ini
gauge\*.pc?
gauge\*.gim
gauge\*.gat
audio\*.cfg
audio\*.ini
audio\*.res
+15
View File
@@ -0,0 +1,15 @@
#include "testbt.hpp"
//#############################################################################
// Test Class -- AmmoBin
//
Logical AmmoBin::TestClass(Mech &)
{
return True;
}
void AmmoBin::ResetToInitialState()
{
}
+24
View File
@@ -0,0 +1,24 @@
#if !defined(BT_HPP)
# define BT_HPP
# if !defined(MUNGA_HPP)
# include <munga.hpp>
# endif
# if !defined(NO_PRECOMPILED_HEADERS)
# if !defined(MECH_HPP)
# include <mech.hpp>
# endif
# if !defined(BTPLAYER_HPP)
# include <btplayer.hpp>
# endif
# if !defined(MECHSUB_HPP)
# include <mechsub.hpp>
# endif
# endif
#endif
+112
View File
@@ -0,0 +1,112 @@
.autodepend
.cacheautodepend
.suffixes: .cpp
!ifndef BTYPE
!error BTYPE macro not supplied
!endif
!ifndef BPATH
!error BPATH macro not supplied
!endif
!include make.cfg
!include $(BPATH)
!ifndef BT_ROOT
!error BT_ROOT macro is not defined
!endif
TARGET_DIR = $(BT_ROOT)\$(BTYPE)
TARGET_PATH = $(TARGET_DIR)\\
.path.obj = $(TARGET_DIR)
.path.lib = $(LIBRARY_PATH)
LIB_PREFIX = -+$(TARGET_DIR)\\
CFG_FILE = $(TARGET_DIR)\$(BTYPE).cfg
HEADER_FILE = bt$(BTYPE).csm
#------------------------------------------------------------------------------
# Library targets
#
all: $(CFG_FILE) $(TARGET_DIR)\bt.lib
clean:
del $(TARGET_DIR)\*.obj
del $(TARGET_DIR)\*.lib
del $(TARGET_DIR)\*.bak
del $(TARGET_DIR)\*.cfg
assemble:
@echo No assembly targets
#------------------------------------------------------------------------------
# Implicit rules
#
!include $(BTYPE).mak
!ifndef STARTUP_OBJ
!error STARTUP_OBJ macro is not defined
!endif
!ifndef STARTUP_LIBS
!error STARTUP_LIBS macro is not defined
!endif
{$(INCLUDE_PATH)}.cpp{$(TARGET_DIR)}.obj:
$(BCC) @$(CFG_FILE) $< >>error.log
{$(INCLUDE_PATH)}.c{$(TARGET_DIR)}.obj:
$(BCC) @$(CFG_FILE) $< >>error.log
{$(BT_ROOT)}.asm{$(TARGET_DIR)}.obj:
tasm32 -ml $(TASM_OPTIONS) -i$(BT_ROOT) $<,$@ >>error.log
#------------------------------------------------------------------------------
# Battletech library
#
BT_OBJS = \
?btmssn.obj \
?messmgr.obj \
?mechdmg.obj \
?dmgtable.obj \
?mech.obj \
?mech2.obj \
?mech3.obj \
?mech4.obj \
?mechsub.obj \
?mechtech.obj \
?heat.obj \
?mechmppr.obj \
?powersub.obj \
?sensor.obj \
?gnrator.obj \
?gyro.obj \
?torso.obj \
?hud.obj \
?myomers.obj \
?mechweap.obj \
?emitter.obj \
?ppc.obj \
?projweap.obj \
?mislanch.obj \
?ammobin.obj \
?gauss.obj \
?projtile.obj \
?misthrst.obj \
?seeker.obj \
?missile.obj \
?btplayer.obj \
?btteam.obj \
?btdirect.obj \
?btreg.obj \
?btcnsl.obj \
?bttool.obj
$(BT_OBJS:?=): $(CFG_FILE)
$(TARGET_DIR)\bt.lib: $(BT_OBJS:?=) $(BT_ROOT)\bt.mak
tlib $@ $(LIB_OPTIONS) @&&|
$(BT_OBJS:?=$(LIB_PREFIX))
| >>error.log
+107
View File
@@ -0,0 +1,107 @@
//===========================================================================//
// File: cnslmsgs.cpp //
// Project: MUNGA Brick: //
// Contents: Console messages //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- -----------------------------------------------------------//
// 06/02/95 ECH Initial coding. //
// 06/03/95 GAH Added corresponding Macintosh message defintions. //
// 10/05/95 GAH Added ConsoleApplicationEndMissionMessage. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(BTCNSL_HPP)
# include <btcnsl.hpp>
#endif
//~~~~~~~~~~~~~~~~~~ ConsolePlayerMechKilledMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsolePlayerMechKilledMessage::
ConsolePlayerMechKilledMessage(
HostID player_host_ID,
HostID killer_host_ID
):
NetworkClient::Message(
ConsolePlayerMechKilledMessageID,
sizeof(ConsolePlayerMechKilledMessage)
)
{
playerHostID = player_host_ID;
killerHostID = killer_host_ID;
}
//~~~~~~~~~~~~~~~~~~ ConsolePlayerMechScoreUpdateMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsolePlayerMechScoreUpdateMessage::
ConsolePlayerMechScoreUpdateMessage(
HostID player_host_ID,
int score
):
NetworkClient::Message(
ConsolePlayerMechScoreUpdateMessageID,
sizeof(ConsolePlayerMechScoreUpdateMessage)
)
{
playerHostID = player_host_ID;
playerScore = score;
}
//~~~~~~~~~~~~~~~~~~ ConsoleBTTeamScoreUpdateMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsoleBTTeamScoreUpdateMessage::
ConsoleBTTeamScoreUpdateMessage(
int team_ID,
int score
):
NetworkClient::Message(
ConsoleBTTeamScoreUpdateMessageID,
sizeof(ConsoleBTTeamScoreUpdateMessage)
)
{
teamID = team_ID;
teamScore = score;
}
//~~~~~~~~~~~~~~~~~~ ConsolePlayerMechDamagedMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsolePlayerMechDamagedMessage::
ConsolePlayerMechDamagedMessage(
HostID player_host_ID,
HostID damager_host_ID,
int loss,
int damage_zone_index,
Logical damage_zone_destroyed,
int points_transfered,
int weapon_index
):
NetworkClient::Message(
ConsolePlayerMechDamagedMessageID,
sizeof(ConsolePlayerMechDamagedMessage)
)
{
playerHostID = player_host_ID;
damagerHostID = damager_host_ID;
damageLoss = loss;
pointsTransfered = points_transfered;
damageZoneIndex = damage_zone_index;
damageZoneDestroyed = damage_zone_destroyed;
weaponIndex = weapon_index;
}
//~~~~~~~~~~~~~~~~ ConsolePlayerMechDeathWithoutHonorMessage ~~~~~~~~~~~~~~~~~~~
ConsolePlayerMechDeathWithoutHonorMessage::
ConsolePlayerMechDeathWithoutHonorMessage(
HostID player_host_ID
):
NetworkClient::Message(
ConsolePlayerMechDeathWithoutHonorMessageID,
sizeof(ConsolePlayerMechDeathWithoutHonorMessage)
)
{
playerHostID = player_host_ID;
}
//==============================================================================
+76
View File
@@ -0,0 +1,76 @@
//===========================================================================//
// File: btdirect.hh //
// Project: Red Planet //
// Contents: Chooses from a Selection of Camerea's and provides information //
// to any number of cameraship's as to which player to follow //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/15/95 JM Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined (BTDIRECT_HPP)
# define BTDIRECT_HPP
# if !defined (DIRECTOR_HPP)
# include <director.hpp>
# endif
# if !defined (BTPLAYER_HPP) && 0
# include <btplayer.hpp>
# endif
class BTCameraDirector :
public CameraDirector
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Simulation Support
//
public:
typedef void
(BTCameraDirector::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
void
CreateBTCameraShip(Scalar);
void
BeABTDirector(Scalar);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction Support
//
BTCameraDirector(
MakeMessage *creation_message,
SharedData &virtual_data = DefaultData
);
static BTCameraDirector*
BTCameraDirector::Make(CameraDirector::MakeMessage *creation_message);
~BTCameraDirector();
Logical
TestInstance() const;
};
#endif
+70
View File
@@ -0,0 +1,70 @@
//===========================================================================//
// File: btmssn.cpp //
// Project: BattleTech //
// Contents: Implementation Details for missions //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 04/07/95 ECH Initial coding. //
// 09/12/95 JM added scenario //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(BTMSSN_HPP)
# include <btmssn.hpp>
#endif
#if !defined(NOTATION_HPP)
# include <notation.hpp>
#endif
//##########################################################################
//########################### BTMission ################################
//##########################################################################
BTMission::BTMission(
NotationFile *notation_file,
ResourceFile *resource_file
):
Mission(notation_file, resource_file)
{
Check(notation_file);
Check(resource_file);
//
//~~~~~~~~~~~~~~~~~~~~~~~~
// Load Up Default Values
//~~~~~~~~~~~~~~~~~~~~~~~~
//
experienceLevel = BTMission::NoviceMode;
advancedDamageOn = False;
int ret;
ret = notation_file->GetEntry("mission", "temperature", &missionTemperature);
if (!ret)
{
DEBUG_STREAM << "ERROR: no temperature in egg!\n";
Exit(AbortExitCodeID);
}
missionTemperature += 273.15f; // Celsius to Kelvin conversion
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BTMission::~BTMission()
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
BTMission::SetPlayerData(NotationFile*)
{
Fail("Should never reach BTMission::SetPlayerData() \n");
}
+96
View File
@@ -0,0 +1,96 @@
//===========================================================================//
// File: btmssn.hpp //
// Project: BattleTech //
// Contents: Implementation Details for missions //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 04/07/95 ECH Initial coding. //
// 09/12/95 JM added scenario //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTMSSN_HPP)
# define BTMSSN_HPP
# if !defined(MISSION_HPP)
# include <mission.hpp>
# endif
//##########################################################################
//########################### BTMission ################################
//##########################################################################
class BTMission :
public Mission
{
public:
enum {
NoviceMode = 0,
StandardMode,
VeteranMode,
ExpertMode,
ExperienceLevelModeCount
};
protected:
Enumeration experienceLevel;
CString
roleName;
CString
teamName;
Logical
advancedDamageOn;
Scalar
missionTemperature;
CString
patchName;
public:
BTMission(
NotationFile *notation_file,
ResourceFile *resources
);
~BTMission();
void
SetPlayerData(NotationFile *notation_file);
CString
GetRoleName() const
{ Check(this); return roleName; }
CString
GetTeamName() const
{ Check(this); return teamName; }
const CString
GetPatchName()
{Check(this); return patchName;}
const Scalar
GetMissionTemperature()
{Check(this); return missionTemperature;}
const Enumeration
ExperienceLevel()
{Check(this); return experienceLevel;}
const Logical
AdvancedDamageOn()
{Check(this); return advancedDamageOn;}
};
#endif
+162
View File
@@ -0,0 +1,162 @@
//===========================================================================//
// File: btreg.cc //
// Project: MUNGA Brick: Registry Manager //
// Contents: Interface specification for Registry Manager //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/22/94 ECH Initial coding. //
// 11/29/94 JMA Changed Identities to IDs //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(BTREG_HPP)
# include <btreg.hpp>
#endif
#if !defined(BTPLAYER_HPP)
# include <btplayer.hpp>
#endif
#if !defined(BTDIRECT_HPP)
# include <btdirect.hpp>
#endif
//
// Registered classes...
//
#if !defined(MECH_HPP)
# include <mech.hpp>
#endif
#if !defined(PROJTILE_HPP)
# include <projtile.hpp>
#endif
#if !defined(MISSILE_HPP)
# include <missile.hpp>
#endif
#if !defined(BTTEAM_HPP)
# include <btteam.hpp>
#endif
//
//~~~~~~~~~~~~~~~~
// Munga Includes
//~~~~~~~~~~~~~~~~
//
#if !defined(BTMSSN_HPP)
# include <btmssn.hpp>
#endif
#if !defined(DIRECTOR_HPP)
# include <director.hpp>
#endif
#if !defined(HOSTMGR_HPP)
# include <hostmgr.hpp>
#endif
#if !defined(APP_HPP)
# include <app.hpp>
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Registry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
// Registry
//#############################################################################
//
BTRegistry::BTRegistry(ResourceFile *)
{
}
//
//#############################################################################
// ~Registry
//#############################################################################
//
BTRegistry::~BTRegistry()
{
}
//
//#############################################################################
// GetStaticData
//#############################################################################
//
Entity::SharedData*
BTRegistry::GetStaticData(ClassID class_ID)
{
switch (class_ID)
{
case MechClassID:
return &Mech::DefaultData;
case ProjectileClassID:
return &Projectile::DefaultData;
case MissileClassID:
return &Missile::DefaultData;
case BTPlayerClassID:
return &BTPlayer::DefaultData;
case BTTeamClassID:
return &BTTeam::DefaultData;
default:
return Registry::GetStaticData(class_ID);
}
}
//
//#############################################################################
// GetStaticData
//#############################################################################
//
Player*
BTRegistry::MakePlayer(Mission *mission)
{
Check(this);
Check(mission);
BTMission *bt_mission = Cast_Object(BTMission *, mission);
if (strcmp(mission->GetGameModel(), "camera"))
{
BTPlayer::MakeMessage
make_player(
BTPlayer::MakeMessageID,
sizeof(BTPlayer::MakeMessage),
BTPlayerClassID,
EntityID::Null,
ResourceDescription::NullResourceID,
BTPlayer::DefaultFlags,
Origin::Identity,
mission->GetPlayerBitmapIndex(),
bt_mission->GetRoleName(),
bt_mission->GetTeamName()
);
return new BTPlayer(&make_player);
}
else
{
BTCameraDirector::MakeMessage create_director(
BTCameraDirector::MakeMessageID,
sizeof(BTCameraDirector::MakeMessage),
CameraDirectorClassID,
EntityID::Null,
ResourceDescription::NullResourceID,
BTCameraDirector::DefaultFlags,
Origin::Identity,
mission->GetPlayerBitmapIndex()
);
return new BTCameraDirector(&create_director);
}
}
+74
View File
@@ -0,0 +1,74 @@
//===========================================================================//
// File: registry.hh //
// Project: MUNGA Brick: Registry Manager //
// Contents: Interface specification for Registry Manager //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/22/94 ECH Initial coding. //
// 11/29/94 JMA Changed Identities to IDs //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTREG_HPP)
# define BTREG_HPP
# if !defined(REGISTRY_HPP)
# include <registry.hpp>
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Registry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//--------------------------------------------------------------------
// Registry
//
// Provides construction methods for entities.
// Provides access to a classes static data.
//--------------------------------------------------------------------
//
class BTRegistry:
public Registry
{
public:
//
//--------------------------------------------------------------------
//--------------------------------------------------------------------
// Public interface
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
//
//--------------------------------------------------------------------
// Construction, Destruction, and testing
//--------------------------------------------------------------------
//
BTRegistry(ResourceFile *);
~BTRegistry();
//
//--------------------------------------------------------------
// GetStaticData
//
// Provides an interface by which the static data for a class
// may be accessed.
//--------------------------------------------------------------
//
Entity__SharedData*
GetStaticData(ClassID entity_class);
//
//-------------------------
// Create the player object
//-------------------------
//
Player*
MakePlayer(Mission *mission);
};
#endif
+22
View File
@@ -0,0 +1,22 @@
//===========================================================================//
// File: btscnrl.cpp //
// Project: MUNGA //
// Contents: BT Scenario Role Specific Data //
//------------------- -------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/06/96 GDU Initial coding //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
# if !defined(BTSCNRL_HPP)
# include <btscnrl.hpp>
# endif
+152
View File
@@ -0,0 +1,152 @@
//===========================================================================//
// File: btteam.cpp //
// Project: BattleTech //
// Contents: BattleTech Team Specifications //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/11/96 JM initial coding //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(BTTEAM_HPP)
# include <btteam.hpp>
#endif
#if !defined(HOSTMGR_HPP)
# include <hostmgr.hpp>
#endif
#if !defined(APP_HPP)
# include <app.hpp>
#endif
#if !defined(BTCNSL_HPP)
# include <btcnsl.hpp>
#endif
//#############################################################################
//############################### BTTeam ###############################
//#############################################################################
//#############################################################################
// Shared Data Support
//
Derivation
BTTeam::ClassDerivations(Team::ClassDerivations,"BTTeam");
BTTeam::SharedData
BTTeam::DefaultData(
BTTeam::ClassDerivations,
BTTeam::MessageHandlers,
BTTeam::AttributeIndex,
BTTeam::StateCount,
(BTTeam::MakeHandler)BTTeam::Make
);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
BTTeam::TeamSimulation(
Scalar // time_slice
)
{
Check(this);
//
//------------------------------------------------------------------------
// Update the console every 15 seconds
//------------------------------------------------------------------------
//
if (lastPerformance - lastConsoleUpdate >= 15.0f)
{
lastConsoleUpdate = lastPerformance;
//
//---------------------------------------------
// Tell the console (if there is one) our score
//---------------------------------------------
//
Check(application);
HostManager *host_manager = application->GetHostManager();
Check(host_manager);
Host *console_host = host_manager->GetConsoleHost();
if (console_host)
{
Check(console_host);
ConsoleBTTeamScoreUpdateMessage
score_message(ownerID, (int)teamScore);
application->SendMessage(
console_host->GetHostID(),
NetworkClient::ConsoleClientID,
&score_message
);
}
}
Check_Fpu();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BTTeam::BTTeam(
MakeMessage *creation_message,
SharedData &shared_data
) :
Team (creation_message, shared_data)
{
lastConsoleUpdate = lastPerformance;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BTTeam::~BTTeam()
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
BTTeam*
BTTeam::Make(MakeMessage *creation_message)
{
Check_Fpu();
return new BTTeam(creation_message);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
Logical
BTTeam::CreateMakeMessage(
MakeMessage *creation_message,
NotationFile *model_file,
const ResourceDirectories *directories
)
{
Check(creation_message);
Check(model_file);
if (!Team::CreateMakeMessage(creation_message, model_file, directories))
{
return False;
}
creation_message->classToCreate = BTTeamClassID;
return True;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
Logical
BTTeam::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
+88
View File
@@ -0,0 +1,88 @@
//===========================================================================//
// File: btteam.hpp //
// Project: BattleTech //
// Contents: BattleTech Team Specifications //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/11/96 JM initial coding //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined (BTTEAM_HPP)
# define BTTEAM_HPP
# if !defined (TEAM_HPP)
# include <team.hpp>
# endif
//##########################################################################
//######################## CLASS BTTeam ##############################
//##########################################################################
class BTTeam :
public Team
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data support
//
public:
static Derivation
ClassDerivations;
static SharedData
DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
public:
typedef void
(BTTeam::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
void
TeamSimulation(Scalar time_slice);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Console Support
//
protected:
Time
lastConsoleUpdate;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction / Destruction Support
//
public:
BTTeam(
MakeMessage *creation_message,
SharedData &shared_data = DefaultData
);
~BTTeam();
Logical
TestInstance() const;
static BTTeam*
Make(MakeMessage *creation_message);
static Logical
CreateMakeMessage (
MakeMessage *creation_message,
NotationFile *model_file,
const ResourceDirectories *directories
);
};
#endif
+209
View File
@@ -0,0 +1,209 @@
//===========================================================================//
// File: txttores.cpp //
// Project: Resource Tools //
// Author: Jerry Edsall //
// Purpose: Program to convert Notation files to MUNGA .res files. //
//---------------------------------------------------------------------------//
// Copyright (c) 1995 Virtual World Entertainment, Inc. //
// All rights reserved worldwide. //
// This unpublished source code is PROPRIETARY and CONFIDENTIAL. //
//===========================================================================//
#include "bt.hpp"
#if !defined(BTTOOL_HPP)
# include "bttool.hpp"
#endif
#if !defined(FILEUTIL_HPP)
# include <fileutil.hpp>
#endif
#if !defined(MECH_HPP)
# include "mech.hpp"
#endif
#if !defined(BTPLAYER_HPP)
# include "btplayer.hpp"
#endif
#if !defined(PROJTILE_HPP)
# include "projtile.hpp"
#endif
#if !defined(MISSILE_HPP)
# include "missile.hpp"
#endif
#if !defined(BTTEAM_HPP)
# include "btteam.hpp"
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
Logical
BTTool::CreateMakeMessage(
const char* class_name,
Entity::MakeMessage *creation_message,
NotationFile *model_file,
const ResourceDirectories *directories
)
{
if (!stricmp(class_name,"MechClassID"))
{
Mech::CreateMakeMessage(
(Mech::MakeMessage*)creation_message,
model_file,
directories
);
return True;
}
else if (!stricmp(class_name, "BTTeamClassID"))
{
BTTeam::CreateMakeMessage(
(BTTeam::MakeMessage*)creation_message,
model_file,
directories
);
return True;
}
return
ApplicationTool::CreateMakeMessage(
class_name,
creation_message,
model_file,
directories
);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
BTTool::CreateModelResource(
ModelData &model_resources,
const char *model_class,
ResourceFile *resource_file,
const char *model_name,
NotationFile *model_file,
const ResourceDirectories *directories
)
{
if (!stricmp(model_class, "MechClassID"))
{
#if 0
strcpy(ops_file_data, ops_name);
strcat(ops_file_data, "::Standard::Vehicle::");
strcat(ops_file_data, model_name );
strcpy(ops_file_page, ops_name);
strcat(ops_file_page, "::Standard::VehicleList");
ops_file->AppendEntry(ops_file_page, "vehicle", ops_file_data);
ops_file->SetEntry(ops_file_data, "tag", model_name );
ops_file->SetEntry(ops_file_data, "classID", "BTVh");
ops_file->AppendEntry(ops_file_data, NULL, (char *)NULL);
#endif
model_resources.gameResourceID =
Mech::CreateModelResource(
resource_file,
model_name,
model_file,
directories
);
model_resources.subsystemResourceID =
Mech::CreateSubsystemStream(
resource_file,
model_name,
model_file,
directories
);
model_resources.damageZoneResourceID =
Mech::CreateDamageZoneStream(
resource_file,
model_name,
model_file,
directories
);
model_resources.skeletonResourceID =
Mech::CreateSkeletonStream(
resource_file,
model_name,
model_file,
directories
);
model_resources.explosionTableResourceID =
Mech::CreateExplosionTableStream(
resource_file,
model_name,
model_file,
directories
);
}
else if (!stricmp(model_class, "ProjectileClassID"))
{
model_resources.gameResourceID =
Projectile::CreateModelResource(
resource_file,
model_name,
model_file,
directories
);
}
else if (!stricmp(model_class, "MissileClassID"))
{
model_resources.gameResourceID =
Missile::CreateModelResource(
resource_file,
model_name,
model_file,
directories
);
}
else
{
ApplicationTool::CreateModelResource(
model_resources,
model_class,
resource_file,
model_name,
model_file,
directories
);
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
ResourceDescription::ResourceID
BTTool::CreateControlMappingStream(
const char *model_class,
const char *mapping_name,
NotationFile *mapping_file,
ResourceFile *resource_file,
const char *model_name,
NotationFile *model_file,
const ResourceDirectories *directories,
PlatformTool *current_tool
)
{
if (!stricmp(model_class, "MechClassID"))
{
return
Mech::CreateControlMappingStream(
mapping_name,
mapping_file,
platformTool->GetControlMappingFunction(),
resource_file,
model_name,
model_file,
directories,
current_tool
);
}
else
{
return -1;
}
}
+64
View File
@@ -0,0 +1,64 @@
//===========================================================================//
// File: txttores.hpp //
// Project: Art Tools //
// Author: Jerry Edsall //
// Purpose: Program to convert Notation files to MUNGA .res files. //
//---------------------------------------------------------------------------//
// Copyright (c) 1995 Virtual World Entertainment, Inc. //
// All rights reserved worldwide. //
// This unpublished source code is PROPRIETARY and CONFIDENTIAL. //
//===========================================================================//
#if !defined(BTTOOL_HPP)
# define BTTOOL_HPP
# if !defined(TOOL_HPP)
# include <tool.hpp>
# endif
//##########################################################################
//############################ RPTool ################################
//##########################################################################
class BTTool:
public ApplicationTool
{
protected:
Logical
CreateMakeMessage(
const char* class_name,
Entity::MakeMessage *creation_message,
NotationFile *model_file,
const ResourceDirectories *directories
);
void
CreateModelResource(
ModelData &model_resources,
const char *model_class,
ResourceFile *resource_file,
const char *model_name,
NotationFile *model_file,
const ResourceDirectories *directories
);
ResourceDescription::ResourceID
CreateControlMappingStream(
const char *model_class,
const char *mapping_name,
NotationFile *mapping_file,
ResourceFile *resource_file,
const char *model_name,
NotationFile *model_file,
const ResourceDirectories *directories,
PlatformTool *current_tool
);
public:
BTTool(PlatformTool *platform):
ApplicationTool(platform)
{}
};
#endif
+101
View File
@@ -0,0 +1,101 @@
#include "testbt.hpp"
//#############################################################################
// Test Class -- Emitter
//
Logical
Emitter::TestClass(Mech &mech)
{
Emitter *emitter;
PowerBar *power_Bar;
Condenser *condenser;
Generator *generator;
const Scalar time_Slice = 0.05f;
#if 0
Tell("Testing Emitter .................\n");
emitter = (Emitter*) mech.GetSubsystem(LaserSubsystemID);
power_Bar = (PowerBar*) mech.GetSubsystem(PowerBarSubsystemID);
condenser = (Condenser*) mech.GetSubsystem(CondenserSubsystemID);
generator = (Generator*) mech.GetSubsystem(GeneratorSubsystemID);
// Test Initial Values as given in the resource file
Test(Close_Enough(emitter->dischargeVoltage, 3.8f));
Test(Close_Enough(emitter->outputVoltage, 0.0f));
Test(Close_Enough(emitter->currentTemperature, 300.0f));
// Run the simulation a few times
#if defined (TEST_DEBUG)
Dump(emitter->currentLevel);
Dump(emitter->outputVoltage);
Dump(emitter->currentTemperature);
#endif
Test(Close_Enough(emitter->currentLevel,0.0f));
Test(Close_Enough(emitter->outputVoltage,0.0f));
// Run the Simulation Loops
MemoryStream stream(NULL, 0);
condenser->HeatSimulation(time_Slice, stream);
power_Bar->PoweredSimulation(time_Slice, stream);
emitter->EmitterSimulation(time_Slice, stream);
generator->GeneratorSimulation(time_Slice, stream);
#if defined (TEST_DEBUG)
Dump(emitter->currentLevel);
Dump(emitter->outputVoltage);
Dump(emitter->currentTemperature);
#endif
Test(Close_Enough(emitter->outputVoltage,0.00f,0.001f));
Test(Close_Enough(emitter->currentTemperature, 300.00f,0.001f));
emitter->outputVoltage = 5.0f; //Give it enough to fire!
#if defined (TEST_DEBUG)
Dump(emitter->outputVoltage);
#endif
emitter->AcceptHeat(35.0f);
// Run the Simulation Loops
condenser->HeatSimulation(time_Slice, stream);
power_Bar->PoweredSimulation(time_Slice, stream);
emitter->EmitterSimulation(time_Slice, stream);
#if defined (TEST_DEBUG)
Dump(emitter->currentLevel);
Dump(emitter->outputVoltage);
Dump(emitter->currentTemperature);
#endif
Test(Close_Enough(emitter->currentTemperature, 301.75f, 0.001f));
// Run the Simulation Loops
condenser->HeatSimulation(time_Slice, stream);
power_Bar->PoweredSimulation(time_Slice, stream);
emitter->EmitterSimulation(time_Slice, stream);
#if defined( TEST_DEBUG)
Dump(emitter->currentLevel);
Dump(emitter->outputVoltage);
Dump(emitter->currentTemperature);
#endif
Test(Close_Enough(emitter->currentTemperature, 301.597f, 0.001f));
// Return Power Bar and Laser to Initial States!
condenser->ResetToInitialState();
power_Bar->ResetToInitialState();
emitter->ResetToInitialState();
generator->ResetToInitialState();
#endif
return True;
}
//########################################################################
// resetToInitialState Emitter
//
void Emitter::ResetToInitialState()
{
SetSimulationState(Loaded);
PoweredSubsystem::ResetToInitialState();
}
+153
View File
@@ -0,0 +1,153 @@
//===========================================================================//
// File: gauss.cc //
// Project: BT Brick: Entity Manager //
// Contents: Basic weapons system pieces //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 04/13/95 JM Initial coding. //
// 07/19/95 GDU Complied with new munga and added electrical behavior
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
//
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(GAUSS_HPP)
# include <gauss.hpp>
#endif
//#############################################################################
// Shared Data Support
//
GaussRifle::SharedData
GaussRifle::DefaultData(
GaussRifle::ClassDerivations,
GaussRifle::MessageHandlers,
GaussRifle::AttributeIndex,
GaussRifle::StateCount
);
Derivation
GaussRifle::ClassDerivations(
Emitter::ClassDerivations,
"GaussRifle"
);
//#############################################################################
// Messaging Support
//
#if 0
//#############################################################################
// Attribute Support
//
const GaussRifle::IndexEntry
GaussRifle::AttributePointers[]=
{
ATTRIBUTE_ENTRY(GaussRifle, DischargeVoltage, dischargeVoltage)
};
GaussRifle::AttributeIndexSet
GaussRifle::AttributeIndex(
ELEMENTS(GaussRifle::AttributePointers),
GaussRifle::AttributePointers,
Emitter::AttributeIndex
);
#endif
//#############################################################################
// Model Support
//
void
GaussRifle::FireWeapon()
{
//
// Fire the weapon
//
outputVoltage = 0.0f;
Check_Fpu();
}
//#############################################################################
// Constructer/Destructor Support
//
GaussRifle::GaussRifle(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data
):
Emitter(owner, subsystem_ID, subsystem_resource, shared_data)
{
Check(owner);
Check_Pointer(subsystem_resource);
outputVoltage = 0.0f;
Check_Fpu();
}
GaussRifle::~GaussRifle()
{
Check(this);
Check_Fpu();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CreateStreamedSubsystem
//
Logical
GaussRifle::CreateStreamedSubsystem(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
int passes
)
{
if (
!Emitter::CreateStreamedSubsystem(
resource_file,
model_file,
model_name,
subsystem_name,
subsystem_resource,
subsystem_file,
directories,
passes
)
)
{
Check_Fpu();
return False;
}
subsystem_resource->subsystemModelSize = sizeof(*subsystem_resource);
subsystem_resource->classID = RegisteredClass::GaussRifleClassID;
Check_Fpu();
return True;
}
Logical
GaussRifle::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
+144
View File
@@ -0,0 +1,144 @@
//===========================================================================//
// File: gauss.hh //
// Project: BT Brick: Entity Manager //
// Contents: Gauss Rifle class, derives from Projectile Weapon //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 04/13/95 JM Initial coding. //
// 07/19/95 GDU Complied to new munga, added new electrical behavior //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined (GAUSS_HPP)
#define GAUSS_HPP
#if !defined(EMITTER_HPP)
# include <emitter.hpp>
#endif
//##################### Forward Class Declarations #######################
class Mech;
class Projectile;
//###########################################################################
//######################### GaussRifle Model Resource ########################
//###########################################################################
struct GaussRifle__SubsystemResource:
public Emitter::SubsystemResource
{
Scalar dischargeVoltage;
};
//###########################################################################
//######################### CLASS -- GaussRifle ##########################
//###########################################################################
class GaussRifle : public Emitter
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Messageing Support
//
#if 0
//##########################################################################
// Attribute Support
//
public:
enum {
= Emitter::NextAttributeID,
NextAttributeID
};
private:
static const IndexEntry AttributePointers[];
public:
static AttributeIndexSet AttributeIndex;
#endif
//##########################################################################
// Model Support
//
public:
typedef void
(GaussRifle::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
void
GaussRifleSimulation(Scalar time_slice);
//##########################################################################
// TestClass Support
//
public:
static Logical
TestClass(Mech &);
void
ResetToInitialState();
//##########################################################################
// Construction and Destruction
//
public:
typedef GaussRifle__SubsystemResource SubsystemResource;
GaussRifle(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data=DefaultData
);
~GaussRifle();
Logical
TestInstance() const;
static int
CreateStreamedSubsystem(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
int passes =1
);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Local data for the gun class
//
protected:
void
FireWeapon();
Vector3D
muzzleVelocity;
};
#endif
+18
View File
@@ -0,0 +1,18 @@
#include "testbt.hpp"
//#############################################################################
// TestClass -- Generator
//
Logical Generator::TestClass(Mech &)
{
return True;
}
//###########################################################################
// ResetToIntialState -- Generator
//
void Generator::ResetToInitialState()
{
HeatableSubsystem::ResetToInitialState();
outputVoltage = 0.0f;
}
+58
View File
@@ -0,0 +1,58 @@
#include "heat.hpp"
#include "app.hpp"
#include "testbt.hpp"
#define JM_CLOSE_ENOUGH 0.0005f
//###########################################################################
// Test Class for HeatableSubsystem
//
Logical
HeatableSubsystem::TestClass(Mech &)
{
return True;
}
//###########################################################################
// ResetToIntialState -- HeatableSubsystem
//
void HeatableSubsystem::ResetToInitialState()
{
currentTemperature = 300.0f;
heatLoad = 0.0f;
}
//###########################################################################
// Test Class for Condenser
//
Logical Condenser::TestClass( Mech& )
{
return True;
}
//###########################################################################
// ResetToIntialState -- Condenser
//
void Condenser::ResetToInitialState()
{
HeatableSubsystem::ResetToInitialState();
}
//###########################################################################
// Test Class for HeatSink
//
Logical HeatSink::TestClass( Mech& )
{
return True;
}
//###########################################################################
// ResetToIntialState -- Condenser
//
void HeatSink::ResetToInitialState()
{
HeatableSubsystem::ResetToInitialState();
}
+208
View File
@@ -0,0 +1,208 @@
//==========================================================================//
// File: mechdmg.hpp //
// Project: BattleTech //
// Contents: Mech::DamageZone //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 06/05/95 JM Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(MECHDMG_HPP)
# define MECHDMG_HPP
# if !defined(DAMAGE_HPP)
# include <damage.hpp>
# endif
# if !defined(SLOT_HPP)
# include <slot.hpp>
# endif
# if !defined(TABLE_HPP)
# include <table.hpp>
# endif
# if !defined(ENTITYID_HPP)
# include <entityid.hpp>
# endif
class Mech;
class Subsystem;
class DamageZone;
//##########################################################################
//###################### MechCriticalSubsystem #################
//##########################################################################
class
MechCriticalSubsystem SIGNATURED
{
public:
MechCriticalSubsystem(DamageZone *owner);
virtual ~MechCriticalSubsystem();
SlotOf<Subsystem*>
subsystemPlug;
Scalar
damagePercentage, damagePercentageUsed;
Scalar
criticalWeight;
Logical
TestInstance() const;
};
//##########################################################################
//#################### Mech::DamageZone ###########################
//##########################################################################
class Mech__DamageZone :
public DamageZone
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// LOD Support
//
protected:
void
LODDamageRouter(EntityID inflicting, Damage damage);
int
RandomRedirect();
typedef PlugOf<int> IntegerPlug;
typedef TableOf<IntegerPlug*, int> DamageZoneIndexTable;
typedef TableIteratorOf<IntegerPlug*, int> DamageZoneIndexTableIterator;
// Zones which are artifacts have a table of their real children.
DamageZoneIndexTable redirectTable;
// The result of the last random redirect
int lastHitZone;
Scalar lastDamageTime;
EntityID lastInflicting;
//
// Zones which are real have a pointer (slot) back to their artifact parent.
// With the current art (1/30/96) no zone has both a parent and children,
// and many zones have neither.
SlotOf<Mech__DamageZone*> parentArtifactZone;
void
UpdateLODDamageLevel();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Descending Heirarchy when DamageZone Destroyed Support
//
void
ShortAttachedGenerators();
void
SendSubsystemDamage();
void
RecurseSegmentTable(Mech *my_mech);
int
segmentIndex;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Damage Support
//
public:
void
TakeDamage(Damage& damage);
Subsystem*
CriticalHit(Damage &damage_data);
protected:
Logical
vitalDamageZone;
Logical
descendOnDestruction;
Logical
destroySiblingsOnDestruction;
Logical
leftLeg;
Logical
rightLeg;
int
criticalSubsystemCount;
Scalar
criticalWeightSum;
MechCriticalSubsystem
**criticalSubsystems;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Graphic State Support
//
public:
void
SetGraphicState(Enumeration new_state);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction / Destruction
//
public:
static const int NullDamageZone;
Mech__DamageZone(
Mech *mech,
int damage_zone_index,
MemoryStream *stream
);
void SetLODParentPointers();
~Mech__DamageZone();
static Logical
CreateStreamedDamageZone(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
NotationFile *skl_file,
const char *damage_zone_name,
NotationFile *dmg_file,
const ResourceDirectories *directories,
MemoryStream *damage_zone_stream
);
static int
GetSegmentIndex(
CString damage_zone_name,
NotationFile *skl_file
);
};
#endif
+149
View File
@@ -0,0 +1,149 @@
#if !defined(MECHTECH_HPP)
# define MECHTECH_HPP
# if !defined(MECHSUB_HPP)
# include <mechsub.hpp>
# endif
//##########################################################################
//###################### MechTech::StatusInfo ########################
//##########################################################################
struct MechTech__StatusInfo SIGNATURED
{
public:
int
currentStatus,
wooHooed;
Time
startTime,
wooHooEnd;
};
//##########################################################################
//###############3### MechTech::SubsystemMonitor #####################
//##########################################################################
struct MechTech__SubsystemMonitor:
public Plug
{
friend class MechTech;
//##########################################################################
// Memory Allocation Support
//
private:
static MemoryBlock AllocatedMemory;
void*
operator new(size_t)
{return AllocatedMemory.New();}
void
operator delete(void *where)
{AllocatedMemory.Delete(where);}
public:
MechTech__StatusInfo statusArray[MechSubsystem::TechStatusTypeCount];
MechSubsystem *monitoredSubsystem;
MechTech__SubsystemMonitor(MechSubsystem *subsystem);
~MechTech__SubsystemMonitor();
};
//##########################################################################
//##################### MechTech::ModelResource ######################
//##########################################################################
struct MechTech__SubsystemResource:
public Subsystem::SubsystemResource
{
ResourceDescription::ResourceID
alarmModel;
Scalar
wooHooMinimumDuration,
wooHooDurationRange,
wooHooChance;
};
//##########################################################################
//############################ MechTech ##############################
//##########################################################################
class MechTech:
public Subsystem
{
//##########################################################################
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//##########################################################################
// Attribute Support
//
public:
typedef MechTech__StatusInfo StatusInfo;
typedef MechTech__SubsystemMonitor SubsystemMonitor;
typedef MechTech__SubsystemResource SubsystemResource;
//##########################################################################
// Construction and Destruction Support
//
public:
~MechTech();
static Logical
CreateStreamedSubsystem(
NotationFile *model_file,
const char* model_name,
const char* subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
ResourceFile *resource_file
);
MechTech(
Mech *entity,
int subsystem_id,
SubsystemResource *model,
SharedData &shared_data = DefaultData
);
Logical
TestInstance() const;
//##########################################################################
// Model support
//
public:
typedef void
(MechTech::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
ChainOf<SubsystemMonitor*> subsystemMonitors;
Scalar
wooHooMinimumDuration,
wooHooDurationRange,
wooHooChance;
ResourceDescription::ResourceID
alarmModel;
void
TechnicalAssistance(Scalar time_slice);
Mech*
GetEntity()
{return (Mech*)Subsystem::GetEntity();}
};
#endif
+184
View File
@@ -0,0 +1,184 @@
//===========================================================================//
// File: messmgr.hh //
// Project: BattleTech //
// Contents: Consolidates Messages from Subsystems and Graphics Generation //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 09/30/95 JM Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined (MESSMGR_HPP)
# define MESSMGR_HPP
#if !defined (SUBSYSTM_HPP)
# include <subsystm.hpp>
#endif
#if !defined (RESOURCE_HPP)
# include <resource.hpp>
#endif
#if !defined (VCHAIN_HPP)
# include <vchain.hpp>
#endif
#if !defined (PLUG_HPP)
# include <plug.hpp>
#endif
#if !defined(ENTITYID_HPP)
# include <entityid.hpp>
#endif
class Entity;
class Mech;
class Entity__TakeDamageMessage;
//##########################################################################
//########## SubsystemMessageManager::SubsystemResource ###############
//##########################################################################
struct SubsystemMessageManager__SubsystemResource :
public Subsystem::SubsystemResource
{
ResourceDescription::ResourceID
terrainHitExplosionID;
Scalar
rendererCompensateTime;
};
//##########################################################################
//##################### SubsystemMessageManager ###################
//##########################################################################
class
SubsystemMessageManager :
public Subsystem
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Death and Damage Support
//
public:
void DeathReset(Logical) {}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
protected:
struct CommonDamageInformation
{
Entity
*entityHit;
int
damageZoneIndex;
Point3D
impactPoint;
} commonDamageInformation;
public:
struct DamageInformation
: public Plug
{
Enumeration
damageType;
int
subsystemID;
};
typedef void
(SubsystemMessageManager::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
void
ConsolidateAndSendDamage(Scalar time_slice);
Mech*
GetEntity()
{Check(this); return Cast_Object(Mech*, Subsystem::GetEntity());}
protected:
Scalar
rendererCompensateTime;
typedef PlugOf<ResourceDescription::ResourceID>
ResourceIDPlug;
VChainOf<ResourceIDPlug*, ResourceDescription::ResourceID>
weaponExplosions;
VChainOf<DamageInformation*, Scalar> damageInformation;
ResourceDescription::ResourceID
terrainHitExplosionID;
void
CreateWeaponExplosions(
Logical terrain_hit,
EntityID entity_hit,
Point3D explode_position
);
public:
void
AddDamageMessage(
Entity *damaged_entity,
Entity__TakeDamageMessage *message
);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction Support
//
public:
typedef SubsystemMessageManager__SubsystemResource SubsystemResource;
SubsystemMessageManager(
Mech *owner,
int subsystem_ID,
SubsystemResource *sub_res,
SharedData &shared_data=DefaultData
);
~SubsystemMessageManager();
Logical
TestInstance() const;
static Logical
CreateStreamedSubsystem(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories
);
};
#endif
+120
View File
@@ -0,0 +1,120 @@
//============================================================================//
// File: mislanch.hh //
// Project: BattleTech //
// Contents: Weapon Which Lanches a missile //
// Derived From Projectile Weapon //
//----------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ------------------------------------------------------------//
// 04/13/95 JM Initial coding. //
//----------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//============================================================================//
#if !defined (MISLANCH_HPP)
# define MISLANCH_HPP
# if !defined(PROJWEAP_HPP)
# include <projweap.hpp>
# endif
class Missile;
//################# MissileLauncher SubsystemResource ###################
struct MissileLauncher__SubsystemResource:
public ProjectileWeapon::SubsystemResource
{
int missileCount;
Vector3D
muzzleVelocity;
};
//###########################################################################
//################# CLASS -- MissileLauncher ##########################
//###########################################################################
class MissileLauncher:
public ProjectileWeapon
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Messaging Support
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Damage Support
//
public:
void TakeDamage(Damage &damage);
void DeathReset(Logical full_reset);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
public:
typedef void
(MissileLauncher::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
typedef MissileLauncher__SubsystemResource SubsystemResource;
MissileLauncher(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &default_data = DefaultData
);
~MissileLauncher();
Logical
TestInstance() const;
static Logical
CreateStreamedSubsystem(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
int passes =1
);
// local stuff
protected:
void
FireWeapon();
int missileCount; // how many individual missiles get fired at once
};
#endif
+44
View File
@@ -0,0 +1,44 @@
#include "testbt.hpp"
#include "projweap.hpp"
//#############################################################################
// Missile Test Class
//
Logical Missile::TestClass(Mech &mech)
{
ProjectileWeapon *gun;
Missile *missile;
MissileThruster *thruster;
Seeker *seeker;
Scalar time_slice =0.5f;
gun = (ProjectileWeapon*) mech.GetSubsystem(ProjectileWeaponSubsystemID);
gun->triggerState = 1;
MemoryStream stream(NULL, 0);
gun->ProjectileWeaponSimulation(time_slice, stream);
gun->triggerState = -1;
missile = (Missile*) gun->currentProjectile; // BAD!!!
Check(missile);
thruster = (MissileThruster*) missile->GetSubsystem(Missile::MissileThrusterSubsystem);
seeker = (Seeker*) missile->GetSubsystem(Missile::SeekerSubsystem);
Check(thruster);
Check(seeker);
seeker->FindTarget(time_slice, stream);
thruster->MissileThrusterSimulation(time_slice, stream);
missile->MoveAndCollide(time_slice, stream);
time_slice = 5.0f;
gun->ProjectileWeaponSimulation(time_slice, stream);
seeker->FindTarget(time_slice, stream);
thruster->MissileThrusterSimulation(time_slice, stream);
missile->MoveAndCollide(time_slice, stream);
return True;
}
+141
View File
@@ -0,0 +1,141 @@
//============================================================================//
// File: misthrst.hh //
// Project: BattleTech //
// Contents: Missile Thruster provides power to move the missile //
//----------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ------------------------------------------------------------//
// 04/13/95 JM Initial coding. //
//----------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//============================================================================//
#if !defined (MISTHRST_HPP)
#define MISTHRST_HPP
#if !defined(SUBSYSTM_HPP)
#include <subsystm.hpp>
#endif
#if !defined(ANGLE_HPP)
#include <angle.hpp>
#endif
#if !defined(MOTION_HPP)
#include <motion.hpp>
#endif
//################### Froward Class Declarations ######################
class Missile;
//################### MissileThruster SubsystemResource #################
struct MissileThruster__SubsystemResource:
public Subsystem::SubsystemResource
{
Scalar burnTime;
Degree maxThrusterRotationRate;
Scalar thrusterAcceleration;
Scalar thrusterClimb;
};
//###########################################################################
//######################### CLASS -- MissileThruster ##################
//###########################################################################
class MissileThruster :
public Subsystem
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support
//
public:
enum {
BurnTimeRemainingAttributeID = Subsystem::NextAttributeID,
MaxThrusterRotationRateAttributeID,
ThrusterAccelerationAttributeID,
NextAttributeID
};
public:
static const IndexEntry AttributePointers[];
protected:
static AttributeIndexSet AttributeIndex;
//
// public attribute declarations go here
//
public:
Scalar burnTimeRemaining;
Radian maxThrusterRotationRate;
const Scalar thrusterAcceleration;
const Scalar thrusterClimb;
Motion acceleration;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
public:
enum {
ThrusterBurning= Subsystem::StateCount,
StateCount
};
typedef void
(MissileThruster::*Performance)(Scalar time_slice);
void
MissileThrusterSimulation(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// TestClass Support
//
public:
static Logical
TestClass(Missile &);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
typedef MissileThruster__SubsystemResource SubsystemResource;
MissileThruster(
Missile *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource
);
~MissileThruster();
Logical
TestInstance() const;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Local Support
//
};
#endif
+5
View File
@@ -0,0 +1,5 @@
SCC = This is a Source Code Control file
[bt.mak]
SCC_Aux_Path = "\\AVATAR\Mungass\VSS"
SCC_Project_Name = "$/Tesla_BT/BT", YOCAAAAA
+166
View File
@@ -0,0 +1,166 @@
//===========================================================================//
// File: ppc.cc //
// Project: BattleTech //
// Contents: Particle Projection Cannon //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/13/95 JM Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined (PPC_HPP)
# include <ppc.hpp>
#endif
#if !defined(BTPLAYER_HPP)
# include <btplayer.hpp>
#endif
#if !defined(BTMSSN_HPP)
# include <btmssn.hpp>
#endif
//#############################################################################
// Shared Data Support
//
PPC::SharedData
PPC::DefaultData(
PPC::ClassDerivations,
PPC::MessageHandlers,
PPC::AttributeIndex,
PPC::StateCount
);
Derivation
PPC::ClassDerivations(
Emitter::ClassDerivations,
"PPC"
);
//#############################################################################
// Model Data Support
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
PPC::FireWeapon()
{
Check(this);
Emitter::FireWeapon();
return;
#if 0
Check(this);
Mech *mech = GetEntity();
Check(mech);
BTPlayer *bt_player = Cast_Object(
BTPlayer*,
mech->GetPlayerLink()
);
Check(bt_player);
Enumeration experienceLevel = bt_player->GetExperienceLevel();
if (experienceLevel == BTMission::NoviceMode)
{
return;
}
if (targetWithinRange)
{
Damage energy_damage(damageData);
energy_damage.damageType = Damage::EnergyDamageType;
energy_damage.damageAmount = 0.0f;
Mech *mech = GetEntity();
Check(mech);
SendDamage(
mech->targetReticle.targetEntity,
energy_damage
);
}
#endif
}
//#############################################################################
// Constructer/Destructor Support
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
PPC::PPC(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data
):
Emitter(owner, subsystem_ID, subsystem_resource, shared_data)
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
PPC::~PPC()
{
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Create Streamed Subsystem
//
Logical
PPC::CreateStreamedSubsystem(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
int passes
)
{
if (
!Emitter::CreateStreamedSubsystem(
resource_file,
model_file,
model_name,
subsystem_name,
subsystem_resource,
subsystem_file,
directories,
passes
)
)
{
return False;
}
subsystem_resource->subsystemModelSize = sizeof(*subsystem_resource);
subsystem_resource->classID = RegisteredClass::PPCClassID;
return True;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
Logical
PPC::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
+67
View File
@@ -0,0 +1,67 @@
//===========================================================================//
// File: ppc.hh //
// Project: BattleTech //
// Contents: Particle Projection Cannon //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/13/95 JM Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined (PPC_HPP)
# define PPC_HPP
#if !defined(EMITTER_HPP)
#include <emitter.hpp>
#endif
class PPC :
public Emitter
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
PPC(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data
);
~PPC();
Logical
TestInstance() const;
static int
CreateStreamedSubsystem(
ResourceFile *resource_file,
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
int passes = 1
);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Local Data
//
protected:
void
FireWeapon();
};
#endif
+12
View File
@@ -0,0 +1,12 @@
#include "testbt.hpp"
//#############################################################################
// Projectile Test Class
//
Logical Projectile::TestClass()
{
return True;
}
+20
View File
@@ -0,0 +1,20 @@
#include "projweap.hpp"
#include "testbt.hpp"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ProjectileWeapon Test Class
//
Logical ProjectileWeapon::TestClass(Mech &)
{
return True;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Reset To InitialState
//
void ProjectileWeapon::ResetToInitialState()
{
}
+134
View File
@@ -0,0 +1,134 @@
//=========================================================================//
// File: seeker.hpp //
// Project: BattleTech //
// Contents: A subsystem which guides, seek out and find a target //
//----------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ------------------------------------------------------------//
// 04/13/95 JM Initial coding. //
// 07/12/95 GDU Complied with new libraries, added seeker logic //
//----------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//============================================================================//
#if !defined (SEEKER_HPP)
#define SEEKER_HPP
#if !defined(SUBSYSTM_HPP)
#include <subsystm.hpp>
#endif
#if !defined(POINT3D_HPP)
#include <point3d.hpp>
#endif
//######################### Forward Class Declarations ########################
class Missile;
class Entity;
//######################### Seeker Subsystem Resource ##########################
struct Seeker__SubsystemResource:
public Subsystem::SubsystemResource
{
};
//###########################################################################
//######################### CLASS -- Seeker ##########################
//###########################################################################
class Seeker : public Subsystem
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Messaging Support
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support
//
public:
enum {
TargetPositionAttributeID = Subsystem::NextAttributeID,
RangeToTargetAttributeID,
RangeFromCreationAttributeID,
NextAttributeID
};
private:
static const IndexEntry AttributePointers[];
protected:
static AttributeIndexSet AttributeIndex;
//
// public attribute declarations go here
//
public:
Point3D targetPosition; // for thruster
const Point3D creationPoint; // where the missile was fired from
Entity *targetEntity;
const Point3D targetOffset;
Scalar rangeToTarget, rangeFromCreation, startingRangeToTarget;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
public:
enum {
Empty = Subsystem::StateCount,
StateCount};
typedef void
(Seeker::*Performance)(Scalar time_slice);
void
LeadTarget();
void
FindTarget(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// TestClass Support
//
public:
static Logical
TestClass(Missile &);
void
ResetToInitialState();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
typedef Seeker__SubsystemResource SubsystemResource;
Seeker (
Missile *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
Entity *target,
const Point3D offset
);
~Seeker();
Logical
TestInstance() const;
};
#endif
+143
View File
@@ -0,0 +1,143 @@
//===========================================================================//
// File: sensor.hpp //
// Project: BattleTech //
// Contents: Sensor subsystem //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 8/10/95 GDU Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined(SENSOR_HPP)
# define SENSOR_HPP
#if !defined(POWERSUB_HPP)
#include "powersub.hpp"
#endif
//##########################################################################
//################# SensorSubsystemResource #######################
//##########################################################################
struct Sensor__SubsystemResource:
public PoweredSubsystem::SubsystemResource
{
};
//##########################################################################
//########################## Sensor ###############################
//##########################################################################
class Sensor:
public PoweredSubsystem
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Death and Damage Support
//
public:
void
TakeDamage(Damage &damage);
void
DeathReset(Logical full_recovery);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support
//
public:
enum {
RadarPercentAttributeID = PoweredSubsystem::NextAttributeID,
SelfTestAttributeID,
BadVoltageAttributeID,
NextAttributeID
};
private:
static const IndexEntry AttributePointers[];
protected:
static AttributeIndexSet AttributeIndex;
public:
Scalar
radarPercent;
Logical
selfTest,
badVoltage;
//##########################################################################
// Simulation Support
//
public:
typedef void
(Sensor::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
void
SensorSimulation(Scalar time_slice);
//##########################################################################
// Test Class Support
//
public:
static Logical
TestClass(Mech&);
void
ResetToInitialState();
//##########################################################################
// Construction and Destruction
//
public:
typedef Sensor__SubsystemResource SubsystemResource;
Sensor(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource
);
~Sensor();
Logical
TestInstance() const;
static int
CreateStreamedSubsystem(
NotationFile *model_file,
const char *model_name,
const char *subsystem_name,
SubsystemResource *subsystem_resource,
NotationFile *subsystem_file,
const ResourceDirectories *directories,
int passes = 1
);
};
#endif
+68
View File
@@ -0,0 +1,68 @@
#if !defined(TESTBT_HPP)
# define TESTBT_HPP
# if !defined(APP_HPP)
# include <app.hpp>
# endif
# if !defined(APP_THP)
# include <app.thp>
# endif
# if !defined(MISSION_HPP)
# include <mission.hpp>
# endif
#define TEST_DEBUG
//##########################################################################
//###################### TestBTApplication ##########################
//##########################################################################
class TestBTApplication:
public TestApplication
{
public:
TestBTApplication(StreamableResourceFile *resource);
~TestBTApplication();
static Logical
ParseCommandLine(
int argc,
char *argv[],
CString *egg_notation_file_name
);
private:
Registry*
MakeRegistry();
Entity*
MakeViewpointEntity(Entity::MakeMessage *message);
};
//##########################################################################
//########################### TestBTMission ##########################
//##########################################################################
class TestBTMission:
public Mission
{
public:
TestBTMission(
NotationFile *notation_file,
StreamableResourceFile *resources
);
~TestBTMission();
Logical
TestInstance() const;
void
CreatePlayerMessage(
NotationFile *notation_file,
StreamableResourceFile *resources
);
};
#endif
+148
View File
@@ -0,0 +1,148 @@
//===========================================================================//
// File: jmover.hh //
// Project: MUNGA Brick: Model Manager //
// Contents: Interface specification for moving entity class //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/21/95 JMA Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(TURRET_HPP)
# define TURRET_HPP
# if !defined(JMOVER_HPP)
# include <jmover.hpp>
# endif
//##########################################################################
//################## Turret::ModelResource ###########################
//##########################################################################
struct Turret__ModelResource:
JointedMover::ModelResource
{
char turretJointName[32];
char gunJointName[32];
ResourceDescription::ResourceID
explosionResourceID;
Scalar
rotationSpeedMin,
rotationSpeedMax,
elevationSpeedMin,
elevationSpeedMax,
rateSkillMin,
rateSkillMax,
rateAdjMin,
rateAdjMax,
accuracySkillMin,
accuracySkillMax,
accuracyAdjMin,
accuracyAdjMax;
};
#if 0
//##########################################################################
//################## Turret::ModelResource ###########################
//##########################################################################
class Turret__MakeMessage:
JointedMover::MakeMessage
{
public:
char teamName[32];
char roleName[32];
};
#endif
//##########################################################################
//######################### Turret ###################################
//##########################################################################
class Turret:
public JointedMover
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
#if 0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Message Support
//
private:
static const HandlerEntry MessageHandlerEntries[];
protected:
static MessageHandlerSet MessageHandlers;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support
//
public:
enum{
NextAttributeID
};
private:
static const IndexEntry AttributePointers[];
protected:
static AttributeIndexSet AttributeIndex;
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
public:
typedef Turret__ModelResource ModelResource;
typedef void
(Turret::*Performance)(Scalar time_slice);
void
SetPerformance(Performance performance)
{
Check(this);
activePerformance = (Simulation::Performance)performance;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
public:
static Logical
CreateMakeMessage(
MemoryStream &creation_stream,
NotationFile *model_file,
const ResourceDirectories *directories
);
static ResourceDescription::ResourceID
CreateModelResource(
ResourceFile *resource_file,
const char* model_name,
NotationFile *model_file,
const ResourceDirectories *directories,
ModelResource* model = NULL
);
static Turret*
Make(MakeMessage *creation_message);
Turret(
MakeMessage *creation_message,
SharedData &virtual_data
);
~Turret();
Logical
TestInstance() const;
};
#endif
Binary file not shown.
+211
View File
@@ -0,0 +1,211 @@
[release]
version=1.0
//
// Official resource maps and models should have an
// id assigned to them, as should any object that could show up on a mission
// review spool (even a test one).
//
// the format is xxxxx=xxxx.xxx /id:#
//
// The next number to use is: 149
//
[resource]
name=btl4.res
dircollision=solids\
dirmodel=models\
dirmap=maps\
diraudio=audio\
dirvideo=video\
dirgauge=gauge\
diranimation=anims\
//
// Player Model File
//
model=player.mod /id:75
//
// Explosion Model Files
//
model=lzrhiti.mod /id:1
model=ppchiti.mod /id:2
model=canhiti.mod /id:3
model=mslhiti.mod /id:4
model=dam3exp.mod /id:5
model=dam4exp.mod /id:6
model=dam4expi.mod /id:7
model=dam1hiti.mod /id:8
model=dam2hiti.mod /id:9
model=dam3hiti.mod /id:10
model=dam4hiti.mod /id:11
model=desthiti.mod /id:12
static=explode.onl
model=explode.mod /id:13
//model=mghit.mod /id:14
model=ppchit.mod /id:15
model=lzrhit.mod /id:16
model=mslhit.mod /id:17
model=canhit.mod /id:18
model=gndhit.mod /id:19
model=minhit.mod /id:20
model=majhit.mod /id:21
model=blhdead.mod /id:22
model=lokdead.mod /id:23
model=maddead.mod /id:76
model=owndead.mod /id:24
model=thrdead.mod /id:25
model=vuldead.mod /id:77
model=avadead.mod /id:113
model=mechdead.mod /id:74
model=dam1hit.mod /id:26
model=dam2hit.mod /id:27
model=dam3hit.mod /id:28
model=dam4hit.mod /id:29
model=desthit.mod /id:30
model=stephit.mod /id:31
model=trkdead.mod /id:32
model=smldead.mod /id:78
model=meddead.mod /id:34
model=bigdead.mod /id:33
model=msldead.mod /id:79
model=twrdead.mod /id:80
//
// Ballistic Ammo
//
model=projtile.mod /id:35
model=srm.mod /id:36
model=lrm.mod /id:37
//
// Scenario Role Model Files
//
//model=convoy.mod /id:38
model=dfltrole.mod /id:39
//model=attacker.mod /id:40
//model=defender.mod /id:41
//model=decoy.mod /id:42
//model=hostage.mod /id:43
//model=ambssdor.mod /id:44
model=NoReturn.mod /id:112
//
// Mech Model Files
//
model=mechalrm.mod /id:83
//
model=madcat.mod /id:72
model=mad1.mod /id:118
model=loki.mod /id:45
model=lok1.mod /id:119
model=thor.mod /id:46
model=thr1.mod /id:115
model=blkhawk.mod /id:47
model=bhk1.mod /id:116
model=owens.mod /id:48
model=vulture.mod /id:73
model=vul1.mod /id:117
model=avatar.mod /id:110
model=ava1.mod /id:114
model=sunder.mod /id:111
//model=firstrtr.mod
//model=blkjack.mod
//model=raptor.mod
//model=wpnmech.mod
//model=strider.mod
//
// Camera Model File
//
model=camera.mod /id:49
//
// Cultural Icons (stuff what can blow up)
//
model=tt1.mod /id:50
model=tt2.mod /id:51
model=snh.mod /id:52
model=trk1.mod /id:53
model=trk3.mod /id:54
model=trk4.mod /id:55
model=bpip1.mod /id:56
model=bac1.mod /id:57
model=awwlk1.mod /id:58
model=adwlk1.mod /id:59
model=adwlk2.mod /id:60
model=adwlk3.mod /id:61
model=arban1.mod /id:62
model=arban2.mod /id:63
model=arban3.mod /id:64
model=arban4.mod /id:65
model=arban5.mod /id:66
model=arban6.mod /id:67
model=bwlk1.mod /id:68
model=bdet4.mod /id:69
model=hn1.mod /id:85
model=pdsh.mod /id:86
model=sl2.mod /id:87
model=twr.mod /id:88
model=plit.mod /id:89
model=gnr.mod /id:90
model=tnt.mod /id:91
model=bnk.mod /id:92
model=msl.mod /id:93
model=crt.mod /id:94
model=hut.mod /id:95
model=ft1.mod /id:96
model=ft2.mod /id:97
model=wst.mod /id:98
model=mslg.mod /id:99
model=fp0.mod /id:100
model=fp1.mod /id:101
model=fp2.mod /id:102
model=fp3.mod /id:103
model=hc1.mod /id:104
model=hc2.mod /id:105
model=hwz.mod /id:106
//model=jax1.mod /id:107
//model=jax2.mod /id:108
model=ab07.mod /id:109
model=apc.mod /id:141
model=armrmovr.mod /id:142
model=bulldog.mod /id:143
model=comtruck.mod /id:123
model=coolant.mod /id:124
model=dozer.mod /id:125
model=harasser.mod /id:126
model=hummer.mod /id:127
model=lrmcarry.mod /id:128
model=mechmovr.mod /id:129
model=rommel.mod /id:130
model=semi.mod /id:131
model=semirig.mod /id:132
model=srmcarry.mod /id:133
model=striker.mod /id:134
model=swiftwnd.mod /id:135
model=bld03.mod /id:136
model=bld04.mod /id:137
model=bld20.mod /id:138
model=bld24.mod /id:139
model=bld26.mod /id:140
model=tree.mod /id:144
model=calp.mod /id:146
model=calpb.mod /id:147
model=dish.mod /id:148
//
// Maps
//
map=arena1.map /id:70
map=arena2.map /id:84
//map=polar1.map /id:71
//map=polar2.map
map=polar3.map /id:81
map=polar4.map /id:82
map=rav.map /id:120
map=grass.map /id:121
map=dbase.map /id:122
//map=test.map /id:145
zone=all.zne
[zones]
zone=all.zne
+26
View File
@@ -0,0 +1,26 @@
!ifndef BC_ROOT
!error BC_ROOT macro is not defined
!endif
!ifndef MUNGA_ROOT
!error MUNGA_ROOT macro is not defined
!endif
!ifndef DPL_ROOT
!error DPL_ROOT macro is not defined
!endif
!ifndef SOS_ROOT
!error SOS_ROOT macro is not defined
!endif
!ifndef NETNUB_ROOT
!error NETNUB_ROOT macro is not defined
!endif
!ifndef BT_ROOT
!error BT_ROOT macro is not defined
!endif
INCLUDE_PATH = $(BTL4_ROOT);$(BT_ROOT);$(MUNGAL4_ROOT);$(DPL_ROOT);$(DPL_ROOT)\dvs;$(DPL_ROOT)\dpl;$(SOS_ROOT)\bc4;$(NETNUB_ROOT);$(MUNGA_ROOT);$(BC_ROOT)\include
LIBRARY_PATH = $(BTL4_ROOT)\$(BTYPE);$(BT_ROOT)\$(BTYPE);$(MUNGAL4_ROOT)\$(BTYPE);$(DPL_ROOT);$(MUNGA_ROOT)\$(BTYPE);$(BC_ROOT)\lib
+12
View File
@@ -0,0 +1,12 @@
#if !defined(BTL4_HPP)
# define BTL4_HPP
# if !defined(BT_HPP)
# include <bt.hpp>
# endif
# if !defined(MUNGAL4_HPP)
# include <mungal4.hpp>
# endif
#endif
+153
View File
@@ -0,0 +1,153 @@
.autodepend
.cacheautodepend
.suffixes: .cpp
!ifndef BTYPE
!error BTYPE macro not supplied
!endif
!ifndef BPATH
!error BPATH macro not supplied
!endif
!include make.cfg
!include $(BPATH)
TARGET_DIR = $(BTL4_ROOT)\$(BTYPE)
TARGET_PATH = $(TARGET_DIR)\\
.path.obj = $(TARGET_DIR)
.path.lib = $(LIBRARY_PATH)
LIB_PREFIX = -+$(TARGET_DIR)\\
CFG_FILE = $(TARGET_DIR)\$(BTYPE).cfg
HEADER_FILE = btl4$(BTYPE).csm
#------------------------------------------------------------------------------
# Library targets
#
all:\
$(CFG_FILE) $(TARGET_DIR)\btl4$(BTYPE).exe $(TARGET_DIR)\btl4tool.exe\
$(TARGET_DIR)\mechbld.exe
clean:
del $(TARGET_DIR)\*.obj
del $(TARGET_DIR)\*.lib
del $(TARGET_DIR)\*.exe
del $(TARGET_DIR)\*.bak
del $(TARGET_DIR)\*.cfg
assemble:
@echo No assembly targets
#------------------------------------------------------------------------------
# Implicit rules
#
!include $(BTYPE).mak
!ifndef STARTUP_OBJ
!error STARTUP_OBJ macro is not defined
!endif
!ifndef STARTUP_LIBS
!error STARTUP_LIBS macro is not defined
!endif
{$(INCLUDE_PATH)}.cpp{$(TARGET_DIR)}.obj:
$(BCC) @$(CFG_FILE) $< >>error.log
{$(INCLUDE_PATH)}.c{$(TARGET_DIR)}.obj:
$(BCC) @$(CFG_FILE) $< >>error.log
{$(BTL4_ROOT)}.asm{$(TARGET_DIR)}.obj:
tasm32 -ml $(TASM_OPTIONS) -i$(BTL4_ROOT) $<,$@ >>error.log
#------------------------------------------------------------------------------
# Game
#
$(TARGET_DIR)\btl4$(BTYPE).exe: \
$(BTL4_ROOT)\btl4.mak l4stub.lib stub.lib $(TARGET_DIR)\btl4.lib\
bt.lib mungal4.lib munga.lib btl4.obj $(BTYPE).mak\
$(DPL_ROOT)\libdpl.lib
tlink32 @&&|
$(LINK_OPTIONS) +
$(STARTUP_OBJ)+
$(TARGET_DIR)\btl4.obj
$<,$*
l4stub.lib+
stub.lib+
munga.lib+
mungal4.lib+
$(DPL_ROOT)\libdpl.lib+
bt.lib+
$(TARGET_DIR)\btl4.lib+
$(STARTUP_LIBS)
| >>error.log
btl4.obj: $(CFG_FILE)
#------------------------------------------------------------------------------
# Tools
#
$(TARGET_DIR)\btl4tool.exe: \
$(BTL4_ROOT)\btl4.mak l4stub.lib stub.lib $(TARGET_DIR)\btl4.lib\
bt.lib mungal4.lib munga.lib btl4tool.obj $(BTYPE).mak\
$(DPL_ROOT)\libdpl.lib
tlink32 @&&|
$(LINK_OPTIONS) +
$(STARTUP_OBJ)+
$(TARGET_DIR)\btl4tool.obj
$<,$*
l4stub.lib+
stub.lib+
munga.lib+
mungal4.lib+
$(DPL_ROOT)\libdpl.lib+
bt.lib+
$(TARGET_DIR)\btl4.lib+
$(STARTUP_LIBS)
| >>error.log
btl4tool.obj: $(CFG_FILE)
#------------------------------------------------------------------------------
# Mech builder
#
$(TARGET_DIR)\mechbld.exe:\
$(BTL4_ROOT)\btl4.mak mechbld.obj stub.lib munga.lib $(BTYPE).mak
tlink32 @&&|
$(LINK_OPTIONS) +
$(STARTUP_OBJ)+
$(TARGET_DIR)\mechbld.obj
$<,$*
stub.lib+
munga.lib+
$(STARTUP_LIBS)
| >>error.log
mechbld.obj: $(BCC_CONFIG) $(BTYPE).mak
#------------------------------------------------------------------------------
# Battletech library
#
BTL4_OBJS = \
?btl4mode.obj \
?btl4rdr.obj \
?btl4gaug.obj \
?btl4gau2.obj \
?btl4gau3.obj \
?btl4grnd.obj \
?btl4galm.obj \
?btl4vid.obj \
?btl4mppr.obj \
?btl4arnd.obj \
?btl4mssn.obj \
?btl4app.obj \
?btl4pb.obj
$(BTL4_OBJS:?=): $(CFG_FILE)
$(TARGET_DIR)\btl4.lib: $(BTL4_OBJS:?=) $(BTL4_ROOT)\btl4.mak
tlib $@ $(LIB_OPTIONS) @&&|
$(BTL4_OBJS:?=$(LIB_PREFIX))
| >>error.log
+88
View File
@@ -0,0 +1,88 @@
//===========================================================================//
// File: rp4lbe4.hh //
// Project: MUNGA Brick: Red Planet LBE Application //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4APP_HPP)
# define BTL4APP_HPP
# if !defined(BTL4MPPR_HPP)
# include <btl4mppr.hpp>
# endif
//##########################################################################
//###################### BTL4Application ##########################
//##########################################################################
//##########################################################################
//###################### RP4L4Application ############################
//##########################################################################
class BTL4Application:
public L4Application
{
public:
BTL4Application(
ResourceFile *resource_file,
ClassID class_ID=L4ApplicationClassID,
SharedData &shared_data=DefaultData
);
~BTL4Application();
static Derivation ClassDerivations;
static SharedData DefaultData;
private:
Registry*
MakeRegistry();
VideoRenderer*
MakeVideoRenderer();
AudioRenderer*
MakeAudioRenderer();
GaugeRenderer*
MakeGaugeRenderer();
ModeManager*
MakeModeManager();
ControlsManager*
MakeControlsManager();
Mission*
MakeMission(
NotationFile *notation_file,
ResourceFile *resources
);
Entity*
MakeViewpointEntity(Entity::MakeMessage *);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Message Support
//
private:
static const HandlerEntry MessageHandlerEntries[];
protected:
static MessageHandlerSet MessageHandlers;
void
RunMissionMessageHandler(RunMissionMessage *message);
void
StopMissionMessageHandler(StopMissionMessage *message);
};
#endif
+185
View File
@@ -0,0 +1,185 @@
//===========================================================================//
// File: btl4arnd.cc //
// Project: MUNGA Brick: Audio Renderer Manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/30/95 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <btl4.hpp>
#pragma hdrstop
#if !defined(BTL4ARND_HPP)
# include <btl4arnd.hpp>
#endif
#if !defined(JMOVER_HPP)
# include <jmover.hpp>
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BTL4AudioHead ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
//#############################################################################
//
BTL4AudioHead::BTL4AudioHead():
earToWorld(LinearMatrix::Identity)
{
useEyepointSegment = False;
eyepointSegment = NULL;
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
BTL4AudioHead::~BTL4AudioHead()
{
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
void
BTL4AudioHead::LinkToEntity(Entity *entity)
{
Check(this);
Check(entity);
//
// Call inherited method
//
AudioHead::LinkToEntity(entity);
#if 0
//
// Find segment containing eyepoint
//
JointedMover *jointed_mover;
jointed_mover = Cast_Object(JointedMover*, entity);
eyepointSegment = jointed_mover->GetSegment("siteeyepoint");
Check(eyepointSegment);
CalculateEarToWorld();
#else
useEyepointSegment = False;
if (entity->IsDerivedFrom(JointedMover::ClassDerivations))
{
//
// Find segment containing eyepoint
//
JointedMover *jointed_mover;
jointed_mover = Cast_Object(JointedMover*, entity);
if ((eyepointSegment = jointed_mover->GetSegment("siteeyepoint")) != NULL)
{
Check(eyepointSegment);
useEyepointSegment = True;
CalculateEarToWorld();
}
}
#endif
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
void
BTL4AudioHead::CalculateEarToWorld()
{
Check(this);
if (useEyepointSegment)
{
Verify(GetHeadEntity()->IsDerivedFrom(JointedMover::ClassDerivations));
JointedMover *jointed_mover = Cast_Object(JointedMover*, GetHeadEntity());
//
// Get the ear transform
//
jointed_mover->GetSegmentToWorld(*eyepointSegment, &earToWorld);
}
else
{
earToWorld = AudioHead::GetEarToWorld();
}
Check(&earToWorld);
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
void
BTL4AudioHead::Execute()
{
Check(this);
AudioHead::Execute();
CalculateEarToWorld();
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
LinearMatrix
BTL4AudioHead::GetEarToWorld()
{
Check(this);
Check_Fpu();
return earToWorld;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BTL4AudioRenderer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
//#############################################################################
//
BTL4AudioRenderer::BTL4AudioRenderer(
RendererRate render_rate,
Logical mission_review_mode
):
L4AudioRenderer(
render_rate,
mission_review_mode
)
{
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
BTL4AudioRenderer::~BTL4AudioRenderer()
{
Check_Fpu();
}
//
//#############################################################################
//#############################################################################
//
AudioHead*
BTL4AudioRenderer::MakeAudioHead()
{
Check_Fpu();
return new BTL4AudioHead;
}
+112
View File
@@ -0,0 +1,112 @@
//===========================================================================//
// File: btl4arnd.hh //
// Project: MUNGA Brick: Audio Renderer Manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/30/95 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4ARND_HPP)
# define BTL4ARND_HPP
# if !defined(L4AUDRND_HPP)
# include <l4audrnd.hpp>
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BTL4AudioHead ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Segment;
class BTL4AudioHead:
public AudioHead
{
public:
//
//--------------------------------------------------------------------
// Construction, Destruction, Testing
//--------------------------------------------------------------------
//
BTL4AudioHead();
~BTL4AudioHead();
//
//-----------------------------------------------------------------------
// LinkToEntity
//-----------------------------------------------------------------------
//
void
LinkToEntity(Entity *entity);
//
//-----------------------------------------------------------------------
// GetEarToWorld
//-----------------------------------------------------------------------
//
LinearMatrix
GetEarToWorld();
//
//-----------------------------------------------------------------------
// Execute
//-----------------------------------------------------------------------
//
void
Execute();
private:
//
//--------------------------------------------------------------------------
// Private methods
//--------------------------------------------------------------------------
//
void
CalculateEarToWorld();
//
//--------------------------------------------------------------------------
// Private Data
//--------------------------------------------------------------------------
//
Logical
useEyepointSegment;
EntitySegment*
eyepointSegment;
LinearMatrix
earToWorld;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BTL4AudioRenderer ~~~~~~~~~~~~~~~~~~~~~~~~~~~
class BTL4AudioRenderer:
public L4AudioRenderer
{
public:
//
//--------------------------------------------------------------------
// Construction, Destruction, Testing
//--------------------------------------------------------------------
//
BTL4AudioRenderer(
RendererRate render_rate,
Logical mission_review_mode
);
~BTL4AudioRenderer();
private:
//
//-----------------------------------------------------------------------
// MakeAudioHead
//-----------------------------------------------------------------------
//
AudioHead*
MakeAudioHead();
};
#endif
+44
View File
@@ -0,0 +1,44 @@
//===========================================================================//
// File: gaugalrm.hpp //
// Project: MUNGA Brick: Gauge Renderer Manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 02/22/96 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. All rights reserved //
// PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4GALM_HPP)
# define BTL4GALM_HPP
# if !defined(GAUGALRM_HPP)
# include "gaugalrm.hpp"
# endif
//#######################################################################
// BTL4GaugeAlarmManager
//#######################################################################
class BTL4GaugeAlarmManager :
public GaugeAlarmManager
{
public:
Logical
CreateGaugeAlarmStreamItem(
MemoryStream *mem_stream,
const char *alarm_name,
const char *alarm_data
);
void
ReadGaugeAlarmStreamItem(
GaugeAlarm *alarm,
Entity *the_entity,
Subsystem *the_subsystem,
Enumeration the_condition,
MemoryStream *mem_stream
);
};
#endif
+48
View File
@@ -0,0 +1,48 @@
//===========================================================================//
// File: rpl4grnd.hh //
// Project: MUNGA Brick: Gauge Renderer Manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 02/13/95 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. All rights reserved //
// PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4GRND_HPP)
# define BTL4GRND_HPP
# if !defined(L4GREND_HPP)
# include <l4grend.hpp>
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~ BTL4GaugeRenderer ~~~~~~~~~~~~~~~~~~~~~~~~~~
class BTL4GaugeRenderer:
public L4GaugeRenderer
{
public:
//
//--------------------------------------------------------------------
// Construction, Destruction, Testing
//--------------------------------------------------------------------
//
BTL4GaugeRenderer();
~BTL4GaugeRenderer();
Logical
TestInstance() const;
void
NotifyOfNewInterestingEntity(Entity *entity);
void
NotifyOfBecomingUninterestingEntity(Entity *entity);
};
#endif
+104
View File
@@ -0,0 +1,104 @@
//==========================================================================//
// File: BTMODE.CPP //
// Project: MUNGA Brick: Controls Manager //
// Contents: Interface specification for BT LBE4 Controls //
//--------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ----------------------------------------------------------//
// 02/13/96 CPB Built from CONTROLS.CPP //
//--------------------------------------------------------------------------//
// Copyright (C) 1994-1996, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//==========================================================================//
#include <btl4.hpp>
#pragma hdrstop
#if !defined(BTL4MODE_HPP)
# include <btl4mode.hpp>
#endif
#if defined(DEBUG)
# define Test_Tell(n) DEBUG_STREAM << n
#else
# define Test_Tell(n)
#endif
struct ModeLookup
{
const char *name;
ModeMask modeMask;
};
static ModeLookup
mode_lookup[] =
{
{"ModeMFD1Quad", BTL4ModeManager::ModeMFD1Quad},
{"ModeMFD1Eng1", BTL4ModeManager::ModeMFD1Eng1},
{"ModeMFD1Eng2", BTL4ModeManager::ModeMFD1Eng2},
{"ModeMFD1Eng3", BTL4ModeManager::ModeMFD1Eng3},
{"ModeMFD1Eng4", BTL4ModeManager::ModeMFD1Eng4},
{"ModeMFD2Quad", BTL4ModeManager::ModeMFD2Quad},
{"ModeMFD2Eng1", BTL4ModeManager::ModeMFD2Eng1},
{"ModeMFD2Eng2", BTL4ModeManager::ModeMFD2Eng2},
{"ModeMFD2Eng3", BTL4ModeManager::ModeMFD2Eng3},
{"ModeMFD2Eng4", BTL4ModeManager::ModeMFD2Eng4},
{"ModeMFD3Quad", BTL4ModeManager::ModeMFD3Quad},
{"ModeMFD3Eng1", BTL4ModeManager::ModeMFD3Eng1},
{"ModeMFD3Eng2", BTL4ModeManager::ModeMFD3Eng2},
{"ModeMFD3Eng3", BTL4ModeManager::ModeMFD3Eng3},
{"ModeMFD3Eng4", BTL4ModeManager::ModeMFD3Eng4},
{"ModeMapping", BTL4ModeManager::ModeMapping},
{"ModeNonMapping", BTL4ModeManager::ModeNonMapping},
{"ModeIntercom", BTL4ModeManager::ModeIntercom},
{"ModeSecondaryDamage", BTL4ModeManager::ModeSecondaryDamage},
{"ModeSecondaryCritical", BTL4ModeManager::ModeSecondaryCritical},
{"ModeSecondaryHeat", BTL4ModeManager::ModeSecondaryHeat},
{"ModeEject", BTL4ModeManager::ModeEject},
{"ModePlasmaDisplay", BTL4ModeManager::ModePlasmaDisplay},
{"ModeInitial", BTL4ModeManager::ModeInitial},
{"ModeNonConfig", BTL4ModeManager::ModeNonConfig},
{"ModeMFD1NonQuad", BTL4ModeManager::ModeMFD1NonQuad},
{"ModeMFD1All", BTL4ModeManager::ModeMFD1All},
{"ModeMFD2NonQuad", BTL4ModeManager::ModeMFD2NonQuad},
{"ModeMFD2All", BTL4ModeManager::ModeMFD2All},
{"ModeMFD3NonQuad", BTL4ModeManager::ModeMFD3NonQuad},
{"ModeMFD3All", BTL4ModeManager::ModeMFD3All},
{"ModeSecondaryAll", BTL4ModeManager::ModeSecondaryAll},
{ NULL, (ModeMask)0}
};
Logical
BTL4ModeManager::ModeStringLookup(
const char *name,
ModeMask *returned_value
)
{
Check(this);
Check_Pointer(name);
Check_Pointer(returned_value);
//----------------------------------------
// Search table for match
//----------------------------------------
ModeLookup
*lookup;
for(lookup=mode_lookup; lookup->name!=NULL; ++lookup)
{
if (stricmp(name, lookup->name) == 0)
{
*returned_value = lookup->modeMask;
Check_Fpu();
return True;
}
}
//----------------------------------------
// Not found here, check next level down.
//----------------------------------------
Check_Fpu();
return ModeManager::ModeStringLookup(name, returned_value);
}
+152
View File
@@ -0,0 +1,152 @@
//===========================================================================//
// File: btl4mode.hpp //
// Project: Battletech //
// Contents: BTL4 controls //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 02/13/96 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4MODE_HPP)
# define BTL4MODE_HPP
# if !defined(MODE_HPP)
# include <mode.hpp>
# endif
//#########################################################################
//########################## BTL4ControlsManager ##########################
//#########################################################################
class BTL4ModeManager:
public ModeManager
{
public:
enum
{
};
//-------------------------------------------------------------------
// Construction/destruction/verification
//-------------------------------------------------------------------
public:
BTL4ModeManager(ModeMask initial_mask):
ModeManager(initial_mask)
{}
//-------------------------------------------------------------------
// Mode control
//-------------------------------------------------------------------
enum
{
ModeMFD1QuadBit = ModeManager::nextModeBit,
ModeMFD1Eng1Bit,
ModeMFD1Eng2Bit,
ModeMFD1Eng3Bit,
ModeMFD1Eng4Bit,
ModeMFD2QuadBit,
ModeMFD2Eng1Bit,
ModeMFD2Eng2Bit,
ModeMFD2Eng3Bit,
ModeMFD2Eng4Bit,
ModeMFD3QuadBit,
ModeMFD3Eng1Bit,
ModeMFD3Eng2Bit,
ModeMFD3Eng3Bit,
ModeMFD3Eng4Bit,
ModeMappingBit,
ModeNonMappingBit,
ModeIntercomBit,
ModeSecondaryDamageBit,
ModeSecondaryCriticalBit,
ModeSecondaryHeatBit,
ModeEjectBit,
ModePlasmaDisplayBit,
};
enum
{
// These 5 mutually exclusive
ModeMFD1Quad = 1L<<ModeMFD1QuadBit,
ModeMFD1Eng1 = 1L<<ModeMFD1Eng1Bit,
ModeMFD1Eng2 = 1L<<ModeMFD1Eng2Bit,
ModeMFD1Eng3 = 1L<<ModeMFD1Eng3Bit,
ModeMFD1Eng4 = 1L<<ModeMFD1Eng4Bit,
// These 5 mutually exclusive
ModeMFD2Quad = 1L<<ModeMFD2QuadBit,
ModeMFD2Eng1 = 1L<<ModeMFD2Eng1Bit,
ModeMFD2Eng2 = 1L<<ModeMFD2Eng2Bit,
ModeMFD2Eng3 = 1L<<ModeMFD2Eng3Bit,
ModeMFD2Eng4 = 1L<<ModeMFD2Eng4Bit,
// These 5 mutually exclusive
ModeMFD3Quad = 1L<<ModeMFD3QuadBit,
ModeMFD3Eng1 = 1L<<ModeMFD3Eng1Bit,
ModeMFD3Eng2 = 1L<<ModeMFD3Eng2Bit,
ModeMFD3Eng3 = 1L<<ModeMFD3Eng3Bit,
ModeMFD3Eng4 = 1L<<ModeMFD3Eng4Bit,
// These two mutually exclusive
ModeMapping = 1L<<ModeMappingBit,
ModeNonMapping= 1L<<ModeNonMappingBit,
ModeIntercom = 1L<<ModeIntercomBit,
// These three mutually exclusive
ModeSecondaryDamage = 1L<<ModeSecondaryDamageBit,
ModeSecondaryCritical= 1L<<ModeSecondaryCriticalBit,
ModeSecondaryHeat = 1L<<ModeSecondaryHeatBit,
ModeEject = 1L<<ModeEjectBit,
ModePlasmaDisplay = 1L<<ModePlasmaDisplayBit
};
// Useful combinations
enum
{
ModeInitial =
ModeMFD1Quad|ModeMFD2Quad|ModeMFD3Quad|ModeNonMapping|
ModeSecondaryDamage,
ModeNonConfig =
ModeNonMapping,
ModeMFD1NonQuad =
ModeMFD1Eng1|ModeMFD1Eng2|ModeMFD1Eng3|ModeMFD1Eng4,
ModeMFD1All =
ModeMFD1Quad|ModeMFD1NonQuad,
ModeMFD2NonQuad =
ModeMFD2Eng1|ModeMFD2Eng2|ModeMFD2Eng3|ModeMFD2Eng4,
ModeMFD2All =
ModeMFD2Quad|ModeMFD2NonQuad,
ModeMFD3NonQuad =
ModeMFD3Eng1|ModeMFD3Eng2|ModeMFD3Eng3|ModeMFD3Eng4,
ModeMFD3All =
ModeMFD3Quad|ModeMFD3NonQuad,
ModeSecondaryAll =
ModeSecondaryDamage|ModeSecondaryCritical|ModeSecondaryHeat
};
Logical // defined as virtual in MODE.HPP
ModeStringLookup(const char *name, ModeMask *returned_value);
};
#endif
+46
View File
@@ -0,0 +1,46 @@
//===========================================================================//
// File: rpl4mssn.hpp //
// Project: MUNGA Brick: //
// Contents: Interface specification for missions //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 04/07/95 ECH Initial coding. //
// 09/12/95 JM Derived from L4Mission //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4MSSN_HPP)
# define BTL4MSSN_HPP
# if !defined(BTMSSN_HPP)
# include <btmssn.hpp>
# endif
//##########################################################################
//########################### BTL4Mission ############################
//##########################################################################
class BTL4Mission:
public BTMission
{
public:
BTL4Mission(
NotationFile *notation_file,
ResourceFile *resources
);
~BTL4Mission();
Logical
TestInstance() const;
void
SetPlayerData(NotationFile *notation_file);
};
#endif
+116
View File
@@ -0,0 +1,116 @@
//===========================================================================//
// File: rp4lbe4.hh //
// Project: MUNGA Brick: Red Planet LBE Application //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4PB_HPP)
# define BTL4PB_HPP
# if !defined(BTL4APP_HPP)
# include <btl4app.hpp>
# endif
# if !defined(L4SPLR_HPP)
# include <l4splr.hpp>
# endif
//##########################################################################
//####################### RPSpoolerTask ##############################
//##########################################################################
class BTSpoolerTask:
public SpoolerTask
{
public:
BTSpoolerTask();
~BTSpoolerTask();
void
DispatchPacket(NetworkPacket *packet);
long
GetTimeBias();
};
//##########################################################################
//#################### RPPlaybackApplication ##########################
//##########################################################################
class BTL4PlaybackApplication:
public BTL4Application
{
public:
BTL4PlaybackApplication(
ResourceFile *resource,
SpoolFile *spool_file = NULL
);
~BTL4PlaybackApplication();
Logical
TestInstance() const;
void
SetSpoolFile(SpoolFile *spool_file)
{spoolFile = spool_file;}
MissionReviewApplicationManager*
GetApplicationManager()
{
return
(MissionReviewApplicationManager*)
Application::GetApplicationManager();
}
long
GetTimeBias()
{return timeBias;}
void
DispatchPacket(NetworkPacket *packet);
protected:
NetworkManager*
MakeNetworkManager();
long
timeBias;
void
Initialize();
void
LoadBackgroundTasks();
Logical
ExecuteForeground(
Time start_of_frame,
Scalar frame_duration
);
void
ExecuteBackgroundTask();
static const HandlerEntry
MessageHandlerEntries[];
static MessageHandlerSet
MessageHandlers;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
public:
static Derivation ClassDerivations;
static SharedData DefaultData;
void
RunMissionMessageHandler(RunMissionMessage *message);
void
StopMissionMessageHandler(StopMissionMessage *message);
};
#endif
+238
View File
@@ -0,0 +1,238 @@
//===========================================================================//
// File: btl4gaug.hh //
// Project: MUNGA Brick: Gauge Renderer Manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 09/13/95 CPB Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. All rights reserved //
// PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BTL4RDR_HPP)
# define BTL4RDR_HPP
# if !defined(SLOT_HPP)
# include <slot.hpp>
# endif
# if !defined(L4GREND_HPP)
# include <l4grend.hpp>
# endif
# if !defined(L4GAUGE_HPP)
# include <l4gauge.hpp>
# endif
# if !defined(ROTATION_HPP)
# include <rotation.hpp>
# endif
# if !defined(RANDOM_HPP)
# include <random.hpp>
# endif
# if !defined(POINT3D_HPP)
# include "point3d.hpp"
# endif
# if !defined(HEAT_HPP)
# include <heat.hpp>
# endif
# if !defined(POWERSUB_HPP)
# include <powersub.hpp>
# endif
struct ShadowRecord
{
int distance;
};
class MapDisplay;
class MapName SIGNATURED // Used exclusively by MapDisplay
{
friend class MapDisplay;
MapName()
{}
~MapName()
{}
Logical
TestInstance() const
{
return True;
}
protected:
void
ExtractFromEntity(
Entity *entity,
AffineMatrix &worldToView,
Entity *exclude_entity=NULL,
Entity *hotbox_entity=NULL
);
void
Draw(
GraphicsView *graphics_view,
int hotbox_color
);
Point3D
center;
Vector3D
direction;
BitMap
*nameBitmap;
int
color;
Logical
hotBoxed;
};
class MapDisplay :
public GraphicGauge
{
public:
enum OffsetPosition
{
center,
bottom
};
static MethodDescription
methodDescription;
static Logical
Make(
int display_port_index,
Vector2DOf<int> position,
Entity *entity,
GaugeRenderer *gauge_renderer
);
MapDisplay(
GaugeRate rate,
ModeMask mode_mask,
L4GaugeRenderer *renderer,
unsigned int owner_ID,
int graphics_port_number,
int left, int bottom,
int right, int top,
OffsetPosition offset_position,
int view_width_in_degrees,
int bg_color,
int static_color,
int hotbox_color,
Scalar maximum_range,
Entity *entity,
Scalar *scale_value_pointer,
Point3D **position_pointer,
Quaternion **angle_pointer,
Scalar *capabilities_ratio,
Logical allow_rock_and_roll=False
);
~MapDisplay();
Logical
TestInstance() const;
void
ShowInstance(char *indent);
void
BecameActive();
void
Execute();
protected:
void
CalculateBounds();
void
EraseDisplay();
void
DrawDisplay();
void
BuildRadarShadow(AffineMatrix &worldToView);
void
DrawViewWedge();
void
DrawStatic(AffineMatrix &worldToView);
void
DrawMoving(AffineMatrix &worldToView);
void
DrawNames(AffineMatrix &worldToView);
enum
{
maximumNames = 16
};
MapName
nameArray[maximumNames];
OffsetPosition
offsetPosition;
Scalar
currentScale;
Point3D *
currentPositionPointer;
Quaternion *
currentAngularPointer;
Scalar
currentCapabilitiesRatio;
Scalar
LODIndex,
pixelsPerMeter,
metersPerPixel,
maximumRange,
maximumDistanceSquared,
xMin,
yMin,
zMin,
xMax,
yMax,
zMax;
Point3D
viewingPosition;
Radian
viewHorizontalRotation;
Radian
viewHalfHorizontalWidth;
AffineMatrix
worldToView;
int
operatingPhase,
backgroundColor,
staticColor,
boxColor,
halfWidth,
halfHeight;
Logical
operating,
rockAndRoll,
flashState;
GaugeEntityList
staticEntityList,
movingEntityList;
GraphicsViewRecord
previousDrawing;
int
halfViewWidthInUnits;
ShadowRecord
*shadowTable;
};
#endif
+9
View File
@@ -0,0 +1,9 @@
#if !defined(BTL4VER_HPP)
# define BTL4VER_HPP
# define MAJOR_DATA_VERSION 1
# define RELEASE_VERSION 0
# define MINOR_DATA_VERSION 6
#endif
+5
View File
@@ -0,0 +1,5 @@
SCC = This is a Source Code Control file
[BTL4.MAK]
SCC_Aux_Path = "\\AVATAR\Mungass\VSS"
SCC_Project_Name = "$/Tesla_BT/BT_L4", ZOCAAAAA
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
@REM **************************************************************************
@REM * BUILDRES.BAT - 11-11-96 cpb *
@REM * This file is intended to simplify the development of BTL4 resources *
@REM * on a Win95 system. It must be executed under MS-DOS (but NOT in a *
@REM * "dos box": the current tools won't run at all under Win32)! *
@REM * See the document "Modifying Resources" for more information. *
@REM **************************************************************************
@ECHO ON
cd models
@echo Building avatar... > ..\result.txt
..\mechbld avatar.mch >> ..\result.txt
@echo Building ava1... > ..\result.txt
..\mechbld ava1.mch >> ..\result.txt
@echo Building blkhawk... >> ..\result.txt
..\mechbld blkhawk.mch >> ..\result.txt
@echo Building bhk1... >> ..\result.txt
..\mechbld bhk1.mch >> ..\result.txt
@echo Building loki... >> ..\result.txt
..\mechbld loki.mch >> ..\result.txt
@echo Building Lok1... >> ..\result.txt
..\mechbld lok1.mch >> ..\result.txt
@echo Building madcat... >> ..\result.txt
..\mechbld madcat.mch >> ..\result.txt
@echo Building mad1... >> ..\result.txt
..\mechbld mad1.mch >> ..\result.txt
@echo Building owens... >> ..\result.txt
..\mechbld owens.mch >> ..\result.txt
@echo Building sunder... >> ..\result.txt
..\mechbld sunder.mch >> ..\result.txt
@echo Building thor... >> ..\result.txt
..\mechbld thor.mch >> ..\result.txt
@echo Building thr1... >> ..\result.txt
..\mechbld thr1.mch >> ..\result.txt
@echo Building vulture... >> ..\result.txt
..\mechbld vulture.mch >> ..\result.txt
@echo Building vul1... >> ..\result.txt
..\mechbld vul1.mch >> ..\result.txt
cd ..
btl4tool -b btl4.bld >> result.txt
call arcbt f . >> result.txt
BIN
View File
Binary file not shown.
+49
View File
@@ -0,0 +1,49 @@
LINK_OPTIONS = -Tpe -ax -L$(LIBRARY_PATH) -v -x
BCC = bcc32
TASM_OPTIONS = -zi
STARTUP_OBJ = $(STARTUP_ROOT)\c0x32.obj
STARTUP_LIBS = $(STARTUP_ROOT)\dpmi32.lib $(STARTUP_ROOT)\cw32.lib
LIB_OPTIONS = /P512
$(CFG_FILE): d0.mak make.cfg $(BPATH)
copy &&|
-DLAB_ONLY;LBE4;DEBUG_LEVEL=0;DEBUG_STREAM=cout
-DTEST_CLASS=50
-b
-r
-ff
-AT
-k-
-N-
-v
-vi-
-5
-pc
-a4
-V
-Jg
-x-
-RT-
-O2
-Ot
-Oc
-Og
-O
-Ol
-Z
-Ob
-Oe
-Oi
-Om
-Op
-Ov
-w
-c
-I$(INCLUDE_PATH)
-H
-H=$(HEADER_FILE)
-Hc
-n$(TARGET_DIR)
| $(CFG_FILE)
+33
View File
@@ -0,0 +1,33 @@
LINK_OPTIONS = -Tpe -ax -L$(LIBRARY_PATH) -v -x
BCC = bcc32
TASM_OPTIONS = -zi
STARTUP_OBJ = $(STARTUP_ROOT)\c0x32.obj
STARTUP_LIBS = $(STARTUP_ROOT)\dpmi32.lib $(STARTUP_ROOT)\cw32.lib
LIB_OPTIONS = /P512
$(CFG_FILE): d2s.mak make.cfg $(BPATH)
copy &&|
-DLAB_ONLY;LBE4;DEBUG_LEVEL=1;DEBUG_STREAM=cout
-b
-r-
-ff
-AT
-v
-5
-pc
-a4
-V
-Jg
-x-
-RT-
-Od
-w
-c
-I$(INCLUDE_PATH)
-H
-H=$(HEADER_FILE)
-Hc
-n$(TARGET_DIR)
| $(CFG_FILE)
+33
View File
@@ -0,0 +1,33 @@
LINK_OPTIONS = -Tpe -ax -L$(LIBRARY_PATH) -v -x
BCC = bcc32
TASM_OPTIONS = -zi
STARTUP_OBJ = $(STARTUP_ROOT)\c0x32.obj
STARTUP_LIBS = $(STARTUP_ROOT)\dpmi32.lib $(STARTUP_ROOT)\cw32.lib
LIB_OPTIONS = /P512
$(CFG_FILE): d2s.mak make.cfg $(BPATH)
copy &&|
-DLAB_ONLY;LBE4;DEBUG_LEVEL=2;DEBUG_STREAM=cout;DEBUG_NEW_ON;USE_SIGNATURE
-b
-r-
-ff
-AT
-v
-5
-pc
-a4
-V
-Jg
-x-
-RT-
-Od
-w
-c
-I$(INCLUDE_PATH)
-H
-H=$(HEADER_FILE)
-Hc
-n$(TARGET_DIR)
| $(CFG_FILE)
+48
View File
@@ -0,0 +1,48 @@
LINK_OPTIONS = -Tpe -ax -L$(LIBRARY_PATH) -m
BCC = bcc32
TASM_OPTIONS =
MAKE_TEST = 1
STARTUP_OBJ = $(STARTUP_ROOT)\c0x32.obj
STARTUP_LIBS = $(STARTUP_ROOT)\dpmi32.lib $(STARTUP_ROOT)\cw32.lib
LIB_OPTIONS = /P256
$(CFG_FILE): opt.mak make.cfg $(BPATH)
copy &&|
-DLBE4;DEBUG_LEVEL=2;DEBUG_STREAM=cout;MEMORY_REGISTER;USE_SIGNATURE
-DTEST_CLASS=50
-b
-r
-ff
-AT
-k-
-N-
-v-
-5
-a4
-V
-Jg
-x-
-RT-
-O2
-Ot
-Oc
-Og
-O
-Ol
-Z
-Ob
-Oe
-Oi
-Om
-Op
-Ov
-w
-c
-I$(INCLUDE_PATH)
-H
-H=$(HEADER_FILE)
-Hc
-n$(TARGET_DIR)
| $(CFG_FILE)
+19
View File
@@ -0,0 +1,19 @@
rem --------------------------------------
rem - %1=o restore to the directory
rem - %1=f freshen to the directory
rem - %2=path to the zipfile
rem --------------------------------------
if "%1"=="o" goto RESTORE
if "%1"=="f" goto FRESHEN
:RESTORE
pkunzip -o -d %2\bt.zip
goto END
:FRESHEN
pkunzip -n -d %2\bt.zip
goto END
:END
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
@echo off
del error.log
make -r -DBTYPE=opt -DBPATH=btl4.pth -fmunga\munga.mak %1 %2 %3 %4 %5
if errorlevel 1 goto done
make -r -DBTYPE=opt -DBPATH=btl4.pth -fmunga_l4\mungal4.mak %1 %2 %3 %4 %5
if errorlevel 1 goto done
make -r -DBTYPE=opt -DBPATH=btl4.pth -fbt\bt.mak %1 %2 %3 %4 %5
if errorlevel 1 goto done
make -r -DBTYPE=opt -DBPATH=btl4.pth -fbt_l4\btl4.mak %1 %2 %3 %4 %5
:done
+12
View File
@@ -0,0 +1,12 @@
BC_ROOT = d:\bc5
DPL_ROOT = g:\tesla_bt\munga_l4\libdpl
SOS_ROOT = g:\tesla_bt\munga_l4\sos
NETNUB_ROOT = g:\tesla_bt\munga_l4\netnub
STARTUP_ROOT = g:\tesla_bt
MUNGA_ROOT = g:\tesla_bt\munga
BT_ROOT = g:\tesla_bt\bt
MUNGAL4_ROOT = g:\tesla_bt\munga_l4
BTL4_ROOT = g:\tesla_bt\bt_l4
BCC_OPT = bcc32i
+7
View File
@@ -0,0 +1,7 @@
joystick.ini
anims\vcs.cfg
audio\vcs.cfg
gauge\vcs.cfg
maps\vcs.cfg
models\vcs.cfg
solids\vcs.cfg
Binary file not shown.
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
SCC = This is a Source Code Control file
[D0.mak]
SCC_Aux_Path = "\\AVATAR\Mungass\VSS"
SCC_Project_Name = "$/Tesla_BT", VOCAAAAA
[d1.mak]
SCC_Aux_Path = "\\AVATAR\Mungass\VSS"
SCC_Project_Name = "$/Tesla_BT", VOCAAAAA
[d2s.mak]
SCC_Aux_Path = "\\AVATAR\Mungass\VSS"
SCC_Project_Name = "$/Tesla_BT", VOCAAAAA
[d3s.mak]
SCC_Aux_Path = "\\AVATAR\Mungass\VSS"
SCC_Project_Name = "$/Tesla_BT", VOCAAAAA
[OPT.mak]
SCC_Aux_Path = "\\AVATAR\Mungass\VSS"
SCC_Project_Name = "$/Tesla_BT", VOCAAAAA
+27
View File
@@ -0,0 +1,27 @@
//===========================================================================//
// File: affnmtrx.cc //
// Project: MUNGA Brick: Math Library //
// Contents: Implementation details for the Affine matrices //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/20/94 JMA Initial coding. //
// 12/01/94 JMA Made compatible with SGI CC //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
//
//###########################################################################
//###########################################################################
//
Logical
AffineMatrix::TestClass()
{
DEBUG_STREAM << "Starting AffineMatrix Test...\n";
Tell(" AffineMatrix::TestClass() stubbed out!\n");
return False;
}
+170
View File
@@ -0,0 +1,170 @@
//===========================================================================//
// File: angle.tst //
// Project: MUNGA Brick: Math Library //
// Contents: Tests for angle classes //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/19/94 JMA Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
//
//#############################################################################
//#############################################################################
//
Logical
Radian::TestClass()
{
DEBUG_STREAM << "Starting Radian Test...\n";
const Radian a(1.25f);
Radian
b,c;
Test(a);
c = 0.0f;
Test(!c);
Test(Normalize(3.1f) == 3.1f);
Test(Normalize(-3.1f) == -3.1f);
Scalar f = Normalize(PI+PI_OVER_2);
Test(Close_Enough(f,PI_OVER_2 - PI));
f = Normalize(-PI-PI_OVER_2);
Test(Close_Enough(f,PI - PI_OVER_2));
c = a;
Test(c == a);
Test(c.angle == a);
Test(c == a.angle);
b.Negate(c);
Test(b == -c.angle);
#if 0
b = -c;
d.Add(b,c);
Test(d == b.angle + c.angle);
Test(a+b == a.angle + b.angle);
Test(a+c == a.angle + c.angle);
Test(a+1.25f == a.angle+1.25f);
Test(1.25f+c == 1.25f+c.angle);
c = 1.5f;
d.Subtract(c,a);
Test(d == c.angle - a.angle);
Test(c-a == c.angle - a.angle);
Test(c-1.25f == c.angle - 1.25f);
Test(1.5f-a == 1.5f - a.angle);
Test(c-b == c.angle - b.angle);
c = 2.5f;
d.Multiply(a,c);
Test(d == a.angle * c.angle);
Test(a*c == a.angle * c.angle);
Test(1.25f*c == 1.25f * c.angle);
Test(a*2.5f == a.angle * 2.5f);
Test(a*b == a.angle * b.angle);
c = 2.0f;
d.Divide(a,c);
Test(d == a.angle / c.angle);
Test(a/c == a.angle / c.angle);
Test(1.25f/c == 1.25f / c.angle);
Test(a/2.0f == a.angle / 2.0f);
Test(a/b == a.angle / b.angle);
b = a;
b += c;
b.Normalize();
Test(b == 3.25f - TWO_PI);
b += 2.0f;
b.Normalize();
Test(b == 5.25f - TWO_PI);
b -= c;
b.Normalize();
Test(b == 3.25f - TWO_PI);
b -= 2.0f;
b.Normalize();
Test(b == 1.25f);
b *= c;
b.Normalize();
Test(b == 1.25f*2.0f);
b *= 2.0f;
b.Normalize();
Test(b == 1.25f*2.0f*2.0f - TWO_PI);
b = a*c;
b.Normalize();
Test(b == 1.25f*2.0f);
b /= 2.0f;
b.Normalize();
Test(b == 1.25f);
b = -3.0f*PI_OVER_4;
c = 3.0f*PI_OVER_4;
Test(Lerp(b,c,0.25f) < b);
Test(Normalize(Lerp(b,c,0.75f)) > c);
#endif
return True;
}
//
//#############################################################################
//#############################################################################
//
Logical
Degree::TestClass()
{
DEBUG_STREAM << "Starting Degree test...\n";
const Degree a(DEG_PER_RAD);
Degree
b,c;
Radian
r(1.0f),s;
s = a;
Test(r == s);
b = r;
s = b;
Test(r == s);
c = DEG_PER_RAD;
s = c;
Test(r == s);
b = c;
s = b;
Test(r == s);
return True;
}
//
//#############################################################################
//#############################################################################
//
Logical
SinCosPair::TestClass()
{
DEBUG_STREAM << "Starting SinCos test...\n";
Radian
s,r(PI_OVER_2);
SinCosPair a;
a = r;
Test(Close_Enough(a.sine,1.0f));
Test(Small_Enough(a.cosine));
s = a;
Test(s == r);
return True;
}
+45
View File
@@ -0,0 +1,45 @@
//===========================================================================//
// File: tstapp.hh //
// Project: MUNGA Brick: Application //
// Contents: Interface specification for Application //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/06/95 ECH Added event utilities. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(APP_THP)
# define APP_THP
# if !defined(APP_HPP)
# include "app.hpp"
# endif
# if !defined(RENDERER_THP)
# include "renderer.thp"
# endif
# if !defined(VIDREND_HPP)
# include "vidrend.hpp"
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TestApplication ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class TestApplication:
public Application
{
public:
TestApplication(ResourceFile *resource_file);
~TestApplication();
void
Initialize();
void
Terminate();
};
#endif
+33
View File
@@ -0,0 +1,33 @@
#if !defined(APPMGR_HPP)
# define APPMGR_HPP
# if !defined(APP_HPP)
# include <app.hpp>
# endif
class ApplicationManager:
public Node
{
public:
ApplicationManager(Scalar frame_rate);
~ApplicationManager();
void
StartApplication(Application *new_app);
void
RunMissions();
Scalar
GetFrameRate()
{Check(this); return frameRate;}
protected:
Scalar
frameDuration,
frameRate;
SChainOf<Application*>
runningApplications;
};
#endif
+87
View File
@@ -0,0 +1,87 @@
//===========================================================================//
// File: audtime.cpp //
// Project: MUNGA Brick: Audio Renderer //
// Contents: Interface declarations for AudioTim //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/08/96 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(AUDIO_HPP)
#include <audio.hpp>
#endif
#if !defined(AUDTIME_HPP)
#include <audtime.hpp>
#endif
#if !defined(APP_HPP)
#include <app.hpp>
#endif
#if !defined(AUDREND_HPP)
#include <audrend.hpp>
#endif
//#############################################################################
//############################# AudioTime ###############################
//#############################################################################
const AudioTime
AudioTime::Null;
//
//#############################################################################
//#############################################################################
//
Logical
AudioTime::TestInstance() const
{
return True;
}
//
//#############################################################################
//#############################################################################
//
AudioTime
AudioTime::Now()
{
Check(application);
Check(application->GetAudioRenderer());
return AudioTime(application->GetAudioRenderer()->GetAudioFrameCount());
}
//
//#############################################################################
//#############################################################################
//
AudioFrameCount
AudioTime::Seconds_To_Frames(Scalar seconds) const
{
Check(application);
Check(application->GetAudioRenderer());
return
(seconds * application->GetAudioRenderer()->GetCalibrationRate() + 0.5f);
}
//
//#############################################################################
//#############################################################################
//
Scalar
AudioTime::Frames_To_Seconds(AudioFrameCount frames) const
{
Check(application);
Check(application->GetAudioRenderer());
return
((Scalar)frames / application->GetAudioRenderer()->GetCalibrationRate());
}
+51
View File
@@ -0,0 +1,51 @@
//===========================================================================//
// File: audtools.hpp //
// Project: MUNGA Brick: Audio Renderer Manager //
// Contents: //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/10/95 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(AUDTOOLS_HPP)
# define AUDTOOLS_HPP
# if !defined(STYLE_HPP)
# include <style.hpp>
# endif
# if !defined(CSTR_HPP)
# include <cstr.hpp>
# endif
//##########################################################################
//##################### AudioCreateSymbols ###########################
//##########################################################################
class AudioCreateSymbols
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction, Destruction and testing
//
public:
AudioCreateSymbols();
~AudioCreateSymbols();
void Execute();
private:
static void
MakeFileReadWrite(const CString &file_name);
protected:
virtual void
WriteEntryStream(ofstream &symbol_file);
};
#endif
+38
View File
@@ -0,0 +1,38 @@
//===========================================================================//
// File: audwgt.cpp //
// Project: MUNGA Brick: Audio Renderer //
// Contents: Implementation for audio weighting //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/02/96 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(AUDWGT_HPP)
# include <audwgt.hpp>
#endif
//#############################################################################
//########################## AudioWeighting #############################
//#############################################################################
const AudioWeighting
AudioWeighting::Null;
//
//#############################################################################
//#############################################################################
//
Logical
AudioWeighting::TestInstance() const
{
return True;
}
+21
View File
@@ -0,0 +1,21 @@
//===========================================================================//
// File: average.cpp //
// Project: MUNGA Brick: Renderer //
// 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 <munga.hpp>
#pragma hdrstop
#if !defined(AVERAGE_HPP)
# include <average.hpp>
#endif
+177
View File
@@ -0,0 +1,177 @@
//===========================================================================//
// File: bndgbox.hh //
// Project: MUNGA Brick: Spatializer Library //
// Contents: Interface specification of bounding-box based spatialization //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 01/08/95 JMA Initial port back to C++ //
//---------------------------------------------------------------------------//
// Copyright (C) 1993-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(BOXLIST_HPP)
# define BOXLIST_HPP
# if !defined(BNDGBOX_HPP)
# include <bndgbox.hpp>
# endif
# if !defined(MEMBLOCK_HPP)
# include <memblock.hpp>
# endif
# if !defined(POINT3D_HPP)
# include <point3d.hpp>
# endif
//##########################################################################
//####################### BoundingBoxListNode ########################
//##########################################################################
class BoundingBoxList;
class BoxedSolidList;
class BoundingBoxTree;
class BoundingBoxListNode SIGNATURED
{
friend class BoundingBoxList;
friend class BoxedSolidList;
//##########################################################################
// Memory Allocation
//
private:
static MemoryBlock
AllocatedMemory;
void*
operator new(size_t)
{return AllocatedMemory.New();}
void
operator delete(void *where)
{AllocatedMemory.Delete(where);}
//##########################################################################
// Construction and Destruction
//
protected:
BoundingBox
*boundingBox;
BoundingBoxListNode
*previousNode;
BoundingBoxListNode(
BoundingBox *volume,
const ExtentBox &slice
):
boundingBox(volume),
solidSlice(slice),
previousNode(NULL)
{Check_Pointer(this); Check(volume);}
~BoundingBoxListNode()
{Check(this);}
public:
ExtentBox
solidSlice;
BoundingBox*
GetBoundingBox()
{Check(this); return boundingBox;}
BoundingBoxListNode*
GetNextNode()
{Check(this); return previousNode;}
//##########################################################################
// Test Support
//
public:
Logical
TestInstance() const;
};
//##########################################################################
//######################## BoundingBoxList ###########################
//##########################################################################
class BoundingBoxList SIGNATURED
{
//##########################################################################
// Construction and Destruction
//
protected:
BoundingBoxListNode
*root;
int
nodeCount;
int*
scoreBoard;
BoundingBox
**boundingBoxIndex;
Logical
isXMajorAxis;
public:
BoundingBoxList();
~BoundingBoxList();
void
Add(
BoundingBox* volume,
const ExtentBox &slice
);
void
Remove(BoundingBox* volume);
void
EraseList();
BoundingBoxListNode*
GetRoot()
{Check(this); return root;}
//##########################################################################
// Tree Traversal Functions
//
public:
BoundingBox*
FindBoundingBoxContaining(const Point3D &point);
void
FindBoundingBoxesContaining(
BoundingBox *volume,
BoundingBoxCollisionList &list
);
BoundingBox*
FindBoundingBoxUnder(
const Point3D &point,
Scalar *height
);
BoundingBox*
FindBoundingBoxHitBy(Line *line);
void
Reduce();
void
SortForTree();
protected:
void
Sort(
BoundingBoxList &active_solids,
ExtentBox &clipping_box,
BoundingBoxTree &tree_so_far
);
//##########################################################################
// Test Support
//
public:
Logical
TestInstance() const;
};
#endif
+73
View File
@@ -0,0 +1,73 @@
//===========================================================================//
// File: cmpnnt.hh //
// Project: MUNGA Brick: Watcher //
// 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 //
//===========================================================================//
#if !defined(CMPNNT_HPP)
# define CMPNNT_HPP
# if !defined(RECEIVER_HPP)
# include <receiver.hpp>
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Component ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Component:
public Receiver
{
public:
//
//-----------------------------------------------------------------------
// Destructor
//-----------------------------------------------------------------------
//
~Component();
//
//-----------------------------------------------------------------------
// Execute
//-----------------------------------------------------------------------
//
virtual void
Execute();
//
//-----------------------------------------------------------------------
// Shared Data Support
//-----------------------------------------------------------------------
//
static Derivation
ClassDerivations;
static SharedData
DefaultData;
Logical
TestInstance() const;
protected:
//
//-----------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------
//
Component(
ClassID class_id = TrivialComponentClassID,
SharedData &shared_data = DefaultData
);
Component(
PlugStream *stream,
SharedData &shared_data = DefaultData
);
};
#endif
+106
View File
@@ -0,0 +1,106 @@
//===========================================================================//
// File: Color.cpp //
// Project: MUNGA Brick: Utility Library //
// Contents: Implementation details for color classes //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/12/95 GDU Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(COLOR_HPP)
# include <color.hpp>
#endif
#if !defined(CSTR_HPP)
#include <cstr.hpp>
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~ RGBColor functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#if defined(USE_SIGNATURE)
int
Is_Signature_Bad(const volatile RGBColor *)
{
return False;
}
#endif
//
//###########################################################################
//###########################################################################
//
void
Convert_From_Ascii(
const char *str,
RGBColor *color
)
{
Check_Pointer(str);
Check_Signature(color);
CString parse_string(str);
Check_Pointer(parse_string.GetNthToken(0));
color->Red = atof(parse_string.GetNthToken(0));
Check_Pointer(parse_string.GetNthToken(1));
color->Green = atof(parse_string.GetNthToken(1));
Check_Pointer(parse_string.GetNthToken(2));
color->Blue = atof(parse_string.GetNthToken(2));
Check(color);
}
//
//###########################################################################
//###########################################################################
//
Logical
RGBColor::TestInstance() const
{
return True;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~ RGBAColor functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//###########################################################################
//###########################################################################
//
void
Convert_From_Ascii(
const char *str,
RGBAColor *color
)
{
Check_Pointer(str);
Check_Signature(color);
CString parse_string(str);
Check_Pointer(parse_string.GetNthToken(0));
color->Red = atof(parse_string.GetNthToken(0));
Check_Pointer(parse_string.GetNthToken(1));
color->Green = atof(parse_string.GetNthToken(1));
Check_Pointer(parse_string.GetNthToken(2));
color->Blue = atof(parse_string.GetNthToken(2));
Check_Pointer(parse_string.GetNthToken(3));
color->Alpha = atof(parse_string.GetNthToken(3));
Check(color);
}
+190
View File
@@ -0,0 +1,190 @@
//===========================================================================//
// File: color.hh //
// Title: Declaration of Color classes. //
// Project: Tool Architecture II //
// Author: Jerry Edsall & Ken Olsen (based on work by J.M. Albertson) //
// Purpose: Stores color information. //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 12/15/94 KEO Added RGBAColor class. //
// 11/12/95 GDU Added MUNGA signatures and stream IO, moved to MUNGA //
//---------------------------------------------------------------------------//
// Copyright (c) 1994 Virtual World Entertainment, Inc. //
// All rights reserved worldwide. //
// This unpublished source code is PROPRIETARY and CONFIDENTIAL. //
//===========================================================================//
#if !defined(COLOR_HPP)
#define COLOR_HPP
#if !defined(MEMSTRM_HPP)
#include <memstrm.hpp>
#endif
#if !defined(SCALAR_HPP)
#include <scalar.hpp>
#endif
//##########################################################################
//############## RGBColor ############################################
//##########################################################################
class RGBColor
{
friend class RGBAColor;
public:
Scalar
Red,
Green,
Blue;
#if defined(USE_SIGNATURE)
friend int
Is_Signature_Bad(const volatile RGBColor *p);
#endif
RGBColor()
{
Red = Green = Blue = -1.0f;
}
RGBColor(
Scalar r,
Scalar g,
Scalar b
)
{
Red = r;
Green = g;
Blue = b;
}
Logical
operator==(const RGBColor &a_RGBColor) const
{ return !memcmp(this, &a_RGBColor, sizeof(RGBColor)); }
Logical
operator!=(const RGBColor &a_RGBColor) const
{ return memcmp(this, &a_RGBColor, sizeof(RGBColor)); }
Logical
TestInstance() const;
RGBColor
operator+(const RGBColor &a_RGBColor) const
{
return RGBColor (
min(this->Red + a_RGBColor.Red, 1.0),
min(this->Green + a_RGBColor.Green, 1.0),
min(this->Blue + a_RGBColor.Blue, 1.0));
}
Scalar
Infrared() const
{ return 0.3 * this->Red + 0.5 * this->Green + 0.2 * this->Blue; }
//
// Support functions
//
friend ostream&
operator<<(
ostream& stream,
const RGBColor& C
);
private:
Scalar
min(Scalar x, Scalar y) const
{ return x < y ? x : y; }
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~ RGBColor functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void
Convert_From_Ascii(
const char *str,
RGBColor *color
);
inline MemoryStream&
MemoryStream_Read(
MemoryStream* stream,
RGBColor *output
)
{return stream->ReadBytes(output, sizeof(*output));}
inline MemoryStream&
MemoryStream_Write(
MemoryStream* stream,
const RGBColor *input
)
{return stream->WriteBytes(input, sizeof(*input));}
//##########################################################################
//############## RGBAColor ###########################################
//##########################################################################
class RGBAColor:
public RGBColor
{
public:
Scalar
Alpha;
RGBAColor():
RGBColor()
{ Alpha = -1.0f; }
RGBAColor(
Scalar r,
Scalar g,
Scalar b,
Scalar a
):
RGBColor(r, g, b)
{ Alpha = a; }
Logical
operator==(const RGBAColor &a_RGBAColor) const
{ return !memcmp(this, &a_RGBAColor, sizeof(RGBAColor)); }
Logical
operator!=(const RGBAColor &a_RGBAColor) const
{ return memcmp(this, &a_RGBAColor, sizeof(RGBAColor)); }
//
// Support functions
//
friend ostream&
operator<<(
ostream& stream,
const RGBAColor& c
);
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~ RGBAColor functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void
Convert_From_Ascii(
const char *str,
RGBAColor *color
);
inline MemoryStream&
MemoryStream_Read(
MemoryStream* stream,
RGBAColor *output
)
{return stream->ReadBytes(output, sizeof(*output));}
inline MemoryStream&
MemoryStream_Write(
MemoryStream* stream,
const RGBAColor *input
)
{return stream->WriteBytes(input, sizeof(*input));}
#endif
//=============================================================================
+79
View File
@@ -0,0 +1,79 @@
#define TEST_STRING "Test String"
#define TEST_STRING_2 "Test StringTest String"
#define TEST_STRING_3 "Test StringZ"
Logical
CString::TestClass()
{
#if 1
CString string_a;
//Verify(string_a.stringSize == 0);
//Verify(string_a.stringLength == 0);
//Verify(string_a.stringText == NULL);
CString string_b(TEST_STRING);
CString string_c(string_b);
Verify(string_b.Length() == strlen(TEST_STRING));
Verify(string_b.Length() == strlen(string_c));
Verify(string_b == string_c);
CString string_d(TEST_STRING_2);
CString string_e;
string_e = string_b + string_c;
Verify(string_e == string_d);
CString string_f(TEST_STRING_3);
CString string_g;
string_g = string_b + 'Z';
Verify(string_g == string_f);
CString string_h(TEST_STRING);
string_h += string_b;
Verify(string_h == string_d);
CString string_i(TEST_STRING);
string_i += 'Z';
Verify(string_i == string_f);
CString string_j("aaa");
CString string_k("aab");
CString string_l("abb");
CString string_m("bbb");
CString string_n("aaa");
Verify(string_j < string_k);
Verify(string_l > string_k);
Verify(string_l <= string_m);
Verify(string_m >= string_j);
Verify(string_j == string_n);
Verify(string_j != string_k);
Verify(string_k[0] == 'a');
Verify(string_k[1] == 'a');
Verify(string_k[2] == 'b');
CString string_o("0.1,0.2,0.3");
CString string_p("0.1 0.2 0.3");
CString string_q("0.1");
CString string_r("0.2");
CString string_s("0.3");
Verify(string_o.GetNthToken(0) == string_q);
Verify(string_o.GetNthToken(1) == string_r);
Verify(string_o.GetNthToken(2) == string_s);
Verify(string_p.GetNthToken(0) == string_q);
Verify(string_p.GetNthToken(1) == string_r);
Verify(string_p.GetNthToken(2) == string_s);
#endif
return True;
}
+72
View File
@@ -0,0 +1,72 @@
//=======================================================================//
// File: debugoff.hpp //
// Project: Architecture //
// Author: J.M. Albertson //
// 4-12-95 CPB added Str_Cat macro //
//-----------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainments, All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//=======================================================================//
#if !defined(OLD_DEBUG_LEVEL)
# define OLD_DEBUG_LEVEL 0
#else
# undef OLD_DEBUG_LEVEL
# if DEBUG_LEVEL>=3
# define OLD_DEBUG_LEVEL 3
# elif DEBUG_LEVEL==2
# define OLD_DEBUG_LEVEL 2
# elif DEBUG_LEVEL==1
# define OLD_DEBUG_LEVEL 1
# endif
#endif
#undef DEBUG_LEVEL
#undef Verify
#undef Verify_And_Dump
#undef Warn
#undef Warn_And_Dump
#undef Dump
#undef Tell
#undef Check_Signature
#undef Check_Pointer
#undef Mem_Copy
#undef Str_Copy
#undef Str_Cat
#undef Check
#undef Check_Fpu
#undef Fail
#undef Cast_Object
#undef DEBUG_CODE
#undef Sqrt
#undef Arctan
#undef Arccos
#undef Arcsin
#define DEBUG_LEVEL 0
#define DEBUG_CODE(x)
#define Verify(c)
#define Verify_And_Dump(c,v)
#define Warn(c)
#define Warn_And_Dump(c,v)
#define Dump(v)
#define Tell(m)
#define Check_Pointer(p)
#define Check_Fpu()
#define Mem_Copy(destination, source, length, available)\
memcpy(destination, source, length)
#define Str_Copy(destination, source, available)\
strcpy(destination, source);
#define Str_Cat(destination, source, available)\
strcat(destination, source);
#define Sqrt(value) sqrt(value)
#define Arctan(y,x) atan2(y,x)
#define Arccos(x) acos(x)
#define Arcsin(x) asin(x)
#define Power(x,y) pow(x,y)
#define Check(p)
#define Check_Signature(p)
#define Fail(m) Fail_To_Debugger(m,__FILE__,__LINE__)
#define Cast_Object(type, ptr) ((type)(ptr))
+24
View File
@@ -0,0 +1,24 @@
//=======================================================================//
// File: debug2on.hpp //
// Project: Architecture //
// Author: J.M. Albertson //
// 4-12-95 CPB added Str_Cat macro //
//-----------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainments, All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//=======================================================================//
#if !defined(OLD_DEBUG_LEVEL)
# error Cannot revert to old debug level!
#else
# if OLD_DEBUG_LEVEL>=3
# include <debug3on.hpp>
# elif OLD_DEBUG_LEVEL==2
# include <debug2on.hpp>
# elif OLD_DEBUG_LEVEL==1
# include <debug1on.hpp>
# else
# include <debugoff.hpp>
# endif
#endif
+168
View File
@@ -0,0 +1,168 @@
//===========================================================================//
// File: evtstat.cpp //
// Project: MUNGA Brick: Event Manager //
// Contents: interface specification of event manager //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/15/96 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(EVTSTAT_HPP)
# include <evtstat.hpp>
#endif
#if !defined(APP_HPP)
# include <app.hpp>
#endif
#if !defined(REGISTRY_HPP)
# include <registry.hpp>
#endif
#if !defined(ENTITY_HPP)
# include <entity.hpp>
#endif
//#############################################################################
//########################## EventStatistics ############################
//#############################################################################
//
//#############################################################################
//#############################################################################
//
EventStatistics::EventStatistics(
ClassID class_ID,
Receiver::MessageID message_ID
):
classID(class_ID),
messageID(message_ID),
eventCount(0)
{
}
//#############################################################################
//######################## EventStatisticsManager #######################
//#############################################################################
EventStatisticsManager
event_statistics_manager;
//
//#############################################################################
//#############################################################################
//
EventStatisticsManager::EventStatisticsManager():
eventStatisticsSocket(NULL, True)
{
printedReport = False;
}
//
//#############################################################################
//#############################################################################
//
void
EventStatisticsManager::Maintain(Event *event)
{
Check(this);
Check(event);
//
// If the application is not running then it is not time to collect
// statistics yet
//
Check(application);
if (application->GetApplicationState() != Application::RunningMission)
return;
//
// Add statistics for this event
//
ClassID
class_ID;
Receiver::MessageID
message_ID;
long
index_value;
EventStatistics
*event_statistics;
message_ID = event->messageToSend->messageID;
class_ID = event->targetReceiver.GetCurrent()->GetClassID();
index_value = class_ID * 1000 + message_ID; // HACK to create unique key
if ((event_statistics = eventStatisticsSocket.Find(index_value)) == NULL)
{
event_statistics = new EventStatistics(class_ID, message_ID);
eventStatisticsSocket.AddValue(event_statistics, index_value);
}
Check(event_statistics);
event_statistics->eventCount++;
}
//
//#############################################################################
//#############################################################################
//
void
EventStatisticsManager::Report()
{
Check(this);
//
// Print Report
//
TableIteratorOf<EventStatistics*, long>
iterator(&eventStatisticsSocket);
EventStatistics
*event_statistics;
DEBUG_STREAM << "EventStatisticsManager::Report - event_count="
<< iterator.GetSize() << "\n";
while ((event_statistics = iterator.ReadAndNext()) != NULL)
{
Check(event_statistics);
Registry
*registry;
Entity::SharedData
*shared_data;
Derivation
*derivation;
Receiver::MessageHandlerSet
*handlers;
DEBUG_STREAM << "EventStatisticsManager::Report -\t";
DEBUG_STREAM << event_statistics->classID << "\t";
DEBUG_STREAM << event_statistics->messageID << "\t";
DEBUG_STREAM << event_statistics->eventCount << "\t";
Check(application);
if ((registry = application->GetRegistry()) != NULL)
{
Check(registry);
shared_data = registry->GetStaticData(event_statistics->classID);
if (shared_data != NULL)
{
Check(shared_data);
derivation = shared_data->derivedClasses;
Check(derivation);
handlers = shared_data->activeMessageHandlers;
Check(handlers);
DEBUG_STREAM << derivation->className << "::"
<< handlers->GetName(event_statistics->messageID) << "\t";
}
}
DEBUG_STREAM << "\n";
}
iterator.DeletePlugs();
}
+96
View File
@@ -0,0 +1,96 @@
//===========================================================================//
// File: evtstat.hpp //
// Project: MUNGA Brick: Event Manager //
// Contents: interface specification of event manager //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 05/15/96 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined(EVTSTAT_HPP)
# define EVTSTAT_HPP
# if !defined(STYLE_HPP)
# include <style.hpp>
# endif
# if !defined(RECEIVER_HPP)
# include <receiver.hpp>
# endif
# if !defined(TABLE_HPP)
# include <table.hpp>
# endif
//#########################################################################
//######################## EventStatistics ##########################
//#########################################################################
class EventStatistics:
public Plug
{
friend class EventStatisticsManager;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction, Destruction
//
public:
EventStatistics::EventStatistics(
ClassID class_ID,
Receiver::MessageID message_ID
);
~EventStatistics() {}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Private Data
//
private:
ClassID
classID;
Receiver::MessageID
messageID;
long
eventCount;
};
//#########################################################################
//##################### EventStatisticsManager ######################
//#########################################################################
class EventStatisticsManager:
public Node
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction, Destruction
//
public:
EventStatisticsManager::EventStatisticsManager();
~EventStatisticsManager() {}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Statistic collection and reporting
//
public:
void
Maintain(Event *event);
void
Report();
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Private Data
//
private:
TableOf<EventStatistics*, long>
eventStatisticsSocket;
Logical
printedReport;
};
extern EventStatisticsManager
event_statistics_manager;
#endif
+152
View File
@@ -0,0 +1,152 @@
#include <munga.hpp>
#pragma hdrstop
#if !defined(FILESTRM_HPP)
# include <filestrm.hpp>
#endif
//#############################################################################
//########################### FileStream ################################
//#############################################################################
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
FileStream::FileStream(
const char* file_name,
Logical writable
):
MemoryStream(NULL, 0)
{
Open(file_name, writable);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
FileStream::Open(
const char* file_name,
Logical writable
)
{
readOnly = !writable;
(int)fileHandle = -1;
currentPosition = streamStart = NULL;
streamSize = 0;
if (file_name)
{
Check_Pointer(file_name);
fileHandle = OpenImplementation(file_name, readOnly);
}
if ((int) fileHandle != -1)
{
if (readOnly)
{
streamSize = SeekImplementation(fileHandle, 0, True);
SeekImplementation(fileHandle, 0);
}
else
{
streamSize = 0xFFFFFFFFU;
}
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
FileStream::Close()
{
Check(this);
//
//---------------------------------
// If the file was opened, close it
//---------------------------------
//
if ((int) fileHandle != -1)
{
CloseImplementation(fileHandle);
}
(int)fileHandle = -1;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
FileStream::SetPointer(size_t index)
{
Check(this);
Verify((int) fileHandle != -1);
currentPosition = (char*)SeekImplementation(fileHandle, index);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
MemoryStream&
FileStream::AdvancePointer(size_t index)
{
Check(this);
Verify((int)fileHandle != -1);
currentPosition =
(char*)SeekImplementation(fileHandle, (size_t)currentPosition + index);
return *this;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
MemoryStream&
FileStream::RewindPointer(size_t index)
{
Check(this);
Verify((int)fileHandle != -1);
currentPosition =
(char*)SeekImplementation(fileHandle, (size_t)currentPosition + index);
return *this;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
MemoryStream&
FileStream::ReadBytes(
void *ptr,
size_t number_of_bytes
)
{
Check(this);
Verify((int)fileHandle != -1);
Verify(readOnly);
size_t read = ReadImplementation(fileHandle, ptr, number_of_bytes);
Verify(read == number_of_bytes);
currentPosition += read;
return *this;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
MemoryStream&
FileStream::WriteBytes(
const void *ptr,
size_t number_of_bytes
)
{
Check(this);
Verify((int)fileHandle != -1);
Verify(!readOnly);
size_t written = WriteImplementation(fileHandle, ptr, number_of_bytes);
Verify(written == number_of_bytes);
currentPosition += written;
return *this;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
Logical
FileStream::TestInstance() const
{
return True;
}
+121
View File
@@ -0,0 +1,121 @@
//===========================================================================//
// File: filestrm.hpp //
// Project: MUNGA Brick: Resource Manager //
// Contents: Implementation Details of resource management //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined(FILESTRM_HPP)
# define FILESTRM_HPP
# if !defined(MEMSTRM_HPP)
# include <memstrm.hpp>
# endif
//##########################################################################
//######################## FileStream ################################
//##########################################################################
class FileStream:
public MemoryStream
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Constructors
//
public:
FileStream(
const char* file_name = NULL,
Logical writable = False
);
~FileStream()
{Close();}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Status functions
//
public:
void*
GetPointer() const
{
Fail("No implementation possible for FileStream::GetPointer()");
return NULL;
}
void
SetPointer(void *new_pointer)
{Fail("No implementation possible for FileStream::SetPointer(void*)");}
void
SetPointer(size_t index);
MemoryStream&
AdvancePointer(size_t count);
MemoryStream&
RewindPointer(size_t count);
MemoryStream&
ReadBytes(
void *ptr,
size_t number_of_bytes
);
MemoryStream&
WriteBytes(
const void *ptr,
size_t number_of_bytes
);
void
Open(
const char* file_name = NULL,
Logical writable = False
);
void
Close();
Logical
IsFileOpened()
{return ((int) fileHandle) != -1;}
Logical
TestInstance() const;
static Logical
TestClass();
protected:
void * fileHandle;
Logical readOnly;
static void*
OpenImplementation(
const char* file_name,
Logical read_only
);
static void
CloseImplementation(void * file_handle);
static size_t
SeekImplementation(
void * file_handle,
size_t where,
Logical from_end = False
);
static size_t
ReadImplementation(
void * file_handle,
void *buffer,
size_t length
);
static size_t
WriteImplementation(
void * file_handle,
const void* buffer,
size_t length
);
};
#endif
+52
View File
@@ -0,0 +1,52 @@
//===========================================================================//
// File: filestrm.tcp //
// Project: MUNGA Brick: Filestream Manager //
// Contents: Test stuff for MMIO class //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 4/25/96 JTR Initial Creation //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MMIOstream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
//#############################################################################
//
#include <time.hpp>
Logical
FileStream::TestClass()
{
char buffer[65535];
int i;
float total = 0;
Time s;
FileStream Testit;
memset(buffer,'A',65535);
DEBUG_STREAM << "Starting FileStream test...\n";
for(i=0; i < 1024; i++)
{
s = Now();
Testit.Open("mmiotest.tst",1);
Testit.WriteBytes(buffer,65535);
Testit.Close();
Testit.Open("mmiotest.tst",0);
Testit.ReadBytes(buffer,65535);
Testit.Close();
total += Now() - s;
}
for(i=0; i < 65535; i++) Verify(buffer[i] == 'A');
DEBUG_STREAM << "Opening, writing, closing, opening, reading, and closing\n 64K file 1024 times, averaging out to " << total / 1024.0f << " ticks apiece...\n";
DEBUG_STREAM << "File data checks out, as well...\n";
DEBUG_STREAM << "Leaving FileStream test...\n";
return True;
};
+78
View File
@@ -0,0 +1,78 @@
#include <munga.hpp>
#pragma hdrstop
#if !defined(FILESTRM_HPP)
# include <filestrm.hpp>
#endif
#include <fcntl.h>
#include <io.h>
#include <sys\stat.h>
//#############################################################################
//########################### FileStream ################################
//#############################################################################
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void*
FileStream::OpenImplementation(
const char *file_name,
Logical read_only
)
{
if (read_only)
{
return (void*)open(file_name, O_BINARY|O_RDONLY);
}
else
{
return (void*)
open(file_name, O_BINARY|O_CREAT|O_TRUNC|O_WRONLY, S_IWRITE);
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
FileStream::CloseImplementation(void * file_handle)
{
close((int)file_handle);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
size_t
FileStream::SeekImplementation(
void * file_handle,
size_t where,
Logical from_end
)
{
return lseek((int)file_handle, (long)where, (from_end) ? SEEK_END : SEEK_SET);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
size_t
FileStream::ReadImplementation(
void * file_handle,
void *buffer,
size_t length
)
{
return read((int)file_handle, buffer, length);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
size_t
FileStream::WriteImplementation(
void * file_handle,
const void *buffer,
size_t length
)
{
return write((int)file_handle, buffer, length);
}
+125
View File
@@ -0,0 +1,125 @@
//---------------------------------------------------------------------------
//
// Heap.h -- This file contains the definition for the Base HEAP
// Manager Class. The Base HEAP manager creates,
// manages and destroys block of memory using Win32
// virtual memory calls.
//
// Honor Bound -- FASA Interactive Technologies
//
// Copyright (c) 1995 FASA Interactive Technologies
//
//---------------------------------------------------------------------------
#if !defined(HEAP_HPP)
# define HEAP_HPP
#if !defined(STYLE_HPP)
#include <style.hpp>
#endif
# if !defined(MEMREG_HPP)
# include <memreg.hpp>
# endif
#if defined(MW3)
extern fstream debugfile;
#endif
struct HeapBlock;
struct HeapFreeBlock;
class UserHeap SIGNATURED
{
protected:
char
*bigHeap;
const char
*heapName;
HeapBlock
*heapStart,
*firstNearBlock;
size_t
heapSize,
lowestTotalHeapLeft;
size_t
allocateCount,
releaseCount;
protected:
void
Relink(HeapBlock *newBlock);
void
Unlink(HeapBlock *oldBlock);
void
Sort(HeapBlock *sortBlock);
void
MergeWithLower(HeapBlock *block);
public:
UserHeap(
const char* heap_name,
size_t mem_size
);
~UserHeap();
size_t
GetTotalHeapLeft();
size_t
GetBiggestHeapLeft();
size_t
GetLowestTotalHeapLeft()
{return lowestTotalHeapLeft;}
size_t
GetHeapUsed()
{return heapSize - GetTotalHeapLeft();}
size_t
GetMostHeapUsed()
{return heapSize - lowestTotalHeapLeft;}
Logical
TestHeap(
Logical print_it = False,
Logical skip_allocated = False,
Logical skip_free = False
);
void*
Allocate(size_t mem_size);
void
Release(void *where);
void
ReleaseAll();
Logical
TestInstance() const;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Global memory allocation
//
protected:
static LWord
HeapMark;
Logical
mainHeap;
public:
static UserHeap
MainStorage;
static size_t
GetMainHeapInitialSize();
friend void*
operator new(size_t mem_size);
friend void*
operator new(size_t mem_size, void* where);
friend void
operator delete(void *mem_block);
};
void*
Get_Caller(int levels);
#endif
+56
View File
@@ -0,0 +1,56 @@
//===========================================================================//
// File: host.tst //
// Project: MUNGA Brick: Connection Library //
// Contents: Interface specification for base Host class //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 12/07/94 ECH Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
void
HostManager::TestClass()
{
DEBUG_STREAM << "Starting Host test...\n";
//
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
Host *local_host;
local_host = new Host(
FirstLegalHostID,
GameMachineHostType,
(NetworkAddress)1
);
Register_Object(local_host);
Check(application);
Check(application->GetHostManager());
application->GetHostManager()->AdoptLocalHost(local_host);
//
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
HostID localHostID;
Check(application);
localHostID = application->GetHostManager()->GetLocalHostID();
Verify(localHostID != NullHostID);
//
//--------------------------------------------------------------------
//--------------------------------------------------------------------
//
EntityID newEntityID;
Check(application);
newEntityID = application->GetHostManager()->MakeUniqueEntityID();
Verify(newEntityID != EntityID::Null);
}
+34
View File
@@ -0,0 +1,34 @@
//===========================================================================//
// File: network.hh //
// Project: MUNGA Brick: Network Manager //
// Contents: Interface specification for network brick //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 11/01/94 JMA Initial coding. //
// 11/03/94 ECH Made compatible with BC4.0 //
// 11/03/94 ECH Changed NetworkClient to inherit from Node //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// PROPRIETARY AND CONFIDENTIAL //
//===========================================================================//
#if !defined(HOSTID_HPP)
# define HOSTID_HPP
# if !defined(STYLE_HPP)
# include <style.hpp>
# endif
//
//---------------------------------------------------
// Support types for host manager
//---------------------------------------------------
//
typedef Enumeration HostID;
const HostID NullHostID = 0;
const HostID MapHostID = -1;
const HostID FirstLegalHostID = 1;
#endif
+87
View File
@@ -0,0 +1,87 @@
//=======================================================================//
// File: line.cpp //
// Project: Architecture //
// Author: J.M. Albertson //
//-----------------------------------------------------------------------//
// Copyright (C) 1994, Virtual World Entertainments, All Rights reserved //
// PROPRIETARY AND CONFIDENTIAL //
//=======================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(LINE_HPP)
# include <line.hpp>
#endif
#if !defined(PLANE_HPP)
# include <plane.hpp>
#endif
//
//###########################################################################
//###########################################################################
//
Line&
Line::operator=(const Vector3D &vector)
{
Check_Pointer(this);
Check(&vector);
//
// Make sure length of vector is non-zero
//
length = vector.Length();
Verify(length);
//
// Normalize the vector and put it into the line
//
direction.x = vector.x/length;
direction.y = vector.y/length;
direction.z = vector.z/length;
return *this;
}
//
//###########################################################################
//###########################################################################
//
Line&
Line::operator=(const Point3D &point)
{
Check_Pointer(this);
Check(&point);
//
// Copy the point over into the line.
//
origin.x = point.x;
origin.y = point.y;
origin.z = point.z;
return *this;
}
Scalar
Line::DistanceTo(
const Plane &plane,
Scalar *product
) const
{
*product = direction * plane.normal;
if (Small_Enough(*product))
{
Check_Fpu();
return -1.0f;
}
Scalar result = -plane.DistanceTo(origin) / *product;
Check_Fpu();
return result;
}
Scalar
Line::DistanceTo(
const Sphere &,//sphere,
Scalar *//penetration
) const
{
return -1.0f; // HACK
}
+70
View File
@@ -0,0 +1,70 @@
//=======================================================================//
// File: line.hpp //
// Project: Architecture //
// Author: J.M. Albertson //
//-----------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainments, //
// PROPRIETARY AND CONFIDENTIAL //
//=======================================================================//
#if !defined(LINE_HPP)
# define LINE_HPP
# if !defined(RAY_HPP)
# include <ray.hpp>
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Line3D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Line:
public Ray
{
public:
Scalar
length;
Line() {}
Line(
const Ray &ray,
Scalar length
):
Ray(ray),
length(length)
{}
Line(
const Point3D &start,
const UnitVector &direction,
Scalar length
):
Ray(start,direction),
length(length)
{}
void
FindEnd(Point3D *result)
{Check(this); Check_Pointer(result); Ray::Project(length, result);}
//
// Assignment operators
//
Line&
operator=(const Vector3D &vector);
Line&
operator=(const Point3D &point);
//
// Ray intersection functions
//
Scalar
DistanceTo(
const Plane &plane,
Scalar *product
) const;
Scalar
DistanceTo(
const Sphere &sphere,
Scalar *penetration
) const;
};
#endif
+136
View File
@@ -0,0 +1,136 @@
//===========================================================================//
// File: link.cc //
// Project: MUNGA Brick: Connection Library //
// Contents: Implementation details of base Link //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 09/28/94 ECH Initial coding. //
// 10/20/94 JMA Fixed style stuff. //
// 10/28/94 JMA Made compatible with SGI CC //
// 11/03/94 ECH Made compatible with BC4.0 //
// 12/12/94 ECH Changed release handling //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <munga.hpp>
#pragma hdrstop
#if !defined(LINK_HPP)
#include <link.hpp>
#endif
#if !defined(PLUG_HPP)
#include <plug.hpp>
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//#############################################################################
// Link
//#############################################################################
//
Link::Link(
Socket *socket,
Plug *plug
)
{
this->socket = socket;
this->plug = plug;
//
//----------------------------------------------------
// Add this new link to the plugs current set of links
//----------------------------------------------------
//
AddToPlug(plug);
}
//
//#############################################################################
// ~Link
//#############################################################################
//
Link::~Link()
{
//
//-----------------------------------------------------
// Remove this link from the plugs current set of links
//-----------------------------------------------------
//
ReleaseFromPlug();
}
//
//#############################################################################
// TestInstance
//#############################################################################
//
Logical
Link::TestInstance() const
{
Check_Signature(socket);
Check_Signature(plug);
return True;
}
//
//#############################################################################
// ReleaseFromPlug
//#############################################################################
//
void
Link::ReleaseFromPlug()
{
//
//-----------------------------------------------------
// Remove this link from the plugs current set of links
//-----------------------------------------------------
//
Check(plug);
if (plug->linkHead == this)
{
plug->linkHead = nextLink;
}
if (prevLink != NULL)
{
Check(prevLink);
prevLink->nextLink = nextLink;
}
if (nextLink != NULL)
{
Check(nextLink);
nextLink->prevLink = prevLink;
}
prevLink = nextLink = NULL;
}
//
//#############################################################################
// AddToPlug
//#############################################################################
//
void
Link::AddToPlug(Plug *plug)
{
Verify(plug);
Verify_And_Dump(!Is_Signature_Bad(plug),Is_Signature_Bad(plug));\
Verify((plug)->TestInstance());
Verify(Fpu_Ok());
Check_All_Signatures();
// Check(plug);
if ((nextLink = plug->linkHead) != NULL)
{
Check(nextLink);
nextLink->prevLink = this;
}
this->prevLink = NULL;
plug->linkHead = this;
}

Some files were not shown because too many files have changed in this diff Show More