games/xspacewarp: Added (a "Star Trek" genre game)

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
Niels Horn 2010-06-12 15:46:37 -05:00 committed by Robby Workman
parent 29c2f4c373
commit a8c6d3606a
9 changed files with 1220 additions and 0 deletions

5
games/xspacewarp/README Normal file
View File

@ -0,0 +1,5 @@
In xspacewarp the player maneuvers a Federation spaceship, called the Endever,
through 81 sectors of space trying to destroy an Armada of enemy Jovian ships
before they destroy the all the Federation bases.
Ported to X from a game originally written for the TRS-80 in 1977.

View File

@ -0,0 +1,3 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

View File

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
xspacewarp: xspacewarp (Time Trek - like game for X Window System)
xspacewarp:
xspacewarp: In xspacewarp the player maneuvers a Federation spaceship, called the
xspacewarp: Endever, through 81 sectors of space trying to destroy an Armada of
xspacewarp: enemy Jovian ships before they destroy the all the Federation bases.
xspacewarp:
xspacewarp: Ported to X from a game originally written for the TRS-80 in 1977.
xspacewarp:
xspacewarp:
xspacewarp:
xspacewarp:

View File

@ -0,0 +1,999 @@
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"

View File

@ -0,0 +1,84 @@
XSPACEWARP 1.2 (12/22/95)
DESCRIPTION
In xspacewarp the player maneuvers a Federation spaceship,
called the Endever, through 81 sectors of space trying to
destroy an Armada of enemy Jovian ships before they destroy the
all the Federation bases. To accompish this task, the Endever
has fasers, ion thrust engines, warpdrive for jumping between
sectors, a limited number of photon torpedoes, and a finite
store of energy which gets depleted during battles and must be
replenished by docking with the bases. The game has no time
limit and has a choice of 10 skill levels. xspacewarp also has
an online orientation to explain the game in further detail.
HISTORY
xspacewarp is a re-creation of a Star Trek genre video game,
called "Time Trek", originally written in Z80 assembly language
by Joshua Lavinsky in 1977 to run on Radio Shack's TRS-80
computers with only 4K of RAM. Some time in the late 70's, Radio
Shack commercialized the game, changing its name to "Space Warp"
and changing some of the Star Trek terms (Klingons, Enterprise,
etc) to Radio Shack's own generic terms (Jovians, Endever,
etc). It is with this commercialized version of the game that I
am most familiar; so its names are what I used in
xspacewarp. Anybody wishing to change the names to the original
"Time Trek" equivalents can easily do so (see the "Note To
Translators" below).
REQUIREMENTS
1) A C++ compiler
2) The MIT X11 Server. X11R5 and X11R6 should work.
3) xmkmf/imake correctly installed and in your path.
4) This README file and the file xspacewarp-1.2.tar.gz
PLATFORMS
I have only built xspacewarp with the Gnu g++ compiler on a Sun
SPARCstation running SunOS 4.1.4 and X11R6.
A NOTE TO ARCHIVE ADMINISTRATORS
Anybody is free to put the xspacewarp program on a public
archive; I only ask that such persons notify me by email
(gow@math.orst.edu) of the new archive address. This will help
me when I make future improvements on the code. Thank you.
A NOTE TO TRANSLATORS
xspacewarp should be easy to translate into a different spoken
language (as long as it can be written in the 26 letter English
alphabet, anyway). If anyone volunteers to do this, all the
string constants used in xspacewarp are confined to the header
files messages.hh and orientation.hh.
A PERSONAL NOTE
I found Space Warp very fun to play as a kid, and I decided to
port it to X11 and make its source public in hopes that the game
will survive far into the future, beyond when all the TRS-80s
have perished from the Earth and people stop making Z80
emulators.
I would welcome any comments on bugs or inconsistencies with the
original game from people more familiar with the TRS-80
spacewarp than myself. Having neither seen nor played the game
in at least 10 years, there are bound to be inconsistencies.
Enjoy!
Greg Walker
gow@math.orst.edu
Dec 19, 1995

View File

@ -0,0 +1,88 @@
#!/bin/sh
# Slackware build script for xspacewarp
# Time Trek - like game for X Window System
# Written by Niels Horn <niels.horn@gmail.com>
# Revision date: 2010/06/01
PRGNAM=xspacewarp
VERSION=${VERSION:-1.2b}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
SRCVERSION=$(echo $VERSION | cut -b -3)
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$SRCVERSION
tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.gz
cd $PRGNAM-$SRCVERSION
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Apply patch to version 1.2b (adapt for modern gcc compiler)
patch -p1 < $CWD/version12b.patch
xmkmf
make Makefile
make CDEBUGFLAGS="$SLKCFLAGS -fno-strength-reduce -fno-strict-aliasing" $PRGNAM
make install BINDIR=/usr/games DESTDIR=$PKG
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
CHANGES INSTALL \
$PKG/usr/doc/$PRGNAM-$VERSION/
cat $CWD/xspacewarp-1.2.README > $PKG/usr/doc/$PRGNAM-$VERSION/README
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/usr/share/{applications,pixmaps}
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=XSpaceWarp
Comment=Live long and prosper!
Categories=Game;
Exec=xspacewarp
Icon=xspacewarp
StartupNotify=false

View File

@ -0,0 +1,12 @@
PRGNAM="xspacewarp"
VERSION="1.2b"
HOMEPAGE="http://ftp.x.org/contrib/games/xspacewarp-1.2.README"
DOWNLOAD="http://ftp.x.org/contrib/games/xspacewarp-1.2.tar.gz \
http://ftp.x.org/contrib/games/xspacewarp-1.2.README"
MD5SUM="54aa93eb6fd3d7fa396fc47ddf3ffd15 \
2ada097ae26285e710f2e4976744e7cf"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Niels Horn"
EMAIL="niels.horn@gmail.com"
APPROVED="rworkman"

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B