From cc64e6cc8e9548dafc268af825638b82a52842ae Mon Sep 17 00:00:00 2001 From: Tom Reynolds Date: Wed, 12 Feb 2014 00:55:29 +0100 Subject: [PATCH 001/258] fix detection for CXX=clang --- mk/linux/build-mg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/linux/build-mg.sh b/mk/linux/build-mg.sh index 726fe734..174e355f 100755 --- a/mk/linux/build-mg.sh +++ b/mk/linux/build-mg.sh @@ -174,12 +174,12 @@ if [ $CLANG_FORCED = 1 ]; then # If both the $CC and $CXX environment variable point to something containing # "clang", use whatever these environment variables point to. elif [ "`echo $CC | grep -oF 'clang'`" = 'clang' -a "`echo $CXX | grep -oF 'clang'`" = 'clang' ]; then - if [ `echo $CC | grep -Fq '/'` = '/' ]; then + if [ "`echo $CC | grep -Fo '/'`" = '/' ]; then CLANG_CC=$CC else CLANG_CC=`which $CC` fi - if [ `echo $CXX | grep -Fq '/'` = '/' ]; then + if [ "`echo $CXX | grep -Fo '/'`" = '/' ]; then CLANG_CXX=$CXX else CLANG_CXX=`which $CXX` From 32d68d664298e7dc71f619b40a442d09d3c104af Mon Sep 17 00:00:00 2001 From: Tom Reynolds Date: Wed, 12 Feb 2014 08:45:01 +0100 Subject: [PATCH 002/258] travis: for now, clang build result should not impact overall build result --- .travis.yml | 16 +++++++++++++++- data/glest_game | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5a7c70f4..fbdb8c30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,33 @@ # http://docs.travis-ci.com/user/build-configuration/ language: cpp + compiler: - gcc - clang + +matrix: + include: + - compiler: gcc + - compiler: clang + allow_failures: + - compiler: clang + git: submodules: false + #branches: # only: # - master + before_install: - sudo apt-get update -qq # UPDATE REPOS - - sudo mk/linux/setupBuildDeps.sh --quiet # INSTALL DEPENDENCIES HERE + - sudo apt-get upgrade -qq # UPGRADE SYSTEM TO LATEST PATCH LEVEL + - sudo mk/linux/setupBuildDeps.sh --quiet # INSTALL OUR DEPENDENCIES + script: # ALL THE BUILD COMMANDS HERE - mk/linux/build-mg.sh -c 4 + notifications: irc: channels: diff --git a/data/glest_game b/data/glest_game index 72f44c67..c52a68f1 160000 --- a/data/glest_game +++ b/data/glest_game @@ -1 +1 @@ -Subproject commit 72f44c6742b2d18e1fd1220377c33b1d8ba58d1f +Subproject commit c52a68f135fe95ba73b3b22ddb43ec2cb4e0350d From 7ce54766696a905e6d84d474f8329430494d48a6 Mon Sep 17 00:00:00 2001 From: Tom Reynolds Date: Wed, 12 Feb 2014 22:39:55 +0100 Subject: [PATCH 003/258] hopefully this gives us just two travis builds (not 4) --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fbdb8c30..6280a0ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,9 @@ compiler: - clang matrix: - include: - - compiler: gcc - - compiler: clang + #include: + # - compiler: gcc + # - compiler: clang allow_failures: - compiler: clang From d348edc634a3911d94a80f931f40540bec26f932 Mon Sep 17 00:00:00 2001 From: Tom Reynolds Date: Sat, 15 Feb 2014 02:38:42 +0100 Subject: [PATCH 004/258] build-mg.sh: no more warning when clang is not installed [ci skip] --- mk/linux/build-mg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/linux/build-mg.sh b/mk/linux/build-mg.sh index 174e355f..f785c43f 100755 --- a/mk/linux/build-mg.sh +++ b/mk/linux/build-mg.sh @@ -85,8 +85,8 @@ done # 1. Install clang (sudo apt-get install clang) # 2. Set the two vars below: # WANT_CLANG=YES and CLANG_BIN_PATH= -CLANG_BIN_PATH=$( which clang ) -CLANGPP_BIN_PATH=$( which clang++ ) +CLANG_BIN_PATH=$( which clang 2>/dev/null ) +CLANGPP_BIN_PATH=$( which clang++ 2>/dev/null ) cd ${SCRIPTDIR} From 31a6a84c939707b1dad1f5adff8bc9fb139a652e Mon Sep 17 00:00:00 2001 From: Tom Reynolds Date: Thu, 27 Feb 2014 03:22:36 +0100 Subject: [PATCH 005/258] travis: don't apt-get upgrade build node --- .travis.yml | 3 ++- data/glest_game | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6280a0ae..20735e38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,8 @@ git: before_install: - sudo apt-get update -qq # UPDATE REPOS - - sudo apt-get upgrade -qq # UPGRADE SYSTEM TO LATEST PATCH LEVEL + #- sudo apt-get upgrade -qq # UPGRADE SYSTEM TO LATEST PATCH LEVEL + - sudo apt-get install -y -qq - sudo mk/linux/setupBuildDeps.sh --quiet # INSTALL OUR DEPENDENCIES script: diff --git a/data/glest_game b/data/glest_game index c52a68f1..368b27fa 160000 --- a/data/glest_game +++ b/data/glest_game @@ -1 +1 @@ -Subproject commit c52a68f135fe95ba73b3b22ddb43ec2cb4e0350d +Subproject commit 368b27fa59f1b5804b4f166168f0f6645ce5fe8d From cf53540438562aed56bb0e9f9877f0437512f897 Mon Sep 17 00:00:00 2001 From: Tom Reynolds Date: Sun, 16 Mar 2014 06:13:31 +0100 Subject: [PATCH 006/258] Windows: delete Release\*.tlog before building --- data/glest_game | 2 +- mk/windoze/build-mg-2010.bat | 6 ++++-- mk/windoze/build-mg-2012.bat | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/data/glest_game b/data/glest_game index 368b27fa..cfb41238 160000 --- a/data/glest_game +++ b/data/glest_game @@ -1 +1 @@ -Subproject commit 368b27fa59f1b5804b4f166168f0f6645ce5fe8d +Subproject commit cfb41238ad446318b6dda34adba700194a5037c6 diff --git a/mk/windoze/build-mg-2010.bat b/mk/windoze/build-mg-2010.bat index 6598f76e..1ad686cb 100644 --- a/mk/windoze/build-mg-2010.bat +++ b/mk/windoze/build-mg-2010.bat @@ -93,16 +93,18 @@ copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, rem Build Mega-Glest in release mode ECHO -------------------------------- -Echo Building Mega-Glest using Visual Studio 2010... +Echo Building MegaGlest using Visual Studio 2010... set CL= del ..\..\source\glest_game\facilities\gitversion.h if not "%GITVERSION_SHA1%" == "." set CL=/DGITVERSIONHEADER -if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%] +if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%] if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, +del Release\*.tlog + set msBuildMaxCPU= SET BuildInParallel=false SET BuildInParallelCount= diff --git a/mk/windoze/build-mg-2012.bat b/mk/windoze/build-mg-2012.bat index 38508717..eec4d4f6 100644 --- a/mk/windoze/build-mg-2012.bat +++ b/mk/windoze/build-mg-2012.bat @@ -117,7 +117,7 @@ copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, rem Build Mega-Glest in release mode ECHO -------------------------------- -Echo Building Mega-Glest using Visual Studio 2012... +Echo Building MegaGlest using Visual Studio 2012... set CL=/MP rem set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE% @@ -138,10 +138,12 @@ rem set PlatformToolset=V110 del ..\..\source\glest_game\facilities\gitversion.h if not "%GITVERSION_SHA1%" == "." set CL=/DGITVERSIONHEADER -if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%] +if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%] if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, +del Release\*.tlog + rem set VisualStudioVersion=11.0 set msBuildMaxCPU= SET BuildInParallel=false From fa0a8ac9e77c43e55b9f8445d897d51dbec5fd31 Mon Sep 17 00:00:00 2001 From: Tom Reynolds Date: Sun, 16 Mar 2014 06:16:24 +0100 Subject: [PATCH 007/258] No prompt for file removal --- mk/windoze/build-mg-2010.bat | 2 +- mk/windoze/build-mg-2012.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/windoze/build-mg-2010.bat b/mk/windoze/build-mg-2010.bat index 1ad686cb..71c6be2f 100644 --- a/mk/windoze/build-mg-2010.bat +++ b/mk/windoze/build-mg-2010.bat @@ -103,7 +103,7 @@ if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%] if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, -del Release\*.tlog +del /Q /F Release\*.tlog set msBuildMaxCPU= SET BuildInParallel=false diff --git a/mk/windoze/build-mg-2012.bat b/mk/windoze/build-mg-2012.bat index eec4d4f6..1cddc605 100644 --- a/mk/windoze/build-mg-2012.bat +++ b/mk/windoze/build-mg-2012.bat @@ -142,7 +142,7 @@ if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%] if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,, -del Release\*.tlog +del /Q /F Release\*.tlog rem set VisualStudioVersion=11.0 set msBuildMaxCPU= From c190c2eabb8c2591b8c05734ae95233fe1f586c8 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Wed, 26 Mar 2014 10:26:53 +0800 Subject: [PATCH 008/258] Also support -DCMAKE_BUILD_TYPE=None which is used by Debian Fixes: https://bugs.debian.org/739068 --- CMakeLists.txt | 9 ++++++++- source/glest_game/CMakeLists.txt | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48e4beaa..77b67e44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,9 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) message(STATUS "**WARNING DID NOT Find GCC backtrace lib") ENDIF() + # Default compiler flags + SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE}") + # Debug compiler flags SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3") @@ -280,6 +283,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) MESSAGE(STATUS "*NOTE: Custom Data Install Path is [${CUSTOM_DATA_INSTALL_PATH}]") ENDIF() + SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") @@ -287,12 +291,15 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) # We do some funky character escaping to get the right stuff written out to # the final Makefile so we get the GIT Global Revsion # + string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE}") string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}") - IF( CMAKE_BUILD_TYPE STREQUAL Debug ) + IF( CMAKE_BUILD_TYPE STREQUAL None ) + message("CMAKE_CXX_FLAGS_NONE: ${CMAKE_CXX_FLAGS_NONE}") + ELSEIF( CMAKE_BUILD_TYPE STREQUAL Debug ) message("CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}") ELSEIF( CMAKE_BUILD_TYPE STREQUAL Release ) message("CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}") diff --git a/source/glest_game/CMakeLists.txt b/source/glest_game/CMakeLists.txt index 1c94df63..eabc8665 100644 --- a/source/glest_game/CMakeLists.txt +++ b/source/glest_game/CMakeLists.txt @@ -208,6 +208,7 @@ IF(BUILD_MEGAGLEST) ENDIF() IF(WIN32) + SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE} -Wl,-subsystem,console -mconsole") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wl,-subsystem,console -mconsole") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-subsystem,console -mconsole") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wl,-subsystem,console -mconsole") From 4ea86ae90ff58a55ea558017f366c68788f48510 Mon Sep 17 00:00:00 2001 From: Christoph Korn Date: Tue, 22 Apr 2014 22:44:23 +0200 Subject: [PATCH 009/258] Pass the custom data install path to the compiler The CUSTOM_DATA_INSTALL_PATH constant is checked at different places in the code but was not actually passed to the compiler. This resulted in searching the data files in /usr/games instead of /usr/share/games/megaglest (in Ubuntu and Debian). This commit also fixes setting the variable. It is still wrong for Apple I think. But I can not test it. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 77b67e44..7e68cb97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,10 +272,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) IF(APPLE) SET(CUSTOM_DATA_INSTALL_PATH "'\\\\'${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_DATA_INSTALL_PATH}\\\\''" CACHE STRING "The FULL installation path for data files (this is build automatically by combining CMAKE_INSTALL_PREFIX and MEGAGLEST_DATA_INSTALL_PATH)") ELSE() - SET(CUSTOM_DATA_INSTALL_PATH "'\\\"${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_DATA_INSTALL_PATH}\\\"'" CACHE STRING "The FULL installation path for data files (this is build automatically by combining CMAKE_INSTALL_PREFIX and MEGAGLEST_DATA_INSTALL_PATH)") + SET(CUSTOM_DATA_INSTALL_PATH "\"${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_DATA_INSTALL_PATH}\"" CACHE STRING "The FULL installation path for data files (this is build automatically by combining CMAKE_INSTALL_PREFIX and MEGAGLEST_DATA_INSTALL_PATH)") ENDIF() ENDIF() SET(CUSTOM_DATA_INSTALL_PATH_VALUE "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}") + ADD_DEFINITIONS("-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}") SET(PKG_DATADIR ${CUSTOM_DATA_INSTALL_PATH_VALUE}) SET(PKG_BINDIR ${MEGAGLEST_BIN_INSTALL_PATH}) From cac1cc3e6efa17576b6d1ef92cf664b95f3ba085 Mon Sep 17 00:00:00 2001 From: alketii Date: Fri, 23 May 2014 22:43:36 +0200 Subject: [PATCH 010/258] Disabled button in lobby which holds players name. --- source/glest_game/menu/menu_state_masterserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index c6e1da1d..f6110812 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -857,7 +857,7 @@ void MenuStateMasterserver::update() { button->setFont(CoreData::getInstance().getDisplayFontSmall()); button->setFont3D(CoreData::getInstance().getDisplayFontSmall3D()); button->setText(nickList[i]); - if(strncmp(&nickList[i][0],"MG_",3) != 0) { + if(strncmp(&nickList[i][0],"MG_",3) != 0 || &nickList[i][0] == currentIrcNick) { button->setEnabled(false); button->setEditable(false); button->setCustomTexture(CoreData::getInstance().getCustomTexture()); From 04d2664b06b73f05eb3aa1c60d924333af3bb712 Mon Sep 17 00:00:00 2001 From: FreshDumbledore Date: Wed, 18 Jun 2014 22:00:50 +0200 Subject: [PATCH 011/258] optional start-ep tag implemented --- source/glest_game/type_instances/unit.cpp | 4 ++++ source/glest_game/types/unit_type.cpp | 10 ++++++++++ source/glest_game/types/unit_type.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 728d7fed..7042c4ee 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1958,6 +1958,10 @@ void Unit::born(const CommandType *ct) { //printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__); } addItemToVault(&this->hp,this->hp); + + //set ep from start-ep tag + checkItemInVault(&this->ep,this->ep); + this->ep= type->getStartEp(); } void Unit::kill() { diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 846a4a9e..4b1ab292 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -126,6 +126,7 @@ UnitType::UnitType() : ProducibleType() { maxUnitCount= 0; maxHp=0; maxEp=0; + startEp=0; armor=0; sight=0; size=0; @@ -247,6 +248,14 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } addItemToVault(&(this->epRegeneration),this->epRegeneration); + //startEp + + if(parametersNode->hasChild("start-ep")) { + //checkItemInVault(&(this->startEp),this->startEp); + startEp= parametersNode->getChild("start-ep")->getAttribute("value")->getIntValue(); + } + addItemToVault(&(this->startEp),this->startEp); + //maxUnitCount if(parametersNode->hasChild("max-unit-count")) { //checkItemInVault(&(this->maxUnitCount),this->maxUnitCount); @@ -1100,6 +1109,7 @@ std::string UnitType::toString() const { result += " maxHp = " + intToStr(maxHp); result += " hpRegeneration = " + intToStr(hpRegeneration); result += " maxEp = " + intToStr(maxEp); + result += " startEp = " + intToStr(maxEp); result += " epRegeneration = " + intToStr(epRegeneration); result += " maxUnitCount = " + intToStr(getMaxUnitCount()); diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index 2f437527..ee23d111 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -106,6 +106,7 @@ private: int maxHp; int hpRegeneration; int maxEp; + int startEp; int epRegeneration; int maxUnitCount; @@ -180,6 +181,7 @@ public: inline int getHpRegeneration() const {return hpRegeneration;} inline int getMaxEp() const {return maxEp;} inline int getEpRegeneration() const {return epRegeneration;} + inline int getStartEp() const {return startEp;} inline int getMaxUnitCount() const {return maxUnitCount;} inline bool getField(Field field) const {return fields[field];} inline Field getField() const {return field;} From 202fcd7cad50fc193acd41c4c916aedfb6b66b6c Mon Sep 17 00:00:00 2001 From: FreshDumbledore Date: Wed, 18 Jun 2014 22:50:07 +0200 Subject: [PATCH 012/258] fixed an unimported copy&paste tag :) had no influence afaik but still better like this --- source/glest_game/types/unit_type.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 4b1ab292..5eac779e 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -1109,7 +1109,7 @@ std::string UnitType::toString() const { result += " maxHp = " + intToStr(maxHp); result += " hpRegeneration = " + intToStr(hpRegeneration); result += " maxEp = " + intToStr(maxEp); - result += " startEp = " + intToStr(maxEp); + result += " startEp = " + intToStr(startEp); result += " epRegeneration = " + intToStr(epRegeneration); result += " maxUnitCount = " + intToStr(getMaxUnitCount()); From a5e8e6df02172d6e0f9ea61ec1d7599ab351e5f2 Mon Sep 17 00:00:00 2001 From: FreshDumbledore Date: Wed, 9 Jul 2014 19:59:09 +0200 Subject: [PATCH 013/258] testing version of multiple projectiles --- source/glest_game/types/skill_type.cpp | 21 +++++++++++++++++++++ source/glest_game/types/skill_type.h | 2 ++ source/glest_game/world/unit_updater.cpp | 21 +++++++++++---------- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 7a72c5ce..75fbd499 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -895,8 +895,29 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, projectileParticleSystemType->load(particleNode, dir, currentPath + path, &Renderer::getInstance(), loadedFileList, parentLoader, tt->getPath()); + loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); + projectileParticleSystemTypes.push_back(projectileParticleSystemType); } + //extra projectiles + if(projectileNode->hasChild("particles")){ + const XmlNode *extraParticlesNode= projectileNode->getChild("particles"); + bool extraParticlesEnabled= extraParticlesNode->getAttribute("value")->getBoolValue(); + if(extraParticlesEnabled){ + for(int i = 0; i < (int)extraParticlesNode->getChildCount(); ++i) { + const XmlNode *extraParticleFileNode= extraParticlesNode->getChild("particle-file", i); + string path= extraParticleFileNode->getAttribute("path")->getRestrictedValue(); + projectileParticleSystemType= new ParticleSystemTypeProjectile(); + projectileParticleSystemType->load(extraParticleFileNode, dir, currentPath + path, + &Renderer::getInstance(), loadedFileList, parentLoader, + tt->getPath()); + loadedFileList[currentPath + path].push_back(make_pair(parentLoader,extraParticleFileNode->getAttribute("path")->getRestrictedValue())); + projectileParticleSystemTypes.push_back(projectileParticleSystemType); + } + } + } + + //proj sounds const XmlNode *soundNode= projectileNode->getChild("sound"); if(soundNode->getAttribute("enabled")->getBoolValue()){ diff --git a/source/glest_game/types/skill_type.h b/source/glest_game/types/skill_type.h index 75db79b7..6b1853e5 100644 --- a/source/glest_game/types/skill_type.h +++ b/source/glest_game/types/skill_type.h @@ -74,6 +74,7 @@ enum SkillClass{ }; typedef list UnitParticleSystemTypes; +typedef list ProjectileParticleSystemTypes; // ===================================================== // class SkillType // @@ -172,6 +173,7 @@ protected: public: UnitParticleSystemTypes unitParticleSystemTypes; + ProjectileParticleSystemTypes projectileParticleSystemTypes; public: //varios diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index de9d6560..bdea2950 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2615,23 +2615,24 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ visible = true; } - //projectile - if(pstProj != NULL) { - psProj= pstProj->create(unit); + + for(ProjectileParticleSystemTypes::const_iterator pit= unit->getCurrSkill()->projectileParticleSystemTypes.begin(); pit != unit->getCurrSkill()->projectileParticleSystemTypes.end(); ++pit) { + psProj= (*pit)->create(unit); psProj->setPath(startPos, endPos); psProj->setObserver(new ParticleDamager(unit, this, gameCamera)); psProj->setVisible(visible); - if(unit->getFaction()->getTexture()) { - psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); - } - renderer.manageParticleSystem(psProj, rsGame); - unit->addAttackParticleSystem(psProj); + if(unit->getFaction()->getTexture()) { + psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + } + renderer.manageParticleSystem(psProj, rsGame); + unit->addAttackParticleSystem(psProj); } - else { + + // if no projectile, still deal damage.. + if(pstProj == NULL) { char szBuf[8096]=""; snprintf(szBuf,8095,"Unit hitting [startAttackParticleSystem] no proj"); unit->addNetworkCRCDecHp(szBuf); - hit(unit); } From dff810a5b1b6fd10f413f4c04aa3ca8e5c808951 Mon Sep 17 00:00:00 2001 From: titiger Date: Thu, 10 Jul 2014 23:34:39 +0200 Subject: [PATCH 014/258] multishot with more than one attack particle system --- source/glest_game/types/skill_type.cpp | 36 +++++++++++++----------- source/glest_game/types/skill_type.h | 4 +-- source/glest_game/world/unit_updater.cpp | 3 +- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 75fbd499..e939b243 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -806,7 +806,6 @@ AttackSkillType::AttackSkillType() { splashRadius= 0; spawnUnit=""; spawnUnitcount=0; - projectileParticleSystemType= NULL; splashParticleSystemType= NULL; for(int i = 0; i < fieldCount; ++i) { @@ -821,8 +820,8 @@ AttackSkillType::AttackSkillType() { } AttackSkillType::~AttackSkillType() { - delete projectileParticleSystemType; - projectileParticleSystemType = NULL; + + deleteValues(projectileParticleSystemTypes.begin(), projectileParticleSystemTypes.end()); delete splashParticleSystemType; splashParticleSystemType = NULL; @@ -887,16 +886,18 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, if(projectile){ //proj particle - const XmlNode *particleNode= projectileNode->getChild("particle"); - bool particleEnabled= particleNode->getAttribute("value")->getBoolValue(); - if(particleEnabled){ - string path= particleNode->getAttribute("path")->getRestrictedValue(); - projectileParticleSystemType= new ParticleSystemTypeProjectile(); - projectileParticleSystemType->load(particleNode, dir, currentPath + path, - &Renderer::getInstance(), loadedFileList, parentLoader, - tt->getPath()); - loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); - projectileParticleSystemTypes.push_back(projectileParticleSystemType); + if(projectileNode->hasChild("particle")){ + const XmlNode *particleNode= projectileNode->getChild("particle"); + bool particleEnabled= particleNode->getAttribute("value")->getBoolValue(); + if(particleEnabled){ + string path= particleNode->getAttribute("path")->getRestrictedValue(); + ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); + projectileParticleSystemType->load(particleNode, dir, currentPath + path, + &Renderer::getInstance(), loadedFileList, parentLoader, + tt->getPath()); + loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); + projectileParticleSystemTypes.push_back(projectileParticleSystemType); + } } //extra projectiles @@ -907,7 +908,7 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, for(int i = 0; i < (int)extraParticlesNode->getChildCount(); ++i) { const XmlNode *extraParticleFileNode= extraParticlesNode->getChild("particle-file", i); string path= extraParticleFileNode->getAttribute("path")->getRestrictedValue(); - projectileParticleSystemType= new ParticleSystemTypeProjectile(); + ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); projectileParticleSystemType->load(extraParticleFileNode, dir, currentPath + path, &Renderer::getInstance(), loadedFileList, parentLoader, tt->getPath()); @@ -1007,9 +1008,10 @@ void AttackSkillType::saveGame(XmlNode *rootNode) { // bool projectile; attackSkillTypeNode->addAttribute("projectile",intToStr(projectile), mapTagReplacements); // ParticleSystemTypeProjectile* projectileParticleSystemType; - if(projectileParticleSystemType != NULL) { - projectileParticleSystemType->saveGame(attackSkillTypeNode); - } +// save a skill_type ???? + // if(projectileParticleSystemType != NULL) { +// projectileParticleSystemType->saveGame(attackSkillTypeNode); +// } // SoundContainer projSounds; // // bool splash; diff --git a/source/glest_game/types/skill_type.h b/source/glest_game/types/skill_type.h index 6b1853e5..e0b79ce7 100644 --- a/source/glest_game/types/skill_type.h +++ b/source/glest_game/types/skill_type.h @@ -271,7 +271,7 @@ private: string spawnUnit; int spawnUnitcount; bool projectile; - ParticleSystemTypeProjectile* projectileParticleSystemType; + //ParticleSystemTypeProjectile* projectileParticleSystemType; SoundContainer projSounds; bool splash; @@ -299,7 +299,7 @@ public: //get proj inline bool getProjectile() const {return projectile;} - inline ParticleSystemTypeProjectile * getProjParticleType() const {return projectileParticleSystemType;} + //inline ParticleSystemTypeProjectile * getProjParticleType() const {return projectileParticleSystemType;} inline StaticSound *getProjSound() const {return projSounds.getRandSound();} //get splash diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index bdea2950..8fb76f91 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2601,7 +2601,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ if(ast == NULL) { throw megaglest_runtime_error("Start attack particle ast == NULL!"); } - ParticleSystemTypeProjectile *pstProj= ast->getProjParticleType(); + ParticleSystemTypeProjectile *pstProj= NULL; ParticleSystemTypeSplash *pstSplash= ast->getSplashParticleType(); Vec3f startPos= unit->getCurrVector(); @@ -2626,6 +2626,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ } renderer.manageParticleSystem(psProj, rsGame); unit->addAttackParticleSystem(psProj); + pstProj=(*pit); } // if no projectile, still deal damage.. From c08186207021db35439c62ae5aac8f28122ef044 Mon Sep 17 00:00:00 2001 From: titiger Date: Fri, 11 Jul 2014 00:26:16 +0200 Subject: [PATCH 015/258] use a bool instead of a (unused) pointer. --- source/glest_game/world/unit_updater.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 8fb76f91..a52aa757 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2601,7 +2601,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ if(ast == NULL) { throw megaglest_runtime_error("Start attack particle ast == NULL!"); } - ParticleSystemTypeProjectile *pstProj= NULL; + bool hasProjectile = false; ParticleSystemTypeSplash *pstSplash= ast->getSplashParticleType(); Vec3f startPos= unit->getCurrVector(); @@ -2621,16 +2621,16 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ psProj->setPath(startPos, endPos); psProj->setObserver(new ParticleDamager(unit, this, gameCamera)); psProj->setVisible(visible); - if(unit->getFaction()->getTexture()) { - psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); - } - renderer.manageParticleSystem(psProj, rsGame); - unit->addAttackParticleSystem(psProj); - pstProj=(*pit); + if(unit->getFaction()->getTexture()) { + psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + } + renderer.manageParticleSystem(psProj, rsGame); + unit->addAttackParticleSystem(psProj); + hasProjectile=true; } // if no projectile, still deal damage.. - if(pstProj == NULL) { + if(hasProjectile == true) { char szBuf[8096]=""; snprintf(szBuf,8095,"Unit hitting [startAttackParticleSystem] no proj"); unit->addNetworkCRCDecHp(szBuf); @@ -2646,7 +2646,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ psSplash->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); } renderer.manageParticleSystem(psSplash, rsGame); - if(pstProj!=NULL){ + if(hasProjectile == true){ psProj->link(psSplash); } unit->addAttackParticleSystem(psSplash); From b72f4857d7c243d3e6673d1036ef8c5f7c3a1568 Mon Sep 17 00:00:00 2001 From: titiger Date: Fri, 18 Jul 2014 01:04:36 +0200 Subject: [PATCH 016/258] multi projectiles with different timings and particle systems --- mk/windoze/glest_game.vcxproj | 2 + source/glest_game/graphics/particle_type.cpp | 18 ++-- source/glest_game/types/projectile_type.cpp | 88 ++++++++++++++++++ source/glest_game/types/projectile_type.h | 88 ++++++++++++++++++ source/glest_game/types/skill_type.cpp | 94 ++++++++++---------- source/glest_game/types/skill_type.h | 7 +- source/glest_game/world/unit_updater.cpp | 90 ++++++++++++------- source/glest_game/world/unit_updater.h | 5 +- 8 files changed, 296 insertions(+), 96 deletions(-) create mode 100644 source/glest_game/types/projectile_type.cpp create mode 100644 source/glest_game/types/projectile_type.h diff --git a/mk/windoze/glest_game.vcxproj b/mk/windoze/glest_game.vcxproj index a27d3aee..8725d125 100644 --- a/mk/windoze/glest_game.vcxproj +++ b/mk/windoze/glest_game.vcxproj @@ -269,6 +269,7 @@ + @@ -356,6 +357,7 @@ + diff --git a/source/glest_game/graphics/particle_type.cpp b/source/glest_game/graphics/particle_type.cpp index 110ada9d..2a8a2bfc 100644 --- a/source/glest_game/graphics/particle_type.cpp +++ b/source/glest_game/graphics/particle_type.cpp @@ -3,9 +3,9 @@ // // Copyright (C) 2010-2010 Titus Tscharntke // -// You can redistribute this code and/or modify it under -// the terms of the GNU General Public License as published -// by the Free Software Foundation; either version 2 of the +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the // License, or (at your option) any later version // ============================================================== @@ -160,7 +160,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d else { texture= NULL; } - + //model if(particleSystemNode->hasChild("model")){ const XmlNode *modelNode= particleSystemNode->getChild("model"); @@ -172,7 +172,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d string path= modelNode->getAttribute("path")->getRestrictedValue(currentPath); model= renderer->newModel(rsGame,path, false, &loadedFileList, &parentLoader); loadedFileList[path].push_back(make_pair(parentLoader,modelNode->getAttribute("path")->getRestrictedValue())); - + if(modelNode->hasChild("cycles")) { modelCycle = modelNode->getChild("cycles")->getAttribute("value")->getFloatValue(); if(modelCycle < 0.0) @@ -235,7 +235,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d //speed const XmlNode *energyVarNode= particleSystemNode->getChild("energy-var"); energyVar= energyVarNode->getAttribute("value")->getIntValue(); - + //teamcolorNoEnergy if(particleSystemNode->hasChild("teamcolorNoEnergy")){ const XmlNode *teamcolorNoEnergyNode= particleSystemNode->getChild("teamcolorNoEnergy"); @@ -441,7 +441,7 @@ void ParticleSystemTypeProjectile::load(const XmlNode* particleFileNode, const s particleFileNode->setSuper(particleSystemNode); particleSystemNode= particleFileNode; } - + ParticleSystemType::load(particleSystemNode, dir, renderer, loadedFileList,parentLoader, techtreePath); //trajectory values @@ -535,7 +535,7 @@ void ParticleSystemTypeSplash::load(const XmlNode* particleFileNode, const strin loadedFileList[path].push_back(make_pair(parentLoader,parentLoader)); const XmlNode *particleSystemNode= xmlTree.getRootNode(); - + if(particleFileNode){ // immediate children in the particleFileNode will override the particleSystemNode particleFileNode->setSuper(particleSystemNode); @@ -547,7 +547,7 @@ void ParticleSystemTypeSplash::load(const XmlNode* particleFileNode, const strin //emission rate fade const XmlNode *emissionRateFadeNode= particleSystemNode->getChild("emission-rate-fade"); emissionRateFade= emissionRateFadeNode->getAttribute("value")->getFloatValue(); - + //spread values const XmlNode *verticalSpreadNode= particleSystemNode->getChild("vertical-spread"); verticalSpreadA= verticalSpreadNode->getAttribute("a")->getFloatValue(0.0f, 1.0f); diff --git a/source/glest_game/types/projectile_type.cpp b/source/glest_game/types/projectile_type.cpp new file mode 100644 index 00000000..9d6265c0 --- /dev/null +++ b/source/glest_game/types/projectile_type.cpp @@ -0,0 +1,88 @@ +// ============================================================== +// This file is part of Glest (www.glest.org) +// +// Copyright (C) 2001-2008 Martiño Figueroa +// +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version +// ============================================================== + +#include +#include "logger.h" +#include "lang.h" +#include "renderer.h" +#include "leak_dumper.h" + +using namespace Shared::Util; + +namespace Glest{ namespace Game{ + +ProjectileType::ProjectileType() { + + projectileParticleSystemType=NULL; + attackStartTime=0.0f; + + splash=false; + splashRadius=0; + splashDamageAll=true; + splashParticleSystemType=NULL; + + shake=false; + shakeIntensity=0; + shakeDuration=0; + + shakeVisible=true; + shakeInCameraView=true; + shakeCameraAffected=false; + +} + + +void ProjectileType::load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map > > &loadedFileList, + string parentLoader){ + + string currentPath = dir; + endPathWithSlash(currentPath); + + if(projectileNode->hasAttribute("attack-start-time")){ + attackStartTime =projectileNode->getAttribute("attack-start-time")->getFloatValue(); + } + else + { + attackStartTime=0.0f; + } + if(projectileNode->hasChild("particle")){ + const XmlNode *particleNode= projectileNode->getChild("particle"); + bool particleEnabled= particleNode->getAttribute("value")->getBoolValue(); + if(particleEnabled){ + string path= particleNode->getAttribute("path")->getRestrictedValue(); + ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); + projectileParticleSystemType->load(particleNode, dir, currentPath + path, + &Renderer::getInstance(), loadedFileList, parentLoader, + techtreepath); + loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); + setProjectileParticleSystemType(projectileParticleSystemType); + } + } + + const XmlNode *soundNode= projectileNode->getChild("sound"); + if(soundNode->getAttribute("enabled")->getBoolValue()){ + + hitSounds.resize((int)soundNode->getChildCount()); + for(int i=0; i < (int)soundNode->getChildCount(); ++i){ + const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); + string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); + //printf("\n\n\n\n!@#$ ---> parentLoader [%s] path [%s] nodeValue [%s] i = %d",parentLoader.c_str(),path.c_str(),soundFileNode->getAttribute("path")->getRestrictedValue().c_str(),i); + + StaticSound *sound= new StaticSound(); + sound->load(path); + loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue())); + hitSounds[i]= sound; + } + } +} + + +}}//end namespace diff --git a/source/glest_game/types/projectile_type.h b/source/glest_game/types/projectile_type.h new file mode 100644 index 00000000..15c5d31d --- /dev/null +++ b/source/glest_game/types/projectile_type.h @@ -0,0 +1,88 @@ +// ============================================================== +// This file is part of Glest (www.glest.org) +// +// Copyright (C) 2001-2008 Martiño Figueroa +// +// You can redistribute this code and/or modify it under +// the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version +// ============================================================== + +#ifndef _GLEST_GAME_PROJEKTILETYPE_H_ +#define _GLEST_GAME_PROJEKTILETYPE_H_ + +#ifdef WIN32 + #include + #include +#endif + +#include "sound.h" +#include "vec.h" +//#include "xml_parser.h" +#include "util.h" +//#include "element_type.h" +#include "factory.h" +#include "sound_container.h" +#include "particle_type.h" +#include "leak_dumper.h" + +using std::vector; +using std::string; + +namespace Glest{ namespace Game{ +// ===================================================== +// class ProjectileType +// ===================================================== + +class ProjectileType { +protected: + ParticleSystemTypeProjectile* projectileParticleSystemType; + SoundContainer hitSounds; + float attackStartTime; + + bool splash; + int splashRadius; + bool splashDamageAll; + ParticleSystemTypeSplash* splashParticleSystemType; + + bool shake; + int shakeIntensity; + int shakeDuration; + + bool shakeVisible; + bool shakeInCameraView; + bool shakeCameraAffected; + +public: + ProjectileType(); + virtual ~ProjectileType(){}; + + + void load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map > > &loadedFileList, + string parentLoader); + + //get/set + inline StaticSound *getHitSound() const {return hitSounds.getRandSound();} + ParticleSystemTypeProjectile* getProjectileParticleSystemType() const { return projectileParticleSystemType;} + float getAttackStartTime() const {return attackStartTime;} + void setAttackStartTime(float value) {attackStartTime=value;} + bool isSplash() const { return splash;} + bool isSplashDamageAll() const { return splashDamageAll;} + ParticleSystemTypeSplash* getSplashParticleSystemType() const { return splashParticleSystemType;} + int getSplashRadius() const { return splashRadius;} + + bool isShake() const{return shake;} + bool isShakeCameraAffected() const{return shakeCameraAffected;} + int getShakeDuration() const{return shakeDuration;} + bool isShakeInCameraView() const{return shakeInCameraView;} + int getShakeIntensity() const{return shakeIntensity;} + bool isShakeVisible() const{return shakeVisible;} + + void setProjectileParticleSystemType(ParticleSystemTypeProjectile *pointer) {projectileParticleSystemType=pointer;} + ParticleSystemTypeProjectile* getProjectileParticleSystemType() {return projectileParticleSystemType;} +}; + +}}//end namespace + +#endif diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index e939b243..d7d343fb 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -19,6 +19,7 @@ #include "renderer.h" #include "particle_type.h" #include "unit_particle_type.h" +#include "projectile_type.h" #include "tech_tree.h" #include "faction_type.h" #include "leak_dumper.h" @@ -821,7 +822,7 @@ AttackSkillType::AttackSkillType() { AttackSkillType::~AttackSkillType() { - deleteValues(projectileParticleSystemTypes.begin(), projectileParticleSystemTypes.end()); + deleteValues(projectileTypes.begin(), projectileTypes.end()); delete splashParticleSystemType; splashParticleSystemType = NULL; @@ -880,59 +881,56 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, } } - //projectile - const XmlNode *projectileNode= sn->getChild("projectile"); - projectile= projectileNode->getAttribute("value")->getBoolValue(); - if(projectile){ + if(sn->hasChild("projectiles")){ + const XmlNode *projectilesNode= sn->getChild("projectiles"); + vector projectilesNodeList = projectilesNode->getChildList("projectile"); + for(unsigned int i = 0; i < projectilesNodeList.size(); ++i) { + const XmlNode *projectileNode= projectilesNodeList[i]; + ProjectileType *projectileType=new ProjectileType(); + projectileType->load(projectileNode,dir, tt->getPath(), loadedFileList, parentLoader); - //proj particle - if(projectileNode->hasChild("particle")){ - const XmlNode *particleNode= projectileNode->getChild("particle"); - bool particleEnabled= particleNode->getAttribute("value")->getBoolValue(); - if(particleEnabled){ - string path= particleNode->getAttribute("path")->getRestrictedValue(); - ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); - projectileParticleSystemType->load(particleNode, dir, currentPath + path, - &Renderer::getInstance(), loadedFileList, parentLoader, - tt->getPath()); - loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); - projectileParticleSystemTypes.push_back(projectileParticleSystemType); - } + projectileTypes.push_back(projectileType); + projectile=true; } - - //extra projectiles - if(projectileNode->hasChild("particles")){ - const XmlNode *extraParticlesNode= projectileNode->getChild("particles"); - bool extraParticlesEnabled= extraParticlesNode->getAttribute("value")->getBoolValue(); - if(extraParticlesEnabled){ - for(int i = 0; i < (int)extraParticlesNode->getChildCount(); ++i) { - const XmlNode *extraParticleFileNode= extraParticlesNode->getChild("particle-file", i); - string path= extraParticleFileNode->getAttribute("path")->getRestrictedValue(); - ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); - projectileParticleSystemType->load(extraParticleFileNode, dir, currentPath + path, - &Renderer::getInstance(), loadedFileList, parentLoader, - tt->getPath()); - loadedFileList[currentPath + path].push_back(make_pair(parentLoader,extraParticleFileNode->getAttribute("path")->getRestrictedValue())); - projectileParticleSystemTypes.push_back(projectileParticleSystemType); + } + else { + //projectile -- backward compatible old behaviour with only one projectile + const XmlNode *projectileNode= sn->getChild("projectile"); + projectile= projectileNode->getAttribute("value")->getBoolValue(); + if(projectile){ + // create new projectile + ProjectileType *projectileType=new ProjectileType(); + projectileTypes.push_back(projectileType); + projectileType->setAttackStartTime(attackStartTime); + //proj particle + if(projectileNode->hasChild("particle")){ + const XmlNode *particleNode= projectileNode->getChild("particle"); + bool particleEnabled= particleNode->getAttribute("value")->getBoolValue(); + if(particleEnabled){ + string path= particleNode->getAttribute("path")->getRestrictedValue(); + ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); + projectileParticleSystemType->load(particleNode, dir, currentPath + path, + &Renderer::getInstance(), loadedFileList, parentLoader, + tt->getPath()); + loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); + projectileType->setProjectileParticleSystemType(projectileParticleSystemType); } } - } + //proj sounds + const XmlNode *soundNode= projectileNode->getChild("sound"); + if(soundNode->getAttribute("enabled")->getBoolValue()){ + projSounds.resize((int)soundNode->getChildCount()); + for(int i=0; i < (int)soundNode->getChildCount(); ++i){ + const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); + string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); + //printf("\n\n\n\n!@#$ ---> parentLoader [%s] path [%s] nodeValue [%s] i = %d",parentLoader.c_str(),path.c_str(),soundFileNode->getAttribute("path")->getRestrictedValue().c_str(),i); - //proj sounds - const XmlNode *soundNode= projectileNode->getChild("sound"); - if(soundNode->getAttribute("enabled")->getBoolValue()){ - - projSounds.resize((int)soundNode->getChildCount()); - for(int i=0; i < (int)soundNode->getChildCount(); ++i){ - const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); - string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); - //printf("\n\n\n\n!@#$ ---> parentLoader [%s] path [%s] nodeValue [%s] i = %d",parentLoader.c_str(),path.c_str(),soundFileNode->getAttribute("path")->getRestrictedValue().c_str(),i); - - StaticSound *sound= new StaticSound(); - sound->load(path); - loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue())); - projSounds[i]= sound; + StaticSound *sound= new StaticSound(); + sound->load(path); + loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue())); + projSounds[i]= sound; + } } } } diff --git a/source/glest_game/types/skill_type.h b/source/glest_game/types/skill_type.h index e0b79ce7..f65989b3 100644 --- a/source/glest_game/types/skill_type.h +++ b/source/glest_game/types/skill_type.h @@ -27,6 +27,7 @@ #include "factory.h" #include "sound_container.h" #include "particle.h" +#include "projectile_type.h" #include "upgrade_type.h" #include "leak_dumper.h" @@ -74,7 +75,7 @@ enum SkillClass{ }; typedef list UnitParticleSystemTypes; -typedef list ProjectileParticleSystemTypes; +typedef list ProjectileTypes; // ===================================================== // class SkillType // @@ -173,7 +174,6 @@ protected: public: UnitParticleSystemTypes unitParticleSystemTypes; - ProjectileParticleSystemTypes projectileParticleSystemTypes; public: //varios @@ -260,6 +260,8 @@ public: // =============================== class AttackSkillType: public SkillType{ +public: + ProjectileTypes projectileTypes; private: int attackStrength; int attackVar; @@ -299,7 +301,6 @@ public: //get proj inline bool getProjectile() const {return projectile;} - //inline ParticleSystemTypeProjectile * getProjParticleType() const {return projectileParticleSystemType;} inline StaticSound *getProjSound() const {return projSounds.getRandSound();} //get splash diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index a52aa757..70e1cd86 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -21,6 +21,7 @@ #include "network_manager.h" #include "object.h" #include "particle_type.h" +#include "projectile_type.h" #include "path_finder.h" #include "renderer.h" #include "sound.h" @@ -186,14 +187,24 @@ bool UnitUpdater::updateUnit(Unit *unit) { float attackStartTime = truncateDecimal(ast->getAttackStartTime(),6); float lastAnimProgress = truncateDecimal(unit->getLastAnimProgressAsFloat(),6); float animProgress = truncateDecimal(unit->getAnimProgressAsFloat(),6); - bool startAttackParticleSystemNow = (attackStartTime >= lastAnimProgress && attackStartTime < animProgress); + bool startAttackParticleSystemNow = false; + if(ast->projectileTypes.empty() == true ){ + startAttackParticleSystemNow = (attackStartTime >= lastAnimProgress && attackStartTime < animProgress); + } + else {// start projectile attack + for(ProjectileTypes::const_iterator it= ast->projectileTypes.begin(); it != ast->projectileTypes.end(); ++it) { + attackStartTime= (*it)->getAttackStartTime(); + startAttackParticleSystemNow = (attackStartTime >= lastAnimProgress && attackStartTime < animProgress); + if(startAttackParticleSystemNow==true) break; + } + } char szBuf[8096]=""; snprintf(szBuf,8095,"attackStartTime = %f, lastAnimProgress = %f, animProgress = %f startAttackParticleSystemNow = %d",attackStartTime,lastAnimProgress,animProgress,startAttackParticleSystemNow); unit->setNetworkCRCParticleLogInfo(szBuf); if(startAttackParticleSystemNow == true) { - startAttackParticleSystem(unit); + startAttackParticleSystem(unit,lastAnimProgress,animProgress); } } @@ -2592,18 +2603,18 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac //attacker->computeHp(); } -void UnitUpdater::startAttackParticleSystem(Unit *unit){ +void UnitUpdater::startAttackParticleSystem(Unit *unit, float lastAnimProgress, float animProgress){ Renderer &renderer= Renderer::getInstance(); - ProjectileParticleSystem *psProj = 0; + //const AttackSkillType *ast= dynamic_cast(unit->getCurrSkill()); + const AttackSkillType *ast= static_cast(unit->getCurrSkill()); - const AttackSkillType *ast= dynamic_cast(unit->getCurrSkill()); if(ast == NULL) { throw megaglest_runtime_error("Start attack particle ast == NULL!"); } - bool hasProjectile = false; - ParticleSystemTypeSplash *pstSplash= ast->getSplashParticleType(); + ParticleSystemTypeSplash *pstSplash= ast->getSplashParticleType(); + bool hasProjectile = !ast->projectileTypes.empty(); Vec3f startPos= unit->getCurrVector(); Vec3f endPos= unit->getTargetVec(); @@ -2615,41 +2626,51 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ visible = true; } - - for(ProjectileParticleSystemTypes::const_iterator pit= unit->getCurrSkill()->projectileParticleSystemTypes.begin(); pit != unit->getCurrSkill()->projectileParticleSystemTypes.end(); ++pit) { - psProj= (*pit)->create(unit); - psProj->setPath(startPos, endPos); - psProj->setObserver(new ParticleDamager(unit, this, gameCamera)); - psProj->setVisible(visible); - if(unit->getFaction()->getTexture()) { - psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + //for(ProjectileParticleSystemTypes::const_iterator pit= unit->getCurrSkill()->projectileParticleSystemTypes.begin(); pit != unit->getCurrSkill()->projectileParticleSystemTypes.end(); ++pit) { + for(ProjectileTypes::const_iterator pt= ast->projectileTypes.begin(); pt != ast->projectileTypes.end(); ++pt) { + bool startAttackParticleSystemNow = ((*pt)->getAttackStartTime() >= lastAnimProgress && (*pt)->getAttackStartTime() < animProgress); + if(startAttackParticleSystemNow){ + ProjectileParticleSystem *psProj= (*pt)->getProjectileParticleSystemType()->create(unit); + psProj->setPath(startPos, endPos); + psProj->setObserver(new ParticleDamager(unit,(*pt), this, gameCamera)); + psProj->setVisible(visible); + if(unit->getFaction()->getTexture()) { + psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + } + renderer.manageParticleSystem(psProj, rsGame); + unit->addAttackParticleSystem(psProj); + ParticleSystemTypeSplash *splashType=(*pt)->getSplashParticleSystemType(); + if(splashType!=NULL){ + SplashParticleSystem *psSplash= pstSplash->create(unit); + psSplash->setPos(endPos); + psSplash->setVisible(visible); + if(unit->getFaction()->getTexture()) { + psSplash->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + } + renderer.manageParticleSystem(psSplash, rsGame); + unit->addAttackParticleSystem(psSplash); + psProj->link(psSplash); + } } - renderer.manageParticleSystem(psProj, rsGame); - unit->addAttackParticleSystem(psProj); - hasProjectile=true; } // if no projectile, still deal damage.. - if(hasProjectile == true) { + if(hasProjectile == false) { char szBuf[8096]=""; snprintf(szBuf,8095,"Unit hitting [startAttackParticleSystem] no proj"); unit->addNetworkCRCDecHp(szBuf); hit(unit); - } - - //splash - if(pstSplash != NULL) { - SplashParticleSystem *psSplash= pstSplash->create(unit); - psSplash->setPos(endPos); - psSplash->setVisible(visible); - if(unit->getFaction()->getTexture()) { - psSplash->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + //splash + if(pstSplash != NULL) { + SplashParticleSystem *psSplash= pstSplash->create(unit); + psSplash->setPos(endPos); + psSplash->setVisible(visible); + if(unit->getFaction()->getTexture()) { + psSplash->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + } + renderer.manageParticleSystem(psSplash, rsGame); + unit->addAttackParticleSystem(psSplash); } - renderer.manageParticleSystem(psSplash, rsGame); - if(hasProjectile == true){ - psProj->link(psSplash); - } - unit->addAttackParticleSystem(psSplash); } } @@ -3206,9 +3227,10 @@ void UnitUpdater::loadGame(const XmlNode *rootNode) { // class ParticleDamager // ===================================================== -ParticleDamager::ParticleDamager(Unit *attacker, UnitUpdater *unitUpdater, const GameCamera *gameCamera){ +ParticleDamager::ParticleDamager(Unit *attacker,const ProjectileType* projectileType, UnitUpdater *unitUpdater, const GameCamera *gameCamera){ this->gameCamera= gameCamera; this->attackerRef= attacker; + this->projectileType= projectileType; this->ast= static_cast(attacker->getCurrSkill()); this->targetPos= attacker->getTargetPos(); this->targetField= attacker->getTargetField(); diff --git a/source/glest_game/world/unit_updater.h b/source/glest_game/world/unit_updater.h index ca9dd893..6c98dbeb 100644 --- a/source/glest_game/world/unit_updater.h +++ b/source/glest_game/world/unit_updater.h @@ -143,7 +143,7 @@ private: void hit(Unit *attacker); void hit(Unit *attacker, const AttackSkillType* ast, const Vec2i &targetPos, Field targetField); void damage(Unit *attacker, const AttackSkillType* ast, Unit *attacked, float distance); - void startAttackParticleSystem(Unit *unit); + void startAttackParticleSystem(Unit *unit, float lastAnimProgress, float animProgress); //misc bool searchForResource(Unit *unit, const HarvestCommandType *hct); @@ -169,13 +169,14 @@ class ParticleDamager: public ParticleObserver { public: UnitReference attackerRef; const AttackSkillType* ast; + const ProjectileType* projectileType; UnitUpdater *unitUpdater; const GameCamera *gameCamera; Vec2i targetPos; Field targetField; public: - ParticleDamager(Unit *attacker, UnitUpdater *unitUpdater, const GameCamera *gameCamera); + ParticleDamager(Unit *attacker, const ProjectileType *projectileType, UnitUpdater *unitUpdater, const GameCamera *gameCamera); virtual void update(ParticleSystem *particleSystem); virtual void saveGame(XmlNode *rootNode); From f22c96e5034f08d49cdb7fe1d719a46565f9a0a8 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 09:15:53 -0600 Subject: [PATCH 017/258] Start ep now an argument of max-ep Syntax is `` --- source/glest_game/types/unit_type.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 5eac779e..47f4d903 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -249,10 +249,9 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, addItemToVault(&(this->epRegeneration),this->epRegeneration); //startEp - - if(parametersNode->hasChild("start-ep")) { + if(parametersNode->getChild("max-ep")->hasAttribute("start-value")) { //checkItemInVault(&(this->startEp),this->startEp); - startEp= parametersNode->getChild("start-ep")->getAttribute("value")->getIntValue(); + startEp= parametersNode->getChild("max-ep")->getAttribute("start-value")->getIntValue(); } addItemToVault(&(this->startEp),this->startEp); From a65898571d6902e3176cab6331483f0cdeeadcbe Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 09:53:38 -0600 Subject: [PATCH 018/258] Implemented start percentage for EP Note that start-value and start-percentage (both are attributes of the max-ep tag) are mutually exclusive. If they both exist, then start-percentage is used. --- source/glest_game/type_instances/unit.cpp | 9 +++++++-- source/glest_game/types/unit_type.cpp | 21 ++++++++++++++++----- source/glest_game/types/unit_type.h | 13 +++++++++++-- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 7042c4ee..70258b7c 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1959,9 +1959,14 @@ void Unit::born(const CommandType *ct) { } addItemToVault(&this->hp,this->hp); - //set ep from start-ep tag + //set ep from start ep checkItemInVault(&this->ep,this->ep); - this->ep= type->getStartEp(); + if(type->getStartEpType() == UnitType::stValue) { + this->ep= type->getStartEpValue(); + } + else { + this->ep= type->getStartEpPercentage() * type->getTotalMaxEp(&totalUpgrade); + } } void Unit::kill() { diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 47f4d903..a9b264d0 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -126,7 +126,9 @@ UnitType::UnitType() : ProducibleType() { maxUnitCount= 0; maxHp=0; maxEp=0; - startEp=0; + startEpValue=0; + startEpPercentage=0; + startEpType=stValue; armor=0; sight=0; size=0; @@ -248,12 +250,20 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } addItemToVault(&(this->epRegeneration),this->epRegeneration); - //startEp + //startEpValue -- the *absolute* value to use for starting EP if(parametersNode->getChild("max-ep")->hasAttribute("start-value")) { //checkItemInVault(&(this->startEp),this->startEp); - startEp= parametersNode->getChild("max-ep")->getAttribute("start-value")->getIntValue(); + startEpValue= parametersNode->getChild("max-ep")->getAttribute("start-value")->getIntValue(); + startEpType= stValue; } - addItemToVault(&(this->startEp),this->startEp); + addItemToVault(&(this->startEpValue),this->startEpValue); + + //startEpPercentage -- the *relative* value to use for starting EP + if(parametersNode->getChild("max-ep")->hasAttribute("start-percentage")) { + startEpPercentage= parametersNode->getChild("max-ep")->getAttribute("start-percentage")->getFloatValue(); + startEpType= stPercentage; + } + addItemToVault(&(this->startEpPercentage),this->startEpPercentage); //maxUnitCount if(parametersNode->hasChild("max-unit-count")) { @@ -1108,7 +1118,8 @@ std::string UnitType::toString() const { result += " maxHp = " + intToStr(maxHp); result += " hpRegeneration = " + intToStr(hpRegeneration); result += " maxEp = " + intToStr(maxEp); - result += " startEp = " + intToStr(startEp); + result += " startEpValue = " + intToStr(startEpValue); + result += " startEpPercentage = " + intToStr(startEpPercentage); result += " epRegeneration = " + intToStr(epRegeneration); result += " maxUnitCount = " + intToStr(getMaxUnitCount()); diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index ee23d111..5f2a4cd9 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -92,6 +92,11 @@ public: pCount }; + enum StartType { + stValue, + stPercentage + }; + static const char *propertyNames[]; DamageParticleSystemTypes damageParticleSystemTypes; private: @@ -106,7 +111,9 @@ private: int maxHp; int hpRegeneration; int maxEp; - int startEp; + int startEpValue; + double startEpPercentage; + StartType startEpType; int epRegeneration; int maxUnitCount; @@ -181,7 +188,9 @@ public: inline int getHpRegeneration() const {return hpRegeneration;} inline int getMaxEp() const {return maxEp;} inline int getEpRegeneration() const {return epRegeneration;} - inline int getStartEp() const {return startEp;} + inline int getStartEpValue() const {return startEpValue;} + inline double getStartEpPercentage() const {return startEpPercentage;} + inline StartType getStartEpType() const {return startEpType;} inline int getMaxUnitCount() const {return maxUnitCount;} inline bool getField(Field field) const {return fields[field];} inline Field getField() const {return field;} From 94667b9ab9f8c67511387351bc883e149a1d920b Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 10:31:57 -0600 Subject: [PATCH 019/258] Error checking now active for start-ep You can no longer have both start-value and start-percentage. --- source/glest_game/types/unit_type.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index a9b264d0..960b19c5 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -250,6 +250,14 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } addItemToVault(&(this->epRegeneration),this->epRegeneration); + // Check that we don't use both start-value and start-percentage, as they are mutually + // exclusive + if(parametersNode->getChild("max-ep")->hasAttribute("start-value") && + parametersNode->getChild("max-ep")->hasAttribute("start-percentage")) { + throw megaglest_runtime_error("Unit " + name + + " has both start-value and start-percentage for EP", validationMode); + } + //startEpValue -- the *absolute* value to use for starting EP if(parametersNode->getChild("max-ep")->hasAttribute("start-value")) { //checkItemInVault(&(this->startEp),this->startEp); From 762f09ab43412ca4f813b10f3a487a9b8d55e47d Mon Sep 17 00:00:00 2001 From: titiger Date: Sat, 19 Jul 2014 18:50:47 +0200 Subject: [PATCH 020/258] multishot with multi sounds and possible camerashake on projectile impact. Still work in progress! --- source/glest_game/types/projectile_type.cpp | 45 ++++++++++++++------- source/glest_game/types/projectile_type.h | 4 +- source/glest_game/types/skill_type.cpp | 42 +++++++++++++------ source/glest_game/world/unit_updater.cpp | 25 +++++++++++- 4 files changed, 85 insertions(+), 31 deletions(-) diff --git a/source/glest_game/types/projectile_type.cpp b/source/glest_game/types/projectile_type.cpp index 9d6265c0..ab77addd 100644 --- a/source/glest_game/types/projectile_type.cpp +++ b/source/glest_game/types/projectile_type.cpp @@ -24,9 +24,9 @@ ProjectileType::ProjectileType() { projectileParticleSystemType=NULL; attackStartTime=0.0f; - splash=false; - splashRadius=0; - splashDamageAll=true; + splash=false; + splashRadius=0; + splashDamageAll=true; splashParticleSystemType=NULL; shake=false; @@ -35,7 +35,7 @@ ProjectileType::ProjectileType() { shakeVisible=true; shakeInCameraView=true; - shakeCameraAffected=false; + shakeCameraDistanceAffected=false; } @@ -67,19 +67,34 @@ void ProjectileType::load(const XmlNode *projectileNode, const string &dir, cons } } - const XmlNode *soundNode= projectileNode->getChild("sound"); - if(soundNode->getAttribute("enabled")->getBoolValue()){ + if(projectileNode->hasChild("hitshake")){ + const XmlNode *hitShakeNode= projectileNode->getChild("hitshake"); + shake=hitShakeNode->getAttribute("enabled")->getBoolValue(); + if(shake){ + shakeIntensity=hitShakeNode->getAttribute("intensity")->getIntValue(); + shakeDuration=hitShakeNode->getAttribute("duration")->getIntValue(); - hitSounds.resize((int)soundNode->getChildCount()); - for(int i=0; i < (int)soundNode->getChildCount(); ++i){ - const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); - string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); - //printf("\n\n\n\n!@#$ ---> parentLoader [%s] path [%s] nodeValue [%s] i = %d",parentLoader.c_str(),path.c_str(),soundFileNode->getAttribute("path")->getRestrictedValue().c_str(),i); + shakeVisible=hitShakeNode->getAttribute("visible")->getBoolValue(); + shakeInCameraView=hitShakeNode->getAttribute("in-camera-view")->getBoolValue(); + shakeCameraDistanceAffected=hitShakeNode->getAttribute("camera-distance-affected")->getBoolValue(); + } + } - StaticSound *sound= new StaticSound(); - sound->load(path); - loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue())); - hitSounds[i]= sound; + if(projectileNode->hasChild("hitsound")){ + const XmlNode *soundNode= projectileNode->getChild("hitsound"); + if(soundNode->getAttribute("enabled")->getBoolValue()){ + + hitSounds.resize((int)soundNode->getChildCount()); + for(int i=0; i < (int)soundNode->getChildCount(); ++i){ + const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); + string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); + //printf("\n\n\n\n!@#$ ---> parentLoader [%s] path [%s] nodeValue [%s] i = %d",parentLoader.c_str(),path.c_str(),soundFileNode->getAttribute("path")->getRestrictedValue().c_str(),i); + + StaticSound *sound= new StaticSound(); + sound->load(path); + loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue())); + hitSounds[i]= sound; + } } } } diff --git a/source/glest_game/types/projectile_type.h b/source/glest_game/types/projectile_type.h index 15c5d31d..3a3b6ec6 100644 --- a/source/glest_game/types/projectile_type.h +++ b/source/glest_game/types/projectile_type.h @@ -52,7 +52,7 @@ protected: bool shakeVisible; bool shakeInCameraView; - bool shakeCameraAffected; + bool shakeCameraDistanceAffected; public: ProjectileType(); @@ -73,7 +73,7 @@ public: int getSplashRadius() const { return splashRadius;} bool isShake() const{return shake;} - bool isShakeCameraAffected() const{return shakeCameraAffected;} + bool isShakeCameraDistanceAffected() const{return shakeCameraDistanceAffected;} int getShakeDuration() const{return shakeDuration;} bool isShakeInCameraView() const{return shakeInCameraView;} int getShakeIntensity() const{return shakeIntensity;} diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index d7d343fb..8ccff7e7 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -881,19 +881,7 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, } } - if(sn->hasChild("projectiles")){ - const XmlNode *projectilesNode= sn->getChild("projectiles"); - vector projectilesNodeList = projectilesNode->getChildList("projectile"); - for(unsigned int i = 0; i < projectilesNodeList.size(); ++i) { - const XmlNode *projectileNode= projectilesNodeList[i]; - ProjectileType *projectileType=new ProjectileType(); - projectileType->load(projectileNode,dir, tt->getPath(), loadedFileList, parentLoader); - - projectileTypes.push_back(projectileType); - projectile=true; - } - } - else { + if(sn->hasChild("projectile")){ //projectile -- backward compatible old behaviour with only one projectile const XmlNode *projectileNode= sn->getChild("projectile"); projectile= projectileNode->getAttribute("value")->getBoolValue(); @@ -934,6 +922,34 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, } } } + else { + const XmlNode *projectilesNode= sn->getChild("projectiles"); + vector projectilesNodeList = projectilesNode->getChildList("projectile"); + for(unsigned int i = 0; i < projectilesNodeList.size(); ++i) { + const XmlNode *projectileNode= projectilesNodeList[i]; + ProjectileType *projectileType=new ProjectileType(); + projectileType->load(projectileNode,dir, tt->getPath(), loadedFileList, parentLoader); + + projectileTypes.push_back(projectileType); + projectile=true; + } + //general hit sounds, individual ones can be set in projectiles + const XmlNode *soundNode= sn->getChild("hitsound"); + if(soundNode->getAttribute("enabled")->getBoolValue()){ + + projSounds.resize((int)soundNode->getChildCount()); + for(int i=0; i < (int)soundNode->getChildCount(); ++i){ + const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); + string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); + //printf("\n\n\n\n!@#$ ---> parentLoader [%s] path [%s] nodeValue [%s] i = %d",parentLoader.c_str(),path.c_str(),soundFileNode->getAttribute("path")->getRestrictedValue().c_str(),i); + + StaticSound *sound= new StaticSound(); + sound->load(path); + loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue())); + projSounds[i]= sound; + } + } + } //splash const XmlNode *splashNode= sn->getChild("splash"); diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 70e1cd86..062cff84 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -3254,10 +3254,33 @@ void ParticleDamager::update(ParticleSystem *particleSystem) { //attacker->setNetworkCRCParticleObserverLogInfo(szBuf); //play sound - StaticSound *projSound= ast->getProjSound(); + // Try to use the sound form the projetileType + StaticSound *projSound=projectileType->getHitSound(); + if(projSound == NULL){ + // use the sound from the skill + projSound= ast->getProjSound(); + } if(particleSystem->getVisible() && projSound != NULL) { SoundRenderer::getInstance().playFx(projSound, attacker->getCurrVector(), gameCamera->getPos()); } + + // check for shake and shake + if(projectileType->isShake()==true){ + World *world=attacker->getFaction()->getWorld(); + Map* map=world->getMap(); + Game *game=world->getGame(); + + //Unit *attacked= map->getCell(targetPos)->getUnit(targetField); + Vec2i surfaceTargetPos=Map::toSurfCoords(targetPos); + bool visibility=(!projectileType->isShakeVisible())||(map->getSurfaceCell(surfaceTargetPos)->isVisible(world->getThisTeamIndex()) || + (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true)); + + bool isInCameraView=(!projectileType->isShakeInCameraView()) || Renderer::getInstance().posInCellQuadCache(surfaceTargetPos).first; + + if(visibility && isInCameraView) { + game->getGameCameraPtr()->shake( projectileType->getShakeDuration(), projectileType->getShakeIntensity(),projectileType->isShakeCameraDistanceAffected(),map->getSurfaceCell(surfaceTargetPos)->getVertex()); + } + } } particleSystem->setObserver(NULL); delete this; From 0a68e3a6a490e7fb7033df6c7224dae3e2cded43 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 10:57:34 -0600 Subject: [PATCH 021/258] Implemented starting value for HP Same syntax as for EP: Where `start-percentage` can be replaced by `start-value` to use an absolute number. Note that unlike EP, HP defaults to the max-hp value *before* upgrades are applied. This behavior is not changed. To make units spawn with their fully upgraded HP, set their start-percentage to 1.0. --- source/glest_game/type_instances/unit.cpp | 12 ++++++++- source/glest_game/types/unit_type.cpp | 33 +++++++++++++++++++++++ source/glest_game/types/unit_type.h | 6 +++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 70258b7c..9ba9d44b 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1951,7 +1951,17 @@ void Unit::born(const CommandType *ct) { checkItemInVault(&this->hp,this->hp); int original_hp = this->hp; - this->hp= type->getMaxHp(); + + + //set hp from start hp + checkItemInVault(&this->ep,this->ep); + if(type->getStartHpType() == UnitType::stValue) { + this->hp= type->getStartHpValue(); + } + else { + this->hp= type->getStartHpPercentage() * type->getTotalMaxHp(&totalUpgrade); + } + if(original_hp != this->hp) { //printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__); game->getScriptManager()->onUnitTriggerEvent(this,utet_HPChanged); diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 960b19c5..c8e0be10 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -125,6 +125,9 @@ UnitType::UnitType() : ProducibleType() { epRegeneration= 0; maxUnitCount= 0; maxHp=0; + startHpValue=0; + startHpPercentage=1.0; + startHpType=stValue; maxEp=0; startEpValue=0; startEpPercentage=0; @@ -250,6 +253,36 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } addItemToVault(&(this->epRegeneration),this->epRegeneration); + // Check that we don't use both start-value and start-percentage, as they are mutually + // exclusive + if(parametersNode->getChild("max-hp")->hasAttribute("start-value") && + parametersNode->getChild("max-hp")->hasAttribute("start-percentage")) { + throw megaglest_runtime_error("Unit " + name + + " has both start-value and start-percentage for HP", validationMode); + } + + //startHpValue -- the *absolute* value to use for starting HP + if(parametersNode->getChild("max-hp")->hasAttribute("start-value")) { + //checkItemInVault(&(this->startEp),this->startEp); + startHpValue= parametersNode->getChild("max-hp")->getAttribute("start-value")->getIntValue(); + startHpType= stValue; + } + addItemToVault(&(this->startHpValue),this->startHpValue); + + //startHpPercentage -- the *relative* value to use for starting HP + if(parametersNode->getChild("max-hp")->hasAttribute("start-percentage")) { + startHpPercentage= parametersNode->getChild("max-hp")->getAttribute("start-percentage")->getFloatValue(); + startHpType= stPercentage; + } + + // No start value set; use max HP before upgrades + if(!parametersNode->getChild("max-hp")->hasAttribute("start-value") && + !parametersNode->getChild("max-hp")->hasAttribute("start-percentage")) { + startHpValue= parametersNode->getChild("max-hp")->getAttribute("value")->getIntValue(); + startHpType= stValue; + } + addItemToVault(&(this->startHpPercentage),this->startHpPercentage); + // Check that we don't use both start-value and start-percentage, as they are mutually // exclusive if(parametersNode->getChild("max-ep")->hasAttribute("start-value") && diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index 5f2a4cd9..d623eec0 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -109,6 +109,9 @@ private: //basic int id; int maxHp; + int startHpValue; + double startHpPercentage; + StartType startHpType; int hpRegeneration; int maxEp; int startEpValue; @@ -186,6 +189,9 @@ public: inline int getId() const {return id;} inline int getMaxHp() const {return maxHp;} inline int getHpRegeneration() const {return hpRegeneration;} + inline int getStartHpValue() const {return startHpValue;} + inline double getStartHpPercentage() const {return startHpPercentage;} + inline StartType getStartHpType() const {return startHpType;} inline int getMaxEp() const {return maxEp;} inline int getEpRegeneration() const {return epRegeneration;} inline int getStartEpValue() const {return startEpValue;} From 666333b4a1622832ff927ca03379a4946c8be097 Mon Sep 17 00:00:00 2001 From: titiger Date: Sat, 19 Jul 2014 19:29:41 +0200 Subject: [PATCH 022/258] new style projectiles must have a particle system --- source/glest_game/types/projectile_type.cpp | 23 +++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/source/glest_game/types/projectile_type.cpp b/source/glest_game/types/projectile_type.cpp index ab77addd..3b80c054 100644 --- a/source/glest_game/types/projectile_type.cpp +++ b/source/glest_game/types/projectile_type.cpp @@ -53,19 +53,16 @@ void ProjectileType::load(const XmlNode *projectileNode, const string &dir, cons { attackStartTime=0.0f; } - if(projectileNode->hasChild("particle")){ - const XmlNode *particleNode= projectileNode->getChild("particle"); - bool particleEnabled= particleNode->getAttribute("value")->getBoolValue(); - if(particleEnabled){ - string path= particleNode->getAttribute("path")->getRestrictedValue(); - ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); - projectileParticleSystemType->load(particleNode, dir, currentPath + path, - &Renderer::getInstance(), loadedFileList, parentLoader, - techtreepath); - loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); - setProjectileParticleSystemType(projectileParticleSystemType); - } - } + + // projectiles MUST have a particle system. + const XmlNode *particleNode= projectileNode->getChild("particle"); + string path= particleNode->getAttribute("path")->getRestrictedValue(); + ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); + projectileParticleSystemType->load(particleNode, dir, currentPath + path, + &Renderer::getInstance(), loadedFileList, parentLoader, + techtreepath); + loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); + setProjectileParticleSystemType(projectileParticleSystemType); if(projectileNode->hasChild("hitshake")){ const XmlNode *hitShakeNode= projectileNode->getChild("hitshake"); From 26bab8548cdebaf2f629ccff9dea7e6812f10001 Mon Sep 17 00:00:00 2001 From: titiger Date: Sat, 19 Jul 2014 20:26:45 +0200 Subject: [PATCH 023/258] Splash was broken and destructor needs to cleanup more --- source/glest_game/types/projectile_type.cpp | 12 +++++++----- source/glest_game/types/projectile_type.h | 11 +---------- source/glest_game/world/unit_updater.cpp | 4 ++-- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/source/glest_game/types/projectile_type.cpp b/source/glest_game/types/projectile_type.cpp index 3b80c054..3e1607c3 100644 --- a/source/glest_game/types/projectile_type.cpp +++ b/source/glest_game/types/projectile_type.cpp @@ -24,11 +24,6 @@ ProjectileType::ProjectileType() { projectileParticleSystemType=NULL; attackStartTime=0.0f; - splash=false; - splashRadius=0; - splashDamageAll=true; - splashParticleSystemType=NULL; - shake=false; shakeIntensity=0; shakeDuration=0; @@ -39,6 +34,13 @@ ProjectileType::ProjectileType() { } +ProjectileType::~ProjectileType() { + deleteValues(hitSounds.getSounds().begin(), hitSounds.getSounds().end()); + if(projectileParticleSystemType!=NULL){ + delete projectileParticleSystemType; + projectileParticleSystemType = NULL; + } +} void ProjectileType::load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map > > &loadedFileList, string parentLoader){ diff --git a/source/glest_game/types/projectile_type.h b/source/glest_game/types/projectile_type.h index 3a3b6ec6..113ae607 100644 --- a/source/glest_game/types/projectile_type.h +++ b/source/glest_game/types/projectile_type.h @@ -41,11 +41,6 @@ protected: SoundContainer hitSounds; float attackStartTime; - bool splash; - int splashRadius; - bool splashDamageAll; - ParticleSystemTypeSplash* splashParticleSystemType; - bool shake; int shakeIntensity; int shakeDuration; @@ -56,7 +51,7 @@ protected: public: ProjectileType(); - virtual ~ProjectileType(){}; + virtual ~ProjectileType(); void load(const XmlNode *projectileNode, const string &dir, const string &techtreepath, std::map > > &loadedFileList, @@ -67,10 +62,6 @@ public: ParticleSystemTypeProjectile* getProjectileParticleSystemType() const { return projectileParticleSystemType;} float getAttackStartTime() const {return attackStartTime;} void setAttackStartTime(float value) {attackStartTime=value;} - bool isSplash() const { return splash;} - bool isSplashDamageAll() const { return splashDamageAll;} - ParticleSystemTypeSplash* getSplashParticleSystemType() const { return splashParticleSystemType;} - int getSplashRadius() const { return splashRadius;} bool isShake() const{return shake;} bool isShakeCameraDistanceAffected() const{return shakeCameraDistanceAffected;} diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 062cff84..dbfda944 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2639,8 +2639,8 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit, float lastAnimProgress, } renderer.manageParticleSystem(psProj, rsGame); unit->addAttackParticleSystem(psProj); - ParticleSystemTypeSplash *splashType=(*pt)->getSplashParticleSystemType(); - if(splashType!=NULL){ + + if(pstSplash!=NULL){ SplashParticleSystem *psSplash= pstSplash->create(unit); psSplash->setPos(endPos); psSplash->setVisible(visible); From 23deb957a74c608374002ec1436bee54e86ea0c3 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 15:37:59 -0600 Subject: [PATCH 024/258] First, basic looting implementation Only absolute values are obtained for now, no loss. --- source/glest_game/types/unit_type.cpp | 26 ++++++++++++++++++ source/glest_game/types/unit_type.h | 35 ++++++++++++++++++++++++ source/glest_game/world/unit_updater.cpp | 7 +++++ 3 files changed, 68 insertions(+) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index c8e0be10..6f3fb13d 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -592,6 +592,32 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } sortedItems.clear(); + // Lootable resources + if(parametersNode->hasChild("resources-death")) { + const XmlNode *deathResourcesNode= parametersNode->getChild("resources-death"); + + for(int i=0; i < deathResourcesNode->getChildCount(); ++i){ + const XmlNode *resourceNode= deathResourcesNode->getChild("resource", i); + + // TODO: Add rest of attributes and make appropriate ones optional + string name= resourceNode->getAttribute("name")->getRestrictedValue(); + int amountValue= resourceNode->getAttribute("amount-value")->getIntValue(); + + LootableResource resource; + resource.setResourceType(techTree->getResourceType(name)); + resource.setAmountValue(amountValue); + + lootableResources.push_back(resource); + + // TODO: Add checks for duplicate resources + } + } + + // TODO: For debug purposes only -- remove + for(int i = 0; i < lootableResources.size(); i++) { + printf("Lootable resource %s has amount %d\n", lootableResources[i].getResourceType()->getName().c_str(), lootableResources[i].getAmountValue()); + } + //image const XmlNode *imageNode= parametersNode->getChild("image"); image= Renderer::getInstance().newTexture2D(rsGame); diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index d623eec0..1635802f 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -63,6 +63,37 @@ public: static const Level * loadGame(const XmlNode *rootNode, const UnitType *ut); }; +// =============================== +// class LootResource +// +/// Stores information about a lootable resource. Lootable resources are stolen by the attacker on death. +// =============================== + +class LootableResource { +private: + const ResourceType *type; + int amountValue; + double amountPercentage; + int lossValue; + double lossPercentage; + +public: + const ResourceType* getResourceType() {return type;} + void setResourceType(const ResourceType *type) {this->type=type;} + + int getAmountValue() {return amountValue;} + void setAmountValue(int amountValue) {this->amountValue=amountValue;} + + double getAmountPercentage() {return amountPercentage;} + void setAmountPercentage(double amountPercentage) {this->amountPercentage=amountPercentage;} + + int getLossValue() {return lossValue;} + void setLossValue(int lossValue) {this->lossValue=lossValue;} + + double getLossPercentage() {return lossPercentage;} + void setLossPercentage(double lossPercentage) {this->lossPercentage=lossPercentage;} +}; + // =============================== // class UnitType // @@ -104,6 +135,7 @@ private: typedef vector CommandTypes; typedef vector StoredResources; typedef vector Levels; + typedef vector LootableResources; private: //basic @@ -151,6 +183,7 @@ private: CommandTypes commandTypes; StoredResources storedResources; Levels levels; + LootableResources lootableResources; //meeting point bool meetingPoint; @@ -220,6 +253,8 @@ public: int getHeight() const {return height;} int getStoredResourceCount() const {return (int)storedResources.size();} inline const Resource *getStoredResource(int i) const {return &storedResources[i];} + int getLootableResourceCount() const {return lootableResources.size();} + inline const LootableResource getLootableResource(int i) const {return lootableResources.at(i);} bool getCellMapCell(int x, int y, CardinalDir facing) const; inline bool getMeetingPoint() const {return meetingPoint;} inline bool getCountUnitDeathInStats() const {return countUnitDeathInStats;} diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index de9d6560..4ee4a4b6 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2573,6 +2573,13 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac attacker->incKills(attacked->getTeam()); } + // TODO: Add looting here + int lootableResourceCount = attacked->getType()->getLootableResourceCount(); + for(int i = 0; i < lootableResourceCount; i++) { + LootableResource resource = attacked->getType()->getLootableResource(i); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); + } + switch(this->game->getGameSettings()->getPathFinderType()) { case pfBasic: break; From df0d7aaac96188ce027190c10d50f9a5a0305124 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 16:13:09 -0600 Subject: [PATCH 025/258] Implemented rest of resource amount/loss attrs --- source/glest_game/types/unit_type.cpp | 39 ++++++++++++++++++------ source/glest_game/world/unit_updater.cpp | 14 ++++++++- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 6f3fb13d..f4327201 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -598,14 +598,40 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, for(int i=0; i < deathResourcesNode->getChildCount(); ++i){ const XmlNode *resourceNode= deathResourcesNode->getChild("resource", i); - - // TODO: Add rest of attributes and make appropriate ones optional string name= resourceNode->getAttribute("name")->getRestrictedValue(); - int amountValue= resourceNode->getAttribute("amount-value")->getIntValue(); LootableResource resource; resource.setResourceType(techTree->getResourceType(name)); - resource.setAmountValue(amountValue); + + // All attributes are optional, although nothing happens if they aren't used. They can + // be combined freely. Percentages will take affect before absolute values. + if(resourceNode->hasAttribute("amount-value")) { + resource.setAmountValue(resourceNode->getAttribute("amount-value")->getIntValue()); + } + else { + resource.setAmountValue(0); + } + + if(resourceNode->hasAttribute("amount-percentage")) { + resource.setAmountPercentage(resourceNode->getAttribute("amount-percentage")->getFloatValue()); + } + else { + resource.setAmountPercentage(0); + } + + if(resourceNode->hasAttribute("loss-value")) { + resource.setLossValue(resourceNode->getAttribute("loss-value")->getIntValue()); + } + else { + resource.setLossValue(0); + } + + if(resourceNode->hasAttribute("loss-percentage")) { + resource.setLossPercentage(resourceNode->getAttribute("loss-percentage")->getFloatValue()); + } + else { + resource.setLossPercentage(0); + } lootableResources.push_back(resource); @@ -613,11 +639,6 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } } - // TODO: For debug purposes only -- remove - for(int i = 0; i < lootableResources.size(); i++) { - printf("Lootable resource %s has amount %d\n", lootableResources[i].getResourceType()->getName().c_str(), lootableResources[i].getAmountValue()); - } - //image const XmlNode *imageNode= parametersNode->getChild("image"); image= Renderer::getInstance().newTexture2D(rsGame); diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 4ee4a4b6..08e4d139 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2573,10 +2573,22 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac attacker->incKills(attacked->getTeam()); } - // TODO: Add looting here int lootableResourceCount = attacked->getType()->getLootableResourceCount(); for(int i = 0; i < lootableResourceCount; i++) { LootableResource resource = attacked->getType()->getLootableResource(i); + + // Figure out how much of the resource in question that the attacked unit's faction has + int factionTotalResource = 0; + for(int j = 0; j < attacked->getFaction()->getTechTree()->getResourceTypeCount(); j++) { + if(attacked->getFaction()->getTechTree()->getResourceType(j) == resource.getResourceType()) { + factionTotalResource = attacked->getFaction()->getResource(j)->getAmount(); + break; + } + } + + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossPercentage() * factionTotalResource); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossValue()); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountPercentage() * factionTotalResource); attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); } From 68455a819f16097518d5dba6e1c4955c137625df Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 16:38:33 -0600 Subject: [PATCH 026/258] Added setting to disable going into negatives After all, how does one loot what the other faction does not have? Still, could be useful for some places, by forcing the opponent to go into "debt". --- source/glest_game/types/unit_type.cpp | 7 +++++++ source/glest_game/types/unit_type.h | 4 ++++ source/glest_game/world/unit_updater.cpp | 17 +++++++++++++---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index f4327201..75a31207 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -632,6 +632,13 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, else { resource.setLossPercentage(0); } + + if(resourceNode->hasAttribute("allow-negative")) { + resource.setNegativeAllowed(resourceNode->getAttribute("allow-negative")->getBoolValue()); + } + else { + resource.setNegativeAllowed(false); + } lootableResources.push_back(resource); diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index 1635802f..b32a42ee 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -76,6 +76,7 @@ private: double amountPercentage; int lossValue; double lossPercentage; + bool negativeAllowed; public: const ResourceType* getResourceType() {return type;} @@ -92,6 +93,9 @@ public: double getLossPercentage() {return lossPercentage;} void setLossPercentage(double lossPercentage) {this->lossPercentage=lossPercentage;} + + bool isNegativeAllowed() {return negativeAllowed;} + void setNegativeAllowed(bool negativeAllowed) {this->negativeAllowed=negativeAllowed;} }; // =============================== diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 08e4d139..b297d4ea 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2586,10 +2586,19 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac } } - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossPercentage() * factionTotalResource); - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossValue()); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountPercentage() * factionTotalResource); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); + if(resource.isNegativeAllowed()) { + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossPercentage() * factionTotalResource); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossValue()); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountPercentage() * factionTotalResource); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); + } + // Can't take more resources than the faction has, otherwise we end up in the negatives + else { + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossPercentage() * factionTotalResource, factionTotalResource)); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossValue(), factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountPercentage() * factionTotalResource, factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountValue(), factionTotalResource)); + } } switch(this->game->getGameSettings()->getPathFinderType()) { From 3cae2559c759f349bfd5a63dc678b7bfa93799da Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 16:44:11 -0600 Subject: [PATCH 027/258] No looting if you attack units in same faction --- source/glest_game/world/unit_updater.cpp | 47 +++++++++++++----------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index b297d4ea..16c5efc5 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2573,31 +2573,34 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac attacker->incKills(attacked->getTeam()); } - int lootableResourceCount = attacked->getType()->getLootableResourceCount(); - for(int i = 0; i < lootableResourceCount; i++) { - LootableResource resource = attacked->getType()->getLootableResource(i); + // Perform resource looting iff the attack is from a different faction + if(attacker->getFaction() != attacked->getFaction()) { + int lootableResourceCount = attacked->getType()->getLootableResourceCount(); + for(int i = 0; i < lootableResourceCount; i++) { + LootableResource resource = attacked->getType()->getLootableResource(i); - // Figure out how much of the resource in question that the attacked unit's faction has - int factionTotalResource = 0; - for(int j = 0; j < attacked->getFaction()->getTechTree()->getResourceTypeCount(); j++) { - if(attacked->getFaction()->getTechTree()->getResourceType(j) == resource.getResourceType()) { - factionTotalResource = attacked->getFaction()->getResource(j)->getAmount(); - break; + // Figure out how much of the resource in question that the attacked unit's faction has + int factionTotalResource = 0; + for(int j = 0; j < attacked->getFaction()->getTechTree()->getResourceTypeCount(); j++) { + if(attacked->getFaction()->getTechTree()->getResourceType(j) == resource.getResourceType()) { + factionTotalResource = attacked->getFaction()->getResource(j)->getAmount(); + break; + } } - } - if(resource.isNegativeAllowed()) { - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossPercentage() * factionTotalResource); - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossValue()); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountPercentage() * factionTotalResource); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); - } - // Can't take more resources than the faction has, otherwise we end up in the negatives - else { - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossPercentage() * factionTotalResource, factionTotalResource)); - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossValue(), factionTotalResource)); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountPercentage() * factionTotalResource, factionTotalResource)); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountValue(), factionTotalResource)); + if(resource.isNegativeAllowed()) { + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossPercentage() * factionTotalResource); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossValue()); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountPercentage() * factionTotalResource); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); + } + // Can't take more resources than the faction has, otherwise we end up in the negatives + else { + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossPercentage() * factionTotalResource, factionTotalResource)); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossValue(), factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountPercentage() * factionTotalResource, factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountValue(), factionTotalResource)); + } } } From 75eb5c8ddf90d5c70acac26df6a8b5c5b5c6430e Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 16:52:53 -0600 Subject: [PATCH 028/258] Lootable resources now checks for dups --- source/glest_game/types/unit_type.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 75a31207..b8b07dff 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -591,8 +591,9 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } } sortedItems.clear(); + hasDup = false; - // Lootable resources + // Lootable resources (resources given/lost on death) if(parametersNode->hasChild("resources-death")) { const XmlNode *deathResourcesNode= parametersNode->getChild("resources-death"); @@ -640,9 +641,13 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, resource.setNegativeAllowed(false); } - lootableResources.push_back(resource); + // Figure out if there are duplicate resources. The value stored in the map is arbitrary, + // and exists solely because + if(std::find(lootableResources.begin(), lootableResources.end(), resource) != lootableResources.end()) { + printf("WARNING, unit type [%s] has one or more duplicate lootable resources\n", this->getName(false).c_str()); + } - // TODO: Add checks for duplicate resources + lootableResources.push_back(resource); } } From cedb20646ef62b91347a1a30209a80ee5597e3b0 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 17:43:27 -0600 Subject: [PATCH 029/258] Fixed compilation error Failed to override == --- source/glest_game/types/unit_type.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index b32a42ee..af2367ee 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -79,23 +79,27 @@ private: bool negativeAllowed; public: - const ResourceType* getResourceType() {return type;} + const ResourceType* getResourceType() const {return type;} void setResourceType(const ResourceType *type) {this->type=type;} - int getAmountValue() {return amountValue;} + int getAmountValue() const {return amountValue;} void setAmountValue(int amountValue) {this->amountValue=amountValue;} - double getAmountPercentage() {return amountPercentage;} + double getAmountPercentage() const {return amountPercentage;} void setAmountPercentage(double amountPercentage) {this->amountPercentage=amountPercentage;} - int getLossValue() {return lossValue;} + int getLossValue() const {return lossValue;} void setLossValue(int lossValue) {this->lossValue=lossValue;} - double getLossPercentage() {return lossPercentage;} + double getLossPercentage() const {return lossPercentage;} void setLossPercentage(double lossPercentage) {this->lossPercentage=lossPercentage;} - bool isNegativeAllowed() {return negativeAllowed;} + bool isNegativeAllowed() const {return negativeAllowed;} void setNegativeAllowed(bool negativeAllowed) {this->negativeAllowed=negativeAllowed;} + + bool operator==(const LootableResource& other) { + return type == other.getResourceType(); + } }; // =============================== From 191c353491282d19684a5cd4e5378dbdd55d76b6 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 18:07:24 -0600 Subject: [PATCH 030/258] Fixing platform inconsistency It appears that the issue is a Windows problem, with Windows providing macros for min and max that interfere with using the proper ones defined in the algorithm header file. --- source/glest_game/world/unit_updater.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 16c5efc5..7a6ac884 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2596,10 +2596,10 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac } // Can't take more resources than the faction has, otherwise we end up in the negatives else { - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossPercentage() * factionTotalResource, factionTotalResource)); - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -min(resource.getLossValue(), factionTotalResource)); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountPercentage() * factionTotalResource, factionTotalResource)); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), min(resource.getAmountValue(), factionTotalResource)); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(static_cast(resource.getLossPercentage() * factionTotalResource), factionTotalResource)); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(resource.getLossValue(), factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(static_cast(resource.getAmountPercentage() * factionTotalResource), factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(resource.getAmountValue(), factionTotalResource)); } } } From ef0cf706b39c82b1df18c36f91a6859d63a46708 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 18:59:11 -0600 Subject: [PATCH 031/258] Converted percentages to use int instead of float May help prevent floating point calculation errors in multiplayer. --- source/glest_game/type_instances/unit.cpp | 4 ++-- source/glest_game/types/unit_type.cpp | 4 ++-- source/glest_game/types/unit_type.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 9ba9d44b..74e75b49 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -1959,7 +1959,7 @@ void Unit::born(const CommandType *ct) { this->hp= type->getStartHpValue(); } else { - this->hp= type->getStartHpPercentage() * type->getTotalMaxHp(&totalUpgrade); + this->hp= type->getTotalMaxHp(&totalUpgrade) * 100 / type->getStartHpPercentage(); } if(original_hp != this->hp) { @@ -1975,7 +1975,7 @@ void Unit::born(const CommandType *ct) { this->ep= type->getStartEpValue(); } else { - this->ep= type->getStartEpPercentage() * type->getTotalMaxEp(&totalUpgrade); + this->ep= type->getTotalMaxEp(&totalUpgrade) * 100 / type->getStartEpPercentage(); } } diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index c8e0be10..7d926fb8 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -271,7 +271,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, //startHpPercentage -- the *relative* value to use for starting HP if(parametersNode->getChild("max-hp")->hasAttribute("start-percentage")) { - startHpPercentage= parametersNode->getChild("max-hp")->getAttribute("start-percentage")->getFloatValue(); + startHpPercentage= parametersNode->getChild("max-hp")->getAttribute("start-percentage")->getIntValue(); startHpType= stPercentage; } @@ -301,7 +301,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, //startEpPercentage -- the *relative* value to use for starting EP if(parametersNode->getChild("max-ep")->hasAttribute("start-percentage")) { - startEpPercentage= parametersNode->getChild("max-ep")->getAttribute("start-percentage")->getFloatValue(); + startEpPercentage= parametersNode->getChild("max-ep")->getAttribute("start-percentage")->getIntValue(); startEpType= stPercentage; } addItemToVault(&(this->startEpPercentage),this->startEpPercentage); diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index d623eec0..afe5cc05 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -110,12 +110,12 @@ private: int id; int maxHp; int startHpValue; - double startHpPercentage; + int startHpPercentage; StartType startHpType; int hpRegeneration; int maxEp; int startEpValue; - double startEpPercentage; + int startEpPercentage; StartType startEpType; int epRegeneration; int maxUnitCount; @@ -190,12 +190,12 @@ public: inline int getMaxHp() const {return maxHp;} inline int getHpRegeneration() const {return hpRegeneration;} inline int getStartHpValue() const {return startHpValue;} - inline double getStartHpPercentage() const {return startHpPercentage;} + inline int getStartHpPercentage() const {return startHpPercentage;} inline StartType getStartHpType() const {return startHpType;} inline int getMaxEp() const {return maxEp;} inline int getEpRegeneration() const {return epRegeneration;} inline int getStartEpValue() const {return startEpValue;} - inline double getStartEpPercentage() const {return startEpPercentage;} + inline int getStartEpPercentage() const {return startEpPercentage;} inline StartType getStartEpType() const {return startEpType;} inline int getMaxUnitCount() const {return maxUnitCount;} inline bool getField(Field field) const {return fields[field];} From f0801b3c33a2ecb5708b598e6fec29fd8a3bbf00 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 19:03:33 -0600 Subject: [PATCH 032/258] Converted floats to ints As discussed with Titi, this may prevent some issues with multiplayer getting out of sync due to different floating point calculations. --- source/glest_game/types/unit_type.cpp | 4 ++-- source/glest_game/types/unit_type.h | 12 ++++++------ source/glest_game/world/unit_updater.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index 11ee7285..a43a2034 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -614,7 +614,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } if(resourceNode->hasAttribute("amount-percentage")) { - resource.setAmountPercentage(resourceNode->getAttribute("amount-percentage")->getFloatValue()); + resource.setAmountPercentage(resourceNode->getAttribute("amount-percentage")->getIntValue()); } else { resource.setAmountPercentage(0); @@ -628,7 +628,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, } if(resourceNode->hasAttribute("loss-percentage")) { - resource.setLossPercentage(resourceNode->getAttribute("loss-percentage")->getFloatValue()); + resource.setLossPercentage(resourceNode->getAttribute("loss-percentage")->getIntValue()); } else { resource.setLossPercentage(0); diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index a0ce6a7c..0342394a 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -73,9 +73,9 @@ class LootableResource { private: const ResourceType *type; int amountValue; - double amountPercentage; + int amountPercentage; int lossValue; - double lossPercentage; + int lossPercentage; bool negativeAllowed; public: @@ -85,14 +85,14 @@ public: int getAmountValue() const {return amountValue;} void setAmountValue(int amountValue) {this->amountValue=amountValue;} - double getAmountPercentage() const {return amountPercentage;} - void setAmountPercentage(double amountPercentage) {this->amountPercentage=amountPercentage;} + int getAmountPercentage() const {return amountPercentage;} + void setAmountPercentage(int amountPercentage) {this->amountPercentage=amountPercentage;} int getLossValue() const {return lossValue;} void setLossValue(int lossValue) {this->lossValue=lossValue;} - double getLossPercentage() const {return lossPercentage;} - void setLossPercentage(double lossPercentage) {this->lossPercentage=lossPercentage;} + int getLossPercentage() const {return lossPercentage;} + void setLossPercentage(int lossPercentage) {this->lossPercentage=lossPercentage;} bool isNegativeAllowed() const {return negativeAllowed;} void setNegativeAllowed(bool negativeAllowed) {this->negativeAllowed=negativeAllowed;} diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 7a6ac884..fe5b8384 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2589,16 +2589,16 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac } if(resource.isNegativeAllowed()) { - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossPercentage() * factionTotalResource); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(factionTotalResource * 100 / resource.getLossPercentage())); attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossValue()); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountPercentage() * factionTotalResource); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), factionTotalResource * 100 / resource.getAmountPercentage()); attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); } // Can't take more resources than the faction has, otherwise we end up in the negatives else { - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(static_cast(resource.getLossPercentage() * factionTotalResource), factionTotalResource)); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(factionTotalResource * 100 / resource.getLossPercentage(), factionTotalResource)); attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(resource.getLossValue(), factionTotalResource)); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(static_cast(resource.getAmountPercentage() * factionTotalResource), factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(factionTotalResource * 100 / resource.getAmountPercentage(), factionTotalResource)); attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(resource.getAmountValue(), factionTotalResource)); } } From b9eb74d916e18c93612e7527f325825ffc9c30c9 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 19:12:34 -0600 Subject: [PATCH 033/258] Percentages were wrong way around --- source/glest_game/world/unit_updater.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index fe5b8384..6e0bc167 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2589,16 +2589,16 @@ void UnitUpdater::damage(Unit *attacker, const AttackSkillType* ast, Unit *attac } if(resource.isNegativeAllowed()) { - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(factionTotalResource * 100 / resource.getLossPercentage())); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(factionTotalResource * resource.getLossPercentage() / 100)); attacked->getFaction()->incResourceAmount(resource.getResourceType(), -resource.getLossValue()); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), factionTotalResource * 100 / resource.getAmountPercentage()); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), factionTotalResource * resource.getAmountPercentage() / 100); attacker->getFaction()->incResourceAmount(resource.getResourceType(), resource.getAmountValue()); } // Can't take more resources than the faction has, otherwise we end up in the negatives else { - attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(factionTotalResource * 100 / resource.getLossPercentage(), factionTotalResource)); + attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(factionTotalResource * resource.getLossPercentage() / 100, factionTotalResource)); attacked->getFaction()->incResourceAmount(resource.getResourceType(), -(std::min)(resource.getLossValue(), factionTotalResource)); - attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(factionTotalResource * 100 / resource.getAmountPercentage(), factionTotalResource)); + attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(factionTotalResource * resource.getAmountPercentage() / 100, factionTotalResource)); attacker->getFaction()->incResourceAmount(resource.getResourceType(), (std::min)(resource.getAmountValue(), factionTotalResource)); } } From da23e4c0488ba4270354a5c8ed8a0daaca7c70ed Mon Sep 17 00:00:00 2001 From: titiger Date: Sun, 20 Jul 2014 03:28:03 +0200 Subject: [PATCH 034/258] multi sounds multiple sounds timed sounds for all skills. By this you can now play a sound for shooting every single shot too. --- source/glest_game/type_instances/faction.cpp | 2 +- source/glest_game/type_instances/unit.cpp | 8 ++-- source/glest_game/types/skill_type.cpp | 43 ++++++++++++++++---- source/glest_game/types/skill_type.h | 31 +++++++++++--- source/glest_game/world/unit_updater.cpp | 8 ++-- 5 files changed, 72 insertions(+), 20 deletions(-) diff --git a/source/glest_game/type_instances/faction.cpp b/source/glest_game/type_instances/faction.cpp index 63db47ad..aad40ae4 100644 --- a/source/glest_game/type_instances/faction.cpp +++ b/source/glest_game/type_instances/faction.cpp @@ -1209,7 +1209,7 @@ void Faction::applyCostsOnInterval(const ResourceType *rtApply) { world->getStats()->die(unit->getFactionIndex(),unit->getType()->getCountUnitDeathInStats()); scriptManager->onUnitDied(unit); } - StaticSound *sound= unit->getType()->getFirstStOfClass(scDie)->getSound(); + StaticSound *sound= static_cast(unit->getType()->getFirstStOfClass(scDie))->getSound(); if(sound != NULL && (thisFaction == true || world->showWorldForPlayer(world->getThisTeamIndex()) == true)) { SoundRenderer::getInstance().playFx(sound); diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 7042c4ee..cbe3c050 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -2937,7 +2937,7 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) { Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); game->getScriptManager()->onUnitDied(this); - StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); + StaticSound *sound= static_cast(this->getType()->getFirstStOfClass(scDie))->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { @@ -3035,7 +3035,7 @@ void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) { Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); game->getScriptManager()->onUnitDied(this); - StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); + StaticSound *sound= static_cast(this->getType()->getFirstStOfClass(scDie))->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { @@ -3107,7 +3107,7 @@ void Unit::tick() { Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); game->getScriptManager()->onUnitDied(this); } - StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); + StaticSound *sound= static_cast(this->getType()->getFirstStOfClass(scDie))->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { @@ -3146,7 +3146,7 @@ void Unit::tick() { Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); game->getScriptManager()->onUnitDied(this); } - StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); + StaticSound *sound= static_cast(this->getType()->getFirstStOfClass(scDie))->getSound(); if(sound != NULL && (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 8ccff7e7..a9832c3a 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -274,12 +274,27 @@ void AttackBoost::saveGame(XmlNode *rootNode) const { attackBoostNode->addAttribute("name",name, mapTagReplacements); } +// ===================================================== +// class SkillSound +// ===================================================== +SkillSound::SkillSound(){ + startTime=0.0f; +} +SkillSound::~SkillSound() +{ + deleteValues(soundContainer.getSounds().begin(), soundContainer.getSounds().end()); + startTime=0.0f; + //soundContainer +} // ===================================================== // class SkillType // ===================================================== SkillType::~SkillType() { - deleteValues(sounds.getSounds().begin(), sounds.getSounds().end()); + while(!skillSoundList.empty()) { + delete skillSoundList.back(); + skillSoundList.pop_back(); + } //remove unitParticleSystemTypes while(!unitParticleSystemTypes.empty()) { delete unitParticleSystemTypes.back(); @@ -505,11 +520,16 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, } //sound - if(sn->hasChild("sound")) { - const XmlNode *soundNode= sn->getChild("sound"); + vector soundNodeList = sn->getChildList("sound"); + for(unsigned int i = 0; i < soundNodeList.size(); ++i) { + const XmlNode *soundNode= soundNodeList[i]; if(soundNode->getAttribute("enabled")->getBoolValue()) { - soundStartTime= soundNode->getAttribute("start-time")->getFloatValue(); - sounds.resize((int)soundNode->getChildCount()); + float soundStartTime= soundNode->getAttribute("start-time")->getFloatValue(); + SkillSound *skillSound = new SkillSound(); + skillSound->setStartTime(soundStartTime); + + skillSound->getSoundContainer()->resize((int)soundNode->getChildCount()); + skillSoundList.push_back(skillSound); for(int i = 0; i < (int)soundNode->getChildCount(); ++i) { const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); @@ -517,7 +537,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, StaticSound *sound= new StaticSound(); sound->load(path); loadedFileList[path].push_back(make_pair(parentLoader,soundFileNode->getAttribute("path")->getRestrictedValue())); - sounds[i]= sound; + (*skillSound->getSoundContainer())[i]= sound; } } } @@ -744,7 +764,7 @@ void SkillType::saveGame(XmlNode *rootNode) { // // SoundContainer sounds; // float soundStartTime; - skillTypeNode->addAttribute("soundStartTime",floatToStr(soundStartTime,6), mapTagReplacements); +// skillTypeNode->addAttribute("soundStartTime",floatToStr(soundStartTime,6), mapTagReplacements); // RandomGen random; skillTypeNode->addAttribute("random",intToStr(random.getLastNumber()), mapTagReplacements); // AttackBoost attackBoost; @@ -1299,6 +1319,15 @@ void DieSkillType::saveGame(XmlNode *rootNode) { dieSkillTypeNode->addAttribute("fade",intToStr(fade), mapTagReplacements); } +StaticSound *DieSkillType::getSound() const{ + if(skillSoundList.size()==0){ + return NULL; + } + else { + return skillSoundList.front()->getSoundContainer()->getRandSound(); + } +} + // ===================================================== // class FogOfWarSkillType diff --git a/source/glest_game/types/skill_type.h b/source/glest_game/types/skill_type.h index f65989b3..290c1903 100644 --- a/source/glest_game/types/skill_type.h +++ b/source/glest_game/types/skill_type.h @@ -125,8 +125,29 @@ public: int toHp; }; +// ===================================================== +// class SkillSound +// holds the start time and a SoundContainer +// ===================================================== + +class SkillSound{ +private: + SoundContainer soundContainer; + float startTime; + +public: + SkillSound(); + ~SkillSound(); + + SoundContainer *getSoundContainer() {return &soundContainer;} + float getStartTime() const {return startTime;} + void setStartTime(float value) {startTime=value;} +}; + +typedef list SkillSoundList; + class SkillType { - + protected: SkillClass skillClass; string name; @@ -157,8 +178,7 @@ protected: vector animations; vector animationAttributes; - SoundContainer sounds; - float soundStartTime; + SkillSoundList skillSoundList; RandomGen random; AttackBoost attackBoost; @@ -197,14 +217,14 @@ public: int getSpeed() const {return speed;} int getAnimSpeed() const {return animSpeed;} Model *getAnimation(float animProgress=0, const Unit *unit=NULL, int *lastAnimationIndex=NULL, int *animationRandomCycleCount=NULL) const; - StaticSound *getSound() const {return sounds.getRandSound();} - float getSoundStartTime() const {return soundStartTime;} float getShakeStartTime() const {return shakeStartTime;} bool getShake() const {return shake;} int getShakeIntensity() const {return shakeIntensity;} int getShakeDuration() const {return shakeDuration;} + const SkillSoundList * getSkillSoundList() const {return &skillSoundList;} + bool getShakeSelfEnabled() const {return shakeSelfEnabled;} bool getShakeSelfVisible() const {return shakeSelfVisible;} bool getShakeSelfInCameraView() const {return shakeSelfInCameraView;} @@ -450,6 +470,7 @@ public: virtual string toString(bool translatedValue) const; virtual void saveGame(XmlNode *rootNode); + StaticSound *getSound() const; }; // =============================== diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index dbfda944..90835e11 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -128,16 +128,18 @@ bool UnitUpdater::updateUnit(Unit *unit) { //play skill sound const SkillType *currSkill= unit->getCurrSkill(); - if(currSkill->getSound() != NULL) { - float soundStartTime= currSkill->getSoundStartTime(); + + for(SkillSoundList::const_iterator it= currSkill->getSkillSoundList()->begin(); it != currSkill->getSkillSoundList()->end(); ++it) { + float soundStartTime= (*it)->getStartTime(); if(soundStartTime >= unit->getLastAnimProgressAsFloat() && soundStartTime < unit->getAnimProgressAsFloat()) { if(map->getSurfaceCell(Map::toSurfCoords(unit->getPos()))->isVisible(world->getThisTeamIndex()) || (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true)) { - soundRenderer.playFx(currSkill->getSound(), unit->getCurrVector(), gameCamera->getPos()); + soundRenderer.playFx((*it)->getSoundContainer()->getRandSound(), unit->getCurrVector(), gameCamera->getPos()); } } } + if (currSkill->getShake()) { float shakeStartTime = currSkill->getShakeStartTime(); if (shakeStartTime >= unit->getLastAnimProgressAsFloat() From 3165e4101420b316f281bd3cf3de24c7f380e3bd Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 22:01:34 -0600 Subject: [PATCH 035/258] Attack speed is now upgradable Syntax is the same as all other upgrade stats. This also allows attack boosts to upgrade the attack speed (since they use the same code). --- source/glest_game/type_instances/unit.cpp | 10 ++- source/glest_game/types/command_type.cpp | 6 ++ source/glest_game/types/skill_type.cpp | 10 +++ source/glest_game/types/skill_type.h | 2 + source/glest_game/types/upgrade_type.cpp | 93 +++++++++++++++++++++++ source/glest_game/types/upgrade_type.h | 9 +++ 6 files changed, 129 insertions(+), 1 deletion(-) diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 7042c4ee..3166cf5d 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -2615,7 +2615,15 @@ bool Unit::update() { int64 heightFactor = getHeightFactor(ANIMATION_SPEED_MULTIPLIER); int64 speedDenominator = speedDivider * game->getWorld()->getUpdateFps(this->getFactionIndex()); - int64 progressIncrease = (currSkill->getAnimSpeed() * heightFactor) / speedDenominator; + + // Override the animation speed for attacks that have upgraded the attack speed + int animSpeed = currSkill->getAnimSpeed(); + if(currSkill->getClass() == scAttack) { + int animSpeedBoost = ((AttackSkillType *) currSkill)->getAnimSpeedBoost(&totalUpgrade); + animSpeed += animSpeedBoost; + } + + int64 progressIncrease = (animSpeed * heightFactor) / speedDenominator; // Ensure we increment at least a value of 1 of the action will be stuck infinitely if(currSkill->getAnimSpeed() > 0 && heightFactor > 0 && progressIncrease == 0) { progressIncrease = 1; diff --git a/source/glest_game/types/command_type.cpp b/source/glest_game/types/command_type.cpp index 6e775622..7c3e2b6a 100644 --- a/source/glest_game/types/command_type.cpp +++ b/source/glest_game/types/command_type.cpp @@ -288,7 +288,13 @@ string AttackCommandType::getDesc(const TotalUpgrade *totalUpgrade, bool transla } str+="\n"; + //attack speed str+= lang.getString("AttackSpeed",(translatedValue == true ? "" : "english"))+": "+ intToStr(attackSkillType->getSpeed()) +"\n"; + if(totalUpgrade->getAttackSpeed(attackSkillType) != 0) { + str+= "+"+intToStr(totalUpgrade->getAttackSpeed(attackSkillType)); + } + str+="\n"; + str+=attackSkillType->getBoostDesc(translatedValue); return str; } diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 7a72c5ce..9aabec79 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -935,6 +935,16 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, } } +int AttackSkillType::getTotalSpeed(const TotalUpgrade *totalUpgrade) const{ + int result = speed + totalUpgrade->getAttackSpeed(this); + result = max(0,result); + return result; +} + +int AttackSkillType::getAnimSpeedBoost(const TotalUpgrade *totalUpgrade) const{ + return totalUpgrade->getAttackSpeed(this); +} + string AttackSkillType::toString(bool translatedValue) const{ if(translatedValue == false) { return "Attack"; diff --git a/source/glest_game/types/skill_type.h b/source/glest_game/types/skill_type.h index 75db79b7..ead459bc 100644 --- a/source/glest_game/types/skill_type.h +++ b/source/glest_game/types/skill_type.h @@ -309,6 +309,8 @@ public: //misc int getTotalAttackStrength(const TotalUpgrade *totalUpgrade) const; int getTotalAttackRange(const TotalUpgrade *totalUpgrade) const; + virtual int getTotalSpeed(const TotalUpgrade *totalUpgrade) const; + virtual int getAnimSpeedBoost(const TotalUpgrade *totalUpgrade) const; virtual void saveGame(XmlNode *rootNode); }; diff --git a/source/glest_game/types/upgrade_type.cpp b/source/glest_game/types/upgrade_type.cpp index 812f247d..b47a97ce 100644 --- a/source/glest_game/types/upgrade_type.cpp +++ b/source/glest_game/types/upgrade_type.cpp @@ -169,6 +169,19 @@ void UpgradeTypeBase::load(const XmlNode *upgradeNode, string upgradename) { else { prodSpeed = 0; } + + attackSpeedIsMultiplier = false; + if(upgradeNode->hasChild("attack-speed") == true) { + attackSpeed= upgradeNode->getChild("attack-speed")->getAttribute("value")->getIntValue(); + if(upgradeNode->getChild("attack-speed")->getAttribute(VALUE_PERCENT_MULTIPLIER_KEY_NAME,false) != NULL) { + attackSpeedIsMultiplier = upgradeNode->getChild("attack-speed")->getAttribute(VALUE_PERCENT_MULTIPLIER_KEY_NAME)->getBoolValue(); + + //printf("Found prodSpeedIsMultiplier = %d\n",prodSpeedIsMultiplier); + } + } + else { + attackSpeed = 0; + } } int UpgradeTypeBase::getAttackStrength(const AttackSkillType *st) const { @@ -212,6 +225,20 @@ int UpgradeTypeBase::getMoveSpeed(const MoveSkillType *st) const { } } +int UpgradeTypeBase::getAttackSpeed(const AttackSkillType *st) const { + if(attackSpeedIsMultiplier == false || st == NULL) { + return attackSpeed; + } + else { + int result = 0; + if(attackSpeedIsMultiplierValueList.find(st->getName()) != attackSpeedIsMultiplierValueList.end()) { + result = attackSpeedIsMultiplierValueList.find(st->getName())->second; + } + + return result; + } +} + int UpgradeTypeBase::getProdSpeed(const SkillType *st) const { if(prodSpeedIsMultiplier == false || st == NULL) { return prodSpeed; @@ -347,6 +374,18 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{ str+= indent+lang.getString("ProductionSpeed",(translatedValue == true ? "" : "english")) + " +" + intToStr(prodSpeed); } } + if(attackSpeed != 0) { + if(str != "") { + str += "\n"; + } + + if(attackSpeedIsMultiplier) { + str+= indent+lang.getString("AttackSpeed",(translatedValue == true ? "" : "english")) + " *" + intToStr(moveSpeed); + } + else { + str+= indent+lang.getString("AttackSpeed",(translatedValue == true ? "" : "english")) + " +" + intToStr(moveSpeed); + } + } if(str != "") { str += "\n"; } @@ -821,6 +860,9 @@ void TotalUpgrade::reset() { prodSpeed=0; prodSpeedIsMultiplier=false; + + attackSpeed=0; + attackSpeedIsMultiplier=false; } void TotalUpgrade::sum(const UpgradeTypeBase *ut, const Unit *unit) { @@ -832,6 +874,7 @@ void TotalUpgrade::sum(const UpgradeTypeBase *ut, const Unit *unit) { attackRangeIsMultiplier = ut->getAttackRangeIsMultiplier(); moveSpeedIsMultiplier = ut->getMoveSpeedIsMultiplier(); prodSpeedIsMultiplier = ut->getProdSpeedIsMultiplier(); + attackSpeedIsMultiplier = ut->getAttackSpeedIsMultiplier(); if(ut->getMaxHpIsMultiplier() == true) { //printf("#1 Maxhp maxHp = %d, unit->getHp() = %d ut->getMaxHp() = %d\n",maxHp,unit->getHp(),ut->getMaxHp()); @@ -941,6 +984,19 @@ void TotalUpgrade::sum(const UpgradeTypeBase *ut, const Unit *unit) { else { prodSpeed += ut->getProdSpeed(NULL); } + + if(ut->getAttackSpeedIsMultiplier() == true) { + for(unsigned int i = 0; i < (unsigned int)unit->getType()->getSkillTypeCount(); ++i) { + const SkillType *skillType = unit->getType()->getSkillType(i); + const AttackSkillType *ast = dynamic_cast(skillType); + if(ast != NULL) { + attackSpeedIsMultiplierValueList[ast->getName()] += ((double)ast->getSpeed() * ((double)ut->getAttackSpeed(NULL) / (double)100)); + } + } + } + else { + attackSpeed += ut->getAttackSpeed(NULL); + } } void TotalUpgrade::apply(const UpgradeTypeBase *ut, const Unit *unit) { @@ -1080,6 +1136,23 @@ void TotalUpgrade::deapply(const UpgradeTypeBase *ut,const Unit *unit) { prodSpeed -= ut->getProdSpeed(NULL); enforceMinimumValue(0,prodSpeed); } + + if(ut->getAttackSpeedIsMultiplier() == true) { + for(unsigned int i = 0; i < (unsigned int)unit->getType()->getSkillTypeCount(); ++i) { + const SkillType *skillType = unit->getType()->getSkillType(i); + const AttackSkillType *ast = dynamic_cast(skillType); + if(ast != NULL) { + attackSpeedIsMultiplierValueList[ast->getName()] -= ((double)ast->getSpeed() * ((double)ut->getAttackSpeed(NULL) / (double)100)); + enforceMinimumValue(0, attackSpeedIsMultiplierValueList[ast->getName()]); + } + } + + //printf("AFTER Applying moveSpeedIsMultiplier, moveSpeed = %d\n",moveSpeed); + } + else { + attackSpeed -= ut->getAttackSpeed(NULL); + enforceMinimumValue(0, attackSpeed); + } } void TotalUpgrade::incLevel(const UnitType *ut) { @@ -1184,6 +1257,16 @@ void TotalUpgrade::saveGame(XmlNode *rootNode) const { prodSpeedMorphIsMultiplierValueListNode->addAttribute("key",iterMap->first, mapTagReplacements); prodSpeedMorphIsMultiplierValueListNode->addAttribute("value",intToStr(iterMap->second), mapTagReplacements); } + + upgradeTypeBaseNode->addAttribute("attackSpeed",intToStr(attackSpeed), mapTagReplacements); + upgradeTypeBaseNode->addAttribute("attackSpeedIsMultiplier",intToStr(attackSpeedIsMultiplier), mapTagReplacements); + for(std::map::const_iterator iterMap = attackSpeedIsMultiplierValueList.begin(); + iterMap != attackSpeedIsMultiplierValueList.end(); ++iterMap) { + XmlNode *attackSpeedIsMultiplierValueListNode = upgradeTypeBaseNode->addChild("attackSpeedIsMultiplierValueList"); + + attackSpeedIsMultiplierValueListNode->addAttribute("key",iterMap->first, mapTagReplacements); + attackSpeedIsMultiplierValueListNode->addAttribute("value",intToStr(iterMap->second), mapTagReplacements); + } } void TotalUpgrade::loadGame(const XmlNode *rootNode) { @@ -1282,6 +1365,16 @@ void TotalUpgrade::loadGame(const XmlNode *rootNode) { prodSpeedMorphIsMultiplierValueList[node->getAttribute("key")->getValue()] = node->getAttribute("value")->getIntValue(); } + + attackSpeed = upgradeTypeBaseNode->getAttribute("attackSpeed")->getIntValue(); + attackSpeedIsMultiplier = upgradeTypeBaseNode->getAttribute("attackSpeedIsMultiplier")->getIntValue() != 0; + vector attackSpeedIsMultiplierValueNodeList = upgradeTypeBaseNode->getChildList("attackSpeedIsMultiplierValueList"); + for(unsigned int i = 0; i < attackSpeedIsMultiplierValueNodeList.size(); ++i) { + XmlNode *node = attackSpeedIsMultiplierValueNodeList[i]; + + attackSpeedIsMultiplierValueList[node->getAttribute("key")->getValue()] = + node->getAttribute("value")->getIntValue(); + } } diff --git a/source/glest_game/types/upgrade_type.h b/source/glest_game/types/upgrade_type.h index 23a77121..c25b5e07 100644 --- a/source/glest_game/types/upgrade_type.h +++ b/source/glest_game/types/upgrade_type.h @@ -80,6 +80,10 @@ protected: std::map prodSpeedUpgradeIsMultiplierValueList; std::map prodSpeedMorphIsMultiplierValueList; + int attackSpeed; + bool attackSpeedIsMultiplier; + std::map attackSpeedIsMultiplierValueList; + public: UpgradeTypeBase() { maxHp = 0;; @@ -127,6 +131,8 @@ public: bool getMoveSpeedIsMultiplier() const {return moveSpeedIsMultiplier;} int getProdSpeed(const SkillType *st) const; bool getProdSpeedIsMultiplier() const {return prodSpeedIsMultiplier;} + int getAttackSpeed(const AttackSkillType *st) const; + bool getAttackSpeedIsMultiplier() const {return attackSpeedIsMultiplier;} void load(const XmlNode *upgradeNode, string upgradename); @@ -207,6 +213,9 @@ public: crcForUpgradeType.addInt64((int64)prodSpeedUpgradeIsMultiplierValueList.size()); //std::map prodSpeedMorphIsMultiplierValueList; crcForUpgradeType.addInt64((int64)prodSpeedMorphIsMultiplierValueList.size()); + + crcForUpgradeType.addInt(attackSpeed); + crcForUpgradeType.addInt(attackSpeedIsMultiplier); return crcForUpgradeType; } From a829fe580a145e486922e25bdca28ae695747414 Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sat, 19 Jul 2014 22:24:23 -0600 Subject: [PATCH 036/258] Animation speed now properly scales That is, the increase in attack speed is the same as the increase in animation speed. Previously, this was only the case for absolute increases. Now percentage increases do so, as well. --- source/glest_game/types/skill_type.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index 9aabec79..b6aa6318 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -941,8 +941,16 @@ int AttackSkillType::getTotalSpeed(const TotalUpgrade *totalUpgrade) const{ return result; } +// Get the amount to boost the attack animation speed by (based on attack-speed upgrades) int AttackSkillType::getAnimSpeedBoost(const TotalUpgrade *totalUpgrade) const{ - return totalUpgrade->getAttackSpeed(this); + // Same calculation as in TotalUpgrade::sum, but bypassing the use of the value + // list (which is for the attack speed, not animation speed) + if(totalUpgrade->getAttackRangeIsMultiplier()) { + return animSpeed * (totalUpgrade->getAttackSpeed(NULL) / (double)100); + } + else { + return totalUpgrade->getAttackSpeed(NULL); + } } string AttackSkillType::toString(bool translatedValue) const{ From 69e95eef7fa8c198a25430addecd0c47c797830c Mon Sep 17 00:00:00 2001 From: Mike Hoffert Date: Sun, 20 Jul 2014 11:06:49 -0600 Subject: [PATCH 037/258] Added Doxygen support Output folder is ignored by Git --- source/.gitignore | 1 + source/glest_game/Doxyfile | 2329 ++++++++++++++++++++++++++++++++++++ 2 files changed, 2330 insertions(+) create mode 100644 source/glest_game/Doxyfile diff --git a/source/.gitignore b/source/.gitignore index dace2a5b..74175717 100644 --- a/source/.gitignore +++ b/source/.gitignore @@ -1,2 +1,3 @@ /windows_deps*/ /glest_game/facilities/gitversion.h +/glest_game/site/ \ No newline at end of file diff --git a/source/glest_game/Doxyfile b/source/glest_game/Doxyfile new file mode 100644 index 00000000..d4627f51 --- /dev/null +++ b/source/glest_game/Doxyfile @@ -0,0 +1,2329 @@ +# Doxyfile 1.8.7 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "MegaGlest" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "The free RTS" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = site + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = YES + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /