Move cursorPosition and cursorScale from MenuEntryFormat_t to MenuFont_t.

git-svn-id: https://svn.eduke32.com/eduke32@6203 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-06-19 23:06:57 +00:00
parent e51960b3a2
commit 2afdaf5faf
2 changed files with 35 additions and 36 deletions

View file

@ -170,14 +170,14 @@ they effectively stand in for curly braces as struct initializers.
// common font types // common font types
// tilenums are set after namesdyn runs // tilenums are set after namesdyn runs
static MenuFont_t MF_Redfont = { { 5<<16, 15<<16 }, { 0, 0 }, 65536, TEXT_BIGALPHANUM | TEXT_UPPERCASE, -1, 10, 0, 1 }; static MenuFont_t MF_Redfont = { { 5<<16, 15<<16 }, { 0, 0 }, 65536, 20<<16, 110<<16, 65536, TEXT_BIGALPHANUM | TEXT_UPPERCASE, -1, 10, 0, 1 };
static MenuFont_t MF_RedfontBlue = { { 5<<16, 15<<16 }, { 0, 0 }, 65536, TEXT_BIGALPHANUM | TEXT_UPPERCASE, -1, 10, 1, 1 }; static MenuFont_t MF_RedfontBlue = { { 5<<16, 15<<16 }, { 0, 0 }, 65536, 20<<16, 110<<16, 65536, TEXT_BIGALPHANUM | TEXT_UPPERCASE, -1, 10, 1, 1 };
static MenuFont_t MF_RedfontGreen = { { 5<<16, 15<<16 }, { 0, 0 }, 65536, TEXT_BIGALPHANUM | TEXT_UPPERCASE, -1, 10, 8, 1 }; static MenuFont_t MF_RedfontGreen = { { 5<<16, 15<<16 }, { 0, 0 }, 65536, 20<<16, 110<<16, 65536, TEXT_BIGALPHANUM | TEXT_UPPERCASE, -1, 10, 8, 1 };
static MenuFont_t MF_Bluefont = { { 5<<16, 7<<16 }, { -(1<<16), 0 }, 65536, 0, -1, 10, 0, 16 }; static MenuFont_t MF_Bluefont = { { 5<<16, 7<<16 }, { -(1<<16), 0 }, 65536, 10<<16, 110<<16, 32768, 0, -1, 10, 0, 16 };
static MenuFont_t MF_BluefontRed = { { 5<<16, 7<<16 }, { -(1<<16), 0 }, 65536, 0, -1, 10, 10, 16 }; static MenuFont_t MF_BluefontRed = { { 5<<16, 7<<16 }, { -(1<<16), 0 }, 65536, 10<<16, 110<<16, 32768, 0, -1, 10, 10, 16 };
static MenuFont_t MF_Minifont = { { 4<<16, 5<<16 }, { 1<<16, 1<<16 }, 65536, 0, -1, 10, 0, 16 }; static MenuFont_t MF_Minifont = { { 4<<16, 5<<16 }, { 1<<16, 1<<16 }, 65536, 10<<16, 110<<16, 32768, 0, -1, 10, 0, 16 };
static MenuFont_t MF_MinifontRed = { { 4<<16, 5<<16 }, { 1<<16, 1<<16 }, 65536, 0, -1, 16, 21, 16 }; static MenuFont_t MF_MinifontRed = { { 4<<16, 5<<16 }, { 1<<16, 1<<16 }, 65536, 10<<16, 110<<16, 32768, 0, -1, 16, 21, 16 };
static MenuFont_t MF_MinifontDarkGray = { { 4<<16, 5<<16 }, { 1<<16, 1<<16 }, 65536, 0, -1, 10, 13, 16 }; static MenuFont_t MF_MinifontDarkGray = { { 4<<16, 5<<16 }, { 1<<16, 1<<16 }, 65536, 10<<16, 110<<16, 32768, 0, -1, 10, 13, 16 };
static MenuMenuFormat_t MMF_Top_Main = { { MENU_MARGIN_CENTER<<16, 55<<16, }, -(170<<16) }; static MenuMenuFormat_t MMF_Top_Main = { { MENU_MARGIN_CENTER<<16, 55<<16, }, -(170<<16) };
@ -199,25 +199,25 @@ static MenuMenuFormat_t MMF_NetSetup = { { 36<<16,
static MenuMenuFormat_t MMF_FileSelectLeft = { { 40<<16, 45<<16, }, 162<<16 }; static MenuMenuFormat_t MMF_FileSelectLeft = { { 40<<16, 45<<16, }, 162<<16 };
static MenuMenuFormat_t MMF_FileSelectRight = { { 164<<16, 45<<16, }, 162<<16 }; static MenuMenuFormat_t MMF_FileSelectRight = { { 164<<16, 45<<16, }, 162<<16 };
static MenuEntryFormat_t MEF_Null = { 0, 0, 0, 20<<16, 65536 }; static MenuEntryFormat_t MEF_Null = { 0, 0, 0 };
static MenuEntryFormat_t MEF_MainMenu = { 4<<16, 0, 0, 110<<16, 65536 }; static MenuEntryFormat_t MEF_MainMenu = { 4<<16, 0, 0 };
static MenuEntryFormat_t MEF_CenterMenu = { 7<<16, 0, 0, 110<<16, 65536 }; static MenuEntryFormat_t MEF_CenterMenu = { 7<<16, 0, 0 };
static MenuEntryFormat_t MEF_BigOptions = { 4<<16, 0, 190<<16, 20<<16, 65536 }; static MenuEntryFormat_t MEF_BigOptions = { 4<<16, 0, 190<<16 };
static MenuEntryFormat_t MEF_BigOptions_Apply = { 4<<16, 16<<16, 190<<16, 20<<16, 65536 }; static MenuEntryFormat_t MEF_BigOptions_Apply = { 4<<16, 16<<16, 190<<16 };
static MenuEntryFormat_t MEF_BigOptionsRt = { 4<<16, 0,-(260<<16), 20<<16, 65536 }; static MenuEntryFormat_t MEF_BigOptionsRt = { 4<<16, 0, -(260<<16) };
#if defined USE_OPENGL || !defined EDUKE32_ANDROID_MENU #if defined USE_OPENGL || !defined EDUKE32_ANDROID_MENU
static MenuEntryFormat_t MEF_SmallOptions = { 1<<16, 0, 216<<16, 10<<16, 32768 }; static MenuEntryFormat_t MEF_SmallOptions = { 1<<16, 0, 216<<16 };
#endif #endif
static MenuEntryFormat_t MEF_BigCheats = { 3<<16, 0,-(260<<16), 20<<16, 65536 }; static MenuEntryFormat_t MEF_BigCheats = { 3<<16, 0, -(260<<16) };
static MenuEntryFormat_t MEF_Cheats = { 2<<16, 0,-(260<<16), 10<<16, 32768 }; static MenuEntryFormat_t MEF_Cheats = { 2<<16, 0, -(260<<16) };
static MenuEntryFormat_t MEF_PlayerNarrow = { 1<<16, 0, 90<<16, 10<<16, 32768 }; static MenuEntryFormat_t MEF_PlayerNarrow = { 1<<16, 0, 90<<16 };
static MenuEntryFormat_t MEF_Macros = { 2<<16, -1, 268<<16, 10<<16, 32768 }; static MenuEntryFormat_t MEF_Macros = { 2<<16, -1, 268<<16 };
static MenuEntryFormat_t MEF_VideoSetup = { 4<<16, 0, 168<<16, 20<<16, 65536 }; static MenuEntryFormat_t MEF_VideoSetup = { 4<<16, 0, 168<<16 };
static MenuEntryFormat_t MEF_FuncList = { 3<<16, 0, 100<<16, 10<<16, 32768 }; static MenuEntryFormat_t MEF_FuncList = { 3<<16, 0, 100<<16 };
static MenuEntryFormat_t MEF_ColorCorrect = { 2<<16, 0,-(240<<16), 20<<16, 65536 }; static MenuEntryFormat_t MEF_ColorCorrect = { 2<<16, 0, -(240<<16) };
static MenuEntryFormat_t MEF_BigSliders = { 2<<16, 0, 170<<16, 20<<16, 65536 }; static MenuEntryFormat_t MEF_BigSliders = { 2<<16, 0, 170<<16 };
static MenuEntryFormat_t MEF_LoadSave = { 7<<16, -1, 78<<16, 20<<16, 65536 }; static MenuEntryFormat_t MEF_LoadSave = { 7<<16, -1, 78<<16 };
static MenuEntryFormat_t MEF_NetSetup = { 4<<16, 0, 112<<16, 20<<16, 65536 }; static MenuEntryFormat_t MEF_NetSetup = { 4<<16, 0, 112<<16 };
// common menu option sets // common menu option sets
#define MAKE_MENUOPTIONSET(optionNames, optionValues, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, ARRAY_SIZE(optionNames), -1, 0, features } #define MAKE_MENUOPTIONSET(optionNames, optionValues, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, ARRAY_SIZE(optionNames), -1, 0, features }
@ -4051,11 +4051,11 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
{ {
if (status & MT_XCenter) if (status & MT_XCenter)
{ {
rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) + entry->format->cursorPosition, origin.y + y_upper + y + (height>>1) - menu->scrollPos, entry->format->cursorScale, 0, SPINNINGNUKEICON+6-((6+(totalclock>>3))%7), cursorShade, 0, 10); rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) + entry->font->cursorCenterPosition, origin.y + y_upper + y + (height>>1) - menu->scrollPos, entry->font->cursorScale, 0, SPINNINGNUKEICON+6-((6+(totalclock>>3))%7), cursorShade, 0, 10);
rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) - entry->format->cursorPosition, origin.y + y_upper + y + (height>>1) - menu->scrollPos, entry->format->cursorScale, 0, SPINNINGNUKEICON+((totalclock>>3)%7), cursorShade, 0, 10); rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) - entry->font->cursorCenterPosition, origin.y + y_upper + y + (height>>1) - menu->scrollPos, entry->font->cursorScale, 0, SPINNINGNUKEICON+((totalclock>>3)%7), cursorShade, 0, 10);
} }
else else
rotatesprite_fs(origin.x + x - entry->format->cursorPosition, origin.y + y_upper + y + (height>>1) - menu->scrollPos, entry->format->cursorScale, 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10); rotatesprite_fs(origin.x + x - entry->font->cursorLeftPosition, origin.y + y_upper + y + (height>>1) - menu->scrollPos, entry->font->cursorScale, 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10);
} }
// need this up here to avoid race conditions // need this up here to avoid race conditions
@ -4235,7 +4235,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
MenuRangeInt32_t *object = (MenuRangeInt32_t*)entry->entry; MenuRangeInt32_t *object = (MenuRangeInt32_t*)entry->entry;
int32_t s, p; int32_t s, p;
const int32_t z = entry->format->cursorScale; const int32_t z = entry->font->cursorScale;
Menu_ShadePal(object->font, status, &s, &p); Menu_ShadePal(object->font, status, &s, &p);
const int32_t slidebarwidth = scale(tilesiz[SLIDEBAR].x<<16, z, 65536); const int32_t slidebarwidth = scale(tilesiz[SLIDEBAR].x<<16, z, 65536);
@ -4330,7 +4330,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
MenuRangeFloat_t *object = (MenuRangeFloat_t*)entry->entry; MenuRangeFloat_t *object = (MenuRangeFloat_t*)entry->entry;
int32_t s, p; int32_t s, p;
const int32_t z = entry->format->cursorScale; const int32_t z = entry->font->cursorScale;
Menu_ShadePal(object->font, status, &s, &p); Menu_ShadePal(object->font, status, &s, &p);
const int32_t slidebarwidth = scale(tilesiz[SLIDEBAR].x<<16, z, 65536); const int32_t slidebarwidth = scale(tilesiz[SLIDEBAR].x<<16, z, 65536);
@ -4425,7 +4425,7 @@ static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *current
MenuRangeDouble_t *object = (MenuRangeDouble_t*)entry->entry; MenuRangeDouble_t *object = (MenuRangeDouble_t*)entry->entry;
int32_t s, p; int32_t s, p;
const int32_t z = entry->format->cursorScale; const int32_t z = entry->font->cursorScale;
Menu_ShadePal(object->font, status, &s, &p); Menu_ShadePal(object->font, status, &s, &p);
const int32_t slidebarwidth = scale(tilesiz[SLIDEBAR].x<<16, z, 65536); const int32_t slidebarwidth = scale(tilesiz[SLIDEBAR].x<<16, z, 65536);
@ -4662,11 +4662,11 @@ static void Menu_RunOptionList(Menu_t *cm, MenuEntry_t *entry, MenuOption_t *obj
{ {
if (status & MT_XCenter) if (status & MT_XCenter)
{ {
rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) + object->options->entryFormat->cursorPosition, origin.y + y_upper + y + (height>>1) - object->options->scrollPos, object->options->entryFormat->cursorScale, 0, SPINNINGNUKEICON+6-((6+(totalclock>>3))%7), cursorShade, 0, 10); rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) + object->options->font->cursorCenterPosition, origin.y + y_upper + y + (height>>1) - object->options->scrollPos, object->options->font->cursorScale, 0, SPINNINGNUKEICON+6-((6+(totalclock>>3))%7), cursorShade, 0, 10);
rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) - object->options->entryFormat->cursorPosition, origin.y + y_upper + y + (height>>1) - object->options->scrollPos, object->options->entryFormat->cursorScale, 0, SPINNINGNUKEICON+((totalclock>>3)%7), cursorShade, 0, 10); rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16) - object->options->font->cursorCenterPosition, origin.y + y_upper + y + (height>>1) - object->options->scrollPos, object->options->font->cursorScale, 0, SPINNINGNUKEICON+((totalclock>>3)%7), cursorShade, 0, 10);
} }
else else
rotatesprite_fs(origin.x + x - object->options->entryFormat->cursorPosition, origin.y + y_upper + y + (height>>1) - object->options->scrollPos, object->options->entryFormat->cursorScale, 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10); rotatesprite_fs(origin.x + x - object->options->font->cursorLeftPosition, origin.y + y_upper + y + (height>>1) - object->options->scrollPos, object->options->font->cursorScale, 0, SPINNINGNUKEICON+(((totalclock>>3))%7), cursorShade, 0, 10);
} }
if (dodraw) if (dodraw)

View file

@ -121,6 +121,7 @@ typedef struct MenuFont_t
{ {
vec2_t emptychar, between; vec2_t emptychar, between;
int32_t zoom; int32_t zoom;
int32_t cursorLeftPosition, cursorCenterPosition, cursorScale;
int32_t textflags; int32_t textflags;
int16_t tilenum; int16_t tilenum;
int8_t shade_deselected; // selected entries are mandated to glow int8_t shade_deselected; // selected entries are mandated to glow
@ -149,8 +150,6 @@ typedef struct MenuEntryFormat_t
int32_t marginBottom; int32_t marginBottom;
int32_t indent; int32_t indent;
int32_t width; // 0: center, >0: width of the label column (left-aligned options), <0: -width of everything (right-aligned) int32_t width; // 0: center, >0: width of the label column (left-aligned options), <0: -width of everything (right-aligned)
int32_t cursorPosition, cursorScale;
} MenuEntryFormat_t; } MenuEntryFormat_t;