Browse Source

- fixed #1128 #1127 #1121 #1119
- instructions in linux readme use cmake instead of autotools
- update autoconf files

Ivan Savenko 13 years ago
parent
commit
3542bfdc63

+ 14 - 27
README.linux

@@ -3,7 +3,7 @@ This readme covers VCMI compilation on Unix-like systems.
 To run the game you will need:
 1) Heroes 3 data files (SoD or Complete editions);
 2) Unofficial WoG addon
-2) VCMI data pack (http://download.vcmi.eu/vcmi-data_0.89.tar.gz)
+2) VCMI data pack (http://download.vcmi.eu/core.zip)
 
 For complete installation instructions see VCMI wiki:
 http://wiki.vcmi.eu/index.php?title=Installation_on_Linux#Preparing_data
@@ -11,7 +11,8 @@ http://wiki.vcmi.eu/index.php?title=Installation_on_Linux#Preparing_data
 I. Prerequisites
 
 To compile, at least the following packages (and their development counterparts) are needed to build:
-    * libstdc++ devel
+	* libstdc++ devel
+	* CMake build system
 	* SDL and SDL-devel
 	* SDL_mixer and SDL_mixer-devel
 	* SDL_image and SDL_image-devel
@@ -25,17 +26,10 @@ To compile, at least the following packages (and their development counterparts)
 		- thread
 
 On Debian-based systems (e.g. Ubuntu) run:
-  sudo apt-get install g++ libsdl1.2debian libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev
+  sudo apt-get install cmake g++ libsdl1.2debian libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev
 
 On RPM-based distributions (e.g. Fedora) run:
-  sudo yum install gcc-c++ SDL-devel SDL_image-devel SDL_ttf-devel SDL_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options zlib-devel ffmpeg-devel ffmpeg-libs
-
-Optionaly, if you want to regenerate the build system, you will need the following tools:
- * libtool
- * automake
- * autoconf
-And then regenerate the build system with
-  autoreconf -i
+  sudo yum install cmake gcc-c++ SDL-devel SDL_image-devel SDL_ttf-devel SDL_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options zlib-devel ffmpeg-devel ffmpeg-libs
 
 II. Getting the sources
 
@@ -59,24 +53,17 @@ There is a mantis call here: http://bugs.vcmi.eu/view.php?id=933.
 
 Run configure:
   cd trunk/build
-  ../src/configure
-
-Alternatively it is possible to install VCMI to non-default directory (e.g. /opt/games or /home/user/vcmi).
-To do this run:
-  ../src/configure --datadir=/DATA_PATH/ --bindir=/BIN_PATH/vcmi --libdir=/LIB_PATH/
-An example would be:
-  ../src/configure --datadir=/usr/local/share --bindir=/usr/local --libdir=/usr/local/lib64
+  cmake ../src
 
 Notice:
 The ../src/ is not a typo, it will place makefile scripts into the build dir 
-as the build dir is your working dir when calling the configure script.
+as the build dir is your working dir when calling CMake.
 
 Then build vcmi:
   make
 
 That will generate vcmiclient, vcmiserver as well as 3 .so libraries.
 
-
 III. Installing binaries
 
 Since VCMI is still in development, there's no install procedure, although this will work:
@@ -89,18 +76,18 @@ For more permament solution you should use links as described below.
 For development puposes, it's better to use links. Go
 to /BIN_PATH/, and type:
 
-  ln -s /PATH_TO_SOURCE/client/.libs/vcmiclient
-  ln -s /PATH_TO_SOURCE/server/.libs/vcmiserver
+  ln -s .../trunk/build/client/vcmiclient
+  ln -s .../trunk/build/server/vcmiserver
   
 Go to /LIB_PATH/vcmi, and type:
 
-  ln -s /PATH_TO_SOURCE/lib/.libs/libvcmi.so libvcmi.so.0
+  ln -s .../trunk/build/lib/libvcmi.so libvcmi.so
   
 Go to /LIB_PATH/vcmi/AI, and type: 
-  ln -s /PATH_TO_SOURCE/AI/VCAI/.libs/VCAI.so
-  ln -s /PATH_TO_SOURCE/AI/StupidAI/.libs/StupidAI.so
-  ln -s /PATH_TO_SOURCE/AI/BattleAI/.libs/BattleAI.so
+  ln -s .../trunk/build/AI/VCAI/VCAI.so
+  ln -s .../trunk/build/AI/StupidAI/StupidAI.so
+  ln -s .../trunk/build/AI/BattleAI/BattleAI.so
 
 Go to /DATA_PATH/vcmi, and type:
-  ln -s /PATH_TO_SOURCE/config
+  ln -s .../trunk/source/config
 

+ 2 - 1
client/CCastleInterface.cpp

@@ -711,7 +711,7 @@ void CCastleBuildings::enterBlacksmith(int ArtifactID)
 		return;
 	}
 	int price = CGI->arth->artifacts[ArtifactID]->price;
