From 68f52a42576c85a7558b4e6068e983069376681d Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 10 May 2015 10:55:30 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/src/build.c | 14 +++++++++++++- polymer/eduke32/source/astub.c | 10 ++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 32dbe681a..8f20d829f 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -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; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index dfbf99b8e..b761ef69f 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -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);