From bf8e09d435a914c14aca1e609dfec6df7dcba02d Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@ensiie.fr>
Date: Wed, 20 Feb 2019 11:37:27 +0100
Subject: [PATCH] Screen: move screen's variables into screen module

---
 src/log.c    | 15 ---------------
 src/screen.c | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/log.c b/src/log.c
index 5ab5517..90d1e0c 100644
--- a/src/log.c
+++ b/src/log.c
@@ -89,20 +89,6 @@ enum cursors oldcursortype;
 
 log_action_t gg;   ///< External global variables
 
-short cursx;   ///< Current X position of cursor
-short cursy;   ///< Current Y position of cursor
-short cursx1;  ///< X position of wire starting point
-short cursy1;  ///< Y position of wire starting point
-short cursx2;  ///< X position of wire end point
-short cursy2;  ///< Y position of wire end point
-short chairx;  ///< X position of crosshair
-short chairy;  ///< Y position of crosshair
-
-int cursorflag;   ///< If cursor is displayed
-int prevcursorflag; ///< If cursor was displayed before operation began
-int chairflag;   ///< If crosshair is on screen
-int chairflag2;   ///< If crosshair will be on screen
-int rbandflag;   ///< If Rubber-band wire is on screen
 int rabbits;   ///< A plushy animal
 int rabflag;   ///< If Rabbit mode
 int avoidrabbits; ///< Should repel rabbits
@@ -11386,7 +11372,6 @@ static void initialize()
 	helpptr = 0;
 	cursortype = normal;
 	oldcursortype = normal;
-	cursorflag = false;
 	setscale(0);
 	curlistgroup = 0;
 	messagepos = topmessagepos;
diff --git a/src/screen.c b/src/screen.c
index 1dbd8d1..3e093d2 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -43,6 +43,22 @@
 #include "log.h"
 #include "box.h"
 
+short cursx;   ///< Current X position of cursor
+short cursy;   ///< Current Y position of cursor
+short cursx1;  ///< X position of wire starting point
+short cursy1;  ///< Y position of wire starting point
+short cursx2;  ///< X position of wire end point
+short cursy2;  ///< Y position of wire end point
+short chairx;  ///< X position of crosshair
+short chairy;  ///< Y position of crosshair
+
+int cursorflag;   ///< If cursor is displayed
+int prevcursorflag; ///< If cursor was displayed before operation began
+
+int chairflag;   ///< If crosshair is on screen
+int chairflag2;   ///< If crosshair will be on screen
+int rbandflag;   ///< If Rubber-band wire is on screen
+
 static rablistrec rabtable[rabtabsize];   ///< Positions of rabbits
 
 void initcolormap()
@@ -82,6 +98,7 @@ void fixcolormap()
 /// Initialize color graphics, graphics tablet, low-level flags & variables.
 void initscreen()
 {
+	cursorflag = false;
 	m_init_screen();
 	m_upside_down();
 	m_setlinestyle(1L, 0xf0f0L);
-- 
GitLab