Mapster32: honor r_usenewaspect, especially it being off.

For this, add a setaspect_new() setup/restore pair in M32_DrawRoomsAndMasks()
like for G_DrawRooms(). With this, changing viewingrange/aspect via m32script
(in a.m32: [7] -- [9] on the upper row) can only be done in r_usenewaspect 0,
though.

git-svn-id: https://svn.eduke32.com/eduke32@5182 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2015-05-10 10:55:30 +00:00
parent f186ecc58a
commit 68f52a4257
2 changed files with 17 additions and 7 deletions

View File

@ -491,6 +491,13 @@ void M32_ResetFakeRORTiles(void)
void M32_DrawRoomsAndMasks(void)
{
static int srchwall = -1;
const int32_t tmpyx=yxaspect, tmpvr=viewingrange;
if (r_usenewaspect)
{
newaspect_enable = 1;
setaspect_new();
}
VM_OnEvent(EVENT_PREDRAW3DSCREEN, -1);
@ -532,6 +539,12 @@ void M32_DrawRoomsAndMasks(void)
screencapture("mcapxxxx.tga", 0, "Mapster32, from script");
g_doScreenShot = 0;
}
if (r_usenewaspect)
{
newaspect_enable = 0;
setaspect(tmpvr, tmpyx);
}
}
int32_t app_main(int32_t argc, const char **argv)
@ -555,7 +568,6 @@ int32_t app_main(int32_t argc, const char **argv)
wm_setapptitle(AppProperName);
editstatus = 1;
newaspect_enable = 1;
if ((i = CallExtPreInit(argc,argv)) < 0) return -1;

View File

@ -3657,22 +3657,20 @@ static void drawtileinfo(const char *title,int32_t x,int32_t y,int32_t picnum,in
{
char buf[64];
int32_t small = (xdimgame<=640);
int32_t oviewingrange=viewingrange, oyxaspect=yxaspect;
if (tilesiz[picnum].x>0 && tilesiz[picnum].y>0)
{
double scalediv;
int32_t scale=65536;
int32_t x1 = x+80;
if (small)
x1 /= 2;
x1 = (int32_t)(x1 * 320.0/xdimgame);
scalediv = max(tilesiz[picnum].x,tilesiz[picnum].y)/24.0;
scale = (int32_t)((double)scale/scalediv);
const double scalediv = max(tilesiz[picnum].x,tilesiz[picnum].y)/24.0;
const int32_t scale = (int32_t)(65536.0/scalediv);
setaspect(65536L, (int32_t)divscale16(ydim*320L,xdim*200L));
const int32_t oviewingrange=viewingrange, oyxaspect=yxaspect;
setaspect(65536, divscale16(ydim*320, xdim*200));
// +1024: prevents rotatesprite from setting aspect itself
rotatesprite_fs((x1+13)<<16,(y+11)<<16,scale,0, picnum,shade,pal, 2+1024);
setaspect(oviewingrange, oyxaspect);