m32: have default grid size in configuration

git-svn-id: https://svn.eduke32.com/eduke32@1621 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2010-04-11 13:04:53 +00:00
parent 0c63340d4a
commit 32a86d8fce
4 changed files with 16 additions and 17 deletions

View file

@ -112,7 +112,7 @@ extern int16_t searchsector, searchwall, searchstat; //search output
int32_t osearchx, osearchy; //old search input int32_t osearchx, osearchy; //old search input
extern int16_t pointhighlight, linehighlight, highlightcnt; extern int16_t pointhighlight, linehighlight, highlightcnt;
int32_t grid = 3, gridlock = 1, showtags = 1; int32_t grid = 3, autogrid = 0, gridlock = 1, showtags = 1;
int32_t zoom = 768, gettilezoom = 1; int32_t zoom = 768, gettilezoom = 1;
int32_t lastpm16time = 0; int32_t lastpm16time = 0;

View file

@ -64,7 +64,8 @@ extern char keys[NUMBUILDKEYS];
extern char remap[256]; extern char remap[256];
extern int32_t remapinit; extern int32_t remapinit;
extern double msens; extern double msens;
extern int32_t editorgridextent; extern int32_t editorgridextent, grid, autogrid;
static int32_t default_grid=3;
extern int32_t showheightindicators; extern int32_t showheightindicators;
extern int32_t graphicsmode; extern int32_t graphicsmode;
extern int32_t AmbienceToggle; extern int32_t AmbienceToggle;
@ -139,6 +140,13 @@ int32_t loadsetup(const char *fn)
if (readconfig(fp, "bpp", val, VL) > 0) bppgame = Batoi(val); if (readconfig(fp, "bpp", val, VL) > 0) bppgame = Batoi(val);
if (readconfig(fp, "vsync", val, VL) > 0) vsync = Batoi(val)?1:0; if (readconfig(fp, "vsync", val, VL) > 0) vsync = Batoi(val)?1:0;
if (readconfig(fp, "editorgridextent", val, VL) > 0) editorgridextent = max(min(524288,Batoi(val)),65536); if (readconfig(fp, "editorgridextent", val, VL) > 0) editorgridextent = max(min(524288,Batoi(val)),65536);
if (readconfig(fp, "grid", val, VL) > 0)
{
grid = Batoi(val);
default_grid = grid;
autogrid = (grid==9);
grid = min(max(0, grid), 8);
}
#ifdef POLYMER #ifdef POLYMER
if (readconfig(fp, "rendmode", val, VL) > 0) { i = Batoi(val); glrendmode = i; } if (readconfig(fp, "rendmode", val, VL) > 0) { i = Batoi(val); glrendmode = i; }
#endif #endif
@ -306,6 +314,8 @@ int32_t writesetup(const char *fn)
#endif #endif
"; Grid limits\n" "; Grid limits\n"
"editorgridextent = %d\n" "editorgridextent = %d\n"
"; Startup grid size (0-8, 9 is automatic)\n"
"grid = %d\n"
"\n" "\n"
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
"; OpenGL mode options\n" "; OpenGL mode options\n"
@ -453,7 +463,7 @@ int32_t writesetup(const char *fn)
#ifdef POLYMER #ifdef POLYMER
glrendmode, glrendmode,
#endif #endif
editorgridextent, editorgridextent, min(max(0, default_grid), 9),
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
usemodels, usehightile, usemodels, usehightile,
glusetexcache, gltexfiltermode, glanisotropy, glusetexcache, gltexfiltermode, glanisotropy,

View file

@ -7733,8 +7733,6 @@ static void Keys2d(void)
} }
{ {
static int32_t autogrid = 0;
if (keystatus[KEYSC_G]) // G (grid on/off) if (keystatus[KEYSC_G]) // G (grid on/off)
{ {
if (autogrid) if (autogrid)
@ -7749,17 +7747,8 @@ static void Keys2d(void)
grid += eitherSHIFT?-1:1; grid += eitherSHIFT?-1:1;
if (grid == -1 || grid == 9) if (grid == -1 || grid == 9)
{ {
switch (grid) autogrid = 1;
{ grid = 0;
case -1:
autogrid = 1;
grid = 8;
break;
case 9:
autogrid = 1;
grid = 0;
break;
}
} }
} }
if (autogrid) Bsprintf(tempbuf,"Grid size: 9 (autosize)"); if (autogrid) Bsprintf(tempbuf,"Grid size: 9 (autosize)");

View file

@ -106,7 +106,7 @@ void SetSLIMEPalette();
void SetWATERPalette(); void SetWATERPalette();
void SetGAMEPalette(); void SetGAMEPalette();
extern int32_t grid; extern int32_t grid, autogrid;
static void EditSpriteData(int16_t spritenum); static void EditSpriteData(int16_t spritenum);
static void EditWallData(int16_t wallnum); static void EditWallData(int16_t wallnum);