summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acquire.cc1
-rw-r--r--crawl-ref/source/effects.cc1
-rw-r--r--crawl-ref/source/godabil.cc1
-rw-r--r--crawl-ref/source/invent.cc1
-rw-r--r--crawl-ref/source/items.cc1
-rw-r--r--crawl-ref/source/macro.cc14
-rw-r--r--crawl-ref/source/macro.h2
-rw-r--r--crawl-ref/source/spl-selfench.cc1
-rw-r--r--crawl-ref/source/stuff.cc11
-rw-r--r--crawl-ref/source/stuff.h4
-rw-r--r--crawl-ref/source/wiz-item.cc1
-rw-r--r--crawl-ref/source/wiz-you.cc1
12 files changed, 24 insertions, 15 deletions
diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc
index 6661f3b1dc..6a01ba82a8 100644
--- a/crawl-ref/source/acquire.cc
+++ b/crawl-ref/source/acquire.cc
@@ -27,6 +27,7 @@
#include "items.h"
#include "item_use.h"
#include "libutil.h"
+#include "macro.h"
#include "makeitem.h"
#include "message.h"
#include "player.h"
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index c7a4d9eaf8..d0f5c97d0c 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -49,6 +49,7 @@
#include "items.h"
#include "libutil.h"
#include "losglobal.h"
+#include "macro.h"
#include "makeitem.h"
#include "message.h"
#include "mgen_data.h"
diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc
index 1c3d1c5b1e..33742b01f7 100644
--- a/crawl-ref/source/godabil.cc
+++ b/crawl-ref/source/godabil.cc
@@ -38,6 +38,7 @@
#include "items.h"
#include "losglobal.h"
#include "libutil.h"
+#include "macro.h"
#include "mapdef.h"
#include "mapmark.h"
#include "maps.h"
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 91eef62528..6d3715ff4c 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -29,6 +29,7 @@
#include "itemprop.h"
#include "items.h"
#include "libutil.h"
+#include "macro.h"
#include "message.h"
#include "player.h"
#include "religion.h"
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 983b067b4f..921fe36436 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -45,6 +45,7 @@
#include "itemname.h"
#include "itemprop.h"
#include "libutil.h"
+#include "macro.h"
#include "makeitem.h"
#include "message.h"
#include "misc.h"
diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc
index 3de28db46b..75d25d6ab5 100644
--- a/crawl-ref/source/macro.cc
+++ b/crawl-ref/source/macro.cc
@@ -755,6 +755,20 @@ int getchm(KeymapContext mc, int (*rgetch)())
return macro_buf_get();
}
+/**
+ * Get a character?
+ */
+int get_ch()
+{
+ mouse_control mc(MOUSE_MODE_PROMPT);
+ int gotched = getchm();
+
+ if (gotched == 0)
+ gotched = getchm();
+
+ return gotched;
+}
+
/*
* Replacement for getch(). Returns keys from the key buffer if available.
* If not, adds some content to the buffer, and returns some of it.
diff --git a/crawl-ref/source/macro.h b/crawl-ref/source/macro.h
index b9a30cb850..06026b5ac9 100644
--- a/crawl-ref/source/macro.h
+++ b/crawl-ref/source/macro.h
@@ -39,6 +39,8 @@ private:
int getchm(int (*rgetch)() = NULL); // keymaps applied (ie for prompts)
int getchm(KeymapContext context, int (*rgetch)() = NULL);
+int get_ch();
+
int getch_with_command_macros(); // keymaps and macros (ie for commands)
void flush_input_buffer(int reason);
diff --git a/crawl-ref/source/spl-selfench.cc b/crawl-ref/source/spl-selfench.cc
index a4e91cff2b..23358e8e02 100644
--- a/crawl-ref/source/spl-selfench.cc
+++ b/crawl-ref/source/spl-selfench.cc
@@ -14,6 +14,7 @@
#include "godconduct.h"
#include "hints.h"
#include "libutil.h"
+#include "macro.h"
#include "message.h"
#include "misc.h"
#include "options.h"
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc
index 8021d3a82b..259768e0cd 100644
--- a/crawl-ref/source/stuff.cc
+++ b/crawl-ref/source/stuff.cc
@@ -94,17 +94,6 @@ void set_redraw_status(uint64_t flags)
you.redraw_status_flags |= flags;
}
-int get_ch()
-{
- mouse_control mc(MOUSE_MODE_PROMPT);
- int gotched = getchm();
-
- if (gotched == 0)
- gotched = getchm();
-
- return gotched;
-}
-
void cio_init()
{
crawl_state.io_inited = true;
diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h
index 7f7e0f332e..077404eedb 100644
--- a/crawl-ref/source/stuff.h
+++ b/crawl-ref/source/stuff.h
@@ -34,10 +34,6 @@ int stepdown(int value, int step, rounding_type = ROUND_CLOSE, int max = 0);
int stepdown_value(int base_value, int stepping, int first_step,
int last_step, int ceiling_value);
-// ????
-
-int get_ch();
-
// IO
void cio_init();
diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc
index 7139b1a840..2b996518af 100644
--- a/crawl-ref/source/wiz-item.cc
+++ b/crawl-ref/source/wiz-item.cc
@@ -25,6 +25,7 @@
#include "items.h"
#include "invent.h"
#include "libutil.h"
+#include "macro.h"
#include "makeitem.h"
#include "mapdef.h"
#include "misc.h"
diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc
index 1aa7ca75aa..039ef90c66 100644
--- a/crawl-ref/source/wiz-you.cc
+++ b/crawl-ref/source/wiz-you.cc
@@ -16,6 +16,7 @@
#include "godprayer.h"
#include "godwrath.h"
#include "libutil.h"
+#include "macro.h"
#include "message.h"
#include "mutation.h"
#include "newgame.h"