color.h File Reference

Interface to utility code to handle common colors and setting up device specific color values. More...

#include <SDL.h>

Include dependency graph for color.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  {
  COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_PURPLE,
  COLOR_BLACK, COLOR_WHITE, COLOR_REGBACK, COLOR_PONGBACK,
  COLOR_BACK, COLOR_OBSTACLE, COLOR_TEXT, COLOR_MAX
}
 Indecies into an array of color values. More...

Functions

Uint32 ColorBlend (SDL_Color a, SDL_Color b, int partsA, int partsB)
 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.


Detailed Description

Interface to utility code to handle common colors and setting up device specific color values.

Author:
Jeff Jackowski (jeffj@ro.com)
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.h.


Enumeration Type Documentation

anonymous enum

Indecies into an array of color values.

Enumerator:
COLOR_RED  Display format independent color for the red team.
COLOR_BLUE  Display format independent color for the blue team.
COLOR_GREEN  Display format independent color for the green team.
COLOR_PURPLE  Display format independent color for the purple team.
COLOR_BLACK  Display format independent color for black.
COLOR_WHITE  Display format independent color for white.
COLOR_REGBACK  Display format independent color for regular game background.
COLOR_PONGBACK  Display format independent color for pong tank background.
COLOR_BACK  Background.
COLOR_OBSTACLE  Obstacle color.
COLOR_TEXT  Color for text messages.
COLOR_MAX 

Definition at line 30 of file color.h.


Function Documentation

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
Parameters:
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.
Returns:
The device specific color.
Author:
Jeff Jackowski

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.

Author:
Jeff Jackowski

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().


Variable Documentation

SDL_Color colorFmtInd[COLOR_MAX]

An array of display format indepenent colors.

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().


Generated on Mon May 28 04:41:39 2007 for Retro Tank Super Attack by  doxygen 1.5.2