[Avida-SVN] r1376 - in development/source: targets/avida-viewer tools

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Tue Feb 27 09:05:10 PST 2007


Author: brysonda
Date: 2007-02-27 12:05:10 -0500 (Tue, 27 Feb 2007)
New Revision: 1376

Modified:
   development/source/targets/avida-viewer/cAnalyzeScreen.cc
   development/source/targets/avida-viewer/cTextWindow.h
   development/source/targets/avida-viewer/cView.cc
   development/source/tools/cTools.cc
Log:
Workaround the fact that PDCurses reports window width and height, rather than max x and max y as expected.


Modified: development/source/targets/avida-viewer/cAnalyzeScreen.cc
===================================================================
--- development/source/targets/avida-viewer/cAnalyzeScreen.cc	2007-02-27 17:04:38 UTC (rev 1375)
+++ development/source/targets/avida-viewer/cAnalyzeScreen.cc	2007-02-27 17:05:10 UTC (rev 1376)
@@ -26,7 +26,7 @@
 
 #ifdef WIN32
 # include <process.h>
-# define kill(x,y) exit(0)
+# define kill(x, y)
 #else
 # include <unistd.h>
 #endif

Modified: development/source/targets/avida-viewer/cTextWindow.h
===================================================================
--- development/source/targets/avida-viewer/cTextWindow.h	2007-02-27 17:04:38 UTC (rev 1375)
+++ development/source/targets/avida-viewer/cTextWindow.h	2007-02-27 17:05:10 UTC (rev 1376)
@@ -69,8 +69,15 @@
 
   // These function return the number of characters wide or high
   // (respectively) that the screen is.
+#ifdef WIN32
+  // Windows returns the screen width and height
+  inline int Width() { return win_id->_maxx; }
+  inline int Height() { return win_id->_maxy; }
+#else
+  // Elsewhere returns the max x and y coordinates, like expected
   inline int Width() { return win_id->_maxx + 1; }
   inline int Height() { return win_id->_maxy + 1; }
+#endif
 
   // Clear the screen and redraw all text on it.
   inline void RedrawMain() { touchwin(win_id); wrefresh(win_id); }

Modified: development/source/targets/avida-viewer/cView.cc
===================================================================
--- development/source/targets/avida-viewer/cView.cc	2007-02-27 17:04:38 UTC (rev 1375)
+++ development/source/targets/avida-viewer/cView.cc	2007-02-27 17:05:10 UTC (rev 1376)
@@ -34,7 +34,7 @@
 
 #ifdef WIN32
 # include <process.h>
-# define kill(x, y) exit(0)
+# define kill(x, y)
 #else
 # include <unistd.h>
 #endif

Modified: development/source/tools/cTools.cc
===================================================================
--- development/source/tools/cTools.cc	2007-02-27 17:04:38 UTC (rev 1375)
+++ development/source/tools/cTools.cc	2007-02-27 17:05:10 UTC (rev 1376)
@@ -17,13 +17,7 @@
 
 #include "cString.h"
 
-#ifdef WIN32
-# ifndef WIN32_MKDIR_HACK_HH
-#  include "win32_mkdir_hack.hh"
-# endif
-#endif
 
-
 // mkdir undefined in win32
 #ifdef WIN32
 # include <direct.h>




More information about the Avida-cvs mailing list