1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

A turn-based strategy game where up to 8 players strive for control

of as many cities as possible. Produce new armies in cities to
conquer nearby cities. Using the income from those cities, make
more armies to take more cities. Send a hero to a temple to get a
quest, or maybe search a nearby ruin instead. Play with others or
against the computer.

WWW: http://lordsawar.com/

PR:		ports/120803
Submitted by:	spam at rm-rf.kiev.ua
This commit is contained in:
Martin Wilke 2008-02-21 08:53:00 +00:00
parent 793438fc1b
commit 09ce051eb9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=207687
8 changed files with 482 additions and 0 deletions

View File

@ -455,6 +455,7 @@
SUBDIR += lm-solve
SUBDIR += lmarbles
SUBDIR += lmpc
SUBDIR += lordsawar
SUBDIR += ltris
SUBDIR += lucidlife
SUBDIR += luola

40
games/lordsawar/Makefile Normal file
View File

@ -0,0 +1,40 @@
# New ports collection makefile for: lordsawar
# Date created: 12 February 2008
# Whom: spam@rm-rf.kiev.ua
#
# $FreeBSD$
#
PORTNAME= lordsawar
PORTVERSION= 0.0.8
CATEGORIES= games
MASTER_SITES= http://lordsawar.com/
MAINTAINER= spam@rm-rf.kiev.ua
COMMENT= A Warlords II clone
LIB_DEPENDS= glademm-2.4:${PORTSDIR}/devel/libglademm24
USE_GZIP= yes
USE_GETTEXT= yes
USE_SDL= sdl image
OPTIONS= SOUND "Enable sound" on
.include <bsd.port.pre.mk>
CONFIGURE_ARGS+=--disable-nls
.if !defined(WITHOUT_SOUND)
USE_SDL+= mixer
.else
CONFIGURE_ARGS+=--disable-sound
.endif
GNU_CONFIGURE= yes
CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib" \
CPPFLAGS="-I${LOCALBASE}/include" \
LIBS="${PTHREAD_LIBS}"
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
.include <bsd.port.post.mk>

3
games/lordsawar/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (lordsawar-0.0.8.tar.gz) = dfe83aea8517d9760d9cd8e268efef8d
SHA256 (lordsawar-0.0.8.tar.gz) = 9786394b856beeee45fcfe0ca74befed573b5b5f201086f8bc73d3d54a3d28e1
SIZE (lordsawar-0.0.8.tar.gz) = 13340263

View File

@ -0,0 +1,20 @@
Index: configure
@@ -4622,7 +4622,7 @@
LDFLAGS="$LDFLAGS -lSDL_mixer"
LIBS="-lSDL_mixer $LIBS"
- if test $CC = "gcc" || test $CXX = "g++"; then
+ if test $CC = "gcc" || test $CXX = "g++" || test $CXX = "c++"; then
if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
@@ -13798,8 +13798,7 @@
rm -f src/main.o
-LORDSAWAR_DATADIR="$datadir/lordsawar"
-LORDSAWAR_DATADIR=${LORDSAWAR_DATADIR/'${prefix}'/$prefix}
+eval LORDSAWAR_DATADIR="$datadir/lordsawar"
ac_config_files="$ac_config_files dat/Makefile dat/army/Makefile dat/army/default/Makefile dat/army/bigdefault/Makefile dat/tilesets/Makefile dat/tilesets/default/Makefile dat/tilesets/default/misc/Makefile dat/tilesets/bigdefault/Makefile dat/tilesets/bigdefault/misc/Makefile dat/shield/Makefile dat/shield/default/Makefile dat/shield/plain/Makefile dat/citysets/Makefile dat/citysets/default/Makefile dat/citysets/bigdefault/Makefile dat/various/Makefile dat/various/items/Makefile dat/various/editor/Makefile dat/map/Makefile dat/ggz/Makefile dat/ggz/lordsawar.dsc dat/ggz/lordsawar-server.dsc dat/music/Makefile dat/glade/Makefile dat/glade/editor/Makefile intl/Makefile po/Makefile.in po/Makefile Makefile src/Makefile doc/Makefile src/server/Makefile src/editor/Makefile src/gui/Makefile"

View File

