From f070a571d90579175aca630d19838465f44e9ad0 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 25 Oct 2008 02:32:57 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1116 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymost.c | 10 ++----- polymer/eduke32/source/duke3d.h | 3 +++ polymer/eduke32/source/game.c | 39 +++++++++++++--------------- polymer/eduke32/source/player.c | 4 +-- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 908c8d53f..872ca66e0 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -902,10 +902,7 @@ void resizeglcheck() ratio = 1.2f; else if (glprojectionhacks == 1) { - if (gshang > 0) - ratio += gshang*0.33f; - if (gshang < 0) - ratio += -gshang*0.33f; + ratio += (gshang*gshang)*0.36f; } else if (glprojectionhacks == 2) { @@ -4179,10 +4176,7 @@ void polymost_drawrooms() ratio = 1.2f; else if (glprojectionhacks == 1) { - if (gshang > 0) - ratio += gshang*0.33f; - if (gshang < 0) - ratio += -gshang*0.33f; + ratio += (gshang*gshang)*0.36f; } else if (glprojectionhacks == 2) { diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index c870db769..63f0a0e1f 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -50,6 +50,9 @@ extern "C" { #include "function.h" +#define HORIZ_MIN -99 +#define HORIZ_MAX 299 + extern int g_ScriptVersion, g_Shareware, g_GameType; #define GAMEDUKE 0 diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 6dfd6f0dd..c78934af5 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -391,7 +391,7 @@ int gametext_z(int small, int starttile, int x,int y,const char *t,int s,int p,i if (small&4) { - rotatesprite(textsc(x< 4) { mpgametext(j,user_quote[i],(sintable[(totalclock<<5)&2047]>>11),2+8+16); j += textsc(8); } - else if (k > 2) { mpgametext(j,user_quote[i],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1); j += textsc(k<<1); } - else { mpgametext(j,user_quote[i],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1+32); j += textsc(k<<1); } + if (k > 4) { mpgametext(j,user_quote[i],(sintable[(totalclock<<5)&2047]>>11),2+8+16+128); j += textsc(8); } + else if (k > 2) { mpgametext(j,user_quote[i],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1+128); j += textsc(k<<1); } + else { mpgametext(j,user_quote[i],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1+32+128); j += textsc(k<<1); } } else { - if (k > 4) { mpgametext(j,user_quote[i],0,2+8+16); j += textsc(8); } - else if (k > 2) { mpgametext(j,user_quote[i],0,2+8+16+1); j += textsc(k<<1); } - else { mpgametext(j,user_quote[i],0,2+8+16+1+32); j += textsc(k<<1); } + if (k > 4) { mpgametext(j,user_quote[i],0,2+8+16+128); j += textsc(8); } + else if (k > 2) { mpgametext(j,user_quote[i],0,2+8+16+1+128); j += textsc(k<<1); } + else { mpgametext(j,user_quote[i],0,2+8+16+1+32+128); j += textsc(k<<1); } } l = gametextlen(USERQUOTE_LEFTOFFSET,stripcolorcodes(tempbuf,user_quote[i])); while (l > (ud.config.ScreenWidth - USERQUOTE_RIGHTOFFSET)) @@ -2802,9 +2802,9 @@ static void operatefta(void) else gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],0,2+8+16+1+32); return; } - if (j > 4) gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],(sintable[(totalclock<<5)&2047]>>11),2+8+16); - else if (j > 2) gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1); - else gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1+32); + if (j > 4) gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],(sintable[(totalclock<<5)&2047]>>11),2+8+16+128); + else if (j > 2) gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1+128); + else gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],(sintable[(totalclock<<5)&2047]>>11),2+8+16+1+32+128); } void FTA(int q, player_struct *p) @@ -4377,7 +4377,7 @@ void displayrooms(int snum,int smoothratio) short tang; int tiltcx,tiltcy,tiltcs=0; // JBF 20030807 - if (pub > 0) // JBF 20040101: redraw background always + if (pub > 0 || getrendermode() >= 3) // JBF 20040101: redraw background always { if (getrendermode() >= 3 || ud.screen_size > 8 || (ud.screen_size == 8 && ud.statusbarscale<100)) drawbackground(); @@ -4419,9 +4419,6 @@ void displayrooms(int snum,int smoothratio) drawrooms(s->x,s->y,s->z-(4<<8),ud.cameraang,s->yvel,s->sectnum); animatesprites(s->x,s->y,ud.cameraang,smoothratio); drawmasks(); - - if (getrendermode() >= 3) - drawbackground(); } else { @@ -4553,8 +4550,8 @@ void displayrooms(int snum,int smoothratio) if (ud.cameraz > fz-(4<<8)) ud.cameraz = fz-(4<<8); } - if (ud.camerahoriz > 299) ud.camerahoriz = 299; - else if (ud.camerahoriz < -99) ud.camerahoriz = -99; + if (ud.camerahoriz > HORIZ_MAX) ud.camerahoriz = HORIZ_MAX; + else if (ud.camerahoriz < HORIZ_MIN) ud.camerahoriz = HORIZ_MIN; OnEvent(EVENT_DISPLAYROOMS, g_player[screenpeek].ps->i, screenpeek, -1); @@ -4604,9 +4601,6 @@ void displayrooms(int snum,int smoothratio) animatesprites(ud.camerax,ud.cameray,ud.cameraang,smoothratio); drawmasks(); - if (getrendermode() >= 3) - drawbackground(); - if (screencapt == 1) { setviewback(); @@ -11445,7 +11439,10 @@ MAIN_LOOP_RESTART: if (r_maxfps == 0 || j >= nextrender) { nextrender += g_FrameDelay; + displayrooms(screenpeek,i); + if (getrendermode() >= 3) + drawbackground(); displayrest(i); if (g_player[myconnectindex].gotvote == 0 && voting != -1 && voting != myconnectindex) @@ -12342,8 +12339,8 @@ FAKEHORIZONLY: myhoriz -= (myhardlanding<<4); } - if (myhoriz > 299) myhoriz = 299; - else if (myhoriz < -99) myhoriz = -99; + if (myhoriz > HORIZ_MAX) myhoriz = HORIZ_MAX; + else if (myhoriz < HORIZ_MIN) myhoriz = HORIZ_MIN; if (p->knee_incs > 0) { diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index ce016b9d9..0056676f3 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -4625,8 +4625,8 @@ HORIZONLY: } p->horiz += g_player[snum].sync->horz; - if (p->horiz > 299) p->horiz = 299; - else if (p->horiz < -99) p->horiz = -99; + if (p->horiz > HORIZ_MAX) p->horiz = HORIZ_MAX; + else if (p->horiz < HORIZ_MIN) p->horiz = HORIZ_MIN; //Shooting code/changes