Added 'b' option to use PC Menus (text). See TODO for limitations
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@534 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.2:
|
Changes towards version 0.2:
|
||||||
|
- Added '-b' option to get PC Menus -PhracturedBlue
|
||||||
- Check for a deadlock in savedgames and try to continue -PhracturedBlue
|
- Check for a deadlock in savedgames and try to continue -PhracturedBlue
|
||||||
- Added an option ('-a') to display 'PC-style' course-scan -PhracturedBlue
|
- Added an option ('-a') to display 'PC-style' course-scan -PhracturedBlue
|
||||||
- Fixed deadlock races in new FlushGraphics method -PhracturedBlue
|
- Fixed deadlock races in new FlushGraphics method -PhracturedBlue
|
||||||
|
|||||||
@@ -86,7 +86,10 @@ Implementation bugs (low priority):
|
|||||||
- Melee scaling currently causes some very small objects like Ur-Quan fighters
|
- Melee scaling currently causes some very small objects like Ur-Quan fighters
|
||||||
to disappear sometimes. The scaling should be made trilinear instead of
|
to disappear sometimes. The scaling should be made trilinear instead of
|
||||||
nearest neighbor.
|
nearest neighbor.
|
||||||
|
- PC Menu still has some issues
|
||||||
|
- 3DO menu is still used for selecting game options
|
||||||
|
- Menu Font is wrong (the PC font doesn't appear to exist in UQM)
|
||||||
|
- Still using 3DO menu hierarchy, so menu text isn't identical to PC
|
||||||
Stuff still to do (large):
|
Stuff still to do (large):
|
||||||
- add some way to configure your keys
|
- add some way to configure your keys
|
||||||
(assigned to mstr)
|
(assigned to mstr)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ int optWhichMusic = MUSIC_3DO;
|
|||||||
char *configDir, *saveDir, *meleeDir;
|
char *configDir, *saveDir, *meleeDir;
|
||||||
BOOLEAN optSubtitles = TRUE;
|
BOOLEAN optSubtitles = TRUE;
|
||||||
BOOLEAN optPCscan = FALSE;
|
BOOLEAN optPCscan = FALSE;
|
||||||
|
BOOLEAN optPCmenu = FALSE;
|
||||||
|
|
||||||
void
|
void
|
||||||
prepareConfigDir (void) {
|
prepareConfigDir (void) {
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ extern BOOLEAN optSubtitles;
|
|||||||
|
|
||||||
extern BOOLEAN optPCscan;
|
extern BOOLEAN optPCscan;
|
||||||
|
|
||||||
|
extern BOOLEAN optPCmenu;
|
||||||
|
|
||||||
extern char *configDir;
|
extern char *configDir;
|
||||||
extern char *meleeDir;
|
extern char *meleeDir;
|
||||||
extern char *saveDir;
|
extern char *saveDir;
|
||||||
|
|||||||
@@ -1554,7 +1554,7 @@ BatchGraphics ();
|
|||||||
{
|
{
|
||||||
RepairSISBorder ();
|
RepairSISBorder ();
|
||||||
ClearSemaphore (GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DrawMenuStateStrings ((BYTE)~0, (BYTE)~0);
|
DrawMenuStateStrings ((BYTE)~0, 1);
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
}
|
}
|
||||||
else /* in starbase */
|
else /* in starbase */
|
||||||
|
|||||||
@@ -1560,7 +1560,7 @@ UnbatchGraphics ();
|
|||||||
MenuState.Initialized = 1;
|
MenuState.Initialized = 1;
|
||||||
MenuState.CurState = STARMAP + 1;
|
MenuState.CurState = STARMAP + 1;
|
||||||
|
|
||||||
DrawMenuStateStrings (PM_SCAN, STARMAP);
|
DrawMenuStateStrings (PM_STARMAP, STARMAP);
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
SetFlashRect ((PRECT)~0L, (FRAME)0);
|
||||||
ClearSemaphore (GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
|
|||||||
@@ -1313,7 +1313,8 @@ DoFlagshipCommands (INPUT_STATE InputState, PMENU_STATE pMS)
|
|||||||
if (InputState & DEVICE_BUTTON1)
|
if (InputState & DEVICE_BUTTON1)
|
||||||
{
|
{
|
||||||
pMS->CurState = (NAVIGATION) + 1;
|
pMS->CurState = (NAVIGATION) + 1;
|
||||||
DrawMenuStateStrings (PM_SCAN, NAVIGATION);
|
DrawMenuStateStrings ((BYTE)(pMS->Initialized <= 1 ? PM_STARMAP : PM_SCAN),
|
||||||
|
NAVIGATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1321,7 +1322,7 @@ DoFlagshipCommands (INPUT_STATE InputState, PMENU_STATE pMS)
|
|||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
SetFlashRect (NULL_PTR, (FRAME)0);
|
SetFlashRect (NULL_PTR, (FRAME)0);
|
||||||
ClearSemaphore (GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DrawMenuStateStrings (PM_SCAN, NAVIGATION);
|
DrawMenuStateStrings (PM_STARMAP, -NAVIGATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1344,7 +1345,8 @@ DoFlagshipCommands (INPUT_STATE InputState, PMENU_STATE pMS)
|
|||||||
|
|
||||||
if (NewState != pMS->CurState)
|
if (NewState != pMS->CurState)
|
||||||
{
|
{
|
||||||
DrawMenuStateStrings (PM_SCAN, (BYTE)(NewState - 1));
|
DrawMenuStateStrings ((BYTE)(pMS->Initialized <= 1 ? PM_STARMAP : PM_SCAN),
|
||||||
|
(BYTE)(NewState - 1));
|
||||||
|
|
||||||
pMS->CurState = NewState;
|
pMS->CurState = NewState;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1184,7 +1184,7 @@ TheMess:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClearSemaphore (GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DrawMenuStateStrings (PM_SCAN, STARMAP);
|
DrawMenuStateStrings (PM_STARMAP, STARMAP);
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
pSolarSysState->MenuState.CurState = STARMAP + 1;
|
pSolarSysState->MenuState.CurState = STARMAP + 1;
|
||||||
}
|
}
|
||||||
@@ -1261,7 +1261,7 @@ StartGroups:
|
|||||||
++pSolarSysState->MenuState.Initialized;
|
++pSolarSysState->MenuState.Initialized;
|
||||||
if (pSolarSysState->MenuState.flash_task == 0)
|
if (pSolarSysState->MenuState.flash_task == 0)
|
||||||
{
|
{
|
||||||
DrawMenuStateStrings (PM_SCAN, PM_NAVIGATE - PM_SCAN);
|
DrawMenuStateStrings (PM_STARMAP, -(PM_NAVIGATE - PM_SCAN));
|
||||||
|
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
RepairSISBorder ();
|
RepairSISBorder ();
|
||||||
|
|||||||
+129
-4
@@ -20,6 +20,7 @@
|
|||||||
#include "commglue.h"
|
#include "commglue.h"
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
#include "libs/tasklib.h"
|
#include "libs/tasklib.h"
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
RepairSISBorder (void)
|
RepairSISBorder (void)
|
||||||
@@ -73,7 +74,7 @@ ClearSISRect (BYTE ClearFlags)
|
|||||||
if (ClearFlags & CLEAR_SIS_RADAR)
|
if (ClearFlags & CLEAR_SIS_RADAR)
|
||||||
{
|
{
|
||||||
ClearSemaphore (GraphicsSem);
|
ClearSemaphore (GraphicsSem);
|
||||||
DrawMenuStateStrings ((BYTE)~0, (BYTE)~0);
|
DrawMenuStateStrings ((BYTE)~0, 1);
|
||||||
SetSemaphore (GraphicsSem);
|
SetSemaphore (GraphicsSem);
|
||||||
#ifdef NEVER
|
#ifdef NEVER
|
||||||
r.corner.x = RADAR_X - 1;
|
r.corner.x = RADAR_X - 1;
|
||||||
@@ -1032,6 +1033,9 @@ SetFlashRect (PRECT pRect, FRAME f)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//Don't flash when using the PC menu
|
||||||
|
if (optPCmenu)
|
||||||
|
return;
|
||||||
OldContext = SetContext (StatusContext);
|
OldContext = SetContext (StatusContext);
|
||||||
GetContextClipRect (&clip_r);
|
GetContextClipRect (&clip_r);
|
||||||
pRect = &temp_r;
|
pRect = &temp_r;
|
||||||
@@ -1089,20 +1093,128 @@ SetFlashRect (PRECT pRect, FRAME f)
|
|||||||
SetContext (OldContext);
|
SetContext (OldContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
DrawPCMenuFrame (RECT *r)
|
||||||
|
{
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x0F, 0x0F, 0x0F), 0x08));
|
||||||
|
DrawRectangle (r);
|
||||||
|
r->corner.x++;
|
||||||
|
r->corner.y++;
|
||||||
|
r->extent.height--;
|
||||||
|
r->extent.width--;
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x06, 0x06, 0x06), 0x08));
|
||||||
|
DrawRectangle (r);
|
||||||
|
r->extent.height--;
|
||||||
|
r->extent.width--;
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x15), 0x08));
|
||||||
|
DrawFilledRectangle (r);
|
||||||
|
}
|
||||||
|
|
||||||
|
static char menu_string[][11] = {
|
||||||
|
"SCAN",
|
||||||
|
"STARMAP",
|
||||||
|
"DEVICES",
|
||||||
|
"CARGO",
|
||||||
|
"ROSTER",
|
||||||
|
"GAME",
|
||||||
|
"NAVIGATE",
|
||||||
|
|
||||||
|
"MINERAL",
|
||||||
|
"ENERGY",
|
||||||
|
"BIOLOGICAL",
|
||||||
|
"EXIT MENU",
|
||||||
|
"AUTO SCAN",
|
||||||
|
"DISPATCH",
|
||||||
|
|
||||||
|
"SAVE GAME",
|
||||||
|
"LOAD GAME",
|
||||||
|
"SETTINGS",
|
||||||
|
"EXIT MENU",
|
||||||
|
|
||||||
|
"CONVERSE",
|
||||||
|
"ATTACK!",
|
||||||
|
"GAME",
|
||||||
|
|
||||||
|
"FUEL",
|
||||||
|
"MODULE",
|
||||||
|
"GAME",
|
||||||
|
"EXIT MENU",
|
||||||
|
|
||||||
|
"CREW",
|
||||||
|
"GAME",
|
||||||
|
"EXIT MENU",
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
DrawPCMenu (BYTE beg_index, BYTE end_index, BYTE NewState, BYTE hilite, RECT *r)
|
||||||
|
{
|
||||||
|
#define PC_MENU_HEIGHT 8
|
||||||
|
BYTE pos;
|
||||||
|
COUNT i;
|
||||||
|
int num_items, offset;
|
||||||
|
FONT OldFont;
|
||||||
|
TEXT t;
|
||||||
|
UNICODE buf[40];
|
||||||
|
pos = beg_index + NewState;
|
||||||
|
num_items = 1 + end_index - beg_index;
|
||||||
|
DrawFilledRectangle (r);
|
||||||
|
r->corner.x += 1;
|
||||||
|
r->extent.width -= 1;
|
||||||
|
if (num_items * PC_MENU_HEIGHT > r->extent.height)
|
||||||
|
fprintf (stderr, "Warning, no room for all menu items!\n");
|
||||||
|
else
|
||||||
|
r->corner.y += (r->extent.height - num_items * PC_MENU_HEIGHT) / 2;
|
||||||
|
r->extent.height = num_items * PC_MENU_HEIGHT + 4;
|
||||||
|
DrawPCMenuFrame (r);
|
||||||
|
OldFont = SetContextFont (TinyFont);
|
||||||
|
t.align = ALIGN_LEFT;
|
||||||
|
t.baseline.x = r->corner.x + 3;
|
||||||
|
t.baseline.y = r->corner.y + PC_MENU_HEIGHT -1;
|
||||||
|
t.pStr = buf;
|
||||||
|
t.CharCount = (COUNT)~0;
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x15, 0x15), 0x08));
|
||||||
|
for (i = beg_index; i <= end_index; i++)
|
||||||
|
{
|
||||||
|
wsprintf (buf, menu_string[i]);
|
||||||
|
if (hilite && pos == i)
|
||||||
|
{
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x0A, 0x0A, 0x1F), 0x08));
|
||||||
|
r->corner.y = t.baseline.y - PC_MENU_HEIGHT + 1;
|
||||||
|
r->extent.height = PC_MENU_HEIGHT;
|
||||||
|
DrawFilledRectangle (r);
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x0A, 0x1F, 0x1F), 0x08));
|
||||||
|
DrawText (&t);
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x15, 0x15), 0x08));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DrawText (&t);
|
||||||
|
t.baseline.y += PC_MENU_HEIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
void
|
void
|
||||||
DrawMenuStateStrings (BYTE beg_index, BYTE NewState)
|
DrawMenuStateStrings (BYTE beg_index, SWORD NewState)
|
||||||
{
|
{
|
||||||
BYTE end_index;
|
BYTE end_index;
|
||||||
RECT r;
|
RECT r;
|
||||||
STAMP s;
|
STAMP s;
|
||||||
CONTEXT OldContext;
|
CONTEXT OldContext;
|
||||||
|
BYTE hilite = 1;
|
||||||
extern FRAME PlayFrame;
|
extern FRAME PlayFrame;
|
||||||
|
|
||||||
|
if (NewState < 0)
|
||||||
|
{
|
||||||
|
NewState = - NewState;
|
||||||
|
hilite = 0;
|
||||||
|
}
|
||||||
switch (beg_index)
|
switch (beg_index)
|
||||||
{
|
{
|
||||||
case PM_SCAN:
|
case PM_SCAN:
|
||||||
end_index = PM_NAVIGATE;
|
end_index = PM_NAVIGATE;
|
||||||
break;
|
break;
|
||||||
|
case PM_STARMAP:
|
||||||
|
NewState--;
|
||||||
|
end_index = PM_NAVIGATE;
|
||||||
|
break;
|
||||||
case PM_MIN_SCAN:
|
case PM_MIN_SCAN:
|
||||||
end_index = PM_LAUNCH_LANDER;
|
end_index = PM_LAUNCH_LANDER;
|
||||||
break;
|
break;
|
||||||
@@ -1138,10 +1250,23 @@ DrawMenuStateStrings (BYTE beg_index, BYTE NewState)
|
|||||||
r.corner.x = s.origin.x - 1;
|
r.corner.x = s.origin.x - 1;
|
||||||
r.corner.y = s.origin.y - 11;
|
r.corner.y = s.origin.y - 11;
|
||||||
r.extent.width = RADAR_WIDTH + 2;
|
r.extent.width = RADAR_WIDTH + 2;
|
||||||
r.extent.height = 11;
|
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08));
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08));
|
||||||
DrawFilledRectangle (&r);
|
if (s.frame && optPCmenu && beg_index != PM_SOUND_ON)
|
||||||
|
{
|
||||||
|
if (beg_index == PM_CREW)
|
||||||
|
sprintf (menu_string[PM_CREW], "CREW(%d)", GLOBAL (CrewCost));
|
||||||
|
if (beg_index == PM_FUEL)
|
||||||
|
sprintf (menu_string[PM_FUEL], "FUEL(%d)", GLOBAL (FuelCost));
|
||||||
|
r.extent.height = RADAR_HEIGHT + 11;
|
||||||
|
DrawPCMenu (beg_index, end_index, (BYTE)NewState, hilite, &r);
|
||||||
|
s.frame = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
r.extent.height = 11;
|
||||||
|
DrawFilledRectangle (&r);
|
||||||
|
}
|
||||||
if (s.frame)
|
if (s.frame)
|
||||||
{
|
{
|
||||||
DrawStamp (&s);
|
DrawStamp (&s);
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ extern COUNT GetLBayCapacity (PPOINT ppt);
|
|||||||
extern COUNT GetSBayCapacity (PPOINT ppt);
|
extern COUNT GetSBayCapacity (PPOINT ppt);
|
||||||
extern DWORD GetFTankCapacity (PPOINT ppt);
|
extern DWORD GetFTankCapacity (PPOINT ppt);
|
||||||
extern COUNT CountSISPieces (BYTE piece_type);
|
extern COUNT CountSISPieces (BYTE piece_type);
|
||||||
extern void DrawMenuStateStrings (BYTE beg_index, BYTE NewState);
|
extern void DrawMenuStateStrings (BYTE beg_index, SWORD NewState);
|
||||||
extern void DoMenuOptions (void);
|
extern void DoMenuOptions (void);
|
||||||
extern void DrawFlagshipName (BOOLEAN InStatusArea);
|
extern void DrawFlagshipName (BOOLEAN InStatusArea);
|
||||||
extern void DrawCaptainsName (void);
|
extern void DrawCaptainsName (void);
|
||||||
|
|||||||
+6
-1
@@ -88,6 +88,7 @@ main (int argc, char *argv[])
|
|||||||
{"audioquality", 1, NULL, 'q'},
|
{"audioquality", 1, NULL, 'q'},
|
||||||
{"nosubtitles", 0, NULL, 'u'},
|
{"nosubtitles", 0, NULL, 'u'},
|
||||||
{"pcscan", 0, NULL, 'a'},
|
{"pcscan", 0, NULL, 'a'},
|
||||||
|
{"pcmenu", 0, NULL, 'b'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -101,7 +102,7 @@ main (int argc, char *argv[])
|
|||||||
strcpy (contentdir, "content");
|
strcpy (contentdir, "content");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "r:d:foc:spn:?hM:S:T:emq:ua", long_options, &option_index)) != -1)
|
while ((c = getopt_long(argc, argv, "r:d:foc:spn:?hM:S:T:emq:uab", long_options, &option_index)) != -1)
|
||||||
{
|
{
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'r':
|
case 'r':
|
||||||
@@ -188,6 +189,9 @@ main (int argc, char *argv[])
|
|||||||
case 'a':
|
case 'a':
|
||||||
optPCscan = TRUE;
|
optPCscan = TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 'b':
|
||||||
|
optPCmenu = TRUE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printf ("\nOption %s not found!\n", long_options[option_index].name);
|
printf ("\nOption %s not found!\n", long_options[option_index].name);
|
||||||
case '?':
|
case '?':
|
||||||
@@ -209,6 +213,7 @@ main (int argc, char *argv[])
|
|||||||
printf(" -q, --audioquality=QUALITY (high, medium or low, default medium)\n");
|
printf(" -q, --audioquality=QUALITY (high, medium or low, default medium)\n");
|
||||||
printf(" -u, --nosubtitles\n");
|
printf(" -u, --nosubtitles\n");
|
||||||
printf(" -a --pcscan\n");
|
printf(" -a --pcscan\n");
|
||||||
|
printf(" -b --pcmenu\n");
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user