From c21b1deae29c2b46777a170ad6a47541d6e1bca3 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 11 Oct 2008 11:50:02 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1097 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/include/osd.h | 2 +- polymer/build/src/osd.c | 4 ++-- polymer/eduke32/source/astub.c | 2 +- polymer/eduke32/source/config.c | 6 ++++-- polymer/eduke32/source/duke3d.h | 2 +- polymer/eduke32/source/funct.h | 2 +- polymer/eduke32/source/game.c | 15 +++++++++------ polymer/eduke32/source/menus.c | 2 +- polymer/eduke32/source/osdcmds.c | 3 ++- polymer/eduke32/source/premap.c | 3 ++- polymer/eduke32/source/startwin.game.c | 4 +++- 11 files changed, 27 insertions(+), 18 deletions(-) diff --git a/polymer/build/include/osd.h b/polymer/build/include/osd.h index b421db688..18388672d 100644 --- a/polymer/build/include/osd.h +++ b/polymer/build/include/osd.h @@ -23,7 +23,7 @@ typedef struct _symbol } symbol_t; symbol_t *symbols; -const char *stripcolorcodes(const char *in, char *out); +const char *stripcolorcodes(char *out, const char *in); #define OSD_ALIAS 1337 #define OSD_UNALIASED 1338 diff --git a/polymer/build/src/osd.c b/polymer/build/src/osd.c index 237c43df3..dae40c763 100644 --- a/polymer/build/src/osd.c +++ b/polymer/build/src/osd.c @@ -128,7 +128,7 @@ static int (*_getrowheight)(int) = _internal_getrowheight; // ^S# sets a shade, range is 0-7 equiv to shades 0-14 // ^O resets formatting to defaults -const char *stripcolorcodes(const char *in, char *out) +const char *stripcolorcodes(char *out, const char *in) { char *ptr = out; @@ -1438,7 +1438,7 @@ void OSD_Printf(const char *fmt, ...) if (osdlog&&(!logcutoff||linecnt #endif -#define BUILDDATE " 20081005" +#define BUILDDATE " 20081011" #define VERSION " 1.2.0devel" static int floor_over_floor; diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index ffc72fb69..c414525d4 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -592,6 +592,7 @@ extern palette_t crosshair_colors; extern palette_t default_crosshair_colors; extern char mod_dir[BMAX_PATH]; extern int r_maxfps; +extern int g_NoSetup; int32 CONFIG_ReadSetup(void) { @@ -649,7 +650,7 @@ int32 CONFIG_ReadSetup(void) } #ifdef _WIN32 - if (mod_dir[0] == '/') + if (g_NoSetup == 0 && mod_dir[0] == '/') SCRIPT_GetString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]); #endif @@ -1139,7 +1140,8 @@ void CONFIG_WriteSetup(void) SCRIPT_PutString(ud.config.scripthandle, "Setup","SelectedGRP",&duke3dgrp[0]); #ifdef _WIN32 - SCRIPT_PutString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]); + if (g_NoSetup == 0) + SCRIPT_PutString(ud.config.scripthandle, "Setup","ModDir",&mod_dir[0]); #endif { diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index edeb6e719..6528a76a2 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define APPNAME "EDuke32" #define VERSION " 1.5.0devel" // this is checked against http://eduke32.com/VERSION -#define BUILDDATE " 20081005" +#define BUILDDATE " 20081011" #define HEAD2 APPNAME VERSION BUILDDATE #ifdef __cplusplus diff --git a/polymer/eduke32/source/funct.h b/polymer/eduke32/source/funct.h index fd78255f9..85b004806 100644 --- a/polymer/eduke32/source/funct.h +++ b/polymer/eduke32/source/funct.h @@ -108,7 +108,7 @@ extern void savetemp(const char *fn,int daptr,int dasiz); extern int loadplayer(int spot); extern int saveplayer(int spot); extern int menutext_(int x,int y,int s,int p,char *t,int bits); -#define menutext(x,y,s,p,t) menutext_(x,y,s,p,(char *)stripcolorcodes(t,menutextbuf),10+16) +#define menutext(x,y,s,p,t) menutext_(x,y,s,p,(char *)stripcolorcodes(menutextbuf,t),10+16) extern void menus(void); extern void palto(int r,int g,int b,int e); extern void playanm(const char *fn,char); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 58d8e7c10..8417adef2 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -65,7 +65,7 @@ int cameradist = 0, cameraclock = 0; static int playerswhenstarted; static int qe,cp; static int g_CommandSetup = 0; -static int g_NoSetup = 0; +int g_NoSetup = 0; static int g_NoAutoLoad = 0; static int g_NoSound = 0; static int g_NoMusic = 0; @@ -244,6 +244,9 @@ static inline int sbarsc(int sc) static inline int textsc(int sc) { + // prevent ridiculousness to a degree + if (xdim <= 640) return sc; + if (xdim <= 800) return scale(sc,min(300,ud.textscale),100); return scale(sc,ud.textscale,100); } @@ -2714,8 +2717,8 @@ static void operatefta(void) if (g_player[screenpeek].ps->fta > 1 && (g_player[screenpeek].ps->ftq < 115 || g_player[screenpeek].ps->ftq > 117)) { - if (g_player[screenpeek].ps->fta > 5) - k += 6; + if (g_player[screenpeek].ps->fta > 6) + k += 7; else k += g_player[screenpeek].ps->fta; /*if (g_player[screenpeek].ps->fta > 2) k += 3; else k += 1; */ @@ -2739,7 +2742,7 @@ static void operatefta(void) 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); } - l = gametextlen(USERQUOTE_LEFTOFFSET,stripcolorcodes(user_quote[i],tempbuf)); + l = gametextlen(USERQUOTE_LEFTOFFSET,stripcolorcodes(tempbuf,user_quote[i])); while (l > (ud.config.ScreenWidth - USERQUOTE_RIGHTOFFSET)) { l -= (ud.config.ScreenWidth-USERQUOTE_RIGHTOFFSET); @@ -3013,7 +3016,7 @@ static int strget_(int small,int x,int y,char *t,int dalen,int c) } c = 4-(sintable[(totalclock<<4)&2047]>>11); - i = gametextlen(USERQUOTE_LEFTOFFSET,stripcolorcodes(t,tempbuf)); + i = gametextlen(USERQUOTE_LEFTOFFSET,stripcolorcodes(tempbuf,t)); while (i > (ud.config.ScreenWidth - USERQUOTE_RIGHTOFFSET)) { i -= (ud.config.ScreenWidth - USERQUOTE_RIGHTOFFSET); @@ -3088,7 +3091,7 @@ static void typemode(void) } adduserquote(recbuf); quotebot += 8; - l = gametextlen(USERQUOTE_LEFTOFFSET,stripcolorcodes(recbuf,tempbuf)); + l = gametextlen(USERQUOTE_LEFTOFFSET,stripcolorcodes(tempbuf,recbuf)); while (l > (ud.config.ScreenWidth - USERQUOTE_RIGHTOFFSET)) { l -= (ud.config.ScreenWidth - USERQUOTE_RIGHTOFFSET); diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 618d53218..bb9602dbe 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -878,7 +878,7 @@ void menus(void) { x = strget(d-50,37,buf,30,0); - while (Bstrlen(stripcolorcodes(buf,tempbuf)) > 10) + while (Bstrlen(stripcolorcodes(tempbuf,buf)) > 10) { buf[Bstrlen(buf)-1] = '\0'; inputloc--; diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 68dc45f77..15d3653eb 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -727,6 +727,7 @@ cvarmappings cvar[] = { "hud_glowingquotes", "hud_glowingquotes: enable/disable \"glowing\" quote text", (void*)&hud_glowingquotes, CVAR_BOOL, 0, 0, 1 }, { "hud_showmapname", "hud_showmapname: enable/disable map name display on load", (void*)&hud_showmapname, CVAR_BOOL, 0, 0, 1 }, { "hud_stats", "hud_stats: enable/disable level statistics display\n", (void*)&ud.levelstats, CVAR_BOOL, 0, 0, 1 }, + { "hud_textscale", "hud_textscale: sets multiplayer chat message size\n", (void*)&ud.textscale, CVAR_INT, 0, 100, 400 }, { "cl_autoaim", "cl_autoaim: enable/disable weapon autoaim", (void*)&ud.config.AutoAim, CVAR_INT|CVAR_MULTI, 0, 0, 2 }, { "cl_automsg", "cl_automsg: enable/disable automatically sending messages to all players", (void*)&ud.automsg, CVAR_BOOL, 0, 0, 1 }, @@ -998,7 +999,7 @@ static int osdcmd_name(const osdfuncparm_t *parm) Bstrcpy(tempbuf,parm->parms[0]); - while (Bstrlen(stripcolorcodes(tempbuf,namebuf)) > 10) + while (Bstrlen(stripcolorcodes(namebuf,tempbuf)) > 10) tempbuf[Bstrlen(tempbuf)-1] = '\0'; Bstrncpy(myname,tempbuf,sizeof(myname)-1); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 51faa914d..06c880bdb 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1179,7 +1179,8 @@ static void prelevel(char g) { wall[j].picnum = MIRROR; wall[j].overpicnum = MIRROR; - wall[j].pal = 4; + if (wall[mirrorwall[i]].pal == 4) + wall[j].pal = 4; } } } diff --git a/polymer/eduke32/source/startwin.game.c b/polymer/eduke32/source/startwin.game.c index 93b0f3192..3f0e4b37d 100644 --- a/polymer/eduke32/source/startwin.game.c +++ b/polymer/eduke32/source/startwin.game.c @@ -75,6 +75,8 @@ static int getfilenames(char *path) extern char TEXCACHEDIR[]; #endif +extern int g_NoSetup; + static void PopulateForm(int pgs) { HWND hwnd; @@ -667,7 +669,7 @@ int startwin_run(void) duke3dgrp = settings.selectedgrp; g_GameType = settings.game; - if (settings.gamedir != NULL) + if (g_NoSetup == 0 && settings.gamedir != NULL) Bstrcpy(mod_dir,settings.gamedir); else Bsprintf(mod_dir,"/");