mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-22 19:44:21 +01:00
a8c6d3606a
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
999 lines
31 KiB
Diff
999 lines
31 KiB
Diff
diff -ur xspacewarp-1.2/CHANGES xspacewarp-1.2b/CHANGES
|
|
--- xspacewarp-1.2/CHANGES 1995-12-29 05:27:32.000000000 -0200
|
|
+++ xspacewarp-1.2b/CHANGES 2010-05-14 15:36:21.000000000 -0300
|
|
@@ -32,3 +32,13 @@
|
|
algorithm.
|
|
|
|
Version 1.2 lets you pause and un-pause the game.
|
|
+
|
|
+
|
|
+ CHANGES FROM XSPACEWARP VERSION 1.2 TO VERSION 1.2b
|
|
+
|
|
+
|
|
+Version 1.2b is an adaptation of version 1.2 for modern gcc
|
|
+compilers, so that it can be built on current (as of May, 2010)
|
|
+Linux (and probably other) systems.
|
|
+
|
|
+These changes were made by Niels Horn <niels.horn@gmail.com>.
|
|
diff -ur xspacewarp-1.2/actions.cc xspacewarp-1.2b/actions.cc
|
|
--- xspacewarp-1.2/actions.cc 1995-12-29 05:41:44.000000000 -0200
|
|
+++ xspacewarp-1.2b/actions.cc 2010-05-14 14:52:00.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* actions.cc 1.14 95/12/28 23:24:14 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -14,7 +14,8 @@
|
|
#include <X11/Intrinsic.h>
|
|
#include <X11/StringDefs.h>
|
|
#include <stdlib.h>
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include "common.hh"
|
|
#include "params.hh"
|
|
#include "globals.hh"
|
|
diff -ur xspacewarp-1.2/c_base.cc xspacewarp-1.2b/c_base.cc
|
|
--- xspacewarp-1.2/c_base.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_base.cc 2010-05-14 14:53:01.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_base.cc 1.11 95/12/23 03:11:27 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -10,7 +10,8 @@
|
|
// define members of class Base
|
|
|
|
#include "c_base.hh"
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include <stdio.h> // sprintf()
|
|
#include <stdlib.h> // rand()
|
|
#include "c_body.hh"
|
|
diff -ur xspacewarp-1.2/c_blackhole.cc xspacewarp-1.2b/c_blackhole.cc
|
|
--- xspacewarp-1.2/c_blackhole.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_blackhole.cc 2010-05-14 14:53:26.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_blackhole.cc 1.4 95/12/23 03:11:27 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -9,9 +9,11 @@
|
|
|
|
// define blackhole methods and data
|
|
|
|
+#include <cstdlib>
|
|
#include "c_blackhole.hh"
|
|
#include "c_body.hh"
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
|
|
|
|
void Blackhole::draw(Drawable drawable, GC gc) const
|
|
diff -ur xspacewarp-1.2/c_block.cc xspacewarp-1.2b/c_block.cc
|
|
--- xspacewarp-1.2/c_block.cc 1995-12-29 05:42:21.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_block.cc 2010-05-14 14:54:06.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_block.cc 1.4 95/12/23 03:11:46 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -11,7 +11,8 @@
|
|
|
|
|
|
#include <stdlib.h> // exit()
|
|
-#include <iostream.h> // cerr
|
|
+#include <iostream> // cerr
|
|
+using namespace std;
|
|
#include "common.hh"
|
|
#include "params.hh"
|
|
#include "globals.hh" // app_data describes game window dimensions
|
|
diff -ur xspacewarp-1.2/c_body.cc xspacewarp-1.2b/c_body.cc
|
|
--- xspacewarp-1.2/c_body.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_body.cc 2010-05-14 14:52:38.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_body.cc 1.10 95/12/23 03:11:27 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -11,7 +11,8 @@
|
|
|
|
#include "c_body.hh"
|
|
#include <stdlib.h> // exit()
|
|
-#include <iostream.h> // cerr
|
|
+#include <iostream> // cerr
|
|
+using namespace std;
|
|
#include "common.hh"
|
|
#include "params.hh"
|
|
#include "globals.hh" // toplevel for display
|
|
diff -ur xspacewarp-1.2/c_endever.cc xspacewarp-1.2b/c_endever.cc
|
|
--- xspacewarp-1.2/c_endever.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_endever.cc 2010-05-14 14:53:52.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_endever.cc 1.26 95/12/28 23:23:43 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -10,7 +10,8 @@
|
|
// define the class endever methods
|
|
|
|
#include "c_endever.hh"
|
|
-#include <iostream.h> // cerr
|
|
+#include <iostream> // cerr
|
|
+using namespace std;
|
|
#include <stdlib.h> // exit(), rand()
|
|
#include <string.h>
|
|
#include <math.h>
|
|
diff -ur xspacewarp-1.2/c_endever.hh xspacewarp-1.2b/c_endever.hh
|
|
--- xspacewarp-1.2/c_endever.hh 1995-12-29 05:41:59.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_endever.hh 2010-05-14 14:51:25.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_endever.hh 1.15 95/12/23 03:11:30 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -35,7 +35,7 @@
|
|
bool nomove() const {return (nomoveflag);}
|
|
void setnomove(bool nm) {nomoveflag = nm;}
|
|
static void seticon(const char *str);
|
|
- static geticon_len();
|
|
+ static int geticon_len();
|
|
private:
|
|
int torpedoes;
|
|
bool docked; // whether docked to a base
|
|
diff -ur xspacewarp-1.2/c_jovian.cc xspacewarp-1.2b/c_jovian.cc
|
|
--- xspacewarp-1.2/c_jovian.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_jovian.cc 2010-05-14 14:54:36.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_jovian.cc 1.17 95/12/23 03:11:28 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -10,9 +10,11 @@
|
|
// class jovian methods
|
|
|
|
#include "c_jovian.hh"
|
|
+#include "c_jovian_ai.hh"
|
|
#include "c_body.hh"
|
|
#include <stdlib.h>
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include <math.h> // trig
|
|
#include "globals.hh" // GCs etc, to erase after fatal hit
|
|
#include "space_objects.hh"
|
|
@@ -22,10 +24,10 @@
|
|
|
|
// these AI functions are kept in separate file c_jovian_ai.cc
|
|
|
|
-extern Action Jovian::pick_action();
|
|
-extern Direction Jovian::pick_direction();
|
|
-extern Ucoors Jovian::pick_sector();
|
|
-extern Point Jovian::pick_target();
|
|
+//extern Action Jovian::pick_action();
|
|
+//extern Direction Jovian::pick_direction();
|
|
+//extern Ucoors Jovian::pick_sector();
|
|
+//extern Point Jovian::pick_target();
|
|
|
|
|
|
Jovian::Jovian(): Combatant()
|
|
diff -ur xspacewarp-1.2/c_jovian_ai.cc xspacewarp-1.2b/c_jovian_ai.cc
|
|
--- xspacewarp-1.2/c_jovian_ai.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_jovian_ai.cc 2010-05-14 14:51:03.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_jovian_ai.cc 1.14 95/12/28 00:41:30 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -25,7 +25,7 @@
|
|
#include "c_jovian.hh"
|
|
#include "c_jovian_ai.hh" // params and inlines used in these ai routines
|
|
#include "c_sector.hh"
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
#include <stdlib.h> // rand()
|
|
#include "common.hh"
|
|
#include "params.hh"
|
|
diff -ur xspacewarp-1.2/c_sector.cc xspacewarp-1.2b/c_sector.cc
|
|
--- xspacewarp-1.2/c_sector.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_sector.cc 2010-05-14 14:53:41.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_sector.cc 1.19 95/12/23 03:11:28 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -10,7 +10,8 @@
|
|
// methods for the sector class
|
|
|
|
#include "c_sector.hh"
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include <stdlib.h> // abs()
|
|
#include <stdio.h> // sprintf()
|
|
#include <math.h> // sqrt()
|
|
diff -ur xspacewarp-1.2/c_ship.cc xspacewarp-1.2b/c_ship.cc
|
|
--- xspacewarp-1.2/c_ship.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_ship.cc 2010-05-14 14:52:50.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_ship.cc 1.12 95/12/23 03:11:29 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -10,7 +10,8 @@
|
|
// methods for class Ship
|
|
|
|
#include "c_ship.hh"
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include <stdlib.h> // rand()
|
|
#include <stdio.h> // sprintf()
|
|
#include <time.h> // seed
|
|
diff -ur xspacewarp-1.2/c_star.cc xspacewarp-1.2b/c_star.cc
|
|
--- xspacewarp-1.2/c_star.cc 1995-12-29 05:41:56.000000000 -0200
|
|
+++ xspacewarp-1.2b/c_star.cc 2010-05-14 14:53:14.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* c_star.cc 1.9 95/12/23 03:11:29 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -13,7 +13,8 @@
|
|
#include "c_star.hh"
|
|
#include "c_body.hh"
|
|
#include <stdlib.h>
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include "space_objects.hh"
|
|
|
|
|
|
diff -ur xspacewarp-1.2/draw_intro.cc xspacewarp-1.2b/draw_intro.cc
|
|
--- xspacewarp-1.2/draw_intro.cc 1995-12-29 05:42:12.000000000 -0200
|
|
+++ xspacewarp-1.2b/draw_intro.cc 2010-05-14 14:42:53.000000000 -0300
|
|
@@ -1,4 +1,5 @@
|
|
/* draw_intro.cc 1.12 95/12/23 03:11:38 */
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
@@ -43,7 +44,7 @@
|
|
// draw originator string
|
|
|
|
len = XtNumber(intro_originator_str) - 1;
|
|
- block.setrow(GAMEROWS - 5);
|
|
+ block.setrow(GAMEROWS - 6);
|
|
block.setcol(GAMECOLS/2 - len/2);
|
|
origin = block.origin();
|
|
XDrawString(DISPLAY, pixmap, def_GC, origin.x, origin.y,
|
|
@@ -52,12 +53,21 @@
|
|
// draw port string
|
|
|
|
len = XtNumber(intro_port_str) - 1;
|
|
- block.setrow(GAMEROWS - 4);
|
|
+ block.setrow(GAMEROWS - 5);
|
|
block.setcol(GAMECOLS/2 - len/2);
|
|
origin = block.origin();
|
|
XDrawString(DISPLAY, pixmap, def_GC, origin.x, origin.y,
|
|
intro_port_str, len);
|
|
|
|
+ // draw modernization string
|
|
+
|
|
+ len = XtNumber(intro_modern_str) - 1;
|
|
+ block.setrow(GAMEROWS - 4);
|
|
+ block.setcol(GAMECOLS/2 - len/2);
|
|
+ origin = block.origin();
|
|
+ XDrawString(DISPLAY, pixmap, def_GC, origin.x, origin.y,
|
|
+ intro_modern_str, len);
|
|
+
|
|
// copy to window
|
|
|
|
XCopyArea(DISPLAY, pixmap, XtWindow(widget),
|
|
diff -ur xspacewarp-1.2/draw_orientation.cc xspacewarp-1.2b/draw_orientation.cc
|
|
--- xspacewarp-1.2/draw_orientation.cc 1995-12-29 05:42:12.000000000 -0200
|
|
+++ xspacewarp-1.2b/draw_orientation.cc 2010-05-14 14:54:24.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* draw_orientation.cc 1.5 95/12/23 03:11:40 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -10,10 +10,12 @@
|
|
// draw a page of the xspacewarp orientation
|
|
|
|
|
|
+#include <cstdlib>
|
|
#include "orientation.hh" // text for the orientation
|
|
#include <X11/Intrinsic.h>
|
|
#include <X11/StringDefs.h>
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include <string.h> // strlen()
|
|
#include "common.hh"
|
|
#include "params.hh"
|
|
diff -ur xspacewarp-1.2/draw_sector.cc xspacewarp-1.2b/draw_sector.cc
|
|
--- xspacewarp-1.2/draw_sector.cc 1995-12-29 05:42:12.000000000 -0200
|
|
+++ xspacewarp-1.2b/draw_sector.cc 2010-05-14 14:50:32.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* draw_sector.cc 1.8 95/12/23 03:11:39 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -14,7 +14,7 @@
|
|
|
|
|
|
#include <stdlib.h> // exit()
|
|
-#include <iostream.h> // cerr
|
|
+#include <iostream> // cerr
|
|
#include <X11/Intrinsic.h>
|
|
#include <X11/StringDefs.h>
|
|
#include "common.hh"
|
|
diff -ur xspacewarp-1.2/messages.hh xspacewarp-1.2b/messages.hh
|
|
--- xspacewarp-1.2/messages.hh 1995-12-29 05:41:39.000000000 -0200
|
|
+++ xspacewarp-1.2b/messages.hh 2010-05-14 14:55:48.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* messages.hh 1.13 95/12/28 23:24:14 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -24,13 +24,15 @@
|
|
// the introductory message for xspacewarp.
|
|
|
|
static const char intro_title_str[] =
|
|
-"XSPACEWARP 1.2";
|
|
+"XSPACEWARP 1.2b";
|
|
|
|
static const char intro_originator_str[] =
|
|
"ORIGINAL TRS-80 PROGRAM BY JOSHUA LAVINSKY (1977)";
|
|
|
|
static const char intro_port_str[] =
|
|
"PORTED TO X11 BY GREG WALKER (12/22/95)";
|
|
+static const char intro_modern_str[] =
|
|
+"Adapted for current gcc compilers by Niels Horn (05/14/10)";
|
|
|
|
static const char intro_skill_str[] =
|
|
"ENTER DIFFICULTY LEVEL (1-10): ";
|
|
diff -ur xspacewarp-1.2/universe.cc xspacewarp-1.2b/universe.cc
|
|
--- xspacewarp-1.2/universe.cc 1995-12-29 05:41:44.000000000 -0200
|
|
+++ xspacewarp-1.2b/universe.cc 2010-05-14 14:52:19.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* universe.cc 1.8 95/12/23 03:11:20 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -10,7 +10,8 @@
|
|
// the routines for creating a random universe and destroying it.
|
|
|
|
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include <stdlib.h> // rand(), exit()
|
|
#include "common.hh"
|
|
#include "params.hh"
|
|
diff -ur xspacewarp-1.2/xprep.cc xspacewarp-1.2b/xprep.cc
|
|
--- xspacewarp-1.2/xprep.cc 1995-12-29 05:41:44.000000000 -0200
|
|
+++ xspacewarp-1.2b/xprep.cc 2010-05-14 14:51:42.000000000 -0300
|
|
@@ -1,5 +1,5 @@
|
|
/* xprep.cc 1.19 95/12/24 01:05:05 */
|
|
-
|
|
+/* Adapted for modern gcc compilers by Niels Horn <niels.horn@gmail.com> - 2010/05/14 */
|
|
|
|
// xspacewarp by Greg Walker (gow@math.orst.edu)
|
|
|
|
@@ -17,7 +17,7 @@
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
#include "common.hh"
|
|
#include "params.hh"
|
|
#include "globals.hh"
|
|
@@ -150,7 +150,7 @@
|
|
int ndashes;
|
|
if ((ndashes = read_dashes(app_data.faser_dash_list, dash_list)) < 1)
|
|
{
|
|
- invalid("faserDashList");
|
|
+ invalid((char*)"faserDashList");
|
|
app_data.faser_dash_list = def_app_data.faser_dash_list;
|
|
(void) read_dashes(app_data.faser_dash_list, dash_list);
|
|
}
|
|
@@ -276,13 +276,13 @@
|
|
{
|
|
if (app_data.rows < 1)
|
|
{
|
|
- invalid("rows");
|
|
+ invalid((char*)"rows");
|
|
app_data.rows = def_app_data.rows;
|
|
}
|
|
|
|
if (app_data.columns < 1)
|
|
{
|
|
- invalid("columns");
|
|
+ invalid((char*)"columns");
|
|
app_data.columns = def_app_data.columns;
|
|
}
|
|
|
|
@@ -292,7 +292,7 @@
|
|
app_data.min_average_base_pop + app_data.min_variation_base_pop >
|
|
UROWS*UCOLS)
|
|
{
|
|
- invalid("minAverageBasePop or minVariationBasePop");
|
|
+ invalid((char*)"minAverageBasePop or minVariationBasePop");
|
|
app_data.min_average_base_pop = def_app_data.min_average_base_pop;
|
|
app_data.min_variation_base_pop = def_app_data.min_variation_base_pop;
|
|
}
|
|
@@ -303,14 +303,14 @@
|
|
app_data.max_average_base_pop + app_data.max_variation_base_pop >
|
|
UROWS*UCOLS)
|
|
{
|
|
- invalid("maxAverageBasePop or maxVariationBasePop");
|
|
+ invalid((char*)"maxAverageBasePop or maxVariationBasePop");
|
|
app_data.max_average_base_pop = def_app_data.max_average_base_pop;
|
|
app_data.max_variation_base_pop = def_app_data.max_variation_base_pop;
|
|
}
|
|
|
|
if (app_data.max_jovians_per_sector < 1)
|
|
{
|
|
- invalid("maxJoviansPerSector");
|
|
+ invalid((char*)"maxJoviansPerSector");
|
|
app_data.max_jovians_per_sector = def_app_data.max_jovians_per_sector;
|
|
}
|
|
|
|
@@ -320,7 +320,7 @@
|
|
app_data.min_average_jovian_pop + app_data.min_variation_jovian_pop >
|
|
app_data.max_jovians_per_sector*UROWS*UCOLS)
|
|
{
|
|
- invalid("minAverageJovianPop or minVariationJovianPop");
|
|
+ invalid((char*)"minAverageJovianPop or minVariationJovianPop");
|
|
app_data.min_average_jovian_pop = def_app_data.min_average_jovian_pop;
|
|
app_data.min_variation_jovian_pop = def_app_data.min_variation_jovian_pop;
|
|
}
|
|
@@ -331,14 +331,14 @@
|
|
app_data.max_average_jovian_pop + app_data.max_variation_jovian_pop >
|
|
app_data.max_jovians_per_sector*UROWS*UCOLS)
|
|
{
|
|
- invalid("maxAverageJovianPop or maxVariationJovianPop");
|
|
+ invalid((char*)"maxAverageJovianPop or maxVariationJovianPop");
|
|
app_data.max_average_jovian_pop = def_app_data.max_average_jovian_pop;
|
|
app_data.max_variation_jovian_pop = def_app_data.max_variation_jovian_pop;
|
|
}
|
|
|
|
if (app_data.max_stars_per_sector < 1)
|
|
{
|
|
- invalid("maxStarsPerSector");
|
|
+ invalid((char*)"maxStarsPerSector");
|
|
app_data.max_stars_per_sector = def_app_data.max_stars_per_sector;
|
|
}
|
|
|
|
@@ -348,7 +348,7 @@
|
|
app_data.min_average_star_pop + app_data.min_variation_star_pop >
|
|
app_data.max_stars_per_sector*UROWS*UCOLS)
|
|
{
|
|
- invalid("minAverageStarPop or minVariationStarPop");
|
|
+ invalid((char*)"minAverageStarPop or minVariationStarPop");
|
|
app_data.min_average_star_pop = def_app_data.min_average_star_pop;
|
|
app_data.min_variation_star_pop = def_app_data.min_variation_star_pop;
|
|
}
|
|
@@ -359,7 +359,7 @@
|
|
app_data.max_average_star_pop + app_data.max_variation_star_pop >
|
|
app_data.max_stars_per_sector*UROWS*UCOLS)
|
|
{
|
|
- invalid("maxAverageStarPop or maxVariationStarPop");
|
|
+ invalid((char*)"maxAverageStarPop or maxVariationStarPop");
|
|
app_data.max_average_star_pop = def_app_data.max_average_star_pop;
|
|
app_data.max_variation_star_pop = def_app_data.max_variation_star_pop;
|
|
}
|
|
@@ -371,7 +371,7 @@
|
|
app_data.min_average_blackhole_pop + app_data.min_variation_blackhole_pop
|
|
> UROWS*UCOLS)
|
|
{
|
|
- invalid("minAverageBlackholePop or minVariationBlackholePop");
|
|
+ invalid((char*)"minAverageBlackholePop or minVariationBlackholePop");
|
|
app_data.min_average_blackhole_pop = def_app_data.min_average_blackhole_pop;
|
|
app_data.min_variation_blackhole_pop =
|
|
def_app_data.min_variation_blackhole_pop;
|
|
@@ -384,7 +384,7 @@
|
|
app_data.max_average_blackhole_pop + app_data.max_variation_blackhole_pop
|
|
> UROWS*UCOLS)
|
|
{
|
|
- invalid("maxAverageBlackholePop or maxVariationBlackholePop");
|
|
+ invalid((char*)"maxAverageBlackholePop or maxVariationBlackholePop");
|
|
app_data.max_average_blackhole_pop = def_app_data.max_average_blackhole_pop;
|
|
app_data.max_variation_blackhole_pop =
|
|
def_app_data.max_variation_blackhole_pop;
|
|
@@ -392,147 +392,147 @@
|
|
|
|
if (app_data.faser_width < 1)
|
|
{
|
|
- invalid("faserWidth");
|
|
+ invalid((char*)"faserWidth");
|
|
app_data.faser_width = def_app_data.faser_width;
|
|
}
|
|
|
|
if (app_data.faser_dash_offset < 0)
|
|
{
|
|
- invalid("faserDashOffset");
|
|
+ invalid((char*)"faserDashOffset");
|
|
app_data.faser_dash_offset = def_app_data.faser_dash_offset;
|
|
}
|
|
|
|
if (app_data.faser_speed < 1)
|
|
{
|
|
- invalid("faserSpeed");
|
|
+ invalid((char*)"faserSpeed");
|
|
app_data.faser_speed = def_app_data.faser_speed;
|
|
}
|
|
|
|
if (app_data.torpedo_width < 1)
|
|
{
|
|
- invalid("torpedoWidth");
|
|
+ invalid((char*)"torpedoWidth");
|
|
app_data.torpedo_width = def_app_data.torpedo_width;
|
|
}
|
|
|
|
if (app_data.torpedo_length < 1)
|
|
{
|
|
- invalid("torpedoLength");
|
|
+ invalid((char*)"torpedoLength");
|
|
app_data.torpedo_length = def_app_data.torpedo_length;
|
|
}
|
|
|
|
if (app_data.torpedo_speed < 1)
|
|
{
|
|
- invalid("torpedoSpeed");
|
|
+ invalid((char*)"torpedoSpeed");
|
|
app_data.torpedo_speed = def_app_data.torpedo_speed;
|
|
}
|
|
|
|
if (app_data.explosion_speed < 1)
|
|
{
|
|
- invalid("explosionSpeed");
|
|
+ invalid((char*)"explosionSpeed");
|
|
app_data.explosion_speed = def_app_data.explosion_speed;
|
|
}
|
|
|
|
if (app_data.explosion_radius_small < 1)
|
|
{
|
|
- invalid("explosionRadiusSmall");
|
|
+ invalid((char*)"explosionRadiusSmall");
|
|
app_data.explosion_radius_small = def_app_data.explosion_radius_small;
|
|
}
|
|
|
|
if (app_data.explosion_radius_big < 1)
|
|
{
|
|
- invalid("explosionRadiusBig");
|
|
+ invalid((char*)"explosionRadiusBig");
|
|
app_data.explosion_radius_big = def_app_data.explosion_radius_big;
|
|
}
|
|
|
|
if (app_data.endever_thrust_speed < 1)
|
|
{
|
|
- invalid("endeverThrustSpeed");
|
|
+ invalid((char*)"endeverThrustSpeed");
|
|
app_data.endever_thrust_speed = def_app_data.endever_thrust_speed;
|
|
}
|
|
|
|
if (app_data.ship_energize_speed < 1)
|
|
{
|
|
- invalid("shipEnergizeSpeed");
|
|
+ invalid((char*)"shipEnergizeSpeed");
|
|
app_data.ship_energize_speed = def_app_data.ship_energize_speed;
|
|
}
|
|
|
|
if (app_data.jovian_action_speed < 1)
|
|
{
|
|
- invalid("jovianActionSpeed.");
|
|
+ invalid((char*)"jovianActionSpeed.");
|
|
app_data.jovian_action_speed = def_app_data.jovian_action_speed;
|
|
}
|
|
|
|
if (strlen(app_data.self_destruct_code) != 3)
|
|
{
|
|
- invalid("selfDestructCode");
|
|
+ invalid((char*)"selfDestructCode");
|
|
app_data.self_destruct_code = def_app_data.self_destruct_code;
|
|
}
|
|
|
|
if (app_data.max_torpedoes < 0)
|
|
{
|
|
- invalid("maxTorpedoes");
|
|
+ invalid((char*)"maxTorpedoes");
|
|
app_data.max_torpedoes = def_app_data.max_torpedoes;
|
|
}
|
|
|
|
if (app_data.mask_probability < 0 || app_data.mask_probability > 100)
|
|
{
|
|
- invalid("maskProbability");
|
|
+ invalid((char*)"maskProbability");
|
|
app_data.mask_probability = def_app_data.mask_probability;
|
|
}
|
|
|
|
if (app_data.min_jovian_distance < 0 ||
|
|
app_data.min_jovian_distance > sqrt((double)SECTDIAGSQ)/(double)4)
|
|
{
|
|
- invalid("minJovianDistance");
|
|
+ invalid((char*)"minJovianDistance");
|
|
app_data.min_jovian_distance = def_app_data.min_jovian_distance;
|
|
}
|
|
|
|
if (app_data.endever_min_faser_energy < 0 ||
|
|
app_data.endever_min_faser_energy > 100)
|
|
{
|
|
- invalid("endeverMinFaserEnergy");
|
|
+ invalid((char*)"endeverMinFaserEnergy");
|
|
app_data.endever_min_faser_energy = def_app_data.endever_min_faser_energy;
|
|
}
|
|
|
|
if (app_data.endever_min_warp_energy < 0 ||
|
|
app_data.endever_min_warp_energy > 100)
|
|
{
|
|
- invalid("endeverMinWarpEnergy");
|
|
+ invalid((char*)"endeverMinWarpEnergy");
|
|
app_data.endever_min_warp_energy = def_app_data.endever_min_warp_energy;
|
|
}
|
|
|
|
if (app_data.endever_min_thrust_energy < 0 ||
|
|
app_data.endever_min_thrust_energy > 100)
|
|
{
|
|
- invalid("endeverMinThrustEnergy");
|
|
+ invalid((char*)"endeverMinThrustEnergy");
|
|
app_data.endever_min_thrust_energy = def_app_data.endever_min_thrust_energy;
|
|
}
|
|
|
|
if (app_data.jovian_min_faser_energy < 0 ||
|
|
app_data.jovian_min_faser_energy > 100)
|
|
{
|
|
- invalid("jovianMinFaserEnergy");
|
|
+ invalid((char*)"jovianMinFaserEnergy");
|
|
app_data.jovian_min_faser_energy = def_app_data.jovian_min_faser_energy;
|
|
}
|
|
|
|
if (app_data.jovian_min_warp_energy < 0 ||
|
|
app_data.jovian_min_warp_energy > 100)
|
|
{
|
|
- invalid("jovianMinWarpEnergy");
|
|
+ invalid((char*)"jovianMinWarpEnergy");
|
|
app_data.jovian_min_warp_energy = def_app_data.jovian_min_warp_energy;
|
|
}
|
|
|
|
if (app_data.jovian_min_thrust_energy < 0 ||
|
|
app_data.jovian_min_thrust_energy > 100)
|
|
{
|
|
- invalid("jovianMinThrustEnergy");
|
|
+ invalid((char*)"jovianMinThrustEnergy");
|
|
app_data.jovian_min_thrust_energy = def_app_data.jovian_min_thrust_energy;
|
|
}
|
|
|
|
if (app_data.jovian_thrust_retreat_energy < 0 ||
|
|
app_data.jovian_thrust_retreat_energy > 100)
|
|
{
|
|
- invalid("jovianThrustRetreatEnergy");
|
|
+ invalid((char*)"jovianThrustRetreatEnergy");
|
|
app_data.jovian_thrust_retreat_energy =
|
|
def_app_data.jovian_thrust_retreat_energy;
|
|
}
|
|
@@ -540,7 +540,7 @@
|
|
if (app_data.jovian_warp_retreat_energy < 0 ||
|
|
app_data.jovian_warp_retreat_energy > 100)
|
|
{
|
|
- invalid("jovianWarpRetreatEnergy");
|
|
+ invalid((char*)"jovianWarpRetreatEnergy");
|
|
app_data.jovian_warp_retreat_energy =
|
|
def_app_data.jovian_warp_retreat_energy;
|
|
}
|
|
@@ -548,7 +548,7 @@
|
|
if (app_data.jovian_faser_retreat_energy < 0 ||
|
|
app_data.jovian_faser_retreat_energy > 100)
|
|
{
|
|
- invalid("jovianFaserRetreatEnergy");
|
|
+ invalid((char*)"jovianFaserRetreatEnergy");
|
|
app_data.jovian_faser_retreat_energy =
|
|
def_app_data.jovian_faser_retreat_energy;
|
|
}
|
|
@@ -556,7 +556,7 @@
|
|
if (app_data.jovian_shield_retreat_energy < 0 ||
|
|
app_data.jovian_shield_retreat_energy > 100)
|
|
{
|
|
- invalid("jovianShieldRetreatEnergy");
|
|
+ invalid((char*)"jovianShieldRetreatEnergy");
|
|
app_data.jovian_shield_retreat_energy =
|
|
def_app_data.jovian_shield_retreat_energy;
|
|
}
|
|
@@ -564,56 +564,56 @@
|
|
if (app_data.jovian_retreat_probability < 0 ||
|
|
app_data.jovian_retreat_probability > 100)
|
|
{
|
|
- invalid("jovianRetreatProbability");
|
|
+ invalid((char*)"jovianRetreatProbability");
|
|
app_data.jovian_retreat_probability =
|
|
def_app_data.jovian_retreat_probability;
|
|
}
|
|
|
|
if (app_data.jovian_retreat_speed <= 0)
|
|
{
|
|
- invalid("jovianRetreatSpeed");
|
|
+ invalid((char*)"jovianRetreatSpeed");
|
|
app_data.jovian_retreat_speed =
|
|
def_app_data.jovian_retreat_speed;
|
|
}
|
|
|
|
if (app_data.jovian_min_fight_frequency <= 0)
|
|
{
|
|
- invalid("jovianMinFightFrequency");
|
|
+ invalid((char*)"jovianMinFightFrequency");
|
|
app_data.jovian_min_fight_frequency =
|
|
def_app_data.jovian_min_fight_frequency;
|
|
}
|
|
|
|
if (app_data.jovian_max_fight_frequency <= 0)
|
|
{
|
|
- invalid("jovianMaxFightFrequency");
|
|
+ invalid((char*)"jovianMaxFightFrequency");
|
|
app_data.jovian_max_fight_frequency =
|
|
def_app_data.jovian_max_fight_frequency;
|
|
}
|
|
|
|
if (app_data.jovian_min_raid_frequency <= 0)
|
|
{
|
|
- invalid("jovianMinRaidFrequency");
|
|
+ invalid((char*)"jovianMinRaidFrequency");
|
|
app_data.jovian_min_raid_frequency =
|
|
def_app_data.jovian_min_raid_frequency;
|
|
}
|
|
|
|
if (app_data.jovian_max_raid_frequency <= 0)
|
|
{
|
|
- invalid("jovianMaxRaidFrequency");
|
|
+ invalid((char*)"jovianMaxRaidFrequency");
|
|
app_data.jovian_max_raid_frequency =
|
|
def_app_data.jovian_max_raid_frequency;
|
|
}
|
|
|
|
if (app_data.jovian_min_leap_frequency <= 0)
|
|
{
|
|
- invalid("jovianMinLeapFrequency");
|
|
+ invalid((char*)"jovianMinLeapFrequency");
|
|
app_data.jovian_min_leap_frequency =
|
|
def_app_data.jovian_min_leap_frequency;
|
|
}
|
|
|
|
if (app_data.jovian_max_leap_frequency <= 0)
|
|
{
|
|
- invalid("jovianMaxLeapFrequency");
|
|
+ invalid((char*)"jovianMaxLeapFrequency");
|
|
app_data.jovian_max_leap_frequency =
|
|
app_data.jovian_max_leap_frequency;
|
|
}
|
|
diff -ur xspacewarp-1.2/xprep.hh xspacewarp-1.2b/xprep.hh
|
|
--- xspacewarp-1.2/xprep.hh 1995-12-29 05:41:39.000000000 -0200
|
|
+++ xspacewarp-1.2b/xprep.hh 2010-05-14 14:31:32.000000000 -0300
|
|
@@ -13,7 +13,8 @@
|
|
#include <X11/Intrinsic.h>
|
|
#include <X11/StringDefs.h>
|
|
#include <X11/Xmu/Converters.h> // convert resource string to type long int
|
|
-#include <iostream.h>
|
|
+#include <iostream>
|
|
+using namespace std;
|
|
#include "app_data.hh"
|
|
|
|
inline void invalid(char *str)
|
|
@@ -41,23 +42,23 @@
|
|
|
|
static XtActionsRec actions[] =
|
|
{
|
|
- {"expose", (XtActionProc)expose},
|
|
- {"mission", (XtActionProc)mission},
|
|
- {"orientation", (XtActionProc)orientation},
|
|
- {"move", (XtActionProc)move},
|
|
- {"sector", (XtActionProc)sector},
|
|
- {"scanner", (XtActionProc)scanner},
|
|
- {"summary", (XtActionProc)summary},
|
|
- {"leap", (XtActionProc)leap},
|
|
- {"shields", (XtActionProc)shields},
|
|
- {"fasers", (XtActionProc)fasers},
|
|
- {"torpedoes", (XtActionProc)torpedoes},
|
|
- {"selfdestruct", (XtActionProc)selfdestruct},
|
|
- {"input", (XtActionProc)input},
|
|
- {"backspace", (XtActionProc)backspace},
|
|
- {"endinput", (XtActionProc)endinput},
|
|
- {"replay", (XtActionProc)replay},
|
|
- {"pause", (XtActionProc)pause}
|
|
+ {(char*)"expose", (XtActionProc)expose},
|
|
+ {(char*)"mission", (XtActionProc)mission},
|
|
+ {(char*)"orientation", (XtActionProc)orientation},
|
|
+ {(char*)"move", (XtActionProc)move},
|
|
+ {(char*)"sector", (XtActionProc)sector},
|
|
+ {(char*)"scanner", (XtActionProc)scanner},
|
|
+ {(char*)"summary", (XtActionProc)summary},
|
|
+ {(char*)"leap", (XtActionProc)leap},
|
|
+ {(char*)"shields", (XtActionProc)shields},
|
|
+ {(char*)"fasers", (XtActionProc)fasers},
|
|
+ {(char*)"torpedoes", (XtActionProc)torpedoes},
|
|
+ {(char*)"selfdestruct", (XtActionProc)selfdestruct},
|
|
+ {(char*)"input", (XtActionProc)input},
|
|
+ {(char*)"backspace", (XtActionProc)backspace},
|
|
+ {(char*)"endinput", (XtActionProc)endinput},
|
|
+ {(char*)"replay", (XtActionProc)replay},
|
|
+ {(char*)"pause", (XtActionProc)pause}
|
|
};
|
|
|
|
|
|
@@ -130,19 +131,19 @@
|
|
(Pixel) 1, // foreground
|
|
(Pixel) 0, // background
|
|
(Pixel) 1, // endever_color
|
|
- ">-0", // endever_icon
|
|
+ (char*)">-0", // endever_icon
|
|
(Pixel) 1, // jovian_color
|
|
- "<*>", // jovian_icon
|
|
+ (char*)"<*>", // jovian_icon
|
|
(Pixel) 1, // base_color
|
|
- "+0+", // base_icon
|
|
+ (char*)"+0+", // base_icon
|
|
(Pixel) 1, // star_color
|
|
- ".", // star_icon
|
|
+ (char*)".", // star_icon
|
|
(Pixel) 0, // blackhole_color
|
|
- " ", // blackhole_icon
|
|
+ (char*)" ", // blackhole_icon
|
|
(Pixel) 1, // faser_color
|
|
9, // faser_width
|
|
0, // faser_dash_offset
|
|
- "4 4", // faser_dash_list
|
|
+ (char*)"4 4", // faser_dash_list
|
|
15L, // faser_speed
|
|
(Pixel) 1, // torpedo_color
|
|
9, // torpedo_width
|
|
@@ -155,7 +156,7 @@
|
|
100L, // endever_thrust_speed
|
|
3000L, // ship_energize_speed
|
|
100L, // jovian_action_speed
|
|
- "123", // self_destruct_code
|
|
+ (char*)"123", // self_destruct_code
|
|
0.0, // default_firing_angle
|
|
10, // max_torpedoes
|
|
3, // max_jovians_per_sector
|
|
@@ -194,7 +195,7 @@
|
|
sizeof(Boolean),
|
|
XtOffsetOf(AppData, nomouse),
|
|
XtRString,
|
|
- "False"
|
|
+ False
|
|
},
|
|
{
|
|
XtNrows,
|
|
@@ -365,7 +366,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, foreground),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNbackground,
|
|
@@ -374,7 +375,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, background),
|
|
XtRString,
|
|
- XtDefaultBackground
|
|
+ (XtPointer)XtDefaultBackground
|
|
},
|
|
{
|
|
XtNendeverColor,
|
|
@@ -383,7 +384,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, endever_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNendeverIcon,
|
|
@@ -401,7 +402,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, jovian_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNjovianIcon,
|
|
@@ -419,7 +420,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, base_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNbaseIcon,
|
|
@@ -437,7 +438,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, star_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNstarIcon,
|
|
@@ -455,7 +456,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, blackhole_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNblackholeIcon,
|
|
@@ -473,7 +474,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, faser_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNfaserWidth,
|
|
@@ -518,7 +519,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, torpedo_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNtorpedoWidth,
|
|
@@ -554,7 +555,7 @@
|
|
sizeof(Pixel),
|
|
XtOffsetOf(AppData, explosion_color),
|
|
XtRString,
|
|
- XtDefaultForeground
|
|
+ (XtPointer)XtDefaultForeground
|
|
},
|
|
{
|
|
XtNexplosionSpeed,
|
|
@@ -614,7 +615,7 @@
|
|
XtNselfDestructCode,
|
|
XtCSelfDestructCode,
|
|
XtRString,
|
|
- sizeof(String),
|
|
+ sizeof(string),
|
|
XtOffsetOf(AppData, self_destruct_code),
|
|
XtRImmediate,
|
|
(XtPointer) "123"
|