This changes the map scaling feature to operate on sectors selected in the editor rather than the whole map

git-svn-id: https://svn.eduke32.com/eduke32@457 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2007-01-15 00:59:49 +00:00
parent c7def8d139
commit 699f26d1e7

View file

@ -51,7 +51,7 @@ char *startwin_labeltext = "Starting Mapster32...";
char *Help2d[]= { char *Help2d[]= {
" 'A = Autosave toggle", " 'A = Autosave toggle",
" 'J = Jump to location", " 'J = Jump to location",
" 'L = Sprite/wall location", " 'L = Adjust sprite/wall coords",
" 'S = Sprite size", " 'S = Sprite size",
" '3 = Caption mode", " '3 = Caption mode",
#ifdef VULGARITY #ifdef VULGARITY
@ -137,7 +137,7 @@ char *Help3d[]= {
" ' S = CHANGE SHADE", " ' S = CHANGE SHADE",
" ' M = CHANGE EXTRA", " ' M = CHANGE EXTRA",
" ' V = CHANGE VISIBILITY", " ' V = CHANGE VISIBILITY",
" ' L = CHANGE LOCATION", " ' L = CHANGE OBJECT COORDINATES",
" ' C = CHANGE GLOBAL SHADE", " ' C = CHANGE GLOBAL SHADE",
"", "",
" ' ENTER = PASTE GRAPHIC ONLY", " ' ENTER = PASTE GRAPHIC ONLY",
@ -4473,7 +4473,7 @@ int ExtInit(void)
"faster after the first time they are loaded."); "faster after the first time they are loaded.");
#else #else
i = 1; i = 1;
#endif #endif
if (i) if (i)
glusetexcompr = glusetexcache = glusetexcachecompression = 1; glusetexcompr = glusetexcache = glusetexcachecompression = 1;
else glusetexcache = glusetexcachecompression = 0; else glusetexcache = glusetexcachecompression = 0;
@ -5677,9 +5677,9 @@ static void FuncMenuOpts(void)
printext16(8,ydim-STATUS2DSIZ+72,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+72,11,-1,snotbuf,0);
Bsprintf(snotbuf,"Global Z coord shift"); Bsprintf(snotbuf,"Global Z coord shift");
printext16(8,ydim-STATUS2DSIZ+80,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+80,11,-1,snotbuf,0);
Bsprintf(snotbuf,"Scale map up"); Bsprintf(snotbuf,"Scale map section up");
printext16(8,ydim-STATUS2DSIZ+88,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+88,11,-1,snotbuf,0);
Bsprintf(snotbuf,"Scale map down"); Bsprintf(snotbuf,"Scale map section down");
printext16(8,ydim-STATUS2DSIZ+96,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+96,11,-1,snotbuf,0);
Bsprintf(snotbuf,"Global shade divide"); Bsprintf(snotbuf,"Global shade divide");
printext16(8,ydim-STATUS2DSIZ+104,11,-1,snotbuf,0); printext16(8,ydim-STATUS2DSIZ+104,11,-1,snotbuf,0);
@ -5923,30 +5923,41 @@ static void FuncMenu(void)
break; break;
case 5: case 5:
{ {
for (i=Bsprintf(disptext,"Scale map up"); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"Scale map section up"); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Map size multiplier: ",1,8,0); j=getnumber16("Map size multiplier: ",1,8,0);
if (j!=1) if (j!=1)
{ {
for (i=0;i<numsectors;i++) int k, l, w, currsector, start_wall, end_wall;
for (i = 0; i < highlightsectorcnt; i++)
{ {
sector[i].ceilingz *= j; currsector = highlightsector[i];
sector[i].floorz *= j; sector[currsector].ceilingz *= j;
} sector[currsector].floorz *= j;
for (i=0;i<numwalls;i++) // Do all the walls in the sector
{ start_wall = sector[currsector].wallptr;
wall[i].x *= j; end_wall = start_wall + sector[currsector].wallnum;
wall[i].y *= j; for (w = start_wall; w < end_wall; w++)
wall[i].yrepeat = min(wall[i].yrepeat/j,255); {
} wall[w].x *= j;
for (i=0;i<MAXSPRITES;i++) wall[w].y *= j;
{ wall[w].yrepeat = min(wall[w].yrepeat/j,255);
sprite[i].x *= j; }
sprite[i].y *= j; for (k=0;k<highlightsectorcnt;k++)
sprite[i].z *= j; {
sprite[i].xrepeat = max(sprite[i].xrepeat*j,1); w = headspritesect[highlightsector[k]];
sprite[i].yrepeat = max(sprite[i].yrepeat*j,1); while (w >= 0)
{
l = nextspritesect[w];
sprite[w].x *= j;
sprite[w].y *= j;
sprite[w].z *= j;
sprite[w].xrepeat = max(sprite[w].xrepeat*j,1);
sprite[w].yrepeat = max(sprite[w].yrepeat*j,1);
w = l;
}
}
} }
printmessage16("Map scaled"); printmessage16("Map scaled");
} }
@ -5956,30 +5967,41 @@ static void FuncMenu(void)
break; break;
case 6: case 6:
{ {
for (i=Bsprintf(disptext,"Scale map down"); i < dispwidth; i++) disptext[i] = ' '; for (i=Bsprintf(disptext,"Scale map section down"); i < dispwidth; i++) disptext[i] = ' ';
if (editval) if (editval)
{ {
j=getnumber16("Map size divisor: ",1,8,0); j=getnumber16("Map size divisor: ",1,8,0);
if (j!=1) if (j!=1)
{ {
for (i=0;i<numsectors;i++) int k, l, w, currsector, start_wall, end_wall;
for (i = 0; i < highlightsectorcnt; i++)
{ {
sector[i].ceilingz /= j; currsector = highlightsector[i];
sector[i].floorz /= j; sector[currsector].ceilingz /= j;
} sector[currsector].floorz /= j;
for (i=0;i<numwalls;i++) // Do all the walls in the sector
{ start_wall = sector[currsector].wallptr;
wall[i].x /= j; end_wall = start_wall + sector[currsector].wallnum;
wall[i].y /= j; for (w = start_wall; w < end_wall; w++)
wall[i].yrepeat = min(wall[i].yrepeat*j,255); {
} wall[w].x /= j;
for (i=0;i<MAXSPRITES;i++) wall[w].y /= j;
{ wall[w].yrepeat = min(wall[w].yrepeat*j,255);
sprite[i].x /= j; }
sprite[i].y /= j; for (k=0;k<highlightsectorcnt;k++)
sprite[i].z /= j; {
sprite[i].xrepeat = max(sprite[i].xrepeat/j,1); w = headspritesect[highlightsector[k]];
sprite[i].yrepeat = max(sprite[i].yrepeat/j,1); while (w >= 0)
{
l = nextspritesect[w];
sprite[w].x /= j;
sprite[w].y /= j;
sprite[w].z /= j;
sprite[w].xrepeat = max(sprite[w].xrepeat/j,1);
sprite[w].yrepeat = max(sprite[w].yrepeat/j,1);
w = l;
}
}
} }
printmessage16("Map scaled"); printmessage16("Map scaled");
} }