diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 012b4df27..82f795a16 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3584,6 +3584,7 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio) const int32_t vr = divscale22(1,sprite[p->i].yrepeat+28); const int32_t software_screen_tilting = (getrendermode() == REND_CLASSIC && ((ud.screen_tilting && p->rotscrnang && !g_fakeMultiMode))); + int32_t pixelDoubling = 0; if (!r_usenewaspect) { @@ -3667,13 +3668,19 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio) tmpvr = i>>1; tmpyx = (65536*ydim*8)/(xdim*5); } - else if (getrendermode() >= REND_POLYMOST && (ud.screen_tilting && !g_fakeMultiMode) /*&& (p->rotscrnang || p->orotscrnang)*/) + else if (getrendermode() >= REND_POLYMOST && (ud.screen_tilting && !g_fakeMultiMode)) { #ifdef USE_OPENGL setrollangle(p->orotscrnang + mulscale16(((p->rotscrnang - p->orotscrnang + 1024)&2047)-1024, smoothratio)); #endif p->orotscrnang = p->rotscrnang; // JBF: save it for next time } + else if (!ud.detail && getrendermode()==REND_CLASSIC) + { + pixelDoubling = 1; + g_halveScreenArea = 1; + G_UpdateScreenArea(); + } if (p->newowner < 0) { @@ -3837,26 +3844,39 @@ void G_DrawRooms(int32_t snum, int32_t smoothratio) rotatesprite_win(160<<16,100<<16,i,tang+512,TILE_TILT,0,0,4+2+64); walock[TILE_TILT] = 199; } - } - - if (!ud.detail && getrendermode()==REND_CLASSIC && ((xdim|ydim)&1)==0) - { - begindrawing(); + else if (pixelDoubling) { - uint8_t *const f = (uint8_t *)frameplace; - int32_t x, y; + Bassert(g_halfScreen.xdimen!=0); + g_halveScreenArea = 0; + G_UpdateScreenArea(); - for (x=0; x=0; dy--) +// for (dx=2*xd-1; dx>=0; dx--) + for (dx=2*xd-4; dx>=0; dx-=4) + { + const int32_t ylsrc = ylookup[y1+(dy>>1)]; + const int32_t yldst = ylookup[y1+dy]; + +// f[yldst+x1+dx] = f[ylsrc+x1+(dx>>1)]; + uint8_t pixr = f[ylsrc+x1+((dx+3)>>1)]; + uint8_t pixl = f[ylsrc+x1+((dx+1)>>1)]; + + *(uint32_t *)&f[yldst+x1+dx] = pixl|(pixl<<8)|(pixr<<16)|(pixr<<24); + } + } + enddrawing(); } - enddrawing(); } G_RestoreInterpolations(); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index b601c1aea..9ec039528 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -43,6 +43,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int32_t g_testLua = 0; #endif +halfdimen_t g_halfScreen; +int32_t g_halveScreenArea = 0; + static int32_t g_whichPalForPlayer = 9; static uint8_t precachehightile[2][MAXTILES>>3]; @@ -589,7 +592,7 @@ void G_UpdateScreenArea(void) const int32_t ss = max(ud.screen_size-8,0); const int32_t x1 = scale(ss,xdim,160); - const int32_t x2 = xdim-x1; + int32_t x2 = xdim-x1; int32_t y1 = ss; int32_t y2 = 200; @@ -611,9 +614,22 @@ void G_UpdateScreenArea(void) y2 -= (ss+scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100)); y1 = scale(y1,ydim,200); - y2 = scale(y2,ydim,200); + y2 = scale(y2,ydim,200)+(getrendermode() != REND_CLASSIC); - setview(x1,y1,x2-1,y2-(getrendermode() == REND_CLASSIC)); + if (g_halveScreenArea) + { + int32_t ourxdimen=x2-x1, ourydimen=y2-y1; + + g_halfScreen.x1 = x1; + g_halfScreen.y1 = y1; + g_halfScreen.xdimen = (ourxdimen>>1); + g_halfScreen.ydimen = (ourydimen>>1); + + x2 = x1 + (ourxdimen>>1); + y2 = y1 + (ourydimen>>1); + } + + setview(x1,y1,x2-1,y2-1); } G_GetCrosshairColor(); diff --git a/polymer/eduke32/source/premap.h b/polymer/eduke32/source/premap.h index 88c3b5689..126239d7d 100644 --- a/polymer/eduke32/source/premap.h +++ b/polymer/eduke32/source/premap.h @@ -23,6 +23,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __premap_h__ #define __premap_h__ +typedef struct { + int32_t x1, y1; + int32_t xdimen, ydimen; +} halfdimen_t; + +extern halfdimen_t g_halfScreen; +extern int32_t g_halveScreenArea; + extern int32_t g_levelTextTime; extern int32_t g_numRealPalettes; extern int32_t voting,vote_map,vote_episode;