PaletteManager Class Reference

#include <PaletteManager.h>

List of all members.

Public Types

 Pal_Game = 0
 Pal_Movie = 1
 Pal_JPFontStart = 16
enum  PalIndex { Pal_Game = 0, Pal_Movie = 1, Pal_JPFontStart = 16 }

Public Member Functions

 PaletteManager (RenderSurface *rs)
 ~PaletteManager ()
void load (PalIndex index, IDataSource &ds, IDataSource &xformds)
void load (PalIndex index, IDataSource &ds)
Pentagram::PalettegetPalette (PalIndex index)
void duplicate (PalIndex src, PalIndex dest)
void updatedFont (PalIndex index)
void transformPalette (PalIndex index, sint16 matrix[12])
void untransformPalette (PalIndex index)
void RenderSurfaceChanged (RenderSurface *rs)
void reset ()
void resetTransforms ()

Static Public Member Functions

static PaletteManagerget_instance ()
static void getTransformMatrix (sint16 matrix[12], Pentagram::PalTransforms trans)
static void getTransformMatrix (sint16 matrix[12], uint32 col32)

Private Attributes

std::vector< Pentagram::Palette * > palettes
RenderSurfacerendersurface

Static Private Attributes

static PaletteManagerpalettemanager = 0


Detailed Description

Definition at line 28 of file PaletteManager.h.


Member Enumeration Documentation

enum PaletteManager::PalIndex

Enumerator:
Pal_Game 
Pal_Movie 
Pal_JPFontStart 

Definition at line 36 of file PaletteManager.h.


Constructor & Destructor Documentation

PaletteManager::PaletteManager ( RenderSurface rs  )  [explicit]

Definition at line 28 of file PaletteManager.cpp.

References con, MM_INFO, palettemanager, and Console::Print().

PaletteManager::~PaletteManager (  ) 

Definition at line 37 of file PaletteManager.cpp.

References con, MM_INFO, palettemanager, Console::Print(), and reset().


Member Function Documentation

void PaletteManager::duplicate ( PalIndex  src,
PalIndex  dest 
)

Definition at line 120 of file PaletteManager.cpp.

References RenderSurface::CreateNativePalette(), getPalette(), palettes, and rendersurface.

Referenced by FontManager::addJPOverride().

static PaletteManager* PaletteManager::get_instance (  )  [inline, static]

Definition at line 34 of file PaletteManager.h.

References palettemanager.

Referenced by FontManager::addJPOverride(), JPRenderedText::draw(), JPRenderedText::drawBlended(), GUIApp::load(), U8Game::loadFiles(), RemorseGame::loadFiles(), GameData::loadRemorseData(), GameData::loadU8Data(), PaletteFaderProcess::PaletteFaderProcess(), SKFPlayer::run(), PaletteFaderProcess::run(), GUIApp::save(), and ShapeViewerGump::U8ShapeViewer().

Pentagram::Palette * PaletteManager::getPalette ( PalIndex  index  ) 

Definition at line 135 of file PaletteManager.cpp.

References palettes.

Referenced by FontManager::addJPOverride(), JPRenderedText::draw(), JPRenderedText::drawBlended(), duplicate(), GUIApp::load(), PaletteFaderProcess::PaletteFaderProcess(), SKFPlayer::run(), GUIApp::save(), transformPalette(), untransformPalette(), and updatedFont().

void PaletteManager::getTransformMatrix ( sint16  matrix[12],
uint32  col32 
) [static]

Definition at line 286 of file PaletteManager.cpp.

void PaletteManager::getTransformMatrix ( sint16  matrix[12],
Pentagram::PalTransforms  trans 
) [static]

Definition at line 165 of file PaletteManager.cpp.

References perr, Pentagram::Transform_BRG, Pentagram::Transform_FireStorm, Pentagram::Transform_GBR, Pentagram::Transform_Greyscale, Pentagram::Transform_None, Pentagram::Transform_NoRed, Pentagram::Transform_RainStorm, and Pentagram::Transform_Saturate.

Referenced by PaletteFaderProcess::PaletteFaderProcess(), resetTransforms(), and untransformPalette().

void PaletteManager::load ( PalIndex  index,
IDataSource ds 
)

Definition at line 105 of file PaletteManager.cpp.

References RenderSurface::CreateNativePalette(), pal, palettes, and rendersurface.

void PaletteManager::load ( PalIndex  index,
IDataSource ds,
IDataSource xformds 
)

Definition at line 90 of file PaletteManager.cpp.

References RenderSurface::CreateNativePalette(), pal, palettes, and rendersurface.

Referenced by U8Game::loadFiles(), RemorseGame::loadFiles(), and SKFPlayer::run().

void PaletteManager::RenderSurfaceChanged ( RenderSurface rs  ) 

Change the Render Surface used by the PaletteManager.

Definition at line 80 of file PaletteManager.cpp.

References RenderSurface::CreateNativePalette(), palettes, and rendersurface.

Referenced by GUIApp::GraphicSysInit().

void PaletteManager::reset (  ) 

Reset the Palette Manager.

Definition at line 45 of file PaletteManager.cpp.

References con, MM_INFO, palettes, and Console::Print().

Referenced by GUIApp::shutdownGame(), and ~PaletteManager().

void PaletteManager::resetTransforms (  ) 

Reset all the transforms back to default.

Definition at line 62 of file PaletteManager.cpp.

References con, RenderSurface::CreateNativePalette(), getTransformMatrix(), MM_INFO, pal, palettes, Console::Print(), rendersurface, and Pentagram::Transform_None.

Referenced by GUIApp::resetEngine().

void PaletteManager::transformPalette ( PalIndex  index,
sint16  matrix[12] 
)

Apply a transform matrix to a palette (-4.11 fixed).

Definition at line 143 of file PaletteManager.cpp.

References RenderSurface::CreateNativePalette(), getPalette(), pal, and rendersurface.

Referenced by GUIApp::load(), PaletteFaderProcess::run(), and untransformPalette().

void PaletteManager::untransformPalette ( PalIndex  index  ) 

reset the transformation matrix of a palette

Definition at line 153 of file PaletteManager.cpp.

References getPalette(), getTransformMatrix(), pal, Pentagram::Transform_None, and transformPalette().

void PaletteManager::updatedFont ( PalIndex  index  ) 

Re-convert a palette to native format after modifying it.

Definition at line 54 of file PaletteManager.cpp.

References RenderSurface::CreateNativePalette(), getPalette(), pal, and rendersurface.

Referenced by FontManager::addJPOverride().


Member Data Documentation

PaletteManager * PaletteManager::palettemanager = 0 [static, private]

Definition at line 78 of file PaletteManager.h.

Referenced by get_instance(), PaletteManager(), and ~PaletteManager().

std::vector<Pentagram::Palette*> PaletteManager::palettes [private]

Definition at line 75 of file PaletteManager.h.

Referenced by duplicate(), getPalette(), load(), RenderSurfaceChanged(), reset(), and resetTransforms().

RenderSurface* PaletteManager::rendersurface [private]

Definition at line 76 of file PaletteManager.h.

Referenced by duplicate(), load(), RenderSurfaceChanged(), resetTransforms(), transformPalette(), and updatedFont().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:45 2007 for pentagram by  doxygen 1.4.7