#include <ps2_iconsys.hpp>
Public Member Functions | |
IconSys () | |
Constructor. | |
IconSys (const char *fname) | |
Constructor. | |
~IconSys () | |
Destructor. | |
void | SetToDefault () |
Fills the File structure with default values. | |
char const * | GetTitle () const |
Get the title string as displayed by the PS2s file manager. | |
void | SetTitle (char const *str) |
Set the title string (both S-JIS and ASCII). | |
void | SetLinebreak (int lb) |
Set the title string linebreak. | |
char const * | GetTitleSingleLine () const |
Get the title string without enclosed linebreaks. | |
char const * | GetIconFilename () const |
Get the filename of the standard icon referenced by the file. | |
void | SetIconFilename (char const *fname) |
Set the standard icon filename. | |
char const * | GetIconCopyFilename () const |
Get the filename of the copy icon referenced by the file. | |
void | SetIconCopyFilename (char const *fname) |
Set the copy icon filename. | |
char const * | GetIconDeleteFilename () const |
Get the filename of the delete icon referenced by the file. | |
void | SetIconDeleteFilename (char const *fname) |
Set the delete icon filename. | |
int | GetBackgroundOpacity () const |
Get the background opacity value. | |
void | SetBackgroundOpacity (int i) |
Set the background opacity. | |
IconSys_Color | GetBackgroundColor_UL () const |
Get the color of the upper left corner. | |
void | SetBackgroundColor_UL (IconSys_Color const &c) |
Set the color of the upper left corner. | |
IconSys_Color | GetBackgroundColor_UR () const |
Get the color of the upper right corner. | |
void | SetBackgroundColor_UR (IconSys_Color const &c) |
Set the color of the upper right corner. | |
IconSys_Color | GetBackgroundColor_LL () const |
Get the color of the lower left corner. | |
void | SetBackgroundColor_LL (IconSys_Color const &c) |
Set the color of the lower left corner. | |
IconSys_Color | GetBackgroundColor_LR () const |
Get the color of the lower right corner. | |
void | SetBackgroundColor_LR (IconSys_Color const &c) |
Set the color of the lower right corner. | |
IconSys_LightColor | GetLight1Color () const |
Get the color of light source #1. | |
void | SetLight1Color (IconSys_LightColor const &c) |
Set the color of light source #1. | |
IconSys_LightColor | GetLight2Color () const |
Get the color of light source #2. | |
void | SetLight2Color (IconSys_LightColor const &c) |
Set the color of light source #2. | |
IconSys_LightColor | GetLight3Color () const |
Get the color of light source #3. | |
void | SetLight3Color (IconSys_LightColor const &c) |
Set the color of light source #3. | |
IconSys_LightColor | GetLightAmbientColor () const |
Get the color of the ambient light source. | |
void | SetLightAmbientColor (IconSys_LightColor const &c) |
Set the color of the ambient light source. | |
IconSys_LightVec | GetLight1Dir () const |
Get the direction of light source #1. | |
void | SetLight1Dir (IconSys_LightVec const &v) |
Set the direction of light source #1. | |
IconSys_LightVec | GetLight2Dir () const |
Get the direction of light source #2. | |
void | SetLight2Dir (IconSys_LightVec const &v) |
Set the direction of light source #2. | |
IconSys_LightVec | GetLight3Dir () const |
Get the direction of light source #3. | |
void | SetLight3Dir (IconSys_LightVec const &v) |
Set the direction of light source #3. | |
void | WriteFile (char const *fname) |
Write the current data to a file. | |
Classes | |
struct | File_t |
The main struct resembling a complete icon.sys file. | |
class | IconSys_Color |
This class stores integer color value data. More... | |
class | IconSys_LightColor |
This class stores float color value data. More... | |
class | IconSys_LightVec |
This class stores the light direction vectors. More... |
This class can be used to read and write icon.sys files.
The heart of the class is the File_t struct which resembles a complete icon.sys file on a binary basis. Due to their static structure, icon.sys files can be load by directly reading to a a File_t and written by directly writing from a File_t, which makes the implementation pretty straightforward.
The implementation of the S-JIS/ASCII converter is not very good and far from complete. While it supports all of alphanumeric characters and a few special chars it will certainly fail when encountering some more exotic chars. Feel free to augment/replace the DecodeTitle() function at your needs.
IconSys::IconSys | ( | const char * | fname | ) |
Constructor.
[in] | fname | Complete path to a valid icon.sys file |
Ghulbus::gbException | GB_FAILED indicates either a file read error or corrupt file; |
char const * IconSys::GetTitle | ( | ) | const |
Get the title string as displayed by the PS2s file manager.
void IconSys::SetTitle | ( | char const * | str | ) |
Set the title string (both S-JIS and ASCII).
[in] | str | A null-terminated C-string (at most 32 characters!) |
Ghulbus::gbException | GB_ILLEGALPARAMETER |
void IconSys::SetLinebreak | ( | int | lb | ) |
Set the title string linebreak.
[in] | lb | Position of the linebreak in the ASCII string (0..32) |
Ghulbus::gbException | GB_ILLEGALPARAMETER |
char const * IconSys::GetTitleSingleLine | ( | ) | const |
Get the title string without enclosed linebreaks.
char const * IconSys::GetIconFilename | ( | ) | const |
Get the filename of the standard icon referenced by the file.
void IconSys::SetIconFilename | ( | char const * | fname | ) |
Set the standard icon filename.
[in] | fname | A null-terminated C-string (length at most 32) |
Ghulbus::gbException | GB_ILLEGALPARAMETER |
char const * IconSys::GetIconCopyFilename | ( | ) | const |
Get the filename of the copy icon referenced by the file.
void IconSys::SetIconCopyFilename | ( | char const * | fname | ) |
Set the copy icon filename.
[in] | fname | A null-terminated C-string (length at most 32) |
Ghulbus::gbException | GB_ILLEGALPARAMETER |
char const * IconSys::GetIconDeleteFilename | ( | ) | const |
Get the filename of the delete icon referenced by the file.
void IconSys::SetIconDeleteFilename | ( | char const * | fname | ) |
Set the delete icon filename.
[in] | fname | A null-terminated C-string (length at most 32) |
Ghulbus::gbException | GB_ILLEGALPARAMETER |
int IconSys::GetBackgroundOpacity | ( | ) | const |
Get the background opacity value.
Ghulbus::gbException | GB_FAILED uint overflow; |
void IconSys::SetBackgroundOpacity | ( | int | i | ) |
Set the background opacity.
[in] | i | The new background opacity [0..255] |
Ghulbus::gbException | GB_ILLEGALPARAMETER |
IconSys::IconSys_Color IconSys::GetBackgroundColor_UL | ( | ) | const |
Get the color of the upper left corner.
IconSys::IconSys_Color IconSys::GetBackgroundColor_UR | ( | ) | const |
Get the color of the upper right corner.
IconSys::IconSys_Color IconSys::GetBackgroundColor_LL | ( | ) | const |
Get the color of the lower left corner.
IconSys::IconSys_Color IconSys::GetBackgroundColor_LR | ( | ) | const |
Get the color of the lower right corner.
IconSys::IconSys_LightColor IconSys::GetLight1Color | ( | ) | const |
Get the color of light source #1.
IconSys::IconSys_LightColor IconSys::GetLight2Color | ( | ) | const |
Get the color of light source #2.
IconSys::IconSys_LightColor IconSys::GetLight3Color | ( | ) | const |
Get the color of light source #3.
IconSys::IconSys_LightColor IconSys::GetLightAmbientColor | ( | ) | const |
Get the color of the ambient light source.
IconSys::IconSys_LightVec IconSys::GetLight1Dir | ( | ) | const |
Get the direction of light source #1.
IconSys::IconSys_LightVec IconSys::GetLight2Dir | ( | ) | const |
Get the direction of light source #2.
IconSys::IconSys_LightVec IconSys::GetLight3Dir | ( | ) | const |
Get the direction of light source #3.
void IconSys::WriteFile | ( | char const * | fname | ) |
Write the current data to a file.
[in] | fname | Name of the file to save to |
Ghulbus::gbException | GB_FAILED indicates a file access error; |