-	bool possible = LOCPLINT->cb->getResourceAmount(Res::GOLD) >= price && !hero->hasArt(ArtifactID+9);
+	bool possible = LOCPLINT->cb->getResourceAmount(Res::GOLD) >= price && !hero->hasArt(ArtifactID);
 	GH.pushInt(new CBlacksmithDialog(possible,CArtHandler::convertMachineID(ArtifactID,false),ArtifactID,hero->id));
 }
 
@@ -1394,6 +1394,7 @@ CFortScreen::CFortScreen(const CGTownInstance * town):
 	
 	std::string text = boost::str(boost::format(CGI->generaltexth->fcommands[6]) % fortBuilding->Name());
 	exit = new CAdventureMapButton(text, "", boost::bind(&CFortScreen::close,this) ,748, 556, "TPMAGE1", SDLK_RETURN);
+	exit->assignedKeys.insert(SDLK_ESCAPE);
 
 	std::vector<Point> positions;
 	positions += Point(10,  22), Point(404, 22),

+ 29 - 45
client/Makefile.in

@@ -37,8 +37,7 @@ build_triplet = @build@
 host_triplet = @host@
 bin_PROGRAMS = vcmiclient$(EXEEXT)
 subdir = client
-DIST_COMMON = $(dist_icon_DATA) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/aclocal/m4/ax_boost_base.m4 \
 	$(top_srcdir)/aclocal/m4/ax_boost_filesystem.m4 \
@@ -58,8 +57,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(install_sh) -d
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(desktopdir)" \
-	"$(DESTDIR)$(icondir)"
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(desktopdir)"
 PROGRAMS = $(bin_PROGRAMS)
 am_vcmiclient_OBJECTS = vcmiclient-CCallback.$(OBJEXT) \
 	vcmiclient-CBattleAnimations.$(OBJEXT) \
@@ -171,7 +169,7 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-DATA = $(desktop_DATA) $(dist_icon_DATA)
+DATA = $(desktop_DATA)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -311,10 +309,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 desktopdir = $(datadir)/applications
 desktop_DATA = vcmiclient.desktop
-icondir = $(datadir)/icons
-dist_icon_DATA = vcmiclient.png
 EXTRA_DIST = \
-  $(pixmaps_extra_DATA) \
   ${desktop_DATA}
 
 BUILT_SOURCES = StdInc.h.gch
@@ -1037,24 +1032,6 @@ uninstall-desktopDATA:
 	@list='$(desktop_DATA)'; test -n "$(desktopdir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
 	dir='$(DESTDIR)$(desktopdir)'; $(am__uninstall_files_from_dir)
-install-dist_iconDATA: $(dist_icon_DATA)
-	@$(NORMAL_INSTALL)
-	test -z "$(icondir)" || $(MKDIR_P) "$(DESTDIR)$(icondir)"
-	@list='$(dist_icon_DATA)'; test -n "$(icondir)" || list=; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \
-	done
-
-uninstall-dist_iconDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(dist_icon_DATA)'; test -n "$(icondir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(icondir)'; $(am__uninstall_files_from_dir)
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -1138,12 +1115,15 @@ distdir: $(DISTFILES)
 	    || exit 1; \
 	  fi; \
 	done
+	$(MAKE) $(AM_MAKEFLAGS) \
+	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
+	  dist-hook
 check-am: all-am
 check: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(PROGRAMS) $(DATA)
 installdirs:
-	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(icondir)"; do \
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(desktopdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: $(BUILT_SOURCES)
@@ -1200,7 +1180,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-desktopDATA install-dist_iconDATA
+install-data-am: install-desktopDATA
 
 install-dvi: install-dvi-am
 
@@ -1246,27 +1226,31 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS uninstall-desktopDATA \
-	uninstall-dist_iconDATA
+uninstall-am: uninstall-binPROGRAMS uninstall-desktopDATA
 
 .MAKE: all check install install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-libtool ctags distclean distclean-compile \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-binPROGRAMS install-data install-data-am \
-	install-desktopDATA install-dist_iconDATA install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-binPROGRAMS uninstall-desktopDATA \
-	uninstall-dist_iconDATA
-
+	clean-generic clean-libtool ctags dist-hook distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-binPROGRAMS install-data \
+	install-data-am install-desktopDATA install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS \
+	uninstall-desktopDATA
+
+
+dist-hook:
+	install -m 644 "$(srcdir)/icons/vcmiclient.xpm" "$(distdir)/pixmaps/vcmiclient.xpm"
+	install -m 644 "$(srcdir)/icons/vcmiclient.64x64.png" "$(distdir)/icons/hicolor/64x64/apps/vcmiclient.png"
+	install -m 644 "$(srcdir)/icons/vcmiclient.48x48.png" "$(distdir)/icons/hicolor/48x48/apps/vcmiclient.png"
+	install -m 644 "$(srcdir)/icons/vcmiclient.32x32.png" "$(distdir)/icons/hicolor/32x32/apps/vcmiclient.png"
 StdInc.h.gch: StdInc.h
 	$(CXXCOMPILE) -c $<
 

