Files
CydandClaude Fable 5 fdd9ac9d97 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>
2026-07-02 13:21:58 -05:00

91 lines
2.4 KiB
C++

//===========================================================================//
// File: Rect2D.hh //
// Project: MUNGA Brick: Math Library //
// Contents: Interface specification for two-dimensional rectangle class //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 2/01/95 CPB Initial coding (started from Vector2D.hh) //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All rights reserved //
// PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(RECT2D_HPP)
# define RECT2D_HPP
# if !defined(VECTOR2D_HPP)
# include <vector2d.hpp>
# endif
// Note that the coordinate system used here is such that
// (0,0) is in the lower left corner.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Rectangle2D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Rectangle2D SIGNATURED
{
public:
Vector2DOf<int> bottomLeft, topRight;
Rectangle2D();
Rectangle2D(Vector2DOf<int> bl, Vector2DOf<int> tr);
Rectangle2D(int x1, int y1, int x2, int y2);
~Rectangle2D()
{}
Logical
operator==(const Rectangle2D& r) const
{return ((bottomLeft == r.bottomLeft) && (topRight == r.topRight));}
Logical
operator!=(const Rectangle2D& r) const
{return ((bottomLeft != r.bottomLeft) || (topRight != r.topRight));}
void
Union(
const Rectangle2D& r1,
const Rectangle2D& r2
);
void
Intersection(
const Rectangle2D& r1,
const Rectangle2D& r2
);
void
MakeEmpty()
{
Check(this);
bottomLeft.x = 1;
topRight.x = 0;
}
Logical
IsEmpty() const
{
if ((bottomLeft.x > topRight.x) || (bottomLeft.y > topRight.y))
{
return True;
}
else
{
return False;
}
}
friend ostream&
operator<<(
ostream& stream,
const Rectangle2D& r
);
Logical
TestInstance() const;
static Logical
TestClass();
};
#endif