_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Public Member Functions | List of all members
PaletteSwap Class Reference

A class to encode unit-variable dependent palette swaps. More...

#include <color.h>

Public Member Functions

unsigned int GetUnitVariableIndex ()
 
unsigned int GetColorIndexStart ()
 
unsigned int GetColorCount ()
 
color.h - The A platform independent color.
 PaletteSwap (unsigned int variable, unsigned char colorStart, unsigned char colorCount, unsigned char steps, unsigned char alternatives, std::vector< CColor > &colors)
 
 ~PaletteSwap ()
 
SDL_Color * GetColorsForPercentAndAlternative (unsigned int value, unsigned int max, unsigned int alt)
 

Detailed Description

A class to encode unit-variable dependent palette swaps.

This class encodes a range of colors that should be swapped based on the current percentage of a unit variable, with a resolution of a number of steps and a number of alternative colorings per step.

The colors most be laid out first by step, then alternative, then color.

Constructor & Destructor Documentation

◆ PaletteSwap()

PaletteSwap::PaletteSwap ( unsigned int  variable,
unsigned char  colorStart,
unsigned char  colorCount,
unsigned char  steps,
unsigned char  alternatives,
std::vector< CColor > &  colors 
)

◆ ~PaletteSwap()

PaletteSwap::~PaletteSwap ( )

Member Function Documentation

◆ GetColorCount()

unsigned int PaletteSwap::GetColorCount ( )
inline

◆ GetColorIndexStart()

unsigned int PaletteSwap::GetColorIndexStart ( )
inline

◆ GetColorsForPercentAndAlternative()

SDL_Color * PaletteSwap::GetColorsForPercentAndAlternative ( unsigned int  value,
unsigned int  max,
unsigned int  alt 
)

◆ GetUnitVariableIndex()

unsigned int PaletteSwap::GetUnitVariableIndex ( )
inline

The documentation for this class was generated from the following files:
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.