+void Message(char *fmt, ...)
+{ //print game/bot message
+ va_list args;
+ char s[MSG_WIDTH];
+ char *p;
+ int i;
+
+ if (!messageHeight) return;
+ va_start(args, fmt);
+ vsnprintf(s, sizeof(s), fmt, args);
+ va_end(args);
+ p = message[MSG_HEIGHT - 1]; //save last pointer
+ for (i = MSG_HEIGHT - 1; i > 0; i--)
+ message[i] = message[i - 1]; //scroll history
+ message[0] = p;
+ strcpy(p, s);
+
+ wmove(msgwin, messageHeight - 1, 0);
+ DisplayMessage(s);
+ wclrtoeol(msgwin);
+ wrefresh(msgwin);
+}
+
+void Messagetype(char c, int x, char *s)
+{ //show single typed character
+ if (c == 27) {
+ mvwaddch(msgwin, messageHeight-1, (x+1) % (messageWidth-1), ' ');
+ } //escape
+ else {
+ if (c == 13 || c == 127) //enter/backspace
+ mvwaddch(msgwin, messageHeight - 1, (x+2) % (messageWidth-1),
+ x >= messageWidth-3 ? s[x - messageWidth + 3] : ' ');
+ else //any character
+ mvwaddch(msgwin, messageHeight - 1, x % (messageWidth-1), c);
+ mvwaddch(msgwin, messageHeight - 1, (x+1) % (messageWidth-1), '_');
+ } //typing mode
+ wrefresh(msgwin);
+}
+
+void PlotBlock1(int y, int x, unsigned char type)
+{ //display block on screen
+ move(y, x);
+ if (type == BT_none) addstr(" ");
+ else if (type == BT_shadow) addstr("::");
+ else {
+#ifdef HAVE_NCURSES
+ if (Sets.standout) {
+ if (haveColor) attrset(COLOR_PAIR(type & 15));
+ else attrset(A_REVERSE);
+ }
+#endif
+ switch (Sets.drawstyle) {
+ case 2:
+ switch (type & 192) {
+ case 64: //right neighbour
+ addstr("[["); break;
+ case 128: //left
+ addstr("]]"); break;
+ default: //both/none
+ addstr("[]"); break;
+ } //horizontal stickiness
+ break; //ascii horizontally grouped
+ case 3:
+ switch (type & 240) {
+ case 48:
+ addstr("||"); break; //middle
+ case 64: case 80: case 96:
+ addstr("[="); break; //left end
+ case 112:
+ addstr("|="); break;
+ case 128: case 144: case 160:
+ addstr("=]"); break; //right end
+ case 176:
+ addstr("=|"); break;
+ case 192: case 208: case 224:
+ addstr("=="); break;
+ default:
+ addstr("[]"); break; //top/bottom/mid
+ } //neighbours
+ break; //ascii semi-grouped
+ case 7:
+ switch (type & 240) {
+ case 16: addch(ACS_ULCORNER); addch(ACS_URCORNER); break;//top end
+ case 32: addch(ACS_LLCORNER); addch(ACS_LRCORNER); break;//bottom end
+ case 48: addch(ACS_VLINE); addch(ACS_VLINE); break; //vertical middle
+ case 64: addch('['); addch(ACS_HLINE); break; //left end
+ case 80: addch(ACS_ULCORNER); addch(ACS_TTEE); break; //top left corner
+ case 96: addch(ACS_LLCORNER); addch(ACS_BTEE); break; //bottom left corner
+ case 112: addch(ACS_LTEE); addch(ACS_PLUS); break; //vertical+right
+ case 128: addch(ACS_HLINE); addch(']'); break; //right end
+ case 144: addch(ACS_TTEE); addch(ACS_URCORNER); break; //top right corner
+ case 160: addch(ACS_BTEE); addch(ACS_LRCORNER); break; //bottom right corner
+ case 176: addch(ACS_PLUS); addch(ACS_RTEE); break; //vertical+left
+ case 192: addch(ACS_HLINE); addch(ACS_HLINE); break; //horizontal middle
+ case 208: addch(ACS_TTEE); addch(ACS_TTEE); break; //horizontal+down
+ case 224: addch(ACS_BTEE); addch(ACS_BTEE); break; //horizontal+up
+ default: addstr("[]"); break;
+ } //neighbours
+ break; //curses grouped
+ default:
+ addstr("[]");
+ break; //ascii non-grouped
+ } //draw block
+#ifdef HAVE_NCURSES
+ if (Sets.standout) standend();
+#endif
+ } //display one brick
+}
+void PlotBlock1S(int y, int x, unsigned char type)
+{ //display block small
+ move(y, x);
+ if (type == BT_none) addch(' ');
+ else if (type == BT_shadow) addch(':');
+ else {
+ if (Sets.standout) {
+#ifdef HAVE_NCURSES
+ if (haveColor)
+ attrset(COLOR_PAIR(type & 15));
+ else attrset(A_REVERSE);
+#endif
+ }
+ if ((type & 192) == 64)
+ addch('[');
+ else if ((type & 192) == 128)
+ addch(']');