summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libgui.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-05-15 09:15:36 +0200
committerRobert Vollmert <rvollmert@gmx.net>2010-05-15 09:25:54 +0200
commit033a6bb56be09bff1867051e16af8781ebbe3ebb (patch)
treea2d523a67193cab089ce1084abaf9cfc7ee37fa2 /crawl-ref/source/libgui.cc
parentcc30ee9fb6de771f686bbe18f0a1d9c836a4608c (diff)
downloadcrawl-ref-033a6bb56be09bff1867051e16af8781ebbe3ebb.tar.gz
crawl-ref-033a6bb56be09bff1867051e16af8781ebbe3ebb.zip
Get rid of get_input_line.
It's not used anymore, and was buggy on windows console.
Diffstat (limited to 'crawl-ref/source/libgui.cc')
-rw-r--r--crawl-ref/source/libgui.cc115
1 files changed, 0 insertions, 115 deletions
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index ed598b6104..dfc43abf22 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -111,121 +111,6 @@ void clear_to_end_of_line()
TextRegion::text_mode->clear_to_end_of_line();
}
-void get_input_line_gui(char *const buff, int len)
-{
- int y, x;
- int k = 0;
- int prev = 0;
- int done = 0;
- int kin;
- TextRegion *r = TextRegion::text_mode;
-
- static char last[128];
- static int lastk = 0;
-
- // Locate the cursor.
- x = wherex();
- y = wherey();
-
- // Paranoia -- check len.
- if (len < 1)
- len = 1;
-
- /* Restrict the length */
- if (x + len > (int)r->mx)
- len = r->mx - x;
- if (len > 40)
- len = 40;
-
- // Paranoia -- Clip the default entry.
- buff[len] = '\0';
- buff[0] = '\0';
-
- r->cgotoxy(x, y);
- putch('_');
-
- // Process input.
- while (!done)
- {
- // Get a key.
- kin = getch_ck();
-
- // Analyze the key.
- switch (kin)
- {
- case 0x1B:
- k = 0;
- done = true;
- break;
-
- case '\n':
- case '\r':
- k = strlen(buff);
- done = true;
- lastk = k;
- strncpy(last, buff, k);
- break;
-
- case CK_UP: // history
- if (lastk != 0)
- {
- k = lastk;
- strncpy(buff, last, k);
- }
- break;
-
- case 0x7F:
- case '\010':
- k = prev;
- break;
-
- // Escape conversion. (for ^H, etc.)
- case CONTROL('V'):
- kin = getch();
- // fallthrough
-
- default:
- if (k < len
- && (isprint(kin)
- || (kin >= CONTROL('A') && kin <= CONTROL('Z'))
- || (kin >= 0x80 && kin <= 0xff)))
- {
- buff[k++] = kin;
- }
- break;
- }
- // Terminate.
- buff[k] = '\0';
-
- // Update the entry.
- r->cgotoxy(x, y);
- int i;
-
- //addstr(buff);
- for (i = 0; i < k; i++)
- {
- prev = i;
- int c = (unsigned char)buff[i];
- if (c >= 0x80)
- {
- if (buff[i+1] == 0)
- break;
- writeWChar((unsigned char *)&buff[i]);
- i++;
- }
- else if (c >= CONTROL('A') && c <= CONTROL('Z'))
- {
- putch('^');
- putch(c + 'A' - 1);
- }
- else
- putch(c);
- }
- r->addstr((char *)"_ ");
- r->cgotoxy(x+k, y);
- } // while (!done)
-}
-
int cprintf(const char *format,...)
{
char buffer[2048]; // One full screen if no control seq...