[Avida-SVN] r1375 - trunk/source/targets/avida-viewer

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Tue Feb 27 09:04:38 PST 2007


Author: brysonda
Date: 2007-02-27 12:04:38 -0500 (Tue, 27 Feb 2007)
New Revision: 1375

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

Modified: trunk/source/targets/avida-viewer/cTextWindow.h
===================================================================
--- trunk/source/targets/avida-viewer/cTextWindow.h	2007-02-27 14:11:06 UTC (rev 1374)
+++ trunk/source/targets/avida-viewer/cTextWindow.h	2007-02-27 17:04:38 UTC (rev 1375)
@@ -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); }




More information about the Avida-cvs mailing list