+ 27 - 8
client/UIFramework/CIntObjectClasses.cpp

@@ -1265,6 +1265,31 @@ void CBoundedLabel::setTxt(const std::string &Txt)
 	CLabel::setTxt(Txt);
 }
 
+void CBoundedLabel::blitLine(SDL_Surface *to, Point where, std::string what)
+{
+	const Font &f = *graphics->fonts[font];
+
+	size_t begin = 0;
+	size_t end;
+	std::string delimeters = "{}";
+	size_t currDelimeter = 0;
+
+	do
+	{
+		end = what.find_first_of(delimeters[currDelimeter % 2], begin);
+		std::string toPrint = what.substr(begin, end);
+		if (currDelimeter % 2)
+			CSDL_Ext::printAt(toPrint, where.x, where.y, font, Colors::Jasmine, to);
+		else
+			CSDL_Ext::printAt(toPrint, where.x, where.y, font, color, to);
+		begin = end;
+		where.x += f.getWidth(toPrint.c_str());
+
+		currDelimeter++;
+	}
+	while (begin++ != std::string::npos);
+}
+
 void CBoundedLabel::showAll(SDL_Surface * to)
 {
 	CIntObject::showAll(to);
@@ -1290,10 +1315,7 @@ void CBoundedLabel::showAll(SDL_Surface * to)
 			x += (pos.w - f.getWidth(line.c_str())) / 2;
 		}
 
-		if(line[0] == '{' && line[line.size()-1] == '}')
-			CSDL_Ext::printAt(line, x, base_y + i*dy, font, Colors::Jasmine, to);
-		else
-			CSDL_Ext::printAt(line, x, base_y + i*dy, font, color, to);
+		blitLine(to, Point(x, base_y + i * dy), line);
 	}
 }
 
@@ -1386,10 +1408,7 @@ void CTextBox::showAll(SDL_Surface * to)
 				x -= slider->pos.w / 2 + 5;
 		}
 
-		if(line[0] == '{' && line[line.size()-1] == '}')
-			CSDL_Ext::printAt(line, x, base_y + i*dy, font, Colors::Jasmine, to);
-		else
-			CSDL_Ext::printAt(line, x, base_y + i*dy, font, color, to);
+		blitLine(to, Point(x, base_y + i * dy), line);
 	}
 
 }

+ 2 - 0
client/UIFramework/CIntObjectClasses.h

@@ -352,6 +352,8 @@ public:
 
 class CBoundedLabel : public CLabel
 {
+protected:
+	void blitLine(SDL_Surface * to, Point where, std::string what);
 public:
 
 	int maxW; //longest line of text in px

+ 1 - 1
config/defaultSettings.json

@@ -10,7 +10,7 @@
 			},
 			"playerName" : {
 				"type":"string",
-				"default" : "player"
+				"default" : "Player"
 			},
 			"showfps" : {
 				"type" : "bool",

+ 10 - 10
configure

@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for vcmi 0.89.
+# Generated by GNU Autoconf 2.68 for vcmi 0.90.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -567,8 +567,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='vcmi'
 PACKAGE_TARNAME='vcmi'
-PACKAGE_VERSION='0.89'
-PACKAGE_STRING='vcmi 0.89'
+PACKAGE_VERSION='0.90'
+PACKAGE_STRING='vcmi 0.90'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures vcmi 0.89 to adapt to many kinds of systems.
+\`configure' configures vcmi 0.90 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1395,7 +1395,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of vcmi 0.89:";;
+     short | recursive ) echo "Configuration of vcmi 0.90:";;
    esac
   cat <<\_ACEOF
 
@@ -1536,7 +1536,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-vcmi configure 0.89
+vcmi configure 0.90
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2131,7 +2131,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by vcmi $as_me 0.89, which was
+It was created by vcmi $as_me 0.90, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -2946,7 +2946,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='vcmi'
- VERSION='0.89'
+ VERSION='0.90'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -18111,7 +18111,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by vcmi $as_me 0.89, which was
+This file was extended by vcmi $as_me 0.90, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18168,7 +18168,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-vcmi config.status 0.89
+vcmi config.status 0.90
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+vcmi (0.90) unstable; urgency=low
+
+  * New upstream release
+  * Removed boost iostream dependency
+
+ -- Ivan Savenko <[email protected]>  Mon, 1 Oct 2012 15:20:30 +0200
+
 vcmi (0.89) unstable; urgency=low
 
   * New upstream release

+ 1 - 1
server/CGameHandler.cpp

@@ -2472,7 +2472,7 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid, bool force /*=false*/ )
 		ssi.creatures[level].second.push_back(crea->idNumber);
 		sendAndApply(&ssi);
 	}
-	else if ( t->subID == ETownType::DUNGEON && bid == EBuilding::MANA_VORTEX )
+	else if ( t->subID == ETownType::DUNGEON && bid == EBuilding::PORTAL_OF_SUMMON )
 	{
 		setPortalDwelling(t);
 	}