--- matrem-1.0.orig/yourcreature.cpp +++ matrem-1.0/yourcreature.cpp @@ -1,6 +1,6 @@ #include "yourcreature.h" -yourcreature::yourcreature(yourcreature *parent=NULL) : creature(parent) +yourcreature::yourcreature(yourcreature *parent) : creature(parent) { species=YOURCREATURE; hitpoints=100; --- matrem-1.0.orig/graphics.h +++ matrem-1.0/graphics.h @@ -1,7 +1,6 @@ #include "config.h" #include "creature.h" -void error(char* code,int var1=0,int var2=0, int var3=0, int var4=0); extern creature* followcr; void init_graphics(); --- matrem-1.0.orig/fish.cpp +++ matrem-1.0/fish.cpp @@ -1,6 +1,6 @@ #include "fish.h" -fish::fish(fish *parent=NULL) : creature(parent) +fish::fish(fish *parent) : creature(parent) { species=FISH; hitpoints=200; --- matrem-1.0.orig/jerremiah.cpp +++ matrem-1.0/jerremiah.cpp @@ -1,6 +1,6 @@ #include "jerremiah.h" -jerremiah::jerremiah(jerremiah *parent=NULL) : creature(parent) +jerremiah::jerremiah(jerremiah *parent) : creature(parent) { species=JERREMIAH; hitpoints=410; --- matrem-1.0.orig/milkacow.cpp +++ matrem-1.0/milkacow.cpp @@ -1,6 +1,6 @@ #include "milkacow.h" -milkacow::milkacow(milkacow *parent=NULL) : creature(parent) +milkacow::milkacow(milkacow *parent) : creature(parent) { species=MILKACOW; hitpoints=410; --- matrem-1.0.orig/debian/changelog +++ matrem-1.0/debian/changelog @@ -0,0 +1,66 @@ +matrem (1.0-10) unstable; urgency=low + + * Remove strip command from Makefile. Closes: #437558 + * Fix some g++-4.2 compiler warnings. + * Update copyright file. + * Update Standards-Version. + + -- Guus Sliepen Tue, 14 Aug 2007 13:31:23 +0200 + +matrem (1.0-9) unstable; urgency=low + + * Build-depend on liballegro4.2-dev. Closes: #350860 + * Fix some compiler warnings. + + -- Guus Sliepen Thu, 2 Feb 2006 15:13:43 +0100 + +matrem (1.0-8) unstable; urgency=low + + * Recompile needed for C++ ABI change. + + -- Guus Sliepen Fri, 22 Jul 2005 13:42:47 +0200 + +matrem (1.0-7) unstable; urgency=low + + * #include . Closes: #264075, #265527 + * Bump standards version. + + -- Guus Sliepen Wed, 18 Aug 2004 14:17:38 +0200 + +matrem (1.0-6) unstable; urgency=low + + * Fix g++ 3.2 errors. Closes: #192194 + * Update standards version. + * Fix menu colors when changing resolution. Closes: #171590 + + -- Guus Sliepen Wed, 7 May 2003 10:23:57 +0200 + +matrem (1.0-5) unstable; urgency=low + + * Compile against liballegro 4.0.0. Closes: #134359 + + -- Guus Sliepen Mon, 18 Feb 2002 13:09:21 +0100 + +matrem (1.0-4) unstable; urgency=low + + * Spelling fixes for description. Closes: #125119 + + -- Guus Sliepen Tue, 18 Dec 2001 00:21:54 +0100 + +matrem (1.0-3) unstable; urgency=low + + * Added entry for Debian's menu system. + + -- Guus Sliepen Wed, 12 Dec 2001 23:08:41 +0100 + +matrem (1.0-2) unstable; urgency=low + + * Fixed g++-3.0 errors. Closes: #123110 + + -- Guus Sliepen Mon, 10 Dec 2001 13:43:35 +0100 + +matrem (1.0-1) unstable; urgency=low + + * Initial Release. Closes: #113965 + + -- Guus Sliepen Wed, 28 Nov 2001 23:07:42 +0100 --- matrem-1.0.orig/debian/rules +++ matrem-1.0/debian/rules @@ -0,0 +1,83 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/matrem.sgml > matrem.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + rm -f allegro.h + + # Add here commands to clean up after the build process. + $(MAKE) realclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/matrem. + cp matrem $(CURDIR)/debian/matrem/usr/games/ + cp *.bmp $(CURDIR)/debian/matrem/usr/share/games/matrem/ + cp debian/matrem.6 $(CURDIR)/debian/matrem/usr/share/man/man6/ + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit + dh_installcron + dh_installman + dh_installinfo +# dh_undocumented + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- matrem-1.0.orig/debian/docs +++ matrem-1.0/debian/docs @@ -0,0 +1 @@ +readme.txt --- matrem-1.0.orig/debian/matrem.6 +++ matrem-1.0/debian/matrem.6 @@ -0,0 +1,41 @@ +.Dd 2001-09-30 +.Dt MATREM 6 +.Os "Debian GNU/Linux" +.\" Manual page created by Guus Sliepen +.Sh NAME +.Nm matrem +.Nd An experiment in Artificial life. +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +.Nm +is a computer program that simulates life. +It belongs to the emerging science of artificial life, +which studies evolution and complex systems in general by simulation. +.Nm +is also a game, where players compete to create the fittest lifeform. +Their efforts are the driving force behind the program. +.Pp +When you start +.Nm +you will be presented with a close-up of the world map. +You can see the creatures moving around and the environment changing as time passes. +Use the right mouse button to access the menu. +.Sh FILES +.Bl -tag -width indent +.It Pa /usr/share/games/matrem/ +Location of item and map graphics. +You can edit the map file in a graphical editor to change the initial layout of the simulated world. +.El +.Sh SEE ALSO +.Pa http://www.phys.uu.nl/~romans/ +.Sh BUGS +When changing the resolution the menu bar may become invisible. +.Sh AUTHOR +.Nm +has been written by +.An Mathijs Romans Aq m.w.j.romans@phys.uu.nl . +.Pp +This manual page was written by +.An Guus Sliepen Aq guus@sliepen.warande.net +for the Debian GNU/Linux system. --- matrem-1.0.orig/debian/menu +++ matrem-1.0/debian/menu @@ -0,0 +1,3 @@ +?package(matrem):command="/usr/games/matrem" \ + needs="x11" section="Games/Simulation" \ + title="Matrem" --- matrem-1.0.orig/debian/dirs +++ matrem-1.0/debian/dirs @@ -0,0 +1,3 @@ +usr/games +usr/share/games/matrem +usr/share/man/man6 --- matrem-1.0.orig/debian/copyright +++ matrem-1.0/debian/copyright @@ -0,0 +1,25 @@ +This package was debianized by Guus Sliepen on +Sun, 30 Sep 2001 14:30:53 +0200. + +It was downloaded from http://www.phys.uu.nl/~romans/ + +Upstream Author: Mathijs Romans + +Copyright: 1999 Mathijs Romans + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +On Debian GNU/Linux systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL. --- matrem-1.0.orig/debian/control +++ matrem-1.0/debian/control @@ -0,0 +1,19 @@ +Source: matrem +Section: games +Priority: optional +Maintainer: Guus Sliepen +Build-Depends: debhelper (>> 4.0.0), liballegro4.2-dev +Standards-Version: 3.7.2 + +Package: matrem +Architecture: any +Depends: ${shlibs:Depends} +Description: An experiment in Artificial life + Matrem is a computer program that simulates life. It belongs to the emerging + science of "artificial life", which studies evolution and complex systems in + general by simulation. Matrem is also a game, where players compete to create + the fittest life form. Their efforts are the driving force behind the program. + . + This package provides a binary generated from the original sources. You can + study the evolution of the default world and species. If you wish to add your + own species you will need to download and modify the source code. --- matrem-1.0.orig/debian/compat +++ matrem-1.0/debian/compat @@ -0,0 +1 @@ +4 --- matrem-1.0.orig/lion.cpp +++ matrem-1.0/lion.cpp @@ -1,6 +1,6 @@ #include "lion.h" -lion::lion(lion *parent=NULL) : creature(parent) +lion::lion(lion *parent) : creature(parent) { species=LION; hitpoints=410; --- matrem-1.0.orig/yourcreature.h +++ matrem-1.0/yourcreature.h @@ -6,7 +6,7 @@ yourcreature(yourcreature *parent=NULL); creature* newcreature() {return new yourcreature(this);} void choosejob(); - char *name() {return "Yourcreature";} + const char *name() {return "Yourcreature";} int init_n_of() {return 1;} char shortkey() {return 'y';} }; --- matrem-1.0.orig/matrem10.cpp +++ matrem-1.0/matrem10.cpp @@ -349,7 +349,7 @@ #include #include #include -#include "allegro.h" +#include #include "config.h" #include "graphics.h" #include "creature.h" @@ -359,7 +359,9 @@ #include "fish.h" #include "yourcreature.h" -void error(char* code,int var1=0,int var2=0, int var3=0, int var4=0) +using namespace std; + +void error(const char* code,int var1,int var2, int var3, int var4) { allegro_exit(); cout << "\nDamn! An error has occurred: \n"; @@ -447,11 +449,11 @@ { int x,y,xn,yn; creature* othercr; - x=cr->xcoor;y=cr->ycoor; - if (cr->dir==NORTH) {xn=x;yn=y-1;} - else if (cr->dir==SOUTH) {xn=x;yn=y+1;} - else if (cr->dir==EAST) {xn=x+1;yn=y;} - else if (cr->dir==WEST) {xn=x-1;yn=y;} + xn=x=cr->xcoor;yn=y=cr->ycoor; + if (cr->dir==NORTH) {yn--;} + else if (cr->dir==SOUTH) {yn++;} + else if (cr->dir==EAST) {xn++;} + else if (cr->dir==WEST) {xn--;} if (cr->job==RUN) { if ((cr->terrain&atterrain[p[xn][yn]])&&!r[xn][yn]) @@ -562,7 +564,7 @@ void evolveland() { - int land,x,y,k; + int land,x,y; for (land=0;land<400;land++) { x=random(MAPWIDTH-2)+1; @@ -642,7 +644,7 @@ int main(int argc, char* argv[]) { - int species,y; + int species; if (argc>1) seedrand=(int) strtol(argv[1],NULL,0); else --- matrem-1.0.orig/graphics.cpp +++ matrem-1.0/graphics.cpp @@ -1,8 +1,11 @@ +#include #include #include -#include "allegro.h" +#include #include "graphics.h" +using namespace std; + #define INFOWIDTH 64 #define SMPICSZ 16 #define LGPICSZ 32 @@ -276,10 +279,10 @@ return(D_CLOSE); } -char *creature_list(int index, int *list_size) +const char *creature_list(int index, int *list_size) { char s1[50]; - int i, totpop; + unsigned int i, totpop; for (i=0;idrawinfo(cr_info,draw_again); else { rectfill(screen,4,338,INFOWIDTH-2,346,0); - textprintf(screen,font,4,338,5,"%i",turn); + textprintf_ex(screen,font,4,338,5,0,"%i",(int)turn); rectfill(screen,4,358,INFOWIDTH-2,366,0); - textprintf(screen,font,4,358,5,"%i",sumalive); + textprintf_ex(screen,font,4,358,5,0,"%i",sumalive); rectfill(screen,4,378,INFOWIDTH-2,386,0); - textprintf(screen,font,4,378,5,"%i",sumdead); + textprintf_ex(screen,font,4,378,5,0,"%i",sumdead); } if (turns_per_sec_display!=turns_per_sec) { rectfill(screen,4,471,INFOWIDTH-25,478,0); - textprintf(screen,font,4,471,5,"%i",turns_per_sec); + textprintf_ex(screen,font,4,471,5,0,"%i",turns_per_sec); turns_per_sec_display=turns_per_sec; } } @@ -432,7 +434,6 @@ { int s; - text_mode(0); rectfill(screen,0,0,INFOWIDTH-1,SCREEN_H-1,0); rect(screen,0,14,INFOWIDTH-1,325,30); rect(screen,0,325,INFOWIDTH-1,470,30); @@ -445,11 +446,11 @@ } turns_per_sec_display=-1; if (!followcr) { - textout(screen,font,"T:",20,330,5); - textout(screen,font,"Alive:",10,350,5); - textout(screen,font,"Dead:",10,370,5); + textout_ex(screen,font,"T:",20,330,5,0); + textout_ex(screen,font,"Alive:",10,350,5,0); + textout_ex(screen,font,"Dead:",10,370,5,0); } - textout(screen,font,"t/s",INFOWIDTH-25,471,5); + textout_ex(screen,font,"t/s",INFOWIDTH-25,471,5,0); update_left_side(); } @@ -557,8 +558,8 @@ if (w==SCREEN_W) return D_O_K; destroy_bitmap(cr_info); destroy_bitmap(used_screen); - if (set_gfx_mode(GFX_AUTODETECT,w,h,0,0)) { - set_gfx_mode(GFX_AUTODETECT,640,480,0,0); + if (set_gfx_mode(GFX_AUTODETECT_WINDOWED,w,h,0,0)) { + set_gfx_mode(GFX_AUTODETECT_WINDOWED,640,480,0,0); set_palette(my_palette); alert("I tried, and tried", "but your computer is too stupid", "to get this kind of civilized resolution", "How embarassing!", NULL, 'h',0); @@ -571,6 +572,8 @@ used_screen=create_sub_bitmap(screen,0,0,SCREEN_W,SCREEN_H); nofpicx=((used_screen->w+picsz-1)/picsz+1)/2; nofpicy=((used_screen->h+picsz-1)/picsz+1)/2; + gui_fg_color=20; + gui_bg_color=1; return D_CLOSE; } @@ -579,16 +582,16 @@ BITMAP *bmp; int x,y; one_pic=create_bitmap(SMPICSZ,SMPICSZ); - if (!(logo=load_bmp("logo.bmp", my_palette))) + if (!(logo=load_bmp("/usr/share/games/matrem/logo.bmp", my_palette))) error ("couldn't find the file 'logo.bmp'"); - if (!(bmp=load_bmp("map.bmp", my_palette))) + if (!(bmp=load_bmp("/usr/share/games/matrem/map.bmp", my_palette))) error ("couldn't find the file 'map.bmp'"); for (y=0;yh;y++) for (x=0;xw;x++) p[x][y]=bmp->line[y][x]; destroy_bitmap(bmp); - if (!(bmp=load_bmp("crpic.bmp", my_palette))) + if (!(bmp=load_bmp("/usr/share/games/matrem/crpic.bmp", my_palette))) error ("couldn't find the file 'crpic.bmp'"); for (x=0;xw-1,23,0); - textprintf(cr_info,font,5,15,5,"%i",(int) food); + textprintf_ex(cr_info,font,5,15,5,0,"%i",(int) food); rectfill(cr_info,5,45,cr_info->w-1,53,0); - textprintf(cr_info,font,5,45,5,"%i",life); + textprintf_ex(cr_info,font,5,45,5,0,"%i",life); rectfill(cr_info,5,75,cr_info->w-1,83,0); - textprintf(cr_info,font,5,75,5,"%i",weight); + textprintf_ex(cr_info,font,5,75,5,0,"%i",weight); } --- matrem-1.0.orig/Makefile +++ matrem-1.0/Makefile @@ -7,58 +7,30 @@ CC=g++ SED=sed -ARCH=i586 allegrodir=/usr/local/lib/ -CFLAGS= -DPROG=\"$(PROG)\" -DVERSION=\"$(VERSION)\" -fomit-frame-pointer -O4 \ - -ffast-math +CFLAGS= -DPROG=\"$(PROG)\" -DVERSION=\"$(VERSION)\" -O2 -pipe -Wall LDFLAGS= -lm `allegro-config --libs` -allegrofiles = $(allegrodir)liballeg.a +allegrofiles = OBJ = matrem10.o graphics.o creature.o config.o milkacow.o lion.o jerremiah.o fish.o yourcreature.o -SRC= $(OBJ:.o=.cpp) -HDR = allegro.h config.h creature.h graphics.h milkacow.h lion.h jerremiah.h fish.h yourcreature.h +HDR = config.h creature.h graphics.h milkacow.h lion.h jerremiah.h fish.h yourcreature.h all: banner $(PROG) -matrem21.o: $(SRC) - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -graphics.o: graphics.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -creature.o: creature.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -config.o: config.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -milkacow.o: milkacow.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -lion.o: lion.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -jerremiah.o: jerremiah.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -fish.o: fish.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - -yourcreature.o: yourcreature.cpp - $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(@:.o=.cpp) -o $@ - +.cpp.o: + $(CC) -c -I. -I$(srcdir) $(CFLAGS) $< -o $@ banner: @echo "****************" - @echo "Making $(PROG) $(VERSION) for $(ARCH)" + @echo "Making $(PROG) $(VERSION)" @echo "****************" $(PROG): $(OBJ) $(HDR) - $(CC) -o $(PROG) $(OBJ) $(allegrofiles) $(LDFLAGS) `allegro-config --libs` - strip $(PROG) + $(CC) -o $(PROG) $(OBJ) $(allegrofiles) $(LDFLAGS) + #strip $(PROG) run: $(PROG) ./matrem --- matrem-1.0.orig/config.h +++ matrem-1.0/config.h @@ -66,6 +66,6 @@ extern int pop[POPMEM][N_OF_SPECIES]; extern int seedrand; -void error(char* code,int var1=0,int var2=0, int var3=0, int var4=0); +void error(const char* code,int var1=0,int var2=0, int var3=0, int var4=0); void itostr(int n, char*s); #endif --- matrem-1.0.orig/creature.h +++ matrem-1.0/creature.h @@ -1,6 +1,6 @@ #ifndef CREATURE_H #define CREATURE_H -#include "allegro.h" +#include #include "config.h" class linkedlist @@ -51,7 +51,7 @@ virtual creature* previous() {return (creature*) previousn;} void preparecreature(creature* parent); - virtual char* name(); + virtual const char* name(); virtual int color() {return ((species+1)*16)%256+(species+1)/16;} virtual int lookslike(); virtual void drawinfo(BITMAP *cr_info, bool firsttime); --- matrem-1.0.orig/jerremiah.h +++ matrem-1.0/jerremiah.h @@ -6,7 +6,7 @@ jerremiah(jerremiah *parent=NULL); creature* newcreature() {return new jerremiah(this);} void choosejob(); - char *name() {return "Jerremiah";} + const char *name() {return "Jerremiah";} char shortkey() {return 'j';} };