Changed cmd-line options once again (hopefully for the last time)

- new options are of format --opt=pc/3do
  - availiable options are --menu, --cscan, --font, --music
  - only --music has a 'short' version (-m) -e has been removed


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@543 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
ghaushe
2003-01-12 03:44:35 +00:00
parent 0e471c82cd
commit 9d829033c8
10 changed files with 81 additions and 63 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
Changes towards version 0.2:
- Added a sane cmd-line naming scheme: --opt=(pc|3do) see --help for more -PBlue
- Added new font effect (PC-lander messages), and set colors for text -PBlue
- Use correct font for 'CAPTAIN', 'FUEL', and 'CREW' is status screen -PBlue
- Changed PC cmd-line options: now -a font,menu,scan -PhracturedBlue
- Added gradiated font support (for ship name), and PC-font option -PBlue
- Minor fixes to PCMenu by fOSSiL, Nic, PhracturedBlue
- Updated mingw support with better directions, and easier build -PBlue
+5 -4
View File
@@ -28,12 +28,13 @@
#include "file.h"
#include "config.h"
int optWhichMusic = MUSIC_3DO;
int optWhichMusic = OPT_3DO;
int optWhichCoarseScan = OPT_3DO;
int optWhichMenu = OPT_3DO;
int optWhichFonts = OPT_3DO;
char *configDir, *saveDir, *meleeDir;
BOOLEAN optSubtitles = TRUE;
BOOLEAN optPCscan = FALSE;
BOOLEAN optPCmenu = FALSE;
BOOLEAN optPCfonts = FALSE;
void
prepareConfigDir (void) {
+7 -10
View File
@@ -26,20 +26,17 @@
#define UQM_MAJOR_VERSION 0
#define UQM_MINOR_VERSION 13
enum
{
MUSIC_3DO,
MUSIC_PC,
};
#define OPT_3DO 0x01
#define OPT_PC 0x02
#define OPT_ALL 0xFF
extern int optWhichMusic;
extern int optWhichCoarseScan;
extern int optWhichMenu;
extern int optWhichFonts;
extern BOOLEAN optSubtitles;
extern BOOLEAN optPCscan;
extern BOOLEAN optPCmenu;
extern BOOLEAN optPCfonts;
extern char *configDir;
extern char *meleeDir;
+1 -1
View File
@@ -128,7 +128,7 @@ FeedbackSetting (BYTE which_setting)
case CYBORG_NORMAL_SETTING:
case CYBORG_DOUBLE_SETTING:
case CYBORG_SUPER_SETTING:
if (optPCmenu && which_setting > CYBORG_NORMAL_SETTING)
if (optWhichMenu == OPT_PC && which_setting > CYBORG_NORMAL_SETTING)
{
if (which_setting == CYBORG_DOUBLE_SETTING)
strcpy (tmpstr, "+");
+2 -2
View File
@@ -139,7 +139,7 @@ _GetMusicData (FILE *fp, DWORD length)
switch (optWhichMusic)
{
default:
case MUSIC_3DO:
case OPT_3DO:
{
char threedoname[1000];
@@ -151,7 +151,7 @@ _GetMusicData (FILE *fp, DWORD length)
}
break;
}
case MUSIC_PC:
case OPT_PC:
{
break;
}
+2 -2
View File
@@ -172,7 +172,7 @@ _GetMusicData (FILE *fp, DWORD length)
switch (optWhichMusic)
{
default:
case MUSIC_3DO:
case OPT_3DO:
{
char threedoname[1000];
@@ -184,7 +184,7 @@ _GetMusicData (FILE *fp, DWORD length)
}
break;
}
case MUSIC_PC:
case OPT_PC:
{
break;
}
+3 -3
View File
@@ -34,7 +34,7 @@ ClearReportArea ()
STAMP s;
PRIMITIVE prim_row[NUM_CELL_COLS];
if (optPCfonts)
if (optWhichFonts == OPT_PC)
s.frame = SetAbsFrameIndex (SpaceJunkFrame, 21);
else
s.frame = SetAbsFrameIndex (SpaceJunkFrame, 18);
@@ -47,7 +47,7 @@ ClearReportArea ()
s.origin.x += r.extent.width + 1;
SetPrimNextLink (&prim_row[i], i + 1);
if (optPCfonts)
if (optWhichFonts == OPT_PC)
SetPrimType (&prim_row[i], STAMP_PRIM);
else
{
@@ -234,7 +234,7 @@ DoDiscoveryReport (SOUND ReadOutSounds)
FONT OldFont;
OldFont = SetContextFont (pSolarSysState->SysInfo.PlanetInfo.LanderFont);
if (optPCfonts)
if (optWhichFonts == OPT_PC)
{
SetContextFontEffect (ALTERNATE_EFFECT,
BUILD_COLOR_RGBA (0x00, 0x00, 0xD6, 0xFF),
+2 -2
View File
@@ -784,7 +784,7 @@ PickPlanetSide (INPUT_STATE InputState, PMENU_STATE pMS)
return (FALSE);
}
if (optPCscan)
if (optWhichCoarseScan == OPT_PC)
PrintCoarseScanPC ();
else
PrintCoarseScan3DO ();
@@ -1242,7 +1242,7 @@ ScanSystem (void)
DrawMenuStateStrings (PM_MIN_SCAN, MenuState.CurState);
if (optPCscan)
if (optWhichCoarseScan == OPT_PC)
PrintCoarseScanPC ();
else
PrintCoarseScan3DO ();
+6 -6
View File
@@ -378,14 +378,14 @@ DrawFlagshipName (BOOLEAN InStatusArea)
t.baseline.y = r.corner.y + (SHIP_NAME_HEIGHT - InStatusArea);
t.align = ALIGN_CENTER;
t.CharCount = (COUNT)~0;
if (optPCfonts)
if (optWhichFonts == OPT_PC)
SetContextFontEffect (GRADIENT_EFFECT,
BUILD_COLOR_RGBA (0xF7, 0x2C, 0x00, 0xFF),
BUILD_COLOR_RGBA (0xF7, 0xBA, 0x00, 0xFF));
else
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x14, 0x0A, 0x00), 0x0C));
DrawText (&t);
if (optPCfonts)
if (optWhichFonts == OPT_PC)
SetContextFontEffect (0, 0, 0);
SetContextForeGroundColor (OldColor);
@@ -579,7 +579,7 @@ DeltaSISGauges (SIZE crew_delta, SIZE fuel_delta, int resunit_delta)
s.origin.x = s.origin.y = 0;
s.frame = flagship_status;
DrawStamp (&s);
if (optPCfonts)
if (optWhichFonts == OPT_PC)
DrawPC_SIS();
s.origin.x = 1;
@@ -1091,7 +1091,7 @@ SetFlashRect (PRECT pRect, FRAME f)
else
{
//Don't flash when using the PC menu
if (optPCmenu) {
if (optWhichMenu == OPT_PC) {
if (flash_task)
{
ClearSemaphore (GraphicsSem);
@@ -1325,7 +1325,7 @@ DrawMenuStateStrings (BYTE beg_index, SWORD NewState)
r.extent.width = RADAR_WIDTH + 2;
BatchGraphics ();
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xA, 0xA, 0xA), 0x08));
if (s.frame && optPCmenu)
if (s.frame && optWhichMenu == OPT_PC)
{
if (beg_index == PM_CREW)
sprintf (menu_string[PM_CREW], "crew(%d)", GLOBAL (CrewCost));
@@ -1367,7 +1367,7 @@ DrawMenuStateStrings (BYTE beg_index, SWORD NewState)
}
else
{
if(optPCmenu)
if(optWhichMenu == OPT_PC)
{
r.corner.x -= 1;
r.extent.width += 1;
+52 -32
View File
@@ -58,6 +58,17 @@ CDToContentDir (char *contentdir)
}
}
static int
Check_PC_3DO_opt (char *value, DWORD mask, char *opt)
{
if ((mask & OPT_3DO) && strcmp (value, "3do") == 0)
return OPT_3DO;
if ((mask & OPT_PC) && strcmp (value, "pc") == 0)
return OPT_PC;
fprintf (stderr, "Unknown option '%s %s' found!",opt, value);
return -1;
}
int
main (int argc, char *argv[])
{
@@ -66,8 +77,16 @@ main (int argc, char *argv[])
int soundflags = TFB_SOUNDFLAGS_MQAUDIO;
int width = 640, height = 480, bpp = 16;
int vol;
int val;
char contentdir[1000];
enum
{
CSCAN_OPT = 1000,
MENU_OPT,
FONT_OPT
};
int option_index = 0, c;
static struct option long_options[] =
{
@@ -83,11 +102,13 @@ main (int argc, char *argv[])
{"musicvol", 1, NULL, 'M'},
{"sfxvol", 1, NULL, 'S'},
{"speechvol", 1, NULL, 'T'},
{"3domusic", 0, NULL, 'e'},
{"pcmusic", 0, NULL, 'm'},
{"audioquality", 1, NULL, 'q'},
{"nosubtitles", 0, NULL, 'u'},
{"pcopt", 1, NULL, 'a'},
{"music", 1, NULL, 'm'},
// options with no short equivalent
{"cscan", 1, NULL, CSCAN_OPT},
{"menu", 1, NULL, MENU_OPT},
{"font", 1, NULL, FONT_OPT},
{0, 0, 0, 0}
};
@@ -159,12 +180,6 @@ main (int argc, char *argv[])
vol = 100;
speechVolumeScale = vol / 100.0f;
break;
case 'e':
optWhichMusic = MUSIC_3DO;
break;
case 'm':
optWhichMusic = MUSIC_PC;
break;
case 'q':
if (!strcmp (optarg, "high"))
{
@@ -185,22 +200,29 @@ main (int argc, char *argv[])
case 'u':
optSubtitles = FALSE;
break;
case 'a':
{
char *thisopt, *optptr = optarg;
while (thisopt = strtok (optptr, ","))
{
optptr= NULL;
if (!strcmp (thisopt, "m") || !strcmp (thisopt, "menu"))
optPCmenu = TRUE;
else if (!strcmp (thisopt, "s") || !strcmp (thisopt, "scan"))
optPCscan = TRUE;
else if (!strcmp (thisopt, "f") || !strcmp (thisopt, "font"))
optPCfonts = TRUE;
else
printf ("\nUnknown PC option: %s\n", thisopt);
}
}
case 'm':
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
optWhichMusic = val;
break;
case CSCAN_OPT:
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
optWhichCoarseScan = val;
break;
case MENU_OPT:
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
optWhichMenu = val;
break;
case FONT_OPT:
if ((val = Check_PC_3DO_opt (optarg,
OPT_PC | OPT_3DO,
(char *)long_options[option_index].name)) != -1)
optWhichFonts = val;
break;
default:
printf ("\nOption %s not found!\n", long_options[option_index].name);
@@ -218,15 +240,13 @@ main (int argc, char *argv[])
printf(" -M, --musicvol=VOLUME (0-100, default 100)\n");
printf(" -S, --sfxvol=VOLUME (0-100, default 100)\n");
printf(" -T, --speechvol=VOLUME (0-100, default 100)\n");
printf(" -e, --3domusic (default)\n");
printf(" -m, --pcmusic\n");
printf(" -q, --audioquality=QUALITY (high, medium or low, default medium)\n");
printf(" -u, --nosubtitles\n");
printf(" -a --pcopt=font,menu,scan\n");
printf(" options are comma seperated (no spaces)\n");
printf(" font (or 'f') : use PC fonts\n");
printf(" menu (or 'm') : use text menus\n");
printf(" scan (or 's') : use text for coarse-scan (not hierogliphics)\n");
printf("The following options can take either '3do' or 'pc' as an option:\n");
printf(" -m, --music : Music version (default 3do)\n");
printf(" --cscan : coarse-scan display, pc=text, 3do=hieroglyphs (default 3do)\n");
printf(" --menu : menu type, pc=text, 3do=graphical (default 3do)\n");
printf(" --font : font types and colors (default 3do)\n");
return 0;
break;
}