Graphics Namespace Reference

Graphics functions. More...


Namespaces

namespace  ColorTransformation
 Color transformations.
namespace  SplashEffect
 Splash available effects.

Functions

void FactorizePalette (const u16 *src_palette, u16 *dst_palette, int palette_size, u8 factor, ColorTransformation::mode trans)
 Multiply a palette by a certain factor making colors lighter or darker.
void SplashImage (const unsigned int *bitmap, const unsigned short *palette, Types::Screen::selector screen, int bgid, u8 effect)
 Splash an image in a screen.
void PrintBitmap (int x, int y, int width, int height, const unsigned int *bitmap, unsigned short key_color, int bgid, Types::Screen::selector screen)
 Prints a bitmap from grit in a background.
void PrintBitmapRegion (int dst_x, int dst_y, int region_x, int region_y, int region_width, int region_height, int bmp_width, int bmp_height, const unsigned int *bitmap, unsigned short key_color, int bgid, Types::Screen::selector screen, bool use_key_color=true)
 Print a region of a bitmap in a background.
void RedrawBgRegion (int x, int y, int region_width, int region_height, Types::MainScreenMode::mode screen_mode, GameMode::mode game_mode, int bgid)
 Redraw a region of a background.
void RedrawBgRegion (int x, int y, int region_width, int region_height, Types::SubScreenMode::mode screen_mode, GameMode::mode game_mode, int bgid)
 Redraw a region of a background.
void PrintBitmap (int x, int y, int width, int height, const unsigned char *bitmap, int bgid, Types::Screen::selector screen)
 Print a bitmap in a background.
void Fill (unsigned short color, Types::Screen::selector screen)
 Fill the screen with a color.
unsigned short FindColor (unsigned short color, Types::Screen::selector screen, unsigned short offset=0)
void SetColors ()
 Set black and gray colors variables to render fonts.
const unsigned int * GetBitmapPtr (Types::MainScreenMode::mode screen_mode)
const unsigned short * GetPalPtr (Types::MainScreenMode::mode screen_mode)
const unsigned int * GetBitmapPtr (Types::SubScreenMode::mode screen_mode, GameMode::mode game_mode)
const unsigned short * GetPalPtr (Types::SubScreenMode::mode screen_mode, GameMode::mode game_mode)


Detailed Description

Graphics functions.


Function Documentation

void Graphics::FactorizePalette ( const u16 *  src_palette,
u16 *  dst_palette,
int  palette_size,
u8  factor,
ColorTransformation::mode  trans 
)

Multiply a palette by a certain factor making colors lighter or darker.

Parameters:
src_palette Source color palette.
dst_palette Destination color palette.
palette_size Size in bytes of the palette.
factor Factor to multiply colors by. Value range is [0-256]. As lower it is, the more lighter/darker the colors become.
trans if trans == LIGHTER the palette gets lighter.
if trans == DARKER the palette gets darker.

Definition at line 96 of file graphics.cpp.

Referenced by SplashImage().

unsigned short Graphics::FindColor ( unsigned short  color,
Types::Screen::selector  screen,
unsigned short  offset = 0 
)

Find a color in the palette of the given screen. Optional offset to the start of the palette can be given.

Definition at line 405 of file graphics.cpp.

Referenced by PrintBitmap(), PrintBitmapRegion(), and SetColors().

const unsigned int * Graphics::GetBitmapPtr ( Types::SubScreenMode::mode  screen_mode,
GameMode::mode  game_mode 
)

Get the direction of the background bitmap for the screen mode for the sub screen.

Definition at line 453 of file graphics.cpp.

const unsigned int * Graphics::GetBitmapPtr ( Types::MainScreenMode::mode  screen_mode  ) 

Get the direction of the background bitmap for the screen mode for the main screen.

Definition at line 425 of file graphics.cpp.

