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>
98 lines
2.9 KiB
C++
98 lines
2.9 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
//
|
|
//###########################################################################
|
|
//###########################################################################
|
|
//
|
|
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);
|
|
}
|
|
|