Increase default tile cache size to 24M in Mapster32 and add a command-line parameter '-cachesize <kilobytes>'

git-svn-id: https://svn.eduke32.com/eduke32@1894 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-05-23 18:07:45 +00:00
parent 5f8cc046cc
commit 4fb043483d
3 changed files with 33 additions and 11 deletions

View file

@ -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;

View file

@ -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

View file

@ -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 <filename>\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)