diff --git a/sc2/src/starcon2.c b/sc2/src/starcon2.c index 46a5893ea..c20f06578 100644 --- a/sc2/src/starcon2.c +++ b/sc2/src/starcon2.c @@ -18,8 +18,10 @@ #ifndef WIN32 #include +#include #else #include +#include "getopt/getopt.h" #endif #include "libs/graphics/gfx_common.h" @@ -27,7 +29,6 @@ #include "libs/input/input_common.h" #include "libs/tasklib.h" - BOOLEAN FileExists (char *filename) { FILE *fp; @@ -56,65 +57,85 @@ CDToContentDir (char *contentdir) int main (int argc, char *argv[]) { - int i; int gfxdriver = TFB_GFXDRIVER_SDL_PURE; int gfxflags = 0; int width = 640, height = 480, bpp = 16; int frequency = 44100; - char contentdir[1000]; + char contentdir[1000]; + + int option_index = 0, c; + static struct option long_options[] = + { + {"res", 1, NULL, 'r'}, + {"bpp", 1, NULL, 'd'}, + {"fullscreen", 0, NULL, 'f'}, + {"opengl", 0, NULL, 'o'}, + {"bilinear", 0, NULL, 'b'}, + {"frequency", 1, NULL, 'q'}, + {"fps", 0, NULL, 'p'}, + {"tv", 0, NULL, 't'}, + {"contentdir", 1, NULL, 'c'}, + {"help", 0, NULL, 'h'}, + {0, 0, 0, 0} + }; #ifndef WIN32 - strcpy (contentdir, "content"); + strcpy (contentdir, "content"); #else strcpy (contentdir, "../../content"); #endif - // TODO: proper commandline parser, this is just a quick hack - for (i=1;i