Remove experimental Unicode support.
This reverts commit 7f0f43e6f9 and some related
subsequent commits.
This compiles, but I have not done extensive testing.
Conflicts:
include/config.h
include/decl.h
include/extern.h
include/global.h
include/tradstdc.h
include/wintty.h
src/drawing.c
src/files.c
src/hacklib.c
src/mapglyph.c
src/options.c
sys/winnt/nttty.c
win/tty/getline.c
win/tty/topl.c
win/tty/wintty.c
This commit is contained in:
@@ -262,8 +262,7 @@ NEARDATA winid WIN_MESSAGE = WIN_ERR;
|
||||
NEARDATA winid WIN_STATUS = WIN_ERR;
|
||||
#endif
|
||||
NEARDATA winid WIN_MAP = WIN_ERR, WIN_INVEN = WIN_ERR;
|
||||
nhwchar toplines[TBUFSZ];
|
||||
|
||||
char toplines[TBUFSZ];
|
||||
/* Windowing stuff that's really tty oriented, but present for all ports */
|
||||
struct tc_gbl_data tc_gbl_data = { 0,0, 0,0 }; /* AS,AE, LI,CO */
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ struct symsetentry symset[NUM_GRAPHICS];
|
||||
int currentgraphics = 0;
|
||||
|
||||
nhsym showsyms[SYM_MAX] = DUMMY; /* symbols to be displayed */
|
||||
nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */
|
||||
nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */
|
||||
nhsym l_syms[SYM_MAX] = DUMMY; /* loaded symbols */
|
||||
nhsym r_syms[SYM_MAX] = DUMMY; /* rogue symbols */
|
||||
|
||||
nhsym warnsyms[WARNCOUNT] = DUMMY; /* the current warning display symbols */
|
||||
const char invisexplain[] = "remembered, unseen, creature";
|
||||
@@ -525,7 +525,6 @@ boolean name_too;
|
||||
/* initialize restriction bits */
|
||||
symset[which_set].primary = 0;
|
||||
symset[which_set].rogue = 0;
|
||||
symset[which_set].unicode = 0;
|
||||
|
||||
if (name_too) {
|
||||
if (symset[which_set].name)
|
||||
@@ -563,7 +562,6 @@ const char *known_handling[] = {
|
||||
const char *known_restrictions[] = {
|
||||
"primary",
|
||||
"rogue",
|
||||
"unicode",
|
||||
(const char *)0,
|
||||
};
|
||||
|
||||
|
||||
90
src/files.c
90
src/files.c
@@ -2607,7 +2607,7 @@ parse_sym_line(buf, which_set)
|
||||
char *buf;
|
||||
int which_set;
|
||||
{
|
||||
int val;
|
||||
int val, i;
|
||||
struct symparse *symp = (struct symparse *)0;
|
||||
char *bufp, *commentp, *altp;
|
||||
|
||||
@@ -2657,7 +2657,6 @@ int which_set;
|
||||
return 0;
|
||||
|
||||
if (!symset[which_set].name) {
|
||||
int i;
|
||||
/* A null symset name indicates that we're just
|
||||
building a pick-list of possible symset
|
||||
values from the file, so only do that */
|
||||
@@ -2682,7 +2681,6 @@ int which_set;
|
||||
/* initialize restriction bits */
|
||||
tmpsp->primary = 0;
|
||||
tmpsp->rogue = 0;
|
||||
tmpsp->unicode = 0;
|
||||
break;
|
||||
case 2:
|
||||
/* handler type identified */
|
||||
@@ -2705,17 +2703,14 @@ int which_set;
|
||||
case 5:
|
||||
/* restrictions: xxxx*/
|
||||
tmpsp = symset_list; /* most recent symset */
|
||||
i = 0;
|
||||
while (known_restrictions[i]) {
|
||||
for (i = 0; known_restrictions[i]; ++i) {
|
||||
if (!strcmpi(known_restrictions[i], bufp)) {
|
||||
switch(i) {
|
||||
case 0: tmpsp->primary = 1; break;
|
||||
case 1: tmpsp->rogue = 1; break;
|
||||
case 2: tmpsp->unicode = 1; break;
|
||||
}
|
||||
break; /* while loop */
|
||||
}
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2732,7 +2727,7 @@ int which_set;
|
||||
chosen_symset_start = TRUE;
|
||||
/* these init_*() functions clear symset fields too */
|
||||
if (which_set == ROGUESET) init_r_symbols();
|
||||
else if (which_set == PRIMARY) init_l_symbols();
|
||||
else if (which_set == PRIMARY) init_l_symbols();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
@@ -2771,23 +2766,12 @@ int which_set;
|
||||
break;
|
||||
case 1: symset[which_set].rogue = 1;
|
||||
break;
|
||||
case 2: symset[which_set].unicode = 1;
|
||||
break;
|
||||
}
|
||||
break; /* while loop */
|
||||
}
|
||||
n++;
|
||||
}
|
||||
/* Don't allow unicode set if code can't handle it */
|
||||
if (symset[which_set].unicode &&
|
||||
!iflags.unicodedisp) {
|
||||
if (chosen_symset_start)
|
||||
chosen_symset_end = FALSE;
|
||||
chosen_symset_start = FALSE;
|
||||
if (which_set == ROGUESET) init_r_symbols();
|
||||
else if (which_set == PRIMARY) init_l_symbols();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else { /* !SYM_CONTROL */
|
||||
@@ -2821,72 +2805,6 @@ int which_set;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Produces a single integer value.
|
||||
*/
|
||||
int
|
||||
sym_val(cp)
|
||||
const char *cp;
|
||||
{
|
||||
unsigned int cval = 0;
|
||||
int meta = 0, dcount = 0;
|
||||
const char *dp, *hex = "00112233445566778899aAbBcCdDeEfF";
|
||||
|
||||
while (*cp)
|
||||
{
|
||||
if (*cp == '\\' && index("mM", cp[1])) {
|
||||
meta = 1;
|
||||
cp += 2;
|
||||
}
|
||||
if ((*cp == 'U' || *cp == 'u') && cp[1] == '+' && index(hex, cp[2]))
|
||||
{
|
||||
dcount = 0;
|
||||
cp++;
|
||||
for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++)
|
||||
cval = (unsigned int)((cval * 16) +
|
||||
((unsigned int)(dp - hex) / 2));
|
||||
}
|
||||
else if (*cp == '\\' && index("0123456789xXoO", cp[1]))
|
||||
{
|
||||
dcount = 0;
|
||||
cp++;
|
||||
if (*cp == 'x' || *cp == 'X')
|
||||
for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++)
|
||||
cval = (unsigned int)((cval * 16) +
|
||||
((unsigned int)(dp - hex) / 2));
|
||||
else if (*cp == 'o' || *cp == 'O')
|
||||
for (++cp; *cp && (index("01234567",*cp)) && (dcount++ < 5); cp++)
|
||||
cval = (cval * 8) + (unsigned int)(*cp - '0');
|
||||
else
|
||||
for (; *cp && (index("0123456789",*cp)) && (dcount++ < 5); cp++)
|
||||
cval = (cval * 10) + (unsigned int)(*cp - '0');
|
||||
}
|
||||
else if (*cp == '\\') /* C-style character escapes */
|
||||
{
|
||||
switch (*++cp)
|
||||
{
|
||||
case '\\': cval = '\\'; break;
|
||||
case 'n': cval = '\n'; break;
|
||||
case 't': cval = '\t'; break;
|
||||
case 'b': cval = '\b'; break;
|
||||
case 'r': cval = '\r'; break;
|
||||
default: cval = (unsigned int)*cp;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '^') /* expand control-character syntax */
|
||||
{
|
||||
cval = (unsigned int)(*++cp & 0x1f);
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
cval = (unsigned int)*cp++;
|
||||
if (meta)
|
||||
cval |= 0x80;
|
||||
}
|
||||
return cval;
|
||||
}
|
||||
|
||||
/* ---------- END CONFIG FILE HANDLING ----------- */
|
||||
|
||||
/* ---------- BEGIN SCOREBOARD CREATION ----------- */
|
||||
|
||||
188
src/hacklib.c
188
src/hacklib.c
@@ -768,192 +768,4 @@ midnight()
|
||||
return(getlt()->tm_hour == 0);
|
||||
}
|
||||
|
||||
#ifdef UNICODE_WIDEWINPORT
|
||||
nhwchar *
|
||||
nhwstrncpy(dest, strSource, cnt)
|
||||
nhwchar *dest;
|
||||
const char *strSource;
|
||||
size_t cnt;
|
||||
{
|
||||
nhwchar *d = dest;
|
||||
const char *s = strSource;
|
||||
size_t dcnt = 0;
|
||||
|
||||
while(*s && dcnt < cnt) {
|
||||
*d++ = (nhwchar)*s++;
|
||||
dcnt++;
|
||||
}
|
||||
if (dcnt < cnt) *d = 0;
|
||||
return dest;
|
||||
}
|
||||
|
||||
nhwchar *
|
||||
nhwncpy(dest, src, cnt)
|
||||
nhwchar *dest;
|
||||
const nhwchar *src;
|
||||
size_t cnt;
|
||||
{
|
||||
nhwchar *d = dest;
|
||||
const nhwchar *s = src;
|
||||
size_t dcnt = 0;
|
||||
|
||||
while(*s && dcnt < cnt) {
|
||||
*d++ = *s++;
|
||||
dcnt++;
|
||||
}
|
||||
if (dcnt < cnt) *d = 0;
|
||||
return dest;
|
||||
}
|
||||
|
||||
nhwchar *
|
||||
nhwcpy(dest, src)
|
||||
nhwchar *dest;
|
||||
const nhwchar *src;
|
||||
{
|
||||
nhwchar *d = dest;
|
||||
const nhwchar *s = src;
|
||||
|
||||
while(*s) {
|
||||
*d++ = *s++;
|
||||
}
|
||||
*d = 0;
|
||||
return dest;
|
||||
}
|
||||
|
||||
nhwchar *
|
||||
nhwstrcpy(dest, strSource)
|
||||
nhwchar *dest;
|
||||
const char *strSource;
|
||||
{
|
||||
nhwchar *d = dest;
|
||||
const char *s = strSource;
|
||||
|
||||
while(*s) {
|
||||
*d++ = *s++;
|
||||
}
|
||||
*d = 0;
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *
|
||||
strnhwcpy(strDest, src)
|
||||
char *strDest;
|
||||
const nhwchar *src;
|
||||
{
|
||||
char *d = strDest;
|
||||
const nhwchar *s = src;
|
||||
|
||||
while(*s) {
|
||||
*d++ = (char)*s++;
|
||||
}
|
||||
*d = 0;
|
||||
return strDest;
|
||||
}
|
||||
|
||||
nhwchar *
|
||||
nhwstrcat(dest, strSource)
|
||||
nhwchar *dest;
|
||||
const char *strSource;
|
||||
{
|
||||
nhwchar *d = dest;
|
||||
const char *s = strSource;
|
||||
|
||||
while(*d) d++;
|
||||
while(*s) {
|
||||
*d++ = *s++;
|
||||
}
|
||||
*d = 0;
|
||||
return dest;
|
||||
}
|
||||
|
||||
nhwchar *
|
||||
nhwcat(dest, src)
|
||||
nhwchar *dest;
|
||||
const nhwchar *src;
|
||||
{
|
||||
nhwchar *d = dest;
|
||||
const nhwchar *s = src;
|
||||
|
||||
while(*d) d++;
|
||||
while(*s) {
|
||||
*d++ = *s++;
|
||||
}
|
||||
*d = 0;
|
||||
return dest;
|
||||
}
|
||||
|
||||
nhwchar *
|
||||
nhwindex(ss, c)
|
||||
const nhwchar *ss;
|
||||
int c;
|
||||
{
|
||||
const nhwchar *s = ss;
|
||||
|
||||
while (*s) {
|
||||
if (*s == c) return (nhwchar *)s;
|
||||
s++;
|
||||
}
|
||||
if (*s == c) return (nhwchar *)s;
|
||||
return (nhwchar *)0;
|
||||
}
|
||||
|
||||
size_t nhwlen(src)
|
||||
const nhwchar *src;
|
||||
{
|
||||
register size_t dl = 0;
|
||||
|
||||
while(*src++) dl++;
|
||||
return dl;
|
||||
}
|
||||
|
||||
int
|
||||
nhwcmp(s1, s2) /* case sensitive comparison */
|
||||
register const nhwchar *s1, *s2;
|
||||
{
|
||||
register nhwchar t1, t2;
|
||||
|
||||
for (;;) {
|
||||
if (!*s2) return (*s1 != 0); /* s1 >= s2 */
|
||||
else if (!*s1) return -1; /* s1 < s2 */
|
||||
t1 = *s1++;
|
||||
t2 = *s2++;
|
||||
if (t1 != t2) return (t1 > t2) ? 1 : -1;
|
||||
}
|
||||
return 0; /* s1 == s2 */
|
||||
}
|
||||
|
||||
int
|
||||
nhwncmp(s1, s2, n) /* case sensitive counted nhwchar (wide string) comparison */
|
||||
register const nhwchar *s1, *s2;
|
||||
register int n; /*(should probably be size_t, which is usually unsigned)*/
|
||||
{
|
||||
register nhwchar t1, t2;
|
||||
|
||||
while (n--) {
|
||||
if (!*s2) return (*s1 != 0); /* s1 >= s2 */
|
||||
else if (!*s1) return -1; /* s1 < s2 */
|
||||
t1 = *s1++;
|
||||
t2 = *s2++;
|
||||
if (t1 != t2) return (t1 > t2) ? 1 : -1;
|
||||
}
|
||||
return 0; /* s1 == s2 */
|
||||
}
|
||||
|
||||
int
|
||||
nhwstrcmp(s1, s2)
|
||||
register const nhwchar *s1;
|
||||
const char *s2;
|
||||
{
|
||||
register nhwchar t1, t2;
|
||||
|
||||
for (;;) {
|
||||
if (!*s2) return (*s1 != 0); /* s1 >= s2 */
|
||||
else if (!*s1) return -1; /* s1 < s2 */
|
||||
t1 = *s1++;
|
||||
t2 = (nhwchar)*s2++;
|
||||
if (t1 != t2) return (t1 > t2) ? 1 : -1;
|
||||
}
|
||||
return 0; /* s1 == s2 */
|
||||
}
|
||||
#endif
|
||||
/*hacklib.c*/
|
||||
|
||||
@@ -225,7 +225,6 @@ int glyph;
|
||||
return encbuf;
|
||||
}
|
||||
|
||||
#ifndef UNICODE_WIDEWINPORT
|
||||
/*
|
||||
* This differs from putstr() because the str parameter can
|
||||
* contain a sequence of characters representing:
|
||||
@@ -267,12 +266,25 @@ genl_putmixed(window, attr, str)
|
||||
gv = (int)((gv * 16) + ((int)(dp - hex) / 2));
|
||||
so = mapglyph(gv, &ch, &oc, &os, 0, 0);
|
||||
*put++ = showsyms[so];
|
||||
continue;
|
||||
} else {
|
||||
/* possible forgery - leave it the way it is */
|
||||
cp = save_cp;
|
||||
}
|
||||
break;
|
||||
# if 0
|
||||
case 'S': /* symbol offset */
|
||||
dcount = 0;
|
||||
for (++cp; *cp && (dp = index(hex, *cp)) && (dcount++ < 4); cp++)
|
||||
rndchk = (int)((rndchk * 16) + ((int)(dp - hex) / 2));
|
||||
|
||||
if (rndchk == context.rndencode) {
|
||||
dcount = 0;
|
||||
for (; *cp && (dp = index(hex, *cp)) && (dcount++ < 2); cp++)
|
||||
so = (int)((so * 16) + ((int)(dp - hex) / 2));
|
||||
}
|
||||
*put++ = showsyms[so];
|
||||
break;
|
||||
# endif
|
||||
case '\\':
|
||||
break;
|
||||
}
|
||||
@@ -283,5 +295,4 @@ genl_putmixed(window, attr, str)
|
||||
/* now send it to the normal putstr */
|
||||
putstr(window, attr, buf);
|
||||
}
|
||||
#endif /*!UNICODE_WIDEWINPORT*/
|
||||
/*mapglyph.c*/
|
||||
|
||||
@@ -198,9 +198,6 @@ static struct Bool_Opt
|
||||
{"tombstone",&flags.tombstone, TRUE, SET_IN_GAME},
|
||||
{"toptenwin",&iflags.toptenwin, FALSE, SET_IN_GAME},
|
||||
{"travel", &flags.travelcmd, TRUE, SET_IN_GAME},
|
||||
#ifdef UNICODE_SUPPORT
|
||||
{"unicode", &iflags.unicodedisp, FALSE, SET_IN_GAME},
|
||||
#endif
|
||||
#ifdef WIN32CON
|
||||
{"use_inverse", &iflags.wc_inverse, TRUE, SET_IN_GAME}, /*WC*/
|
||||
#else
|
||||
@@ -605,9 +602,6 @@ initoptions_init()
|
||||
iflags.msg_history = 20;
|
||||
#ifdef TTY_GRAPHICS
|
||||
iflags.prevmsg_window = 's';
|
||||
# if defined(UNIX) && defined(UNICODE_WIDEWINPORT)
|
||||
iflags.unicodecapable = TRUE;
|
||||
# endif
|
||||
#endif
|
||||
iflags.menu_headings = ATR_INVERSE;
|
||||
|
||||
@@ -2514,7 +2508,7 @@ goodfruit:
|
||||
boolean badflag = FALSE;
|
||||
if (duplicate) complain_about_duplicate(opts,1);
|
||||
if (!negated) {
|
||||
for (i = PRIMARY; i <= ROGUESET; ++i) {
|
||||
for (i = 0; i < NUM_GRAPHICS; ++i) {
|
||||
if (symset[i].name)
|
||||
badflag = TRUE;
|
||||
else {
|
||||
@@ -3359,7 +3353,7 @@ boolean setinitial,setfromfile;
|
||||
|| !strcmp("roguesymset", optname)) {
|
||||
menu_item *symset_pick = (menu_item *)0;
|
||||
boolean primaryflag = (*optname == 's'),
|
||||
rogueflag = (*optname == 'r'),
|
||||
rogueflag = (*optname == 'r'),
|
||||
ready_to_switch = FALSE,
|
||||
nothing_to_do = FALSE;
|
||||
int res;
|
||||
@@ -3384,8 +3378,7 @@ boolean setinitial,setfromfile;
|
||||
sl = symset_list;
|
||||
while (sl) {
|
||||
/* check restrictions */
|
||||
if ((!rogueflag && sl->rogue) ||
|
||||
(!iflags.unicodedisp && sl->unicode) ||
|
||||
if ((!rogueflag && sl->rogue) ||
|
||||
(!primaryflag && sl->primary)) {
|
||||
sl = sl->next;
|
||||
continue;
|
||||
@@ -3398,8 +3391,8 @@ boolean setinitial,setfromfile;
|
||||
}
|
||||
if (!setcount) {
|
||||
pline("There are no appropriate %ssymbol sets available.",
|
||||
(rogueflag) ? "rogue level " :
|
||||
(primaryflag) ? "primary " :
|
||||
(rogueflag) ? "rogue level " :
|
||||
(primaryflag) ? "primary " :
|
||||
"");
|
||||
return TRUE;
|
||||
}
|
||||
@@ -3415,7 +3408,6 @@ boolean setinitial,setfromfile;
|
||||
while (sl) {
|
||||
/* check restrictions */
|
||||
if ((!rogueflag && sl->rogue) ||
|
||||
(!iflags.unicodedisp && sl->unicode) ||
|
||||
(!primaryflag && sl->primary)) {
|
||||
sl = sl->next;
|
||||
continue;
|
||||
@@ -3502,7 +3494,7 @@ boolean setinitial,setfromfile;
|
||||
if(rogueflag)
|
||||
init_r_symbols();
|
||||
else
|
||||
init_l_symbols();
|
||||
init_l_symbols();
|
||||
|
||||
if (symset[which_set].name) {
|
||||
if (read_sym_file(which_set))
|
||||
@@ -3568,14 +3560,9 @@ char *buf;
|
||||
#endif
|
||||
#ifdef BACKWARD_COMPAT
|
||||
else if (!strcmp(optname, "boulder"))
|
||||
Sprintf(buf,
|
||||
# ifdef UNICODE_DRAWING
|
||||
"\\x%04X",
|
||||
# else
|
||||
"%c",
|
||||
# endif
|
||||
iflags.bouldersym ? iflags.bouldersym :
|
||||
showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]);
|
||||
Sprintf(buf, "%c", iflags.bouldersym ?
|
||||
iflags.bouldersym :
|
||||
showsyms[(int)objects[BOULDER].oc_class + SYM_OFF_O]);
|
||||
#endif
|
||||
else if (!strcmp(optname, "catname"))
|
||||
Sprintf(buf, "%s", catname[0] ? catname : none);
|
||||
@@ -4034,6 +4021,15 @@ char *buf;
|
||||
return (struct symparse *)0;
|
||||
}
|
||||
|
||||
int sym_val(strval)
|
||||
char *strval;
|
||||
{
|
||||
char buf[QBUFSZ];
|
||||
buf[0] = '\0';
|
||||
escapes(strval, buf);
|
||||
return (int)*buf;
|
||||
}
|
||||
|
||||
/* data for option_help() */
|
||||
static const char *opt_intro[] = {
|
||||
"",
|
||||
|
||||
@@ -571,7 +571,7 @@ do_look(mode, click_cc)
|
||||
for (i = 0; i < MAXMCLASSES; i++) {
|
||||
if (sym == ((from_screen || clicklook) ?
|
||||
showsyms[i + SYM_OFF_M] : def_monsyms[i].sym) &&
|
||||
def_monsyms[i].explain) {
|
||||
def_monsyms[i].explain) {
|
||||
need_to_look = TRUE;
|
||||
if (!found) {
|
||||
Sprintf(out_str, "%s %s",
|
||||
|
||||
@@ -76,11 +76,7 @@ pline VA_DECL(const char *, line)
|
||||
return;
|
||||
}
|
||||
#ifndef MAC
|
||||
# ifdef UNICODE_WIDEWINPORT
|
||||
if (no_repeat && !nhwstrcmp(toplines, line))
|
||||
# else
|
||||
if (no_repeat && !strcmp(toplines, line))
|
||||
# endif
|
||||
if (no_repeat && !strcmp(line, toplines))
|
||||
return;
|
||||
#endif /* MAC */
|
||||
if (vision_full_recalc) vision_recalc(0);
|
||||
|
||||
Reference in New Issue
Block a user