@ -0,0 +1,98 @@
Index: src/game.cpp
@@ -1115,15 +1115,6 @@
int
Game::loadHeroTemplates()
{
- FILE *fileptr = fopen (File::getMiscFile("heronames").c_str(), "r");
- char *line = NULL;
- size_t len = 0;
- ssize_t read;
- int retval;
- int gender;
- int side;
- size_t bytesread = 0;
- char *tmp;
const Armysetlist* al = Armysetlist::getInstance();
const Army* herotype;
@@ -1131,51 +1122,41 @@
std::vector<const Army*> heroes;
Player *p = Playerlist::getInstance()->getNeutral();
for (unsigned int j = 0; j < al->getSize(p->getArmyset()); j++)
- {
+ {
const Army *a = al->getArmy (p->getArmyset(), j);
if (a->isHero())
- heroes.push_back(a);
+ heroes.push_back(a);
}
+
+ std::ifstream file(File::getMiscFile("heronames").c_str());
- if (fileptr == NULL)
- return -1;
- while ((read = getline (&line, &len, fileptr)) != -1)
- {
- bytesread = 0;
- retval = sscanf (line, "%d%d%n", &side, &gender, &bytesread);
- if (retval != 2)
- {
- free (line);
- return -2;
- }
- while (isspace(line[bytesread]) && line[bytesread] != '\0')
- bytesread++;
- tmp = strchr (&line[bytesread], '\n');
- if (tmp)
- tmp[0] = '\0';
- if (strlen (&line[bytesread]) == 0)
- {
- free (line);
- return -3;
- }
- if (side < 0 || side > (int) MAX_PLAYERS)
- {
- free (line);
- return -4;
+ if (file.good()) {
+ std::string buffer, name;
+ int side, gender;
+
+ while (std::getline(file, buffer)) {
+ std::istringstream line(buffer);
+ if (!(line >> side >> gender >> name))
+ return -2;
+
+ if (side < 0 || side > (int) MAX_PLAYERS)
+ return -4;
+
+ herotype = heroes[rand() % heroes.size()];
+ Hero *newhero = new Hero (*herotype, "", NULL);
+
+ if (gender)
+ newhero->setGender(Hero::MALE);
+ else
+ newhero->setGender(Hero::FEMALE);
+
+ newhero->setName (name);
+ d_herotemplates[side].push_back (newhero);
}
+ } else
+ return -1;
- herotype = heroes[rand() % heroes.size()];
- Hero *newhero = new Hero (*herotype, "", NULL);
- if (gender)
- newhero->setGender(Hero::MALE);
- else
- newhero->setGender(Hero::FEMALE);
- newhero->setName (&line[bytesread]);
- d_herotemplates[side].push_back (newhero);
- }
- if (line)
- free (line);
- fclose (fileptr);
+ file.close();
return 0;
}

View File

@ -0,0 +1,14 @@
Index: src/ucompose.hpp
@@ -178,9 +178,9 @@
inline Composition::Composition(std::string fmt)
: arg_no(1)
{
-#if __GNUC__ >= 3
- os.imbue(std::locale("")); // use the user's locale for the stream
-#endif
+//#if __GNUC__ >= 3
+// os.imbue(std::locale("")); // use the user's locale for the stream
+//#endif
std::string::size_type b = 0, i = 0;
// fill in output with the strings between the %1 %2 %3 etc. and

View File

@ -0,0 +1,8 @@
A turn-based strategy game where up to 8 players strive for control
of as many cities as possible. Produce new armies in cities to
conquer nearby cities. Using the income from those cities, make
more armies to take more cities. Send a hero to a temple to get a
quest, or maybe search a nearby ruin instead. Play with others or
against the computer.
WWW: http://lordsawar.com/

298
games/lordsawar/pkg-plist Normal file
View File

@ -0,0 +1,298 @@
bin/lordsawar
bin/lordsawar-army-editor
bin/lordsawar-editor
bin/lordsawar_server
share/applications/lordsawar.desktop
%%DATADIR%%/citynames
%%DATADIR%%/heronames
%%DATADIR%%/ruinnames
%%DATADIR%%/signposts
%%DATADIR%%/templenames
%%DATADIR%%/army/default/default.xml
%%DATADIR%%/army/default/archers.png
%%DATADIR%%/army/default/archons.png
%%DATADIR%%/army/default/catapults.png
%%DATADIR%%/army/default/daemons.png
%%DATADIR%%/army/default/devils.png
%%DATADIR%%/army/default/dragons.png
%%DATADIR%%/army/default/dwarves.png
%%DATADIR%%/army/default/elementals.png
%%DATADIR%%/army/default/elephants.png
%%DATADIR%%/army/default/ghosts.png
%%DATADIR%%/army/default/giantbats.png
%%DATADIR%%/army/default/giants.png
%%DATADIR%%/army/default/giantworms.png
%%DATADIR%%/army/default/griffins.png
%%DATADIR%%/army/default/heavycav.png
%%DATADIR%%/army/default/heavyinf.png
%%DATADIR%%/army/default/hero.png
%%DATADIR%%/army/default/lightcav.png
%%DATADIR%%/army/default/lightinf.png
%%DATADIR%%/army/default/minotaurs.png
%%DATADIR%%/army/default/orcishmob.png
%%DATADIR%%/army/default/pegasi.png
%%DATADIR%%/army/default/pikeman.png
%%DATADIR%%/army/default/scouts.png
%%DATADIR%%/army/default/spiders.png
%%DATADIR%%/army/default/unicorns.png
%%DATADIR%%/army/default/wizards.png
%%DATADIR%%/army/default/wolfriders.png
%%DATADIR%%/army/default/stackship.png
%%DATADIR%%/army/default/plantedstandard.png
%%DATADIR%%/army/bigdefault/bigdefault.xml
%%DATADIR%%/army/bigdefault/archers.png
%%DATADIR%%/army/bigdefault/archons.png
%%DATADIR%%/army/bigdefault/catapults.png
%%DATADIR%%/army/bigdefault/daemons.png
%%DATADIR%%/army/bigdefault/devils.png
%%DATADIR%%/army/bigdefault/dragons.png
%%DATADIR%%/army/bigdefault/dwarves.png
%%DATADIR%%/army/bigdefault/elementals.png
%%DATADIR%%/army/bigdefault/elephants.png
%%DATADIR%%/army/bigdefault/ghosts.png
%%DATADIR%%/army/bigdefault/giantbats.png
%%DATADIR%%/army/bigdefault/giants.png
%%DATADIR%%/army/bigdefault/giantworms.png
%%DATADIR%%/army/bigdefault/griffins.png
%%DATADIR%%/army/bigdefault/heavycav.png
%%DATADIR%%/army/bigdefault/heavyinf.png
%%DATADIR%%/army/bigdefault/hero.png
%%DATADIR%%/army/bigdefault/lightcav.png
%%DATADIR%%/army/bigdefault/lightinf.png
%%DATADIR%%/army/bigdefault/minotaurs.png
%%DATADIR%%/army/bigdefault/pegasi.png
%%DATADIR%%/army/bigdefault/orcishmob.png
%%DATADIR%%/army/bigdefault/pikeman.png
%%DATADIR%%/army/bigdefault/scouts.png
%%DATADIR%%/army/bigdefault/spiders.png
%%DATADIR%%/army/bigdefault/unicorns.png
%%DATADIR%%/army/bigdefault/wizards.png
%%DATADIR%%/army/bigdefault/wolfriders.png
%%DATADIR%%/army/bigdefault/stackship.png
%%DATADIR%%/army/bigdefault/plantedstandard.png
%%DATADIR%%/tilesets/default/misc/flags.png
%%DATADIR%%/tilesets/default/misc/roads.png
%%DATADIR%%/tilesets/default/misc/bridges.png
%%DATADIR%%/tilesets/default/misc/fog.png
%%DATADIR%%/tilesets/default/misc/selector.png
%%DATADIR%%/tilesets/default/misc/small_selector.png
%%DATADIR%%/tilesets/default/misc/explosion.png
%%DATADIR%%/tilesets/default/default.xml
%%DATADIR%%/tilesets/default/grass.png
%%DATADIR%%/tilesets/default/water.png
%%DATADIR%%/tilesets/default/forest.png
%%DATADIR%%/tilesets/default/hills.png
%%DATADIR%%/tilesets/default/mountains.png
%%DATADIR%%/tilesets/default/swamp.png
%%DATADIR%%/tilesets/bigdefault/misc/flags.png
%%DATADIR%%/tilesets/bigdefault/misc/roads.png
%%DATADIR%%/tilesets/bigdefault/misc/bridges.png
%%DATADIR%%/tilesets/bigdefault/misc/fog.png
%%DATADIR%%/tilesets/bigdefault/misc/selector.png
%%DATADIR%%/tilesets/bigdefault/misc/small_selector.png
%%DATADIR%%/tilesets/bigdefault/misc/explosion.png
%%DATADIR%%/tilesets/bigdefault/bigdefault.xml
%%DATADIR%%/tilesets/bigdefault/grass.png
%%DATADIR%%/tilesets/bigdefault/water.png
%%DATADIR%%/tilesets/bigdefault/forest.png
%%DATADIR%%/tilesets/bigdefault/hills.png
%%DATADIR%%/tilesets/bigdefault/mountains.png
%%DATADIR%%/tilesets/bigdefault/swamp.png
%%DATADIR%%/various/items/items.xml
%%DATADIR%%/various/editor/button_selector.png
%%DATADIR%%/various/editor/button_1x1.png
%%DATADIR%%/various/editor/button_2x2.png
%%DATADIR%%/various/editor/button_3x3.png
%%DATADIR%%/various/editor/button_castle.png
%%DATADIR%%/various/editor/button_erase.png
%%DATADIR%%/various/editor/button_blank.png
%%DATADIR%%/various/editor/button_signpost.png
%%DATADIR%%/various/editor/button_ruin.png
%%DATADIR%%/various/editor/button_road.png
%%DATADIR%%/various/editor/button_temple.png
%%DATADIR%%/various/editor/button_stack.png
%%DATADIR%%/various/editor/button_bridge.png
%%DATADIR%%/various/editor/button_port.png
%%DATADIR%%/various/arrows.png
%%DATADIR%%/various/waypoints.png
%%DATADIR%%/various/buttons.png
%%DATADIR%%/various/city_occupied.png
%%DATADIR%%/various/items.png
%%DATADIR%%/various/medals_mask.gif
%%DATADIR%%/various/ship.png
%%DATADIR%%/various/recruit_female.png
%%DATADIR%%/various/recruit_male.png
%%DATADIR%%/various/ruin_1.png
%%DATADIR%%/various/ruin_2.png
%%DATADIR%%/various/splash_screen.jpg
%%DATADIR%%/various/about_screen.jpg
%%DATADIR%%/various/network_screen.jpg
%%DATADIR%%/various/stats.png
%%DATADIR%%/various/win.jpg
%%DATADIR%%/various/win_mask.png
%%DATADIR%%/various/freelords.png
%%DATADIR%%/various/lordsawar_logo.png
%%DATADIR%%/various/freelords_editor.png
%%DATADIR%%/various/editor.png
%%DATADIR%%/various/hero.png
%%DATADIR%%/various/prodshieldset.png
%%DATADIR%%/various/smallruinedcity.png
%%DATADIR%%/various/movebonus.png
%%DATADIR%%/various/smallunexploredruin.png
%%DATADIR%%/various/smallunexploredstronghold.png
%%DATADIR%%/various/smallexploredruin.png
%%DATADIR%%/various/smalltemple.png
%%DATADIR%%/various/cursors.png
%%DATADIR%%/various/smallupkeep.png
%%DATADIR%%/various/smallincome.png
%%DATADIR%%/various/smalltreasury.png
%%DATADIR%%/various/smallcity.png
%%DATADIR%%/various/diplomacy-small.png
%%DATADIR%%/various/diplomacy-large.png
%%DATADIR%%/map/2ndPunic37.map
%%DATADIR%%/music/back1.ogg
%%DATADIR%%/music/defeat.ogg
%%DATADIR%%/music/defeat1.ogg
%%DATADIR%%/music/victory.ogg
%%DATADIR%%/music/victory1.ogg
%%DATADIR%%/music/hero.ogg
%%DATADIR%%/music/intro.ogg
%%DATADIR%%/music/music.xml
%%DATADIR%%/glade/army-gains-level-dialog.glade
%%DATADIR%%/glade/army-info-window.glade
%%DATADIR%%/glade/stack-info-window.glade
%%DATADIR%%/glade/buy-production-dialog.glade
%%DATADIR%%/glade/city-defeated-dialog.glade
%%DATADIR%%/glade/city-looted-dialog.glade
%%DATADIR%%/glade/city-pillaged-dialog.glade
%%DATADIR%%/glade/city-sacked-dialog.glade
%%DATADIR%%/glade/city-window.glade
%%DATADIR%%/glade/destination-dialog.glade
%%DATADIR%%/glade/fight-window.glade
%%DATADIR%%/glade/game-loaded-dialog.glade
%%DATADIR%%/glade/player-died-dialog.glade
%%DATADIR%%/glade/game-over-dialog.glade
%%DATADIR%%/glade/game-preferences-dialog.glade
%%DATADIR%%/glade/game-window.glade
%%DATADIR%%/glade/hero-dialog.glade
%%DATADIR%%/glade/hero-offer-dialog.glade
%%DATADIR%%/glade/surrender-dialog.glade
%%DATADIR%%/glade/sage-dialog.glade
%%DATADIR%%/glade/ruin-rewarded-dialog.glade
%%DATADIR%%/glade/ruin-report-dialog.glade
%%DATADIR%%/glade/history-report-dialog.glade
%%DATADIR%%/glade/report-dialog.glade
%%DATADIR%%/glade/load-scenario-dialog.glade
%%DATADIR%%/glade/medal-awarded-dialog.glade
%%DATADIR%%/glade/quest-assigned-dialog.glade
%%DATADIR%%/glade/quest-expired-dialog.glade
%%DATADIR%%/glade/preferences-dialog.glade
%%DATADIR%%/glade/ruinfight-finished-dialog.glade
%%DATADIR%%/glade/ruinfight-started-dialog.glade
%%DATADIR%%/glade/ruin-searched-dialog.glade
%%DATADIR%%/glade/splash-window.glade
%%DATADIR%%/glade/temple-visit-dialog.glade
%%DATADIR%%/glade/disband-stack-dialog.glade
%%DATADIR%%/glade/hero-brings-allies-dialog.glade
%%DATADIR%%/glade/military-advisor-dialog.glade
%%DATADIR%%/glade/next-player-turn-dialog.glade
%%DATADIR%%/glade/city-rename-dialog.glade
%%DATADIR%%/glade/city-raze-dialog.glade
%%DATADIR%%/glade/city-razed-dialog.glade
%%DATADIR%%/glade/signpost-change-dialog.glade
%%DATADIR%%/glade/fight-order-dialog.glade
%%DATADIR%%/glade/hero-levels-dialog.glade
%%DATADIR%%/glade/player-resign-dialog.glade
%%DATADIR%%/glade/army-bonus-dialog.glade
%%DATADIR%%/glade/item-bonus-dialog.glade
%%DATADIR%%/glade/game-options-dialog.glade
%%DATADIR%%/glade/triumphs-dialog.glade
%%DATADIR%%/glade/diplomacy-report-dialog.glade
%%DATADIR%%/glade/diplomacy-dialog.glade
%%DATADIR%%/glade/treachery-dialog.glade
%%DATADIR%%/glade/editor/main-window.glade
%%DATADIR%%/glade/editor/signpost-dialog.glade
%%DATADIR%%/glade/editor/temple-dialog.glade
%%DATADIR%%/glade/editor/ruin-dialog.glade
%%DATADIR%%/glade/editor/stack-dialog.glade
%%DATADIR%%/glade/editor/select-army-dialog.glade
%%DATADIR%%/glade/editor/players-dialog.glade
%%DATADIR%%/glade/editor/city-dialog.glade
%%DATADIR%%/glade/editor/map-info-dialog.glade
%%DATADIR%%/glade/editor/new-map-dialog.glade
%%DATADIR%%/glade/editor/armyset-window.glade
%%DATADIR%%/glade/editor/armyset-info-dialog.glade
%%DATADIR%%/shield/default/default.xml
%%DATADIR%%/shield/default/small-white-shield.png
%%DATADIR%%/shield/default/small-green-shield.png
%%DATADIR%%/shield/default/small-yellow-shield.png
%%DATADIR%%/shield/default/small-lightblue-shield.png
%%DATADIR%%/shield/default/small-red-shield.png
%%DATADIR%%/shield/default/small-darkblue-shield.png
%%DATADIR%%/shield/default/small-orange-shield.png
%%DATADIR%%/shield/default/small-black-shield.png
%%DATADIR%%/shield/default/small-neutral-shield.png
%%DATADIR%%/shield/default/medium-white-shield.png
%%DATADIR%%/shield/default/medium-green-shield.png
%%DATADIR%%/shield/default/medium-yellow-shield.png
%%DATADIR%%/shield/default/medium-lightblue-shield.png
%%DATADIR%%/shield/default/medium-red-shield.png
%%DATADIR%%/shield/default/medium-darkblue-shield.png
%%DATADIR%%/shield/default/medium-orange-shield.png
%%DATADIR%%/shield/default/medium-black-shield.png
%%DATADIR%%/shield/default/medium-neutral-shield.png
%%DATADIR%%/shield/default/large-white-shield.png
%%DATADIR%%/shield/default/large-green-shield.png
%%DATADIR%%/shield/default/large-yellow-shield.png
%%DATADIR%%/shield/default/large-lightblue-shield.png
%%DATADIR%%/shield/default/large-red-shield.png
%%DATADIR%%/shield/default/large-darkblue-shield.png
%%DATADIR%%/shield/default/large-orange-shield.png
%%DATADIR%%/shield/default/large-black-shield.png
%%DATADIR%%/shield/default/large-neutral-shield.png
%%DATADIR%%/shield/plain/plain.xml
%%DATADIR%%/shield/plain/small-shield.png
%%DATADIR%%/shield/plain/small-neutral-shield.png
%%DATADIR%%/shield/plain/medium-shield.png
%%DATADIR%%/shield/plain/medium-neutral-shield.png
%%DATADIR%%/shield/plain/large-shield.png
%%DATADIR%%/shield/plain/large-neutral-shield.png
%%DATADIR%%/citysets/default/default.xml
%%DATADIR%%/citysets/default/castle_razed.png
%%DATADIR%%/citysets/default/castles.png
%%DATADIR%%/citysets/default/port.png
%%DATADIR%%/citysets/default/ruin.png
%%DATADIR%%/citysets/default/signpost.png
%%DATADIR%%/citysets/default/temples.png
%%DATADIR%%/citysets/default/towers.png
%%DATADIR%%/citysets/bigdefault/bigdefault.xml
%%DATADIR%%/citysets/bigdefault/castle_razed.png
%%DATADIR%%/citysets/bigdefault/castles.png
%%DATADIR%%/citysets/bigdefault/port.png
%%DATADIR%%/citysets/bigdefault/ruin.png
%%DATADIR%%/citysets/bigdefault/signpost.png
%%DATADIR%%/citysets/bigdefault/temples.png
%%DATADIR%%/citysets/bigdefault/towers.png
@dirrmtry share/applications
@dirrm %%DATADIR%%/army/default
@dirrm %%DATADIR%%/army/bigdefault
@dirrm %%DATADIR%%/army
@dirrm %%DATADIR%%/citysets/default
@dirrm %%DATADIR%%/citysets/bigdefault
@dirrm %%DATADIR%%/citysets
@dirrm %%DATADIR%%/glade/editor
@dirrm %%DATADIR%%/glade
@dirrm %%DATADIR%%/map
@dirrm %%DATADIR%%/music
@dirrm %%DATADIR%%/shield/default
@dirrm %%DATADIR%%/shield/plain
@dirrm %%DATADIR%%/shield
@dirrm %%DATADIR%%/tilesets/default/misc
@dirrm %%DATADIR%%/tilesets/default
@dirrm %%DATADIR%%/tilesets/bigdefault/misc
@dirrm %%DATADIR%%/tilesets/bigdefault
@dirrm %%DATADIR%%/tilesets
@dirrm %%DATADIR%%/various/items
@dirrm %%DATADIR%%/various/editor
@dirrm %%DATADIR%%/various
@dirrm %%DATADIR%%