Add putmixed() to the window port. It allows map symbols to be included in the string by encoding them in a unique fashion. This was done because Unicode symbols, for instance, could be longer than the size of a char. The encoding of the map symbols in this patch is done by prefixing a glyph value with \GXXXX, where XXXX is a random value for the current game. The reason for the random prefix is to minimize the possibility that a player can trigger the escape sequence processing within text under their control (dog names, etc.) the way they could if the sequence was fixed in the source code. The random prefix remains the same throughout the lifetime of a game because message window strings are saved in the save file. (There was actually a bug present because of the embedded character even before the recent symbol changes, because if someone was using a different set of characters between games, the saved messages would reflect the original characters, rather than the current. That bug was introduced with the ability to save messages to the savefile.) A window port does not have to supply an XXX_putmixed() routine, it can use genl_putmixed() which uses the old behavior of embedding the sequence as a character within the string and calling putstr(). genl_putmixed() takes care of the decoding of the escape sequence. This also #ifdef's out code in pager.c for converting a glyph to a character, and uses mapglyph() to do that instead. Does anyone see a problem with doing that through mapglyph instead of repeating similar code within pager.c?
76 KiB
76 KiB