|
| 1 | +/* |
| 2 | +** Command & Conquer Generals(tm) |
| 3 | +** Copyright 2025 Electronic Arts Inc. |
| 4 | +** |
| 5 | +** This program is free software: you can redistribute it and/or modify |
| 6 | +** it under the terms of the GNU General Public License as published by |
| 7 | +** the Free Software Foundation, either version 3 of the License, or |
| 8 | +** (at your option) any later version. |
| 9 | +** |
| 10 | +** This program is distributed in the hope that it will be useful, |
| 11 | +** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +** GNU General Public License for more details. |
| 14 | +** |
| 15 | +** You should have received a copy of the GNU General Public License |
| 16 | +** along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +*/ |
| 18 | + |
| 19 | +//////////////////////////////////////////////////////////////////////////////// |
| 20 | +// // |
| 21 | +// (c) 2001-2003 Electronic Arts Inc. // |
| 22 | +// // |
| 23 | +//////////////////////////////////////////////////////////////////////////////// |
| 24 | + |
| 25 | +// FILE: Color.h ////////////////////////////////////////////////////////////// |
| 26 | +//----------------------------------------------------------------------------- |
| 27 | +// |
| 28 | +// Westwood Studios Pacific. |
| 29 | +// |
| 30 | +// Confidential Information |
| 31 | +// Copyright (C) 2001 - All Rights Reserved |
| 32 | +// |
| 33 | +//----------------------------------------------------------------------------- |
| 34 | +// |
| 35 | +// Project: RTS3 |
| 36 | +// |
| 37 | +// File name: Color.h |
| 38 | +// |
| 39 | +// Created: Colin Day, July 2001 |
| 40 | +// |
| 41 | +// Desc: Management of color representations |
| 42 | +// |
| 43 | +//----------------------------------------------------------------------------- |
| 44 | +/////////////////////////////////////////////////////////////////////////////// |
| 45 | + |
| 46 | +#pragma once |
| 47 | + |
| 48 | +// SYSTEM INCLUDES //////////////////////////////////////////////////////////// |
| 49 | + |
| 50 | +// USER INCLUDES ////////////////////////////////////////////////////////////// |
| 51 | +#include "Lib/BaseType.h" |
| 52 | + |
| 53 | +// FORWARD REFERENCES ///////////////////////////////////////////////////////// |
| 54 | + |
| 55 | +// TYPE DEFINES /////////////////////////////////////////////////////////////// |
| 56 | +enum { GAME_COLOR_UNDEFINED = 0x00FFFFFF }; // this is white with zero alpha... safe to use! |
| 57 | + |
| 58 | +/** @todo we need real color representation, this is just palce holder so we |
| 59 | +can more easily identify sections of the code that need it */ |
| 60 | +typedef Int Color; |
| 61 | + |
| 62 | +// INLINING /////////////////////////////////////////////////////////////////// |
| 63 | + |
| 64 | +// EXTERNALS ////////////////////////////////////////////////////////////////// |
| 65 | + |
| 66 | +inline Color GameMakeColor( UnsignedByte red, UnsignedByte green, UnsignedByte blue, UnsignedByte alpha ) |
| 67 | +{ |
| 68 | + return (alpha << 24) | (red << 16) | (green << 8) | (blue); |
| 69 | +} |
| 70 | + |
| 71 | +extern void GameGetColorComponents( Color color, |
| 72 | + UnsignedByte *red, |
| 73 | + UnsignedByte *green, |
| 74 | + UnsignedByte *blue, |
| 75 | + UnsignedByte *alpha ); |
| 76 | + |
| 77 | +// Put on ice until later - M Lorenzen |
| 78 | +//extern void GameGetColorComponentsWithCheatSpy( Color color, |
| 79 | +// UnsignedByte *red, |
| 80 | +// UnsignedByte *green, |
| 81 | +// UnsignedByte *blue, |
| 82 | +// UnsignedByte *alpha ); |
| 83 | + |
| 84 | + |
| 85 | +extern void GameGetColorComponentsReal( Color color, Real *red, Real *green, Real *blue, Real *alpha ); |
| 86 | + |
| 87 | +extern Color GameDarkenColor( Color color, Int percent = 10 ); |
0 commit comments