summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libw32c.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-09-08 02:05:57 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-09-08 02:09:51 +0200
commit58b7930167ecccbe138bbfc7c6c7f44f9dd09107 (patch)
tree6fe98a2ad6c7fe17ff48215f0cb32fb9031db5c4 /crawl-ref/source/libw32c.cc
parentf15db1b054f390612b74db98a4b15159f038ca56 (diff)
downloadcrawl-ref-58b7930167ecccbe138bbfc7c6c7f44f9dd09107.tar.gz
crawl-ref-58b7930167ecccbe138bbfc7c6c7f44f9dd09107.zip
Combine common parts of lib*.h
Having different prototypes for different ports without a good reason is bad. After unification, it's easier to have, for example, two ports at once.
Diffstat (limited to 'crawl-ref/source/libw32c.cc')
-rw-r--r--crawl-ref/source/libw32c.cc21
1 files changed, 8 insertions, 13 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc
index a412a524f6..a72f9094f5 100644
--- a/crawl-ref/source/libw32c.cc
+++ b/crawl-ref/source/libw32c.cc
@@ -242,7 +242,7 @@ void set_mouse_enabled(bool enabled)
}
}
-void set_string_input(bool value)
+static void _set_string_input(bool value)
{
DWORD inmodes, outmodes;
if (value == TRUE)
@@ -337,7 +337,7 @@ static void w32_term_resizer()
crawl_view.init_geometry();
}
-void init_libw32c(void)
+void console_startup()
{
inbuf = GetStdHandle(STD_INPUT_HANDLE);
outbuf = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -363,7 +363,7 @@ void init_libw32c(void)
#endif
// by default, set string input to false: use char-input only
- set_string_input(false);
+ _set_string_input(false);
// set up screen size
set_w32_screen_size();
@@ -396,7 +396,7 @@ void init_libw32c(void)
}
-void deinit_libw32c(void)
+void console_shutdown()
{
// don't do anything if we were never initted
if (inbuf == NULL || outbuf == NULL)
@@ -411,7 +411,7 @@ void deinit_libw32c(void)
SetConsoleOutputCP(OutputCP);
// restore console attributes for normal function
- set_string_input(true);
+ _set_string_input(true);
// set cursor and normal textcolor
_setcursortype_internal(true);
@@ -524,11 +524,6 @@ void gotoxy_sys(int x, int y)
}
}
-void textattr(int c)
-{
- textcolor(c);
-}
-
void textcolor(int c)
{
// change current color used to stamp chars
@@ -842,7 +837,7 @@ bool kbhit()
return 0;
}
-void delay(int ms)
+void delay(unsigned int ms)
{
Sleep((DWORD)ms);
}
@@ -856,13 +851,13 @@ void puttext(int x1, int y1, const crawl_view_buffer &vbuf)
cgotoxy(x1, y1 + y);
for (int x = 0; x < size.x; ++x)
{
- textattr(cell->colour);
+ textcolor(cell->colour);
putwch(cell->glyph);
cell++;
}
}
update_screen();
- textattr(WHITE);
+ textcolor(WHITE);
}
void update_screen()