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

107 lines
3.0 KiB
C++

//===========================================================================//
// 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);
}