OSDN Git Service

[Refactor] #40624 Separated monster-lite.c/h from floor-events.c/h
[hengband/hengband.git] / src / main-win.c
index 1e6e218..ceccba9 100644 (file)
@@ -99,8 +99,8 @@
 #include "core/stuff-handler.h"
 #include "core/visuals-reseter.h"
 #include "dungeon/quest.h"
+#include "floor/floor-base-definitions.h"
 #include "floor/floor-events.h"
-#include "floor/floor.h"
 #include "game-option/runtime-arguments.h"
 #include "game-option/special-options.h"
 #include "io/chuukei.h"
 #include "main/music-definitions-table.h"
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
+#include "monster-floor/monster-lite.h"
 #include "system/angband-version.h"
 #include "system/angband.h"
+#include "system/floor-type-definition.h"
 #include "system/system-variables.h"
 #include "term/gameterm.h"
 #include "term/screen-processor.h"
 
 #ifdef WINDOWS
 #include "dungeon/dungeon.h"
-#include "savedata/save.h"
-#include "term/z-term.h"
+#include "save/save.h"
 #include <direct.h>
 #include <locale.h>
 #include <windows.h>
  * </p>
  */
 typedef struct {
-    term t;
+    term_type t;
     concptr s;
     HWND w;
     DWORD dwStyle;
@@ -1386,7 +1387,7 @@ static errr term_xtra_win_react(player_type *player_ptr)
     }
 
     for (int i = 0; i < MAX_TERM_DATA; i++) {
-        term *old = Term;
+        term_type *old = Term;
         term_data *td = &data[i];
         if ((td->cols != td->t.wid) || (td->rows != td->t.hgt)) {
             term_activate(&td->t);
@@ -1965,7 +1966,7 @@ static void windows_map(player_type *player_ptr)
  */
 static void term_data_link(term_data *td)
 {
-    term *t = &td->t;
+    term_type *t = &td->t;
     term_init(t, td->cols, td->rows, td->keys);
     t->soft_cursor = TRUE;
     t->higher_pict = TRUE;
@@ -2723,6 +2724,28 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
     }
 }
 
+/*
+ * Add a keypress to the "queue"
+ */
+static errr term_keypress(int k)
+{
+    /* Refuse to enqueue non-keys */
+    if (!k)
+        return -1;
+
+    /* Store the char, advance the queue */
+    Term->key_queue[Term->key_head++] = (char)k;
+
+    /* Circular queue, handle wrap */
+    if (Term->key_head == Term->key_size)
+        Term->key_head = 0;
+
+    if (Term->key_head != Term->key_tail)
+        return 0;
+
+    return 1;
+}
+
 static bool process_keydown(WPARAM wParam, LPARAM lParam)
 {
     bool mc = FALSE;
@@ -3162,7 +3185,7 @@ LRESULT PASCAL AngbandListProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
         TERM_LEN cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
         TERM_LEN rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
         if ((td->cols != cols) || (td->rows != rows)) {
-            term *old_term = Term;
+            term_type *old_term = Term;
             td->cols = cols;
             td->rows = rows;
             term_activate(&td->t);