2006-04-23 06:44:19 +00:00
|
|
|
// Evil and Nasty Configuration File Reader for KenBuild
|
|
|
|
// by Jonathon Fowler
|
|
|
|
|
|
|
|
#include "compat.h"
|
|
|
|
#include "build.h"
|
|
|
|
#include "editor.h"
|
|
|
|
#include "osd.h"
|
2015-07-08 03:34:16 +00:00
|
|
|
#include "cache1d.h"
|
2006-04-23 06:44:19 +00:00
|
|
|
#include "baselayer.h"
|
2012-11-25 04:26:37 +00:00
|
|
|
#include "renderlayer.h"
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
static double clampd(double d, double mind, double maxd)
|
|
|
|
{
|
|
|
|
if (d != d || d<mind)
|
|
|
|
d = mind;
|
|
|
|
else if (d>maxd)
|
|
|
|
d = maxd;
|
|
|
|
return d;
|
|
|
|
}
|
|
|
|
|
2009-06-05 20:09:13 +00:00
|
|
|
static int32_t readconfig(BFILE *fp, const char *key, char *value, uint32_t len)
|
2006-04-23 06:44:19 +00:00
|
|
|
{
|
2006-04-24 19:04:22 +00:00
|
|
|
char buf[1000], *k, *v, *eq;
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t x=0;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
if (len < 1) return 0;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
Brewind(fp);
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2007-12-12 17:42:14 +00:00
|
|
|
while (1)
|
|
|
|
{
|
2006-04-24 19:04:22 +00:00
|
|
|
if (!Bfgets(buf, 1000, fp)) return 0;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
if (buf[0] == ';') continue;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
eq = Bstrchr(buf, '=');
|
|
|
|
if (!eq) continue;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
k = buf;
|
|
|
|
v = eq+1;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
while (*k == ' ' || *k == '\t') k++;
|
|
|
|
*(eq--) = 0;
|
|
|
|
while ((*eq == ' ' || *eq == '\t') && eq>=k) *(eq--) = 0;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
if (Bstrcasecmp(k, key)) continue;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2014-05-03 15:39:22 +00:00
|
|
|
while (*v == ' ' || *v == '\t') v++;
|
2006-04-24 19:04:22 +00:00
|
|
|
eq = v + Bstrlen(v)-1;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
while ((*eq == ' ' || *eq == '\t' || *eq == '\r' || *eq == '\n') && eq>=v) *(eq--) = 0;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
value[--len] = 0;
|
|
|
|
do value[x] = v[x]; while (v[x++] != 0 && len-- > 0);
|
|
|
|
|
|
|
|
return x-1;
|
|
|
|
}
|
2006-04-23 06:44:19 +00:00
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int16_t brightness;
|
2013-10-13 09:08:31 +00:00
|
|
|
#ifdef USE_OPENGL
|
2009-08-05 22:37:48 +00:00
|
|
|
extern int32_t vsync;
|
2013-10-13 09:08:31 +00:00
|
|
|
#endif
|
2008-10-14 08:40:59 +00:00
|
|
|
extern char game_executable[BMAX_PATH];
|
2009-01-09 09:29:17 +00:00
|
|
|
extern int32_t fullscreen;
|
2011-03-08 23:02:38 +00:00
|
|
|
extern char default_buildkeys[NUMBUILDKEYS];
|
|
|
|
static char *const keys = default_buildkeys;
|
2010-04-11 13:04:53 +00:00
|
|
|
static int32_t default_grid=3;
|
2010-08-17 20:00:44 +00:00
|
|
|
extern int32_t AmbienceToggle, MixRate;
|
2009-04-07 18:56:22 +00:00
|
|
|
extern int32_t ParentalLock;
|
2006-04-23 06:44:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* SETUP.DAT
|
|
|
|
* 0 = video mode (0:chained 1:vesa 2:screen buffered 3/4/5:tseng/paradise/s3 6:red-blue)
|
|
|
|
* 1 = sound (0:none)
|
|
|
|
* 2 = music (0:none)
|
|
|
|
* 3 = input (0:keyboard 1:+mouse)
|
|
|
|
* 4 = multiplayer (0:single 1-4:com 5-11:ipx)
|
|
|
|
* 5&0xf0 = com speed
|
|
|
|
* 5&0x0f = com irq
|
|
|
|
* 6&0xf0 = chained y-res
|
|
|
|
* 6&0x0f = chained x-res or vesa mode
|
|
|
|
* 7&0xf0 = sound samplerate
|
|
|
|
* 7&0x01 = sound quality
|
|
|
|
* 7&0x02 = 8/16 bit
|
|
|
|
* 7&0x04 = mono/stereo
|
|
|
|
*
|
|
|
|
* bytes 8 to 26 are key settings:
|
|
|
|
* 0 = Forward (0xc8)
|
|
|
|
* 1 = Backward (0xd0)
|
|
|
|
* 2 = Turn left (0xcb)
|
|
|
|
* 3 = Turn right (0xcd)
|
|
|
|
* 4 = Run (0x2a)
|
|
|
|
* 5 = Strafe (0x9d)
|
|
|
|
* 6 = Fire (0x1d)
|
|
|
|
* 7 = Use (0x39)
|
|
|
|
* 8 = Stand high (0x1e)
|
|
|
|
* 9 = Stand low (0x2c)
|
|
|
|
* 10 = Look up (0xd1)
|
|
|
|
* 11 = Look down (0xc9)
|
|
|
|
* 12 = Strafe left (0x33)
|
|
|
|
* 13 = Strafe right (0x34)
|
|
|
|
* 14 = 2D/3D switch (0x9c)
|
|
|
|
* 15 = View cycle (0x1c)
|
|
|
|
* 16 = 2D Zoom in (0xd)
|
|
|
|
* 17 = 2D Zoom out (0xc)
|
|
|
|
* 18 = Chat (0xf)
|
|
|
|
*/
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t loadsetup(const char *fn)
|
2006-04-23 06:44:19 +00:00
|
|
|
{
|
2006-04-24 19:04:22 +00:00
|
|
|
BFILE *fp;
|
2010-06-25 23:01:54 +00:00
|
|
|
#define VL 1024
|
2006-04-24 19:04:22 +00:00
|
|
|
char val[VL];
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t i;
|
2006-04-24 19:04:22 +00:00
|
|
|
|
|
|
|
if ((fp = Bfopen(fn, "rt")) == NULL) return -1;
|
|
|
|
|
2014-05-03 15:39:24 +00:00
|
|
|
if (readconfig(fp, "forcesetup", val, VL) > 0) forcesetup = (atoi_safe(val) != 0);
|
|
|
|
if (readconfig(fp, "fullscreen", val, VL) > 0) fullscreen = (atoi_safe(val) != 0);
|
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "xdim2d", val, VL) > 0) xdim2d = atoi_safe(val);
|
|
|
|
if (readconfig(fp, "ydim2d", val, VL) > 0) ydim2d = atoi_safe(val);
|
|
|
|
if (readconfig(fp, "xdim3d", val, VL) > 0) xdimgame = atoi_safe(val);
|
|
|
|
if (readconfig(fp, "ydim3d", val, VL) > 0) ydimgame = atoi_safe(val);
|
2014-05-03 15:39:24 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "bpp", val, VL) > 0) bppgame = atoi_safe(val);
|
2014-05-03 15:39:24 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "editorgridextent", val, VL) > 0)
|
|
|
|
{
|
|
|
|
int32_t tmp = atoi_safe(val);
|
|
|
|
editorgridextent = clamp(tmp, 65536, BXY_MAX);
|
|
|
|
}
|
|
|
|
|
2010-04-11 13:04:53 +00:00
|
|
|
if (readconfig(fp, "grid", val, VL) > 0)
|
|
|
|
{
|
2011-03-17 23:37:38 +00:00
|
|
|
grid = atoi_safe(val);
|
2010-04-11 13:04:53 +00:00
|
|
|
default_grid = grid;
|
|
|
|
autogrid = (grid==9);
|
2011-03-17 23:37:38 +00:00
|
|
|
grid = clamp(grid, 0, 8);
|
2010-04-11 13:04:53 +00:00
|
|
|
}
|
2009-04-29 19:43:51 +00:00
|
|
|
#ifdef POLYMER
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "rendmode", val, VL) > 0) { i = atoi_safe(val); glrendmode = i; }
|
2009-04-29 19:43:51 +00:00
|
|
|
#endif
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "vid_gamma", val, VL) > 0) vid_gamma = clampd(Bstrtod(val, NULL), 0.0, 10.0);
|
|
|
|
if (readconfig(fp, "vid_brightness", val, VL) > 0) vid_brightness = clampd(Bstrtod(val, NULL), 0.0, 10.0);
|
|
|
|
if (readconfig(fp, "vid_contrast", val, VL) > 0) vid_contrast = clampd(Bstrtod(val, NULL), 0.0, 10.0);
|
2006-04-23 06:44:19 +00:00
|
|
|
#ifdef RENDERTYPEWIN
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "maxrefreshfreq", val, VL) > 0) maxrefreshfreq = atoi_safe(val);
|
2006-04-23 06:44:19 +00:00
|
|
|
#endif
|
2011-03-04 08:50:58 +00:00
|
|
|
#ifdef USE_OPENGL
|
2011-05-18 22:44:09 +00:00
|
|
|
if (readconfig(fp, "lazytileselector", val, VL) > 0) g_lazy_tileselector = !!atoi_safe(val);
|
2012-04-09 19:22:00 +00:00
|
|
|
#endif
|
2008-10-14 08:40:59 +00:00
|
|
|
if (readconfig(fp, "gameexecutable", val, VL) > 0)
|
|
|
|
Bstrcpy(game_executable, val);
|
|
|
|
|
2007-03-22 20:58:13 +00:00
|
|
|
#if 1
|
2015-01-18 22:11:31 +00:00
|
|
|
if (readconfig(fp, "keyforward", val, VL) > 0) keys[BK_MOVEFORWARD] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "keybackward", val, VL) > 0) keys[BK_MOVEBACKWARD] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "keyturnleft", val, VL) > 0) keys[BK_TURNLEFT] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "keyturnright", val, VL) > 0) keys[BK_TURNRIGHT] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "keyrun", val, VL) > 0) keys[BK_RUN] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "keystrafe", val, VL) > 0) keys[BK_STRAFE] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keyfire", val, VL) > 0) keys[BK_SHOOT] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keyuse", val, VL) > 0) keys[BK_OPEN] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "keystandhigh", val, VL) > 0) keys[BK_MOVEUP] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "keystandlow", val, VL) > 0) keys[BK_MOVEDOWN] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keylookup", val, VL) > 0) keys[BK_LOOKUP] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keylookdown", val, VL) > 0) keys[BK_LOOKDOWN] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keystrafeleft", val, VL) > 0) keys[BK_STRAFELEFT] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keystraferight", val, VL) > 0) keys[BK_STRAFERIGHT] = Bstrtol(val, NULL, 16);
|
|
|
|
if (readconfig(fp, "key2dmode", val, VL) > 0) keys[BK_MODE2D_3D] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keyviewcycle", val, VL) > 0) keys[BK_PLAYERVIEW] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "key2dzoomin", val, VL) > 0) keys[BK_ZOOMIN] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "key2dzoomout", val, VL) > 0) keys[BK_ZOOMOUT] = Bstrtol(val, NULL, 16);
|
|
|
|
// if (readconfig(fp, "keychat", val, VL) > 0) keys[BK_MESSAGE] = Bstrtol(val, NULL, 16);
|
2007-03-01 00:50:59 +00:00
|
|
|
#endif
|
2007-04-22 03:44:54 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "windowpositioning", val, VL) > 0) windowpos = atoi_safe(val);
|
2007-04-22 03:44:54 +00:00
|
|
|
windowx = -1;
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "windowposx", val, VL) > 0) windowx = atoi_safe(val);
|
2007-04-22 03:44:54 +00:00
|
|
|
windowy = -1;
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "windowposy", val, VL) > 0) windowy = atoi_safe(val);
|
2007-04-22 03:44:54 +00:00
|
|
|
|
2015-01-18 22:11:31 +00:00
|
|
|
if (readconfig(fp, "keyconsole", val, VL) > 0)
|
|
|
|
{
|
|
|
|
keys[BK_CONSOLE] = Bstrtol(val, NULL, 16);
|
|
|
|
OSD_CaptureKey(keys[BK_CONSOLE]);
|
|
|
|
}
|
2006-04-24 19:04:22 +00:00
|
|
|
|
|
|
|
if (readconfig(fp, "mousesensitivity", val, VL) > 0) msens = Bstrtod(val, NULL);
|
2008-02-14 08:35:30 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "mousenavigation", val, VL) > 0) unrealedlook = !!atoi_safe(val);
|
2008-05-16 19:51:38 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "mousenavigationaccel", val, VL) > 0) pk_uedaccel = atoi_safe(val);
|
2008-05-18 21:09:30 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "quickmapcycling", val, VL) > 0) quickmapcycling = !!atoi_safe(val);
|
2008-05-16 19:51:38 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "sideview_reversehorizrot", val, VL) > 0) sideview_reversehrot = !!atoi_safe(val);
|
|
|
|
if (readconfig(fp, "revertCTRL", val, VL) > 0) revertCTRL = !!atoi_safe(val);
|
2008-05-18 21:09:30 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "scrollamount", val, VL) > 0) scrollamount = atoi_safe(val);
|
2008-05-18 21:09:30 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "turnaccel", val, VL) > 0) pk_turnaccel = atoi_safe(val);
|
2008-05-18 21:09:30 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "turndecel", val, VL) > 0) pk_turndecel = atoi_safe(val);
|
2008-05-18 21:09:30 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "autosavesec", val, VL) > 0) autosave = max(0, atoi_safe(val));
|
|
|
|
if (readconfig(fp, "autocorruptchecksec", val, VL) > 0) autocorruptcheck = max(0, atoi_safe(val));
|
2011-07-10 15:39:21 +00:00
|
|
|
if (readconfig(fp, "corruptcheck_noalreadyrefd", val, VL) > 0)
|
|
|
|
corruptcheck_noalreadyrefd = !!atoi_safe(val);
|
2011-11-11 20:05:29 +00:00
|
|
|
if (readconfig(fp, "fixmaponsave_sprites", val, VL) > 0)
|
|
|
|
fixmaponsave_sprites = !!atoi_safe(val);
|
2013-01-16 20:38:56 +00:00
|
|
|
if (readconfig(fp, "keeptexturestretch", val, VL) > 0)
|
|
|
|
keeptexturestretch = !!atoi_safe(val);
|
2008-05-30 09:07:50 +00:00
|
|
|
|
2008-10-09 21:09:16 +00:00
|
|
|
if (readconfig(fp, "showheightindicators", val, VL) > 0)
|
2011-03-17 23:37:38 +00:00
|
|
|
showheightindicators = clamp(atoi_safe(val), 0, 2);
|
2010-08-11 22:37:45 +00:00
|
|
|
if (readconfig(fp, "showambiencesounds", val, VL) > 0)
|
2011-03-17 23:37:38 +00:00
|
|
|
showambiencesounds = clamp(atoi_safe(val), 0, 2);
|
2008-10-09 21:09:16 +00:00
|
|
|
|
2015-07-08 03:34:16 +00:00
|
|
|
if (readconfig(fp, "pathsearchmode", val, VL) > 0)
|
|
|
|
pathsearchmode = clamp(atoi_safe(val), 0, 1);
|
|
|
|
|
2011-07-04 21:20:59 +00:00
|
|
|
if (readconfig(fp, "autogray", val, VL) > 0)
|
|
|
|
autogray = !!atoi_safe(val);
|
2011-08-06 11:50:45 +00:00
|
|
|
// if (readconfig(fp, "showinnergray", val, VL) > 0)
|
|
|
|
// showinnergray = !!atoi_safe(val);
|
2011-07-04 21:20:59 +00:00
|
|
|
|
2008-12-31 09:07:49 +00:00
|
|
|
if (readconfig(fp, "graphicsmode", val, VL) > 0)
|
2011-03-17 23:37:38 +00:00
|
|
|
graphicsmode = clamp(atoi_safe(val), 0, 2);
|
2008-12-31 09:07:49 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "samplerate", val, VL) > 0) MixRate = clamp(atoi_safe(val), 8000, 48000);
|
|
|
|
if (readconfig(fp, "ambiencetoggle", val, VL) > 0) AmbienceToggle = !!atoi_safe(val);
|
|
|
|
if (readconfig(fp, "parlock", val, VL) > 0) ParentalLock = !!atoi_safe(val);
|
2009-04-07 18:56:22 +00:00
|
|
|
|
2011-03-17 23:37:38 +00:00
|
|
|
if (readconfig(fp, "osdtryscript", val, VL) > 0) m32_osd_tryscript = !!atoi_safe(val);
|
2010-05-22 23:41:18 +00:00
|
|
|
|
2009-02-19 16:47:54 +00:00
|
|
|
for (i=0; i<256; i++)
|
2014-12-09 23:56:54 +00:00
|
|
|
keyremap[i]=i;
|
2008-10-18 12:37:26 +00:00
|
|
|
|
2014-12-09 23:56:54 +00:00
|
|
|
keyremapinit=1;
|
2008-02-14 08:35:30 +00:00
|
|
|
if (readconfig(fp, "remap", val, VL) > 0)
|
|
|
|
{
|
2009-02-19 16:47:54 +00:00
|
|
|
char *p=val; int32_t v1,v2;
|
2008-02-14 08:35:30 +00:00
|
|
|
while (*p)
|
|
|
|
{
|
|
|
|
if (!sscanf(p,"%x",&v1))break;
|
2009-02-19 16:47:54 +00:00
|
|
|
if ((p=strchr(p,'-'))==0)break; p++;
|
2008-02-14 08:35:30 +00:00
|
|
|
if (!sscanf(p,"%x",&v2))break;
|
2014-12-09 23:56:54 +00:00
|
|
|
keyremap[v1]=v2;
|
2008-02-14 08:35:30 +00:00
|
|
|
initprintf("Remap %X key to %X\n",v1,v2);
|
2009-02-19 16:47:54 +00:00
|
|
|
if ((p=strchr(p,','))==0)break; p++;
|
2008-02-14 08:35:30 +00:00
|
|
|
}
|
|
|
|
}
|
2010-06-25 23:01:54 +00:00
|
|
|
|
|
|
|
// load m32script history
|
|
|
|
for (i=0; i<SCRIPTHISTSIZ; i++)
|
|
|
|
{
|
|
|
|
Bsprintf(val, "hist%d", i);
|
|
|
|
if (readconfig(fp, val, val, VL) <= 0)
|
|
|
|
break;
|
|
|
|
|
2014-05-30 00:02:19 +00:00
|
|
|
scripthist[i] = Xstrdup(val);
|
2010-06-25 23:01:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
scripthistend = i;
|
|
|
|
|
|
|
|
// copy script history into OSD history
|
2014-07-06 00:12:25 +00:00
|
|
|
for (i=0; i<min(scripthistend, osd->history.maxlines); i++)
|
2010-06-25 23:01:54 +00:00
|
|
|
{
|
2014-07-06 00:12:25 +00:00
|
|
|
DO_FREE_AND_NULL(osd->history.buf[i]);
|
2014-11-06 23:43:49 +00:00
|
|
|
OSD_SetHistory(i, scripthist[scripthistend-1-i]);
|
2012-03-28 19:43:21 +00:00
|
|
|
|
2014-07-06 00:12:25 +00:00
|
|
|
osd->history.lines++;
|
|
|
|
osd->history.total++;
|
2010-06-25 23:01:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
scripthistend %= SCRIPTHISTSIZ;
|
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
Bfclose(fp);
|
|
|
|
|
|
|
|
return 0;
|
2006-04-23 06:44:19 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 08:03:02 +00:00
|
|
|
void writesettings(void) // save binds and aliases to <cfgname>_m32_settings.cfg
|
|
|
|
{
|
|
|
|
BFILE *fp;
|
2014-05-30 00:02:19 +00:00
|
|
|
char *ptr = Xstrdup(setupfilename);
|
2014-02-22 08:03:02 +00:00
|
|
|
char tempbuf[128];
|
|
|
|
|
2014-07-28 06:43:16 +00:00
|
|
|
if (!Bstrcmp(setupfilename, defaultsetupfilename))
|
2014-02-22 08:03:02 +00:00
|
|
|
Bsprintf(tempbuf, "m32_settings.cfg");
|
|
|
|
else Bsprintf(tempbuf, "%s_m32_settings.cfg", strtok(ptr, "."));
|
|
|
|
|
|
|
|
fp = Bfopen(tempbuf, "wt");
|
|
|
|
|
|
|
|
if (fp)
|
|
|
|
{
|
2014-07-28 06:43:16 +00:00
|
|
|
Bfprintf(fp,"// this file is automatically generated by %s\n", AppProperName);
|
2014-02-22 08:03:02 +00:00
|
|
|
Bfprintf(fp,"// these settings take precedence over your main cfg file\n");
|
|
|
|
Bfprintf(fp,"// do not modify if you lack common sense\n");
|
|
|
|
|
|
|
|
OSD_WriteAliases(fp);
|
|
|
|
OSD_WriteCvars(fp);
|
|
|
|
|
|
|
|
Bfclose(fp);
|
|
|
|
|
2014-07-28 06:43:16 +00:00
|
|
|
if (!Bstrcmp(setupfilename, defaultsetupfilename))
|
2014-02-22 08:03:02 +00:00
|
|
|
OSD_Printf("Wrote m32_settings.cfg\n");
|
|
|
|
else OSD_Printf("Wrote %s_m32_settings.cfg\n",ptr);
|
|
|
|
|
|
|
|
Bfree(ptr);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-07-28 06:43:16 +00:00
|
|
|
if (!Bstrcmp(setupfilename, defaultsetupfilename))
|
2014-02-22 08:03:02 +00:00
|
|
|
OSD_Printf("Error writing m32_settings.cfg: %s\n", strerror(errno));
|
|
|
|
else OSD_Printf("Error writing %s_m32_settings.cfg: %s\n",ptr,strerror(errno));
|
|
|
|
|
|
|
|
Bfree(ptr);
|
|
|
|
}
|
|
|
|
|
2009-01-09 09:29:17 +00:00
|
|
|
int32_t writesetup(const char *fn)
|
2006-04-23 06:44:19 +00:00
|
|
|
{
|
2006-04-24 19:04:22 +00:00
|
|
|
BFILE *fp;
|
2010-06-25 23:01:54 +00:00
|
|
|
int32_t i,j,first=1;
|
2006-04-24 19:04:22 +00:00
|
|
|
|
|
|
|
fp = Bfopen(fn,"wt");
|
|
|
|
if (!fp) return -1;
|
|
|
|
|
|
|
|
Bfprintf(fp,
|
2014-05-03 15:39:24 +00:00
|
|
|
";; NOTE: key-value pairs ending in a trailing ';;' will NOT be read from this\n"
|
|
|
|
";; file, but from m32_settings.cfg, potentially under a different name.\n"
|
|
|
|
"\n"
|
2006-07-01 01:40:18 +00:00
|
|
|
"; Always show configuration options on startup\n"
|
|
|
|
"; 0 - No\n"
|
|
|
|
"; 1 - Yes\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
"forcesetup = %d\n"
|
2006-07-01 01:40:18 +00:00
|
|
|
"\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"; Video mode selection\n"
|
|
|
|
"; 0 - Windowed\n"
|
|
|
|
"; 1 - Fullscreen\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
"fullscreen = %d\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"\n"
|
|
|
|
"; Video resolution\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
"xdim2d = %d\n"
|
|
|
|
"ydim2d = %d\n"
|
|
|
|
"xdim3d = %d\n"
|
|
|
|
"ydim3d = %d\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"\n"
|
|
|
|
"; 3D-mode colour depth\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
"bpp = %d\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"\n"
|
2013-10-13 09:08:31 +00:00
|
|
|
#ifdef USE_OPENGL
|
2014-05-03 15:39:24 +00:00
|
|
|
"vsync = %d ;;\n"
|
2009-08-05 22:37:48 +00:00
|
|
|
"\n"
|
2013-10-13 09:08:31 +00:00
|
|
|
#endif
|
2009-04-29 19:43:51 +00:00
|
|
|
#ifdef POLYMER
|
2009-04-29 00:51:03 +00:00
|
|
|
"; Rendering mode\n"
|
|
|
|
"rendmode = %d\n"
|
|
|
|
"\n"
|
2009-04-29 19:43:51 +00:00
|
|
|
#endif
|
2007-03-01 00:50:59 +00:00
|
|
|
"; Grid limits\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
"editorgridextent = %d\n"
|
2010-04-11 13:04:53 +00:00
|
|
|
"; Startup grid size (0-8, 9 is automatic)\n"
|
|
|
|
"grid = %d\n"
|
2007-03-01 00:50:59 +00:00
|
|
|
"\n"
|
2011-03-04 08:50:58 +00:00
|
|
|
#ifdef USE_OPENGL
|
2011-06-18 13:02:08 +00:00
|
|
|
";; OpenGL mode options\n"
|
2014-05-03 15:39:24 +00:00
|
|
|
"usemodels = %d ;;\n"
|
|
|
|
"usehightile = %d ;;\n"
|
2011-06-18 13:02:08 +00:00
|
|
|
"; Enabling lazytileselector allows the tile display to interrupt\n"
|
|
|
|
"; drawing hightiles so you can quickly browse without waiting\n"
|
|
|
|
"; for all of them to load. Set to 0 if you experience flickering.\n"
|
2011-05-18 22:44:09 +00:00
|
|
|
"lazytileselector = %d\n"
|
2011-01-09 18:53:06 +00:00
|
|
|
"; glusetexcache: 0:no, 1:yes, 2:compressed\n"
|
2011-06-18 13:02:08 +00:00
|
|
|
"; For best performance, keep this setting in sync with EDuke32\n"
|
2014-05-03 15:39:24 +00:00
|
|
|
"glusetexcache = %d ;;\n"
|
|
|
|
"glusememcache = %d ;;\n"
|
|
|
|
"gltexfiltermode = %d ;;\n"
|
|
|
|
"glanisotropy = %d ;;\n"
|
|
|
|
"r_downsize = %d ;;\n"
|
|
|
|
"r_texcompr = %d ;;\n"
|
|
|
|
"r_shadescale = %g ;;\n"
|
|
|
|
"r_usenewshading = %d ;;\n"
|
|
|
|
"r_usetileshades = %d ;;\n"
|
2013-10-28 21:26:28 +00:00
|
|
|
# ifdef POLYMER
|
2014-05-03 15:39:24 +00:00
|
|
|
"r_pr_artmapping = %d ;;\n"
|
2013-10-28 21:26:28 +00:00
|
|
|
# endif
|
2006-04-24 19:04:22 +00:00
|
|
|
"\n"
|
2006-05-12 21:55:05 +00:00
|
|
|
#endif
|
2011-07-10 15:39:21 +00:00
|
|
|
"; Use new aspect determination code? (classic/Polymost)\n"
|
2014-05-03 15:39:24 +00:00
|
|
|
"r_usenewaspect = %d ;;\n"
|
2012-04-09 19:22:00 +00:00
|
|
|
#ifndef RENDERTYPEWIN
|
2012-08-24 18:51:49 +00:00
|
|
|
"; Screen aspect for fullscreen, in the form WWHH (e.g. 1609 for 16:9).\n"
|
2014-05-03 15:39:24 +00:00
|
|
|
"; A value of 0 means to assume that the pixel aspect is square.\n"
|
|
|
|
"r_screenxy = %d ;;\n"
|
2012-04-09 19:22:00 +00:00
|
|
|
#endif
|
2011-07-10 15:39:21 +00:00
|
|
|
"\n"
|
2007-03-01 00:50:59 +00:00
|
|
|
|
2006-04-23 06:44:19 +00:00
|
|
|
#ifdef RENDERTYPEWIN
|
2006-04-24 19:04:22 +00:00
|
|
|
"; Maximum OpenGL mode refresh rate (Windows only, in Hertz)\n"
|
|
|
|
"maxrefreshfreq = %d\n"
|
|
|
|
"\n"
|
2014-02-11 17:55:45 +00:00
|
|
|
#endif
|
2007-04-22 03:44:54 +00:00
|
|
|
"; Window positioning, 0 = center, 1 = memory\n"
|
2007-04-23 23:36:21 +00:00
|
|
|
"windowpositioning = %d\n"
|
|
|
|
"windowposx = %d\n"
|
|
|
|
"windowposy = %d\n"
|
2007-04-22 03:44:54 +00:00
|
|
|
"\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"; 3D mode brightness setting\n"
|
2010-07-19 15:14:00 +00:00
|
|
|
"vid_gamma = %g\n"
|
|
|
|
"vid_brightness = %g\n"
|
|
|
|
"vid_contrast = %g\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"\n"
|
2008-10-14 08:40:59 +00:00
|
|
|
"; Game executable used for map testing\n"
|
|
|
|
"gameexecutable = %s\n"
|
|
|
|
"\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
#if 0
|
2006-04-24 19:04:22 +00:00
|
|
|
"; Sound sample frequency\n"
|
|
|
|
"; 0 - 6 KHz\n"
|
|
|
|
"; 1 - 8 KHz\n"
|
|
|
|
"; 2 - 11.025 KHz\n"
|
|
|
|
"; 3 - 16 KHz\n"
|
|
|
|
"; 4 - 22.05 KHz\n"
|
|
|
|
"; 5 - 32 KHz\n"
|
|
|
|
"; 6 - 44.1 KHz\n"
|
|
|
|
"samplerate = %d\n"
|
|
|
|
"\n"
|
|
|
|
"; Music playback\n"
|
|
|
|
"; 0 - Off\n"
|
|
|
|
"; 1 - On\n"
|
|
|
|
"music = %d\n"
|
|
|
|
"\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
#endif
|
2006-04-24 19:04:22 +00:00
|
|
|
"; Mouse sensitivity\n"
|
|
|
|
"mousesensitivity = %g\n"
|
|
|
|
"\n"
|
2008-05-16 19:51:38 +00:00
|
|
|
"; Mouse navigation\n"
|
2008-05-18 21:09:30 +00:00
|
|
|
"; 0 - No\n"
|
|
|
|
"; 1 - Yes\n"
|
2008-05-16 19:51:38 +00:00
|
|
|
"mousenavigation = %d\n"
|
|
|
|
"\n"
|
2008-10-09 21:09:16 +00:00
|
|
|
"; Mouse navigation acceleration\n"
|
2008-05-18 21:09:30 +00:00
|
|
|
"mousenavigationaccel = %d\n"
|
|
|
|
"\n"
|
|
|
|
"; Quick map cycling (SHIFT)+CTRL+X\n"
|
|
|
|
"; 0 - No\n"
|
|
|
|
"; 1 - Yes\n"
|
2008-05-16 19:51:38 +00:00
|
|
|
"quickmapcycling = %d\n"
|
|
|
|
"\n"
|
2010-11-27 22:12:24 +00:00
|
|
|
"; Reverse meaning of Q and W keys in side view mode\n"
|
|
|
|
"sideview_reversehorizrot = %d\n"
|
|
|
|
"\n"
|
2008-05-18 21:09:30 +00:00
|
|
|
"; Revert CTRL for tile selction\n"
|
|
|
|
"; 0 - WHEEL:scrolling, CTRL+WHEEL:zooming\n"
|
|
|
|
"; 1 - CTRL+WHEEL:scrolling, WHEEL:zooming\n"
|
|
|
|
"revertCTRL = %d\n"
|
|
|
|
"\n"
|
2010-11-27 22:12:24 +00:00
|
|
|
"; Scroll amount for WHEEL in the tile selection\n"
|
2008-05-18 21:09:30 +00:00
|
|
|
"scrollamount = %d\n"
|
|
|
|
"\n"
|
|
|
|
"; Turning acceleration+declaration\n"
|
|
|
|
"turnaccel = %d\n"
|
|
|
|
"\n"
|
|
|
|
"; Turning deceleration\n"
|
|
|
|
"turndecel = %d\n"
|
|
|
|
"\n"
|
2008-06-05 02:29:18 +00:00
|
|
|
"; Autosave map interval (seconds)\n"
|
|
|
|
"autosavesec = %d\n"
|
|
|
|
"\n"
|
2011-01-03 22:04:20 +00:00
|
|
|
"; Auto corruption check interval (seconds)\n"
|
|
|
|
"autocorruptchecksec = %d\n"
|
|
|
|
"\n"
|
2011-07-10 15:39:21 +00:00
|
|
|
"; Ignore 'already referenced wall' warnings\n"
|
|
|
|
"corruptcheck_noalreadyrefd = %d\n"
|
|
|
|
"\n"
|
2011-11-11 20:05:29 +00:00
|
|
|
"; Fix sprite sectnums when saving a map or entering 3D mode\n"
|
|
|
|
"fixmaponsave_sprites = %d\n"
|
|
|
|
"\n"
|
2013-01-16 20:38:56 +00:00
|
|
|
"; Keep texture stretching when dragging wall vertices\n"
|
|
|
|
"keeptexturestretch = %d\n"
|
|
|
|
"\n"
|
2008-10-09 21:09:16 +00:00
|
|
|
"; Height indicators (0:none, 1:only 2-sided&different, 2:all)\n"
|
2009-04-07 18:56:22 +00:00
|
|
|
"showheightindicators = %d\n"
|
2008-12-31 09:07:49 +00:00
|
|
|
"\n"
|
2010-08-11 22:37:45 +00:00
|
|
|
"; Ambience sound circles (0:none, 1:only in current sector, 2:all)\n"
|
|
|
|
"showambiencesounds = %d\n"
|
|
|
|
"\n"
|
2015-07-08 03:34:16 +00:00
|
|
|
"; Default filesystem mode\n"
|
|
|
|
"pathsearchmode = %d\n"
|
|
|
|
"\n"
|
2011-07-04 21:20:59 +00:00
|
|
|
"; TROR: Automatic grayout of plain (non-extended) sectors,\n"
|
|
|
|
"; toggled with Ctrl-A:\n"
|
|
|
|
"autogray = %d\n"
|
2013-01-16 20:38:56 +00:00
|
|
|
// "; TROR: Show inner gray walls, toggled with Ctrl-Alt-A:\n"
|
|
|
|
// "showinnergray = %d\n"
|
2011-07-04 21:20:59 +00:00
|
|
|
"\n"
|
2008-12-31 09:07:49 +00:00
|
|
|
"; 2D mode display type (0:classic, 1:textured, 2:textured/animated)\n"
|
2010-08-17 20:00:44 +00:00
|
|
|
"graphicsmode = %d\n"
|
|
|
|
"\n"
|
|
|
|
"; Sample rate in Hz\n"
|
|
|
|
"samplerate = %d\n"
|
2009-04-07 18:56:22 +00:00
|
|
|
"; Ambient sounds in 3D mode (0:off, 1:on)\n"
|
|
|
|
"ambiencetoggle = %d\n"
|
2010-05-22 23:41:18 +00:00
|
|
|
"parlock = %d\n"
|
|
|
|
"\n"
|
|
|
|
"; Try executing m32script on invalid command in the OSD? This makes\n"
|
|
|
|
"; typing m32script commands into the OSD directly possible.\n"
|
|
|
|
"osdtryscript = %d\n"
|
|
|
|
"\n"
|
2007-12-12 17:42:14 +00:00
|
|
|
#if 1
|
2006-04-24 19:04:22 +00:00
|
|
|
"; Key Settings\n"
|
|
|
|
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
|
|
|
|
"; +---------------------------------------------------------------------------------------------+\n"
|
|
|
|
"; | 01 3B 3C 3D 3E 3F 40 41 42 43 44 57 58 46 |\n"
|
|
|
|
"; |ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 SCROLL |\n"
|
|
|
|
"; | |\n"
|
|
|
|
"; |29 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E D2 C7 C9 45 B5 37 4A |\n"
|
|
|
|
"; | ` '1' '2' '3' '4' '5' '6' '7' '8' '9' '0' - = BACK INS HOME PGUP NUMLK KP/ KP* KP- |\n"
|
|
|
|
"; | |\n"
|
|
|
|
"; | 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 2B D3 CF D1 47 48 49 4E |\n"
|
|
|
|
"; |TAB Q W E R T Y U I O P [ ] \\ DEL END PGDN KP7 KP8 KP9 KP+ |\n"
|
|
|
|
"; | |\n"
|
|
|
|
"; | 3A 1E 1F 20 21 22 23 24 25 26 27 28 1C 4B 4C 4D |\n"
|
|
|
|
"; |CAPS A S D F G H J K L ; ' ENTER KP4 KP5 KP6 9C |\n"
|
|
|
|
"; | KPENTER|\n"
|
|
|
|
"; | 2A 2C 2D 2E 2F 30 31 32 33 34 35 36 C8 4F 50 51 |\n"
|
|
|
|
"; |LSHIFT Z X C V B N M , . / RSHIFT UP KP1 KP2 KP3 |\n"
|
|
|
|
"; | |\n"
|
|
|
|
"; | 1D 38 39 B8 9D CB D0 CD 52 53 |\n"
|
|
|
|
"; |LCTRL LALT SPACE RALT RCTRL LEFT DOWN RIGHT KP0 KP. |\n"
|
|
|
|
"; +---------------------------------------------------------------------------------------------+\n"
|
|
|
|
"\n"
|
|
|
|
"keyforward = %X\n"
|
|
|
|
"keybackward = %X\n"
|
|
|
|
"keyturnleft = %X\n"
|
|
|
|
"keyturnright = %X\n"
|
|
|
|
"keyrun = %X\n"
|
|
|
|
"keystrafe = %X\n"
|
2015-01-18 22:11:31 +00:00
|
|
|
// "keyfire = %X\n"
|
|
|
|
// "keyuse = %X\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"keystandhigh = %X\n"
|
|
|
|
"keystandlow = %X\n"
|
2015-01-18 22:11:31 +00:00
|
|
|
// "keylookup = %X\n"
|
|
|
|
// "keylookdown = %X\n"
|
|
|
|
// "keystrafeleft = %X\n"
|
|
|
|
// "keystraferight = %X\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"key2dmode = %X\n"
|
2015-01-18 22:11:31 +00:00
|
|
|
// "keyviewcycle = %X\n"
|
|
|
|
// "key2dzoomin = %X\n"
|
|
|
|
// "key2dzoomout = %X\n"
|
|
|
|
// "keychat = %X\n"
|
2007-03-01 00:50:59 +00:00
|
|
|
#endif
|
2007-03-24 23:17:56 +00:00
|
|
|
// "; Console key scancode, in hex\n"
|
2006-04-24 19:04:22 +00:00
|
|
|
"keyconsole = %X\n"
|
2012-07-06 11:27:52 +00:00
|
|
|
"\n"
|
|
|
|
"; This option allows you to remap keys in case some of them are not available\n"
|
|
|
|
"; (like on a notebook). It has to be a comma-separated list of SOURCE-TARGET\n"
|
|
|
|
"; scancode values, looked up in the keyboard map above. This also means that\n"
|
|
|
|
"; the key positions count, not their labels for non-US keyboards.\n"
|
|
|
|
";\n"
|
|
|
|
"; Example:\n"
|
|
|
|
"; 1. Map the backslash key (0x2B) to KPENTER (9C), since portable devices\n"
|
|
|
|
"; often don't have the latter\n"
|
|
|
|
"; 2. make KP0 (0x52) function as KP5 (0x4C), countering the inability to pan\n"
|
|
|
|
"; using Shift-KP5-KP8/2 in 3D mode\n"
|
|
|
|
"; remap = 2B-9C,52-4C\n"
|
2008-02-14 08:35:30 +00:00
|
|
|
"remap = ",
|
2006-04-24 19:04:22 +00:00
|
|
|
|
2013-10-13 09:08:31 +00:00
|
|
|
forcesetup, fullscreen, xdim2d, ydim2d, xdimgame, ydimgame, bppgame,
|
|
|
|
#ifdef USE_OPENGL
|
|
|
|
vsync,
|
|
|
|
#endif
|
2009-04-29 19:43:51 +00:00
|
|
|
#ifdef POLYMER
|
|
|
|
glrendmode,
|
|
|
|
#endif
|
2011-03-17 23:37:38 +00:00
|
|
|
editorgridextent, clamp(default_grid, 0, 9),
|
2011-03-04 08:50:58 +00:00
|
|
|
#ifdef USE_OPENGL
|
2011-05-18 22:44:09 +00:00
|
|
|
usemodels, usehightile, g_lazy_tileselector,
|
2011-12-03 13:13:28 +00:00
|
|
|
glusetexcache, glusememcache, gltexfiltermode, glanisotropy,r_downsize,glusetexcompr,
|
2013-10-28 21:26:28 +00:00
|
|
|
shadescale, r_usenewshading, r_usetileshades,
|
|
|
|
# ifdef POLYMER
|
|
|
|
pr_artmapping,
|
|
|
|
# endif
|
2006-05-12 21:55:05 +00:00
|
|
|
#endif
|
2012-04-09 19:22:00 +00:00
|
|
|
r_usenewaspect,
|
|
|
|
#ifndef RENDERTYPEWIN
|
|
|
|
r_screenxy,
|
|
|
|
#else
|
2014-02-11 17:55:45 +00:00
|
|
|
maxrefreshfreq,
|
2006-04-23 06:44:19 +00:00
|
|
|
#endif
|
2014-02-11 17:55:45 +00:00
|
|
|
windowpos, windowx, windowy,
|
2010-08-02 18:59:59 +00:00
|
|
|
vid_gamma_3d>=0?vid_gamma_3d:vid_gamma,
|
|
|
|
vid_brightness_3d>=0?vid_brightness_3d:vid_brightness,
|
|
|
|
vid_contrast_3d>=0?vid_contrast_3d:vid_contrast,
|
|
|
|
game_executable,
|
2007-03-01 00:50:59 +00:00
|
|
|
#if 0
|
|
|
|
option[7]>>4, option[2],
|
2007-12-12 17:42:14 +00:00
|
|
|
#endif
|
2011-03-08 23:02:38 +00:00
|
|
|
msens, unrealedlook, pk_uedaccel, quickmapcycling,
|
2010-11-27 22:12:24 +00:00
|
|
|
sideview_reversehrot,
|
2011-01-03 22:04:20 +00:00
|
|
|
revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave,autocorruptcheck,
|
2013-01-16 20:38:56 +00:00
|
|
|
corruptcheck_noalreadyrefd, fixmaponsave_sprites, keeptexturestretch,
|
2015-07-08 03:34:16 +00:00
|
|
|
showheightindicators,showambiencesounds,pathsearchmode,
|
2013-01-16 20:38:56 +00:00
|
|
|
autogray, //showinnergray,
|
2011-07-04 21:20:59 +00:00
|
|
|
graphicsmode,
|
2010-08-17 20:00:44 +00:00
|
|
|
MixRate,AmbienceToggle,ParentalLock, !!m32_osd_tryscript,
|
2015-01-18 22:11:31 +00:00
|
|
|
|
|
|
|
keys[BK_MOVEFORWARD],
|
|
|
|
keys[BK_MOVEBACKWARD],
|
|
|
|
keys[BK_TURNLEFT],
|
|
|
|
keys[BK_TURNRIGHT],
|
|
|
|
keys[BK_RUN],
|
|
|
|
keys[BK_STRAFE],
|
|
|
|
// keys[BK_SHOOT],
|
|
|
|
// keys[BK_OPEN],
|
|
|
|
keys[BK_MOVEUP],
|
|
|
|
keys[BK_MOVEDOWN],
|
|
|
|
// keys[BK_LOOKUP],
|
|
|
|
// keys[BK_LOOKDOWN],
|
|
|
|
// keys[BK_STRAFELEFT],
|
|
|
|
// keys[BK_STRAFERIGHT],
|
|
|
|
keys[BK_MODE2D_3D],
|
|
|
|
// keys[BK_PLAYERVIEW],
|
|
|
|
// keys[BK_ZOOMIN],
|
|
|
|
// keys[BK_ZOOMOUT],
|
|
|
|
// keys[BK_MESSAGE],
|
|
|
|
keys[BK_CONSOLE]
|
2006-04-24 19:04:22 +00:00
|
|
|
);
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2009-02-19 16:47:54 +00:00
|
|
|
for (i=0; i<256; i++)
|
2014-12-09 23:56:54 +00:00
|
|
|
if (keyremap[i]!=i)
|
2008-02-14 08:35:30 +00:00
|
|
|
{
|
2014-12-09 23:56:54 +00:00
|
|
|
Bfprintf(fp,first?"%02X-%02X":",%02X-%02X",i,keyremap[i]);
|
2008-02-14 08:35:30 +00:00
|
|
|
first=0;
|
|
|
|
}
|
2010-06-25 23:01:54 +00:00
|
|
|
Bfprintf(fp,"\n\n");
|
|
|
|
|
|
|
|
// save m32script history
|
2011-07-04 21:20:59 +00:00
|
|
|
Bfprintf(fp,"; Mapster32-script history\n");
|
2010-06-25 23:01:54 +00:00
|
|
|
first = 1;
|
|
|
|
for (i=scripthistend, j=0; first || i!=scripthistend; i=(i+1)%SCRIPTHISTSIZ, first=0)
|
|
|
|
{
|
|
|
|
if (scripthist[i])
|
|
|
|
Bfprintf(fp, "hist%d = %s\n", j++, scripthist[i]);
|
|
|
|
}
|
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
Bfclose(fp);
|
2006-04-23 06:44:19 +00:00
|
|
|
|
2014-02-22 08:03:02 +00:00
|
|
|
writesettings();
|
|
|
|
|
2006-04-24 19:04:22 +00:00
|
|
|
return 0;
|
2006-04-23 06:44:19 +00:00
|
|
|
}
|