1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2025-04-21 12:27:27 +03:00

Improved conversion from color enum to string and vice versa.

The stringToColor() and colorToString() methods were changed into file-scope functions, so they can be inlined by the compiler.
The colorNames array is now used for lookups in both directions, removing duplication of the color names.
The missing "selectionBg" entry was added to the colorNames array.
This commit is contained in:
Maarten ter Huurne
2010-07-28 16:15:52 +02:00
parent c91a190f28
commit b54a595e26
2 changed files with 26 additions and 39 deletions

View File

@@ -52,6 +52,7 @@ extern const char *CARD_ROOT;
extern void jz_cpuspeed(unsigned clockspeed);
// Note: Keep this in sync with colorNames!
enum color {
COLOR_TOP_BAR_BG,
COLOR_BOTTOM_BAR_BG,
@@ -144,9 +145,6 @@ private:
void gp2x_deinit();
void toggleTvOut();
enum color stringToColor(const string &name);
const string &colorToString(enum color);
public:
GMenu2X();
~GMenu2X();