Referenced by SubScreenHandler::DrawBgImage(), MainScreenHandler::DrawBgImage(), SubScreenHandler::PrintBoards(), SubScreenHandler::PrintCross(), SubScreenHandler::PrintTick(), and RedrawBgRegion().

const unsigned short * Graphics::GetPalPtr ( Types::SubScreenMode::mode  screen_mode,
GameMode::mode  game_mode 
)

Get the direction of the background palette for the screen mode for the sub screen.

Definition at line 472 of file graphics.cpp.

const unsigned short * Graphics::GetPalPtr ( Types::MainScreenMode::mode  screen_mode  ) 

Get the direction of the background palette for the screen mode for the main screen.

Definition at line 439 of file graphics.cpp.

Referenced by SubScreenHandler::DrawBgImage(), and MainScreenHandler::DrawBgImage().

void Graphics::PrintBitmap ( int  x,
int  y,
int  width,
int  height,
const unsigned char *  bitmap,
int  bgid,
Types::Screen::selector  screen 
)

Print a bitmap in a background.

Function to print a 256-color bitmap of a font glyph converting colors.

Parameters:
x Upper left corner x coordinate where to print the bitmap.
y Upper left corner y coordinate where to print the bitmap.
width Width of the bitmap.
height Height of the bitmap.
bitmap Pointer to an array of 4 bytes words containing the bitmap pixels color palette index.
bgid Background id where to print.
screen Screen where to print in

Definition at line 324 of file graphics.cpp.

Referenced by TextBox::Print().

void Graphics::PrintBitmap ( int  x,
int  y,
int  width,
int  height,
const unsigned int *  bitmap,
unsigned short  key_color,
int  bgid,
Types::Screen::selector  screen 
)

Prints a bitmap from grit in a background.

Parameters:
x Upper left corner x coordinate where to print the bitmap.
y Upper left corner y coordinate where to print the bitmap.
width Width of the bitmap.
height Height of the bitmap.
bitmap Pointer to an array of 4 bytes words containing the bitmap pixels color palette index.
key_color Masking color.
bgid Background id where to print.
screen Screen where to print in

Definition at line 167 of file graphics.cpp.

void Graphics::PrintBitmapRegion ( int  dst_x,
int  dst_y,
int  region_x,
int  region_y,
int  region_width,
int  region_height,
int  bmp_width,
int  bmp_height,
const unsigned int *  bitmap,
unsigned short  key_color,
int  bgid,
Types::Screen::selector  screen,
bool  use_key_color = true 
)

Print a region of a bitmap in a background.

Parameters:
dst_x Upper left corner x coordinate where to print the bitmap.
dst_y Upper left corner y coordinate where to print the bitmap.
region_x Upper left corner x coordinate where the region to print start in the bitmap.
region_y Upper left corner y coordinate where the region to print start in the bitmap.
region_width Width of the region to print.
region_height Height of the region to print.
bmp_width Width of the bitmap.
bmp_height Height of the bitmap.
bitmap Pointer to an array of 4 bytes words containing the source bitmap pixels color palette index.
key_color Masking color.
bgid Background id where to print.
screen Screen where to print in
use_key_color Whether not to print when the given key color is found or not.

Definition at line 246 of file graphics.cpp.

Referenced by SubScreenHandler::PrintCross(), SubScreenHandler::PrintTick(), and RedrawBgRegion().

void Graphics::SplashImage ( const unsigned int *  bitmap,
const unsigned short *  palette,
Types::Screen::selector  screen,
int  bgid,
u8  effect 
)

Splash an image in a screen.

Parameters:
bitmap Bitmap of the image.
palette Palette of the image.
screen Screen selector.
bgid Background where to print ID.
effect Can be either SplashEffect::APPEAR or SplashEffect::DISSOLVE.
Both values can be ORed together. In this case the bitmap will appear and then dissolve.

Definition at line 129 of file graphics.cpp.

Referenced by MainScreenHandler::DrawBgImage().


Generated on Fri Oct 2 10:25:29 2009 for DSMemorizer by  doxygen 1.5.8