diff --git a/AI/Makefile.am b/AI/Makefile.am index 67eed6063..b51704ec5 100644 --- a/AI/Makefile.am +++ b/AI/Makefile.am @@ -1 +1 @@ -SUBDIRS = StupidAI EmptyAI GeniusAI +SUBDIRS = StupidAI EmptyAI VCAI diff --git a/AI/Makefile.in b/AI/Makefile.in index 81c3a8f60..c4440c112 100644 --- a/AI/Makefile.in +++ b/AI/Makefile.in @@ -237,7 +237,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = StupidAI EmptyAI GeniusAI +SUBDIRS = StupidAI EmptyAI VCAI all: all-recursive .SUFFIXES: diff --git a/AI/VCAI/Makefile.am b/AI/VCAI/Makefile.am new file mode 100644 index 000000000..14d5ee159 --- /dev/null +++ b/AI/VCAI/Makefile.am @@ -0,0 +1,13 @@ +vcmiaidir = $(VCMI_AI_LIBS_DIR) +BUILT_SOURCES = StdInc.h.gch +StdInc.h.gch: StdInc.h + $(CXXCOMPILE) -DVCMI_DLL -fPIC -c $< + +vcmiai_LTLIBRARIES = libVCAI.la +libVCAI_la_LIBADD = $(top_builddir)/lib/libvcmi.la +libVCAI_la_CXXFLAGS = -DVCMI_DLL +libVCAI_la_LDFLAGS = -L$(top_builddir)/lib -module -avoid-version +libVCAI_la_SOURCES = \ + main.cpp \ + VCAI.cpp \ + VCAI.h diff --git a/AI/VCAI/Makefile.in b/AI/VCAI/Makefile.in new file mode 100644 index 000000000..f81b5af78 --- /dev/null +++ b/AI/VCAI/Makefile.in @@ -0,0 +1,615 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = AI/VCAI +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 \ + $(top_srcdir)/aclocal/m4/ax_boost_iostreams.m4 \ + $(top_srcdir)/aclocal/m4/ax_boost_program_options.m4 \ + $(top_srcdir)/aclocal/m4/ax_boost_system.m4 \ + $(top_srcdir)/aclocal/m4/ax_boost_thread.m4 \ + $(top_srcdir)/aclocal/m4/ax_compiler_vendor.m4 \ + $(top_srcdir)/aclocal/m4/libtool.m4 \ + $(top_srcdir)/aclocal/m4/ltoptions.m4 \ + $(top_srcdir)/aclocal/m4/ltsugar.m4 \ + $(top_srcdir)/aclocal/m4/ltversion.m4 \ + $(top_srcdir)/aclocal/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(vcmiaidir)" +LTLIBRARIES = $(vcmiai_LTLIBRARIES) +libVCAI_la_DEPENDENCIES = $(top_builddir)/lib/libvcmi.la +am_libVCAI_la_OBJECTS = libVCAI_la-main.lo libVCAI_la-VCAI.lo +libVCAI_la_OBJECTS = $(am_libVCAI_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +libVCAI_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(libVCAI_la_CXXFLAGS) \ + $(CXXFLAGS) $(libVCAI_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_$(V)) +am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY)) +am__v_CXX_0 = @echo " CXX " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_$(V)) +am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CXXLD_0 = @echo " CXXLD " $@; +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libVCAI_la_SOURCES) +DIST_SOURCES = $(libVCAI_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ +BOOST_FILESYSTEM_LIB = @BOOST_FILESYSTEM_LIB@ +BOOST_IOSTREAMS_LIB = @BOOST_IOSTREAMS_LIB@ +BOOST_LDFLAGS = @BOOST_LDFLAGS@ +BOOST_PROGRAM_OPTIONS_LIB = @BOOST_PROGRAM_OPTIONS_LIB@ +BOOST_SYSTEM_LIB = @BOOST_SYSTEM_LIB@ +BOOST_THREAD_LIB = @BOOST_THREAD_LIB@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FFMPEG_CXXFLAGS = @FFMPEG_CXXFLAGS@ +FFMPEG_LIBS = @FFMPEG_LIBS@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_CXXFLAGS = @SDL_CXXFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VCMI_AI_LIBS_DIR = @VCMI_AI_LIBS_DIR@ +VCMI_SCRIPTING_LIBS_DIR = @VCMI_SCRIPTING_LIBS_DIR@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +vcmiaidir = $(VCMI_AI_LIBS_DIR) +BUILT_SOURCES = StdInc.h.gch +vcmiai_LTLIBRARIES = libVCAI.la +libVCAI_la_LIBADD = $(top_builddir)/lib/libvcmi.la +libVCAI_la_CXXFLAGS = -DVCMI_DLL +libVCAI_la_LDFLAGS = -L$(top_builddir)/lib -module -avoid-version +libVCAI_la_SOURCES = \ + main.cpp \ + VCAI.cpp \ + VCAI.h + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu AI/VCAI/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu AI/VCAI/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-vcmiaiLTLIBRARIES: $(vcmiai_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(vcmiaidir)" || $(MKDIR_P) "$(DESTDIR)$(vcmiaidir)" + @list='$(vcmiai_LTLIBRARIES)'; test -n "$(vcmiaidir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(vcmiaidir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(vcmiaidir)"; \ + } + +uninstall-vcmiaiLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(vcmiai_LTLIBRARIES)'; test -n "$(vcmiaidir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(vcmiaidir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(vcmiaidir)/$$f"; \ + done + +clean-vcmiaiLTLIBRARIES: + -test -z "$(vcmiai_LTLIBRARIES)" || rm -f $(vcmiai_LTLIBRARIES) + @list='$(vcmiai_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libVCAI.la: $(libVCAI_la_OBJECTS) $(libVCAI_la_DEPENDENCIES) + $(AM_V_CXXLD)$(libVCAI_la_LINK) -rpath $(vcmiaidir) $(libVCAI_la_OBJECTS) $(libVCAI_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libVCAI_la-VCAI.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libVCAI_la-main.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libVCAI_la-main.lo: main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libVCAI_la_CXXFLAGS) $(CXXFLAGS) -MT libVCAI_la-main.lo -MD -MP -MF $(DEPDIR)/libVCAI_la-main.Tpo -c -o libVCAI_la-main.lo `test -f 'main.cpp' || echo '$(srcdir)/'`main.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libVCAI_la-main.Tpo $(DEPDIR)/libVCAI_la-main.Plo +@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='main.cpp' object='libVCAI_la-main.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libVCAI_la_CXXFLAGS) $(CXXFLAGS) -c -o libVCAI_la-main.lo `test -f 'main.cpp' || echo '$(srcdir)/'`main.cpp + +libVCAI_la-VCAI.lo: VCAI.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libVCAI_la_CXXFLAGS) $(CXXFLAGS) -MT libVCAI_la-VCAI.lo -MD -MP -MF $(DEPDIR)/libVCAI_la-VCAI.Tpo -c -o libVCAI_la-VCAI.lo `test -f 'VCAI.cpp' || echo '$(srcdir)/'`VCAI.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libVCAI_la-VCAI.Tpo $(DEPDIR)/libVCAI_la-VCAI.Plo +@am__fastdepCXX_FALSE@ $(AM_V_CXX) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='VCAI.cpp' object='libVCAI_la-VCAI.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libVCAI_la_CXXFLAGS) $(CXXFLAGS) -c -o libVCAI_la-VCAI.lo `test -f 'VCAI.cpp' || echo '$(srcdir)/'`VCAI.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(vcmiaidir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-vcmiaiLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-vcmiaiLTLIBRARIES + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-vcmiaiLTLIBRARIES + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-vcmiaiLTLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am 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 install-vcmiaiLTLIBRARIES 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-vcmiaiLTLIBRARIES + +StdInc.h.gch: StdInc.h + $(CXXCOMPILE) -DVCMI_DLL -fPIC -c $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 6c1d30cff..f4e16c933 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -91,17 +91,19 @@ struct AILogger struct Tab { - Tab() - { - logger.lvl++; - } - ~Tab() - { - logger.lvl--; - } + Tab(); + ~Tab(); }; } logger; +AILogger::Tab::Tab() +{ + logger.lvl++; +} +AILogger::Tab::~Tab() +{ + logger.lvl--; +} struct TimeCheck { @@ -134,7 +136,7 @@ void erase_if(Range &vec, Predicate pred) struct AtScopeExit { boost::function foo; - AtScopeExit(const boost::function &FOO) : foo(FOO) + AtScopeExit(const boost::function &FOO) : foo(FOO) {} ~AtScopeExit() { @@ -195,7 +197,7 @@ std::map helperObjInfo; template bool remove_if_present(Container &c, const Item &item) { - Container::iterator i = std::find(c.begin(), c.end(), item); + auto i = std::find(c.begin(), c.end(), item); if(i != c.end()) { c.erase(i); @@ -206,7 +208,7 @@ bool remove_if_present(Container &c, const Item &item) } template -void erase(Container &c, Pred &pred) +void erase(Container &c, Pred pred) { c.erase(boost::remove_if(c, pred), c.end()); } @@ -275,7 +277,7 @@ ui64 evaluateDanger(crint3 tile) if(t->visitable) objectDanger = evaluateDanger(t->visitableObjects.front()); - + int3 guardPos = cb->guardingCreaturePosition(tile); if(guardPos.x >= 0 && guardPos != tile) guardDanger = evaluateDanger(guardPos); @@ -366,11 +368,11 @@ void VCAI::heroMoved(const TryMoveHero & details) LOG_ENTRY; if(details.result == TryMoveHero::TELEPORTATION) { - const TerrainTile *t1 = cb->getTile(CGHeroInstance::convertPosition(details.start, false)), + const TerrainTile *t1 = cb->getTile(CGHeroInstance::convertPosition(details.start, false)), *t2 = cb->getTile(CGHeroInstance::convertPosition(details.end, false)); if(t1->visitable && t2->visitable) { - const CGObjectInstance *o1 = t1->visitableObjects.front(), + const CGObjectInstance *o1 = t1->visitableObjects.front(), *o2 = t2->visitableObjects.front(); if(o1->ID == Obj::SUBTERRANEAN_GATE && o2->ID == Obj::SUBTERRANEAN_GATE) @@ -379,7 +381,7 @@ void VCAI::heroMoved(const TryMoveHero & details) knownSubterraneanGates[o2] = o1; } } - + } } @@ -716,7 +718,7 @@ void VCAI::init(CCallback * CB) LOG_ENTRY; playerID = myCb->getMyColor(); myCb->waitTillRealize = true; - + retreiveVisitableObjs(visitableObjs); } @@ -877,12 +879,12 @@ void VCAI::recruitCreatures(const CGTownInstance * t) { for(int i = 0; i < t->creatures.size(); i++) { - if(!t->creatures[i].second.size()) + if(!t->creatures[i].second.size()) continue; int count = t->creatures[i].first; int creID = t->creatures[i].second.back(); - const CCreature *c = VLC->creh->creatures[creID]; +// const CCreature *c = VLC->creh->creatures[creID]; // if(containsSavedRes(c->cost)) // continue; @@ -897,7 +899,7 @@ void VCAI::recruitCreatures(const CGTownInstance * t) void VCAI::buildStructure(const CGTownInstance * t) { //TODO make *real* town development system - const int buildings[] = {5, 11, 14, 16, 0, 12, 7, 8, 9, 13, 30, 31, 32, 33, 34, 35, 36, 37, 38, + const int buildings[] = {5, 11, 14, 16, 0, 12, 7, 8, 9, 13, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 1, 2, 3, 4, 17, 18, 19, 21, 22, 23}; for(int i = 0; i < ARRAY_COUNT(buildings); i++) { @@ -906,7 +908,7 @@ void VCAI::buildStructure(const CGTownInstance * t) const CBuilding *b = VLC->buildh->buildings[t->subID][buildings[i]]; - int canBuild = cb->canBuildStructure(t, buildings[i]); + int canBuild = cb->canBuildStructure(t, buildings[i]); if(canBuild == EBuildingState::ALLOWED) { if(!containsSavedRes(b->resources)) @@ -946,7 +948,7 @@ bool isSafeToVisit(const CGHeroInstance *h, crint3 tile) else return false; } - + return true; //there's no danger } @@ -980,7 +982,7 @@ void VCAI::wander(const CGHeroInstance * h) while(1) { auto dests = getPossibleDestinations(h); - if(!dests.size()) + if(!dests.size()) { auto compareReinforcements = [h](const CGTownInstance *lhs, const CGTownInstance *rhs) -> bool { @@ -999,7 +1001,7 @@ void VCAI::wander(const CGHeroInstance * h) townsNotReachable.push_back(t); } } -// towns.erase(boost::remove_if(towns, [=](const CGTownInstance *t) -> bool +// towns.erase(boost::remove_if(towns, [=](const CGTownInstance *t) -> bool // { // return !!t->visitingHero || !isReachable(t) || !howManyReinforcementsCanGet(h,t) || vstd::contains(townVisitsThisWeek[h], t); // }),towns.end()); @@ -1114,9 +1116,13 @@ void VCAI::retreiveVisitableObjs(std::vector &out, boo for(int j = 0; j < cb->getMapSize().y; j++) for(int k = 0; k < cb->getMapSize().z; k++) if(const TerrainTile *t = cb->getTile(int3(i,j,k), false)) + { BOOST_FOREACH(const CGObjectInstance *obj, t->visitableObjects) + { if(includeOwned || obj->tempOwner != playerID) out.push_back(obj); + } + } } std::vector VCAI::getFlaggedObjects() const @@ -1195,7 +1201,11 @@ public: { } - const char *what() const OVERRIDE + virtual ~cannotFulfillGoalException() throw () + { + }; + + const char *what() const throw () OVERRIDE { return msg.c_str(); } @@ -1239,7 +1249,7 @@ bool VCAI::moveHeroToTile(int3 dst, const CGHeroInstance * h) // { // int3 afterEndPos = path.nodes[i-2].coord; // if(afterEndPos.z != endpos.z) -// +// // } //tlog0 << "Moving " << h->name << " from " << h->getPosition() << " to " << endpos << std::endl; cb->moveHero(h,CGHeroInstance::convertPosition(endpos, true)); @@ -1367,7 +1377,7 @@ void VCAI::tryRealize(CGoal g) } } break; - + case COLLECT_RES: if(const CGObjectInstance *obj = cb->getObj(g.objid, false)) { @@ -1425,7 +1435,7 @@ std::vector VCAI::getUnblockedHeroes() const std::vector ret = cb->getHeroesInfo(); BOOST_FOREACH(const CGHeroInstance *h, blockedHeroes) remove_if_present(ret, h); - + return ret; } @@ -1448,7 +1458,7 @@ void VCAI::endTurn() tlog1 << "Not having turn at the end of turn???\n"; } - do + do { cb->endTurn(); } while(status.haveTurn()); //for some reasons, our request may fail -> stop requesting end of turn only after we've received a confirmation that it's over @@ -1507,7 +1517,7 @@ void VCAI::performTypicalActions() buildArmyIn(t); if(!ai->primaryHero() || - t->getArmyStrength() > ai->primaryHero()->getArmyStrength() * 2 && !isAccessibleForHero(t->visitablePos(), ai->primaryHero())) + (t->getArmyStrength() > ai->primaryHero()->getArmyStrength() * 2 && !isAccessibleForHero(t->visitablePos(), ai->primaryHero()))) { recruitHero(t); buildArmyIn(t); @@ -1546,7 +1556,7 @@ int3 VCAI::explorationBestNeighbour(int3 hpos, int radius, const CGHeroInstance for(auto i = dstToRevealedTiles.begin(); i != dstToRevealedTiles.end(); i++) { const CGPathNode *pn = cb->getPathInfo(i->first); - const TerrainTile *t = cb->getTile(i->first); + //const TerrainTile *t = cb->getTile(i->first); if(best->second < i->second && i->second && pn->reachable() && pn->accessible == CGPathNode::ACCESSIBLE) best = i; } @@ -1754,7 +1764,7 @@ int3 whereToExplore(const CGHeroInstance *h) } catch(cannotFulfillGoalException &e) { - std::vector > tiles; //tiles[distance_to_fow], metryka taksówkowa + std::vector > tiles; //tiles[distance_to_fow], metryka taksówkowa try { return ai->explorationNewPoint(radius, h, tiles); @@ -1788,7 +1798,7 @@ TSubgoal CGoal::whatToDoToAchieve() { const CVictoryCondition &vc = cb->getMapHeader()->victoryCondition; EVictoryConditionType::EVictoryConditionType cond = vc.condition; - + if(!vc.appliesToAI) { //TODO deduce victory from human loss condition @@ -1819,11 +1829,11 @@ TSubgoal CGoal::whatToDoToAchieve() else { auto towns = cb->getTownsInfo(); - towns.erase(boost::remove_if(towns, - [](const CGTownInstance *t) -> bool + towns.erase(boost::remove_if(towns, + [](const CGTownInstance *t) -> bool { return vstd::contains(t->forbiddenBuildings, EBuilding::GRAIL); - }), + }), towns.end()); boost::sort(towns, isCloser); if(towns.size()) @@ -1850,7 +1860,7 @@ TSubgoal CGoal::whatToDoToAchieve() return CGoal(GET_OBJ).setobjid(vc.ID); case EVictoryConditionType::GATHERRESOURCE: return CGoal(COLLECT_RES).setresID(vc.ID).setvalue(vc.count); - //TODO mines? piles? marketplace? + //TODO mines? piles? marketplace? //save? break; case EVictoryConditionType::GATHERTROOP: @@ -1919,7 +1929,7 @@ TSubgoal CGoal::whatToDoToAchieve() if(tileToHit == tile) { - tlog1 << boost::format("Very strange, tile to hit is %s and tile is also %s, while hero %s is at %s\n") + tlog1 << boost::format("Very strange, tile to hit is %s and tile is also %s, while hero %s is at %s\n") % tileToHit % tile % h->name % h->visitablePos(); throw cannotFulfillGoalException("Retreiving first tile to hit failed (probably)!"); } @@ -1935,7 +1945,7 @@ TSubgoal CGoal::whatToDoToAchieve() { if(cb->getHeroesInfo().empty()) return CGoal(RECRUIT_HERO); - + auto hs = cb->getHeroesInfo(); assert(hs.size()); erase(hs, [](const CGHeroInstance *h) @@ -1973,7 +1983,7 @@ TSubgoal CGoal::whatToDoToAchieve() { if(!cb->isVisible(tile)) return CGoal(EXPLORE); - + if(hero && !ai->isAccessibleForHero(tile, hero)) hero = NULL; @@ -2019,12 +2029,12 @@ TSubgoal CGoal::whatToDoToAchieve() case BUILD_STRUCTURE: //TODO check res - //look for town + //look for town //prerequisites? I_AM_ELEMENTAR; case COLLECT_RES: { - + std::vector markets; std::vector visObjs; @@ -2035,7 +2045,7 @@ TSubgoal CGoal::whatToDoToAchieve() { if(obj->ID == GameConstants::TOWNI_TYPE && obj->tempOwner == ai->playerID && m->allowsTrade(EMarketMode::RESOURCE_RESOURCE)) markets.push_back(m); - else if(obj->ID == Obj::TRADING_POST) //TODO a moze po prostu test na pozwalanie handlu? + else if(obj->ID == Obj::TRADING_POST) //TODO a moze po prostu test na pozwalanie handlu? markets.push_back(m); } } @@ -2045,7 +2055,7 @@ TSubgoal CGoal::whatToDoToAchieve() return m1->getMarketEfficiency() < m2->getMarketEfficiency(); }); - markets.erase(boost::remove_if(markets, [](const IMarket *market) -> bool + markets.erase(boost::remove_if(markets, [](const IMarket *market) -> bool { return !(market->o->ID == GameConstants::TOWNI_TYPE && market->o->tempOwner == ai->playerID) && !ai->isAccessible(market->o->visitablePos()); @@ -2101,7 +2111,7 @@ TSubgoal CGoal::whatToDoToAchieve() ai->retreiveVisitableObjs(objs); erase_if(objs, [&](const CGObjectInstance *obj) { - return obj->ID != GameConstants::TOWNI_TYPE && obj->ID != GameConstants::HEROI_TYPE //not town/hero + return (obj->ID != GameConstants::TOWNI_TYPE && obj->ID != GameConstants::HEROI_TYPE) //not town/hero || cb->getPlayerRelations(ai->playerID, obj->tempOwner) != 0; //not enemy }); @@ -2158,7 +2168,7 @@ bool CGoal::invalid() const bool CGoal::isBlockedBorderGate(int3 tileToHit) { - return cb->getTile(tileToHit)->topVisitableID() == Obj::BORDER_GATE + return cb->getTile(tileToHit)->topVisitableID() == Obj::BORDER_GATE && cb->getPathInfo(tileToHit)->accessible != CGPathNode::ACCESSIBLE; } @@ -2168,7 +2178,7 @@ SectorMap::SectorMap() // sector.resize(sizes.x); // BOOST_FOREACH(auto &i, sector) // i.resize(sizes.y); -// +// // BOOST_FOREACH(auto &i, sector) // BOOST_FOREACH(auto &j, i) // j.resize(sizes.z, 0); @@ -2215,8 +2225,8 @@ void SectorMap::clear() bool canBeEmbarkmentPoint(const TerrainTile *t) { //tile must be free of with unoccupied boat - return !t->blocked - || t->visitableObjects.size() == 1 && t->topVisitableID() == Obj::BOAT; + return !t->blocked + || (t->visitableObjects.size() == 1 && t->topVisitableID() == Obj::BOAT); } void SectorMap::exploreNewSector(crint3 pos, int num) @@ -2285,7 +2295,7 @@ void SectorMap::write(crstring fname) int3 SectorMap::firstTileToGet(const CGHeroInstance *h, crint3 dst) { - int sourceSector = retreiveTile(h->visitablePos()), + int sourceSector = retreiveTile(h->visitablePos()), destinationSector = retreiveTile(dst); if(sourceSector != destinationSector) @@ -2365,7 +2375,7 @@ int3 SectorMap::firstTileToGet(const CGHeroInstance *h, crint3 dst) shipyards.push_back(shipyard); } - shipyards.erase(boost::remove_if(shipyards, [=](const IShipyard *shipyard) -> bool + shipyards.erase(boost::remove_if(shipyards, [=](const IShipyard *shipyard) -> bool { return shipyard->state() != 0 || retreiveTile(shipyard->bestLocation()) != sectorToReach->id; }),shipyards.end()); @@ -2464,7 +2474,7 @@ void SectorMap::makeParentBFS(crint3 source) ui8 &sec = retreiveTile(curPos); assert(sec == mySector); //consider only tiles from the same sector - const TerrainTile *t = cb->getTile(curPos); + //const TerrainTile *t = cb->getTile(curPos); foreach_neighbour(curPos, [&](crint3 neighPos) { if(retreiveTile(neighPos) == mySector && !vstd::contains(parent, neighPos)) diff --git a/AI/VCAI/VCAI.h b/AI/VCAI/VCAI.h index 8a6f68208..1e125c1fa 100644 --- a/AI/VCAI/VCAI.h +++ b/AI/VCAI/VCAI.h @@ -37,14 +37,14 @@ public: enum EGoals { INVALID = -1, - WIN, DO_NOT_LOSE, CONQUER, BUILD, EXPLORE, - RECRUIT_HERO, + WIN, DO_NOT_LOSE, CONQUER, BUILD, EXPLORE, + RECRUIT_HERO, BUILD_STRUCTURE, //if hero set, then in visited town COLLECT_RES, OBJECT_GOALS_BEGIN, GET_OBJ, //visit or defeat or collect the object - + GET_ART_TYPE, //BUILD_STRUCTURE, @@ -54,7 +54,7 @@ enum EGoals //VISIT_OBJ, //hero + tile VISIT_TILE, //tile, in conjunction with hero elementar; assumes tile is reachable - CLEAR_WAY_TO, + CLEAR_WAY_TO, DIG_AT_TILE //elementar with hero on tile }; @@ -77,7 +77,7 @@ struct CGoal virtual TSubgoal whatToDoToAchieve(); bool isBlockedBorderGate(int3 tileToHit); - CGoal(EGoals goal = INVALID) : goalType(goal) + CGoal(EGoals goal = INVALID) : goalType(goal) { priority = 0; isElementar = false; @@ -98,8 +98,8 @@ struct CGoal int objid; SETTER(int, objid) int aid; SETTER(int, aid) int3 tile; SETTER(int3, tile) - const CGHeroInstance *hero; SETTER(const CGHeroInstance *, hero) - const CGTownInstance *town; SETTER(const CGTownInstance *, town) + const CGHeroInstance *hero; SETTER(CGHeroInstance *, hero) + const CGTownInstance *town; SETTER(CGTownInstance *, town) int bid; SETTER(int, bid) }; @@ -114,16 +114,16 @@ struct SectorMap std::vector tiles; std::vector embarkmentPoints; //tiles of other sectors onto which we can (dis)embark bool water; //all tiles of sector are land or water - Sector() - { + Sector() + { id = -1; } }; bool valid; //some kind of lazy eval std::map parent; - std::vector>> sector; - //std::vector>> pathfinderSector; + std::vector>> sector; + //std::vector>> pathfinderSector; std::map infoOnSectors; @@ -144,7 +144,7 @@ struct CIssueCommand : CGoal { boost::function command; - CIssueCommand(boost::function _command) : command(_command), CGoal(ISSUE_COMMAND) {} + CIssueCommand(boost::function _command): CGoal(ISSUE_COMMAND), command(_command) {} }; class VCAI : public CAdventureAI @@ -264,7 +264,7 @@ public: const CGObjectInstance *lookForArt(int aid) const; bool isAccessible(const int3 &pos); const CGHeroInstance *getHeroWithGrail() const; - + const CGObjectInstance *getUnvisitedObj(const boost::function &predicate); bool isAccessibleForHero(const int3 & pos, const CGHeroInstance * h) const; @@ -277,7 +277,7 @@ public: }; -template +template bool objWithID(const CGObjectInstance *obj) { return obj->ID == id; diff --git a/Global.h b/Global.h index 911581a34..178e5c0cf 100644 --- a/Global.h +++ b/Global.h @@ -1,7 +1,7 @@ #pragma once // Standard include file -// Contents: +// Contents: // Includes C/C++ libraries, STL libraries, IOStream and String libraries // Includes the most important boost headers // Defines the import + export, override and exception handling macros @@ -109,6 +109,12 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte) #define DLL_LINKAGE DLL_IMPORT #endif +//defining available c++11 features + +//initialization lists - only gcc-4.4 or later +#if defined(__GNUC__) && ( __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) +#define CPP11_USE_INITIALIZERS_LIST +#endif //a normal std::map with a const operator[] for sanity template @@ -119,10 +125,10 @@ public: { return find(key)->second; } - ValT & operator[](KeyT key) + ValT & operator[](KeyT key) { return static_cast &>(*this)[key]; - } + } template void serialize(Handler &h, const int version) { h & static_cast &>(*this); @@ -133,35 +139,35 @@ namespace vstd { //returns true if container c contains item i template - bool contains(const Container & c, const Item &i) + bool contains(const Container & c, const Item &i) { return std::find(c.begin(),c.end(),i) != c.end(); } //returns true if map c contains item i template - bool contains(const std::map & c, const Item2 &i) + bool contains(const std::map & c, const Item2 &i) { return c.find(i)!=c.end(); } //returns true if bmap c contains item i template - bool contains(const bmap & c, const Item2 &i) + bool contains(const bmap & c, const Item2 &i) { return c.find(i)!=c.end(); } //returns true if unordered set c contains item i template - bool contains(const boost::unordered_set & c, const Item &i) + bool contains(const boost::unordered_set & c, const Item &i) { return c.find(i)!=c.end(); } //returns position of first element in vector c equal to s, if there is no such element, -1 is returned template - int find_pos(const std::vector & c, const T2 &s) + int find_pos(const std::vector & c, const T2 &s) { for(size_t i=0; i < c.size(); ++i) if(c[i] == s) @@ -171,7 +177,7 @@ namespace vstd //Func(T1,T2) must say if these elements matches template - int find_pos(const std::vector & c, const T2 &s, const Func &f) + int find_pos(const std::vector & c, const T2 &s, const Func &f) { for(size_t i=0; i < c.size(); ++i) if(f(c[i],s)) @@ -181,7 +187,7 @@ namespace vstd //returns iterator to the given element if present in container, end() if not template - typename Container::iterator find(Container & c, const Item &i) + typename Container::iterator find(Container & c, const Item &i) { return std::find(c.begin(),c.end(),i); } @@ -195,7 +201,7 @@ namespace vstd //removes element i from container c, returns false if c does not contain i template - typename Container::size_type operator-=(Container &c, const Item &i) + typename Container::size_type operator-=(Container &c, const Item &i) { typename Container::iterator itr = find(c,i); if(itr == c.end()) @@ -206,7 +212,7 @@ namespace vstd //assigns greater of (a, b) to a and returns maximum of (a, b) template - t1 &amax(t1 &a, const t2 &b) + t1 &amax(t1 &a, const t2 &b) { if(a >= b) return a; @@ -232,7 +238,7 @@ namespace vstd //makes a to fit the range template - t1 &abetween(t1 &a, const t2 &b, const t3 &c) + t1 &abetween(t1 &a, const t2 &b, const t3 &c) { amax(a,b); amin(a,c); @@ -241,18 +247,18 @@ namespace vstd //checks if a is between b and c template - bool isbetween(const t1 &a, const t2 &b, const t3 &c) + bool isbetween(const t1 &a, const t2 &b, const t3 &c) { return a > b && a < c; } //checks if a is within b and c template - bool iswithin(const t1 &a, const t2 &b, const t3 &c) + bool iswithin(const t1 &a, const t2 &b, const t3 &c) { return a >= b && a <= c; } - + template struct assigner { @@ -267,7 +273,7 @@ namespace vstd op1 = op2; } }; - + // Assigns value a2 to a1. The point of time of the real operation can be controlled // with the () operator. template @@ -277,8 +283,8 @@ namespace vstd } //deleted pointer and sets it to NULL - template - void clear_pointer(T* &ptr) + template + void clear_pointer(T* &ptr) { delete ptr; ptr = NULL; @@ -287,7 +293,7 @@ namespace vstd using vstd::operator-=; // can be used for counting arrays -template char (&_ArrayCountObj(const T (&)[N]))[N]; +template char (&_ArrayCountObj(const T (&)[N]))[N]; #define ARRAY_COUNT(arr) (sizeof(_ArrayCountObj(arr))) //for explicit overrides diff --git a/README.linux b/README.linux index 4b009536c..85f417532 100644 --- a/README.linux +++ b/README.linux @@ -29,17 +29,14 @@ To compile, at least the following packages (and their development counterparts) On Ubuntu 9.04 or later, run: sudo apt-get install g++ libsdl1.2debian-all libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-iostreams-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev -Create a directory /YOUR_INSTALL_PATH/vcmi (such as -/usr/local/share/games/vcmi) that will contain the game data files. The /vcmi at the end is necessary. +Create a directory /YOUR_INSTALL_PATH/vcmi (default is usually /usr/local/share/vcmi) +that will contain the game data files. The /vcmi at the end is necessary. Then run configure: + ./configure +Or if you're installing to custom path: ./configure --datadir=/YOUR_INSTALL_PATH/ --bindir=/YOUR_INSTALL_PATH/vcmi --libdir=/YOUR_INSTALL_PATH/ -On linux, by default, gcc is used. You can also use icc or clang by prefixing the -configure command: - CXX=clang ./configure ... - CXX=icc ./configure ... - Then build vcmi: make @@ -63,7 +60,7 @@ Install Heroes 3 and Wog. Then move all the installed files into Once both programs are installed, you can install VCMI. Download the windows VCMI release (at time of writing: -http://forum.vcmi.eu/dload.php?action=download&id=21) +http://forum.vcmi.eu/dload.php?action=download&id=23) and extract it in a private directory. Populate /YOUR_INSTALL_PATH/vcmi: mv sprites /YOUR_INSTALL_PATH/vcmi/Sprites @@ -77,19 +74,20 @@ If you also have the original linux version of Heroes, you can also install the III. Installing VCMI Since VCMI is still in development, there's no install procedure, although something like this will work: - DESTDIR=/path/to/heroes3 make install + make install You also need to update configuration files: - cp /PATH/TO/SOURCE/config /path/to/heroes3 + cp /PATH_TO_SOURCE/config /YOUR_INSTALL_PATH/vcmi For development puposes, it's better to use links. Go to /YOUR_INSTALL_PATH/vcmi, and type: - ln -s /PATH_TO_VCMI/client/vcmiclient - ln -s /PATH_TO_VCMI/server/vcmiserver - ln -s /PATH_TO_VCMI/config - ln -s /PATH_TO_VCMI/AI/GeniusAI/.libs/GeniusAI.so - ln -s /PATH_TO_VCMI/AI/StupidAI/.libs/StupidAI.so + ln -s /PATH_TO_SOURCE/client/vcmiclient + ln -s /PATH_TO_SOURCE/server/vcmiserver + ln -s /PATH_TO_SOURCE/config + ln -s /PATH_TO_SOURCE/lib/.libs/libvcmi.so + ln -s /PATH_TO_SOURCE/AI/VCAI/.libs/VCAI.so + ln -s /PATH_TO_SOURCE/AI/StupidAI/.libs/StupidAI.so And start ./vcmiclient diff --git a/Scripting/ERM/ERMInterpreter.cpp b/Scripting/ERM/ERMInterpreter.cpp index 7e44eb99b..d1045c269 100644 --- a/Scripting/ERM/ERMInterpreter.cpp +++ b/Scripting/ERM/ERMInterpreter.cpp @@ -451,7 +451,7 @@ struct ScriptScanner : boost::static_visitor<> break; } } - + } }; @@ -757,7 +757,7 @@ struct HEPerformer : StandardReceiverVisitor else throw EScriptExecError("Setting stack count is not implemented!"); } - else + else throw EScriptExecError("Slot number must be an evaluable i-exp"); } //todo else if(14 params) @@ -819,7 +819,7 @@ struct StringFormatter // startpos is the first digit // digits will be converted to number and returned // ADDITIVE on digitsUsed - int getNum() + int getNum() { int toAdd = 0; int numStart = percentPos + 2; @@ -847,7 +847,7 @@ struct StringFormatter break; if(percentPos + 1 >= msg.size()) //at least one character after % is required - throw EScriptExecError("Formatting error: % at the end of string!"); + throw EScriptExecError("Formatting error: % at the end of string!"); charsToReplace++; //the sign after % is consumed switch(msg[percentPos+1]) @@ -961,7 +961,7 @@ struct MAPerformer : StandardReceiverVisitor break; } } - + }; void MA_PPerformer::operator()( TIexp const& cmp ) const @@ -1197,7 +1197,7 @@ struct VRPerformer : StandardReceiverVisitor break; case 'S': //setting variable { - performOptionTakingOneParamter(trig.params); + performOptionTakingOneParamter(trig.params); } break; case 'T': //random variables @@ -1290,7 +1290,7 @@ struct ERMExpDispatch : boost::static_visitor<> } void operator()(Treceiver const& trig) const { - HLP helper; + HLP helper; //check condition if(trig.condition.is_initialized()) { @@ -1650,7 +1650,7 @@ IexpValStr ERMInterpreter::getVar(std::string toFollow, boost::optional ini { throw EIexpProblem(std::string("Symbol ") + cr + " is not allowed in this context!"); } - + } ret.name = toFollow; @@ -1914,7 +1914,7 @@ struct ConditionDisemboweler : boost::static_visitor default: throw EScriptExecError("Wrong type of left iexp!"); } - //we should never reach this place + return false;//we should never reach this place } bool operator()(int const & flag) const { @@ -2392,9 +2392,15 @@ void ERMInterpreter::heroVisit(const CGHeroInstance *visitor, const CGObjectInst return; setCurrentlyVisitedObj(visitedObj->pos); TIDPattern tip; +#ifdef CPP11_USE_INITIALIZERS_LIST + tip[1] = {visitedObj->ID}; + tip[2] = {visitedObj->ID, visitedObj->subID}; + tip[3] = {visitedObj->pos.x, visitedObj->pos.y, visitedObj->pos.z}; +#else tip[1] = list_of(visitedObj->ID); tip[2] = list_of(visitedObj->ID)(visitedObj->subID); tip[3] = list_of(visitedObj->pos.x)(visitedObj->pos.y)(visitedObj->pos.z); +#endif executeTriggerType(VERMInterpreter::TriggerType("OB"), start, tip); } @@ -2525,7 +2531,7 @@ struct VNodeEvaluator : boost::static_visitor return boost::apply_visitor(_SbackquoteEval(), exp.children[1]); else throw EVermScriptExecError("backquote special form takes only one argument"); - + } else if(opt.text == "if") { @@ -2717,7 +2723,7 @@ VOption ERMInterpreter::eval( VOption line, Environment * env /*= NULL*/ ) { // if(line.children.isNil()) // return; -// +// // VOption & car = line.children.car().getAsItem(); tlog1 << "\tevaluating "; printVOption(line); @@ -2819,7 +2825,7 @@ namespace VERMInterpreter { children.cdr() = VNode(children); } - + if(modifierList[g] == "`") { children.car() = VSymbol("backquote"); @@ -3067,7 +3073,7 @@ namespace VERMInterpreter } else throw EVermScriptExecError("Incompatible types in = special function"); - + } break; case ADD: diff --git a/client/BattleInterface/CBattleInterface.cpp b/client/BattleInterface/CBattleInterface.cpp index 1e8a7f89d..eb3571add 100644 --- a/client/BattleInterface/CBattleInterface.cpp +++ b/client/BattleInterface/CBattleInterface.cpp @@ -89,12 +89,12 @@ void CBattleInterface::addNewAnim(CBattleAnimation * anim) } CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSet * army2, CGHeroInstance *hero1, CGHeroInstance *hero2, const SDL_Rect & myRect, CPlayerInterface * att, CPlayerInterface * defen) - : queue(NULL), attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0), - activeStack(NULL), stackToActivate(NULL), mouseHoveredStack(-1), lastMouseHoveredStackAnimationTime(-1), previouslyHoveredHex(-1), + : queue(NULL), attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0), + activeStack(NULL), stackToActivate(NULL), mouseHoveredStack(-1), lastMouseHoveredStackAnimationTime(-1), previouslyHoveredHex(-1), currentlyHoveredHex(-1), attackingHex(-1), tacticianInterface(NULL), stackCanCastSpell(false), spellDestSelectMode(false), spellSelMode(NO_LOCATION), spellToCast(NULL), siegeH(NULL), attackerInt(att), defenderInt(defen), curInt(att), animIDhelper(0), bfield(GameConstants::BFIELD_SIZE), givenCommand(NULL), myTurn(false), resWindow(NULL), moveStarted(false), moveSh(-1), bresult(NULL) - + { OBJ_CONSTRUCTION; @@ -107,7 +107,7 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe if(attackerInt && attackerInt->cb->battleGetTacticDist()) //hotseat -> check tactics for both players (defender may be local human) tacticianInterface = attackerInt; - else if(defenderInt && defenderInt->cb->battleGetTacticDist()) + else if(defenderInt && defenderInt->cb->battleGetTacticDist()) tacticianInterface = defenderInt; tacticsMode = tacticianInterface; //if we found interface of player with tactics, then enter tactics mode @@ -174,7 +174,7 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe std::vector< std::string > & backref = graphics->battleBacks[ curInt->cb->battleGetBattlefieldType() ]; background = BitmapHandler::loadBitmap(backref[ rand() % backref.size()], false ); } - + //preparing menu background //graphics->blueToPlayersAdv(menu, hero1->tempOwner); @@ -182,7 +182,7 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe amountNormal = BitmapHandler::loadBitmap("CMNUMWIN.BMP"); CSDL_Ext::alphaTransform(amountNormal); transformPalette(amountNormal, 0.59, 0.19, 0.93); - + amountPositive = BitmapHandler::loadBitmap("CMNUMWIN.BMP"); CSDL_Ext::alphaTransform(amountPositive); transformPalette(amountPositive, 0.18, 1.00, 0.18); @@ -203,7 +203,7 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe bOptions = new CAdventureMapButton (CGI->generaltexth->zelp[381].first, CGI->generaltexth->zelp[381].second, boost::bind(&CBattleInterface::bOptionsf,this), 3 + pos.x, 561 + pos.y, "icm003.def", SDLK_o); bSurrender = new CAdventureMapButton (CGI->generaltexth->zelp[379].first, CGI->generaltexth->zelp[379].second, boost::bind(&CBattleInterface::bSurrenderf,this), 54 + pos.x, 561 + pos.y, "icm001.def", SDLK_s); bFlee = new CAdventureMapButton (CGI->generaltexth->zelp[380].first, CGI->generaltexth->zelp[380].second, boost::bind(&CBattleInterface::bFleef,this), 105 + pos.x, 561 + pos.y, "icm002.def", SDLK_r); - bFlee->block(!curInt->cb->battleCanFlee()); + bFlee->block(!curInt->cb->battleCanFlee()); bSurrender->block(curInt->cb->battleGetSurrenderCost() < 0); bAutofight = new CAdventureMapButton (CGI->generaltexth->zelp[382].first, CGI->generaltexth->zelp[382].second, boost::bind(&CBattleInterface::bAutofightf,this), 157 + pos.x, 561 + pos.y, "icm004.def", SDLK_a); bSpell = new CAdventureMapButton (CGI->generaltexth->zelp[385].first, CGI->generaltexth->zelp[385].second, boost::bind(&CBattleInterface::bSpellf,this), 645 + pos.x, 561 + pos.y, "icm005.def", SDLK_c); @@ -362,7 +362,7 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe int channel = CCS->soundh->playSoundFromSet(CCS->soundh->battleIntroSounds); CCS->soundh->setCallback(channel, boost::bind(&CMusicHandler::playMusicFromSet, CCS->musich, CCS->musich->battleMusics, -1)); - memset(stackCountOutsideHexes, 1, GameConstants::BFIELD_SIZE * sizeof(bool)); //initialize array with trues + memset(stackCountOutsideHexes, 1, GameConstants::BFIELD_SIZE * sizeof(bool)); //initialize array with trues } CBattleInterface::~CBattleInterface() @@ -411,9 +411,9 @@ CBattleInterface::~CBattleInterface() curInt->battleInt = NULL; //TODO: play AI tracks if battle was during AI turn - //if (!curInt->makingTurn) + //if (!curInt->makingTurn) //CCS->musich->playMusicFromSet(CCS->musich->aiMusics, -1); - + if(adventureInt && adventureInt->selection) { int terrain = LOCPLINT->cb->getTile(adventureInt->selection->visitablePos())->tertype; @@ -525,7 +525,7 @@ void CBattleInterface::show(SDL_Surface * to) ++animCount; if(!to) //"evaluating" to to = screen; - + SDL_Rect buf; SDL_GetClipRect(to, &buf); SDL_SetClipRect(to, &pos); @@ -588,7 +588,7 @@ void CBattleInterface::show(SDL_Surface * to) else if(settings["battle"]["mouseShadow"].Bool()) //when not casting spell {//TODO: do not check it every frame if (activeStack) //highlight all attackable hexes - { + { std::set set = curInt->cb->battleGetAttackedHexes(activeStack, currentlyHoveredHex, attackingHex); BOOST_FOREACH(BattleHex hex, set) { @@ -607,7 +607,7 @@ void CBattleInterface::show(SDL_Surface * to) } } - + SDL_SetClipRect(to, &buf); //restoring previous clip_rect //prevents blitting outside this window @@ -622,7 +622,7 @@ void CBattleInterface::show(SDL_Surface * to) BattleHex position = CGI->heroh->obstacles.find(obstacles[b].ID)->second.getMaxBlocked(obstacles[b].pos); hexToObstacle.insert(std::make_pair(position, b)); } - + ////showing units //a lot of work... std::vector stackAliveByHex[GameConstants::BFIELD_SIZE]; //double loop because dead stacks should be printed first @@ -711,11 +711,11 @@ void CBattleInterface::show(SDL_Surface * to) // xMove => 0: left side, 1: right side // xMoveDir => 0: decrement, 1: increment, alters every second hex line either xMin or xMax depending on xMove int xMin, xMax, yMin, yMax, xMove, xMoveDir = 0; - + switch (i) { // display units shown at the upper left side - case 0: + case 0: xMin = 0; yMin = 0; xMax = 11; @@ -756,11 +756,11 @@ void CBattleInterface::show(SDL_Surface * to) if (runNum > 0) { if (xMin == xMax) - xMax = xMin = ((runNum % 2) == 0) ? (xMin + (xMoveDir == 0 ? -1 : 1)) : xMin; + xMax = xMin = ((runNum % 2) == 0) ? (xMin + (xMoveDir == 0 ? -1 : 1)) : xMin; else if (xMove == 1) - xMax = ((runNum % 2) == 0) ? (xMax + (xMoveDir == 0 ? -1 : 1)) : xMax; + xMax = ((runNum % 2) == 0) ? (xMax + (xMoveDir == 0 ? -1 : 1)) : xMax; else if (xMove == 0) - xMin = ((runNum % 2) == 0) ? (xMin + (xMoveDir == 0 ? -1 : 1)) : xMin; + xMin = ((runNum % 2) == 0) ? (xMin + (xMoveDir == 0 ? -1 : 1)) : xMin; } for (int k = xMin; k <= xMax; k++) @@ -775,7 +775,7 @@ void CBattleInterface::show(SDL_Surface * to) } } } - + for(size_t b = 0; b < flyingStacks.size(); ++b) //showing flying stacks showAliveStack(flyingStacks[b], to); @@ -799,7 +799,7 @@ void CBattleInterface::show(SDL_Surface * to) //showing menu background and console blitAt(menu, pos.x, 556 + pos.y, to); - + if(tacticsMode) { btactNext->showAll(to); @@ -864,7 +864,7 @@ void CBattleInterface::showAliveStacks(std::vector *aliveStacks, if (hex == 16) if(defendingHero) defendingHero->show(to); - + for(size_t v = 0; v < aliveStacks[hex].size(); ++v) { const CStack *s = aliveStacks[hex][v]; @@ -1217,20 +1217,20 @@ void CBattleInterface::setBattleCursor(const int myNumber) // Exclude directions which cannot be attacked from. // Check to the left. - if (myNumber%GameConstants::BFIELD_WIDTH <= 1 || !vstd::contains(occupyableHexes, myNumber - 1)) + if (myNumber%GameConstants::BFIELD_WIDTH <= 1 || !vstd::contains(occupyableHexes, myNumber - 1)) { sectorCursor[0] = -1; } // Check top left, top right as well as above for 2-hex creatures. - if (myNumber/GameConstants::BFIELD_WIDTH == 0) + if (myNumber/GameConstants::BFIELD_WIDTH == 0) { sectorCursor[1] = -1; sectorCursor[2] = -1; aboveAttackable = false; - } - else + } + else { - if (doubleWide) + if (doubleWide) { bool attackRow[4] = {true, true, true, true}; @@ -1269,8 +1269,8 @@ void CBattleInterface::setBattleCursor(const int myNumber) sectorCursor[4] = -1; sectorCursor[5] = -1; belowAttackable = false; - } - else + } + else { if (doubleWide) { @@ -1291,8 +1291,8 @@ void CBattleInterface::setBattleCursor(const int myNumber) belowAttackable = false; if (!(attackRow[2] && attackRow[3])) sectorCursor[4] = -1; - } - else + } + else { if (!vstd::contains(occupyableHexes, myNumber + GameConstants::BFIELD_WIDTH + zigzagCorrection)) sectorCursor[4] = -1; @@ -1303,7 +1303,7 @@ void CBattleInterface::setBattleCursor(const int myNumber) // Determine index from sector. int cursorIndex; - if (doubleWide) + if (doubleWide) { sectorCursor.insert(sectorCursor.begin() + 5, belowAttackable ? 13 : -1); sectorCursor.insert(sectorCursor.begin() + 2, aboveAttackable ? 14 : -1); @@ -1318,8 +1318,8 @@ void CBattleInterface::setBattleCursor(const int myNumber) cursorIndex = 6; else cursorIndex = (int) sector + 2; - } - else + } + else { cursorIndex = sector; } @@ -1387,7 +1387,7 @@ void CBattleInterface::bSurrenderf() if(cost >= 0) { const CGHeroInstance *opponent = curInt->cb->battleGetFightingHero(1); - std::string enemyHeroName = opponent ? opponent->name : "#ENEMY#"; //TODO: should surrendering without enemy hero be enabled? + std::string enemyHeroName = opponent ? opponent->name : "#ENEMY#"; //TODO: should surrendering without enemy hero be enabled? std::string surrenderMessage = boost::str(boost::format(CGI->generaltexth->allTexts[32]) % enemyHeroName % cost); //%s states: "I will accept your surrender and grant you and your troops safe passage for the price of %d gold." curInt->showYesNoDialog(surrenderMessage, std::vector(), boost::bind(&CBattleInterface::reallySurrender,this), 0, false); } @@ -1508,7 +1508,7 @@ void CBattleInterface::newStack(const CStack * stack) if(stack->position < 0) //turret { const CCreature & turretCreature = *CGI->creh->creatures[ CGI->creh->factionToTurretCreature[siegeH->town->town->typeID] ]; - creAnims[stack->ID] = new CCreatureAnimation(turretCreature.animDefName); + creAnims[stack->ID] = new CCreatureAnimation(turretCreature.animDefName); // Turret positions are read out of the /config/wall_pos.txt int posID = 0; @@ -1533,7 +1533,7 @@ void CBattleInterface::newStack(const CStack * stack) } else { - creAnims[stack->ID] = new CCreatureAnimation(stack->getCreature()->animDefName); + creAnims[stack->ID] = new CCreatureAnimation(stack->getCreature()->animDefName); } creAnims[stack->ID]->setType(CCreatureAnim::HOLDING); creAnims[stack->ID]->pos = Rect(coords.x, coords.y, creAnims[stack->ID]->fullWidth, creAnims[stack->ID]->fullHeight); @@ -1623,7 +1623,7 @@ void CBattleInterface::newRound(int number) //bSpell->block(!curInt->cb->battleCanCastSpell()); //don't unlock spellbook - this should be done when we have axctive creature - + } void CBattleInterface::giveCommand(ui8 action, BattleHex tile, ui32 stack, si32 additional) @@ -1712,7 +1712,7 @@ const CGHeroInstance * CBattleInterface::getActiveHero() { return attackingHeroInstance; } - + return defendingHeroInstance; } @@ -1727,7 +1727,7 @@ void CBattleInterface::hexLclicked(int whichOne) } if( ((whichOne%GameConstants::BFIELD_WIDTH)!=0 && (whichOne%GameConstants::BFIELD_WIDTH)!=(GameConstants::BFIELD_WIDTH-1)) //if player is trying to attack enemey unit or move creature stack - || (actSt->hasBonusOfType(Bonus::CATAPULT) && !spellDestSelectMode || dest ) //enemy's first aid tent can stand there and we want to shoot it + || ((actSt->hasBonusOfType(Bonus::CATAPULT) && !spellDestSelectMode) || dest ) //enemy's first aid tent can stand there and we want to shoot it ) { if(!myTurn) @@ -1970,7 +1970,7 @@ void CBattleInterface::hexLclicked(int whichOne) if(attackFromHex >= 0) //we can be in this line when unreachable creature is L - clicked (as of revision 1308) { giveCommand(BattleAction::WALK_AND_ATTACK, attackFromHex, activeStack->ID, whichOne); - + CCS->curh->changeGraphic(1, 6); //cursor should be changed } @@ -2052,7 +2052,7 @@ void CBattleInterface::battleFinished(const BattleResult& br) void CBattleInterface::displayBattleFinished() { CCS->curh->changeGraphic(0,0); - + SDL_Rect temp_rect = genRect(561, 470, (screen->w - 800)/2 + 165, (screen->h - 600)/2 + 19); resWindow = new CBattleResultWindow(*bresult, temp_rect, this); GH.pushInt(resWindow); @@ -2115,7 +2115,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc ) //displaying animation CDefEssential * animDef = CDefHandler::giveDefEss(animToDisplay); - + int steps = sqrt(static_cast((destcoord.x - srccoord.x)*(destcoord.x - srccoord.x) + (destcoord.y - srccoord.y) * (destcoord.y - srccoord.y))) / 40; if(steps <= 0) steps = 1; @@ -2214,7 +2214,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc ) text = CGI->generaltexth->allTexts[551]; boost::algorithm::replace_first(text, "%s", curInt->cb->battleGetStackByID(*sc->affectedCres.begin())->type->nameSing); } - //The %s shrivel with age, and lose %d hit points." + //The %s shrivel with age, and lose %d hit points." TBonusListPtr bl = curInt->cb->battleGetStackByID(*sc->affectedCres.begin(), false)->getBonuses(Selector::type(Bonus::STACK_HEALTH)); bl->remove_if(Selector::source(Bonus::SPELL_EFFECT, 75)); boost::algorithm::replace_first(text, "%d", boost::lexical_cast(bl->totalValue()/2)); @@ -2256,7 +2256,7 @@ void CBattleInterface::spellCast( const BattleSpellCast * sc ) text = ""; break; default: - text = CGI->generaltexth->allTexts[565]; //The %s casts %s + text = CGI->generaltexth->allTexts[565]; //The %s casts %s boost::algorithm::replace_first(text, "%s", CGI->creh->creatures[sc->attackerType]->namePl); //casting stack } if (plural) @@ -2344,7 +2344,7 @@ void CBattleInterface::battleStacksEffectsSet(const SetStackEffect & sse) sprintf(txt, CGI->generaltexth->allTexts[txtid].c_str(), (stack->count != 1) ? stack->getCreature()->namePl.c_str() : stack->getCreature()->nameSing.c_str(), val); console->addText(txt); } - + } @@ -2433,7 +2433,7 @@ void CBattleInterface::castThisSpell(int spellID) } else { - CCS->curh->changeGraphic(3, 0); + GH.fakeMouseMove();//update cursor } } @@ -2561,8 +2561,8 @@ void CBattleInterface::showAliveStack(const CStack *stack, SDL_Surface * to) if(creAnims.find(ID) == creAnims.end()) //eg. for summoned but not yet handled stacks return; const CCreature *creature = stack->getCreature(); - SDL_Rect unitRect = {creAnims[ID]->pos.x, creAnims[ID]->pos.y, creAnims[ID]->fullWidth, creAnims[ID]->fullHeight}; - + SDL_Rect unitRect = {creAnims[ID]->pos.x, creAnims[ID]->pos.y, int16_t(creAnims[ID]->fullWidth), int16_t(creAnims[ID]->fullHeight)}; + int animType = creAnims[ID]->getType(); int affectingSpeed = getAnimSpeed(); @@ -2613,7 +2613,7 @@ void CBattleInterface::showAliveStack(const CStack *stack, SDL_Surface * to) incrementFrame = false; } } - + // Increment always when moving, never if stack died creAnims[ID]->nextFrame(to, unitRect.x, unitRect.y, creDir[ID], animCount, incrementFrame, activeStack && ID==activeStack->ID, ID==mouseHoveredStack, &unitRect); @@ -2683,9 +2683,16 @@ void CBattleInterface::showPieceOfWall(SDL_Surface * to, int hex, const std::vec return; using namespace boost::assign; +#ifdef CPP11_USE_INITIALIZERS_LIST + //note - std::list must be specified to avoid type deduction by gcc (may not work in other compilers) + static const std::map > hexToPart = { + {12, std::list{8, 1, 7}}, {45, std::list{12, 6}}, + {101, std::list{10}}, {118, std::list{2}}, + {165, std::list{11}}, {186, std::list{3}}}; +#else static const std::map > hexToPart = map_list_of >(12, list_of(8)(1)(7))(45, list_of(12)(6)) - /*gate (78, list_of(9))*/(101, list_of(10))(118, list_of(2))(165, list_of(11))(186, list_of(3)); - + (101, list_of(10))(118, list_of(2))(165, list_of(11))(186, list_of(3)); +#endif std::map >::const_iterator it = hexToPart.find(hex); if(it != hexToPart.end()) { @@ -2797,7 +2804,7 @@ void CBattleInterface::printConsoleAttacked( const CStack * defender, int dmg, i } else //killed == 1 { - sprintf(tabh + end, CGI->generaltexth->allTexts[378].c_str(), + sprintf(tabh + end, CGI->generaltexth->allTexts[378].c_str(), multiple ? CGI->generaltexth->allTexts[42].c_str() : defender->getCreature()->nameSing.c_str()); // creature perishes } } @@ -2828,7 +2835,7 @@ void CBattleInterface::projectileShowHelper(SDL_Surface * to) dst.w = idToProjectile[it->creID]->ourImages[it->frameNum].bitmap->w; dst.x = it->x; dst.y = it->y; - + // The equation below calculates the center pos of the canon, but we need the top left pos // of it for drawing if (it->catapultInfo) @@ -2883,7 +2890,7 @@ void CBattleInterface::projectileShowHelper(SDL_Surface * to) } void CBattleInterface::endAction(const BattleAction* action) -{ +{ //if((action->actionType==2 || (action->actionType==6 && action->destinationTile!=cb->battleGetPos(action->stackNumber)))) //activating interface when move is finished // { // activate(); @@ -2989,7 +2996,7 @@ void CBattleInterface::startAction(const BattleAction* action) assert(action->actionType == BattleAction::HERO_SPELL); //only cast spell is valid action without acting stack number } - if(action->actionType == BattleAction::WALK + if(action->actionType == BattleAction::WALK || (action->actionType == BattleAction::WALK_AND_ATTACK && action->destinationTile != stack->position)) { moveStarted = true; @@ -3162,14 +3169,14 @@ std::string CBattleInterface::SiegeHelper::getSiegeName(ui16 what, ui16 additInf } } -/// What: 1. background wall, 2. keep, 3. bottom tower, 4. bottom wall, 5. wall below gate, -/// 6. wall over gate, 7. upper wall, 8. upper tower, 9. gate, 10. gate arch, 11. bottom static wall, 12. upper static wall, 13. moat, 14. mlip, +/// What: 1. background wall, 2. keep, 3. bottom tower, 4. bottom wall, 5. wall below gate, +/// 6. wall over gate, 7. upper wall, 8. upper tower, 9. gate, 10. gate arch, 11. bottom static wall, 12. upper static wall, 13. moat, 14. mlip, /// 15. keep turret cover, 16. lower turret cover, 17. upper turret cover /// Positions are loaded from the config file: /config/wall_pos.txt void CBattleInterface::SiegeHelper::printPartOfWall(SDL_Surface * to, int what) { Point pos = Point(-1, -1); - + if (what >= 1 && what <= 17) { pos.x = graphics->wallPositions[town->town->typeID][what - 1].x + owner->pos.x; diff --git a/client/CCastleInterface.cpp b/client/CCastleInterface.cpp index fc1bbb54a..0fabb066b 100644 --- a/client/CCastleInterface.cpp +++ b/client/CCastleInterface.cpp @@ -465,7 +465,7 @@ CCastleBuildings::CCastleBuildings(const CGTownInstance* Town): std::map::iterator structure; structure = CGI->townh->structures[town->subID].find(*building); - if(structure != CGI->townh->structures[town->subID].end()) + if(structure != CGI->townh->structures[town->subID].end() && structure->second) { if(structure->second->group<0) // no group - just add it buildings.push_back(new CBuildingRect(this, town, structure->second)); diff --git a/client/CCreatureWindow.cpp b/client/CCreatureWindow.cpp index 61f9eb3bd..75dd9a809 100644 --- a/client/CCreatureWindow.cpp +++ b/client/CCreatureWindow.cpp @@ -86,7 +86,7 @@ CCreatureWindow::CCreatureWindow(const CStackInstance &st, int Type, boost::func for(TResources::nziterator i(upgradeCost); i.valid(); i++) { BLOCK_CAPTURING; - upgResCost.push_back(new CComponent(CComponent::resource, i->resType, i->resVal)); + upgResCost.push_back(new CComponent(CComponent::resource, i->resType, i->resVal)); } if(LOCPLINT->cb->getResourceAmount().canAfford(upgradeCost)) @@ -137,7 +137,7 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode * BonusList bl, blTemp; blTemp = (*(stackNode->getBonuses(Selector::durationType(Bonus::PERMANENT)))); - + while (blTemp.size()) { @@ -243,10 +243,10 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode * expmin = CGI->creh->expRanks[tier][9]; int expmax = CGI->creh->expRanks[tier][10]; number = expmax - expmin; - boost::replace_first (expText, "%i", boost::lexical_cast(number)); //Experience after Rank 10 - number = (stack->count * (expmax - expmin)) / expmin; - boost::replace_first (expText, "%i", boost::lexical_cast(number)); //Maximum New Recruits to remain at Rank 10 if at Maximum Experience - + boost::replace_first (expText, "%i", boost::lexical_cast(number)); //Experience after Rank 10 + number = (stack->count * (expmax - expmin)) / expmin; + boost::replace_first (expText, "%i", boost::lexical_cast(number)); //Maximum New Recruits to remain at Rank 10 if at Maximum Experience + expArea = new LRClickableAreaWTextComp(Rect(334, 49, 160, 44),CComponent::experience); expArea->text = expText; expArea->bonusValue = 0; //TDO: some specific value or no number at all @@ -279,10 +279,10 @@ void CCreatureWindow::init(const CStackInstance *Stack, const CBonusSystemNode * std::string spellText; if (effect < graphics->spellEffectsPics->ourImages.size()) //not all effects have graphics (for eg. Acid Breath) { - spellText = CGI->generaltexth->allTexts[610]; //"%s, duration: %d rounds." + spellText = CGI->generaltexth->allTexts[610]; //"%s, duration: %d rounds." boost::replace_first (spellText, "%s", CGI->spellh->spells[effect]->name); int duration = battleStack->getBonus(Selector::source(Bonus::SPELL_EFFECT,effect))->turnsRemain; - boost::replace_first (spellText, "%d", boost::lexical_cast(duration)); + boost::replace_first (spellText, "%d", boost::lexical_cast(duration)); blitAt(graphics->spellEffectsPics->ourImages[effect + 1].bitmap, 20 + 52 * printed, 184, *bitmap); spellEffects.push_back(new LRClickableAreaWText(Rect(20 + 52 * printed, 184, 50, 38), spellText, spellText)); if (++printed >= 10) //we can fit only 10 effects @@ -370,7 +370,7 @@ void CCreatureWindow::showAll(SDL_Surface * to) //TODO int dmgMultiply = 1; if(heroOwner && stackNode->hasBonusOfType(Bonus::SIEGE_WEAPON)) - dmgMultiply += heroOwner->Attack(); + dmgMultiply += heroOwner->Attack(); printLine(3, CGI->generaltexth->allTexts[199], stackNode->getMinDamage() * dmgMultiply, stackNode->getMaxDamage() * dmgMultiply, true); printLine(4, CGI->generaltexth->allTexts[388], c->valOfBonuses(Bonus::STACK_HEALTH), stackNode->valOfBonuses(Bonus::STACK_HEALTH)); @@ -401,7 +401,7 @@ void CCreatureWindow::scrollArt(int dir) void CCreatureWindow::passArtifactToHero() { - creatureArtifact->artType; + //creatureArtifact->artType; //FIXME } void CCreatureWindow::clickRight(tribool down, bool previousState) @@ -494,7 +494,7 @@ CCreInfoWindow::CCreInfoWindow(const CStackInstance &stack, bool LClicked, boost for(TResources::nziterator i(upgradeCost); i.valid(); i++) { BLOCK_CAPTURING; - upgResCost.push_back(new CComponent(CComponent::resource, i->resType, i->resVal)); + upgResCost.push_back(new CComponent(CComponent::resource, i->resType, i->resVal)); } CFunctionList onUpgrade; @@ -519,14 +519,14 @@ CCreInfoWindow::CCreInfoWindow(const CStackInstance &stack, bool LClicked, boost boost::function dialog = boost::bind(&CPlayerInterface::showYesNoDialog, LOCPLINT, - CGI->generaltexth->allTexts[12], + CGI->generaltexth->allTexts[12], std::vector(), onDismiss, 0, true); dismiss = new CAdventureMapButton("", CGI->generaltexth->zelp[445].second, dialog, 21, 237, "IVIEWCR2",SDLK_d); } - ok = new CAdventureMapButton("", CGI->generaltexth->zelp[445].second, + ok = new CAdventureMapButton("", CGI->generaltexth->zelp[445].second, boost::bind(&CCreInfoWindow::close,this), 216, 237, "IOKAY.DEF", SDLK_RETURN); } } @@ -596,7 +596,7 @@ void CCreInfoWindow::init(const CCreature *creature, const CBonusSystemNode *sta //TODO int dmgMultiply = 1; if(heroOwner && stackNode->hasBonusOfType(Bonus::SIEGE_WEAPON)) - dmgMultiply += heroOwner->Attack(); + dmgMultiply += heroOwner->Attack(); printLine(3, CGI->generaltexth->allTexts[199], stackNode->getMinDamage() * dmgMultiply, stackNode->getMaxDamage() * dmgMultiply, true); printLine(4, CGI->generaltexth->allTexts[388], creature->valOfBonuses(Bonus::STACK_HEALTH), stackNode->valOfBonuses(Bonus::STACK_HEALTH)); diff --git a/client/CDefHandler.cpp b/client/CDefHandler.cpp index 05d24f432..a3ff247af 100644 --- a/client/CDefHandler.cpp +++ b/client/CDefHandler.cpp @@ -96,7 +96,7 @@ void CDefHandler::openFromMemory(ui8 *table, const std::string & name) p += 13; } for (ui32 j=0; j(FDef + BaseOffset); - //prSize = SDL_SwapLE32(sd.prSize); //TODO use me defType2 = SDL_SwapLE32(sd.defType2); FullWidth = SDL_SwapLE32(sd.FullWidth); FullHeight = SDL_SwapLE32(sd.FullHeight); @@ -165,7 +163,7 @@ SDL_Surface * CDefHandler::getSprite (int SIndex, const ui8 * FDef, const BMPPal SpriteWidth+=LeftMargin; if(RightMargin<0) SpriteWidth+=RightMargin; - + // Note: this looks bogus because we allocate only FullWidth, not FullWidth+add add = 4 - FullWidth%4; if (add==4) @@ -209,7 +207,7 @@ SDL_Surface * CDefHandler::getSprite (int SIndex, const ui8 * FDef, const BMPPal memcpy(reinterpret_cast(ret->pixels)+ftcp, &FDef[BaseOffset], SpriteWidth); ftcp += SpriteWidth; BaseOffset += SpriteWidth; - + if (RightMargin>0) ftcp += RightMargin; } diff --git a/client/CMT.cpp b/client/CMT.cpp index 07412d0e2..06e8ec5a7 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -63,7 +63,7 @@ namespace po = boost::program_options; std::string NAME_AFFIX = "client"; std::string NAME = GameConstants::VCMI_VERSION + std::string(" (") + NAME_AFFIX + ')'; //application name CGuiHandler GH; -static CClient *client; +static CClient *client=NULL; SDL_Surface *screen = NULL, //main screen surface *screen2 = NULL,//and hlp surface (used to store not-active interfaces layer) *screenBuf = screen; //points to screen (if only advmapint is present) or screen2 (else) - should be used when updating controls which are not regularly redrawed @@ -742,9 +742,8 @@ void startGame(StartInfo * options, CConnection *serv/* = NULL*/) else setResolution = true; + client = new CClient; - - client = new CClient; CPlayerInterface::howManyPeople = 0; switch(options->mode) //new game { @@ -760,7 +759,7 @@ void startGame(StartInfo * options, CConnection *serv/* = NULL*/) break; } - client->connectionHandler = new boost::thread(&CClient::run, client); + client->connectionHandler = new boost::thread(&CClient::run, client); } void requestChangingResolution() diff --git a/client/CMusicHandler.cpp b/client/CMusicHandler.cpp index c510a952e..b6acbb74a 100644 --- a/client/CMusicHandler.cpp +++ b/client/CMusicHandler.cpp @@ -62,7 +62,7 @@ void CAudioBase::setVolume(ui32 percent) { if (percent > 100) percent = 100; - + volume = percent; } @@ -179,7 +179,7 @@ void CSoundHandler::initCreaturesSounds(const std::vectorid == details.id) ho = dynamic_cast(tile.objects[i].first); - if(!ho) //still nothing... + if(!ho) //still nothing... return; } @@ -354,7 +354,7 @@ void CPlayerInterface::heroKilled(const CGHeroInstance* hero) { boost::unique_lock un(*pim); wanderingHeroes -= hero; - if(vstd::contains(paths, hero)) + if(vstd::contains(paths, hero)) paths.erase(hero); adventureInt->heroList.updateHList(hero); @@ -382,7 +382,7 @@ SDL_Surface * CPlayerInterface::infoWin(const CGObjectInstance * specific) //spe switch(specific->ID) { - case GameConstants::HEROI_TYPE: + case GameConstants::HEROI_TYPE: { InfoAboutHero iah; bool gotInfo = LOCPLINT->cb->getHeroInfo(specific, iah); @@ -452,7 +452,7 @@ void CPlayerInterface::receivedResource(int type, int val) boost::unique_lock un(*pim); if(CMarketplaceWindow *mw = dynamic_cast(GH.topInt())) mw->resourceChanged(type, val); - + GH.totalRedraw(); } @@ -854,7 +854,7 @@ void CPlayerInterface::battleAttack(const BattleAttack *ba) const CStack * attacked = cb->battleGetStackByID(i->stackAttacked); battleInt->displayEffect(73, attacked->position); } - + } const CStack * attacker = cb->battleGetStackByID(ba->stackAttacking); @@ -896,6 +896,7 @@ void CPlayerInterface::yourTacticPhase(int distance) void CPlayerInterface::showComp(CComponent comp) { + waitWhileDialog();//Fix for mantis #98 boost::unique_lock un(*pim); CCS->soundh->playSoundFromSet(CCS->soundh->pickupSounds); @@ -915,7 +916,7 @@ void CPlayerInterface::showInfoDialog(const std::string &text, const std::vector { waitWhileDialog(); boost::unique_lock un(*pim); - + stopMovement(); CInfoWindow *temp = CInfoWindow::create(text, playerID, &components); temp->setDelComps(delComps); @@ -944,7 +945,7 @@ void CPlayerInterface::showBlockingDialog( const std::string &text, const std::v { waitWhileDialog(); boost::unique_lock un(*pim); - + stopMovement(); CCS->soundh->playSound(static_cast(soundID)); @@ -1145,11 +1146,11 @@ bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path ) { adventureInt->sleepWake.clickLeft(true, false); adventureInt->sleepWake.clickLeft(false, true); - //could've just called + //could've just called //adventureInt->fsleepWake(); //but no authentic button click/sound ;-) } - + int i = 1; //evil... eventsM.unlock(); @@ -1190,7 +1191,7 @@ bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path ) { newTerrain = cb->getTile(CGHeroInstance::convertPosition(path.nodes[i].coord, false))->tertype; - if (newTerrain != currentTerrain) + if (newTerrain != currentTerrain) { CCS->soundh->stopSound(sh); sh = CCS->soundh->playSound(CCS->soundh->horseSounds[newTerrain], -1); @@ -1222,7 +1223,7 @@ bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path ) if (adventureInt) { // (i == 0) means hero went through all the path - adventureInt->updateMoveHero(h, (i != 0)); + adventureInt->updateMoveHero(h, (i != 0)); adventureInt->updateNextHero(h); } return result; @@ -1298,7 +1299,7 @@ void CPlayerInterface::showArtifactAssemblyDialog (ui32 artifactID, ui32 assembl text += CGI->generaltexth->allTexts[733]; } - showYesNoDialog(text, scs, onYes, onNo, true); + showYesNoDialog(text, scs, onYes, onNo, true); } void CPlayerInterface::requestRealized( PackageApplied *pa ) @@ -1354,13 +1355,13 @@ void CPlayerInterface::recreateHeroTownList() newWanderingHeroes += allHeroes[j]; allHeroes -= allHeroes[j]; } - //all the rest of new heroes go the end of the list + //all the rest of new heroes go the end of the list wanderingHeroes.clear(); wanderingHeroes = newWanderingHeroes; newWanderingHeroes.clear(); for (int i = 0; i < allHeroes.size(); i++) if (!allHeroes[i]->inTownGarrison) - wanderingHeroes += allHeroes[i]; + wanderingHeroes += allHeroes[i]; std::vector newTowns; std::vector allTowns = cb->getTownsInfo(); @@ -1463,7 +1464,7 @@ void CPlayerInterface::update() if(terminate_cond.get()) return; - + //make sure that gamestate won't change when GUI objects may obtain its parts on event processing or drawing request boost::shared_lock gsLock(cb->getGsMutex()); @@ -1983,15 +1984,15 @@ void CPlayerInterface::gameOver(ui8 player, bool victory ) requestStoppingClient(); } cb->unregisterMyInterface(); //we already won/lost, nothing else matters - } + else { if(!victory && cb->getPlayerStatus(playerID) == PlayerState::INGAME) //enemy has lost - { - std::string txt = CGI->generaltexth->allTexts[5]; //%s has been vanquished! - boost::algorithm::replace_first(txt, "%s", CGI->generaltexth->capColors[player]); - showInfoDialog(txt,std::vector(1, new CComponent(CComponent::flag, player, 0))); + { + std::string txt = CGI->generaltexth->allTexts[5]; //%s has been vanquished! + boost::algorithm::replace_first(txt, "%s", CGI->generaltexth->capColors[player]); + showInfoDialog(txt,std::vector(1, new CComponent(CComponent::flag, player, 0))); } } } @@ -2056,7 +2057,7 @@ CGPath * CPlayerInterface::getAndVerifyPath(const CGHeroInstance * h) } else { - assert(h->getPosition(false) == path.startPos()); + assert(h->getPosition(false) == path.startPos()); //update the hero path in case of something has changed on map if(LOCPLINT->cb->getPath2(path.endPos(), path)) return &path; diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 6e87a8383..b9593bb63 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -4836,7 +4836,7 @@ void CArtifactsOfHero::markPossibleSlots(const CArtifactInstance* art) BOOST_FOREACH(CArtifactsOfHero *aoh, commonInfo->participants) BOOST_FOREACH(CArtPlace *place, aoh->artWorn) place->marked = art->canBePutAt(ArtifactLocation(aoh->curHero, place->slotID), true); - + if (CHeroWindow* chw = dynamic_cast(GH.topInt())) { //FIXME: garrison window has two rows of cretaures :? @@ -4847,10 +4847,10 @@ void CArtifactsOfHero::markPossibleSlots(const CArtifactInstance* art) g->highlight = true; } } - else if(CExchangeWindow* cew = dynamic_cast(GH.topInt())) + /*else if(CExchangeWindow* cew = dynamic_cast(GH.topInt())) { //TODO - } + }*/ safeRedraw(); } diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index ba0d9ca49..57500e70e 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -40,14 +40,14 @@ { \ if(vstd::contains(cl->playerint,player)) \ cl->playerint[player]->function(__VA_ARGS__); \ - }while(0) + }while(0) #define INTERFACE_CALL_IF_PRESENT(player,function,...) \ do \ { \ CALL_ONLY_THAT_INTERFACE(player, function, __VA_ARGS__);\ CALL_IN_PRIVILAGED_INTS(function, __VA_ARGS__); \ - } while(0) + } while(0) #define CALL_ONLY_THT_BATTLE_INTERFACE(player,function, ...) \ do \ @@ -295,7 +295,7 @@ void RemoveBonus::applyCl( CClient *cl ) break; case PLAYER: { - const PlayerState *p = GS(cl)->getPlayer(id); + //const PlayerState *p = GS(cl)->getPlayer(id); INTERFACE_CALL_IF_PRESENT(id, playerBonusChanged, bonus, false); } break; @@ -446,15 +446,15 @@ void SetHeroesInTown::applyCl( CClient *cl ) // void SetHeroArtifacts::applyCl( CClient *cl ) // { // tlog1 << "SetHeroArtifacts :(\n"; -// // +// // // // CGHeroInstance *h = GS(cl)->getHero(hid); // // CGameInterface *player = (vstd::contains(cl->playerint,h->tempOwner) ? cl->playerint[h->tempOwner] : NULL); // // if(!player) // // return; -// +// // //h->recreateArtBonuses(); // //player->heroArtifactSetChanged(h); -// +// // // BOOST_FOREACH(Bonus bonus, gained) // // { // // player->heroBonusChanged(h,bonus,true); @@ -475,7 +475,7 @@ void HeroRecruited::applyCl( CClient *cl ) CGI->mh->initHeroDef(h); CGI->mh->printObject(h); - + if(vstd::contains(cl->playerint,h->tempOwner)) { cl->playerint[h->tempOwner]->heroCreated(h); @@ -500,7 +500,7 @@ void GiveHero::applyFirstCl( CClient *cl ) void InfoWindow::applyCl( CClient *cl ) { std::vector comps; - for(size_t i=0;iinvalidatePaths(); - //consider notifying other interfaces that see hero? + //consider notifying other interfaces that see hero? INTERFACE_CALL_IF_PRESENT(caster->getOwner(),advmapSpellCast, caster, spellID); } @@ -902,7 +902,7 @@ void TradeComponents::applyCl(CClient *cl) break; case 221: //Trading Post break; - default: + default: tlog2 << "Shop type not supported! \n"; } } diff --git a/client/UIFramework/SDL_Extensions.cpp b/client/UIFramework/SDL_Extensions.cpp index add710dc5..ad2cb7025 100644 --- a/client/UIFramework/SDL_Extensions.cpp +++ b/client/UIFramework/SDL_Extensions.cpp @@ -17,7 +17,7 @@ * */ -SDL_Color Colors::createColor(int r, int g, int b, int a /*= 0*/) +SDL_Color Colors::createColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a /*= 0*/) { SDL_Color temp = {r, g, b, a}; return temp; @@ -47,8 +47,8 @@ STRONG_INLINE void ColorPutter::PutColorAlphaSwitch(Uint8 *&p PutColor(ptr, R, G, B); return; case 128: // optimized - PutColor(ptr, ((Uint16)R + (Uint16)ptr[2]) >> 1, - ((Uint16)G + (Uint16)ptr[1]) >> 1, + PutColor(ptr, ((Uint16)R + (Uint16)ptr[2]) >> 1, + ((Uint16)G + (Uint16)ptr[1]) >> 1, ((Uint16)B + (Uint16)ptr[0]) >> 1); return; default: @@ -60,8 +60,8 @@ STRONG_INLINE void ColorPutter::PutColorAlphaSwitch(Uint8 *&p template STRONG_INLINE void ColorPutter::PutColor(Uint8 *&ptr, const Uint8 & R, const Uint8 & G, const Uint8 & B, const Uint8 & A) { - PutColor(ptr, ((((Uint32)ptr[2]-(Uint32)R)*(Uint32)A) >> 8 ) + (Uint32)R, - ((((Uint32)ptr[1]-(Uint32)G)*(Uint32)A) >> 8 ) + (Uint32)G, + PutColor(ptr, ((((Uint32)ptr[2]-(Uint32)R)*(Uint32)A) >> 8 ) + (Uint32)R, + ((((Uint32)ptr[1]-(Uint32)G)*(Uint32)A) >> 8 ) + (Uint32)G, ((((Uint32)ptr[0]-(Uint32)B)*(Uint32)A) >> 8 ) + (Uint32)B); } @@ -103,7 +103,7 @@ template STRONG_INLINE void ColorPutter::PutColorRow(Uint8 *&ptr, const SDL_Color & Color, size_t count) { Uint32 pixel = ((Uint32)Color.b << 0 ) + ((Uint32)Color.g << 8) + ((Uint32)Color.r << 16); - + for (size_t i=0; i::PutColor(Uint8 *&ptr, const Uin g8 = (g5 << (8 - gbit)) | (g5 >> (2*gbit - 8)), b8 = (b5 << (8 - bbit)) | (b5 >> (2*bbit - 8)); - PutColor(ptr, + PutColor(ptr, (((r8-R)*A) >> 8) + R, (((g8-G)*A) >> 8) + G, (((b8-B)*A) >> 8) + B); @@ -182,7 +182,7 @@ STRONG_INLINE void ColorPutter<2, incrementPtr>::PutColorRow(Uint8 *&ptr, const { //drop least significant bits of 24 bpp encoded color Uint16 pixel = (Color.b>>3) + ((Color.g>>2) << 5) + ((Color.r>>3) << 11); - + for (size_t i=0; i(src, &srcRect, dst, &dstRect, rotation); } -template +template void CSDL_Ext::blitWithRotateClipWithAlpha(SDL_Surface *src,SDL_Rect * srcRect, SDL_Surface * dst, SDL_Rect * dstRect, ui8 rotation)//srcRect is not used, works with 8bpp sources and 24bpp dests { static void (*blitWithRotate[])(const SDL_Surface *, const SDL_Rect *, SDL_Surface *, const SDL_Rect *) = {blitWithRotate1WithAlpha, blitWithRotate2WithAlpha, blitWithRotate3WithAlpha}; @@ -730,7 +730,7 @@ void CSDL_Ext::blitWithRotateClipWithAlpha(SDL_Surface *src,SDL_Rect * srcRect, } } -template +template void CSDL_Ext::blitWithRotateClipValWithAlpha( SDL_Surface *src,SDL_Rect srcRect, SDL_Surface * dst, SDL_Rect dstRect, ui8 rotation ) { blitWithRotateClipWithAlpha(src, &srcRect, dst, &dstRect, rotation); @@ -777,13 +777,13 @@ void CSDL_Ext::blitWithRotate3(const SDL_Surface *src, const SDL_Rect * srcRect, Uint8 *sp = (Uint8 *)src->pixels + (src->h - srcRect->h - srcRect->y)*src->pitch + (src->w - srcRect->w - srcRect->x); Uint8 *dporg = (Uint8 *)dst->pixels +(dstRect->y + dstRect->h - 1)*dst->pitch + (dstRect->x+dstRect->w)*bpp; const SDL_Color * const colors = src->format->palette->colors; - + for(int i=dstRect->h; i>0; i--, dporg -= dst->pitch) { Uint8 *dp = dporg; for(int j=dstRect->w; j>0; j--, sp++) ColorPutter::PutColor(dp, colors[*sp]); - + sp += src->w - dstRect->w; } } @@ -1056,7 +1056,7 @@ void CSDL_Ext::setPlayerColor(SDL_Surface * sur, ui8 player) return; if(sur->format->BitsPerPixel==8) { - SDL_Color *color = (player == 255 + SDL_Color *color = (player == 255 ? graphics->neutralColor : &graphics->playerColors[player]); SDL_SetColors(sur, color, 5, 1); @@ -1212,29 +1212,29 @@ void CSDL_Ext::applyEffect( SDL_Surface * surf, const SDL_Rect * rect, int mode { ui8 * pixels = (ui8*)surf->pixels + yp * surf->pitch + xp * surf->format->BytesPerPixel; - int b = pixels[0]; - int g = pixels[1]; - int r = pixels[2]; + int b = pixels[0]; + int g = pixels[1]; + int r = pixels[2]; int gry = (r + g + b) / 3; - r = g = b = gry; - r = r + (sepiaDepth * 2); - g = g + sepiaDepth; + r = g = b = gry; + r = r + (sepiaDepth * 2); + g = g + sepiaDepth; - if (r>255) r=255; - if (g>255) g=255; - if (b>255) b=255; + if (r>255) r=255; + if (g>255) g=255; + if (b>255) b=255; - // Darken blue color to increase sepia effect - b -= sepiaIntensity; + // Darken blue color to increase sepia effect + b -= sepiaIntensity; - // normalize if out of bounds - if (b<0) b=0; - if (b>255) b=255; + // normalize if out of bounds + if (b<0) b=0; + if (b>255) b=255; - pixels[0] = b; - pixels[1] = g; - pixels[2] = r; + pixels[0] = b; + pixels[1] = g; + pixels[2] = r; } } @@ -1248,9 +1248,9 @@ void CSDL_Ext::applyEffect( SDL_Surface * surf, const SDL_Rect * rect, int mode { ui8 * pixels = (ui8*)surf->pixels + yp * surf->pitch + xp * surf->format->BytesPerPixel; - int b = pixels[0]; - int g = pixels[1]; - int r = pixels[2]; + int b = pixels[0]; + int g = pixels[1]; + int r = pixels[2]; int gry = (r + g + b) / 3; pixels[0] = pixels[1] = pixels[2] = gry; diff --git a/client/UIFramework/SDL_Extensions.h b/client/UIFramework/SDL_Extensions.h index 2c8624975..c693f9c08 100644 --- a/client/UIFramework/SDL_Extensions.h +++ b/client/UIFramework/SDL_Extensions.h @@ -40,7 +40,7 @@ bool isItIn(const SDL_Rect * rect, int x, int y); namespace Colors { - SDL_Color createColor(int r, int g, int b, int a = 0); + SDL_Color createColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a = 0); const SDL_Color Jasmine = createColor(229, 215, 123, 0); // http://en.wikipedia.org/wiki/Jasmine_%28color%29 const SDL_Color Cornsilk = createColor(255, 243, 222, 0); // http://en.wikipedia.org/wiki/Shades_of_white diff --git a/configure b/configure index 2bad21d2f..a06c630f5 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for vcmi 0.84b. +# Generated by GNU Autoconf 2.68 for vcmi 0.87b. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -89,6 +89,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -222,11 +223,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -559,8 +567,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='vcmi' PACKAGE_TARNAME='vcmi' -PACKAGE_VERSION='0.84b' -PACKAGE_STRING='vcmi 0.84b' +PACKAGE_VERSION='0.87b' +PACKAGE_STRING='vcmi 0.87b' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1176,7 +1184,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1314,7 +1322,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.84b to adapt to many kinds of systems. +\`configure' configures vcmi 0.87b to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1384,7 +1392,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of vcmi 0.84b:";; + short | recursive ) echo "Configuration of vcmi 0.87b:";; esac cat <<\_ACEOF @@ -1525,8 +1533,8 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -vcmi configure 0.84b -generated by GNU Autoconf 2.67 +vcmi configure 0.87b +generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1572,7 +1580,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1610,7 +1618,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1656,7 +1664,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1670,7 +1678,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1688,7 +1696,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1724,7 +1732,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1766,7 +1774,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1779,7 +1787,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1834,7 +1842,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -1870,7 +1878,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp @@ -1916,7 +1924,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link @@ -1958,7 +1966,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run @@ -1971,10 +1979,10 @@ fi ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2037,7 +2045,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2046,7 +2054,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel @@ -2058,7 +2066,7 @@ ac_fn_cxx_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2113,15 +2121,15 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func 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.84b, which was -generated by GNU Autoconf 2.67. Invocation command line was +It was created by vcmi $as_me 0.87b, which was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2379,7 +2387,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2516,7 +2524,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2603,11 +2611,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -2693,7 +2701,7 @@ if test "$cross_compiling" != no; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2733,7 +2741,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2786,7 +2794,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if test "${ac_cv_path_mkdir+set}" = set; then : + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2837,7 +2845,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2877,7 +2885,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2935,7 +2943,7 @@ fi # Define the identity of the package. PACKAGE='vcmi' - VERSION='0.84b' + VERSION='0.87b' cat >>confdefs.h <<_ACEOF @@ -3000,7 +3008,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -3044,7 +3052,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3208,7 +3216,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3251,7 +3259,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3310,7 +3318,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -3321,7 +3329,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3362,7 +3370,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3372,7 +3380,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3409,7 +3417,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -3557,7 +3565,7 @@ depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -3773,7 +3781,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -3789,7 +3797,7 @@ fi $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -3807,7 +3815,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -3822,7 +3830,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -3917,7 +3925,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3957,7 +3965,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -4010,7 +4018,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4050,7 +4058,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4109,7 +4117,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4153,7 +4161,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -4208,7 +4216,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4237,7 +4245,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4274,7 +4282,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -4352,7 +4360,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -4451,7 +4459,7 @@ depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4576,7 +4584,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -4658,7 +4666,7 @@ Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -4721,7 +4729,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -4788,7 +4796,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then : +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -4919,7 +4927,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -4959,7 +4967,7 @@ fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -4986,7 +4994,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if test "${lt_cv_path_NM+set}" = set; then : +if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -5049,7 +5057,7 @@ else set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -5093,7 +5101,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -5165,7 +5173,7 @@ test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if test "${lt_cv_nm_interface+set}" = set; then : +if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" @@ -5200,7 +5208,7 @@ fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then : +if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 @@ -5397,7 +5405,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if test "${lt_cv_to_host_file_cmd+set}" = set; then : +if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in @@ -5444,7 +5452,7 @@ $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if test "${lt_cv_to_tool_file_cmd+set}" = set; then : +if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. @@ -5471,7 +5479,7 @@ $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if test "${lt_cv_ld_reload_flag+set}" = set; then : +if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -5512,7 +5520,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -5552,7 +5560,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -5611,7 +5619,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then : +if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -5858,7 +5866,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then : +if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then @@ -5898,7 +5906,7 @@ if test -z "$ac_cv_prog_DLLTOOL"; then set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then @@ -5958,7 +5966,7 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then : +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' @@ -6002,7 +6010,7 @@ if test -n "$ac_tool_prefix"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -6046,7 +6054,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -6110,7 +6118,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } -if test "${lt_cv_ar_at_file+set}" = set; then : +if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no @@ -6171,7 +6179,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -6211,7 +6219,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -6270,7 +6278,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -6310,7 +6318,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -6439,7 +6447,7 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : +if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6873,7 +6881,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then : +if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -6946,7 +6954,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then : +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then @@ -6986,7 +6994,7 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then @@ -7036,7 +7044,7 @@ fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if test "${lt_cv_path_mainfest_tool+set}" = set; then : +if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no @@ -7066,7 +7074,7 @@ fi set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -7106,7 +7114,7 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -7158,7 +7166,7 @@ fi set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NMEDIT+set}" = set; then : +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -7198,7 +7206,7 @@ if test -z "$ac_cv_prog_NMEDIT"; then set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -7250,7 +7258,7 @@ fi set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LIPO+set}" = set; then : +if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -7290,7 +7298,7 @@ if test -z "$ac_cv_prog_LIPO"; then set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -7342,7 +7350,7 @@ fi set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL+set}" = set; then : +if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -7382,7 +7390,7 @@ if test -z "$ac_cv_prog_OTOOL"; then set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -7434,7 +7442,7 @@ fi set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OTOOL64+set}" = set; then : +if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -7474,7 +7482,7 @@ if test -z "$ac_cv_prog_OTOOL64"; then set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -7549,7 +7557,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if test "${lt_cv_apple_cc_single_mod+set}" = set; then : +if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -7578,7 +7586,7 @@ fi $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : +if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -7610,7 +7618,7 @@ fi $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } -if test "${lt_cv_ld_force_load+set}" = set; then : +if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no @@ -7687,7 +7695,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -7803,7 +7811,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -7815,7 +7823,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7946,7 +7954,7 @@ for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = x""yes; then : +if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF @@ -8083,7 +8091,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if test "${lt_cv_objdir+set}" = set; then : +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -8161,7 +8169,7 @@ file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8227,7 +8235,7 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : +if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8369,7 +8377,7 @@ if test "$GCC" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -8714,7 +8722,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if test "${lt_cv_prog_compiler_pic+set}" = set; then : +if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic @@ -8729,7 +8737,7 @@ lt_prog_compiler_pic=$lt_cv_prog_compiler_pic if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -8793,7 +8801,7 @@ fi wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works+set}" = set; then : +if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -8836,7 +8844,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -8891,7 +8899,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then : +if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9460,7 +9468,7 @@ _LT_EOF if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else - if test "${lt_cv_aix_libpath_+set}" = set; then : + if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9513,7 +9521,7 @@ fi if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else - if test "${lt_cv_aix_libpath_+set}" = set; then : + if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9785,7 +9793,7 @@ fi # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } -if test "${lt_cv_prog_compiler__b+set}" = set; then : +if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no @@ -9854,7 +9862,7 @@ fi # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if test "${lt_cv_irix_exported_symbol+set}" = set; then : +if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" @@ -10170,7 +10178,7 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : +if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* @@ -10872,7 +10880,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no @@ -11304,7 +11312,7 @@ else # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11338,7 +11346,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -11352,12 +11360,12 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; then : +if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if test "${ac_cv_lib_dld_shl_load+set}" = set; then : +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11391,16 +11399,16 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : +if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11434,12 +11442,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if test "${ac_cv_lib_svld_dlopen+set}" = set; then : +if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11473,12 +11481,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if test "${ac_cv_lib_dld_dld_link+set}" = set; then : +if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11512,7 +11520,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -11553,7 +11561,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then : +if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11659,7 +11667,7 @@ $as_echo "$lt_cv_dlopen_self" >&6; } wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then : +if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11896,7 +11904,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then : + if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded @@ -12012,7 +12020,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp @@ -12199,7 +12207,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if test "${lt_cv_path_LD+set}" = set; then : +if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -12239,7 +12247,7 @@ fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if test "${lt_cv_prog_gnu_ld+set}" = set; then : +if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -12411,7 +12419,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else - if test "${lt_cv_aix_libpath__CXX+set}" = set; then : + if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12465,7 +12473,7 @@ fi if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else - if test "${lt_cv_aix_libpath__CXX+set}" = set; then : + if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13871,7 +13879,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if test "${lt_cv_prog_compiler_pic_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX @@ -13886,7 +13894,7 @@ lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no @@ -13944,7 +13952,7 @@ fi wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no @@ -13984,7 +13992,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14036,7 +14044,7 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14178,7 +14186,7 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if test "${lt_cv_archive_cmds_need_lc_CXX+set}" = set; then : +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* @@ -14721,7 +14729,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no @@ -15114,7 +15122,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler vendor" >&5 $as_echo_n "checking for C++ compiler vendor... " >&6; } -if test "${ax_cv_cxx_compiler_vendor+set}" = set; then : +if ${ax_cv_cxx_compiler_vendor+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_cxx_compiler_vendor=unknown @@ -15147,6 +15155,7 @@ fi $as_echo "$ax_cv_cxx_compiler_vendor" >&6; } + # Use silent rules if supported. # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : @@ -15176,10 +15185,13 @@ if test "x$GXX" = "xyes" -a "x$enable_debug" = "xyes" ; then CXXFLAGS="$CXXFLAGS -O0 -ggdb" fi +# For c++11 compatibility. Required at least in VCAI +CXXFLAGS="$CXXFLAGS -std=c++0x" + # For gcc and compatible compilers, enable compilation warnings, but # selectively disable some because too many are generated. if test "x$GXX" = "xyes" ; then - CXXFLAGS="$CXXFLAGS -Wall -Wno-switch -Wno-sign-compare -Wcast-align -Wpointer-arith -Wno-unknown-pragmas" + CXXFLAGS="$CXXFLAGS -Wall -Wno-switch -Wno-sign-compare -Wcast-align -Wpointer-arith" fi # extra clang parameters @@ -15492,7 +15504,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Boost::System library is available" >&5 $as_echo_n "checking whether the Boost::System library is available... " >&6; } -if test "${ax_cv_boost_system+set}" = set; then : +if ${ax_cv_boost_system+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -15546,7 +15558,7 @@ $as_echo "#define HAVE_BOOST_SYSTEM /**/" >>confdefs.h as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15594,7 +15606,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15643,7 +15655,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15736,7 +15748,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Filesystem library is available" >&5 $as_echo_n "checking whether the Boost::Filesystem library is available... " >&6; } -if test "${ax_cv_boost_filesystem+set}" = set; then : +if ${ax_cv_boost_filesystem+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -15785,7 +15797,7 @@ $as_echo "#define HAVE_BOOST_FILESYSTEM /**/" >>confdefs.h as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15833,7 +15845,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15881,7 +15893,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15972,7 +15984,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Thread library is available" >&5 $as_echo_n "checking whether the Boost::Thread library is available... " >&6; } -if test "${ax_cv_boost_thread+set}" = set; then : +if ${ax_cv_boost_thread+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -16048,7 +16060,7 @@ $as_echo "#define HAVE_BOOST_THREAD /**/" >>confdefs.h as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16096,7 +16108,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16145,7 +16157,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16242,7 +16254,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Boost::IOStreams library is available" >&5 $as_echo_n "checking whether the Boost::IOStreams library is available... " >&6; } -if test "${ax_cv_boost_iostreams+set}" = set; then : +if ${ax_cv_boost_iostreams+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -16295,7 +16307,7 @@ $as_echo "#define HAVE_BOOST_IOSTREAMS /**/" >>confdefs.h as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16343,7 +16355,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16392,7 +16404,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$ax_lib" >&5 $as_echo_n "checking for main in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16474,7 +16486,7 @@ fi export LDFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Boost::Program_Options library is available" >&5 $as_echo_n "checking whether the Boost::Program_Options library is available... " >&6; } -if test "${ax_cv_boost_program_options+set}" = set; then : +if ${ax_cv_boost_program_options+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=cpp @@ -16523,7 +16535,7 @@ $as_echo "#define HAVE_BOOST_PROGRAM_OPTIONS /**/" >>confdefs.h as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16571,7 +16583,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_exit" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for exit in -l$ax_lib" >&5 $as_echo_n "checking for exit in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16619,7 +16631,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_$ax_lib''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$ax_lib" >&5 $as_echo_n "checking for main in -l$ax_lib... " >&6; } -if eval "test \"\${$as_ac_Lib+set}\"" = set; then : +if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16671,7 +16683,7 @@ fi # Check whether librt is necessary { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shm_open in -lrt" >&5 $as_echo_n "checking for shm_open in -lrt... " >&6; } -if test "${ac_cv_lib_rt_shm_open+set}" = set; then : +if ${ac_cv_lib_rt_shm_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16705,7 +16717,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_shm_open" >&5 $as_echo "$ac_cv_lib_rt_shm_open" >&6; } -if test "x$ac_cv_lib_rt_shm_open" = x""yes; then : +if test "x$ac_cv_lib_rt_shm_open" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF @@ -16761,7 +16773,7 @@ fi set dummy sdl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SDL_CONFIG+set}" = set; then : +if ${ac_cv_path_SDL_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $SDL_CONFIG in @@ -16992,7 +17004,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL_Init in -lSDL" >&5 $as_echo_n "checking for SDL_Init in -lSDL... " >&6; } -if test "${ac_cv_lib_SDL_SDL_Init+set}" = set; then : +if ${ac_cv_lib_SDL_SDL_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17026,7 +17038,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_SDL_Init" >&5 $as_echo "$ac_cv_lib_SDL_SDL_Init" >&6; } -if test "x$ac_cv_lib_SDL_SDL_Init" = x""yes; then : +if test "x$ac_cv_lib_SDL_SDL_Init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSDL 1 _ACEOF @@ -17039,7 +17051,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lSDL_mixer" >&5 $as_echo_n "checking for main in -lSDL_mixer... " >&6; } -if test "${ac_cv_lib_SDL_mixer_main+set}" = set; then : +if ${ac_cv_lib_SDL_mixer_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17067,7 +17079,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_mixer_main" >&5 $as_echo "$ac_cv_lib_SDL_mixer_main" >&6; } -if test "x$ac_cv_lib_SDL_mixer_main" = x""yes; then : +if test "x$ac_cv_lib_SDL_mixer_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSDL_MIXER 1 _ACEOF @@ -17080,7 +17092,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMG_Load in -lSDL_image" >&5 $as_echo_n "checking for IMG_Load in -lSDL_image... " >&6; } -if test "${ac_cv_lib_SDL_image_IMG_Load+set}" = set; then : +if ${ac_cv_lib_SDL_image_IMG_Load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17114,7 +17126,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_image_IMG_Load" >&5 $as_echo "$ac_cv_lib_SDL_image_IMG_Load" >&6; } -if test "x$ac_cv_lib_SDL_image_IMG_Load" = x""yes; then : +if test "x$ac_cv_lib_SDL_image_IMG_Load" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSDL_IMAGE 1 _ACEOF @@ -17127,7 +17139,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lSDL_ttf" >&5 $as_echo_n "checking for main in -lSDL_ttf... " >&6; } -if test "${ac_cv_lib_SDL_ttf_main+set}" = set; then : +if ${ac_cv_lib_SDL_ttf_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17155,7 +17167,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_ttf_main" >&5 $as_echo "$ac_cv_lib_SDL_ttf_main" >&6; } -if test "x$ac_cv_lib_SDL_ttf_main" = x""yes; then : +if test "x$ac_cv_lib_SDL_ttf_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSDL_TTF 1 _ACEOF @@ -17179,7 +17191,7 @@ CFLAGS="$CFLAGS `pkg-config --cflags libavformat libswscale`" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_open_input_file in -lavformat" >&5 $as_echo_n "checking for av_open_input_file in -lavformat... " >&6; } -if test "${ac_cv_lib_avformat_av_open_input_file+set}" = set; then : +if ${ac_cv_lib_avformat_av_open_input_file+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17213,7 +17225,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_av_open_input_file" >&5 $as_echo "$ac_cv_lib_avformat_av_open_input_file" >&6; } -if test "x$ac_cv_lib_avformat_av_open_input_file" = x""yes; then : +if test "x$ac_cv_lib_avformat_av_open_input_file" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBAVFORMAT 1 _ACEOF @@ -17226,7 +17238,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sws_getContext in -lswscale" >&5 $as_echo_n "checking for sws_getContext in -lswscale... " >&6; } -if test "${ac_cv_lib_swscale_sws_getContext+set}" = set; then : +if ${ac_cv_lib_swscale_sws_getContext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17260,7 +17272,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_sws_getContext" >&5 $as_echo "$ac_cv_lib_swscale_sws_getContext" >&6; } -if test "x$ac_cv_lib_swscale_sws_getContext" = x""yes; then : +if test "x$ac_cv_lib_swscale_sws_getContext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSWSCALE 1 _ACEOF @@ -17273,7 +17285,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_decode_video2 in -lavcodec" >&5 $as_echo_n "checking for avcodec_decode_video2 in -lavcodec... " >&6; } -if test "${ac_cv_lib_avcodec_avcodec_decode_video2+set}" = set; then : +if ${ac_cv_lib_avcodec_avcodec_decode_video2+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17307,13 +17319,13 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_decode_video2" >&5 $as_echo "$ac_cv_lib_avcodec_avcodec_decode_video2" >&6; } -if test "x$ac_cv_lib_avcodec_avcodec_decode_video2" = x""yes; then : +if test "x$ac_cv_lib_avcodec_avcodec_decode_video2" = xyes; then : AVCODEC_DECODE_VIDEO2="-DWITH_AVCODEC_DECODE_VIDEO2" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_register_protocol2 in -lavcodec" >&5 $as_echo_n "checking for av_register_protocol2 in -lavcodec... " >&6; } -if test "${ac_cv_lib_avcodec_av_register_protocol2+set}" = set; then : +if ${ac_cv_lib_avcodec_av_register_protocol2+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -17347,7 +17359,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_av_register_protocol2" >&5 $as_echo "$ac_cv_lib_avcodec_av_register_protocol2" >&6; } -if test "x$ac_cv_lib_avcodec_av_register_protocol2" = x""yes; then : +if test "x$ac_cv_lib_avcodec_av_register_protocol2" = xyes; then : AV_REGISTER_PROTOCOL2="-DWITH_AV_REGISTER_PROTOCOL2" fi @@ -17361,7 +17373,7 @@ CFLAGS=$saved_CFLAGS # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17528,7 +17540,7 @@ VCMI_AI_LIBS_DIR="$libdir/vcmi/AI" VCMI_SCRIPTING_LIBS_DIR="$libdir/vcmi/Scripting" -ac_config_files="$ac_config_files Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/StupidAI/Makefile AI/GeniusAI/Makefile AI/EmptyAI/Makefile Scripting/ERM/Makefile" +ac_config_files="$ac_config_files Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/StupidAI/Makefile AI/EmptyAI/Makefile AI/VCAI/Makefile Scripting/ERM/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17594,10 +17606,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -17685,7 +17708,7 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -17786,6 +17809,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -18092,8 +18116,8 @@ 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.84b, which was -generated by GNU Autoconf 2.67. Invocation command line was +This file was extended by vcmi $as_me 0.87b, which was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18149,8 +18173,8 @@ _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.84b -configured by $0, generated by GNU Autoconf 2.67, +vcmi config.status 0.87b +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -18652,11 +18676,11 @@ do "server/Makefile") CONFIG_FILES="$CONFIG_FILES server/Makefile" ;; "AI/Makefile") CONFIG_FILES="$CONFIG_FILES AI/Makefile" ;; "AI/StupidAI/Makefile") CONFIG_FILES="$CONFIG_FILES AI/StupidAI/Makefile" ;; - "AI/GeniusAI/Makefile") CONFIG_FILES="$CONFIG_FILES AI/GeniusAI/Makefile" ;; "AI/EmptyAI/Makefile") CONFIG_FILES="$CONFIG_FILES AI/EmptyAI/Makefile" ;; + "AI/VCAI/Makefile") CONFIG_FILES="$CONFIG_FILES AI/VCAI/Makefile" ;; "Scripting/ERM/Makefile") CONFIG_FILES="$CONFIG_FILES Scripting/ERM/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -18678,9 +18702,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -18688,12 +18713,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -18715,7 +18741,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -18743,7 +18769,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -18791,7 +18817,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -18823,7 +18849,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -18863,7 +18889,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -18882,7 +18908,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -18891,7 +18917,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -18917,8 +18943,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -19054,21 +19080,22 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; diff --git a/configure.ac b/configure.ac index 21d6796c4..06fe2c79b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.60) -AC_INIT(vcmi, 0.84b) # Follow VCMI_VERSION in GameConstants.h +AC_INIT(vcmi, 0.87b) # Follow VCMI_VERSION in GameConstants.h AM_INIT_AUTOMAKE AC_CONFIG_MACRO_DIR([aclocal/m4]) @@ -14,6 +14,7 @@ AC_DISABLE_STATIC AC_PROG_LIBTOOL AX_COMPILER_VENDOR + # Use silent rules if supported. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -29,10 +30,13 @@ if test "x$GXX" = "xyes" -a "x$enable_debug" = "xyes" ; then CXXFLAGS="$CXXFLAGS -O0 -ggdb" fi +# For c++11 compatibility. Required at least in VCAI +CXXFLAGS="$CXXFLAGS -std=c++0x" + # For gcc and compatible compilers, enable compilation warnings, but # selectively disable some because too many are generated. if test "x$GXX" = "xyes" ; then - CXXFLAGS="$CXXFLAGS -Wall -Wno-switch -Wno-sign-compare -Wcast-align -Wpointer-arith -Wno-unknown-pragmas" + CXXFLAGS="$CXXFLAGS -Wall -Wno-switch -Wno-sign-compare -Wcast-align -Wpointer-arith" fi # extra clang parameters @@ -110,4 +114,4 @@ AC_SUBST(VCMI_AI_LIBS_DIR) VCMI_SCRIPTING_LIBS_DIR="$libdir/vcmi/Scripting" AC_SUBST(VCMI_SCRIPTING_LIBS_DIR) -AC_OUTPUT(Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/StupidAI/Makefile AI/GeniusAI/Makefile AI/EmptyAI/Makefile Scripting/ERM/Makefile) +AC_OUTPUT(Makefile lib/Makefile client/Makefile server/Makefile AI/Makefile AI/StupidAI/Makefile AI/EmptyAI/Makefile AI/VCAI/Makefile Scripting/ERM/Makefile) diff --git a/lib/CBuildingHandler.h b/lib/CBuildingHandler.h index e36f0295f..1823189ee 100644 --- a/lib/CBuildingHandler.h +++ b/lib/CBuildingHandler.h @@ -36,7 +36,8 @@ public: class DLL_LINKAGE CBuildingHandler { public: - std::vector< bmap > > buildings; ///< vector by castle ID, second the building ID (in ERM-U format) + typedef bmap > TBuildingsMap; + std::vector< TBuildingsMap > buildings; ///< vector by castle ID, second the building ID (in ERM-U format) bmap > > > > hall; //map >[5]> - external vector is the vector of buildings in the row, internal is the list of buildings for the specific slot void loadBuildings(); //main loader diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 4925cb542..428aa21fd 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -59,7 +59,7 @@ template class CApplyOnGS; class CBaseForGSApply { public: - virtual void applyOnGS(CGameState *gs, void *pack) const =0; + virtual void applyOnGS(CGameState *gs, void *pack) const =0; virtual ~CBaseForGSApply(){}; template static CBaseForGSApply *getApplier(const U * t=NULL) { @@ -107,7 +107,7 @@ public: class CObjectCallersHandler { public: - std::vector apps; + std::vector apps; template void registerType(const T * t=NULL) { @@ -161,7 +161,7 @@ void InfoAboutTown::initFromTown( const CGTownInstance *t, bool detailed ) tType = t->town; owner = t->tempOwner; - if(detailed) + if(detailed) { //include details about hero details = new Details; @@ -336,7 +336,7 @@ DLL_LINKAGE std::string MetaString::buildList () const { size_t exSt = 0, loSt = 0, nums = 0; - std::string lista; + std::string lista; for (int i = 0; i < message.size(); ++i) { if (i > 0 && (message[i] == TEXACT_STRING || message[i] == TLOCAL_STRING)) @@ -557,9 +557,9 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) case 70: //random hero return std::pair(GameConstants::HEROI_TYPE,pickHero(obj->tempOwner)); case 71: //random monster - return std::pair(54,VLC->creh->pickRandomMonster(boost::ref(ran))); + return std::pair(54,VLC->creh->pickRandomMonster(boost::ref(ran))); case 72: //random monster lvl1 - return std::pair(54,VLC->creh->pickRandomMonster(boost::ref(ran), 1)); + return std::pair(54,VLC->creh->pickRandomMonster(boost::ref(ran), 1)); case 73: //random monster lvl2 return std::pair(54,VLC->creh->pickRandomMonster(boost::ref(ran), 2)); case 74: //random monster lvl3 @@ -567,7 +567,7 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) case 75: //random monster lvl4 return std::pair(54, VLC->creh->pickRandomMonster(boost::ref(ran), 4)); case 76: //random resource - return std::pair(79,ran()%7); //now it's OH3 style, use %8 for mithril + return std::pair(79,ran()%7); //now it's OH3 style, use %8 for mithril case 77: //random town { int align = (static_cast(obj))->alignment, @@ -584,7 +584,7 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) f = scenarioOps->getIthPlayersSettings(align).castle; } if(f<0) f = ran()%VLC->townh->towns.size(); - return std::pair(GameConstants::TOWNI_TYPE,f); + return std::pair(GameConstants::TOWNI_TYPE,f); } case 162: //random monster lvl5 return std::pair(54, VLC->creh->pickRandomMonster(boost::ref(ran), 5)); @@ -627,7 +627,7 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) int cid = VLC->townh->towns[faction].basicCreatures[level]; for(ui32 i=0;iobjh->cregens.size();i++) if(VLC->objh->cregens[i]==cid) - return std::pair(17,i); + return std::pair(17,i); tlog3 << "Cannot find a dwelling for creature "<< cid << std::endl; return std::pair(17,0); delete dwl->info; @@ -667,7 +667,7 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) int cid = VLC->townh->towns[faction].basicCreatures[obj->subID]; for(ui32 i=0;iobjh->cregens.size();i++) if(VLC->objh->cregens[i]==cid) - return std::pair(17,i); + return std::pair(17,i); tlog3 << "Cannot find a dwelling for creature "<(17,0); delete dwl->info; @@ -681,9 +681,9 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) int cid = VLC->townh->towns[obj->subID].basicCreatures[level]; for(ui32 i=0;iobjh->cregens.size();i++) if(VLC->objh->cregens[i]==cid) - return std::pair(17,i); + return std::pair(17,i); tlog3 << "Cannot find a dwelling for creature "<(17,0); + return std::pair(17,0); delete dwl->info; dwl->info = NULL; } @@ -692,7 +692,7 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) } void CGameState::randomizeObject(CGObjectInstance *cur) -{ +{ std::pair ran = pickObject(cur); if(ran.first<0 || ran.second<0) //this is not a random object, or we couldn't find anything { @@ -705,7 +705,7 @@ void CGameState::randomizeObject(CGObjectInstance *cur) else if(t->hasFort()) t->defInfo = forts[t->subID]; else - t->defInfo = villages[t->subID]; + t->defInfo = villages[t->subID]; } return; } @@ -732,7 +732,7 @@ void CGameState::randomizeObject(CGObjectInstance *cur) else if(t->hasFort()) t->defInfo = forts[t->subID]; else - t->defInfo = villages[t->subID]; + t->defInfo = villages[t->subID]; t->randomizeArmy(t->subID); map->towns.push_back(t); return; @@ -769,11 +769,11 @@ int CGameState::getDate(int mode) const temp = ((day-1)/7)+1; if (!(temp%4)) return 4; - else + else return (temp%4); break; case 3: //current month - return ((day-1)/28)+1; + return ((day-1)/28)+1; break; case 4: //day of month temp = (day)%28; @@ -877,7 +877,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) static std::vector getHumanPlayerInfo(const StartInfo * si) { std::vector ret; - for(std::map::const_iterator it = si->playerInfos.begin(); + for(std::map::const_iterator it = si->playerInfos.begin(); it != si->playerInfos.end(); ++it) { if(it->second.human) @@ -887,7 +887,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) return ret; } - static void replaceHero( CGameState * gs, int objId, CGHeroInstance * ghi ) + static void replaceHero( CGameState * gs, int objId, CGHeroInstance * ghi ) { ghi->id = objId; gs->map->objects[objId] = ghi; @@ -901,7 +901,6 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) } }; - seed = Seed; ran.seed((boost::int32_t)seed); scenarioOps = new StartInfo(*si); @@ -926,13 +925,11 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) break; case StartInfo::DUEL: { - bool success = false; DuelParameters dp; try { CLoadFile lf(scenarioOps->mapname); lf >> dp; - success = true; } catch(...) {} @@ -958,7 +955,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) CGCreature *c = new CGCreature(); armies[i] = obj = c; c->subID = 34; - + } obj->initObj(); @@ -1008,7 +1005,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) std::vector allowedPos; - + // add all not blocked tiles in range for (int i = 0; i < map->width ; i++) { @@ -1017,16 +1014,16 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) for (int k = 0; k <= map->twoLevel ; k++) { const TerrainTile &t = map->terrain[i][j][k]; - if(!t.blocked - && !t.visitable - && t.tertype != TerrainTile::water + if(!t.blocked + && !t.visitable + && t.tertype != TerrainTile::water && t.tertype != TerrainTile::rock && map->grailPos.dist2d(int3(i,j,k)) <= map->grailRadious) allowedPos.push_back(int3(i,j,k)); } } } - + //remove tiles with holes for(ui32 no=0; noobjects.size(); ++no) if(map->objects[no]->ID == 124) @@ -1039,7 +1036,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) } //picking random factions for players - for(std::map::iterator it = scenarioOps->playerInfos.begin(); + for(std::map::iterator it = scenarioOps->playerInfos.begin(); it != scenarioOps->playerInfos.end(); ++it) { if(it->second.castle==-1) @@ -1072,7 +1069,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) //std::cout<<"\tRandomizing objects: "<::iterator it = scenarioOps->playerInfos.begin(); + for(std::map::iterator it = scenarioOps->playerInfos.begin(); it != scenarioOps->playerInfos.end(); ++it) { std::pair ins(it->first,PlayerState()); @@ -1214,7 +1211,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) //give start resource bonus in case of campaign if (scenarioOps->mode == StartInfo::CAMPAIGN) { - CScenarioTravel::STravelBonus chosenBonus = + CScenarioTravel::STravelBonus chosenBonus = campaign->camp->scenarios[scenarioOps->whichMapInCampaign].travelOptions.bonusesToChoose[scenarioOps->choosenCampaignBonus]; if(chosenBonus.type == 7) //resource { @@ -1299,7 +1296,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) if (scenarioOps->mode == StartInfo::CAMPAIGN) //give campaign bonuses for specific / best hero { - CScenarioTravel::STravelBonus chosenBonus = + CScenarioTravel::STravelBonus chosenBonus = campaign->camp->scenarios[scenarioOps->whichMapInCampaign].travelOptions.bonusesToChoose[scenarioOps->choosenCampaignBonus]; if (chosenBonus.isBonusForHero() && chosenBonus.info1 != 0xFFFE) //exclude generated heroes { @@ -1372,7 +1369,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) } } } - + for(std::map::iterator k=players.begin(); k!=players.end(); ++k) { //starting bonus @@ -1416,7 +1413,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) /****************************TOWNS************************************************/ for ( int i=0; i<4; i++) CGTownInstance::universitySkills.push_back(14+i);//skills for university - + for (ui32 i=0;itowns.size();i++) { CGTownInstance * vti =(map->towns[i]); @@ -1435,10 +1432,10 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) if(ran()%2) vti->builtBuildings.insert(31); } - + if (vstd::contains(vti->builtBuildings,(6)) && vti->state()==2) vti->builtBuildings.erase(6);//if we have harbor without water - erase it (this is H3 behaviour) - + //init hordes for (int i = 0; ibuiltBuildings,(-31-i))) //if we have horde for this level @@ -1457,7 +1454,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) vti->builtBuildings.insert(25); } } - + //town events BOOST_FOREACH(CCastleEvent *ev, vti->events) { @@ -1511,7 +1508,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) //campaign bonuses for towns if (scenarioOps->mode == StartInfo::CAMPAIGN) { - CScenarioTravel::STravelBonus chosenBonus = + CScenarioTravel::STravelBonus chosenBonus = campaign->camp->scenarios[scenarioOps->whichMapInCampaign].travelOptions.bonusesToChoose[scenarioOps->choosenCampaignBonus]; if (chosenBonus.type == 2) @@ -1519,14 +1516,17 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) for (int g=0; gtowns.size(); ++g) { PlayerState * owner = getPlayer(map->towns[g]->getOwner()); - PlayerInfo & pi = map->players[owner->color]; - - if (owner->human && //human-owned - map->towns[g]->pos == pi.posOfMainTown + int3(2, 0, 0)) + if (owner) { - map->towns[g]->builtBuildings.insert( - CBuildingHandler::campToERMU(chosenBonus.info1, map->towns[g]->town->typeID, map->towns[g]->builtBuildings)); - break; + PlayerInfo & pi = map->players[owner->color]; + + if (owner->human && //human-owned + map->towns[g]->pos == pi.posOfMainTown + int3(2, 0, 0)) + { + map->towns[g]->builtBuildings.insert( + CBuildingHandler::campToERMU(chosenBonus.info1, map->towns[g]->town->typeID, map->towns[g]->builtBuildings)); + break; + } } } } @@ -1551,7 +1551,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed ) //init visiting and garrisoned heroes BOOST_FOREACH(CGHeroInstance *h, k->second.heroes) - { + { BOOST_FOREACH(CGTownInstance *t, k->second.towns) { int3 vistile = t->pos; vistile.x--; //tile next to the entrance @@ -1589,8 +1589,8 @@ int CGameState::battleGetBattlefieldType(int3 tile) const std::vector > & objs = map->objects; for(int g=0; gpos.x - tile.x < 0 || objs[g]->pos.x - tile.x >= 8 - || tile.y - objs[g]->pos.y + 5 < 0 || tile.y - objs[g]->pos.y + 5 >=6 + if( !objs[g] || objs[g]->pos.x - tile.x < 0 || objs[g]->pos.x - tile.x >= 8 + || tile.y - objs[g]->pos.y + 5 < 0 || tile.y - objs[g]->pos.y + 5 >=6 || !objs[g]->coveringAt(objs[g]->pos.x - tile.x, tile.y - objs[g]->pos.y + 5) ) //look only for objects covering given tile continue; @@ -1701,7 +1701,7 @@ UpgradeInfo CGameState::getUpgradeInfo(const CStackInstance &stack) } //hero is visiting Hill Fort - if(h && map->getTile(h->visitablePos()).visitableObjects.front()->ID == 35) + if(h && map->getTile(h->visitablePos()).visitableObjects.front()->ID == 35) { static const int costModifiers[] = {0, 25, 50, 75, 100}; //we get cheaper upgrades depending on level const int costModifier = costModifiers[std::min(std::max((int)base->level - 1, 0), ARRAY_COUNT(costModifiers) - 1)]; @@ -1724,7 +1724,7 @@ int CGameState::getPlayerRelations( ui8 color1, ui8 color2 ) if ( color1 == color2 ) return 2; if(color1 == 255 || color2 == 255) //neutral player has no friends - return 0; + return 0; const TeamState * ts = getPlayerTeam(color1); if (ts && vstd::contains(ts->players, color2)) @@ -1752,7 +1752,7 @@ void CGameState::loadTownDInfos() capitols[i] = new CGDefInfo(*VLC->dobjinfo->castles[i]); capitols[i]->name = t["capitol"].String(); map->defy.push_back(capitols[i]); - + ++i; } } @@ -1765,7 +1765,7 @@ void CGameState::getNeighbours(const TerrainTile &srct, int3 tile, std::vectorisInTheMap(hlp)) + if(!map->isInTheMap(hlp)) continue; const TerrainTile &hlpt = map->getTile(hlp); @@ -1787,8 +1787,8 @@ void CGameState::getNeighbours(const TerrainTile &srct, int3 tile, std::vectorisInTheMap(pos)) return int3(-1, -1, -1); const TerrainTile &posTile = map->terrain[pos.x][pos.y][pos.z]; - if (posTile.visitable) + if (posTile.visitable) { - BOOST_FOREACH (CGObjectInstance* obj, posTile.visitableObjects) + BOOST_FOREACH (CGObjectInstance* obj, posTile.visitableObjects) { if(obj->blockVisit) { @@ -1902,19 +1902,19 @@ int3 CGameState::guardingCreaturePosition (int3 pos) const // See if there are any monsters adjacent. pos -= int3(1, 1, 0); // Start with top left. - for (int dx = 0; dx < 3; dx++) + for (int dx = 0; dx < 3; dx++) { - for (int dy = 0; dy < 3; dy++) + for (int dy = 0; dy < 3; dy++) { - if (map->isInTheMap(pos)) + if (map->isInTheMap(pos)) { TerrainTile &tile = map->terrain[pos.x][pos.y][pos.z]; - if (tile.visitable && (tile.tertype == TerrainTile::water) == (posTile.tertype == TerrainTile::water)) + if (tile.visitable && (tile.tertype == TerrainTile::water) == (posTile.tertype == TerrainTile::water)) { - BOOST_FOREACH (CGObjectInstance* obj, tile.visitableObjects) + BOOST_FOREACH (CGObjectInstance* obj, tile.visitableObjects) { if (obj->ID == 54 && checkForVisitableDir(pos, &map->getTile(originalPos), originalPos)) // Monster being able to attack investigated tile - { + { return pos; } } @@ -1950,8 +1950,8 @@ bool CGameState::isVisible( const CGObjectInstance *obj, int player ) for(int fy=0; fy<6; ++fy) { int3 pos = obj->pos + int3(fx-7,fy-5,0); - if(map->isInTheMap(pos) - && !((obj->defInfo->blockMap[fy] >> (7 - fx)) & 1) + if(map->isInTheMap(pos) + && !((obj->defInfo->blockMap[fy] >> (7 - fx)) & 1) && isVisible(pos, player) ) return true; } @@ -2044,7 +2044,7 @@ int CGameState::victoryCheck( ui8 player ) const for(size_t i = 0; i < map->objects.size(); i++) { const CArmedInstance *ai = NULL; - if(map->objects[i] + if(map->objects[i] && map->objects[i]->tempOwner == player //object controlled by player && (ai = dynamic_cast(map->objects[i].get()))) //contains army { @@ -2076,7 +2076,7 @@ int CGameState::victoryCheck( ui8 player ) const case EVictoryConditionType::BUILDGRAIL: BOOST_FOREACH(const CGTownInstance *t, map->towns) if((t == map->victoryCondition.obj || !map->victoryCondition.obj) - && t->tempOwner == player + && t->tempOwner == player && vstd::contains(t->builtBuildings, 26)) return 1; break; @@ -2149,7 +2149,7 @@ ui8 CGameState::checkForStandardWin() const { if(i->second.status == PlayerState::INGAME && i->first < GameConstants::PLAYER_LIMIT) { - if(supposedWinner == 255) + if(supposedWinner == 255) { //first player remaining ingame - candidate for victory supposedWinner = i->second.color; @@ -2262,7 +2262,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level) if(g->second.color != 255) tgi.playerColors.push_back(g->second.color); } - + if(level >= 1) //num of towns & num of heroes { //num of towns @@ -2327,7 +2327,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level) { tgi.personality[g->second.color] = map->players[g->second.color].AITactic; } - + } } if(level >= 10) //best creature @@ -2421,7 +2421,7 @@ void CGameState::buildBonusSystemTree() { t->deserializationFix(); } - // CStackInstance <-> CCreature, CStackInstance <-> CArmedInstance, CArtifactInstance <-> CArtifact + // CStackInstance <-> CCreature, CStackInstance <-> CArmedInstance, CArtifactInstance <-> CArtifact // are provided on initializing / deserializing } @@ -2559,8 +2559,8 @@ void CGPath::convert( ui8 mode ) } } -PlayerState::PlayerState() - : color(-1), currentSelection(0xffffffff), enteredWinningCheatCode(0), +PlayerState::PlayerState() + : color(-1), currentSelection(0xffffffff), enteredWinningCheatCode(0), enteredLosingCheatCode(0), status(INGAME), daysWithoutCastle(0) { setNodeType(PLAYER); @@ -2575,7 +2575,7 @@ std::string PlayerState::nodeName() const // { // return; //no loops possible // } -// +// // void PlayerState::getBonuses(BonusList &out, const CSelector &selector, const CBonusSystemNode *root /*= NULL*/) const // { // for (std::vector::const_iterator it = heroes.begin(); it != heroes.end(); it++) @@ -2612,7 +2612,7 @@ void InfoAboutHero::initFromHero( const CGHeroInstance *h, bool detailed ) portrait = h->portrait; army = ArmyDescriptor(h, detailed); - if(detailed) + if(detailed) { //include details about hero details = new Details; @@ -2857,7 +2857,7 @@ void CPathfinder::calculatePaths(int3 src /*= int3(-1,-1,-1)*/, int movement /*= dp->turns = turnAtNextTile; dp->theNodeBefore = cp; - const bool guardedDst = guardingCreaturePosition(dp->coord) != int3(-1, -1, -1) + const bool guardedDst = guardingCreaturePosition(dp->coord) != int3(-1, -1, -1) && dp->accessible == CGPathNode::BLOCKVIS; if (dp->accessible == CGPathNode::ACCESSIBLE @@ -2898,7 +2898,7 @@ CGPathNode::EAccessibility CPathfinder::evaluateAccessibility(const TerrainTile if(tinfo->tertype == TerrainTile::rock || !FoW[curPos.x][curPos.y][curPos.z]) return CGPathNode::BLOCKED; - + if(tinfo->visitable) { if(tinfo->visitableObjects.front()->ID == 80 && tinfo->visitableObjects.back()->ID == GameConstants::HEROI_TYPE && tinfo->visitableObjects.back()->tempOwner != hero->tempOwner) //non-owned hero stands on Sanctuary @@ -2941,20 +2941,20 @@ bool CPathfinder::goodForLandSeaTransition() if(cp->land) //from land to sea -> embark or assault hero on boat { if(dp->accessible == CGPathNode::ACCESSIBLE || destTopVisObjID < 0) //cannot enter empty water tile from land -> it has to be visitable - return false; + return false; if(destTopVisObjID != GameConstants::HEROI_TYPE && destTopVisObjID != GameConstants::BOATI_TYPE) //only boat or hero can be accessed from land return false; if(destTopVisObjID == GameConstants::BOATI_TYPE) - useEmbarkCost = 1; + useEmbarkCost = 1; } else //disembark { //can disembark only on coastal tiles - if(!dt->isCoastal()) + if(!dt->isCoastal()) return false; //tile must be accessible -> exception: unblocked blockvis tiles -> clear but guarded by nearby monster coast - if(dp->accessible != CGPathNode::ACCESSIBLE && (dp->accessible != CGPathNode::BLOCKVIS || dt->blocked) + if( (dp->accessible != CGPathNode::ACCESSIBLE && (dp->accessible != CGPathNode::BLOCKVIS || dt->blocked)) || dt->visitable) //TODO: passableness problem -> town says it's passable (thus accessible) but we obviously can't disembark onto town gate return false;; @@ -2962,7 +2962,7 @@ bool CPathfinder::goodForLandSeaTransition() } } - return true; + return true; } CPathfinder::CPathfinder(CPathsInfo &_out, CGameState *_gs, const CGHeroInstance *_hero) : CGameInfoCallback(_gs, -1), out(_out), hero(_hero), FoW(getPlayerTeam(hero->tempOwner)->fogOfWarMap) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 501a1eaa7..fa174c7d5 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -1273,32 +1273,14 @@ void CGameHandler::run(bool resume) { static time_duration p = milliseconds(200); states.cv.timed_wait(lock,p); + } } } - while(conns.size() && (*conns.begin())->isOpen()) boost::this_thread::sleep(boost::posix_time::milliseconds(5)); //give time client to close socket } -//namespace CGH -//{ -// using namespace std; -// static void readItTo(ifstream & input, vector< vector > & dest) //reads 7 lines, i-th one containing i integers, and puts it to dest -// { -// for(int j=0; j<7; ++j) -// { -// std::vector pom; -// for(int g=0; g>hlp; -// pom.push_back(hlp); -// } -// dest.push_back(pom); -// } -// } -//} - void CGameHandler::setupBattle( int3 tile, const CArmedInstance *armies[2], const CGHeroInstance *heroes[2], bool creatureBank, const CGTownInstance *town ) { battleResult.set(NULL); @@ -3437,6 +3419,21 @@ void CGameHandler::playerMessage( ui8 player, const std::string &message ) sendAndApply(&cs); sendAndApply(&sm); } + else if (message == "vcmiarmenelos") //build all buildings in selected town + { + CGTownInstance *town = gs->getTown(gs->getPlayer(player)->currentSelection); + if (town) + { + BOOST_FOREACH (CBuildingHandler::TBuildingsMap::value_type &build, VLC->buildh->buildings[town->subID]) + { + if (!vstd::contains(town->builtBuildings, build.first) + && !build.second->Name().empty()) + { + buildStructure(town->id, build.first, true); + } + } + } + } else if(message == "vcmiainur") //gives 5 archangels into each slot { CGHeroInstance *hero = gs->getHero(gs->getPlayer(player)->currentSelection); @@ -3512,12 +3509,10 @@ void CGameHandler::playerMessage( ui8 player, const std::string &message ) else if(message == "vcmisilmaril") //player wins { gs->getPlayer(player)->enteredWinningCheatCode = 1; - checkLossVictory(player); } else if(message == "vcmimelkor") //player looses { gs->getPlayer(player)->enteredLosingCheatCode = 1; - checkLossVictory(player); } else if (message == "vcmiforgeofnoldorking") //hero gets all artifacts except war machines, spell scrolls and spell book { @@ -3532,6 +3527,7 @@ void CGameHandler::playerMessage( ui8 player, const std::string &message ) { SystemMessage temp_message(VLC->generaltexth->allTexts[260]); sendAndApply(&temp_message); + checkLossVictory(player);//Player enter win code or got required art\creature } } @@ -4484,6 +4480,7 @@ void CGameHandler::engageIntoBattle( ui8 player ) void CGameHandler::winLoseHandle(ui8 players ) { + for(size_t i = 0; i < GameConstants::PLAYER_LIMIT; i++) { if(players & 1<getPlayer(i)) @@ -4505,10 +4502,10 @@ void CGameHandler::checkLossVictory( ui8 player ) if(!loss && !vic) return; + InfoWindow iw; getLossVicMessage(player, vic ? vic : loss , vic, iw); sendAndApply(&iw); - PlayerEndsGame peg; peg.player = player; peg.victory = vic; @@ -4545,28 +4542,28 @@ void CGameHandler::checkLossVictory( ui8 player ) //eliminating one player may cause victory of another: winLoseHandle(GameConstants::ALL_PLAYERS & ~(1<campaign) - { + { std::vector hes; BOOST_FOREACH(CGHeroInstance * ghi, gs->map->heroes) - { + { if (ghi->tempOwner == vic) - { + { hes.push_back(ghi); - } } + } gs->campaign->mapConquered(hes); UpdateCampaignState ucs; ucs.camp = gs->campaign; sendAndApply(&ucs); - } + } } }