#include "color.h"
#include "render.h"
Include dependency graph for color.c:
Go to the source code of this file.
Functions | |
Uint32 | ColorBlend (SDL_Color c, SDL_Color d, int partsC, int partsD) |
Blends two device independent colors together and produces a device specific result. | |
void | SetupColorVals () |
Sets the values of colorVals to the corresponding closest color in the current display surface's format. | |
Variables | |
SDL_Color | colorFmtInd [COLOR_MAX] |
An array of display format indepenent colors. | |
Uint32 | colorVals [COLOR_MAX] |
An array of display specific color values. |
Copyright (C) 2007 Jeff Jackowski
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Or visit their website at: http://www.gnu.org/
Definition in file color.c.
Uint32 ColorBlend | ( | SDL_Color | a, | |
SDL_Color | b, | |||
int | partsA, | |||
int | partsB | |||
) |
Blends two device independent colors together and produces a device specific result.
color = ColorBlend(a, b, 2, 3); // color is 2/5 a and 3/5 b
a | One color to blend. | |
b | Another color to blend. | |
partsA | The number of times to count a. | |
partsB | The number of times to count b. |
Definition at line 53 of file color.c.
References dInfo, and DisplayInfo_t::display.
Referenced by TeamSelInit().
void SetupColorVals | ( | ) |
Sets the values of colorVals to the corresponding closest color in the current display surface's format.
This function should be called whenever the display format may have changed.
Definition at line 44 of file color.c.
References COLOR_MAX, colorFmtInd, colorVals, dInfo, and DisplayInfo_t::display.
Referenced by BfldErrResize(), GraphicReset(), main(), MenuRun(), and SplashResize().
SDL_Color colorFmtInd[COLOR_MAX] |
Initial value:
{ { 184, 50, 50, 255 }, { 24, 26, 167, 255 }, { 0, 160, 0, 255 }, { 132, 0, 132, 255 }, { 0, 0, 0, 255 }, { 255, 255, 255, 255 }, { 183, 194, 95, 255 }, { 163, 57, 21, 255 }, { 183, 194, 95, 255 }, { 128, 128, 128, 255 }, { 255, 255, 255, 127 } }
Definition at line 28 of file color.c.
Referenced by AddNotice(), AddPlayer(), BfldErrInit(), BfldErrResize(), GraphicReset(), MenuRootInit(), NetStatUpdate(), RenderLatency(), RenderLocalAddr(), RenderScore(), RenderTSync(), SetupColorVals(), SplashInit(), TeamSelInit(), TextSetupStateMenu(), TextSetupStatePlay(), and TextSetupStateSplash().
Uint32 colorVals[COLOR_MAX] |
An array of display specific color values.
Definition at line 42 of file color.c.
Referenced by AddPlayer(), BfldErrInit(), DrawTank(), GameInit(), GraphicReset(), ObstacleInit(), SetupColorVals(), SetupMenu(), SplashInit(), TeamSelInit(), TeamSelInput(), and TeamSelUninit().