From d7e30a65ddb028601fb806d26e178c1f8f194527 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 25 Mar 2013 04:31:09 +0000 Subject: [PATCH] Relax CAPITALIZATION restrictions. git-svn-id: https://svn.eduke32.com/eduke32@3606 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 1 + polymer/eduke32/build/src/engine.c | 8 ++++++++ polymer/eduke32/source/game.c | 15 +++++++++++++-- polymer/eduke32/source/gamedef.c | 8 ++++---- polymer/eduke32/source/input.c | 1 - polymer/eduke32/source/net.c | 4 ++-- polymer/eduke32/source/premap.c | 4 ++-- 7 files changed, 30 insertions(+), 11 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index c0ffe7e42..6209bc61c 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -732,6 +732,7 @@ int32_t clipmapinfo_load(void); #endif int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, int16_t dacursectnum); void set_tilesiz(int32_t picnum, int16_t dasizx, int16_t dasizy); +int32_t tile_exists(int32_t picnum); int32_t loadpics(const char *filename, int32_t askedsize); void loadtile(int16_t tilenume); int32_t qloadkvx(int32_t voxindex, const char *filename); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index c45502d81..40e341908 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -10612,6 +10612,14 @@ void set_tilesiz(int32_t picnum, int16_t dasizx, int16_t dasizy) set_picsiz(picnum); } +int32_t tile_exists(int32_t picnum) +{ + if (waloff[picnum] == 0) + loadtile(picnum); + + return (waloff[picnum] != 0 && tilesizx[picnum] > 0 && tilesizy[picnum] > 0); +} + // // loadpics // diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 7a8471600..15d624164 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -487,6 +487,7 @@ int32_t mpgametext(int32_t y,const char *t,int32_t s,int32_t dabits) // minitext_yofs: in hud_scale-independent, (<<16)-scaled, 0-200-normalized y coords, // (sb&ROTATESPRITE_MAX) only. static int32_t minitext_yofs = 0; +static int32_t minitext_lowercase = 0; int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t sb) { int32_t ac; @@ -519,7 +520,11 @@ int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t p = Batoi(smallbuf); continue; } - ch = Btoupper(*t); + if (!minitext_lowercase) + ch = Btoupper(*t); + else + ch = *t; + if (ch == 32) { x+=5; @@ -529,7 +534,7 @@ int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t if (cmode) rotatesprite_fs(sbarx(x),minitext_yofs+sbary(y),sbarsc(65536L),0,ac,s,p,sb); else rotatesprite_fs(x<<16,y<<16,65536L,0,ac,s,p,sb); - x += 4; // tilesizx[ac]+1; + x += (tilesizx[ac] > 0 ? tilesizx[ac] : 3) + 1; } while (*(++t)); @@ -10639,6 +10644,12 @@ int32_t app_main(int32_t argc, const char **argv) g_clipMapFiles = NULL; #endif + // check if the minifont will support lowercase letters (3136-3161) + // there is room for them in tiles012.art between "[\]^_." and "{|}~" + minitext_lowercase = 1; + for (i = MINIFONT + ('a'-'!'); minitext_lowercase && i < MINIFONT + ('z'-'!') + 1; ++i) + minitext_lowercase &= tile_exists(i); + OSD_Exec("autoexec.cfg"); if (g_networkMode != NET_DEDICATED_SERVER) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index b8017def4..812ad0c00 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5252,7 +5252,7 @@ repeatcase: while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { - EpisodeNames[j][i] = toupper(*textptr); + EpisodeNames[j][i] = *textptr; textptr++,i++; if (i >= (signed)sizeof(EpisodeNames[j])-1) { @@ -5339,7 +5339,7 @@ repeatcase: while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { - SkillNames[j][i] = toupper(*textptr); + SkillNames[j][i] = *textptr; textptr++,i++; if (i >= (signed)sizeof(SkillNames[j])-1) { @@ -5503,7 +5503,7 @@ repeatcase: while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { - GametypeNames[j][i] = toupper(*textptr); + GametypeNames[j][i] = *textptr; textptr++,i++; if (i >= (signed)sizeof(GametypeNames[j])-1) { @@ -5589,7 +5589,7 @@ repeatcase: while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) { - tempbuf[i] = Btoupper(*textptr); + tempbuf[i] = *textptr; textptr++,i++; if (i >= 32) { diff --git a/polymer/eduke32/source/input.c b/polymer/eduke32/source/input.c index ae34bbcca..deac243bc 100644 --- a/polymer/eduke32/source/input.c +++ b/polymer/eduke32/source/input.c @@ -281,7 +281,6 @@ int32_t _EnterText(int32_t small,int32_t x,int32_t y,char *t,int32_t dalen,int32 } else if (ch >= 32 && inputloc < dalen && ch < 127) { - ch = Btoupper(ch); if (c != 997 || (ch >= '0' && ch <= '9')) { // JBF 20040508: so we can have numeric only if we want diff --git a/polymer/eduke32/source/net.c b/polymer/eduke32/source/net.c index 0b03ae950..990213f57 100644 --- a/polymer/eduke32/source/net.c +++ b/polymer/eduke32/source/net.c @@ -860,7 +860,7 @@ void Net_SendClientInfo(void) int32_t i,l; for (l=0; (unsigned)l