diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index 63e582ec3..26676b8a4 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -96,6 +96,7 @@ extern char *testplay_addparam; extern const char *g_namesFileName; extern const char *defsfilename; // set in bstub.c +extern int32_t g_maxCacheSize; extern int32_t g_lazy_tileselector; extern int32_t m32_osd_tryscript; diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index b83d660da..63c312d31 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -62,6 +62,7 @@ double vid_gamma_3d=-1, vid_contrast_3d=-1, vid_brightness_3d=-1; int32_t xdim2d = 640, ydim2d = 480, xdimgame = 640, ydimgame = 480, bppgame = 8; int32_t forcesetup = 1; +int32_t g_maxCacheSize = 24<<20; //extern int32_t cachesize, artsize; static int16_t oldmousebstatus = 0; @@ -507,7 +508,7 @@ int32_t app_main(int32_t argc, const char **argv) inittimer(TIMERINTSPERSECOND); installusertimercallback(keytimerstuff); - loadpics("tiles000.art", 1048576*16); + loadpics("tiles000.art", g_maxCacheSize); #ifdef YAX_ENABLE // init dummy texture for YAX diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 74392b16c..5cbeb3498 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -8223,20 +8223,22 @@ void ExtPreSaveMap(void) static void G_ShowParameterHelp(void) { const char *s = "Usage: mapster32 [OPTIONS] [FILE]\n\n" - "-gFILE, -grp FILE\tUse extra group file FILE\n" - "-hFILE\t\tUse definitions file FILE\n" - "-xFILE\t\tUse FILE instead of GAME.CON for getting sound definitions" - "-jDIR, -game_dir DIR\n\t\tAdds DIR to the file path stack\n" - "-check\t\tEnables map pointer checking when saving\n" - "-nocheck\t\tDisables map pointer checking when saving (default)\n" // kept for script compat - "-namesfile \t\tOverride NAMES.H\n" + "-gFILE, -grp FILE Use extra group file FILE\n" + "-hFILE Use definitions file FILE\n" + "-xFILE Use FILE instead of GAME.CON for getting sound definitions\n" + "-jDIR, -game_dir DIR\n" + " Adds DIR to the file path stack\n" + "-cachesize # Sets cache size, in Kb\n" + "-check Enables map pointer checking when saving\n" + "-namesfile FILE Uses FILE instead of NAMES.H for tile names\n" + "-nocheck Disables map pointer checking when saving (default)\n" // kept for script compat #if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2) - "-setup\t\tDisplays the configuration dialog\n" + "-setup Displays the configuration dialog\n" #endif #if !defined(_WIN32) - "-usecwd\t\tRead game data and configuration file from working directory\n" + "-usecwd Read game data and configuration file from working directory\n" #endif - "\n-?, -help, --help\tDisplay this help message and exit" + "\n-?, -help, --help Display this help message and exit" ; Bsprintf(tempbuf, "Mapster32 %s %s", VERSION, s_buildRev); wm_msgbox(tempbuf, "%s", s); @@ -8353,6 +8355,24 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) i++; continue; } + if (!Bstrcasecmp(c+1,"cachesize")) + { + if (argc > i+1) + { + int32_t sz = atoi_safe(argv[i+1]); + if (sz >= 16<<10 && sz <= 1024<<10) + { + g_maxCacheSize = sz<<10; + initprintf("Cache size: %dkB\n",sz); + + COPYARG(i); + COPYARG(i+1); + } + i++; + } + i++; + continue; + } if (!Bstrcasecmp(c+1,"cfg")) { if (argc > i+1)