X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fclient%2Fio.c;h=095577d32e1d84fa0d68a89eb31d41a6ac5a76e1;hb=024b404c0db59dc6651b1c8f3d379c2797654fdf;hp=32843896143ae3202e17bc4b5074c8bcaf6b9072;hpb=dd9d65ee727ac7e95801da0f8b5bae7009811802;p=plomrogue
diff --git a/src/client/io.c b/src/client/io.c
index 3284389..095577d 100644
--- a/src/client/io.c
+++ b/src/client/io.c
@@ -16,12 +16,10 @@
#include "../common/readwrite.h" /* try_fopen(), try_fclose(), try_fgets(),
* try_fgetc()
*/
-#include "control.h" /* meta_control(), player_control(), wingeom_control(),
- * winkeyb_control()
- */
-#include "map_window.h" /* for map_center() */
-#include "wincontrol.h" /* WinConf struct, get_winconf_by_win() */
-#include "windows.h" /* draw_all_wins() */
+#include "control.h" /* try_key() */
+#include "map_window.h" /* map_center() */
+#include "misc.h" /* reset_windows() */
+#include "windows.h" /* reset_windows_on_winch(), draw_all_wins() */
#include "world.h" /* world global */
@@ -260,6 +258,12 @@ extern char * io_loop()
uint8_t change_in_client = 0;
while (1)
{
+ if (world.winch)
+ {
+ reset_windows_on_winch();
+ world.winch = 0;
+ change_in_client++;
+ }
if (read_world() || change_in_client)
{
draw_all_wins();
@@ -268,21 +272,11 @@ extern char * io_loop()
int key = getch();
if (ERR != key)
{
- change_in_client = meta_control(key);
+ change_in_client = try_key((uint16_t) key);
if (2 == change_in_client)
{
break;
}
- if (!change_in_client)
- {
- change_in_client = player_control(key);
- }
- if (!change_in_client)
- {
- struct WinConf * wc = get_winconf_by_win(world.wmeta.active);
- change_in_client = (1 == wc->view && wingeom_control(key))
- || (2 == wc->view && winkeyb_control(key));
- }
}
}
try_send("QUIT");