Merge branch 'release/3.11.0'

This commit is contained in:
Tom Reynolds 2015-01-21 22:05:48 +01:00
commit e2b6ec5797
378 changed files with 9694 additions and 1833 deletions

View File

@ -1,19 +1,34 @@
# http://docs.travis-ci.com/user/build-configuration/ # http://docs.travis-ci.com/user/build-configuration/
language: cpp language: cpp
compiler: compiler:
- gcc - gcc
- clang - clang
matrix:
#include:
# - compiler: gcc
# - compiler: clang
allow_failures:
- compiler: clang
git: git:
submodules: false submodules: false
#branches: #branches:
# only: # only:
# - master # - master
before_install: before_install:
- sudo apt-get update -qq # UPDATE REPOS - 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 apt-get install -y -qq
- sudo mk/linux/setupBuildDeps.sh --quiet # INSTALL OUR DEPENDENCIES
script: script:
# ALL THE BUILD COMMANDS HERE # ALL THE BUILD COMMANDS HERE
- mk/linux/build-mg.sh -c 4 - mk/linux/build-mg.sh -c 4
notifications: notifications:
irc: irc:
channels: channels:

View File

@ -78,9 +78,10 @@ else()
endif() endif()
endif() endif()
## Compiler flags ## Compiler flags, CPACK configuration and other Apple specific code.
IF(APPLE) IF(APPLE)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
include(${PROJECT_SOURCE_DIR}/mk/macosx/CMakeLists.txt)
ENDIF(APPLE) ENDIF(APPLE)
IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW) IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
@ -188,19 +189,31 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
message(STATUS "**WARNING DID NOT Find GCC backtrace lib") message(STATUS "**WARNING DID NOT Find GCC backtrace lib")
ENDIF() ENDIF()
# Default compiler flags
SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE}")
# Debug compiler flags # Debug compiler flags
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3")
# Release compiler flags # Release compiler flags
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 ") SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 ")
IF(CMAKE_GENERATOR STREQUAL Xcode)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") ## Strip binary
ELSE()
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
ENDIF()
# Release with debug info compiler flags # Release with debug info compiler flags
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 ") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 ")
# Release minimum size compiler flags # Release minimum size compiler flags
SET(CMAKE_CXX_FLAGS_MINSIZEREL "-O3 ${CMAKE_CXX_FLAGS_MINSIZEREL} -O3 ") SET(CMAKE_CXX_FLAGS_MINSIZEREL "-O3 ${CMAKE_CXX_FLAGS_MINSIZEREL} -O3 ")
SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -s") ## Strip binary SET(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}") ## Strip binary
IF(CMAKE_GENERATOR STREQUAL Xcode)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") ## Strip binary
ELSE()
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
ENDIF()
# Get the git revision info for the binary # Get the git revision info for the binary
SET(HAS_GIT "FALSE") SET(HAS_GIT "FALSE")
@ -239,11 +252,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
ENDIF() ENDIF()
ENDIF() ENDIF()
IF(APPLE AND NOT CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_GENERATOR STREQUAL Xcode)
SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_LIVE_REV_CMD}\\\\''") SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_LIVE_REV_CMD}\\\\''")
ELSE() ELSE()
SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_LIVE_REV_CMD}\\\"'") SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_LIVE_REV_CMD}\\\"'")
# SET(SVN_VERSION_CMD "-DSVNVERSION='\\\"`svnversion -n ${PROJECT_SOURCE_DIR}`\\\"'")
ENDIF() ENDIF()
IF(CMAKE_INSTALL_PREFIX STREQUAL "") IF(CMAKE_INSTALL_PREFIX STREQUAL "")
@ -266,11 +278,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
ENDIF() ENDIF()
IF(NOT CUSTOM_DATA_INSTALL_PATH) IF(NOT CUSTOM_DATA_INSTALL_PATH)
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)")
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)")
ENDIF()
ENDIF() ENDIF()
SET(CUSTOM_DATA_INSTALL_PATH_VALUE "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}") SET(CUSTOM_DATA_INSTALL_PATH_VALUE "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}")
@ -280,6 +288,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
MESSAGE(STATUS "*NOTE: Custom Data Install Path is [${CUSTOM_DATA_INSTALL_PATH}]") MESSAGE(STATUS "*NOTE: Custom Data Install Path is [${CUSTOM_DATA_INSTALL_PATH}]")
ENDIF() 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_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_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}") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
@ -287,12 +296,15 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
# We do some funky character escaping to get the right stuff written out to # We do some funky character escaping to get the right stuff written out to
# the final Makefile so we get the GIT Global Revsion # # 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_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") 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_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}") 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}") message("CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
ELSEIF( CMAKE_BUILD_TYPE STREQUAL Release ) ELSEIF( CMAKE_BUILD_TYPE STREQUAL Release )
message("CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}") message("CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
@ -353,10 +365,6 @@ IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
#endif() #endif()
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/tools/glexemel ) ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/tools/glexemel )
IF(APPLE)
include(${PROJECT_SOURCE_DIR}/mk/macosx/CMakeLists.txt)
ENDIF()
ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/tests ) ADD_SUBDIRECTORY( ${PROJECT_SOURCE_DIR}/source/tests )
ENDIF() ENDIF()
@ -373,6 +381,20 @@ IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans") MESSAGE(WARNING ">> CLANG is NOT currently compatible as it does not support the following essential GCC compiler settings: -frounding-math -fsignaling-nans")
ENDIF() ENDIF()
# CPack configuration shared accross platforms
SET(CPACK_PACKAGE_NAME ${PKG_NAME})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MegaGlest")
SET(CPACK_PACKAGE_VENDOR "megaglest.org")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "megaglest")
SET(CPACK_PACKAGE_VERSION_MAJOR ${VER_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${VER_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${VER_RELEASE})
# Debian specific generator options
IF(NOT DEFINED CPACK_GENERATOR)
SET(CPACK_GENERATOR "DEB") SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mark Vejvoda") #required SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mark Vejvoda") #required
SET(CPACK_DEBIAN_PACKAGE_DEPENDS " SET(CPACK_DEBIAN_PACKAGE_DEPENDS "
@ -404,22 +426,15 @@ SET(CPACK_DEBIAN_PACKAGE_DEPENDS "
# OUTPUT_STRIP_TRAILING_WHITESPACE # OUTPUT_STRIP_TRAILING_WHITESPACE
# ) # )
#endif(DPKG_PROGRAM) #endif(DPKG_PROGRAM)
ENDIF(NOT DEFINED CPACK_GENERATOR)
SET(CPACK_PACKAGE_NAME ${PKG_NAME}) IF(CPACK_GENERATOR STREQUAL "NSIS")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MegaGlest")
SET(CPACK_PACKAGE_VENDOR "megaglest.org")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "megaglest")
SET(CPACK_PACKAGE_VERSION_MAJOR ${VER_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${VER_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${VER_RELEASE})
IF(WIN32)
SET(CPACK_NSIS_DISPLAY_NAME "MegaGlest") SET(CPACK_NSIS_DISPLAY_NAME "MegaGlest")
SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/mk/windoze/glest.ico") SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/mk/windoze/glest.ico")
SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/mk/windoze/megaglest.ico") SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/mk/windoze/megaglest.ico")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://megaglest.org") SET(CPACK_NSIS_URL_INFO_ABOUT "http://megaglest.org")
ENDIF() ENDIF(CPACK_GENERATOR STREQUAL "NSIS")
INCLUDE(CPack) INCLUDE(CPack)
get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS ) get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )

@ -1 +1 @@
Subproject commit 72f44c6742b2d18e1fd1220377c33b1d8ba58d1f Subproject commit c29e5630cad15a160ab201b1769b2c27f5da8359

View File

@ -3,6 +3,30 @@ MEGAGLEST CHANGELOG
To see a timeline of detail changes please visit: To see a timeline of detail changes please visit:
https://github.com/MegaGlest/megaglest-source/commits/master https://github.com/MegaGlest/megaglest-source/commits/master
v3.11.0
- healthbars with a lot of options
- multi shot / multi-projectiles with different timings,sounds and particle systems
- several camera shake effects
- new tileset "pine rock"
- some new maps
- improve switching settings when connected to a headless server
- support for team unit sharing
- team resource sharing
- tags feature
- Attack boosts fixed in many ways
- Attack boosts and upgrades now support upgrading attack speed
- timed particles and mesh bound particles really work now.
- unit height independend particle positioning ( flat-particle-positions )
- CPU players multiplier are displayed in debug view
- You can have non commandable units
- Units spawned by an attack skill can get an attack command
- Unit and Splash particles can be speeded up ( accelerated )
- Looting https://github.com/MegaGlest/megaglest-source/pull/17
- HP and EP starting values
- <target-height> <burn-height> can be given https://docs.megaglest.org/XML/Unit#target-height
- +several bugfixes
v3.10.0 This version was skipped because of version number trouble.
v3.9.1 v3.9.1
- Backward compatible with 3.9.0 - Backward compatible with 3.9.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -85,8 +85,8 @@ done
# 1. Install clang (sudo apt-get install clang) # 1. Install clang (sudo apt-get install clang)
# 2. Set the two vars below: # 2. Set the two vars below:
# WANT_CLANG=YES and CLANG_BIN_PATH=<path_to_the_clang_binary> # WANT_CLANG=YES and CLANG_BIN_PATH=<path_to_the_clang_binary>
CLANG_BIN_PATH=$( which clang ) CLANG_BIN_PATH=$( which clang 2>/dev/null )
CLANGPP_BIN_PATH=$( which clang++ ) CLANGPP_BIN_PATH=$( which clang++ 2>/dev/null )
cd ${SCRIPTDIR} cd ${SCRIPTDIR}
@ -174,12 +174,12 @@ if [ $CLANG_FORCED = 1 ]; then
# If both the $CC and $CXX environment variable point to something containing # If both the $CC and $CXX environment variable point to something containing
# "clang", use whatever these environment variables point to. # "clang", use whatever these environment variables point to.
elif [ "`echo $CC | grep -oF 'clang'`" = 'clang' -a "`echo $CXX | grep -oF 'clang'`" = 'clang' ]; then 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 CLANG_CC=$CC
else else
CLANG_CC=`which $CC` CLANG_CC=`which $CC`
fi fi
if [ `echo $CXX | grep -Fq '/'` = '/' ]; then if [ "`echo $CXX | grep -Fo '/'`" = '/' ]; then
CLANG_CXX=$CXX CLANG_CXX=$CXX
else else
CLANG_CXX=`which $CXX` CLANG_CXX=`which $CXX`

View File

@ -32,6 +32,9 @@ PROJECT=MegaGlest
# E-Mail address of registered Coverity Scan user with project access # E-Mail address of registered Coverity Scan user with project access
# EMAIL=x # EMAIL=x
# Where to store the data gathered by the Coverity Scan Build Tool
BUILDTOOL=cov-int
# read in config settings # read in config settings
if [ ! -f ${CURRENTDIR}/.coverity-scan ] ; then if [ ! -f ${CURRENTDIR}/.coverity-scan ] ; then
echo "-----------------------------------------" echo "-----------------------------------------"
@ -44,24 +47,17 @@ fi
# echo "Read config values: TOKEN [$TOKEN] EMAIL [$EMAIL] COVERITY_ANALYSIS_ROOT [$COVERITY_ANALYSIS_ROOT] NUMCORES [${NUMCORES}]" # echo "Read config values: TOKEN [$TOKEN] EMAIL [$EMAIL] COVERITY_ANALYSIS_ROOT [$COVERITY_ANALYSIS_ROOT] NUMCORES [${NUMCORES}]"
# exit 1 # exit 1
GITBRANCH=$(git rev-parse --abbrev-ref HEAD | tr '/' '_')
GITVERSION_SHA1=$(git log -1 --format=%h)
GITVERSION_REV=$(git rev-list HEAD --count)
VERSION=${GITBRANCH}.${GITVERSION_REV}.${GITVERSION_SHA1}
# Included from shared functions # Included from shared functions
detect_system detect_system
computername=$(hostname) #DESCRIPTION=${distribution}-${release}-${architecture}_${hostname}
#DESCRIPTION=${distribution}-${release}-${architecture}_${computername} DESCRIPTION=${GITBRANCH}.${GITVERSION_SHA1}.${distribution}-${architecture}.${hostname}
DESCRIPTION=${distribution}-${architecture}_${computername} FILENAME=${PROJECT}.${DESCRIPTION}
# Where to store the data gathered by the Coverity Scan Build Tool
BUILDTOOL=cov-int
# ------------------------------------------------------------------------------
GITVERSION_SHA1=$(git log -1 --format=%h)
GITVERSION_REV=$(git rev-list HEAD --count)
VERSION=${GITVERSION_REV}.${GITVERSION_SHA1}
FILENAME=${PROJECT}_${DESCRIPTION}_${VERSION}
# echo "FILENAME = [${FILENAME}]" # echo "FILENAME = [${FILENAME}]"
# exit 1 # exit 1
@ -105,3 +101,6 @@ else
rm -rf ${BUILDTOOL}/ rm -rf ${BUILDTOOL}/
fi fi
# This currently fails to detect the following error situation, as reported in the HTML of the HTTP response (to the upload request):
# ERROR: Too many build submitted. Wait for few days before submitting next build: Refer build frequency at https://scan.coverity.com/faq#frequency

View File

@ -54,11 +54,11 @@ fi
cd $PROJDIR cd $PROJDIR
echo "copying binaries ..." echo "copying binaries ..."
cp -r lib/* "$RELEASEDIR/lib" cp -r lib/* "$RELEASEDIR/lib"
cp *.ico "$RELEASEDIR/" cp {../shared/,}*.ico "$RELEASEDIR/"
cp *.bmp "$RELEASEDIR/" cp *.bmp "$RELEASEDIR/"
cp *.png "$RELEASEDIR/" cp *.png "$RELEASEDIR/"
cp *.xpm "$RELEASEDIR/" cp *.xpm "$RELEASEDIR/"
cp *.ini "$RELEASEDIR/" cp {../shared/,}*.ini "$RELEASEDIR/"
cp megaglest "$RELEASEDIR/" cp megaglest "$RELEASEDIR/"
cp megaglest_editor "$RELEASEDIR/" cp megaglest_editor "$RELEASEDIR/"
cp megaglest_g3dviewer "$RELEASEDIR/" cp megaglest_g3dviewer "$RELEASEDIR/"

View File

@ -66,6 +66,13 @@ mkdir -p "$RELEASEDIR/data/core/misc_textures/flags/"
cd "$RELEASEDIR/data/core/misc_textures/flags/" cd "$RELEASEDIR/data/core/misc_textures/flags/"
git archive --remote ${REPODIR} HEAD:source/masterserver/flags | tar x git archive --remote ${REPODIR} HEAD:source/masterserver/flags | tar x
echo "Removing non required files ..."
cd "$CURRENTDIR"
# START
# remove cegui data
rm -rf "$RELEASEDIR/data/cegui"
# END
cd "$CURRENTDIR" cd "$CURRENTDIR"
echo "creating data archive: $PACKAGE" echo "creating data archive: $PACKAGE"
[[ -f "${RELEASEDIR_ROOT}/$PACKAGE" ]] && rm "${RELEASEDIR_ROOT}/$PACKAGE" [[ -f "${RELEASEDIR_ROOT}/$PACKAGE" ]] && rm "${RELEASEDIR_ROOT}/$PACKAGE"

View File

@ -79,6 +79,8 @@ cd "$CURRENTDIR"
# START # START
# remove embedded data # remove embedded data
rm -rf "$RELEASEDIR/data/core/fonts" rm -rf "$RELEASEDIR/data/core/fonts"
# remove cegui data
rm -rf "$RELEASEDIR/data/cegui"
# END # END
echo "creating $PACKAGE" echo "creating $PACKAGE"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -6,7 +6,7 @@
OLD_MG_VERSION=3.9.1 OLD_MG_VERSION=3.9.1
OLD_MG_VERSION_BINARY=3.9.1 OLD_MG_VERSION_BINARY=3.9.1
MG_VERSION=3.10.0-dev MG_VERSION=3.11.0
if [ "$1" = "--oldversion" ]; then if [ "$1" = "--oldversion" ]; then
echo "$OLD_MG_VERSION" echo "$OLD_MG_VERSION"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 232 KiB

View File

@ -1,5 +1,5 @@
local GAME_INSTALL_SIZE = 730000000; local GAME_INSTALL_SIZE = 680000000;
local GAME_VERSION = "3.10.0-dev"; local GAME_VERSION = "3.11.0";
local _ = MojoSetup.translate local _ = MojoSetup.translate

View File

@ -153,6 +153,12 @@ case $distribution in
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ $? != 0 ]; then error_during_installation; exit 1; fi
;; ;;
14.04|14.10)
installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase3.0-dev libwxgtk3.0-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev'
$installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi
;;
*) *)
installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev' installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev'
unsupported_release unsupported_release
@ -167,7 +173,7 @@ case $distribution in
fi fi
case $release in case $release in
13|14|15) 13|14|15|16)
installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev' installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev'
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ $? != 0 ]; then error_during_installation; exit 1; fi
@ -180,7 +186,7 @@ case $distribution in
esac esac
;; ;;
SuSE|SUSE?LINUX|Opensuse) SuSE|SUSE?LINUX|Opensuse*|openSUSE*)
case $release in case $release in
11.2|11.3|11.4|12.1) 11.2|11.3|11.4|12.1)
installcommand='zypper install gcc gcc-c++ cmake libSDL-devel MesaGLw-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel' installcommand='zypper install gcc gcc-c++ cmake libSDL-devel MesaGLw-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
@ -192,6 +198,11 @@ case $distribution in
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ $? != 0 ]; then error_during_installation; exit 1; fi
;; ;;
13.1)
installcommand='zypper install gcc gcc-c++ cmake libSDL-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
$installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi
;;
*) *)
installcommand='zypper install gcc gcc-c++ cmake libSDL-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel' installcommand='zypper install gcc gcc-c++ cmake libSDL-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
unsupported_release unsupported_release

View File

@ -202,6 +202,15 @@ GCRYPT_LINKEDLIBNAME='libgcrypt.so.11'
GCRYPT_LIBLOOKUP1=${GCRYPT_LINKEDLIBNAME} GCRYPT_LIBLOOKUP1=${GCRYPT_LINKEDLIBNAME}
GCRYPT_LIBLOOKUP2='libgcrypt.so.' GCRYPT_LIBLOOKUP2='libgcrypt.so.'
TASN_LINKEDLIBNAME='libtasn1.so.3'
TASN_LIBLOOKUP1=${TASN_LINKEDLIBNAME}
TASN_LIBLOOKUP2='libtasn1.so.'
RTMP_LINKEDLIBNAME='librtmp.so.0'
RTMP_LIBLOOKUP1=${RTMP_LINKEDLIBNAME}
RTMP_LIBLOOKUP2='librtmp.so.'
if [ "$OS_TYPE"'_' = 'x86_64_' ]; then if [ "$OS_TYPE"'_' = 'x86_64_' ]; then
DIRECTFB_LINKEDLIBNAME='libdirectfb-1.2.so.0' DIRECTFB_LINKEDLIBNAME='libdirectfb-1.2.so.0'
DIRECTFB_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME} DIRECTFB_LIBLOOKUP1=${DIRECTFB_LINKEDLIBNAME}
@ -279,6 +288,8 @@ findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${DL_LINKEDLIBNAME}" "$DL_LIBLOOKUP1
findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${VLCCORE_LINKEDLIBNAME}" "$VLCCORE_LIBLOOKUP1" "$VLCCORE_LIBLOOKUP2" findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${VLCCORE_LINKEDLIBNAME}" "$VLCCORE_LIBLOOKUP1" "$VLCCORE_LIBLOOKUP2"
findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${VLC_LINKEDLIBNAME}" "$VLC_LIBLOOKUP1" "$VLC_LIBLOOKUP2" findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${VLC_LINKEDLIBNAME}" "$VLC_LIBLOOKUP1" "$VLC_LIBLOOKUP2"
findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${GCRYPT_LINKEDLIBNAME}" "$GCRYPT_LIBLOOKUP1" "$GCRYPT_LIBLOOKUP2" findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${GCRYPT_LINKEDLIBNAME}" "$GCRYPT_LIBLOOKUP1" "$GCRYPT_LIBLOOKUP2"
findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${TASN_LINKEDLIBNAME}" "$TASN_LIBLOOKUP1" "$TASN_LIBLOOKUP2"
findMissingSO "$LDCONFIG" "$GAMEDIR/$LIBDIR/${RTMP_LINKEDLIBNAME}" "$RTMP_LIBLOOKUP1" "$RTMP_LIBLOOKUP2"
./megaglest $@ ./megaglest $@

View File

@ -25,38 +25,34 @@ IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
ENDIF() ENDIF()
ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
# Include extra paths to search for includes; this is the default system wide macports path.
INCLUDE_DIRECTORIES(/opt/local/include)
LINK_DIRECTORIES(/opt/local/lib)
##install part ##install part
#extracting the current version... # This changes Info.plist from something with variables and CMakeisms to
EXECUTE_PROCESS( # something that can be installed on disk.
COMMAND /usr/bin/sed CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist"
-n -e "s/.*glestVersionString = \"v\\\(.*\\\)\";.*/\\1/p" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
game_util.cpp
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/source/glest_game/facilities"
OUTPUT_VARIABLE MEGAGLEST_VERSION )
#for some reason the MEGAGLEST_VERSION can containts return like thus remove it
STRING(REGEX REPLACE "\n" "" MEGAGLEST_VERSION "${MEGAGLEST_VERSION}")
set(CPACK_PACKAGE_FILE_NAME MegaGlest-${MEGAGLEST_VERSION})
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
include (InstallRequiredSystemLibraries) include (InstallRequiredSystemLibraries)
# Use bundle generator (OSX has 3 other options if you feel adventurous)
set (CPACK_GENERATOR "Bundle")
# The following CPACK_* options are all required
set (CPACK_PACKAGE_FILE_NAME MegaGlest-${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE})
set (CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns")
set (CPACK_RESOURCE_FILE_LICENSE set (CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt") "${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt")
set (CPACK_GENERATOR Bundle)
set (CPACK_BUNDLE_NAME "MegaGlest") set (CPACK_BUNDLE_NAME "MegaGlest")
set (CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/data/glest_game/megaglest") set (CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/data/glest_game/megaglest")
set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns") set (CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns")
set (CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns")
set (CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist") set (CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
#set (CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist.template")
# Install files in to the package (FIXME: how? we sure?)
INSTALL(FILES INSTALL(FILES
${LUA_LIBRARIES} ${LUA_LIBRARIES}
DESTINATION ../Frameworks DESTINATION ../Frameworks
@ -74,5 +70,3 @@ STRING(REGEX REPLACE ";.*" "" SDL_LIBRARY_DIR "${SDL_LIBRARY}")
# DESTINATION ../Frameworks # DESTINATION ../Frameworks
# ) # )
include (CPack)

View File

@ -5,13 +5,13 @@
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>English</string> <string>English</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>MegaGlest</string> <string>megaglest</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>${MEGAGLEST_VERSION}, © 2001-2010 The Glest Team All Rights Reserved.</string> <string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}, © 2001-2015 The Glest Team All Rights Reserved.</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>MegaGlest</string> <string>MegaGlest</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>geovah.MegaGlest</string> <string>org.megaglest.v${VER_MAJOR}-${VER_MINOR}-${VER_RELEASE}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@ -19,11 +19,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>${MEGAGLEST_VERSION}</string> <string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>MGGL</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${MEGAGLEST_VERSION}</string> <string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@ -42,6 +42,7 @@ HotKeySelectedUnitsAttack=A
HotKeySelectedUnitsStop=S HotKeySelectedUnitsStop=S
HotKeyToggleOSMouseEnabled=/ HotKeyToggleOSMouseEnabled=/
ChatTeamMode=H ChatTeamMode=H
ToggleHealthbars=#
ToggleMusic=K ToggleMusic=K
SaveGUILayout=f10 SaveGUILayout=f10
SetMarker=X SetMarker=X

View File

@ -37,9 +37,9 @@ Global
Release with error catching|Mixed Platforms = Release with error catching|Mixed Platforms Release with error catching|Mixed Platforms = Release with error catching|Mixed Platforms
Release with error catching|Win32 = Release with error catching|Win32 Release with error catching|Win32 = Release with error catching|Win32
Release with error catching|x64 = Release with error catching|x64 Release with error catching|x64 = Release with error catching|x64
Release_NO_STREFLOP|Mixed Platforms = Release_NO_STREFLOP|Mixed Platforms Release_WITHOUT_STREFLOP|Mixed Platforms = Release_WITHOUT_STREFLOP|Mixed Platforms
Release_NO_STREFLOP|Win32 = Release_NO_STREFLOP|Win32 Release_WITHOUT_STREFLOP|Win32 = Release_WITHOUT_STREFLOP|Win32
Release_NO_STREFLOP|x64 = Release_NO_STREFLOP|x64 Release_WITHOUT_STREFLOP|x64 = Release_WITHOUT_STREFLOP|x64
Release|Mixed Platforms = Release|Mixed Platforms Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
Release|x64 = Release|x64 Release|x64 = Release|x64
@ -81,12 +81,12 @@ Global
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release with error catching|Win32.Build.0 = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release with error catching|Win32.Build.0 = Release|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release with error catching|x64.ActiveCfg = Release|x64 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release with error catching|x64.ActiveCfg = Release|x64
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release with error catching|x64.Build.0 = Release|x64 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release with error catching|x64.Build.0 = Release|x64
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|Win32.ActiveCfg = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|Win32.Build.0 = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|x64.ActiveCfg = Release|x64 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|x64.Build.0 = Release|x64 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release|Mixed Platforms.Build.0 = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release|Mixed Platforms.Build.0 = Release|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release|Win32.ActiveCfg = Release|Win32 {407355A4-D12A-4E3B-A7EB-A835E573B376}.Release|Win32.ActiveCfg = Release|Win32
@ -135,12 +135,12 @@ Global
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release with error catching|Win32.Build.0 = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release with error catching|Win32.Build.0 = Release|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release with error catching|x64.ActiveCfg = Release|x64 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release with error catching|x64.ActiveCfg = Release|x64
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release with error catching|x64.Build.0 = Release|x64 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release with error catching|x64.Build.0 = Release|x64
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|Win32.ActiveCfg = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|Win32.Build.0 = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|x64.ActiveCfg = Release|x64 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|x64.Build.0 = Release|x64 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release|Mixed Platforms.Build.0 = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release|Mixed Platforms.Build.0 = Release|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release|Win32.ActiveCfg = Release|Win32 {3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release|Win32.ActiveCfg = Release|Win32
@ -189,12 +189,12 @@ Global
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release with error catching|Win32.Build.0 = Release|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release with error catching|Win32.Build.0 = Release|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_STREFLOP|x64 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|x64.Build.0 = Release_NO_STREFLOP|x64 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release|Mixed Platforms.Build.0 = Release|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release|Mixed Platforms.Build.0 = Release|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release|Win32.ActiveCfg = Release|Win32 {8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release|Win32.ActiveCfg = Release|Win32
@ -243,12 +243,12 @@ Global
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release with error catching|Win32.Build.0 = Release|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release with error catching|Win32.Build.0 = Release|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_STREFLOP|x64 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|x64.Build.0 = Release_NO_STREFLOP|x64 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release|Mixed Platforms.Build.0 = Release|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release|Mixed Platforms.Build.0 = Release|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release|Win32.ActiveCfg = Release|Win32 {6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release|Win32.ActiveCfg = Release|Win32
@ -297,12 +297,12 @@ Global
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release with error catching|Win32.Build.0 = Release|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release with error catching|Win32.Build.0 = Release|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_STREFLOP|x64 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|x64.Build.0 = Release_NO_STREFLOP|x64 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release|Mixed Platforms.Build.0 = Release|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release|Mixed Platforms.Build.0 = Release|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release|Win32.ActiveCfg = Release|Win32 {5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release|Win32.ActiveCfg = Release|Win32
@ -351,12 +351,12 @@ Global
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release with error catching|Win32.Build.0 = Release|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release with error catching|Win32.Build.0 = Release|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_STREFLOP|x64 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|x64.Build.0 = Release_NO_STREFLOP|x64 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release|Mixed Platforms.Build.0 = Release|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release|Mixed Platforms.Build.0 = Release|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release|Win32.ActiveCfg = Release|Win32 {FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release|Win32.ActiveCfg = Release|Win32
@ -405,12 +405,12 @@ Global
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release with error catching|Win32.Build.0 = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release with error catching|Win32.Build.0 = Release|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release with error catching|x64.ActiveCfg = Release|x64 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release with error catching|x64.ActiveCfg = Release|x64
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release with error catching|x64.Build.0 = Release|x64 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release with error catching|x64.Build.0 = Release|x64
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|Win32.ActiveCfg = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|Win32.Build.0 = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|x64.ActiveCfg = Release|x64 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|x64.Build.0 = Release|x64 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release|Mixed Platforms.Build.0 = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release|Mixed Platforms.Build.0 = Release|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release|Win32.ActiveCfg = Release|Win32 {9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release|Win32.ActiveCfg = Release|Win32
@ -459,12 +459,12 @@ Global
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release with error catching|Win32.Build.0 = Release_NO_STREFLOP|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release with error catching|Win32.Build.0 = Release_NO_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release with error catching|x64.ActiveCfg = Release_NO_STREFLOP|x64
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release with error catching|x64.Build.0 = Release_NO_STREFLOP|x64
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_STREFLOP|x64 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|x64.Build.0 = Release_NO_STREFLOP|x64 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|x64.Build.0 = Release_WITHOUT_STREFLOP|x64
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Mixed Platforms.Build.0 = Release|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Mixed Platforms.Build.0 = Release|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Win32.ActiveCfg = Release|Win32 {CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Win32.ActiveCfg = Release|Win32

View File

@ -4,7 +4,7 @@
!define APNAME MegaGlest !define APNAME MegaGlest
!define APNAME_OLD Mega-Glest !define APNAME_OLD Mega-Glest
!define APVER_OLD 3.9.1 !define APVER_OLD 3.9.1
!define APVER 3.10.0-dev !define APVER 3.11.0
Name "${APNAME} ${APVER}" Name "${APNAME} ${APVER}"
SetCompressor /FINAL /SOLID lzma SetCompressor /FINAL /SOLID lzma
@ -16,7 +16,7 @@ UninstallIcon "..\..\shared\megaglest.ico"
!define MUI_UNICON "..\..\shared\megaglest.ico" !define MUI_UNICON "..\..\shared\megaglest.ico"
InstallDir "$PROGRAMFILES\${APNAME}" InstallDir "$PROGRAMFILES\${APNAME}"
ShowInstDetails show ShowInstDetails show
BGGradient 0xDF9437 0xffffff ;BGGradient 0xDF9437 0xffffff
; Request application privileges for Windows Vista ; Request application privileges for Windows Vista
RequestExecutionLevel none RequestExecutionLevel none
@ -31,6 +31,8 @@ PageEx license
LicenseData "..\..\..\data\glest_game\docs\cc-by-sa-3.0-unported.txt" LicenseData "..\..\..\data\glest_game\docs\cc-by-sa-3.0-unported.txt"
PageExEnd PageExEnd
;---- add local plugins dir
!addPluginDir "plugins"
;-------------------------------- ;--------------------------------
; Images not included! ; Images not included!
; Use your own animated GIFs please ; Use your own animated GIFs please
@ -67,7 +69,7 @@ Function myGUIInit
File megaglestinstallscreen.jpg File megaglestinstallscreen.jpg
FindWindow $0 '_Nb' FindWindow $0 '_Nb'
EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg" #EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg"
#BgImage::SetBg /NOUNLOAD /FILLSCREEN "$PLUGINSDIR\megaglestinstallscreen.jpg" #BgImage::SetBg /NOUNLOAD /FILLSCREEN "$PLUGINSDIR\megaglestinstallscreen.jpg"
#BgImage::Redraw /NOUNLOAD #BgImage::Redraw /NOUNLOAD
@ -81,7 +83,7 @@ Function un.myGUIInit
File megaglestinstallscreen.jpg File megaglestinstallscreen.jpg
FindWindow $0 '_Nb' FindWindow $0 '_Nb'
EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg" #EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg"
FunctionEnd FunctionEnd
Function MUIGUIInit Function MUIGUIInit
@ -173,7 +175,7 @@ FunctionEnd
Function .onGUIEnd Function .onGUIEnd
EBanner::stop #EBanner::stop
FunctionEnd FunctionEnd
@ -235,7 +237,7 @@ Section "${APNAME} (required)"
File /r /x .svn /x mydata "..\..\..\source\tools\glexemel\*.*" File /r /x .svn /x mydata "..\..\..\source\tools\glexemel\*.*"
SetOutPath $INSTDIR SetOutPath $INSTDIR
File /r /x .svn /x mydata "..\..\..\data\glest_game\data" File /r /x .svn /x mydata /x cegui "..\..\..\data\glest_game\data"
File /r /x .svn /x mydata "..\..\..\data\glest_game\docs" File /r /x .svn /x mydata "..\..\..\data\glest_game\docs"
File /r /x .svn /x mydata "..\..\..\data\glest_game\maps" File /r /x .svn /x mydata "..\..\..\data\glest_game\maps"
File /r /x .svn /x mydata "..\..\..\data\glest_game\scenarios" File /r /x .svn /x mydata "..\..\..\data\glest_game\scenarios"

View File

@ -2,10 +2,10 @@
; General Attributes ; General Attributes
!define APNAME MegaGlest !define APNAME MegaGlest
!define APVER 3.10.0-dev !define APVER 3.11.0
!define APNAME_OLD Mega-Glest !define APNAME_OLD Mega-Glest
!define APVER_OLD 3.9.1 !define APVER_OLD 3.9.1
!define APVER_UPDATE 3.10.0-dev !define APVER_UPDATE 3.11.0
Name "${APNAME} ${APVER_UPDATE}" Name "${APNAME} ${APVER_UPDATE}"
SetCompressor /FINAL /SOLID lzma SetCompressor /FINAL /SOLID lzma

View File

@ -0,0 +1,6 @@
#/bin/bash
# for this script nsis is needed
# windows binaries must be installed from snapshots.megaglest.org
makensis MegaGlestInstaller.nsi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

View File

@ -0,0 +1,253 @@
ACCESS CONTROL PLUGIN
---------------------
Written by Mathias Hasselmann <mathias@taschenorakel.de>
Modifications by:
* Afrow UK <afrowuk@afrowsoft.co.uk>
* AndersK <anders_k@users.sf.net>
The AccessControl plugin for NSIS provides a set of functions related
Windows NT access control list (ACL) management.
MODIFICATIONS
-------------
v1.0.8.1 - 7th July 2014 - AndersK
* Don't require SE_RESTORE_NAME and SE_TAKE_OWNERSHIP_NAME when changing owner.
* Fixed broken return value when trustee parsing failed
v1.0.8.0 - 24th March 2014 - AndersK
* Added basic String SID parsing in the emulated ConvertStringSidToSid (Broken in v1.0.6)
* Fixed WinNT4 and Win95 support? (Unicode DLL will not load on Win95 but will probably load on Win98)
* Fixed leaks from ParseSid and ConvertSidToStringSid
* NameToSid and SidToName now pushes "error" and error details
* Better GetCurrentUserName error handling (Still returns the problematic "error" string)
v1.0.7.0 - 25th February 2012 - Afrow UK
* Fixed DisableFileInheritance (broken in v1.0.5.0).
v1.0.6.0 - 26th January 2012 - Afrow UK
* Wrote replacements for ConvertSidToStringSid/ConvertStringSidToSid for
backwards compatibility with Windows NT4/ME (ANSI build only).
* Loads RegSetKeySecurity/RegGetKeySecurity functions at run-time for
backwards compatibility with Windows NT4/ME (ANSI build only).
* Removed commented out legacy code.
v1.0.5.0 - 25th January 2012 - Afrow UK
* Removed IsUserTheAdministrator.
* Added NameToSid.
* Major code cleanup/rewrite.
* Proper Unicode build (with Unicode plugin API).
* Support for 64-bit registry (SetRegView 64).
* Functions now return "ok" on success or "error" otherwise. On "error",
the next item on the stack will be the error description.
* Added version information resource.
23rd January 2008 - Afrow UK
* Added function IsUserTheAdministrator.
* Cleaned up code. Rebuilt as pure cpp, decreasing DLL size.
* No longer using gobal temp variable for strings.
7th January 2008 - Afrow UK
* Fixed registry instructions.
8th November 2007 - Afrow UK
* EnableInheritance/DisableInheritance names changed.
* Functions added:
EnableFileInheritance
DisableFileInheritance
EnableRegKeyInheritance
DisableRegKeyInheritance
GetFileOwner
GetFileGroup
GetRegKeyOwner
GetRegKeyGroup
ClearOnFile
ClearOnRegKey
GetCurrentUserName
SidToName
21st August 2007 - Afrow UK
* Added /noinherit switch to prevent child objects inheriting a
particular permission.
* Added EnableInheritance and DisableInheritance functions.
* Removed code to print items in the install log.
13th July 2007 - kichik
* Return proper error codes (return value instead of GetLastError())
30th June 2006 - Afrow UK
* Error MessageBox removed.
* Error messages are now just returned on NSIS stack.
CONVENTIONS
-----------
<filename>
A valid Windows(tm) filename (ie. "C:\WINDOWS\" or
"\\HOSTNAME\SHARE").
<rootkey>
The well-known root of a registry key. Following values are defined:
HKCR - HKEY_CLASSES_ROOT
HKLM - HKEY_LOCAL_MACHINE
HKCU - HKEY_CURRENT_USER
HKU - HKEY_USERS
<regkey>
The name of the registry to alter (ie. "Software\Microsoft\Windows").
<trustee>
A valid Windows(tm) account. The account can be specified as relative
account name (ie. "Administrator" or "Everyone"), a qualified account
name (ie. "Domain\Administrator") or as security identifier (SID,
ie. "(S-1-5-32-545)"). "BUILTIN\USERS" is also a valid account name.
For a list of trustee names, open up
Control Panel > Administrative Tools > Computer Management >
Local Users and Groups.
WinNT4 uses a emulated version of ConvertStringSidToSid and
only supports the following SDDL strings: AN, AU, BA, BU, IU, SY and WD
<permissions>
A combination of access rights (ie. "FullAccess" or
"GenericRead + GenericWrite").
For a full list of access rights, open the AccessControl.cpp source
file in Notepad.
/NOINHERIT
Ensures the specified ACEs (Access Control Entries) are not inherited
by child nodes (i.e for directory or registry key objects).
HANDLING ERRORS
---------------
To handle errors, check the result on the stack:
AccessControl::SetOnRegKey HKLM Software\MyApp Stuart FullAccess
Pop $R0
${If} $R0 == error
Pop $R0
DetailPrint `AccessControl error: $R0`
${EndIf}
FUNCTIONS
---------
GrantOnFile [/NOINHERIT] <filename> <trustee> <permissions>
GrantOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
Pop $Result ; "ok" or "error" + error details
Makes sure that the trustee get the requested access rights on
that object.
---------
SetOnFile [/NOINHERIT] <filename> <trustee> <permissions>
SetOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
Pop $Result ; "ok" or "error" + error details
Replaces any existing access rights for the trustee on the object
with the specified access rights.
---------
ClearOnFile [/NOINHERIT] <filename> <trustee> <permissions>
ClearOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
Pop $Result ; "ok" or "error" + error details
Replaces all trustees on the object with the specified trustee and
access rights.
---------
DenyOnFile [/NOINHERIT] <filename> <trustee> <permissions>
DenyOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
Pop $Result ; "ok" or "error" + error details
Explicitly denies an access right on a object.
---------
RevokeOnFile [/NOINHERIT] <filename> <trustee> <permissions>
RevokeOnRegKey [/NOINHERIT] <rootkey> <regkey> <trustee> <permissions>
Pop $Result ; "ok" or "error" + error details
Removes a formerly defined access right for that object.
Note that access rights will still be revoked even if they are
inherited.
---------
SetFileOwner <filename> <trustee>
SetRegKeyOwner <rootkey> <regkey> <trustee>
Pop $Result ; "ok" or "error" + error details
Changes the owner of an object.
---------
GetFileOwner <filename>
GetRegKeyOwner <rootkey> <regkey>
Pop $Owner ; or "error" + error details
Gets the owner of an object.
---------
SetFileGroup <filename> <trustee>
SetRegKeyGroup <rootkey> <regkey> <trustee>
Pop $Result ; "ok" or "error" + error details
Changes the primary group of the object.
---------
GetFileGroup <filename>
GetRegKeyGroup <rootkey> <regkey>
Pop $Group ; or "error" + error details
Gets the primary group of the object.
---------
EnableFileInheritance <filename>
EnableRegKeyInheritance <rootkey> <regkey>
Pop $Result ; "ok" or "error" + error details
Enables inheritance of parent object permissions.
---------
DisableFileInheritance <filename>
DisableRegKeyInheritance <rootkey> <regkey>
Pop $Result ; "ok" or "error" + error details
Disables inheritance of parent object permissions.
---------
SidToName <sidstring>
Pop $Domain ; or "error" + error details
Pop $Username
Converts an SID on the local machine to the corresponding username and
domain name.
---------
NameToSid <username>
Pop $SID ; or "error" + error details
Gets the SID of the specified username on the local machine.
---------
GetCurrentUserName
Pop $Username ; or "error"
Gets the username of the current user running the setup.
---------

View File

@ -93,7 +93,7 @@ copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
rem Build Mega-Glest in release mode rem Build Mega-Glest in release mode
ECHO -------------------------------- ECHO --------------------------------
Echo Building Mega-Glest using Visual Studio 2010... Echo Building MegaGlest using Visual Studio 2010...
set CL= set CL=
del ..\..\source\glest_game\facilities\gitversion.h del ..\..\source\glest_game\facilities\gitversion.h
@ -103,6 +103,8 @@ 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%" == "." 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 +,, if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
del /Q /F Release\*.tlog
set msBuildMaxCPU= set msBuildMaxCPU=
SET BuildInParallel=false SET BuildInParallel=false
SET BuildInParallelCount= SET BuildInParallelCount=

View File

@ -117,7 +117,7 @@ copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
rem Build Mega-Glest in release mode rem Build Mega-Glest in release mode
ECHO -------------------------------- ECHO --------------------------------
Echo Building Mega-Glest using Visual Studio 2012... Echo Building MegaGlest using Visual Studio 2012...
set CL=/MP set CL=/MP
rem set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE% rem set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%
@ -142,6 +142,8 @@ 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%" == "." 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 +,, if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
del /Q /F Release\*.tlog
rem set VisualStudioVersion=11.0 rem set VisualStudioVersion=11.0
set msBuildMaxCPU= set msBuildMaxCPU=
SET BuildInParallel=false SET BuildInParallel=false
@ -159,13 +161,15 @@ rem if "%2" == "rebuild" msbuild %msBuildMaxCPU% /p:Configuration=Release;Platfo
rem /p:VCTargetsPath=%MSBUILD_PATH_MG_x64%; rem /p:VCTargetsPath=%MSBUILD_PATH_MG_x64%;
rem if "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:detailed /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m /t:Rebuild Glest_vc2012.sln rem if "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:detailed /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m /t:Rebuild Glest_vc2012.sln
if "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:q /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m /t:Rebuild Glest_vc2012.sln rem if "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:q /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m /t:Rebuild Glest_vc2012.sln
if "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:q /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release_WITHOUT_STREFLOP;Platform=x64;PlatformToolset=v110 /m /t:Rebuild Glest_vc2012.sln
rem if not "%2" == "rebuild" msbuild /detailedsummary %msBuildMaxCPU% /p:BuildInParallel=%BuildInParallel% /p:Configuration=Release Glest_vc2010.sln rem if not "%2" == "rebuild" msbuild /detailedsummary %msBuildMaxCPU% /p:BuildInParallel=%BuildInParallel% /p:Configuration=Release Glest_vc2010.sln
rem if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /p:Configuration=Release;Platform=x64 /v:q /m /p:PlatformToolset=v110_xp Glest_vc2012.sln rem if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /p:Configuration=Release;Platform=x64 /v:q /m /p:PlatformToolset=v110_xp Glest_vc2012.sln
rem if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:detailed /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m Glest_vc2012.sln rem if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:detailed /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m Glest_vc2012.sln
if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:q /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m Glest_vc2012.sln rem if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:q /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release;Platform=x64;PlatformToolset=v110 /m Glest_vc2012.sln
if not "%2" == "rebuild" msbuild %msBuildMaxCPU% /v:q /p:TrackFileAccess=false;VCTargetsPath=%MSBUILD_PATH_MG_x64%;Configuration=Release_WITHOUT_STREFLOP;Platform=x64;PlatformToolset=v110 /m Glest_vc2012.sln
rem pause execution so we can see the output before the batch file exits rem pause execution so we can see the output before the batch file exits
if not "%1" == "nopause" pause if not "%1" == "nopause" pause

View File

@ -269,6 +269,7 @@
<ClCompile Include="..\..\source\glest_game\types\object_type.cpp" /> <ClCompile Include="..\..\source\glest_game\types\object_type.cpp" />
<ClCompile Include="..\..\source\glest_game\types\resource_type.cpp" /> <ClCompile Include="..\..\source\glest_game\types\resource_type.cpp" />
<ClCompile Include="..\..\source\glest_game\types\skill_type.cpp" /> <ClCompile Include="..\..\source\glest_game\types\skill_type.cpp" />
<ClCompile Include="..\..\source\glest_game\types\projectile_type.cpp" />
<ClCompile Include="..\..\source\glest_game\types\tech_tree.cpp" /> <ClCompile Include="..\..\source\glest_game\types\tech_tree.cpp" />
<ClCompile Include="..\..\source\glest_game\types\unit_type.cpp" /> <ClCompile Include="..\..\source\glest_game\types\unit_type.cpp" />
<ClCompile Include="..\..\source\glest_game\types\upgrade_type.cpp" /> <ClCompile Include="..\..\source\glest_game\types\upgrade_type.cpp" />
@ -356,6 +357,7 @@
<ClInclude Include="..\..\source\glest_game\types\object_type.h" /> <ClInclude Include="..\..\source\glest_game\types\object_type.h" />
<ClInclude Include="..\..\source\glest_game\types\resource_type.h" /> <ClInclude Include="..\..\source\glest_game\types\resource_type.h" />
<ClInclude Include="..\..\source\glest_game\types\skill_type.h" /> <ClInclude Include="..\..\source\glest_game\types\skill_type.h" />
<ClInclude Include="..\..\source\glest_game\types\projectile_type.h" />
<ClInclude Include="..\..\source\glest_game\types\tech_tree.h" /> <ClInclude Include="..\..\source\glest_game\types\tech_tree.h" />
<ClInclude Include="..\..\source\glest_game\types\unit_type.h" /> <ClInclude Include="..\..\source\glest_game\types\unit_type.h" />
<ClInclude Include="..\..\source\glest_game\types\upgrade_type.h" /> <ClInclude Include="..\..\source\glest_game\types\upgrade_type.h" />

View File

@ -9,6 +9,22 @@
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_NO_STREFLOP|Win32">
<Configuration>Release_NO_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_NO_STREFLOP|x64">
<Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -31,12 +47,36 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
@ -51,9 +91,21 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
@ -68,20 +120,48 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\data\glest_game\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\data\glest_game\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">.\..\..\data\glest_game\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">.\..\..\data\glest_game\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>g2xml</TargetName> <TargetName>g2xml</TargetName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<TargetName>g2xml</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<TargetName>g2xml</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>g2xmlx64</TargetName> <TargetName>g2xmlx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir> <OutDir>$(SolutionDir)</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<TargetName>g2xmlx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">
<TargetName>g2xmlx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
@ -140,6 +220,50 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
@ -163,6 +287,52 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\..\source\tools\glexemel\g2xml.c" /> <ClCompile Include="..\..\..\source\tools\glexemel\g2xml.c" />
</ItemGroup> </ItemGroup>

View File

@ -17,6 +17,14 @@
<Configuration>Release_NO_STREFLOP</Configuration> <Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -43,10 +51,18 @@
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
</PropertyGroup> </PropertyGroup>
@ -65,9 +81,15 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
@ -82,22 +104,34 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">.\..\..\..\data\glest_game\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">true</LinkIncremental>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">megaglest_g3dviewer</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">megaglest_g3dviewer</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">megaglest_g3dviewer</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">megaglest_g3dviewerx64</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">megaglest_g3dviewerx64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">megaglest_g3dviewerx64</TargetName>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir> <OutDir>$(SolutionDir)</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
@ -188,6 +222,42 @@
</DataExecutionPrevention> </DataExecutionPrevention>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\lib\vc_lib\mswu;..\..\..\source\shared_lib\include\util;..\..\..\source\shared_lib\include\graphics\gl;..\..\..\source\windows_deps_2012\include;..\..\..\source\shared_lib\include\graphics;..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\include;..\..\..\source\shared_lib\include\platform\sdl;../../../source/shared_lib/include/streflop;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/windows_deps_2012/curl-7.21.3/include;..\..\..\source\glest_game\graphics;..\..\..\source\shared_lib\include\xml;../../../source/windows_deps_2012/xerces-c-3.1.1/src;..\..\..\source\glest_game\global;..\..\..\source\glest_game\sound;..\..\..\source\shared_lib\include\sound;..\..\..\source\glest_game\game;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/lpng1510;..\..\..\source\glest_game\facilities;../../../source/windows_deps_2012/glew-1.7.0/include;..\..\..\source\shared_lib\include\xml\rapidxml;../../../source/shared_lib/include/platform/win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;CURL_STATICLIB;UNICODE;_UNICODE;GLEW_STATIC;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>c:\temp\release\$(TargetName).pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>wxbase29u.lib;wxbase29u_net.lib;wxbase29u_xml.lib;wxexpat.lib;wxjpeg.lib;wxtiff.lib;wxmsw29u_adv.lib;wxmsw29u_aui.lib;wxmsw29u_core.lib;wxmsw29u_gl.lib;wxmsw29u_html.lib;wxmsw29u_media.lib;wxmsw29u_qa.lib;wxmsw29u_richtext.lib;wxmsw29u_xrc.lib;wxregexu.lib;winmm.lib;rpcrt4.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleaut32.lib;comctl32.lib;comdlg32.lib;uuid.lib;advapi32.lib;shell32.lib;libglest.lib;Dbghelp.lib;sdl.lib;sdlmain.lib;dxguid.lib;libstreflop.lib;libcurl.lib;ws2_32.lib;xerces-c_static_3.lib;libpng15.lib;jpeg.lib;ftgl_static.lib;freetype244MT.lib;glew32s.lib;zlibstat.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)\$(TargetFileName)</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;../../../source/shared_lib/sources/streflop/libstreflop;$(DXSDK_DIR)/lib/x86;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>
</OptimizeReferences>
<EnableCOMDATFolding>
</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -225,6 +295,43 @@
</DataExecutionPrevention> </DataExecutionPrevention>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\lib\vc_lib\mswu;..\..\..\source\shared_lib\include\util;..\..\..\source\shared_lib\include\graphics\gl;..\..\..\source\windows_deps_2012\include;..\..\..\source\shared_lib\include\graphics;..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\include;..\..\..\source\shared_lib\include\platform\sdl;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/windows_deps_2012/curl-7.21.3/include;..\..\..\source\glest_game\graphics;..\..\..\source\shared_lib\include\xml;../../../source/windows_deps_2012/xerces-c-3.1.1/src;..\..\..\source\glest_game\global;..\..\..\source\glest_game\sound;..\..\..\source\shared_lib\include\sound;..\..\..\source\glest_game\game;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/lpng1510;..\..\..\source\glest_game\facilities;../../../source/windows_deps_2012/glew-1.7.0/include;..\..\..\source\shared_lib\include\xml\rapidxml;../../../source/shared_lib/include/platform/win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;CURL_STATICLIB;UNICODE;_UNICODE;GLEW_STATIC;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>c:\temp\release\$(TargetName).pch</PrecompiledHeaderOutputFile>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<FunctionLevelLinking>true</FunctionLevelLinking>
<FloatingPointModel>Fast</FloatingPointModel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>wxbase29u.lib;wxbase29u_net.lib;wxbase29u_xml.lib;wxexpat.lib;wxjpeg.lib;wxtiff.lib;wxmsw29u_adv.lib;wxmsw29u_aui.lib;wxmsw29u_core.lib;wxmsw29u_gl.lib;wxmsw29u_html.lib;wxmsw29u_media.lib;wxmsw29u_qa.lib;wxmsw29u_richtext.lib;wxmsw29u_xrc.lib;wxregexu.lib;winmm.lib;rpcrt4.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleaut32.lib;comctl32.lib;comdlg32.lib;uuid.lib;advapi32.lib;shell32.lib;libglest.lib;Dbghelp.lib;sdl.lib;sdlmain.lib;dxguid.lib;libcurl.lib;ws2_32.lib;xerces-c_static_3.lib;libpng15.lib;jpeg.lib;ftgl_static.lib;freetype244MT.lib;glew32s.lib;zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)\$(TargetFileName)</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;$(DXSDK_DIR)/lib/x64;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>
</OptimizeReferences>
<EnableCOMDATFolding>
</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<ClCompile> <ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>

View File

@ -17,6 +17,14 @@
<Configuration>Release_NO_STREFLOP</Configuration> <Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -43,10 +51,18 @@
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
</PropertyGroup> </PropertyGroup>
@ -65,9 +81,15 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
@ -82,22 +104,34 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">.\..\..\..\data\glest_game\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">true</LinkIncremental>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">megaglest_editor</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">megaglest_editor</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">megaglest_editor</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">megaglest_editorx64</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">megaglest_editorx64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">megaglest_editorx64</TargetName>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir> <OutDir>$(SolutionDir)</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
@ -187,6 +221,41 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress> <RandomizedBaseAddress>false</RandomizedBaseAddress>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\lib\vc_lib\mswu;..\..\..\source\shared_lib\include\util;..\..\..\source\shared_lib\include\platform\win32;..\..\..\source\shared_lib\include\graphics\gl;..\..\..\source\windows_deps_2012\include;..\..\..\source\shared_lib\include\graphics;..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\include;..\..\..\source\shared_lib\include\platform\sdl;../../../source/shared_lib/include/streflop;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;..\..\..\source\glest_game\global;..\..\..\source\glest_game\game;..\..\..\source\glest_game\facilities;..\..\..\source\shared_lib\include\xml;..\..\..\source\shared_lib\include\xml\rapidxml;../../../source/windows_deps_2012/xerces-c-3.1.1/src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;CURL_STATICLIB;UNICODE;_UNICODE;GLEW_STATIC;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>wxbase29u.lib;wxbase29u_net.lib;wxbase29u_xml.lib;wxexpat.lib;wxjpeg.lib;wxmsw29u_adv.lib;wxmsw29u_aui.lib;wxmsw29u_core.lib;wxmsw29u_gl.lib;wxmsw29u_html.lib;wxmsw29u_media.lib;wxmsw29u_qa.lib;wxmsw29u_richtext.lib;wxmsw29u_xrc.lib;wxpng.lib;wxregexu.lib;wxtiff.lib;winmm.lib;rpcrt4.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleaut32.lib;comctl32.lib;comdlg32.lib;uuid.lib;advapi32.lib;shell32.lib;libglest.lib;sdl.lib;sdlmain.lib;dsound.lib;dxguid.lib;Dbghelp.lib;libcurl.lib;ws2_32.lib;ftgl_static.lib;freetype244MT.lib;zlibstat.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)\$(TargetFileName)</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;$(DXSDK_DIR)/lib/x86;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>
</OptimizeReferences>
<EnableCOMDATFolding>
</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
<DataExecutionPrevention>
</DataExecutionPrevention>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -224,6 +293,43 @@
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\lib\vc_lib\mswu;..\..\..\source\shared_lib\include\util;..\..\..\source\shared_lib\include\platform\win32;..\..\..\source\shared_lib\include\graphics\gl;..\..\..\source\windows_deps_2012\include;..\..\..\source\shared_lib\include\graphics;..\..\..\source\windows_deps_2012\wxWidgets-2.9.3\include;..\..\..\source\shared_lib\include\platform\sdl;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;..\..\..\source\glest_game\global;..\..\..\source\glest_game\game;..\..\..\source\glest_game\facilities;..\..\..\source\shared_lib\include\xml;..\..\..\source\shared_lib\include\xml\rapidxml;../../../source/windows_deps_2012/xerces-c-3.1.1/src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;CURL_STATICLIB;UNICODE;_UNICODE;GLEW_STATIC;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>
</PrecompiledHeaderOutputFile>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>wxbase29u.lib;wxbase29u_net.lib;wxbase29u_xml.lib;wxexpat.lib;wxjpeg.lib;wxmsw29u_adv.lib;wxmsw29u_aui.lib;wxmsw29u_core.lib;wxmsw29u_gl.lib;wxmsw29u_html.lib;wxmsw29u_media.lib;wxmsw29u_qa.lib;wxmsw29u_richtext.lib;wxmsw29u_xrc.lib;wxpng.lib;wxregexu.lib;wxtiff.lib;winmm.lib;rpcrt4.lib;kernel32.lib;user32.lib;gdi32.lib;ole32.lib;oleaut32.lib;comctl32.lib;comdlg32.lib;uuid.lib;advapi32.lib;shell32.lib;libglest.lib;sdl.lib;sdlmain.lib;dsound.lib;dxguid.lib;Dbghelp.lib;libcurl.lib;ws2_32.lib;ftgl_static.lib;freetype244MT.lib;zlibstat.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)\$(TargetFileName)</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;$(DXSDK_DIR)/lib/x64;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>
</OptimizeReferences>
<EnableCOMDATFolding>
</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<ClCompile> <ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>

View File

@ -17,6 +17,14 @@
<Configuration>Release_NO_STREFLOP</Configuration> <Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -48,12 +56,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
@ -76,9 +96,15 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
@ -91,9 +117,13 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\..\..\..\data\glest_game\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\..\..\..\data\glest_game\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">.\..\..\..\data\glest_game\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">false</LinkIncremental>
@ -101,12 +131,18 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">megaglest</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">megaglest</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">megaglest</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">megaglestx64</TargetName> <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">megaglestx64</TargetName>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">megaglestx64</TargetName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir> <OutDir>$(SolutionDir)</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
@ -247,6 +283,56 @@
</IgnoreAllDefaultLibraries> </IgnoreAllDefaultLibraries>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/streflop;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/windows_deps_2012/google-breakpad\trunk\src\client\windows\;../../../source/windows_deps_2012/google-breakpad\trunk\src\;../../../source/shared_lib/include/compression</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4018;4244;4250;4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<AdditionalDependencies>dsound.lib;dxguid.lib;glew32s.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opengl32.lib;glu32.lib;wsock32.lib;libglest.lib;mmc.lib;lua.lib;xerces-c_static_3.lib;Dbghelp.lib;libpng15.lib;jpeg.lib;zlibstat.lib;sdl.lib;sdlmain.lib;winmm.lib;openal32.lib;iphlpapi.lib;libstreflop.lib;libcurl.lib;ws2_32.lib;libircclient.lib;freetype244MT.lib;ftgl_static.lib;libeay32.lib;ssleay32.lib;crash_generation_client.lib;exception_handler.lib;common.lib;processor_bits.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;../../../source/shared_lib/sources/streflop/libstreflop;$(DXSDK_DIR)/lib/x86;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>
</OptimizeReferences>
<EnableCOMDATFolding>
</EnableCOMDATFolding>
<LinkTimeCodeGeneration>
</LinkTimeCodeGeneration>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<TargetMachine>MachineX86</TargetMachine>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
<ShowProgress>
</ShowProgress>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -297,6 +383,56 @@
</IgnoreAllDefaultLibraries> </IgnoreAllDefaultLibraries>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>false</OmitFramePointers>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/shared_lib/include/compression;../../../source/shared_lib/include/streflop/</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL_XXX;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD_XXX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4018;4244;4250;4503;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<AdditionalDependencies>libstreflop.lib;dxguid.lib;glew32s.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opengl32.lib;glu32.lib;wsock32.lib;libglest.lib;mmc.lib;lua.lib;xerces-c_static_3.lib;Dbghelp.lib;libpng15.lib;jpeg.lib;zlibstat.lib;sdl.lib;sdlmain.lib;winmm.lib;openal64.lib;iphlpapi.lib;libcurl.lib;ws2_32.lib;libircclient.lib;freetype244MT.lib;ftgl_static.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;$(DXSDK_DIR)/lib/x64;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>
</OptimizeReferences>
<EnableCOMDATFolding>
</EnableCOMDATFolding>
<LinkTimeCodeGeneration>
</LinkTimeCodeGeneration>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
<ShowProgress>
</ShowProgress>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<ClCompile> <ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
@ -435,6 +571,7 @@
<ClCompile Include="..\..\..\source\glest_game\network\server_interface.cpp" /> <ClCompile Include="..\..\..\source\glest_game\network\server_interface.cpp" />
<ClCompile Include="..\..\..\source\glest_game\sound\sound_container.cpp" /> <ClCompile Include="..\..\..\source\glest_game\sound\sound_container.cpp" />
<ClCompile Include="..\..\..\source\glest_game\sound\sound_renderer.cpp" /> <ClCompile Include="..\..\..\source\glest_game\sound\sound_renderer.cpp" />
<ClCompile Include="..\..\..\source\glest_game\types\projectile_type.cpp" />
<ClCompile Include="..\..\..\source\glest_game\types\tileset_model_type.cpp" /> <ClCompile Include="..\..\..\source\glest_game\types\tileset_model_type.cpp" />
<ClCompile Include="..\..\..\source\glest_game\type_instances\command.cpp" /> <ClCompile Include="..\..\..\source\glest_game\type_instances\command.cpp" />
<ClCompile Include="..\..\..\source\glest_game\type_instances\faction.cpp" /> <ClCompile Include="..\..\..\source\glest_game\type_instances\faction.cpp" />

View File

@ -25,6 +25,14 @@
<Configuration>Release_NO_STREFLOP</Configuration> <Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -66,12 +74,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
@ -99,9 +119,15 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
@ -114,7 +140,9 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'">$(Configuration)\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'">$(Configuration)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'">$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
@ -123,11 +151,19 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>libstreflop</TargetName> <TargetName>libstreflop</TargetName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<TargetName>libstreflop</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>libstreflop</TargetName> <TargetName>libstreflop</TargetName>
<OutDir>.\</OutDir> <OutDir>.\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<TargetName>libstreflop</TargetName>
<OutDir>.\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
@ -184,6 +220,33 @@
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\..\..\source\shared_lib\include\streflop\libm\flt-32;..\..\..\source\shared_lib\include\streflop\libm\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -213,6 +276,35 @@
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>..\..\..\source\shared_lib\include\streflop\libm\flt-32;..\..\..\source\shared_lib\include\streflop\libm\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4996;4250;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Lib>
<TargetMachine>MachineX64</TargetMachine>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'">
<ClCompile> <ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>

View File

@ -9,6 +9,22 @@
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_NO_STREFLOP|Win32">
<Configuration>Release_NO_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_NO_STREFLOP|x64">
<Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -42,6 +58,20 @@
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
@ -49,6 +79,20 @@
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
@ -61,9 +105,21 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
@ -77,12 +133,34 @@
<OutDir>.\..\..\..\data\glest_game\</OutDir> <OutDir>.\..\..\..\data\glest_game\</OutDir>
<TargetName>megaglest_tests</TargetName> <TargetName>megaglest_tests</TargetName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\..\..\..\data\glest_game\</OutDir>
<TargetName>megaglest_tests</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>.\..\..\..\data\glest_game\</OutDir>
<TargetName>megaglest_tests</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>megaglest_testsx64</TargetName> <TargetName>megaglest_testsx64</TargetName>
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir> <OutDir>$(SolutionDir)</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<TargetName>megaglest_testsx64</TargetName>
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">
<TargetName>megaglest_testsx64</TargetName>
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<PrecompiledHeader> <PrecompiledHeader>
@ -158,6 +236,68 @@
<Message>Run unit tests</Message> <Message>Run unit tests</Message>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/streflop;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/windows_deps_2012/google-breakpad\trunk\src\client\windows\;../../../source/windows_deps_2012/google-breakpad\trunk\src\;../../../source/windows_deps_2012/cppunit/include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\megaglest_tests.exe</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;../../../source/shared_lib/sources/streflop/libstreflop;$(DXSDK_DIR)/lib/x86;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x86;../../../source/windows_deps_2012/cppunit/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dsound.lib;dxguid.lib;glew32s.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opengl32.lib;glu32.lib;wsock32.lib;libglest.lib;mmc.lib;lua.lib;xerces-c_static_3.lib;Dbghelp.lib;libpng15.lib;jpeg.lib;zlibstat.lib;sdl.lib;sdlmain.lib;winmm.lib;openal32.lib;iphlpapi.lib;libstreflop.lib;libcurl.lib;ws2_32.lib;libircclient.lib;freetype244MT.lib;ftgl_static.lib;libeay32.lib;ssleay32.lib;crash_generation_client.lib;exception_handler.lib;common.lib;processor_bits.lib;cppunit.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<PostBuildEvent>
<Command>$(OutDir)\megaglest_tests.exe</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Run unit tests</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/streflop;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/windows_deps_2012/google-breakpad\trunk\src\client\windows\;../../../source/windows_deps_2012/google-breakpad\trunk\src\;../../../source/windows_deps_2012/cppunit/include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\megaglest_tests.exe</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;../../../source/shared_lib/sources/streflop/libstreflop;$(DXSDK_DIR)/lib/x86;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x86;../../../source/windows_deps_2012/cppunit/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dsound.lib;dxguid.lib;glew32s.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opengl32.lib;glu32.lib;wsock32.lib;libglest.lib;mmc.lib;lua.lib;xerces-c_static_3.lib;Dbghelp.lib;libpng15.lib;jpeg.lib;zlibstat.lib;sdl.lib;sdlmain.lib;winmm.lib;openal32.lib;iphlpapi.lib;libstreflop.lib;libcurl.lib;ws2_32.lib;libircclient.lib;freetype244MT.lib;ftgl_static.lib;libeay32.lib;ssleay32.lib;crash_generation_client.lib;exception_handler.lib;common.lib;processor_bits.lib;cppunit.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<PostBuildEvent>
<Command>$(OutDir)\megaglest_tests.exe</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Run unit tests</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
@ -192,6 +332,74 @@
<Message>Run unit tests</Message> <Message>Run unit tests</Message>
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP_XXX;STREFLOP_SSE_XXX;LIBM_COMPILING_FLT32_XXX;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/windows_deps_2012/cppunit/include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;$(DXSDK_DIR)/lib/x64;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x64;../../../source/windows_deps_2012/cppunit/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dsound.lib;dxguid.lib;glew32s.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opengl32.lib;glu32.lib;wsock32.lib;libglest.lib;mmc.lib;lua.lib;xerces-c_static_3.lib;Dbghelp.lib;libpng15.lib;jpeg.lib;zlibstat.lib;sdl.lib;sdlmain.lib;winmm.lib;openal64.lib;iphlpapi.lib;libcurl.lib;ws2_32.lib;libircclient.lib;freetype244MT.lib;ftgl_static.lib;cppunit.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<PostBuildEvent>
<Command>$(OutDir)\$(TargetName)$(TargetExt)</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Run unit tests</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP_XXX;STREFLOP_SSE_XXX;LIBM_COMPILING_FLT32_XXX;CURL_STATICLIB;UNICODE;XERCES_STATIC_LIBRARY;GLEW_STATIC;USE_FREETYPEGL;STATICLIB;USE_FTGL;FTGL_LIBRARY_STATIC;ZLIB_WINAPI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/windows_deps_2012/cppunit/include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FloatingPointModel>Fast</FloatingPointModel>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;$(DXSDK_DIR)/lib/x64;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x64;../../../source/windows_deps_2012/cppunit/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dsound.lib;dxguid.lib;glew32s.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opengl32.lib;glu32.lib;wsock32.lib;libglest.lib;mmc.lib;lua.lib;xerces-c_static_3.lib;Dbghelp.lib;libpng15.lib;jpeg.lib;zlibstat.lib;sdl.lib;sdlmain.lib;winmm.lib;openal64.lib;iphlpapi.lib;libcurl.lib;ws2_32.lib;libircclient.lib;freetype244MT.lib;ftgl_static.lib;cppunit.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
<PostBuildEvent>
<Command>$(OutDir)\$(TargetName)$(TargetExt)</Command>
</PostBuildEvent>
<PostBuildEvent>
<Message>Run unit tests</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\..\source\tests\shared_lib\graphics\font_test.cpp" /> <ClCompile Include="..\..\..\source\tests\shared_lib\graphics\font_test.cpp" />
<ClCompile Include="..\..\..\source\tests\shared_lib\graphics\math_util_test.cpp" /> <ClCompile Include="..\..\..\source\tests\shared_lib\graphics\math_util_test.cpp" />

View File

@ -17,6 +17,14 @@
<Configuration>Release_NO_STREFLOP</Configuration> <Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -48,12 +56,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
@ -74,9 +94,15 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
@ -89,19 +115,30 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>libglest</TargetName> <TargetName>libglest</TargetName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<TargetName>libglest</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>libglest</TargetName> <TargetName>libglest</TargetName>
<OutDir>.\</OutDir> <OutDir>.\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<ExecutablePath>$(ExecutablePath)</ExecutablePath> <ExecutablePath>$(ExecutablePath)</ExecutablePath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<TargetName>libglest</TargetName>
<OutDir>.\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<ExecutablePath>$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
@ -193,6 +230,36 @@
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries> <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>../../../source/shared_lib/include;../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/xerces-c-3.1.1/src/xercesc/xinclude;../../../source/windows_deps_2012/lpng1510;../../../source/windows_deps_2012/jpeg-8a;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/sound/openal;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/streflop;../../../source/shared_lib/include/streflop/libm_flt32_source;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/shared_lib/include/platform/miniupnpc;../../../source/shared_lib/include/libircclient/include;../../../source/shared_lib/include/feathery_ftp;../../../source/windows_deps_2012/ftgl-2.1.3-rc5/src;../../../source/windows_deps_2012/freetype-2.4.4/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/shared_lib/include/graphics/md5;../../../source/shared_lib/include/streflop/softfloat;../../../source/shared_lib/include/xml/rapidxml;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/platform/win32;../../../source/windows_deps_2012/vlc-2.0.1/include;../../../source/windows_deps_2012/fribidi-0.19.5/lib;../../../source/windows_deps_2012/fribidi-0.19.5/charset;../../../source/shared_lib/include/compression;../../../source/shared_lib/sources/</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;USE_FTGL;FTGL_LIBRARY_STATIC;TA3D_PLATFORM_MSVC;TA3D_PLATFORM_WINDOWS;STATICLIB;XERCES_STATIC_LIBRARY;GLEW_STATIC;XML_LIBRARY;ZLIB_WINAPI;HAS_LIBVLC;HAVE_FRIBIDI;HAVE_GOOGLE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4250;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<AdditionalDependencies>libstreflop.lib;libcurl.lib;glew32s.lib;freetype244MT.lib;libvlc.lib;libfribidi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>.\;..\..\..\source\windows_deps_2012\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -226,6 +293,39 @@
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries> <IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Lib> </Lib>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WholeProgramOptimization>false</WholeProgramOptimization>
<AdditionalIncludeDirectories>../../../source/shared_lib/include;../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/xerces-c-3.1.1/src/xercesc/xinclude;../../../source/windows_deps_2012/lpng1510;../../../source/windows_deps_2012/jpeg-8a;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/sound/openal;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/shared_lib/include/platform/miniupnpc;../../../source/shared_lib/include/libircclient/include;../../../source/shared_lib/include/feathery_ftp;../../../source/windows_deps_2012/ftgl-2.1.3-rc5/src;../../../source/windows_deps_2012/freetype-2.4.4/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/shared_lib/include/graphics/md5;../../../source/shared_lib/include/xml/rapidxml;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/platform/win32;../../../source/windows_deps_2012/vlc-2.0.1/include;../../../source/windows_deps_2012/fribidi-0.19.5/lib;../../../source/windows_deps_2012/fribidi-0.19.5/charset;../../../source/shared_lib/include/compression;../../../source/shared_lib/sources/;../../../source/shared_lib/include/streflop/</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;USE_FTGL;FTGL_LIBRARY_STATIC;TA3D_PLATFORM_MSVC;TA3D_PLATFORM_WINDOWS;STATICLIB;XERCES_STATIC_LIBRARY;GLEW_STATIC;XML_LIBRARY;ZLIB_WINAPI;HAS_LIBVLC_XXX;HAVE_FRIBIDI;HAVE_GOOGLE_BREAKPAD_XXX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<ExceptionHandling>Async</ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<FloatingPointModel>Precise</FloatingPointModel>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<ProgramDataBaseFileName>$(OutDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4250;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Lib>
<AdditionalDependencies>libstreflop.lib;libcurl.lib;glew32s.lib;freetype244MT.lib;libfribidi.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>.\;..\..\..\source\windows_deps_2012\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<TargetMachine>MachineX64</TargetMachine>
<IgnoreAllDefaultLibraries>
</IgnoreAllDefaultLibraries>
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<ClCompile> <ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>

View File

@ -9,6 +9,22 @@
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release_NO_STREFLOP|Win32">
<Configuration>Release_NO_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_NO_STREFLOP|x64">
<Configuration>Release_NO_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|Win32">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release_WITHOUT_STREFLOP|x64">
<Configuration>Release_WITHOUT_STREFLOP</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -31,12 +47,36 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset> <PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset> <PlatformToolset>v110</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
@ -51,9 +91,21 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
@ -68,20 +120,48 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir> <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\..\..\..\data\glest_game\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">.\..\..\..\data\glest_game\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">.\..\..\..\data\glest_game\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest> <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>xml2g</TargetName> <TargetName>xml2g</TargetName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<TargetName>xml2g</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<TargetName>xml2g</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>xml2gx64</TargetName> <TargetName>xml2gx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir> <OutDir>$(SolutionDir)</OutDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<TargetName>xml2gx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">
<TargetName>xml2gx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
@ -149,6 +229,56 @@
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\libxml2-2.7.7\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;libxml2_a.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\source\windows_deps_2012\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\libxml2-2.7.7\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;libxml2_a.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\source\windows_deps_2012\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
@ -175,6 +305,58 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\libxml2-2.7.7\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;libxml2_a.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\source\windows_deps_2012\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>..\..\..\source\windows_deps_2012\libxml2-2.7.7\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableEnhancedInstructionSet>
</EnableEnhancedInstructionSet>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalDependencies>wsock32.lib;libxml2_a.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\source\windows_deps_2012\lib\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\..\source\tools\glexemel\xml2g.c" /> <ClCompile Include="..\..\..\source\tools\glexemel\xml2g.c" />
</ItemGroup> </ItemGroup>

2
source/.gitignore vendored
View File

@ -1,2 +1,4 @@
/windows_deps*/ /windows_deps*/
/glest_game/facilities/gitversion.h /glest_game/facilities/gitversion.h
/glest_game/site/
/Debug

View File

@ -299,6 +299,9 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
this->appPath = appPath; this->appPath = appPath;
Properties::setApplicationPath(executable_path(appPath)); Properties::setApplicationPath(executable_path(appPath));
lastanim = 0;
model= NULL;
Config &config = Config::getInstance(); Config &config = Config::getInstance();
//getGlPlatformExtensions(); //getGlPlatformExtensions();
@ -313,8 +316,6 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
glCanvas->SetCurrent(); glCanvas->SetCurrent();
#endif #endif
lastanim = 0;
model= NULL;
unitPath = unitToLoad; unitPath = unitToLoad;
if(modelPath != "") { if(modelPath != "") {
@ -480,6 +481,9 @@ void MainWindow::setupTimer() {
} }
void MainWindow::setupStartupSettings() { void MainWindow::setupStartupSettings() {
glCanvas->setCurrentGLContext();
GLuint err = glewInit(); GLuint err = glewInit();
if (GLEW_OK != err) { if (GLEW_OK != err) {
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err)); fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
@ -552,8 +556,9 @@ MainWindow::~MainWindow(){
delete fileDialog; delete fileDialog;
fileDialog = NULL; fileDialog = NULL;
delete model; //delete model;
model = NULL; //model = NULL;
if(renderer) renderer->end();
delete renderer; delete renderer;
renderer = NULL; renderer = NULL;
@ -567,7 +572,7 @@ MainWindow::~MainWindow(){
void MainWindow::init() { void MainWindow::init() {
#if wxCHECK_VERSION(2, 9, 3) #if wxCHECK_VERSION(2, 9, 3)
glCanvas->setCurrentGLContext(); //glCanvas->setCurrentGLContext();
//printf("setcurrent #1\n"); //printf("setcurrent #1\n");
#elif wxCHECK_VERSION(2, 9, 1) #elif wxCHECK_VERSION(2, 9, 1)
@ -585,7 +590,9 @@ void MainWindow::init() {
void MainWindow::onPaint(wxPaintEvent &event) { void MainWindow::onPaint(wxPaintEvent &event) {
if(!IsShown()) return; if(!IsShown()) return;
#if wxCHECK_VERSION(2, 9, 3) #if wxCHECK_VERSION(2, 9, 4)
//glCanvas->setCurrentGLContext();
#elif wxCHECK_VERSION(2, 9, 3)
#elif wxCHECK_VERSION(2, 9, 1) #elif wxCHECK_VERSION(2, 9, 1)
glCanvas->setCurrentGLContext(); glCanvas->setCurrentGLContext();
@ -737,7 +744,6 @@ void MainWindow::onClose(wxCloseEvent &event){
particleSplashPathList.clear(); // as above particleSplashPathList.clear(); // as above
if(timer) timer->Stop(); if(timer) timer->Stop();
if(renderer) renderer->end();
unitParticleSystems.clear(); unitParticleSystems.clear();
unitParticleSystemTypes.clear(); unitParticleSystemTypes.clear();
@ -747,8 +753,9 @@ void MainWindow::onClose(wxCloseEvent &event){
splashParticleSystems.clear(); // as above splashParticleSystems.clear(); // as above
splashParticleSystemTypes.clear(); splashParticleSystemTypes.clear();
delete model; //delete model;
model = NULL; //model = NULL;
if(renderer) renderer->end();
//printf("OnClose about to END\n"); //printf("OnClose about to END\n");
//fflush(stdout); //fflush(stdout);
@ -756,8 +763,8 @@ void MainWindow::onClose(wxCloseEvent &event){
delete timer; delete timer;
timer = NULL; timer = NULL;
delete model; //delete model;
model = NULL; //model = NULL;
delete renderer; delete renderer;
renderer = NULL; renderer = NULL;
@ -1107,7 +1114,9 @@ void MainWindow::onMenuFileClearAll(wxCommandEvent &event) {
splashParticleSystems.clear(); // as above splashParticleSystems.clear(); // as above
splashParticleSystemTypes.clear(); splashParticleSystemTypes.clear();
delete model; //delete model;
//model = NULL;
if(model != NULL && renderer != NULL) renderer->endModel(rsGlobal, model);
model = NULL; model = NULL;
loadUnit("",""); loadUnit("","");
@ -1279,7 +1288,9 @@ void MainWindow::loadModel(string path) {
//printf("Loading model [%s] %u of " MG_SIZE_T_SPECIFIER "\n",modelPath.c_str(),idx, this->modelPathList.size()); //printf("Loading model [%s] %u of " MG_SIZE_T_SPECIFIER "\n",modelPath.c_str(),idx, this->modelPathList.size());
if(timer) timer->Stop(); if(timer) timer->Stop();
delete model; //delete model;
if(model != NULL && renderer != NULL) renderer->endModel(rsGlobal, model);
model = NULL;
model = renderer? renderer->newModel(rsGlobal, modelPath): NULL; model = renderer? renderer->newModel(rsGlobal, modelPath): NULL;
statusbarText = getModelInfo(); statusbarText = getModelInfo();
@ -1371,6 +1382,8 @@ void MainWindow::loadParticle(string path) {
for(std::vector<UnitParticleSystemType *>::const_iterator it= unitParticleSystemTypes.begin(); it != unitParticleSystemTypes.end(); ++it) { for(std::vector<UnitParticleSystemType *>::const_iterator it= unitParticleSystemTypes.begin(); it != unitParticleSystemTypes.end(); ++it) {
UnitParticleSystem *ups= new UnitParticleSystem(200); UnitParticleSystem *ups= new UnitParticleSystem(200);
ups->setParticleType((*it));
(*it)->setValues(ups); (*it)->setValues(ups);
if(size > 0) { if(size > 0) {
//getCurrVectorFlat() + Vec3f(0.f, type->getHeight()/2.f, 0.f); //getCurrVectorFlat() + Vec3f(0.f, type->getHeight()/2.f, 0.f);
@ -2027,7 +2040,7 @@ GlCanvas::GlCanvas(MainWindow * mainWindow, int *args)
} }
GlCanvas::~GlCanvas() { GlCanvas::~GlCanvas() {
delete this->context; if(this->context) delete this->context;
this->context = NULL; this->context = NULL;
} }
@ -2037,11 +2050,13 @@ void GlCanvas::setCurrentGLContext() {
#if wxCHECK_VERSION(2, 9, 1) #if wxCHECK_VERSION(2, 9, 1)
if(this->context == NULL) { if(this->context == NULL) {
this->context = new wxGLContext(this); this->context = new wxGLContext(this);
//printf("Set ctx [%p]\n",this->context);
} }
#endif #endif
//printf("Set ctx [%p]\n",this->context); //printf("Set ctx [%p]\n",this->context);
if(this->context) { if(this->context) {
wxGLCanvas::SetCurrent(*this->context); wxGLCanvas::SetCurrent(*this->context);
//printf("Set ctx2 [%p]\n",this->context);
} }
#else #else
this->SetCurrent(); this->SetCurrent();

View File

@ -201,6 +201,7 @@ public:
void onKeyDown(wxKeyEvent &event); void onKeyDown(wxKeyEvent &event);
void setCurrentGLContext(); void setCurrentGLContext();
wxGLContext * getCtx() { return context; }
private: private:
MainWindow *mainWindow; MainWindow *mainWindow;
wxGLContext *context; wxGLContext *context;

View File

@ -200,6 +200,10 @@ Model * Renderer::newModel(ResourceScope rs,const string &path,bool deletePixMap
return modelManager->newModel(path,deletePixMapAfterLoad,loadedFileList,sourceLoader); return modelManager->newModel(path,deletePixMapAfterLoad,loadedFileList,sourceLoader);
} }
void Renderer::endModel(ResourceScope rs,Model *model) {
modelManager->endModel(model);
}
void Renderer::init() { void Renderer::init() {
assertGl(); assertGl();

View File

@ -147,6 +147,7 @@ public:
Texture2D * getNewTexture2D(); Texture2D * getNewTexture2D();
Model *newModel(ResourceScope rs,const string &path,bool deletePixMapAfterLoad=false,std::map<string,vector<pair<string, string> > > *loadedFileList=NULL, string *sourceLoader=NULL); Model *newModel(ResourceScope rs,const string &path,bool deletePixMapAfterLoad=false,std::map<string,vector<pair<string, string> > > *loadedFileList=NULL, string *sourceLoader=NULL);
void endModel(ResourceScope rs,Model *model);
Texture2D *newTexture2D(ResourceScope rs) { return getNewTexture2D(); } Texture2D *newTexture2D(ResourceScope rs) { return getNewTexture2D(); }
void initTextureManager(); void initTextureManager();

View File

@ -208,6 +208,7 @@ IF(BUILD_MEGAGLEST)
ENDIF() ENDIF()
IF(WIN32) 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_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_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-subsystem,console -mconsole")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wl,-subsystem,console -mconsole") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wl,-subsystem,console -mconsole")

2329
source/glest_game/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -531,7 +531,7 @@ bool Ai::findAbleUnit(int *unitIndex, CommandClass ability, bool idleOnly){
*unitIndex= -1; *unitIndex= -1;
for(int i=0; i<aiInterface->getMyUnitCount(); ++i){ for(int i=0; i<aiInterface->getMyUnitCount(); ++i){
const Unit *unit= aiInterface->getMyUnit(i); const Unit *unit= aiInterface->getMyUnit(i);
if(unit->getType()->hasCommandClass(ability)){ if(unit->getType()->isCommandable() && unit->getType()->hasCommandClass(ability)){
if(!idleOnly || !unit->anyCommand() || unit->getCurrCommand()->getCommandType()->getClass()==ccStop){ if(!idleOnly || !unit->anyCommand() || unit->getCurrCommand()->getCommandType()->getClass()==ccStop){
units.push_back(i); units.push_back(i);
} }
@ -553,6 +553,7 @@ vector<int> Ai::findUnitsHarvestingResourceType(const ResourceType *rt) {
Map *map= aiInterface->getMap(); Map *map= aiInterface->getMap();
for(int i = 0; i < aiInterface->getMyUnitCount(); ++i) { for(int i = 0; i < aiInterface->getMyUnitCount(); ++i) {
const Unit *unit= aiInterface->getMyUnit(i); const Unit *unit= aiInterface->getMyUnit(i);
if(unit->getType()->isCommandable()) {
if(unit->getType()->hasCommandClass(ccHarvest)) { if(unit->getType()->hasCommandClass(ccHarvest)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccHarvest) { if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccHarvest) {
Command *command= unit->getCurrCommand(); Command *command= unit->getCurrCommand();
@ -605,6 +606,7 @@ vector<int> Ai::findUnitsHarvestingResourceType(const ResourceType *rt) {
} }
} }
} }
}
return units; return units;
} }
@ -614,7 +616,7 @@ vector<int> Ai::findUnitsDoingCommand(CommandClass currentCommand) {
for(int i = 0; i < aiInterface->getMyUnitCount(); ++i) { for(int i = 0; i < aiInterface->getMyUnitCount(); ++i) {
const Unit *unit= aiInterface->getMyUnit(i); const Unit *unit= aiInterface->getMyUnit(i);
if(unit->getType()->hasCommandClass(currentCommand)) { if(unit->getType()->isCommandable() && unit->getType()->hasCommandClass(currentCommand)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == currentCommand) { if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == currentCommand) {
units.push_back(i); units.push_back(i);
} }
@ -630,7 +632,7 @@ bool Ai::findAbleUnit(int *unitIndex, CommandClass ability, CommandClass current
*unitIndex= -1; *unitIndex= -1;
for(int i=0; i<aiInterface->getMyUnitCount(); ++i){ for(int i=0; i<aiInterface->getMyUnitCount(); ++i){
const Unit *unit= aiInterface->getMyUnit(i); const Unit *unit= aiInterface->getMyUnit(i);
if(unit->getType()->hasCommandClass(ability)){ if(unit->getType()->isCommandable() && unit->getType()->hasCommandClass(ability)){
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass()==currentCommand){ if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass()==currentCommand){
units.push_back(i); units.push_back(i);
} }

View File

@ -1224,7 +1224,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){
if(ai->outputAIBehaviourToConsole()) printf("produceSpecific aiInterface->reqsOk(ct) = [%d] Testing AI RULE Name[%s]\n",aiInterface->reqsOk(ct), this->getName().c_str()); if(ai->outputAIBehaviourToConsole()) printf("produceSpecific aiInterface->reqsOk(ct) = [%d] Testing AI RULE Name[%s]\n",aiInterface->reqsOk(ct), this->getName().c_str());
if(aiInterface->reqsOk(ct)){ if(aiInterface->reqsOk(ct)){
defCt= ct; //defCt= ct;
producers.push_back(i); producers.push_back(i);
producersDefaultCommandType[i].push_back(ct); producersDefaultCommandType[i].push_back(ct);
} }
@ -1779,7 +1779,7 @@ void AiRuleBuild::buildSpecific(const BuildTask *bt) {
if(aiInterface->reqsOk(bct)) { if(aiInterface->reqsOk(bct)) {
builders.push_back(i); builders.push_back(i);
buildersDefaultCommandType[i].push_back(bct); buildersDefaultCommandType[i].push_back(bct);
defBct= bct; //defBct= bct;
} }
} }
} }

View File

@ -281,6 +281,8 @@ GraphicLabel::GraphicLabel() {
editModeEnabled = false; editModeEnabled = false;
maxEditWidth = -1; maxEditWidth = -1;
maxEditRenderWidth = -1; maxEditRenderWidth = -1;
renderBackground = false;
backgroundColor=Vec4f(0.2f,0.2f,0.2f,0.6f);
isPassword = false; isPassword = false;
texture = NULL; texture = NULL;
} }
@ -339,6 +341,7 @@ const int GraphicButton::defW= 90;
GraphicButton::GraphicButton(std::string containerName, std::string objName) : GraphicComponent(containerName,objName) { GraphicButton::GraphicButton(std::string containerName, std::string objName) : GraphicComponent(containerName,objName) {
lighted = false; lighted = false;
alwaysLighted = false;
useCustomTexture = false; useCustomTexture = false;
customTexture = NULL; customTexture = NULL;
} }
@ -615,7 +618,7 @@ bool GraphicListBox::mouseClick(int x, int y,string advanceToItemStartingWith) {
// class GraphicMessageBox // class GraphicMessageBox
// ===================================================== // =====================================================
const int GraphicMessageBox::defH= 240; const int GraphicMessageBox::defH= 280;
const int GraphicMessageBox::defW= 350; const int GraphicMessageBox::defW= 350;
GraphicMessageBox::GraphicMessageBox(std::string containerName, std::string objName) : GraphicMessageBox::GraphicMessageBox(std::string containerName, std::string objName) :
@ -836,7 +839,7 @@ void GraphicScrollBar::init(int x, int y, bool horizontal,int length, int thickn
bool GraphicScrollBar::mouseDown(int x, int y) { bool GraphicScrollBar::mouseDown(int x, int y) {
if(getVisible() && getEnabled() && getEditable()) if(getVisible() && getEnabled() && getEditable())
{ {
if(activated) if(activated && elementCount>0)
{ {
if( elementCount>visibleSize) { if( elementCount>visibleSize) {
int pos; int pos;
@ -874,7 +877,10 @@ void GraphicScrollBar::setVisibleStart(int vs){
if(visibleStart<0) { if(visibleStart<0) {
visibleStart=0; visibleStart=0;
} }
float partSize=(float)getLength()/(float)elementCount; float partSize = 0.f;
if(elementCount > 0) {
partSize = (float)getLength()/(float)elementCount;
}
visibleCompPosStart=visibleStart*partSize; visibleCompPosStart=visibleStart*partSize;
visibleCompPosEnd=visibleStart*partSize+visibleSize*partSize; visibleCompPosEnd=visibleStart*partSize+visibleSize*partSize;
if(visibleCompPosEnd>getLength()) { if(visibleCompPosEnd>getLength()) {

View File

@ -146,6 +146,8 @@ private:
bool editModeEnabled; bool editModeEnabled;
int maxEditWidth; int maxEditWidth;
int maxEditRenderWidth; int maxEditRenderWidth;
bool renderBackground;
Vec4f backgroundColor;
vector<int> textCharLength; vector<int> textCharLength;
bool isPassword; bool isPassword;
@ -187,6 +189,11 @@ public:
void setMaxEditWidth(int value) { maxEditWidth = value; } void setMaxEditWidth(int value) { maxEditWidth = value; }
int getMaxEditWidth() const { return maxEditWidth; } int getMaxEditWidth() const { return maxEditWidth; }
void setRenderBackground(bool value) { renderBackground = value; }
bool getRenderBackground() const { return renderBackground; }
Vec4f getBackgroundColor() const {return backgroundColor;}
void setBackgroundColor(Vec4f color) {this->backgroundColor= color;}
void setMaxEditRenderWidth(int value) { maxEditRenderWidth = value; } void setMaxEditRenderWidth(int value) { maxEditRenderWidth = value; }
int getMaxEditRenderWidth() const { return maxEditRenderWidth; } int getMaxEditRenderWidth() const { return maxEditRenderWidth; }
@ -205,6 +212,7 @@ public:
private: private:
bool lighted; bool lighted;
bool alwaysLighted;
bool useCustomTexture; bool useCustomTexture;
Texture *customTexture; Texture *customTexture;
@ -219,9 +227,10 @@ public:
void setUseCustomTexture(bool value) { useCustomTexture=value; } void setUseCustomTexture(bool value) { useCustomTexture=value; }
void setCustomTexture(Texture *value) { customTexture=value; } void setCustomTexture(Texture *value) { customTexture=value; }
bool getLighted() const {return lighted;} bool getLighted() const {return lighted||alwaysLighted;}
void setLighted(bool lighted) {this->lighted= lighted;} void setLighted(bool lighted) {this->lighted= lighted;}
bool getAlwaysLighted() const {return alwaysLighted;}
void setAlwaysLighted(bool value) {this->alwaysLighted= value;}
virtual bool mouseMove(int x, int y); virtual bool mouseMove(int x, int y);
}; };

View File

@ -19,6 +19,7 @@
#include "platform_util.h" #include "platform_util.h"
#include "conversion.h" #include "conversion.h"
#include "cache_manager.h" #include "cache_manager.h"
#include "errno.h"
#include "leak_dumper.h" #include "leak_dumper.h"
using namespace Shared::Util; using namespace Shared::Util;
@ -27,7 +28,13 @@ using namespace Shared::Platform;
namespace Glest { namespace Game { namespace Glest { namespace Game {
const char *mailString = " http://bugs.megaglest.org"; const char *mailString = " http://bugs.megaglest.org";
const string glestVersionString = "v3.10.0-dev";
// !! Use minor versions !! Only major and minor version control compatibility!
// typical version numbers look like this: v3.11-beta1.0 v3.12-dev v3.12.0
// don't forget to update mk/linux/mg-version.sh
const string glestVersionString = "v3.11.0";
const string lastCompatibleSaveGameVersionString = "v3.9.0";
#if defined(GITVERSION) #if defined(GITVERSION)
const string GIT_RawRev = string(GITVERSION); const string GIT_RawRev = string(GITVERSION);
const string GIT_Rev = string("Rev: ") + string(GITVERSION); const string GIT_Rev = string("Rev: ") + string(GITVERSION);
@ -47,7 +54,7 @@ string getCrashDumpFileName(){
return "megaglest" + glestVersionString + ".dmp"; return "megaglest" + glestVersionString + ".dmp";
} }
string getPlatformNameString() { string getPlatformTypeNameString() {
static string platform; static string platform;
if(platform == "") { if(platform == "") {
#if defined(WIN32) #if defined(WIN32)
@ -89,27 +96,42 @@ string getPlatformNameString() {
#else #else
platform = "???"; platform = "???";
#endif #endif
}
return platform;
}
string getPlatformArchTypeNameString() {
static string platform;
if(platform == "") {
#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) || defined(_WIN64) #if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) || defined(_WIN64)
platform += "-X64"; platform = "-X64";
#elif defined(_M_ALPHA) || defined(__alpha__) #elif defined(_M_ALPHA) || defined(__alpha__)
platform += "-ALPHA"; platform = "-ALPHA";
#elif defined(_M_IA64) || defined(__ia64__) #elif defined(_M_IA64) || defined(__ia64__)
platform += "-IA64"; platform = "-IA64";
#elif defined(_M_MRX000) || defined(__mips__) #elif defined(_M_MRX000) || defined(__mips__)
platform += "-MIPS"; platform = "-MIPS";
#elif defined(_M_PPC) || defined(__powerpc__) #elif defined(_M_PPC) || defined(__powerpc__)
platform += "-POWERPC"; platform = "-POWERPC";
#elif defined(__sparc__) #elif defined(__sparc__)
platform += "-SPARC"; platform = "-SPARC";
#elif defined(_M_ARM_FP) || defined(__arm__) || defined(_M_ARM) #elif defined(_M_ARM_FP) || defined(__arm__) || defined(_M_ARM)
platform += "-ARM"; platform = "-ARM";
#endif #endif
} }
return platform; return platform;
} }
string getPlatformNameString() {
static string platform;
if(platform == "") {
platform = getPlatformTypeNameString() + getPlatformArchTypeNameString();
}
return platform;
}
string getGITRevisionString() { string getGITRevisionString() {
return GIT_Rev; return GIT_Rev;
} }
@ -191,7 +213,7 @@ string getAboutString1(int i) {
case 0: return "MegaGlest " + glestVersionString + " (" + "Shared Library " + sharedLibVersionString + ")"; case 0: return "MegaGlest " + glestVersionString + " (" + "Shared Library " + sharedLibVersionString + ")";
case 1: return "Built: " + string(__DATE__) + " " + GIT_Rev; case 1: return "Built: " + string(__DATE__) + " " + GIT_Rev;
case 2: return "Copyright 2001-2010 The Glest Team"; case 2: return "Copyright 2001-2010 The Glest Team";
case 3: return "Copyright 2010-2014 The MegaGlest Team"; case 3: return "Copyright 2010-2015 The MegaGlest Team";
} }
return ""; return "";
} }
@ -349,4 +371,40 @@ void initSpecialStrings() {
getCompileDateTime(); getCompileDateTime();
} }
bool upgradeFilesInTemp() {
// Get path to temp files
string tempFilePath = "temp/";
if(getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) != "") {
tempFilePath = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) + tempFilePath;
}
else {
Config &config = Config::getInstance();
string userData = config.getString("UserData_Root","");
if(userData != "") {
endPathWithSlash(userData);
}
tempFilePath = userData + tempFilePath;
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Temp files path [%s]\n",tempFilePath.c_str());
// Move all files into binary folder
bool anyFailures = false;
vector<string> fileList = getFolderTreeContentsListRecursively(tempFilePath, "", false, NULL);
for(unsigned int index = 0; index < fileList.size(); ++index) {
string fileName = fileList[index];
string newFileName = Properties::getApplicationPath() + extractFileFromDirectoryPath(fileName);
bool result = renameFile(fileName,newFileName);
if(result == false) {
printf("FAILED Rename: [%s] to [%s] result = %d errno = %d\n",fileName.c_str(),newFileName.c_str(),result,errno);
anyFailures = true;
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Rename: [%s] to [%s] result = %d\n",fileName.c_str(),newFileName.c_str(),result);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Successfully updated!\n");
return (fileList.size() > 0 && anyFailures == false);
}
}}//end namespace }}//end namespace

View File

@ -29,10 +29,13 @@ namespace Glest{ namespace Game{
extern const char *mailString; extern const char *mailString;
extern const string glestVersionString; extern const string glestVersionString;
extern const string lastCompatibleSaveGameVersionString;
extern const string networkVersionString; extern const string networkVersionString;
void initSpecialStrings(); void initSpecialStrings();
string getCrashDumpFileName(); string getCrashDumpFileName();
string getPlatformTypeNameString();
string getPlatformArchTypeNameString();
string getPlatformNameString(); string getPlatformNameString();
string getGITRevisionString(); string getGITRevisionString();
string getRAWGITRevisionString(); string getRAWGITRevisionString();
@ -51,6 +54,8 @@ string formatString(string str);
string getGameReadWritePath(string lookupKey=""); string getGameReadWritePath(string lookupKey="");
string getGameCustomCoreDataPath(string originalBasePath, string uniqueFilePath); string getGameCustomCoreDataPath(string originalBasePath, string uniqueFilePath);
bool upgradeFilesInTemp();
}}//end namespace }}//end namespace
#endif #endif

View File

@ -103,8 +103,14 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) {
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys)); Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
//toggle team mode //toggle team mode
if(editEnabled == false && disableTeamMode == false && if(editEnabled == false &&
isKeyPressed(configKeys.getSDLKey("ChatTeamMode"),key) == true) { isKeyPressed(configKeys.getSDLKey("ChatTeamMode"),key) == true) {
if(disableTeamMode == true) {
if (!inMenu) {
console->addLine(lang.getString("ChatModeDisabledToAvoidCheating") );
}
}
else {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
if (!inMenu) { if (!inMenu) {
@ -117,6 +123,8 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) {
} }
} }
} }
}
if(isKeyPressed(SDLK_RETURN,key, false) == true) { if(isKeyPressed(SDLK_RETURN,key, false) == true) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym); SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);

View File

@ -687,7 +687,7 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
// If > 50% of team vote yes, switch th eplayers team // If > 50% of team vote yes, switch th eplayers team
if(newTeamTotalMemberCount > 0 && newTeamVotedYes > 0 && if(newTeamTotalMemberCount > 0 && newTeamVotedYes > 0 &&
newTeamVotedYes / newTeamTotalMemberCount > 0.5) { static_cast<float>(newTeamVotedYes) / static_cast<float>(newTeamTotalMemberCount) > 0.5) {
Faction *faction = world->getFaction(factionIndex); Faction *faction = world->getFaction(factionIndex);
int oldTeam = faction->getTeam(); int oldTeam = faction->getTeam();
faction->setTeam(vote->newTeam); faction->setTeam(vote->newTeam);
@ -765,26 +765,30 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface(); GameNetworkInterface *gameNetworkInterface= NetworkManager::getInstance().getGameNetworkInterface();
if(gameNetworkInterface != NULL) { if(gameNetworkInterface != NULL) {
ServerInterface *server = networkManager.getServerInterface(); ServerInterface *server = networkManager.getServerInterface();
if(server->isClientConnected(playerIndex) == true) { if(server != NULL && server->isClientConnected(playerIndex) == true) {
MutexSafeWrapper safeMutex(server->getSlotMutex(playerIndex),CODE_AT_LINE); MutexSafeWrapper safeMutex(server->getSlotMutex(playerIndex),CODE_AT_LINE);
ConnectionSlot *slot = server->getSlot(playerIndex,false); ConnectionSlot *slot = server->getSlot(playerIndex,false);
if(slot != NULL) { if(slot != NULL) {
safeMutex.ReleaseLock(true); safeMutex.ReleaseLock();
NetworkMessageQuit networkMessageQuit; NetworkMessageQuit networkMessageQuit;
slot->sendMessage(&networkMessageQuit); slot->sendMessage(&networkMessageQuit);
sleep(5); sleep(5);
//printf("Sending nctDisconnectNetworkPlayer\n"); //printf("Sending nctDisconnectNetworkPlayer\n");
safeMutex.Lock(); server = networkManager.getServerInterface(false);
if(server != NULL) {
MutexSafeWrapper safeMutex2(server->getSlotMutex(playerIndex),CODE_AT_LINE);
slot = server->getSlot(playerIndex,false); slot = server->getSlot(playerIndex,false);
if(slot != NULL) { if(slot != NULL) {
safeMutex2.ReleaseLock();
slot->close(); slot->close();
} }
} }
} }
} }
} }
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] found nctDisconnectNetworkPlayer\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] found nctDisconnectNetworkPlayer\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
} }
break; break;

View File

@ -115,6 +115,7 @@ Game::Game() : ProgramState(NULL) {
renderFpsAvgTest=0; renderFpsAvgTest=0;
renderExtraTeamColor=0; renderExtraTeamColor=0;
photoModeEnabled=false; photoModeEnabled=false;
healthbarMode=hbvUndefined;
visibleHUD=false; visibleHUD=false;
timeDisplay=false; timeDisplay=false;
withRainEffect=false; withRainEffect=false;
@ -190,8 +191,12 @@ void Game::resetMembers() {
GameConstants::updateFps= 40; GameConstants::updateFps= 40;
GameConstants::cameraFps= 100; GameConstants::cameraFps= 100;
captureAvgTestStatus = false; captureAvgTestStatus = false;
updateFpsAvgTest=0;
renderFpsAvgTest=0;
lastRenderLog2d = 0; lastRenderLog2d = 0;
playerIndexDisconnect=0;
lastMasterServerGameStatsDump=0; lastMasterServerGameStatsDump=0;
highlightCellTexture=NULL;
totalRenderFps =0; totalRenderFps =0;
lastMaxUnitCalcTime =0; lastMaxUnitCalcTime =0;
renderExtraTeamColor =0; renderExtraTeamColor =0;
@ -235,6 +240,7 @@ void Game::resetMembers() {
scrollSpeed = Config::getInstance().getFloat("UiScrollSpeed","1.5"); scrollSpeed = Config::getInstance().getFloat("UiScrollSpeed","1.5");
photoModeEnabled = Config::getInstance().getBool("PhotoMode","false"); photoModeEnabled = Config::getInstance().getBool("PhotoMode","false");
healthbarMode = Config::getInstance().getInt("HealthBarMode","0");
visibleHUD = Config::getInstance().getBool("VisibleHud","true"); visibleHUD = Config::getInstance().getBool("VisibleHud","true");
timeDisplay = Config::getInstance().getBool("TimeDisplay","true"); timeDisplay = Config::getInstance().getBool("TimeDisplay","true");
withRainEffect = Config::getInstance().getBool("RainEffect","true"); withRainEffect = Config::getInstance().getBool("RainEffect","true");
@ -269,6 +275,7 @@ void Game::resetMembers() {
this->speed= 1; this->speed= 1;
showFullConsole= false; showFullConsole= false;
setMarker = false; setMarker = false;
cameraDragAllowed=false;
camLeftButtonDown=false; camLeftButtonDown=false;
camRightButtonDown=false; camRightButtonDown=false;
camUpButtonDown=false; camUpButtonDown=false;
@ -309,6 +316,11 @@ Game::Game(Program *program, const GameSettings *gameSettings,bool masterserverM
this->masterserverMode = masterserverMode; this->masterserverMode = masterserverMode;
videoPlayer = NULL; videoPlayer = NULL;
playingStaticVideo = false; playingStaticVideo = false;
highlightCellTexture = NULL;
playerIndexDisconnect=0;
updateFpsAvgTest=0;
renderFpsAvgTest=0;
cameraDragAllowed=false;
if(this->masterserverMode == true) { if(this->masterserverMode == true) {
printf("Starting a new game...\n"); printf("Starting a new game...\n");
@ -328,6 +340,7 @@ void Game::endGame() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
quitGame(); quitGame();
sleep(0);
Object::setStateCallback(NULL); Object::setStateCallback(NULL);
thisGamePtr = NULL; thisGamePtr = NULL;
@ -1242,7 +1255,8 @@ void Game::init(bool initForPreviewOnly) {
//message box //message box
errorMessageBox.init(lang.getString("Ok")); errorMessageBox.init(lang.getString("Ok"));
errorMessageBox.setEnabled(false); errorMessageBox.setEnabled(false);
errorMessageBox.setY(mainMessageBox.getY() - mainMessageBox.getH() - 10); errorMessageBox.setY(20);
//init world, and place camera //init world, and place camera
commander.init(&world); commander.init(&world);
@ -2169,7 +2183,7 @@ void Game::update() {
} }
if(currentCameraFollowUnit != NULL) { if(currentCameraFollowUnit != NULL) {
Vec3f c=currentCameraFollowUnit->getCurrVector(); Vec3f c=currentCameraFollowUnit->getCurrMidHeightVector();
int rotation=currentCameraFollowUnit->getRotation(); int rotation=currentCameraFollowUnit->getRotation();
float angle=rotation+180; float angle=rotation+180;
@ -4109,8 +4123,7 @@ void Game::mouseDownLeft(int x, int y) {
if(setMarker) { if(setMarker) {
Vec2i targetPos; Vec2i targetPos;
Vec2i screenPos(x,y-60); Vec2i screenPos(x,y-60);
Renderer &renderer= Renderer::getInstance(); targetPos=getMouseCellPos();
renderer.computePosition(screenPos, targetPos);
//Vec2i surfaceCellPos = map->toSurfCoords(targetPos); //Vec2i surfaceCellPos = map->toSurfCoords(targetPos);
@ -4124,8 +4137,7 @@ void Game::mouseDownLeft(int x, int y) {
if(originalIsMarkCellEnabled == true && isMarkCellEnabled == true) { if(originalIsMarkCellEnabled == true && isMarkCellEnabled == true) {
Vec2i targetPos; Vec2i targetPos;
Vec2i screenPos(x,y-60); Vec2i screenPos(x,y-60);
Renderer &renderer= Renderer::getInstance(); targetPos=getMouseCellPos();
renderer.computePosition(screenPos, targetPos);
Vec2i surfaceCellPos = map->toSurfCoords(targetPos); Vec2i surfaceCellPos = map->toSurfCoords(targetPos);
MarkedCell mc(targetPos,world.getThisFaction(),"placeholder for note",world.getThisFaction()->getStartLocationIndex()); MarkedCell mc(targetPos,world.getThisFaction(),"placeholder for note",world.getThisFaction()->getStartLocationIndex());
@ -4139,14 +4151,13 @@ void Game::mouseDownLeft(int x, int y) {
chatManager.switchOnEdit(this,500); chatManager.switchOnEdit(this,500);
//renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); //renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos);
renderer.forceQuadCacheUpdate(); Renderer::getInstance().forceQuadCacheUpdate();
} }
if(originalIsUnMarkCellEnabled == true && isUnMarkCellEnabled == true) { if(originalIsUnMarkCellEnabled == true && isUnMarkCellEnabled == true) {
Vec2i targetPos; Vec2i targetPos;
Vec2i screenPos(x,y-35); Vec2i screenPos(x,y-35);
Renderer &renderer= Renderer::getInstance(); targetPos=getMouseCellPos();
renderer.computePosition(screenPos, targetPos);
Vec2i surfaceCellPos = map->toSurfCoords(targetPos); Vec2i surfaceCellPos = map->toSurfCoords(targetPos);
// if(mapMarkedCellList.find(surfaceCellPos) != mapMarkedCellList.end()) { // if(mapMarkedCellList.find(surfaceCellPos) != mapMarkedCellList.end()) {
@ -4164,7 +4175,7 @@ void Game::mouseDownLeft(int x, int y) {
//Renderer &renderer= Renderer::getInstance(); //Renderer &renderer= Renderer::getInstance();
//renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos); //renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos);
renderer.forceQuadCacheUpdate(); Renderer::getInstance().forceQuadCacheUpdate();
} }
} }
} }
@ -4246,9 +4257,8 @@ void Game::mouseDownRight(int x, int y) {
else { else {
Vec2i targetPos; Vec2i targetPos;
Vec2i screenPos(x,y); Vec2i screenPos(x,y);
Renderer &renderer= Renderer::getInstance(); targetPos=getMouseCellPos();
renderer.computePosition(screenPos, targetPos); if(isValidMouseCellPos() == true &&
if(renderer.computePosition(screenPos, targetPos) == true &&
map->isInsideSurface(map->toSurfCoords(targetPos)) == true) { map->isInsideSurface(map->toSurfCoords(targetPos)) == true) {
gui.mouseDownRightGraphics(x, y,false); gui.mouseDownRightGraphics(x, y,false);
} }
@ -4508,7 +4518,7 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
lastMousePos.y = mouseY; lastMousePos.y = mouseY;
Renderer &renderer= Renderer::getInstance(); Renderer &renderer= Renderer::getInstance();
renderer.computePosition(Vec2i(mouseX, mouseY), mouseCellPos); renderer.ccomputePosition(Vec2i(mouseX, mouseY), mouseCellPos);
} }
catch(const exception &ex) { catch(const exception &ex) {
char szBuf[8096]=""; char szBuf[8096]="";
@ -4528,6 +4538,15 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
} }
} }
bool Game::isValidMouseCellPos() const{
if(world.getMap() == NULL){
return false;
}
else {
return world.getMap()->isInside(mouseCellPos);
}
}
void Game::eventMouseWheel(int x, int y, int zDelta) { void Game::eventMouseWheel(int x, int y, int zDelta) {
if(this->masterserverMode == true) { if(this->masterserverMode == true) {
return; return;
@ -4566,7 +4585,7 @@ void Game::startCameraFollowUnit() {
if(currentUnit != NULL) { if(currentUnit != NULL) {
currentCameraFollowUnit = currentUnit; currentCameraFollowUnit = currentUnit;
getGameCameraPtr()->setState(GameCamera::sUnit); getGameCameraPtr()->setState(GameCamera::sUnit);
getGameCameraPtr()->setPos(currentCameraFollowUnit->getCurrVector()); getGameCameraPtr()->setPos(currentCameraFollowUnit->getCurrMidHeightVector());
int rotation=currentCameraFollowUnit->getRotation(); int rotation=currentCameraFollowUnit->getRotation();
getGameCameraPtr()->stop(); getGameCameraPtr()->stop();
@ -4655,6 +4674,39 @@ void Game::keyDown(SDL_KeyboardEvent key) {
} }
} }
//Toggle Healthbars
else if(isKeyPressed(configKeys.getSDLKey("ToggleHealthbars"),key, false) == true) {
switch (healthbarMode) {
case hbvUndefined:
healthbarMode=hbvOff;
console.addLine(lang.getString("Healthbar")+": "+lang.getString("HealthbarsOff"));
break;
case hbvOff:
healthbarMode=hbvAlways;
console.addLine(lang.getString("Healthbar")+": "+lang.getString("HealthbarsAlways"));
break;
case hbvAlways:
healthbarMode=hbvIfNeeded;
console.addLine(lang.getString("Healthbar")+": "+lang.getString("HealthbarsIfNeeded"));
break;
case hbvIfNeeded:
healthbarMode=hbvSelected;
console.addLine(lang.getString("Healthbar")+": "+lang.getString("HealthbarsSelected"));
break;
case hbvSelected:
healthbarMode=hbvSelected | hbvIfNeeded;
console.addLine(lang.getString("Healthbar")+": "+lang.getString("HealthbarsSelectedOrNeeded"));
break;
case (hbvSelected | hbvIfNeeded):
healthbarMode=hbvUndefined;
console.addLine(lang.getString("Healthbar")+": "+lang.getString("HealthbarsFactionDefault"));
break;
default:
printf("In [%s::%s Line: %d] Toggle Healthbars Hotkey - Invalid Value. Setting to default.\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
healthbarMode=hbvUndefined;
break;
}
}
//Toggle music //Toggle music
//else if(key == configKeys.getCharKey("ToggleMusic")) { //else if(key == configKeys.getCharKey("ToggleMusic")) {
else if(isKeyPressed(configKeys.getSDLKey("ToggleMusic"),key, false) == true) { else if(isKeyPressed(configKeys.getSDLKey("ToggleMusic"),key, false) == true) {
@ -5205,7 +5257,7 @@ void Game::render3d(){
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start(); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
//selection circles //selection circles
renderer.renderSelectionEffects(); renderer.renderSelectionEffects(healthbarMode);
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] renderFps = %d took msecs: %lld [renderSelectionEffects]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,renderFps,chrono.getMillis()); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] renderFps = %d took msecs: %lld [renderSelectionEffects]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,renderFps,chrono.getMillis());
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start(); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
@ -5256,6 +5308,11 @@ void Game::render3d(){
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] renderFps = %d took msecs: %lld [renderParticleManager]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,renderFps,chrono.getMillis()); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] renderFps = %d took msecs: %lld [renderParticleManager]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,renderFps,chrono.getMillis());
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start(); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
//renderOnTopBars (aka Healthbars)
if(photoModeEnabled == false) {
renderer.renderHealthBars(healthbarMode);
}
//mouse 3d //mouse 3d
renderer.renderMouse3d(); renderer.renderMouse3d();
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] renderFps = %d took msecs: %lld [renderMouse3d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,renderFps,chrono.getMillis()); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] renderFps = %d took msecs: %lld [renderMouse3d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,renderFps,chrono.getMillis());
@ -5391,29 +5448,31 @@ string Game::getDebugStats(std::map<int,string> &factionDebugInfo) {
for(int i = 0; i < world.getFactionCount(); ++i) { for(int i = 0; i < world.getFactionCount(); ++i) {
string factionInfo = this->gameSettings.getNetworkPlayerName(i); string factionInfo = this->gameSettings.getNetworkPlayerName(i);
//factionInfo += " [" + this->gameSettings.getNetworkPlayerUUID(i) + "]"; //factionInfo += " [" + this->gameSettings.getNetworkPlayerUUID(i) + "]";
float multi=world.getStats()->getResourceMultiplier(i);
string multiplier="["+floatToStr(multi,1)+"]";
switch(this->gameSettings.getFactionControl(i)) { switch(this->gameSettings.getFactionControl(i)) {
case ctCpuEasy: case ctCpuEasy:
factionInfo += " CPU Easy"; factionInfo += " CPU Easy"+multiplier;
break; break;
case ctCpu: case ctCpu:
factionInfo += " CPU Normal"; factionInfo += " CPU Normal"+multiplier;
break; break;
case ctCpuUltra: case ctCpuUltra:
factionInfo += " CPU Ultra"; factionInfo += " CPU Ultra"+multiplier;
break; break;
case ctCpuMega: case ctCpuMega:
factionInfo += " CPU Mega"; factionInfo += " CPU Mega"+multiplier;
break; break;
} }
factionInfo += " [" + formatString(this->gameSettings.getFactionTypeName(i)) + factionInfo += " [" + formatString(this->gameSettings.getFactionTypeName(i)) +
" team: " + intToStr(this->gameSettings.getTeam(i)) + "]"; " team: " + intToStr(this->gameSettings.getTeam(i)) + "]";
// bool showResourceDebugInfo = false; // bool showResourceDebugInfo = true;
// if(showResourceDebugInfo == true) { // if(showResourceDebugInfo == true) {
// factionInfo +=" res: "; // factionInfo +=" res: ";
// for(int j = 0; j < world.getTechTree()->getResourceTypeCount(); ++j) { // for(int j = 0; j < world.getTechTree()->getResourceTypeCount(); ++j) {
// factionInfo += intToStr(world.getFaction(i)->getResource(j)->getAmount()); // factionInfo += world.getFaction(i)->getResource(j)->getType()->getName()+":"+intToStr(world.getFaction(i)->getResource(j)->getAmount());
// factionInfo += " "; // factionInfo += " ";
// } // }
// } // }
@ -5627,7 +5686,7 @@ void Game::render2d() {
if(this->masterserverMode == false) { if(this->masterserverMode == false) {
renderer.renderResourceStatus(); renderer.renderResourceStatus();
} }
renderer.renderConsole(&console,showFullConsole); renderer.renderConsole(&console,showFullConsole?consoleFull:consoleNormal);
} }
//2d mouse //2d mouse
@ -6709,7 +6768,10 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
string gameVer = versionNode->getAttribute("version")->getValue(); string gameVer = versionNode->getAttribute("version")->getValue();
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) { // this is the version check for loading normal save games from menu_state_load_game
if (gameVer != glestVersionString
&& (compareMajorMinorVersion(gameVer, lastCompatibleSaveGameVersionString) < 0
|| compareMajorMinorVersion(glestVersionString, gameVer) < 0)) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str()); snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
throw megaglest_runtime_error(szBuf,true); throw megaglest_runtime_error(szBuf,true);
@ -6727,6 +6789,12 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
XmlNode *selectionNode = guiNode->getChild("Selection"); XmlNode *selectionNode = guiNode->getChild("Selection");
XmlNode *statsNode = worldNode->getChild("Stats"); XmlNode *statsNode = worldNode->getChild("Stats");
XmlNode *minimapNode = worldNode->getChild("Minimap"); XmlNode *minimapNode = worldNode->getChild("Minimap");
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false){
char szBuf[8096]="";
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
throw megaglest_runtime_error(szBuf,true);
}
// This is explored fog of war for the host player, clear it // This is explored fog of war for the host player, clear it
minimapNode->clearChild("fowPixmap1"); minimapNode->clearChild("fowPixmap1");
@ -6799,7 +6867,13 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
newGame->tickCount = gameNode->getAttribute("tickCount")->getIntValue(); newGame->tickCount = gameNode->getAttribute("tickCount")->getIntValue();
//bool paused; //bool paused;
if(newGame->inJoinGameLoading==true){
newGame->paused = gameNode->getAttribute("paused")->getIntValue() != 0; newGame->paused = gameNode->getAttribute("paused")->getIntValue() != 0;
}else{
//newGame->paused = gameNode->getAttribute("paused")->getIntValue() != 0;
newGame->paused = true;
}
if(newGame->paused) newGame->console.addLine(lang.getString("GamePaused"));
//bool gameOver; //bool gameOver;
newGame->gameOver = gameNode->getAttribute("gameOver")->getIntValue() != 0; newGame->gameOver = gameNode->getAttribute("gameOver")->getIntValue() != 0;
//bool renderNetworkStatus; //bool renderNetworkStatus;

View File

@ -141,6 +141,7 @@ private:
static const int renderTeamColorPlaneBit=2; static const int renderTeamColorPlaneBit=2;
bool photoModeEnabled; bool photoModeEnabled;
int healthbarMode;
bool visibleHUD; bool visibleHUD;
bool timeDisplay; bool timeDisplay;
bool withRainEffect; bool withRainEffect;
@ -256,6 +257,9 @@ public:
Program *getProgram() {return program;} Program *getProgram() {return program;}
Vec2i getMouseCellPos() const {return mouseCellPos;}
bool isValidMouseCellPos() const;
void removeUnitFromSelection(const Unit *unit); void removeUnitFromSelection(const Unit *unit);
bool addUnitToSelection(Unit *unit); bool addUnitToSelection(Unit *unit);
void addUnitToGroupSelection(Unit *unit,int groupIndex); void addUnitToGroupSelection(Unit *unit,int groupIndex);

View File

@ -144,6 +144,7 @@ public:
static const char *folder_path_tutorials; static const char *folder_path_tutorials;
static const char *NETWORK_SLOT_UNCONNECTED_SLOTNAME; static const char *NETWORK_SLOT_UNCONNECTED_SLOTNAME;
static const char *NETWORK_SLOT_CLOSED_SLOTNAME;
static const char *folder_path_screenshots; static const char *folder_path_screenshots;

View File

@ -85,6 +85,7 @@ enum NetworkPlayerStatusType {
class GameSettings { class GameSettings {
private: private:
string gameName;
string description; string description;
string map; string map;
string tileset; string tileset;
@ -189,6 +190,7 @@ public:
// default copy constructor will do fine, and will maintain itself ;) // default copy constructor will do fine, and will maintain itself ;)
//get //get
const string &getGameName() const {return gameName;}
const string &getDescription() const {return description;} const string &getDescription() const {return description;}
const string &getMap() const {return map;} const string &getMap() const {return map;}
const string &getTileset() const {return tileset;} const string &getTileset() const {return tileset;}
@ -394,6 +396,7 @@ public:
const string &getGameUUID() const {return gameUUID;} const string &getGameUUID() const {return gameUUID;}
//set //set
void setGameName(const string& gameName) {this->gameName= gameName;}
void setDescription(const string& description) {this->description= description;} void setDescription(const string& description) {this->description= description;}
void setMap(const string& map) {this->map= map;} void setMap(const string& map) {this->map= map;}
void setTileset(const string& tileset) {this->tileset= tileset;} void setTileset(const string& tileset) {this->tileset= tileset;}
@ -556,6 +559,7 @@ public:
string result = ""; string result = "";
result += "Game ID = " + gameUUID + "\n"; result += "Game ID = " + gameUUID + "\n";
result += "gameName = " + gameName + "\n";
result += "description = " + description + "\n"; result += "description = " + description + "\n";
result += "mapFilterIndex = " + intToStr(mapFilterIndex) + "\n"; result += "mapFilterIndex = " + intToStr(mapFilterIndex) + "\n";
result += "map = " + map + "\n"; result += "map = " + map + "\n";
@ -613,6 +617,8 @@ public:
gameSettingsNode->addAttribute("gameUUID",gameUUID, mapTagReplacements); gameSettingsNode->addAttribute("gameUUID",gameUUID, mapTagReplacements);
// string gameName;
gameSettingsNode->addAttribute("gameName",gameName, mapTagReplacements);
// string description; // string description;
gameSettingsNode->addAttribute("description",description, mapTagReplacements); gameSettingsNode->addAttribute("description",description, mapTagReplacements);
// string map; // string map;
@ -750,6 +756,13 @@ public:
gameUUID = gameSettingsNode->getAttribute("gameUUID")->getValue(); gameUUID = gameSettingsNode->getAttribute("gameUUID")->getValue();
} }
// string gameName;
if(gameSettingsNode->hasAttribute("gameName") == true) {
gameName = gameSettingsNode->getAttribute("gameName")->getValue();
}
else {
gameName = "oldSavegame";
}
// string description; // string description;
description = gameSettingsNode->getAttribute("description")->getValue(); description = gameSettingsNode->getAttribute("description")->getValue();
// string map; // string map;

View File

@ -252,6 +252,7 @@ void ScriptManager::init(World* world, GameCamera *gameCamera, const XmlNode *ro
luaScript.registerFunction(shakeCameraOnUnit, "shakeCameraOnUnit"); luaScript.registerFunction(shakeCameraOnUnit, "shakeCameraOnUnit");
luaScript.registerFunction(createUnit, "createUnit"); luaScript.registerFunction(createUnit, "createUnit");
luaScript.registerFunction(createUnitNoSpacing, "createUnitNoSpacing"); luaScript.registerFunction(createUnitNoSpacing, "createUnitNoSpacing");
luaScript.registerFunction(setLockedUnitForFaction, "setLockedUnitForFaction");
luaScript.registerFunction(destroyUnit, "destroyUnit"); luaScript.registerFunction(destroyUnit, "destroyUnit");
luaScript.registerFunction(giveKills, "giveKills"); luaScript.registerFunction(giveKills, "giveKills");
luaScript.registerFunction(morphToUnit, "morphToUnit"); luaScript.registerFunction(morphToUnit, "morphToUnit");
@ -1032,8 +1033,11 @@ void ScriptManager::shakeCamera(int shakeIntensity, int shakeDuration, bool came
if (cameraDistanceAffected) { if (cameraDistanceAffected) {
Unit *unit = world->findUnitById(unitId); Unit *unit = world->findUnitById(unitId);
gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, unit->getCurrVector()); if(unit) {
} else { gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, unit->getCurrMidHeightVector());
}
}
else {
gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, Vec3f(0.f,0.f,0.f)); gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, Vec3f(0.f,0.f,0.f));
} }
} }
@ -1048,6 +1052,16 @@ void ScriptManager::createUnitNoSpacing(const string &unitName, int factionIndex
world->createUnit(unitName, factionIndex, pos, false); world->createUnit(unitName, factionIndex, pos, false);
} }
void ScriptManager::setLockedUnitForFaction(const string &unitName, int factionIndex , bool lock){
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] unit [%s] factionIndex = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,unitName.c_str(),factionIndex);
if(world->getFactionCount()>factionIndex) {
const UnitType *ut= world->getFaction(factionIndex)->getType()->getUnitType(unitName);
world->getFaction(factionIndex)->setLockedUnitForFaction(ut,lock);
} else {
throw megaglest_runtime_error("Invalid faction index in setLockedUnitForFaction: " + intToStr(factionIndex),true);
}
}
void ScriptManager::destroyUnit(int unitId){ void ScriptManager::destroyUnit(int unitId){
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] unit [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,unitId); if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] unit [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,unitId);
Unit *unit = world->findUnitById(unitId); Unit *unit = world->findUnitById(unitId);
@ -1531,6 +1545,17 @@ int ScriptManager::getUnitFaction(int unitId) {
const string ScriptManager::getUnitName(int unitId) { const string ScriptManager::getUnitName(int unitId) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
string result = "";
Unit *unit = world->findUnitById(unitId);
if(unit) {
result = world->findUnitById(unitId)->getType()->getName(false);
}
return result;
}
const string ScriptManager::getUnitDisplayName(int unitId) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
return world->getUnitName(unitId); return world->getUnitName(unitId);
} }
@ -1709,7 +1734,7 @@ int ScriptManager::isFreeCellsOrHasUnit(int field, int unitId, Vec2i pos) {
if(unit == NULL) { if(unit == NULL) {
throw megaglest_runtime_error("unit == NULL",true); throw megaglest_runtime_error("unit == NULL",true);
} }
int result = world->getMap()->isFreeCellsOrHasUnit(pos,unit->getType()->getSize(),static_cast<Field>(field),unit,NULL,true); int result = world->getMap()->isFreeCellsOrHasUnit(pos,unit->getType()->getSize(),static_cast<Field>(field),unit);
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s] unitId = %d, [%s] pos [%s] field = %d result = %d\n",__FUNCTION__,unitId,unit->getType()->getName(false).c_str(),pos.getString().c_str(),field,result); if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s] unitId = %d, [%s] pos [%s] field = %d result = %d\n",__FUNCTION__,unitId,unit->getType()->getName(false).c_str(),pos.getString().c_str(),field,result);
@ -1719,7 +1744,7 @@ int ScriptManager::isFreeCellsOrHasUnit(int field, int unitId, Vec2i pos) {
int ScriptManager::isFreeCells(int unitSize, int field, Vec2i pos) { int ScriptManager::isFreeCells(int unitSize, int field, Vec2i pos) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
int result = world->getMap()->isFreeCellsOrHasUnit(pos,unitSize,static_cast<Field>(field),NULL,NULL,true); int result = world->getMap()->isFreeCellsOrHasUnit(pos,unitSize,static_cast<Field>(field),NULL);
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s] unitSize = %d, pos [%s] field = %d result = %d\n",__FUNCTION__,unitSize,pos.getString().c_str(),field,result); if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s] unitSize = %d, pos [%s] field = %d result = %d\n",__FUNCTION__,unitSize,pos.getString().c_str(),field,result);
@ -2314,6 +2339,33 @@ int ScriptManager::destroyUnit(LuaHandle* luaHandle) {
return luaArguments.getReturnCount(); return luaArguments.getReturnCount();
} }
int ScriptManager::setLockedUnitForFaction(LuaHandle* luaHandle) {
LuaArguments luaArguments(luaHandle);
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] unit [%s] factionIndex = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,luaArguments.getString(-3).c_str(),luaArguments.getInt(-2));
try {
thisScriptManager->setLockedUnitForFaction(
luaArguments.getString(-3),
luaArguments.getInt(-2),
(luaArguments.getInt(-1) == 0 ? false : true));
}
catch(const megaglest_runtime_error &ex) {
char szErrBuf[8096]="";
snprintf(szErrBuf,8096,"In [%s::%s %d]",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
string sErrBuf = string(szErrBuf) + string("\nThe game may no longer be stable!\nerror [") + string(ex.what()) + string("]\n");
SystemFlags::OutputDebug(SystemFlags::debugError,sErrBuf.c_str());
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,sErrBuf.c_str());
thisScriptManager->addMessageToQueue(ScriptManagerMessage(sErrBuf.c_str(), "error",-1,-1,true));
thisScriptManager->onMessageBoxOk(false);
}
return luaArguments.getReturnCount();
}
int ScriptManager::giveKills(LuaHandle* luaHandle) { int ScriptManager::giveKills(LuaHandle* luaHandle) {
LuaArguments luaArguments(luaHandle); LuaArguments luaArguments(luaHandle);
@ -3414,6 +3466,7 @@ int ScriptManager::getUnitFaction(LuaHandle* luaHandle){
return luaArguments.getReturnCount(); return luaArguments.getReturnCount();
} }
int ScriptManager::getUnitName(LuaHandle* luaHandle){ int ScriptManager::getUnitName(LuaHandle* luaHandle){
LuaArguments luaArguments(luaHandle); LuaArguments luaArguments(luaHandle);
try { try {
@ -3435,6 +3488,28 @@ int ScriptManager::getUnitName(LuaHandle* luaHandle){
return luaArguments.getReturnCount(); return luaArguments.getReturnCount();
} }
int ScriptManager::getUnitDisplayName(LuaHandle* luaHandle){
LuaArguments luaArguments(luaHandle);
try {
const string unitname = thisScriptManager->getUnitDisplayName(luaArguments.getInt(-1));
luaArguments.returnString(unitname);
}
catch(const megaglest_runtime_error &ex) {
char szErrBuf[8096]="";
snprintf(szErrBuf,8096,"In [%s::%s %d]",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
string sErrBuf = string(szErrBuf) + string("\nThe game may no longer be stable!\nerror [") + string(ex.what()) + string("]\n");
SystemFlags::OutputDebug(SystemFlags::debugError,sErrBuf.c_str());
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,sErrBuf.c_str());
thisScriptManager->addMessageToQueue(ScriptManagerMessage(sErrBuf.c_str(), "error",-1,-1,true));
thisScriptManager->onMessageBoxOk(false);
}
return luaArguments.getReturnCount();
}
int ScriptManager::getResourceAmount(LuaHandle* luaHandle){ int ScriptManager::getResourceAmount(LuaHandle* luaHandle){
LuaArguments luaArguments(luaHandle); LuaArguments luaArguments(luaHandle);
try { try {

View File

@ -282,6 +282,7 @@ private:
void createUnit(const string &unitName, int factionIndex, Vec2i pos); void createUnit(const string &unitName, int factionIndex, Vec2i pos);
void createUnitNoSpacing(const string &unitName, int factionIndex, Vec2i pos); void createUnitNoSpacing(const string &unitName, int factionIndex, Vec2i pos);
void setLockedUnitForFaction(const string &unitName, int factionIndex , bool lock);
void destroyUnit(int unitId); void destroyUnit(int unitId);
void giveKills(int unitId, int amount); void giveKills(int unitId, int amount);
void morphToUnit(int unitId,const string &morphName, int ignoreRequirements); void morphToUnit(int unitId,const string &morphName, int ignoreRequirements);
@ -356,6 +357,7 @@ private:
Vec2i getUnitPosition(int unitId); Vec2i getUnitPosition(int unitId);
int getUnitFaction(int unitId); int getUnitFaction(int unitId);
const string getUnitName(int unitId); const string getUnitName(int unitId);
const string getUnitDisplayName(int unitId);
int getResourceAmount(const string &resourceName, int factionIndex); int getResourceAmount(const string &resourceName, int factionIndex);
const string &getLastCreatedUnitName(); const string &getLastCreatedUnitName();
int getLastCreatedUnitId(); int getLastCreatedUnitId();
@ -447,6 +449,7 @@ private:
static int createUnit(LuaHandle* luaHandle); static int createUnit(LuaHandle* luaHandle);
static int createUnitNoSpacing(LuaHandle* luaHandle); static int createUnitNoSpacing(LuaHandle* luaHandle);
static int setLockedUnitForFaction(LuaHandle* luaHandle);
static int destroyUnit(LuaHandle* luaHandle); static int destroyUnit(LuaHandle* luaHandle);
static int giveKills(LuaHandle* luaHandle); static int giveKills(LuaHandle* luaHandle);
static int morphToUnit(LuaHandle* luaHandle); static int morphToUnit(LuaHandle* luaHandle);
@ -521,6 +524,7 @@ private:
static int getUnitPosition(LuaHandle* luaHandle); static int getUnitPosition(LuaHandle* luaHandle);
static int getUnitFaction(LuaHandle* luaHandle); static int getUnitFaction(LuaHandle* luaHandle);
static int getUnitName(LuaHandle* luaHandle); static int getUnitName(LuaHandle* luaHandle);
static int getUnitDisplayName(LuaHandle* luaHandle);
static int getResourceAmount(LuaHandle* luaHandle); static int getResourceAmount(LuaHandle* luaHandle);
static int getLastCreatedUnitName(LuaHandle* luaHandle); static int getLastCreatedUnitName(LuaHandle* luaHandle);
static int getLastCreatedUnitId(LuaHandle* luaHandle); static int getLastCreatedUnitId(LuaHandle* luaHandle);

View File

@ -44,6 +44,7 @@ const char *GameConstants::folder_path_tilesets = "tilesets";
const char *GameConstants::folder_path_tutorials = "tutorials"; const char *GameConstants::folder_path_tutorials = "tutorials";
const char *GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME = "???"; const char *GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME = "???";
const char *GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME = "Closed";
const char *GameConstants::folder_path_screenshots = "screens/"; const char *GameConstants::folder_path_screenshots = "screens/";

View File

@ -78,6 +78,9 @@ CoreData::CoreData() {
statusNotReadyTexture=NULL; statusNotReadyTexture=NULL;
statusBRBTexture=NULL; statusBRBTexture=NULL;
healthbarTexture=NULL;
healthbarBackgroundTexture=NULL;
miscTextureList.clear(); miscTextureList.clear();
displayFont=NULL; displayFont=NULL;
@ -114,30 +117,30 @@ void CoreData::cleanup() {
waterSounds.getSoundsPtr()->clear(); waterSounds.getSoundsPtr()->clear();
} }
Texture2D *CoreData::getTextureBySystemId(TextureSystemType type) const { Texture2D *CoreData::getTextureBySystemId(TextureSystemType type) {
Texture2D *result = NULL; Texture2D *result = NULL;
switch(type) { switch(type) {
case tsyst_logoTexture: case tsyst_logoTexture:
result = logoTexture; result = getLogoTexture();
break; break;
//std::vector<Texture2D *> logoTextureList; //std::vector<Texture2D *> logoTextureList;
case tsyst_backgroundTexture: case tsyst_backgroundTexture:
result = backgroundTexture; result = getBackgroundTexture();
break; break;
case tsyst_fireTexture: case tsyst_fireTexture:
result = fireTexture; result = getFireTexture();
break; break;
case tsyst_teamColorTexture: case tsyst_teamColorTexture:
result = teamColorTexture; result = getTeamColorTexture();
break; break;
case tsyst_snowTexture: case tsyst_snowTexture:
result = snowTexture; result = getSnowTexture();
break; break;
case tsyst_waterSplashTexture: case tsyst_waterSplashTexture:
result = waterSplashTexture; result = getWaterSplashTexture();
break; break;
case tsyst_customTexture: case tsyst_customTexture:
result = customTexture; result = getCustomTexture();
break; break;
case tsyst_buttonSmallTexture: case tsyst_buttonSmallTexture:
result = buttonSmallTexture; result = buttonSmallTexture;
@ -181,6 +184,12 @@ Texture2D *CoreData::getTextureBySystemId(TextureSystemType type) const {
case tsyst_statusBRBTexture: case tsyst_statusBRBTexture:
result = statusBRBTexture; result = statusBRBTexture;
break; break;
case tsyst_healthbarTexture:
result = healthbarTexture;
break;
case tsyst_healthbarBackgroundTexture:
result = healthbarBackgroundTexture;
break;
//std::vector<Texture2D *> miscTextureList; //std::vector<Texture2D *> miscTextureList;
} }
@ -417,6 +426,24 @@ Texture2D *CoreData::getGameWinnerTexture() {
return gameWinnerTexture; return gameWinnerTexture;
} }
Texture2D *CoreData::getHealthbarTexture() {
string data_path = getDataPath();
loadTextureIfRequired(&healthbarTexture,data_path,
CORE_MISC_TEXTURES_PATH + "healthbar.png", tsyst_healthbarTexture,
true, false, false, true);
return healthbarTexture;
}
Texture2D *CoreData::getHealthbarBackgroundTexture() {
string data_path = getDataPath();
loadTextureIfRequired(&healthbarBackgroundTexture,data_path,
CORE_MISC_TEXTURES_PATH + "healthbarBackground.png", tsyst_healthbarBackgroundTexture,
true, false, false, true);
return healthbarBackgroundTexture;
}
void CoreData::loadLogoTextureExtraIfRequired() { void CoreData::loadLogoTextureExtraIfRequired() {
int loadAttemptLookupKey = tsyst_COUNT + 1; int loadAttemptLookupKey = tsyst_COUNT + 1;
if(itemLoadAttempted.find(loadAttemptLookupKey) == itemLoadAttempted.end()) { if(itemLoadAttempted.find(loadAttemptLookupKey) == itemLoadAttempted.end()) {

View File

@ -78,6 +78,9 @@ private:
Texture2D *statusNotReadyTexture; Texture2D *statusNotReadyTexture;
Texture2D *statusBRBTexture; Texture2D *statusBRBTexture;
Texture2D *healthbarTexture;
Texture2D *healthbarBackgroundTexture;
std::vector<Texture2D *> miscTextureList; std::vector<Texture2D *> miscTextureList;
Font2D *displayFont; Font2D *displayFont;
@ -133,6 +136,8 @@ public:
tsyst_statusReadyTexture, tsyst_statusReadyTexture,
tsyst_statusNotReadyTexture, tsyst_statusNotReadyTexture,
tsyst_statusBRBTexture, tsyst_statusBRBTexture,
tsyst_healthbarTexture,
tsyst_healthbarBackgroundTexture,
tsyst_COUNT tsyst_COUNT
}; };
@ -147,7 +152,7 @@ public:
void loadFonts(); void loadFonts();
// Textures // Textures
Texture2D *getTextureBySystemId(TextureSystemType type) const; Texture2D *getTextureBySystemId(TextureSystemType type);
Texture2D *getBackgroundTexture(); Texture2D *getBackgroundTexture();
Texture2D *getFireTexture(); Texture2D *getFireTexture();
@ -171,6 +176,9 @@ public:
Texture2D *getStatusBRBTexture(); Texture2D *getStatusBRBTexture();
Texture2D *getGameWinnerTexture(); Texture2D *getGameWinnerTexture();
Texture2D *getHealthbarTexture();
Texture2D *getHealthbarBackgroundTexture();
size_t getLogoTextureExtraCount(); size_t getLogoTextureExtraCount();
Texture2D *getLogoTextureExtra(int idx); Texture2D *getLogoTextureExtra(int idx);

View File

@ -57,6 +57,8 @@ ParticleSystemType::ParticleSystemType() {
size=0; size=0;
sizeNoEnergy=0; sizeNoEnergy=0;
speed=0; speed=0;
speedUpRelative=0;
speedUpConstant=0;
gravity=0; gravity=0;
emissionRate=0; emissionRate=0;
energyMax=0; energyMax=0;
@ -107,6 +109,8 @@ void ParticleSystemType::copyAll(const ParticleSystemType &src) {
this->size = src.size; this->size = src.size;
this->sizeNoEnergy = src.sizeNoEnergy; this->sizeNoEnergy = src.sizeNoEnergy;
this->speed = src.speed; this->speed = src.speed;
this->speedUpRelative = src.speedUpRelative;
this->speedUpConstant = src.speedUpConstant;
this->gravity = src.gravity; this->gravity = src.gravity;
this->emissionRate = src.emissionRate; this->emissionRate = src.emissionRate;
this->energyMax = src.energyMax; this->energyMax = src.energyMax;
@ -220,6 +224,17 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
const XmlNode *speedNode= particleSystemNode->getChild("speed"); const XmlNode *speedNode= particleSystemNode->getChild("speed");
speed= speedNode->getAttribute("value")->getFloatValue()/GameConstants::updateFps; speed= speedNode->getAttribute("value")->getFloatValue()/GameConstants::updateFps;
//speedUp
if(particleSystemNode->hasChild("speedUp")){
const XmlNode *speedUpNode= particleSystemNode->getChild("speedUp");
if(speedUpNode->hasAttribute("relative")){
speedUpRelative= speedUpNode->getAttribute("relative")->getFloatValue();
}
if(speedUpNode->hasAttribute("constant")){
speedUpConstant= speedUpNode->getAttribute("constant")->getFloatValue();
}
}
//gravity //gravity
const XmlNode *gravityNode= particleSystemNode->getChild("gravity"); const XmlNode *gravityNode= particleSystemNode->getChild("gravity");
gravity= gravityNode->getAttribute("value")->getFloatValue()/GameConstants::updateFps; gravity= gravityNode->getAttribute("value")->getFloatValue()/GameConstants::updateFps;
@ -290,6 +305,7 @@ void ParticleSystemType::setValues(AttackParticleSystem *ats){
for(Children::iterator i=children.begin(); i!=children.end(); ++i){ for(Children::iterator i=children.begin(); i!=children.end(); ++i){
UnitParticleSystem *child = new UnitParticleSystem(); UnitParticleSystem *child = new UnitParticleSystem();
child->setParticleOwner(ats->getParticleOwner()); child->setParticleOwner(ats->getParticleOwner());
child->setParticleType((*i));
(*i)->setValues(child); (*i)->setValues(child);
ats->addChild(child); ats->addChild(child);
child->setState(ParticleSystem::sPlay); child->setState(ParticleSystem::sPlay);
@ -300,6 +316,8 @@ void ParticleSystemType::setValues(AttackParticleSystem *ats){
ats->setColor(color); ats->setColor(color);
ats->setColorNoEnergy(colorNoEnergy); ats->setColorNoEnergy(colorNoEnergy);
ats->setSpeed(speed); ats->setSpeed(speed);
ats->setSpeedUpRelative(speedUpRelative);
ats->setSpeedUpConstant(speedUpConstant);
ats->setGravity(gravity); ats->setGravity(gravity);
ats->setParticleSize(size); ats->setParticleSize(size);
ats->setSizeNoEnergy(sizeNoEnergy); ats->setSizeNoEnergy(sizeNoEnergy);
@ -328,6 +346,12 @@ void ParticleSystemType::loadGame(const XmlNode *rootNode) {
size = particleSystemTypeNode->getAttribute("size")->getFloatValue(); size = particleSystemTypeNode->getAttribute("size")->getFloatValue();
sizeNoEnergy = particleSystemTypeNode->getAttribute("sizeNoEnergy")->getFloatValue(); sizeNoEnergy = particleSystemTypeNode->getAttribute("sizeNoEnergy")->getFloatValue();
speed = particleSystemTypeNode->getAttribute("speed")->getFloatValue(); speed = particleSystemTypeNode->getAttribute("speed")->getFloatValue();
if(particleSystemTypeNode->hasAttribute("speedUpRelative")){
speedUpRelative = particleSystemTypeNode->getAttribute("speedUpRelative")->getFloatValue();
}
if(particleSystemTypeNode->hasAttribute("speedUpConstant")){
speedUpConstant = particleSystemTypeNode->getAttribute("speedUpConstant")->getFloatValue();
}
gravity = particleSystemTypeNode->getAttribute("gravity")->getFloatValue(); gravity = particleSystemTypeNode->getAttribute("gravity")->getFloatValue();
emissionRate = particleSystemTypeNode->getAttribute("emissionRate")->getFloatValue(); emissionRate = particleSystemTypeNode->getAttribute("emissionRate")->getFloatValue();
energyMax = particleSystemTypeNode->getAttribute("energyMax")->getIntValue(); energyMax = particleSystemTypeNode->getAttribute("energyMax")->getIntValue();
@ -348,7 +372,6 @@ void ParticleSystemType::loadGame(const XmlNode *rootNode) {
children.push_back(child); children.push_back(child);
} }
} }
minmaxEnabled = (particleSystemTypeNode->getAttribute("minmaxEnabled")->getIntValue() != 0); minmaxEnabled = (particleSystemTypeNode->getAttribute("minmaxEnabled")->getIntValue() != 0);
minHp = particleSystemTypeNode->getAttribute("minHp")->getIntValue(); minHp = particleSystemTypeNode->getAttribute("minHp")->getIntValue();
maxHp = particleSystemTypeNode->getAttribute("maxHp")->getIntValue(); maxHp = particleSystemTypeNode->getAttribute("maxHp")->getIntValue();
@ -379,6 +402,10 @@ void ParticleSystemType::saveGame(XmlNode *rootNode) {
particleSystemTypeNode->addAttribute("sizeNoEnergy",floatToStr(sizeNoEnergy,6), mapTagReplacements); particleSystemTypeNode->addAttribute("sizeNoEnergy",floatToStr(sizeNoEnergy,6), mapTagReplacements);
// float speed; // float speed;
particleSystemTypeNode->addAttribute("speed",floatToStr(speed,6), mapTagReplacements); particleSystemTypeNode->addAttribute("speed",floatToStr(speed,6), mapTagReplacements);
// float speedUpRelative;
particleSystemTypeNode->addAttribute("speedUpRelative",floatToStr(speedUpRelative,6), mapTagReplacements);
// float speedUpConstant;
particleSystemTypeNode->addAttribute("speedUpConstant",floatToStr(speedUpConstant,6), mapTagReplacements);
// float gravity; // float gravity;
particleSystemTypeNode->addAttribute("gravity",floatToStr(gravity,6), mapTagReplacements); particleSystemTypeNode->addAttribute("gravity",floatToStr(gravity,6), mapTagReplacements);
// float emissionRate; // float emissionRate;

View File

@ -52,7 +52,7 @@ class UnitParticleSystemType;
/// A type of particle system /// A type of particle system
// =========================================================== // ===========================================================
class ParticleSystemType { class ParticleSystemType : public ParticleSystemTypeInterface {
protected: protected:
string type; string type;
Texture2D *texture; Texture2D *texture;
@ -65,6 +65,8 @@ protected:
float size; float size;
float sizeNoEnergy; float sizeNoEnergy;
float speed; float speed;
float speedUpRelative;
float speedUpConstant;
float gravity; float gravity;
float emissionRate; float emissionRate;
int energyMax; int energyMax;

View File

@ -582,10 +582,15 @@ void Renderer::manageDeferredParticleSystems() {
CoreData::TextureSystemType textureSystemId = CoreData::TextureSystemType textureSystemId =
static_cast<CoreData::TextureSystemType>( static_cast<CoreData::TextureSystemType>(
ps->getTextureFileLoadDeferredSystemId()); ps->getTextureFileLoadDeferredSystemId());
//printf("Load DEFERRED particle i = %d textureSystemId = %d\n",i,textureSystemId);
if(textureSystemId != CoreData::tsyst_NONE) { if(textureSystemId != CoreData::tsyst_NONE) {
Texture2D *texture= CoreData::getInstance().getTextureBySystemId(textureSystemId); Texture2D *texture= CoreData::getInstance().getTextureBySystemId(textureSystemId);
//printf("Loading texture from system [%d] [%p]\n",textureSystemId,texture); //printf("Loading texture from system [%d] [%p]\n",textureSystemId,texture);
ps->setTexture(texture); ps->setTexture(texture);
//printf("#2 Load DEFERRED particle i = %d textureSystemId = %d, texture = %p\n",i,textureSystemId,texture);
} }
else { else {
Texture2D *texture= newTexture2D(rs); Texture2D *texture= newTexture2D(rs);
@ -601,6 +606,7 @@ void Renderer::manageDeferredParticleSystems() {
texture->load(textureFile); texture->load(textureFile);
ps->setTexture(texture); ps->setTexture(texture);
} }
//printf("#3 Load DEFERRED particle i = %d textureSystemId = %d, texture = %p\n",i,textureSystemId,texture);
} }
} }
if(dynamic_cast<GameParticleSystem *>(ps) != NULL) { if(dynamic_cast<GameParticleSystem *>(ps) != NULL) {
@ -977,7 +983,7 @@ bool Renderer::validateParticleSystemStillExists(ParticleSystem * particleSystem
} }
void Renderer::removeParticleSystemsForParticleOwner(ParticleOwner * particleOwner,ResourceScope rs) { void Renderer::removeParticleSystemsForParticleOwner(ParticleOwner * particleOwner,ResourceScope rs) {
return particleManager[rs]->removeParticleSystemsForParticleOwner(particleOwner); particleManager[rs]->removeParticleSystemsForParticleOwner(particleOwner);
} }
void Renderer::cleanupParticleSystems(vector<ParticleSystem *> &particleSystems, ResourceScope rs) { void Renderer::cleanupParticleSystems(vector<ParticleSystem *> &particleSystems, ResourceScope rs) {
@ -1061,11 +1067,11 @@ void Renderer::setupLighting() {
Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex]; Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex];
if(world->toRenderUnit(unit) && if(world->toRenderUnit(unit) &&
unit->getCurrVector().dist(gameCamera->getPos()) < maxLightDist && unit->getCurrMidHeightVector().dist(gameCamera->getPos()) < maxLightDist &&
unit->getType()->getLight() && unit->isOperative()) { unit->getType()->getLight() && unit->isOperative()) {
//printf("$$$ Show light for faction: %s # %d / %d for Unit [%d - %s]\n",world->getFaction(i)->getType()->getName().c_str(),lightCount,maxLights,unit->getId(),unit->getFullName().c_str()); //printf("$$$ Show light for faction: %s # %d / %d for Unit [%d - %s]\n",world->getFaction(i)->getType()->getName().c_str(),lightCount,maxLights,unit->getId(),unit->getFullName().c_str());
Vec4f pos= Vec4f(unit->getCurrVector()); Vec4f pos= Vec4f(unit->getCurrMidHeightVector());
pos.y+=4.f; pos.y+=4.f;
GLenum lightEnum= GL_LIGHT0 + lightCount; GLenum lightEnum= GL_LIGHT0 + lightCount;
@ -1642,11 +1648,11 @@ void Renderer::renderMouse2d(int x, int y, int anim, float fade) {
if(game->isMarkCellMode() == true) { if(game->isMarkCellMode() == true) {
const Texture2D *texture= game->getMarkCellTexture(); const Texture2D *texture= game->getMarkCellTexture();
renderTextureQuad(x-18,y-50,texture->getTextureWidth(),texture->getTextureHeight(),texture,0.8f); renderTextureQuad(x,y,texture->getTextureWidth(),texture->getTextureHeight(),texture,0.8f);
} }
if(game->isUnMarkCellMode() == true) { if(game->isUnMarkCellMode() == true) {
const Texture2D *texture= game->getUnMarkCellTexture(); const Texture2D *texture= game->getUnMarkCellTexture();
renderTextureQuad(x-18,y-50,texture->getTextureWidth(),texture->getTextureHeight(),texture,0.8f); renderTextureQuad(x,y,texture->getTextureWidth(),texture->getTextureHeight(),texture,0.8f);
} }
} }
@ -2082,8 +2088,7 @@ void Renderer::renderConsoleLine(int lineIndex, int xPosition, int yPosition, in
xPosition, (lineIndex * lineHeight) + yPosition); xPosition, (lineIndex * lineHeight) + yPosition);
} }
void Renderer::renderConsole(const Console *console,const bool showFullConsole, void Renderer::renderConsole(const Console *console, ConsoleMode mode , int overrideMaxConsoleLines){
const bool showMenuConsole, int overrideMaxConsoleLines){
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) { if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return; return;
} }
@ -2095,7 +2100,7 @@ void Renderer::renderConsole(const Console *console,const bool showFullConsole,
glPushAttrib(GL_ENABLE_BIT); glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND); glEnable(GL_BLEND);
if(showFullConsole) { if(mode==consoleFull) {
int x= console->getXPos()-5; int x= console->getXPos()-5;
int y= console->getYPos()-5; int y= console->getYPos()-5;
int h= console->getLineHeight()*console->getStoredLineCount(); int h= console->getLineHeight()*console->getStoredLineCount();
@ -2130,7 +2135,7 @@ void Renderer::renderConsole(const Console *console,const bool showFullConsole,
} }
} }
} }
else if(showMenuConsole) { else if(mode==consoleStoredOnly) {
int allowedMaxLines = (overrideMaxConsoleLines >= 0 ? overrideMaxConsoleLines : maxConsoleLines); int allowedMaxLines = (overrideMaxConsoleLines >= 0 ? overrideMaxConsoleLines : maxConsoleLines);
for(int i = 0; i < console->getStoredLineCount() && i < allowedMaxLines; ++i) { for(int i = 0; i < console->getStoredLineCount() && i < allowedMaxLines; ++i) {
const ConsoleLineInfo &lineInfo = console->getStoredLineItem(i); const ConsoleLineInfo &lineInfo = console->getStoredLineItem(i);
@ -2144,7 +2149,39 @@ void Renderer::renderConsole(const Console *console,const bool showFullConsole,
} }
} }
} }
else if(mode==consoleStoredAndNormal) {
int allowedMaxLines = (overrideMaxConsoleLines >= 0 ? overrideMaxConsoleLines : maxConsoleLines);
float starttimestamp=-1;
int consoleIndex=0;
for(int i = 0; i < console->getLineCount() && i < allowedMaxLines; ++i) {
const ConsoleLineInfo &lineInfo = console->getLineItem(i);
if(starttimestamp>lineInfo.timeStamp || starttimestamp==-1) starttimestamp=lineInfo.timeStamp;
if(renderText3DEnabled == true) {
renderConsoleLine3D(i, console->getXPos(), console->getYPos(),
console->getLineHeight(), console->getFont3D(), console->getStringToHighlight(), &lineInfo);
}
else { else {
renderConsoleLine(i, console->getXPos(), console->getYPos(),
console->getLineHeight(), console->getFont(), console->getStringToHighlight(), &lineInfo);
}
consoleIndex++;
}
for(int i = 0; i < console->getStoredLineCount() && consoleIndex < allowedMaxLines; ++i) {
const ConsoleLineInfo &lineInfo = console->getStoredLineItem(i);
if( lineInfo.timeStamp<starttimestamp || starttimestamp==-1){
if(renderText3DEnabled == true) {
renderConsoleLine3D(consoleIndex, console->getXPos(), console->getYPos(),
console->getLineHeight(), console->getFont3D(), console->getStringToHighlight(), &lineInfo);
}
else {
renderConsoleLine(consoleIndex, console->getXPos(), console->getYPos(),
console->getLineHeight(), console->getFont(), console->getStringToHighlight(), &lineInfo);
}
consoleIndex++;
}
}
}
else if(mode==consoleNormal) {
for(int i = 0; i < console->getLineCount(); ++i) { for(int i = 0; i < console->getLineCount(); ++i) {
const ConsoleLineInfo &lineInfo = console->getLineItem(i); const ConsoleLineInfo &lineInfo = console->getLineItem(i);
if(renderText3DEnabled == true) { if(renderText3DEnabled == true) {
@ -2336,25 +2373,13 @@ void Renderer::renderClock() {
} }
} }
bool Renderer::renderResourcesInTeamMode() {
bool result = false;
if(game != NULL && game->getGui() != NULL) {
if(game->isFlagType1BitEnabled(ft1_allow_shared_team_units) == true ||
game->isFlagType1BitEnabled(ft1_allow_shared_team_resources) == true) {
result = true;
}
}
return result;
}
void Renderer::renderResourceStatus() { void Renderer::renderResourceStatus() {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) { if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return; return;
} }
const World *world = game->getWorld(); const World *world = game->getWorld();
Config &config= Config::getInstance();
if(world->getThisFactionIndex() < 0 || if(world->getThisFactionIndex() < 0 ||
world->getThisFactionIndex() >= world->getFactionCount()) { world->getThisFactionIndex() >= world->getFactionCount()) {
@ -2368,64 +2393,45 @@ void Renderer::renderResourceStatus() {
int rowsRendered = 0; int rowsRendered = 0;
int resourceCountRendered = 0; int resourceCountRendered = 0;
for(int techTreeResourceTypeIndex = 0; bool twoRessourceLines=false;
techTreeResourceTypeIndex < world->getTechTree()->getResourceTypeCount();
++techTreeResourceTypeIndex) {
const ResourceType *rt = world->getTechTree()->getResourceType(techTreeResourceTypeIndex); bool sharedTeamUnits = game != NULL && game->getGui() != NULL
&& game->isFlagType1BitEnabled(ft1_allow_shared_team_units)
== true;
bool sharedTeamResources = game != NULL && game->getGui() != NULL
&& game->isFlagType1BitEnabled(
ft1_allow_shared_team_resources) == true;
if ( rt->getDisplayInHud() == false ) { bool renderSharedTeamResources=false;
continue; bool renderSharedTeamUnits=false;
bool renderLocalFactionResources=false;
if(config.getBool("TwoLineTeamResourceRendering","false") == true) {
if( sharedTeamResources == true || sharedTeamUnits == true){
twoRessourceLines=true;
} }
if(sharedTeamResources == true){
const Faction *factionForResourceView = thisFaction; renderSharedTeamResources=true;
bool localFactionResourcesOnly = false; renderSharedTeamUnits=true;
}
if(renderResourcesInTeamMode() == true) { else if(sharedTeamUnits == true){
renderSharedTeamUnits=true;
const Gui *gui = game->getGui(); renderLocalFactionResources=true;
if(gui != NULL) { }
else{
const Selection *selection = gui->getSelection(); renderLocalFactionResources=true;
if(selection != NULL && selection->getCount() > 0 && selection->getFrontUnit() != NULL) {
const Unit *selectedUnit = selection->getFrontUnit();
// if(selectedUnit != NULL && selectedUnit->getType()->hasSkillClass(scBeBuilt) == true) {
//
// if(selectedUnit->getFactionIndex() == thisFaction->getIndex() ||
// selectedUnit->getFaction()->isAlly(thisFaction) == true) {
//
// factionForResourceView = selectedUnit->getFaction();
// localFactionResourcesOnly = true;
// }
// }
if(selectedUnit != NULL && selectedUnit->getFaction()->isAlly(thisFaction) == true) {
factionForResourceView = selectedUnit->getFaction();
localFactionResourcesOnly = true;
} }
} }
else { else {
factionForResourceView = thisFaction; if(sharedTeamResources == true)
localFactionResourcesOnly = true; renderSharedTeamResources=true;
} else if(sharedTeamUnits == true)
} renderSharedTeamUnits=true;
else
renderLocalFactionResources=true;
} }
//if any unit produces the resource if(renderSharedTeamResources == true) {
bool showResource = world->showResourceTypeForFaction(rt, factionForResourceView, false);
if(showResource == true) {
rowsRendered = renderResource(factionForResourceView,localFactionResourcesOnly,
rt, 0, resourceCountRendered);
}
}
// If we rendered single player resources above and we are in team mode,
// lets render team totals next
if(renderResourcesInTeamMode() == true) {
if(rowsRendered > 0 || resourceCountRendered > 0) {
rowsRendered++;
}
resourceCountRendered = 0; resourceCountRendered = 0;
for(int techTreeResourceTypeIndex = 0; for(int techTreeResourceTypeIndex = 0;
techTreeResourceTypeIndex < world->getTechTree()->getResourceTypeCount(); techTreeResourceTypeIndex < world->getTechTree()->getResourceTypeCount();
@ -2437,15 +2443,92 @@ void Renderer::renderResourceStatus() {
continue; continue;
} }
const Faction *factionForResourceView = thisFaction; bool showResource = world->showResourceTypeForTeam(rt, thisFaction->getTeam());
bool localFactionResourcesOnly = false; if(showResource == true) {
rowsRendered = renderResource(thisFaction,
false, twoRessourceLines, rt, 0,
resourceCountRendered);
}
}
if(resourceCountRendered > 0) {
rowsRendered++;
}
}
bool showResource = world->showResourceTypeForFaction(rt, factionForResourceView, localFactionResourcesOnly); if(renderLocalFactionResources == true){
resourceCountRendered = 0;
const Faction *factionForResourceView = thisFaction;
bool localFactionResourcesOnly = true;
for(int techTreeResourceTypeIndex = 0;
techTreeResourceTypeIndex < world->getTechTree()->getResourceTypeCount();
++techTreeResourceTypeIndex) {
const ResourceType *rt = world->getTechTree()->getResourceType(techTreeResourceTypeIndex);
if ( rt->getDisplayInHud() == false ) {
continue;
}
//if any unit produces the resource
bool showResource;
if (twoRessourceLines)
showResource = world->showResourceTypeForTeam(rt,
factionForResourceView->getTeam());
else
showResource = world->showResourceTypeForFaction(rt,
factionForResourceView);
if(showResource == true) { if(showResource == true) {
renderResource(factionForResourceView, localFactionResourcesOnly, renderResource(factionForResourceView, localFactionResourcesOnly,
rt, rowsRendered, resourceCountRendered); twoRessourceLines, rt, rowsRendered, resourceCountRendered);
} }
} }
if(resourceCountRendered > 0) {
rowsRendered++;
}
}
if(renderSharedTeamUnits == true){
resourceCountRendered = 0;
const Faction *factionForResourceView = thisFaction;
bool localFactionResourcesOnly = true;
const Gui *gui = game->getGui();
if(gui != NULL) {
const Selection *selection = gui->getSelection();
if(selection != NULL && selection->getCount() > 0 && selection->getFrontUnit() != NULL) {
const Unit *selectedUnit = selection->getFrontUnit();
if(selectedUnit != NULL && selectedUnit->getFaction()->isAlly(thisFaction) == true) {
factionForResourceView = selectedUnit->getFaction();
}
}
}
for(int techTreeResourceTypeIndex = 0;
techTreeResourceTypeIndex < world->getTechTree()->getResourceTypeCount();
++techTreeResourceTypeIndex) {
const ResourceType *rt = world->getTechTree()->getResourceType(techTreeResourceTypeIndex);
if ( rt->getDisplayInHud() == false ) {
continue;
}
//if any unit produces the resource
bool showResource;
if (twoRessourceLines)
showResource = world->showResourceTypeForTeam(rt,
factionForResourceView->getTeam());
else
showResource = world->showResourceTypeForFaction(rt,
factionForResourceView);
if(showResource == true) {
renderResource(factionForResourceView, localFactionResourcesOnly,
twoRessourceLines, rt, rowsRendered, resourceCountRendered);
}
}
if(resourceCountRendered > 0) {
rowsRendered++;
}
} }
glPopAttrib(); glPopAttrib();
@ -2454,29 +2537,35 @@ void Renderer::renderResourceStatus() {
} }
int Renderer::renderResource(const Faction *factionForResourceView,bool localFactionResourcesOnly, int Renderer::renderResource(const Faction *factionForResourceView,bool localFactionResourcesOnly,
const ResourceType *rt, int startRow, int &resourceCountRendered) { bool twoResourceLines, const ResourceType *rt, int startRow, int &resourceCountRendered) {
const Metrics &metrics = Metrics::getInstance(); const Metrics &metrics = Metrics::getInstance();
const int MAX_RESOURCES_PER_ROW = 6;
int resourceRowHeigth=30;
int resourceYStart=metrics.getVirtualH()-30;
if(twoResourceLines){
// we need to save some space
resourceYStart=metrics.getVirtualH()-22;
resourceRowHeigth=16;
}
//draw resource status //draw resource status
if(localFactionResourcesOnly == true) { if(localFactionResourcesOnly == true) {
string str = "*";
Vec4f resourceFontColor = Vec4f(factionForResourceView->getTexture()->getPixmapConst()->getPixel3f(0,0)); Vec4f resourceFontColor = Vec4f(factionForResourceView->getTexture()->getPixmapConst()->getPixel3f(0,0));
int resourceCol = 0; int resourceCol = 0;
int resourceRow = startRow; int resourceRow = startRow;
if(renderText3DEnabled == true) { int x=resourceCol * 100 + 190;
renderTextShadow3D( int y=resourceYStart - (resourceRowHeigth * resourceRow);
str, CoreData::getInstance().getDisplayFontSmall3D(), int h=16;
resourceFontColor, int w=8;
resourceCol * 100 + 190, metrics.getVirtualH()-30 - (30 * resourceRow), false); glColor3f(resourceFontColor.x,resourceFontColor.y,resourceFontColor.z);
} glBegin(GL_TRIANGLE_STRIP);
else { glVertex2i(x, y+h);
renderTextShadow( glVertex2i(x, y);
str, CoreData::getInstance().getDisplayFontSmall(), glVertex2i(x+w, y+h/2);
resourceFontColor, glEnd();
resourceCol * 100 + 190, metrics.getVirtualH()-30 - (30 * resourceRow), false);
}
} }
const Resource *r = factionForResourceView->getResource(rt,localFactionResourcesOnly); const Resource *r = factionForResourceView->getResource(rt,localFactionResourcesOnly);
@ -2495,17 +2584,14 @@ int Renderer::renderResource(const Faction *factionForResourceView,bool localFac
isNegativeConsumableDisplayCycle = true; isNegativeConsumableDisplayCycle = true;
if(r->getBalance() * 1 + r->getAmount() < 0) { if(r->getBalance() * 1 + r->getAmount() < 0) {
glColor3f(RED.x,RED.y,RED.z); glColor3f(RED.x,RED.y,RED.z);
resourceFontColor = RED; resourceFontColor = RED;
} }
else if(r->getBalance() * 3 + r->getAmount() < 0) { else if(r->getBalance() * 3 + r->getAmount() < 0) {
glColor3f(ORANGE.x,ORANGE.y,ORANGE.z); glColor3f(ORANGE.x,ORANGE.y,ORANGE.z);
resourceFontColor = ORANGE; resourceFontColor = ORANGE;
} }
else if(r->getBalance() * 5 + r->getAmount() < 0) { else if(r->getBalance() * 5 + r->getAmount() < 0) {
glColor3f(YELLOW.x,YELLOW.y,YELLOW.z); glColor3f(YELLOW.x,YELLOW.y,YELLOW.z);
resourceFontColor = YELLOW; resourceFontColor = YELLOW;
} }
@ -2516,11 +2602,11 @@ int Renderer::renderResource(const Faction *factionForResourceView,bool localFac
if(isNegativeConsumableDisplayCycle == false) { if(isNegativeConsumableDisplayCycle == false) {
glColor3f(1.f, 1.f, 1.f); glColor3f(1.f, 1.f, 1.f);
} }
const int MAX_RESOURCES_PER_ROW = 6;
int resourceRow = startRow + (resourceCountRendered > 0 ? resourceCountRendered / MAX_RESOURCES_PER_ROW : 0); int resourceRow = startRow + (resourceCountRendered > 0 ? resourceCountRendered / MAX_RESOURCES_PER_ROW : 0);
int resourceCol = resourceCountRendered % MAX_RESOURCES_PER_ROW; int resourceCol = resourceCountRendered % MAX_RESOURCES_PER_ROW;
renderQuad(resourceCol * 100 + 200, metrics.getVirtualH()-30 - (30 * resourceRow), 16, 16, rt->getImage()); renderQuad(resourceCol * 100 + 200, resourceYStart - (resourceRowHeigth * resourceRow), 16, 16, rt->getImage());
if(rt->getClass() != rcStatic) { if(rt->getClass() != rcStatic) {
str+= "/" + intToStr(factionForResourceView->getStoreAmount(rt,localFactionResourcesOnly)); str+= "/" + intToStr(factionForResourceView->getStoreAmount(rt,localFactionResourcesOnly));
@ -2539,13 +2625,13 @@ int Renderer::renderResource(const Faction *factionForResourceView,bool localFac
renderTextShadow3D( renderTextShadow3D(
str, CoreData::getInstance().getDisplayFontSmall3D(), str, CoreData::getInstance().getDisplayFontSmall3D(),
resourceFontColor, resourceFontColor,
resourceCol * 100 + 220, metrics.getVirtualH()-30 - (30 * resourceRow), false); resourceCol * 100 + 220, resourceYStart - (resourceRowHeigth * resourceRow), false);
} }
else { else {
renderTextShadow( renderTextShadow(
str, CoreData::getInstance().getDisplayFontSmall(), str, CoreData::getInstance().getDisplayFontSmall(),
resourceFontColor, resourceFontColor,
resourceCol * 100 + 220, metrics.getVirtualH()-30 - (30 * resourceRow), false); resourceCol * 100 + 220, resourceYStart - (resourceRowHeigth * resourceRow), false);
} }
++resourceCountRendered; ++resourceCountRendered;
@ -3053,6 +3139,33 @@ void Renderer::renderLabel(GraphicLabel *label) {
} }
} }
if(label->getRenderBackground())
{
int x= label->getX();
int y= label->getY();
int h= label->getH();
int w= label->getW();
if(label->getMaxEditRenderWidth()>0){
w= label->getMaxEditRenderWidth();
}
Vec4f color=label->getBackgroundColor();
if(h>0){
//background
glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT);
glEnable(GL_BLEND);
glColor4f(color.x, color.y, color.z, color.w*label->getFade()) ;
glBegin(GL_TRIANGLE_STRIP);
glVertex2i(x, y);
glVertex2i(x, y+h);
glVertex2i(x+w, y);
glVertex2i(x+w, y+h);
glEnd();
glPopAttrib();
}
}
if(label->getTexture()!=NULL ) if(label->getTexture()!=NULL )
{ {
int x= label->getX(); int x= label->getX();
@ -3701,6 +3814,7 @@ void Renderer::renderListBox(GraphicListBox *listBox) {
} }
void Renderer::renderMessageBox(GraphicMessageBox *messageBox) { void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
const int headerHeight=25;
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) { if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return; return;
} }
@ -3732,18 +3846,18 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
glColor4f(0.0f, 0.0f, 0.0f, 0.8f) ; glColor4f(0.0f, 0.0f, 0.0f, 0.8f) ;
glBegin(GL_TRIANGLE_STRIP); glBegin(GL_TRIANGLE_STRIP);
glVertex2i(messageBox->getX(), messageBox->getY()+9*messageBox->getH()/10); glVertex2i(messageBox->getX(), messageBox->getY()+messageBox->getH()-headerHeight);
glVertex2i(messageBox->getX(), messageBox->getY()); glVertex2i(messageBox->getX(), messageBox->getY());
glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY() + 9*messageBox->getH()/10); glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY() + messageBox->getH()-headerHeight);
glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY()); glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY());
glEnd(); glEnd();
glColor4f(0.0f, 0.0f, 0.0f, 0.8f) ; glColor4f(0.0f, 0.0f, 0.0f, 0.8f) ;
glBegin(GL_TRIANGLE_STRIP); glBegin(GL_TRIANGLE_STRIP);
glVertex2i(messageBox->getX(), messageBox->getY()+messageBox->getH()); glVertex2i(messageBox->getX(), messageBox->getY()+messageBox->getH());
glVertex2i(messageBox->getX(), messageBox->getY()+9*messageBox->getH()/10); glVertex2i(messageBox->getX(), messageBox->getY()+messageBox->getH()-headerHeight);
glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY() + messageBox->getH()); glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY() + messageBox->getH());
glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY()+9*messageBox->getH()/10); glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY()+messageBox->getH()-headerHeight);
glEnd(); glEnd();
glBegin(GL_LINE_LOOP); glBegin(GL_LINE_LOOP);
@ -3762,10 +3876,10 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
glColor4f(1.0f, 1.0f, 1.0f, 0.25f) ; glColor4f(1.0f, 1.0f, 1.0f, 0.25f) ;
glVertex2i(messageBox->getX(), messageBox->getY() + 90*messageBox->getH()/100); glVertex2i(messageBox->getX(), messageBox->getY() + messageBox->getH()-headerHeight);
glColor4f(0.5f, 0.5f, 0.5f, 0.25f) ; glColor4f(0.5f, 0.5f, 0.5f, 0.25f) ;
glVertex2i(messageBox->getX()+ messageBox->getW(), messageBox->getY() + 90*messageBox->getH()/100); glVertex2i(messageBox->getX()+ messageBox->getW(), messageBox->getY() + messageBox->getH()-headerHeight);
glEnd(); glEnd();
glPopAttrib(); glPopAttrib();
@ -3796,12 +3910,12 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
//text //text
renderTextShadow3D( renderTextShadow3D(
wrappedText, messageBox->getFont3D(), fontColor, wrappedText, messageBox->getFont3D(), fontColor,
messageBox->getX()+15, messageBox->getY()+7*messageBox->getH()/10, messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight*2,
false ); false );
renderTextShadow3D( renderTextShadow3D(
messageBox->getHeader(), messageBox->getFont3D(),fontColor, messageBox->getHeader(), messageBox->getFont3D(),fontColor,
messageBox->getX()+15, messageBox->getY()+93*messageBox->getH()/100, messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight+8,
false ); false );
} }
@ -3809,12 +3923,12 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
//text //text
renderTextShadow( renderTextShadow(
wrappedText, messageBox->getFont(), fontColor, wrappedText, messageBox->getFont(), fontColor,
messageBox->getX()+15, messageBox->getY()+7*messageBox->getH()/10, messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight*2,
false ); false );
renderTextShadow( renderTextShadow(
messageBox->getHeader(), messageBox->getFont(),fontColor, messageBox->getHeader(), messageBox->getFont(),fontColor,
messageBox->getX()+15, messageBox->getY()+93*messageBox->getH()/100, messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight+8,
false ); false );
} }
} }
@ -5393,7 +5507,7 @@ void Renderer::renderMorphEffects(){
void Renderer::renderSelectionEffects() { void Renderer::renderSelectionEffects(int healthbarMode) {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) { if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return; return;
} }
@ -5427,24 +5541,41 @@ void Renderer::renderSelectionEffects() {
currVec.y+= 0.3f; currVec.y+= 0.3f;
//selection circle //selection circle
int finalHealthbarMode = hbvUndefined;
if(healthbarMode == hbvUndefined) {
finalHealthbarMode = unit->getFaction()->getType()->getHealthbarVisible();
}
else {
finalHealthbarMode = healthbarMode;
}
bool healthbarsVisible =((finalHealthbarMode & hbvAlways) ||
(finalHealthbarMode & hbvSelected) ||
(finalHealthbarMode & hbvIfNeeded));
float selectionCircleThickness = 0.2f;
float hpRatio = unit->getHpRatio();
if(healthbarsVisible) {
selectionCircleThickness = 0.05f;
hpRatio = 1.0f;
}
if(world->getThisFactionIndex() == unit->getFactionIndex()) { if(world->getThisFactionIndex() == unit->getFactionIndex()) {
if( showDebugUI == true && if( showDebugUI == true &&
((showDebugUILevel & debugui_unit_titles) == debugui_unit_titles) && ((showDebugUILevel & debugui_unit_titles) == debugui_unit_titles) &&
unit->getCommandSize() > 0 && unit->getCommandSize() > 0 &&
dynamic_cast<const BuildCommandType *>(unit->getCurrCommand()->getCommandType()) != NULL) { dynamic_cast<const BuildCommandType *>(unit->getCurrCommand()->getCommandType()) != NULL) {
glColor4f(unit->getHpRatio(), unit->getHpRatio(), unit->getHpRatio(), 0.3f); glColor4f(hpRatio, hpRatio, hpRatio, 0.3f);
} }
else { else {
glColor4f(0, unit->getHpRatio(), 0, 0.3f); glColor4f(0, hpRatio, 0, 0.3f);
} }
} }
else if ( world->getThisTeamIndex() == unit->getTeam()) { else if ( world->getThisTeamIndex() == unit->getTeam()) {
glColor4f(unit->getHpRatio(), unit->getHpRatio(), 0, 0.3f); glColor4f(hpRatio, hpRatio, 0, 0.3f);
} }
else { else {
glColor4f(unit->getHpRatio(), 0, 0, 0.3f); glColor4f(hpRatio, 0, 0, 0.3f);
} }
renderSelectionCircle(currVec, unit->getType()->getSize(), selectionCircleRadius); renderSelectionCircle(currVec, unit->getType()->getSize(), selectionCircleRadius,selectionCircleThickness);
if( showDebugUI == true && if( showDebugUI == true &&
(showDebugUILevel & debugui_unit_titles) == debugui_unit_titles) { (showDebugUILevel & debugui_unit_titles) == debugui_unit_titles) {
@ -5468,7 +5599,7 @@ void Renderer::renderSelectionEffects() {
} }
//magic circle //magic circle
if(world->getThisFactionIndex() == unit->getFactionIndex() && unit->getType()->getMaxEp() > 0) { if(!healthbarsVisible && world->getThisFactionIndex() == unit->getFactionIndex() && unit->getType()->getMaxEp() > 0) {
glColor4f(unit->getEpRatio()/2.f, unit->getEpRatio(), unit->getEpRatio(), 0.5f); glColor4f(unit->getEpRatio()/2.f, unit->getEpRatio(), unit->getEpRatio(), 0.5f);
renderSelectionCircle(currVec, unit->getType()->getSize(), magicCircleRadius); renderSelectionCircle(currVec, unit->getType()->getSize(), magicCircleRadius);
} }
@ -5480,7 +5611,7 @@ void Renderer::renderSelectionEffects() {
if(effect.skillType->isAttackBoostEnabled() == true) { if(effect.skillType->isAttackBoostEnabled() == true) {
glColor4f(MAGENTA.x,MAGENTA.y,MAGENTA.z,MAGENTA.w); glColor4f(MAGENTA.x,MAGENTA.y,MAGENTA.z,MAGENTA.w);
renderSelectionCircle(currVec, unit->getType()->getSize(), effect.skillType->getAttackBoost()->radius); renderSelectionCircle(currVec, 1, effect.skillType->getAttackBoost()->radius, .25f/effect.skillType->getAttackBoost()->radius);
for(unsigned int i = 0; i < effect.currentAttackBoostUnits.size(); ++i) { for(unsigned int i = 0; i < effect.currentAttackBoostUnits.size(); ++i) {
// Remove attack boost upgrades from unit // Remove attack boost upgrades from unit
@ -5610,6 +5741,116 @@ void Renderer::renderSelectionEffects() {
glPopAttrib(); glPopAttrib();
} }
void Renderer::renderHealthBars(int healthbarMode){
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
}
Config &config= Config::getInstance();
if(config.getBool("RecordMode","false") == true) {
return;
}
if(config.getBool("PhotoMode")) {
return;
}
glPushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
glDepthFunc(GL_ALWAYS);
glDisable(GL_STENCIL_TEST);
glDisable(GL_CULL_FACE);
glEnable(GL_BLEND);
glLineWidth(2.f);
VisibleQuadContainerCache &qCache = getQuadCache();
if(qCache.visibleQuadUnitList.empty() == false) {
for(int visibleUnitIndex = 0;
visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++visibleUnitIndex) {
Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex];
if(isHealthBarVisible(unit,healthbarMode)) {
float healthbarheight;
float healthbarthickness;
const Texture2D *healthbarTexture;
const Texture2D *healthbarBackgroundTexture;
bool healthbarLineBorder;
//get settings of the faction
healthbarheight=unit->getFaction()->getType()->getHealthbarHeight();
healthbarthickness=unit->getFaction()->getType()->getHealthbarThickness();
healthbarLineBorder=unit->getFaction()->getType()->isHealthbarLineBorder();
CoreData &coreData= CoreData::getInstance();
//First try faction texture then use core Texture
if(unit->getFaction()->getType()->isHealthbarBorderTextureEnabled()) {
healthbarTexture=unit->getFaction()->getType()->getHealthbarTexture();
if(healthbarTexture==NULL) {
healthbarTexture=coreData.getHealthbarTexture();
}
} else {
healthbarTexture=NULL;
}
if(unit->getFaction()->getType()->isHealthbarBackgroundTextureEnabled()) {
healthbarBackgroundTexture=unit->getFaction()->getType()->getHealthbarBackgroundTexture();
if(healthbarBackgroundTexture==NULL) {
healthbarBackgroundTexture=coreData.getHealthbarBackgroundTexture();
}
} else {
healthbarBackgroundTexture=NULL;
}
//replace them by the ones from the unit if existent
if(unit->getType()->getHealthbarVisible()!=hbvOff && unit->getType()->getHealthbarVisible()!=hbvUndefined) {
if(unit->getType()->getHealthbarHeight()!=-100.0f) {
healthbarheight=unit->getType()->getHealthbarHeight();
}
if(unit->getType()->getHealthbarThickness()!=-1.0f) {
healthbarthickness=unit->getType()->getHealthbarThickness();
}
}
Vec3f currVec= unit->getCurrVectorFlat();
if(healthbarheight==-100.0f) {
currVec.y+=unit->getType()->getHeight();
} else {
currVec.y+=healthbarheight;
}
renderHealthBar(currVec,unit,healthbarthickness,healthbarLineBorder,healthbarTexture,healthbarBackgroundTexture);
}
}
}
glPopAttrib();
}
bool Renderer::isHealthBarVisible(const Unit *unit,int healthbarMode){
int healthbarVisible=hbvUndefined;
//check options (hotkey)
if(healthbarMode==hbvUndefined) {
healthbarVisible=unit->getFaction()->getType()->getHealthbarVisible();
} else {
healthbarVisible=healthbarMode;
}
//replace them by the ones from the unit if existent
if(unit->getType()->getHealthbarVisible()!=hbvOff && unit->getType()->getHealthbarVisible()!=hbvUndefined) {
if(healthbarMode==hbvUndefined) { //don't override the visible setting when hotkey is not hbvUndefined
healthbarVisible=unit->getType()->getHealthbarVisible();
}
}
bool settingsWantToRenderThem=!(healthbarVisible==hbvUndefined || (healthbarVisible&hbvOff))
&& ((healthbarVisible&hbvAlways)
|| ((healthbarVisible&hbvIfNeeded) && unit->getHp()<unit->getType()->getMaxHp()+unit->getTotalUpgrade()->getMaxHp())
|| ((healthbarVisible&hbvIfNeeded) && unit->getType()->getMaxEp() > 0 && unit->getEp()<unit->getType()->getMaxEp()+unit->getTotalUpgrade()->getMaxEp())
|| ((healthbarVisible&hbvIfNeeded) && unit->getProductionPercent() > 0)
|| ((healthbarVisible&hbvSelected) && game->getGui()->isSelected(unit)));
if(unit->isAlive() && (settingsWantToRenderThem)) {
return true;
}
return false;
}
void Renderer::renderWaterEffects(){ void Renderer::renderWaterEffects(){
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) { if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return; return;
@ -6193,7 +6434,7 @@ void Renderer::renderVisibleMarkedCells(bool renderTextHint,int x, int y) {
std::map<Vec2i, MarkedCell> markedCells = game->getMapMarkedCellList(); std::map<Vec2i, MarkedCell> markedCells = game->getMapMarkedCellList();
if(markedCells.empty() == false) { if(markedCells.empty() == false) {
const Texture2D *texture= game->getMarkCellTexture(); const Texture2D *texture= game->getMarkCellTexture();
const int yOffset = 10; const int yOffset = -40;
for(std::map<Vec2i, MarkedCell>::iterator iterMap =markedCells.begin(); for(std::map<Vec2i, MarkedCell>::iterator iterMap =markedCells.begin();
iterMap != markedCells.end(); ++iterMap) { iterMap != markedCells.end(); ++iterMap) {
@ -6684,7 +6925,7 @@ void Renderer::renderMenuBackground(Camera *camera, float fade, Model *mainModel
// ==================== computing ==================== // ==================== computing ====================
bool Renderer::computePosition(const Vec2i &screenPos, Vec2i &worldPos, bool exactCoords) { bool Renderer::ccomputePosition(const Vec2i &screenPos, Vec2i &worldPos, bool exactCoords) {
assertGl(); assertGl();
const Map* map= game->getWorld()->getMap(); const Map* map= game->getWorld()->getMap();
const Metrics &metrics= Metrics::getInstance(); const Metrics &metrics= Metrics::getInstance();
@ -6820,7 +7061,7 @@ void Renderer::selectUsingFrustumSelection(Selection::UnitContainer &units,
visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++visibleUnitIndex) { visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++visibleUnitIndex) {
Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex]; Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex];
if(unit != NULL && unit->isAlive()) { if(unit != NULL && unit->isAlive()) {
Vec3f unitPos = unit->getCurrVector(); Vec3f unitPos = unit->getCurrMidHeightVector();
bool insideQuad = CubeInFrustum(quadSelectionCacheItem.frustumData, bool insideQuad = CubeInFrustum(quadSelectionCacheItem.frustumData,
unitPos.x, unitPos.y, unitPos.z, unit->getType()->getRenderSize()); unitPos.x, unitPos.y, unitPos.z, unit->getType()->getRenderSize());
if(insideQuad == true) { if(insideQuad == true) {
@ -7519,7 +7760,10 @@ vector<Unit *> Renderer::renderUnitsFast(bool renderingShadows, bool colorPickin
renderOnlyBuildings=true; renderOnlyBuildings=true;
} }
else { else {
//glClear(GL_DEPTH_BUFFER_BIT); if(colorPickingSelection == true){
// clear depth buffer to get units behind buildings rendered in front of them
glClear(GL_DEPTH_BUFFER_BIT);
}
//glEnable(GL_DEPTH_TEST); //glEnable(GL_DEPTH_TEST);
renderOnlyBuildings=false; renderOnlyBuildings=false;
} }
@ -7527,6 +7771,11 @@ vector<Unit *> Renderer::renderUnitsFast(bool renderingShadows, bool colorPickin
visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++visibleUnitIndex) { visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++visibleUnitIndex) {
Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex]; Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex];
if(renderingShadows==false && unit->isAlive()==false){
// no need to render dead units for selection
continue;
}
if(renderOnlyBuildings==true && unit->getType()->hasSkillClass(scMove)){ if(renderOnlyBuildings==true && unit->getType()->hasSkillClass(scMove)){
continue; continue;
} }
@ -8215,6 +8464,174 @@ void Renderer::enableProjectiveTexturing() {
} }
// ==================== private aux drawing ==================== // ==================== private aux drawing ====================
void Renderer::renderHealthBar(Vec3f v, Unit *unit, float height, bool lineBorder, const Texture2D *texture, const Texture2D *backgroundTexture) {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
}
int numberOfBars=1;
int barCount=0;
float hp=unit->getHpRatio();
float ep=-1.f;
if(unit->getType()->getTotalMaxEp(unit->getTotalUpgrade()) !=0 ) {
ep=unit->getEpRatio();
numberOfBars++;
}
int productionPercent=unit->getProductionPercent();
if(productionPercent!=-1) {
numberOfBars++;
}
int size=unit->getType()->getSize();
Vec3f rightVector;
Vec3f upVector;
Vec3f rightVectorTexture;
Vec3f upVectorTexture;
v.y+=1;
float modelview[16];
float width=(float)size/6+0.25f;
float red;
float green;
float brightness=0.8f;
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
// get the current modelview state
glGetFloatv(GL_MODELVIEW_MATRIX , modelview);
rightVector= Vec3f(modelview[0], modelview[4], modelview[8]);
upVector= Vec3f(modelview[1], modelview[5], modelview[9]);
rightVectorTexture=rightVector*2;
upVectorTexture=upVector*4;
//from green to yellow to red
if(hp >= 0.75f) {
green=1;
red=1-((2*hp-1)-0.5f);
} else {
red=1;
green=0.5f+(2*hp-1);
}
if(red>1.0f) red=1.0f;
if(green>1.0f) green=1.0f;
float yOffset=(float)numberOfBars/2.f;
if(backgroundTexture!=NULL) {
//backgroundTexture
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, static_cast<const Texture2DGl*>(backgroundTexture)->getHandle());
glColor4f(1.f,1.f,1.f,1.f);
//glColor4f(red+0.1f,green+0.1f,0.1f,0.5f);
glBegin(GL_QUADS);
glTexCoord2i(0,1);
glVertex3fv((v - (rightVectorTexture*width - upVectorTexture*height*yOffset)).ptr());
glTexCoord2i(0,0);
glVertex3fv((v - (rightVectorTexture*width + upVectorTexture*height*yOffset)).ptr());
glTexCoord2i(1,0);
glVertex3fv((v + (rightVectorTexture*width - upVectorTexture*height*yOffset)).ptr());
glTexCoord2i(1,1);
glVertex3fv((v + (rightVectorTexture*width + upVectorTexture*height*yOffset)).ptr());
glEnd();
glDisable(GL_TEXTURE_2D);
}
//healthbar
glColor4f(red*brightness,green*brightness,0.0f,0.4f);
//hpbar
barCount++;
internalRenderHp(numberOfBars,barCount,hp,v,width,height,rightVector,upVector);
if(ep > -1.0f) {
//epbar
barCount++;
//glColor4f(brightness,0,brightness,0.5f);
glColor4f(.15f*brightness,0.3f*brightness,0.8f*brightness,0.7f);
internalRenderHp(numberOfBars,barCount,ep,v,width,height,rightVector,upVector);
}
if(productionPercent!=-1) {
barCount++;
glColor4f(brightness,0,brightness,0.6f);
//glColor4f(0.0f*brightness,0.4f*brightness,0.2f*brightness,0.8f);
internalRenderHp(numberOfBars,barCount,(float)productionPercent/100,v,width,height,rightVector,upVector);
}
// glBegin(GL_QUADS);
// if(ep < -2.0f) {
// //hpbar
// glVertex3fv((v - (rightVector*width - upVector*height)).ptr());
// glVertex3fv((v - (rightVector*width + upVector*height)).ptr());
// glVertex3fv((v + (rightVector*hp*width - upVector*height)).ptr());
// glVertex3fv((v + (rightVector*hp*width + upVector*height)).ptr());
//
// } else {
// //hpbar
// glVertex3fv((v - (rightVector*width - upVector*height)).ptr());
// glVertex3fv((v - (rightVector*width + upVector*height*0.0f)).ptr());
// glVertex3fv((v + (rightVector*hp*width - upVector*height*0.0f)).ptr());
// glVertex3fv((v + (rightVector*hp*width + upVector*height)).ptr());
// //epbar
// glColor4f(brightness,0,brightness,0.4f);
// glVertex3fv((v - (rightVector*width + upVector*height*0.0f)).ptr());
// glVertex3fv((v - (rightVector*width + upVector*height)).ptr());
// glVertex3fv((v + (rightVector*ep*width - upVector*height)).ptr());
// glVertex3fv((v + (rightVector*ep*width - upVector*height*0.0f)).ptr());
// }
// glEnd();
if(lineBorder) {
//border
glColor4f(red*brightness,green*brightness,0.1f*brightness,0.5f);
glBegin(GL_LINE_LOOP);
glVertex3fv((v - (rightVector*width - upVector*height*yOffset)).ptr());
glVertex3fv((v - (rightVector*width + upVector*height*yOffset)).ptr());
glVertex3fv((v + (rightVector*width - upVector*height*yOffset)).ptr());
glVertex3fv((v + (rightVector*width + upVector*height*yOffset)).ptr());
glEnd();
}
if(texture!=NULL) {
//BorderTexture
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, static_cast<const Texture2DGl*>(texture)->getHandle());
glColor4f(1.f,1.f,1.f,1.f);
//glColor4f(red+0.1f,green+0.1f,0.1f,0.5f);
glBegin(GL_QUADS);
glTexCoord2i(0,1);
glVertex3fv((v - (rightVectorTexture*width - upVectorTexture*height*yOffset)).ptr());
glTexCoord2i(0,0);
glVertex3fv((v - (rightVectorTexture*width + upVectorTexture*height*yOffset)).ptr());
glTexCoord2i(1,0);
glVertex3fv((v + (rightVectorTexture*width - upVectorTexture*height*yOffset)).ptr());
glTexCoord2i(1,1);
glVertex3fv((v + (rightVectorTexture*width + upVectorTexture*height*yOffset)).ptr());
glEnd();
glDisable(GL_TEXTURE_2D);
}
glPopMatrix();
}
void Renderer::internalRenderHp(int numberOfBars, int barNumber, float hp,
Vec3f posVector, float width, float singleHPheight, Vec3f rightVector, Vec3f upVector) {
float yOffset=(float)numberOfBars*singleHPheight/2;
float offsetTop=yOffset-singleHPheight*(barNumber-1);
float offsetBottom=yOffset-singleHPheight*barNumber;
offsetBottom=offsetBottom*-1;
hp=hp*2-1;
glBegin(GL_QUADS);
glVertex3fv((posVector - (rightVector*width - upVector*offsetTop)).ptr());
glVertex3fv((posVector - (rightVector*width + upVector*offsetBottom)).ptr());
glVertex3fv((posVector + (rightVector*hp*width - upVector*offsetBottom)).ptr());
glVertex3fv((posVector + (rightVector*hp*width + upVector*offsetTop)).ptr());
glEnd();
}
void Renderer::renderSelectionCircle(Vec3f v, int size, float radius, float thickness) { void Renderer::renderSelectionCircle(Vec3f v, int size, float radius, float thickness) {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) { if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
@ -8234,6 +8651,13 @@ void Renderer::renderSelectionCircle(Vec3f v, int size, float radius, float thic
gluDeleteQuadric(disc); gluDeleteQuadric(disc);
glPopMatrix(); glPopMatrix();
// glBegin (GL_QUAD_STRIP);
// for (float k = 0; k <= 180; k=k+1) {
// float j=degToRad(k);
// glVertex3f(v.x+std::cos(j)*.9*radius*size, v.y+thickness, v.z+std::sin(j)*.9*radius*size);
// glVertex3f(v.x+std::cos(j)*radius*size, v.y, v.z+std::sin(j)*radius*size);
// }
// glEnd();
} }
void Renderer::renderArrow(const Vec3f &pos1, const Vec3f &pos2, void Renderer::renderArrow(const Vec3f &pos1, const Vec3f &pos2,
@ -8697,7 +9121,7 @@ VisibleQuadContainerCache & Renderer::getQuadCache( bool updateOnDirtyFrame,
bool unitCheckedForRender = false; bool unitCheckedForRender = false;
if(VisibleQuadContainerCache::enableFrustumCalcs == true) { if(VisibleQuadContainerCache::enableFrustumCalcs == true) {
//bool insideQuad = PointInFrustum(quadCache.frustumData, unit->getCurrVector().x, unit->getCurrVector().y, unit->getCurrVector().z ); //bool insideQuad = PointInFrustum(quadCache.frustumData, unit->getCurrVector().x, unit->getCurrVector().y, unit->getCurrVector().z );
bool insideQuad = CubeInFrustum(quadCache.frustumData, unit->getCurrVector().x, unit->getCurrVector().y, unit->getCurrVector().z, unit->getType()->getRenderSize()); bool insideQuad = CubeInFrustum(quadCache.frustumData, unit->getCurrMidHeightVector().x, unit->getCurrMidHeightVector().y, unit->getCurrMidHeightVector().z, unit->getType()->getRenderSize());
bool renderInMap = world->toRenderUnit(unit); bool renderInMap = world->toRenderUnit(unit);
if(insideQuad == false || renderInMap == false) { if(insideQuad == false || renderInMap == false) {
unit->setVisible(false); unit->setVisible(false);
@ -9423,6 +9847,9 @@ Texture2D * Renderer::findTexture(string logoFilename) {
void Renderer::cycleShowDebugUILevel() { void Renderer::cycleShowDebugUILevel() {
//printf("#1 showDebugUILevel = %d, debugui_fps = %d, debugui_unit_titles = %d\n",showDebugUILevel,debugui_fps,debugui_unit_titles); //printf("#1 showDebugUILevel = %d, debugui_fps = %d, debugui_unit_titles = %d\n",showDebugUILevel,debugui_fps,debugui_unit_titles);
//if(showDebugUI == false) {
// showDebugUI = true;
//}
if((showDebugUILevel & debugui_fps) != debugui_fps || if((showDebugUILevel & debugui_fps) != debugui_fps ||
(showDebugUILevel & debugui_unit_titles) != debugui_unit_titles) { (showDebugUILevel & debugui_unit_titles) != debugui_unit_titles) {
showDebugUILevel |= debugui_fps; showDebugUILevel |= debugui_fps;

View File

@ -183,6 +183,15 @@ public:
//uint32 m_nVBOIndexes; // Indexes VBO Name //uint32 m_nVBOIndexes; // Indexes VBO Name
}; };
enum ConsoleMode {
consoleOff,
consoleNormal,
consoleFull,
consoleStoredOnly,
consoleStoredAndNormal,
consoleCount
};
class Renderer : public RendererInterface, class Renderer : public RendererInterface,
public BaseRenderer, public BaseRenderer,
@ -496,7 +505,7 @@ public:
void renderBackground(const Texture2D *texture); void renderBackground(const Texture2D *texture);
void renderTextureQuad(int x, int y, int w, int h, const Texture2D *texture, float alpha=1.f,const Vec3f *color=NULL); void renderTextureQuad(int x, int y, int w, int h, const Texture2D *texture, float alpha=1.f,const Vec3f *color=NULL);
void renderConsole(const Console *console, const bool showAll=false, const bool showMenuConsole=false, int overrideMaxConsoleLines=-1); void renderConsole(const Console *console, ConsoleMode mode=consoleNormal, int overrideMaxConsoleLines=-1);
void renderConsoleLine3D(int lineIndex, int xPosition, int yPosition, int lineHeight, Font3D* font, string stringToHightlight, const ConsoleLineInfo *lineInfo); void renderConsoleLine3D(int lineIndex, int xPosition, int yPosition, int lineHeight, Font3D* font, string stringToHightlight, const ConsoleLineInfo *lineInfo);
void renderConsoleLine(int lineIndex, int xPosition, int yPosition, int lineHeight, Font2D* font, string stringToHightlight, const ConsoleLineInfo *lineInfo); void renderConsoleLine(int lineIndex, int xPosition, int yPosition, int lineHeight, Font2D* font, string stringToHightlight, const ConsoleLineInfo *lineInfo);
@ -548,7 +557,8 @@ public:
void renderUnits(bool airUnits, const int renderFps); void renderUnits(bool airUnits, const int renderFps);
void renderUnitsToBuild(const int renderFps); void renderUnitsToBuild(const int renderFps);
void renderSelectionEffects(); void renderSelectionEffects(int healthbarMode);
void renderHealthBars(int healthbarMode);
void renderWaterEffects(); void renderWaterEffects();
void renderHud(); void renderHud();
void renderMinimap(); void renderMinimap();
@ -558,7 +568,7 @@ public:
void renderMenuBackground(Camera *camera, float fade, Model *mainModel, vector<Model *> characterModels,const Vec3f characterPosition, float anim); void renderMenuBackground(Camera *camera, float fade, Model *mainModel, vector<Model *> characterModels,const Vec3f characterPosition, float anim);
//computing //computing
bool computePosition(const Vec2i &screenPos, Vec2i &worldPos,bool exactCoords=false); bool ccomputePosition(const Vec2i &screenPos, Vec2i &worldPos,bool exactCoords=false);
void computeSelected(Selection::UnitContainer &units, const Object *&obj, const bool withObjectSelection, const Vec2i &posDown, const Vec2i &posUp); void computeSelected(Selection::UnitContainer &units, const Object *&obj, const bool withObjectSelection, const Vec2i &posDown, const Vec2i &posUp);
void selectUsingColorPicking(Selection::UnitContainer &units, const Object *&obj,const bool withObjectSelection,const Vec2i &posDown, const Vec2i &posUp); void selectUsingColorPicking(Selection::UnitContainer &units, const Object *&obj,const bool withObjectSelection,const Vec2i &posDown, const Vec2i &posUp);
void selectUsingSelectionBuffer(Selection::UnitContainer &units,const Object *&obj, const bool withObjectSelection,const Vec2i &posDown, const Vec2i &posUp); void selectUsingSelectionBuffer(Selection::UnitContainer &units,const Object *&obj, const bool withObjectSelection,const Vec2i &posDown, const Vec2i &posUp);
@ -680,6 +690,9 @@ private:
//private aux drawing //private aux drawing
void renderSelectionCircle(Vec3f v, int size, float radius, float thickness=0.2f); void renderSelectionCircle(Vec3f v, int size, float radius, float thickness=0.2f);
bool isHealthBarVisible(const Unit *unit,int healthbarMode);
void renderHealthBar(Vec3f v, Unit *unit, float height, bool lineBorder, const Texture2D *texture=NULL, const Texture2D *backgroundTexture=NULL);
void internalRenderHp(int numberOfBars, int barNumber, float hp, Vec3f posVector, float width, float singleHPheight, Vec3f rightVector, Vec3f upVector);
void renderTeamColorEffect(Vec3f &v, int heigth, int size, Vec3f color, const Texture2D *texture); void renderTeamColorEffect(Vec3f &v, int heigth, int size, Vec3f color, const Texture2D *texture);
void renderArrow(const Vec3f &pos1, const Vec3f &pos2, const Vec3f &color, float width); void renderArrow(const Vec3f &pos1, const Vec3f &pos2, const Vec3f &color, float width);
void renderTile(const Vec2i &pos); void renderTile(const Vec2i &pos);
@ -695,9 +708,8 @@ private:
void render3dSetup(); void render3dSetup();
void render3dMenuSetup(const MainMenu *mm); void render3dMenuSetup(const MainMenu *mm);
bool renderResourcesInTeamMode();
int renderResource(const Faction *factionForResourceView, int renderResource(const Faction *factionForResourceView,
bool localFactionResourcesOnly, const ResourceType *rt, bool localFactionResourcesOnly,bool twoResourceLines, const ResourceType *rt,
int startRow, int &resourceCountRendered); int startRow, int &resourceCountRendered);
}; };

View File

@ -218,6 +218,7 @@ const void UnitParticleSystemType::setValues(UnitParticleSystem *ups){
for(Children::iterator i=children.begin(); i!=children.end(); ++i){ for(Children::iterator i=children.begin(); i!=children.end(); ++i){
UnitParticleSystem *child = new UnitParticleSystem(); UnitParticleSystem *child = new UnitParticleSystem();
child->setParticleOwner(ups->getParticleOwner()); child->setParticleOwner(ups->getParticleOwner());
child->setParticleType((*i));
(*i)->setValues(child); (*i)->setValues(child);
ups->addChild(child); ups->addChild(child);
} }
@ -233,6 +234,8 @@ const void UnitParticleSystemType::setValues(UnitParticleSystem *ups){
ups->setColor(color); ups->setColor(color);
ups->setColorNoEnergy(colorNoEnergy); ups->setColorNoEnergy(colorNoEnergy);
ups->setSpeed(speed); ups->setSpeed(speed);
ups->setSpeedUpRelative(speedUpRelative);
ups->setSpeedUpConstant(speedUpConstant);
ups->setGravity(gravity); ups->setGravity(gravity);
ups->setParticleSize(size); ups->setParticleSize(size);
ups->setSizeNoEnergy(sizeNoEnergy); ups->setSizeNoEnergy(sizeNoEnergy);

View File

@ -49,7 +49,7 @@ void Display::calculateUpDimensions(int index) {
maxUpIndex=index; maxUpIndex=index;
if(maxUpIndex+1>upCellSideCount*upCellSideCount){ if(maxUpIndex+1>upCellSideCount*upCellSideCount){
upCellSideCount=upCellSideCount+1; upCellSideCount=upCellSideCount+1;
upImageSize=imageSize*cellSideCount/upCellSideCount+0.9f; upImageSize = static_cast<float>(imageSize) * static_cast<float>(cellSideCount) / static_cast<float>(upCellSideCount) + 0.9f;
} }
} }
} }

View File

@ -256,8 +256,8 @@ void Gui::mouseMoveOutsideDisplay() {
void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) { void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
if(selectingPos) { if(selectingPos) {
//give standard orders //give standard orders
Vec2i targetPos; Vec2i targetPos=game->getMouseCellPos();
if(Renderer::getInstance().computePosition(Vec2i(x, y), targetPos) && if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
giveTwoClickOrders(x, y, prepared); giveTwoClickOrders(x, y, prepared);
} }
@ -266,8 +266,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
//set meeting point //set meeting point
else if(selectingMeetingPoint) { else if(selectingMeetingPoint) {
if(selection.isCommandable()) { if(selection.isCommandable()) {
Vec2i targetPos; Vec2i targetPos=game->getMouseCellPos();
if(Renderer::getInstance().computePosition(Vec2i(x, y), targetPos) && if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos); commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos);
} }
@ -287,15 +287,15 @@ void Gui::mouseDownRightGraphics(int x, int y , bool prepared) {
} }
else if(selection.isCommandable()) { else if(selection.isCommandable()) {
if(prepared) { if(prepared) {
Vec2i targetPos; Vec2i targetPos=game->getMouseCellPos();
if(Renderer::getInstance().computePosition(Vec2i(x, y), targetPos) && if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
givePreparedDefaultOrders(x, y); givePreparedDefaultOrders(x, y);
} }
} }
else { else {
Vec2i targetPos; Vec2i targetPos=game->getMouseCellPos();
if(Renderer::getInstance().computePosition(Vec2i(x, y), targetPos) && if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
giveDefaultOrders(x, y); giveDefaultOrders(x, y);
} }
@ -314,7 +314,7 @@ void Gui::mouseUpLeftGraphics(int x, int y) {
if(selection.isCommandable() && random.randRange(0, 1)==0){ if(selection.isCommandable() && random.randRange(0, 1)==0){
SoundRenderer::getInstance().playFx( SoundRenderer::getInstance().playFx(
selection.getFrontUnit()->getType()->getSelectionSound(), selection.getFrontUnit()->getType()->getSelectionSound(),
selection.getFrontUnit()->getCurrVector(), selection.getFrontUnit()->getCurrMidHeightVector(),
gameCamera->getPos()); gameCamera->getPos());
} }
selectionQuad.disable(); selectionQuad.disable();
@ -331,7 +331,8 @@ void Gui::mouseMoveGraphics(int x, int y) {
//compute position for building //compute position for building
if(isPlacingBuilding()){ if(isPlacingBuilding()){
validPosObjWorld= Renderer::getInstance().computePosition(Vec2i(x,y), posObjWorld); posObjWorld=game->getMouseCellPos();
validPosObjWorld= game->isValidMouseCellPos();
} }
display.setInfoText(""); display.setInfoText("");
@ -488,7 +489,7 @@ void Gui::giveDefaultOrders(int x, int y,const Unit *targetUnit, bool paintMouse
if(random.randRange(0, 1)==0){ if(random.randRange(0, 1)==0){
SoundRenderer::getInstance().playFx( SoundRenderer::getInstance().playFx(
selection.getFrontUnit()->getType()->getCommandSound(), selection.getFrontUnit()->getType()->getCommandSound(),
selection.getFrontUnit()->getCurrVector(), selection.getFrontUnit()->getCurrMidHeightVector(),
gameCamera->getPos()); gameCamera->getPos());
} }
} }
@ -543,7 +544,7 @@ void Gui::giveTwoClickOrders(int x, int y , bool prepared) {
if(random.randRange(0, 1) == 0) { if(random.randRange(0, 1) == 0) {
SoundRenderer::getInstance().playFx( SoundRenderer::getInstance().playFx(
selection.getFrontUnit()->getType()->getCommandSound(), selection.getFrontUnit()->getType()->getCommandSound(),
selection.getFrontUnit()->getCurrVector(), selection.getFrontUnit()->getCurrMidHeightVector(),
gameCamera->getPos()); gameCamera->getPos());
} }
} }
@ -768,6 +769,7 @@ void Gui::computeInfoString(int posDisplay){
display.setInfoText(ct->getDesc(unit->getTotalUpgrade(),game->showTranslatedTechTree())); display.setInfoText(ct->getDesc(unit->getTotalUpgrade(),game->showTranslatedTechTree()));
} }
else{ else{
display.setInfoText(ct->getReqDesc(game->showTranslatedTechTree()));
if(ct->getClass()==ccUpgrade){ if(ct->getClass()==ccUpgrade){
string text=""; string text="";
const UpgradeCommandType *uct= static_cast<const UpgradeCommandType*>(ct); const UpgradeCommandType *uct= static_cast<const UpgradeCommandType*>(ct);
@ -779,8 +781,19 @@ void Gui::computeInfoString(int posDisplay){
} }
display.setInfoText(text+ct->getReqDesc(game->showTranslatedTechTree())); display.setInfoText(text+ct->getReqDesc(game->showTranslatedTechTree()));
} }
else{ //locked by scenario
display.setInfoText(ct->getReqDesc(game->showTranslatedTechTree())); else if(ct->getClass()==ccProduce){
string text="";
const ProduceCommandType *pct= static_cast<const ProduceCommandType*>(ct);
if(unit->getFaction()->isUnitLocked(pct->getProducedUnit())){
display.setInfoText(lang.getString("LockedByScenario")+"\n\n"+ct->getReqDesc(game->showTranslatedTechTree()));
}
}
else if(ct->getClass()==ccMorph){
const MorphCommandType *mct= static_cast<const MorphCommandType*>(ct);
if(unit->getFaction()->isUnitLocked(mct->getMorphUnit())){
display.setInfoText(lang.getString("LockedByScenario")+"\n\n"+ct->getReqDesc(game->showTranslatedTechTree()));
}
} }
} }
} }
@ -802,13 +815,19 @@ void Gui::computeInfoString(int posDisplay){
} }
else{ else{
if(activeCommandType!=NULL && activeCommandType->getClass()==ccBuild){ if(activeCommandType!=NULL && activeCommandType->getClass()==ccBuild){
//locked by scenario
const BuildCommandType *bct= static_cast<const BuildCommandType*>(activeCommandType); const BuildCommandType *bct= static_cast<const BuildCommandType*>(activeCommandType);
const Unit *unit= selection.getFrontUnit();
if(unit->getFaction()->isUnitLocked(bct->getBuilding(posDisplay))){
display.setInfoText(lang.getString("LockedByScenario")+"\n\n"+bct->getBuilding(posDisplay)->getReqDesc(game->showTranslatedTechTree()));
} else {
display.setInfoText(bct->getBuilding(posDisplay)->getReqDesc(game->showTranslatedTechTree())); display.setInfoText(bct->getBuilding(posDisplay)->getReqDesc(game->showTranslatedTechTree()));
} }
} }
} }
} }
} }
}
void Gui::computeDisplay(){ void Gui::computeDisplay(){
@ -1142,8 +1161,7 @@ bool Gui::computeTarget(const Vec2i &screenPos, Vec2i &targetPos, const Unit *&t
if(selObj != NULL) { if(selObj != NULL) {
selObj->resetHighlight(); selObj->resetHighlight();
// get real click pos // get real click pos
renderer.computePosition(screenPos, targetPos); targetPos=game->getMouseCellPos();
//validPosObjWorld= true; //validPosObjWorld= true;
//posObjWorld = targetPos; //posObjWorld = targetPos;
@ -1234,7 +1252,8 @@ bool Gui::computeTarget(const Vec2i &screenPos, Vec2i &targetPos, const Unit *&t
} }
else{ else{
targetUnit= NULL; targetUnit= NULL;
if(renderer.computePosition(screenPos, targetPos)){ targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos()){
validPosObjWorld= true; validPosObjWorld= true;
posObjWorld= targetPos; posObjWorld= targetPos;

View File

@ -71,6 +71,11 @@ bool Selection::select(Unit *unit) {
return false; return false;
} }
//check if commandable
if(unit->getType()->isCommandable() == false && isEmpty() == false) {
return false;
}
//check if multisel //check if multisel
if(unit->getType()->getMultiSelect() == false && isEmpty() == false) { if(unit->getType()->getMultiSelect() == false && isEmpty() == false) {
return false; return false;
@ -181,7 +186,8 @@ bool Selection::isCommandable() const {
return return
isEmpty() == false && isEmpty() == false &&
isEnemy() == false && isEnemy() == false &&
(selectedUnits.size() == 1 && selectedUnits.front()->isAlive() == false) == false; (selectedUnits.size() == 1 && selectedUnits.front()->isAlive() == false) == false &&
selectedUnits.front()->getType()->isCommandable();
} }
bool Selection::isCancelable() const { bool Selection::isCancelable() const {
@ -198,7 +204,7 @@ bool Selection::isMeetable() const{
} }
Vec3f Selection::getRefPos() const{ Vec3f Selection::getRefPos() const{
return getFrontUnit()->getCurrVector(); return getFrontUnit()->getCurrMidHeightVector();
} }
bool Selection::hasUnit(const Unit* unit) const { bool Selection::hasUnit(const Unit* unit) const {

View File

@ -101,6 +101,14 @@ using namespace Shared::Graphics::Gl;
using namespace Shared::Xml; using namespace Shared::Xml;
using namespace Shared; using namespace Shared;
/**
* @namespace Glest
* Namespace used for all %Glest related code.
*/
/**
* @namespace Game
* Namespace used for game related code.
*/
namespace Glest { namespace Game { namespace Glest { namespace Game {
static string tempDataLocation = getUserHome(); static string tempDataLocation = getUserHome();
@ -1139,6 +1147,7 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
Renderer &renderer= Renderer::getInstance(); Renderer &renderer= Renderer::getInstance();
if(keystate.mod & (KMOD_LALT | KMOD_RALT)) { if(keystate.mod & (KMOD_LALT | KMOD_RALT)) {
renderer.cycleShowDebugUILevel(); renderer.cycleShowDebugUILevel();
printf("**Cycled Debug UI level to: %d\n",renderer.getShowDebugUILevel());
} }
else { else {
bool showDebugUI = renderer.getShowDebugUI(); bool showDebugUI = renderer.getShowDebugUI();
@ -3503,7 +3512,7 @@ int handleCreateDataArchivesCommand(int argc, char** argv) {
printf("Compress item [%s] is not valid!\n",compress_item.c_str()); printf("Compress item [%s] is not valid!\n",compress_item.c_str());
return_value = 1; return_value = 1;
} }
else
return_value = 0; return_value = 0;
} }
else { else {
@ -4430,6 +4439,10 @@ int glestMain(int argc, char** argv) {
} }
createDirectoryPaths(tempDataPath); createDirectoryPaths(tempDataPath);
string binaryNameOld = Properties::getApplicationPath() + extractFileFromDirectoryPath(PlatformExceptionHandler::application_binary) + "__REMOVE";
if(fileExists(binaryNameOld)) {
removeFile(binaryNameOld);
}
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_USE_PORTS]) == true) { if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_USE_PORTS]) == true) {
int foundParamIndIndex = -1; int foundParamIndIndex = -1;
@ -5051,7 +5064,7 @@ int glestMain(int argc, char** argv) {
gameSettings->setFactionControl(i, ct); gameSettings->setFactionControl(i, ct);
gameSettings->setStartLocationIndex(i, i); gameSettings->setStartLocationIndex(i, i);
gameSettings->setResourceMultiplierIndex(i, 10); gameSettings->setResourceMultiplierIndex(i, 10);
gameSettings->setNetworkPlayerName(i, "Closed"); gameSettings->setNetworkPlayerName(i, GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME);
} }
ControlType ct= ctHuman; ControlType ct= ctHuman;
@ -5351,7 +5364,8 @@ int glestMain(int argc, char** argv) {
bool startCRCPrecacheThread = config.getBool("PreCacheCRCThread","true"); bool startCRCPrecacheThread = config.getBool("PreCacheCRCThread","true");
//printf("### In [%s::%s Line: %d] precache thread enabled = %d SystemFlags::VERBOSE_MODE_ENABLED = %d\n",__FILE__,__FUNCTION__,__LINE__,startCRCPrecacheThread,SystemFlags::VERBOSE_MODE_ENABLED); //printf("### In [%s::%s Line: %d] precache thread enabled = %d SystemFlags::VERBOSE_MODE_ENABLED = %d\n",__FILE__,__FUNCTION__,__LINE__,startCRCPrecacheThread,SystemFlags::VERBOSE_MODE_ENABLED);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] precache thread enabled = %d\n",__FILE__,__FUNCTION__,__LINE__,startCRCPrecacheThread); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] precache thread enabled = %d\n",__FILE__,__FUNCTION__,__LINE__,startCRCPrecacheThread);
if(startCRCPrecacheThread == true) { if (startCRCPrecacheThread == true
&& GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
static string mutexOwnerId = string(extractFileFromDirectoryPath(__FILE__).c_str()) + string("_") + intToStr(__LINE__); static string mutexOwnerId = string(extractFileFromDirectoryPath(__FILE__).c_str()) + string("_") + intToStr(__LINE__);
vector<string> techDataPaths = config.getPathListForType(ptTechs); vector<string> techDataPaths = config.getPathListForType(ptTechs);

View File

@ -44,7 +44,7 @@ static const int MAX_PING_LAG_COUNT = 6;
static const double REPROMPT_DOWNLOAD_SECONDS = 7; static const double REPROMPT_DOWNLOAD_SECONDS = 7;
//static const string ITEM_MISSING = "***missing***"; //static const string ITEM_MISSING = "***missing***";
// above replaced with Lang::getInstance().getString("DataMissing","",true) // above replaced with Lang::getInstance().getString("DataMissing","",true)
const int HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS = 4; const int HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS = 2;
static const char *HEADLESS_SAVED_GAME_FILENAME = "lastHeadlessGameSettings.mgg"; static const char *HEADLESS_SAVED_GAME_FILENAME = "lastHeadlessGameSettings.mgg";
const int mapPreviewTexture_X = 5; const int mapPreviewTexture_X = 5;
@ -71,6 +71,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
switchSetupRequestFlagType |= ssrft_NetworkPlayerName; switchSetupRequestFlagType |= ssrft_NetworkPlayerName;
updateDataSynchDetailText = false; updateDataSynchDetailText = false;
launchingNewGame = false; launchingNewGame = false;
isfirstSwitchingMapMessage = true;
this->zoomedMap = false; this->zoomedMap = false;
this->render_mapPreviewTexture_X = mapPreviewTexture_X; this->render_mapPreviewTexture_X = mapPreviewTexture_X;
@ -81,6 +82,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
needToBroadcastServerSettings=false; needToBroadcastServerSettings=false;
broadcastServerSettingsDelayTimer=0; broadcastServerSettingsDelayTimer=0;
lastGameSettingsReceivedCount=0; lastGameSettingsReceivedCount=0;
noReceiveTimer=time(NULL)-100; // old but inititialized ( must be an "old" time )
soundConnectionCount=0; soundConnectionCount=0;
@ -132,6 +134,9 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
settingsReceivedFromServer=false; settingsReceivedFromServer=false;
initialSettingsReceivedFromServer=false; initialSettingsReceivedFromServer=false;
validOriginalGameSettings=false;
validDisplayedGamesettings=false;
returnMenuInfo=joinMenuInfo; returnMenuInfo=joinMenuInfo;
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
@ -179,6 +184,13 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelInfo.setFont(CoreData::getInstance().getMenuFontBig()); labelInfo.setFont(CoreData::getInstance().getMenuFontBig());
labelInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D()); labelInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelWaitingForPlayers.registerGraphicComponent(containerName,"labelInfo");
labelWaitingForPlayers.init(30, 100);
labelWaitingForPlayers.setText("");
labelWaitingForPlayers.setFont(CoreData::getInstance().getMenuFontBig());
labelWaitingForPlayers.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelWaitingForPlayers.setTextColor(Vec3f(1.0f,1.0f,0.f));
timerLabelFlash = time(NULL); timerLabelFlash = time(NULL);
labelDataSynchInfo.registerGraphicComponent(containerName,"labelDataSynchInfo"); labelDataSynchInfo.registerGraphicComponent(containerName,"labelDataSynchInfo");
labelDataSynchInfo.init(30, networkHeadPos-60); labelDataSynchInfo.init(30, networkHeadPos-60);
@ -193,7 +205,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelFogOfWar.setText(lang.getString("FogOfWar")); labelFogOfWar.setText(lang.getString("FogOfWar"));
listBoxFogOfWar.registerGraphicComponent(containerName,"listBoxFogOfWar"); listBoxFogOfWar.registerGraphicComponent(containerName,"listBoxFogOfWar");
listBoxFogOfWar.init(xoffset+100, aPos, 130); listBoxFogOfWar.init(xoffset+100, aPos, 150);
listBoxFogOfWar.pushBackItem(lang.getString("Enabled")); listBoxFogOfWar.pushBackItem(lang.getString("Enabled"));
listBoxFogOfWar.pushBackItem(lang.getString("Explored")); listBoxFogOfWar.pushBackItem(lang.getString("Explored"));
listBoxFogOfWar.pushBackItem(lang.getString("Disabled")); listBoxFogOfWar.pushBackItem(lang.getString("Disabled"));
@ -273,16 +285,6 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
buttonCancelDownloads.init(xoffset+620, 180, 150); buttonCancelDownloads.init(xoffset+620, 180, 150);
buttonCancelDownloads.setText(lang.getString("CancelDownloads")); buttonCancelDownloads.setText(lang.getString("CancelDownloads"));
listBoxPlayerStatus.registerGraphicComponent(containerName,"listBoxPlayerStatus");
nonAdminPlayerStatusX = xoffset+460;
listBoxPlayerStatus.init(nonAdminPlayerStatusX, 180, 150);
listBoxPlayerStatus.setTextColor(Vec3f(1.0f,0.f,0.f));
listBoxPlayerStatus.setLighted(true);
playerStatuses.push_back(lang.getString("PlayerStatusSetup"));
playerStatuses.push_back(lang.getString("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerStatuses);
// Network Frame Period // Network Frame Period
xoffset=70; xoffset=70;
//map listBox //map listBox
@ -362,6 +364,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
listBoxTeams[i].registerGraphicComponent(containerName,"listBoxTeams" + intToStr(i)); listBoxTeams[i].registerGraphicComponent(containerName,"listBoxTeams" + intToStr(i));
listBoxTeams[i].init(xoffset+650, setupPos-30-i*rowHeight, 60); listBoxTeams[i].init(xoffset+650, setupPos-30-i*rowHeight, 60);
listBoxTeams[i].setEditable(false); listBoxTeams[i].setEditable(false);
listBoxTeams[i].setLighted(true);
labelNetStatus[i].registerGraphicComponent(containerName,"labelNetStatus" + intToStr(i)); labelNetStatus[i].registerGraphicComponent(containerName,"labelNetStatus" + intToStr(i));
labelNetStatus[i].init(xoffset+715, setupPos-30-i*rowHeight, 60); labelNetStatus[i].init(xoffset+715, setupPos-30-i*rowHeight, 60);
@ -453,17 +456,33 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
setupMapList(""); setupMapList("");
listBoxMap.setItems(formattedPlayerSortedMaps[0]); listBoxMap.setItems(formattedPlayerSortedMaps[0]);
int buttonx=170;
int buttony=180;
listBoxPlayerStatus.registerGraphicComponent(containerName,"listBoxPlayerStatus");
listBoxPlayerStatus.init(buttonx, buttony, 150);
listBoxPlayerStatus.setTextColor(Vec3f(1.0f,0.f,0.f));
listBoxPlayerStatus.setLighted(true);
playerStatuses.push_back(lang.getString("PlayerStatusSetup"));
playerStatuses.push_back(lang.getString("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerStatuses);
buttonx+=180;
buttonDisconnect.registerGraphicComponent(containerName,"buttonDisconnect");
buttonDisconnect.init(buttonx, buttony, 125);
buttonx+=130;
buttonRestoreLastSettings.registerGraphicComponent(containerName,"buttonRestoreLastSettings");
buttonRestoreLastSettings.init(buttonx, buttony, 220);
buttonRestoreLastSettings.setText(lang.getString("ReloadLastGameSettings"));
buttonx+=225;
buttonPlayNow.registerGraphicComponent(containerName,"buttonPlayNow"); buttonPlayNow.registerGraphicComponent(containerName,"buttonPlayNow");
buttonPlayNow.init(220, 180, 125); buttonPlayNow.init(buttonx, buttony, 125);
buttonPlayNow.setText(lang.getString("PlayNow")); buttonPlayNow.setText(lang.getString("PlayNow"));
buttonPlayNow.setVisible(false); buttonPlayNow.setVisible(false);
buttonDisconnect.registerGraphicComponent(containerName,"buttonDisconnect");
buttonDisconnect.init(350, 180, 125);
buttonRestoreLastSettings.registerGraphicComponent(containerName,"buttonRestoreLastSettings");
buttonRestoreLastSettings.init(480, 180, 220);
buttonRestoreLastSettings.setText(lang.getString("ReloadLastGameSettings"));
// write hint to console: // write hint to console:
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys)); Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
@ -641,6 +660,9 @@ void MenuStateConnectedGame::reloadUI() {
labelInfo.setFont(CoreData::getInstance().getMenuFontBig()); labelInfo.setFont(CoreData::getInstance().getMenuFontBig());
labelInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D()); labelInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelWaitingForPlayers.setFont(CoreData::getInstance().getMenuFontBig());
labelWaitingForPlayers.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelDataSynchInfo.setFont(CoreData::getInstance().getMenuFontBig()); labelDataSynchInfo.setFont(CoreData::getInstance().getMenuFontBig());
labelDataSynchInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D()); labelDataSynchInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -1531,6 +1553,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
switchSetupRequestFlagType, switchSetupRequestFlagType,
lang.getLanguage()); lang.getLanguage());
switchSetupRequestFlagType= ssrft_None; switchSetupRequestFlagType= ssrft_None;
noReceiveTimer=time(NULL);
} }
break; break;
} }
@ -1571,7 +1594,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
} }
if(canGrabSlot == true) { if(canGrabSlot == true) {
if(i < mapInfo.players && grabSlotButton[i].mouseClick(x, y)) { if(clientInterface != NULL && i < mapInfo.players && grabSlotButton[i].mouseClick(x, y)) {
//printf("Send slot switch request for slot = %d, myCurrentIndex = %d\n",i,myCurrentIndex); //printf("Send slot switch request for slot = %d, myCurrentIndex = %d\n",i,myCurrentIndex);
soundRenderer.playFx(coreData.getClickSoundB()); soundRenderer.playFx(coreData.getClickSoundB());
@ -1608,7 +1631,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
} }
if(labelPlayerNames[i].mouseClick(x, y) && (activeInputLabel != &labelPlayerNames[i])){ if(labelPlayerNames[i].mouseClick(x, y) && (activeInputLabel != &labelPlayerNames[i])){
if(i == clientInterface->getPlayerIndex()){ if(clientInterface != NULL && i == clientInterface->getPlayerIndex()){
setActiveInputLabel(&labelPlayerNames[i]); setActiveInputLabel(&labelPlayerNames[i]);
} }
} }
@ -1724,14 +1747,17 @@ void MenuStateConnectedGame::broadCastGameSettingsToHeadlessServer(bool forceNow
} }
} }
GameSettings gameSettings = *clientInterface->getGameSettings(); if(validDisplayedGamesettings){
loadGameSettings(&gameSettings); loadGameSettings(&displayedGamesettings);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("broadcast settings:\n%s\n",gameSettings.toString().c_str());
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("broadcast settings:\n%s\n",displayedGamesettings.toString().c_str());
//printf("Client sending map [%s] admin key [%d]\n",gameSettings.getMap().c_str(),gameSettings.getMasterserver_admin()); //printf("Client sending map [%s] admin key [%d]\n",gameSettings.getMap().c_str(),gameSettings.getMasterserver_admin());
clientInterface->broadcastGameSetup(&gameSettings); clientInterface->broadcastGameSetup(&displayedGamesettings);
noReceiveTimer=time(NULL);
}
} }
} }
@ -2287,7 +2313,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]); gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]);
gameSettings->setNetworkPlayerStatuses(slotIndex, npst_None); gameSettings->setNetworkPlayerStatuses(slotIndex, npst_None);
gameSettings->setNetworkPlayerName(slotIndex, "Closed"); gameSettings->setNetworkPlayerName(slotIndex, GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME);
closedCount++; closedCount++;
} }
@ -2475,14 +2501,6 @@ void MenuStateConnectedGame::render() {
try { try {
Renderer &renderer= Renderer::getInstance(); Renderer &renderer= Renderer::getInstance();
if(isHeadlessAdmin() == true) {
listBoxPlayerStatus.setX(buttonRestoreLastSettings.getX() +
buttonRestoreLastSettings.getW() + 20);
}
else {
listBoxPlayerStatus.setX(nonAdminPlayerStatusX);
}
if(mainMessageBox.getEnabled()) { if(mainMessageBox.getEnabled()) {
renderer.renderMessageBox(&mainMessageBox); renderer.renderMessageBox(&mainMessageBox);
} }
@ -2510,10 +2528,8 @@ void MenuStateConnectedGame::render() {
delete factionVideo; delete factionVideo;
factionVideo = NULL; factionVideo = NULL;
NetworkManager &networkManager= NetworkManager::getInstance(); if(validDisplayedGamesettings) {
ClientInterface* clientInterface= networkManager.getClientInterface(); initFactionPreview(&displayedGamesettings);
if(clientInterface != NULL) {
initFactionPreview(clientInterface->getGameSettings());
} }
} }
} }
@ -2575,15 +2591,18 @@ void MenuStateConnectedGame::render() {
ClientInterface *clientInterface = networkManager.getClientInterface(); ClientInterface *clientInterface = networkManager.getClientInterface();
for(int i = 0; i < GameConstants::maxPlayers; ++i) { for(int i = 0; i < GameConstants::maxPlayers; ++i) {
if(listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) { if(listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) {
bool renderIt=true;
//printf("Player #%d [%s] control = %d\n",i,labelPlayerNames[i].getText().c_str(),listBoxControls[i].getSelectedItemIndex()); //printf("Player #%d [%s] control = %d\n",i,labelPlayerNames[i].getText().c_str(),listBoxControls[i].getSelectedItemIndex());
if(labelNetStatus[i].getText() == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME){
labelPlayers[i].setVisible(true); renderIt=false;
labelPlayerNames[i].setVisible(true); }
listBoxControls[i].setVisible(true); labelPlayers[i].setVisible(renderIt);
listBoxRMultiplier[i].setVisible(true); labelPlayerNames[i].setVisible(renderIt);
listBoxFactions[i].setVisible(true); listBoxControls[i].setVisible(renderIt);
listBoxTeams[i].setVisible(true); listBoxRMultiplier[i].setVisible(renderIt);
labelNetStatus[i].setVisible(true); listBoxFactions[i].setVisible(renderIt);
listBoxTeams[i].setVisible(renderIt);
labelNetStatus[i].setVisible(renderIt);
} }
if(listBoxControls[i].getSelectedItemIndex() != ctClosed) { if(listBoxControls[i].getSelectedItemIndex() != ctClosed) {
@ -2631,6 +2650,12 @@ void MenuStateConnectedGame::render() {
if(listBoxControls[i].getSelectedItemIndex() != ctClosed) { if(listBoxControls[i].getSelectedItemIndex() != ctClosed) {
renderer.renderListBox(&listBoxRMultiplier[i]); renderer.renderListBox(&listBoxRMultiplier[i]);
renderer.renderListBox(&listBoxFactions[i]); renderer.renderListBox(&listBoxFactions[i]);
int teamnumber=listBoxTeams[i].getSelectedItemIndex();
Vec3f teamcolor=Vec3f(1.0f,1.0f,1.0f);
if(teamnumber>=0 && teamnumber<8){
teamcolor=crcPlayerTextureCache[teamnumber]->getPixmap()->getPixel3f(0, 0);
}
listBoxTeams[i].setTextColor(teamcolor);
renderer.renderListBox(&listBoxTeams[i]); renderer.renderListBox(&listBoxTeams[i]);
bool canGrabSlot = false; bool canGrabSlot = false;
@ -2672,9 +2697,11 @@ void MenuStateConnectedGame::render() {
if(difftime((long int)time(NULL),timerLabelFlash) < 1) { if(difftime((long int)time(NULL),timerLabelFlash) < 1) {
renderer.renderLabel(&labelDataSynchInfo,&RED); renderer.renderLabel(&labelDataSynchInfo,&RED);
renderer.renderLabel(&labelWaitingForPlayers,&YELLOW);
} }
else { else {
renderer.renderLabel(&labelDataSynchInfo,&WHITE); renderer.renderLabel(&labelDataSynchInfo,&WHITE);
renderer.renderLabel(&labelWaitingForPlayers,&WHITE);
} }
renderer.renderLabel(&labelMap); renderer.renderLabel(&labelMap);
@ -2792,7 +2819,7 @@ void MenuStateConnectedGame::render() {
} }
} }
renderer.renderChatManager(&chatManager); renderer.renderChatManager(&chatManager);
renderer.renderConsole(&console,showFullConsole,true); renderer.renderConsole(&console,showFullConsole?consoleFull:consoleStoredAndNormal);
if(difftime((long int)time(NULL),timerLabelFlash) > 2) { if(difftime((long int)time(NULL),timerLabelFlash) > 2) {
timerLabelFlash = time(NULL); timerLabelFlash = time(NULL);
@ -2827,6 +2854,21 @@ void MenuStateConnectedGame::update() {
//printf("#2 admin key [%d] client key [%d]\n",settings->getMasterserver_admin(),clientInterface->getSessionKey()); //printf("#2 admin key [%d] client key [%d]\n",settings->getMasterserver_admin(),clientInterface->getSessionKey());
broadCastGameSettingsToHeadlessServer(false); broadCastGameSettingsToHeadlessServer(false);
bool notCurrentlySwitching=(( difftime((long int) time(NULL), broadcastServerSettingsDelayTimer)) >= HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS );
bool receiveAllowedNow=difftime((long int) time(NULL), noReceiveTimer) > 2 ;
bool newMessage= lastGameSettingsReceivedCount < clientInterface->getGameSettingsReceivedCount();
if (validDisplayedGamesettings == false
|| ( notCurrentlySwitching
&& newMessage
&& receiveAllowedNow )) {
//printf("I take the whole settings top broadcastDelay=%d noReceiveTimer=%d\n", (int)difftime((long int) time(NULL), broadcastServerSettingsDelayTimer),(int)difftime((long int) time(NULL), noReceiveTimer));
displayedGamesettings = *(clientInterface->getGameSettings());
originalGamesettings = displayedGamesettings;
validDisplayedGamesettings = true;
}
checkBoxAllowNativeLanguageTechtree.setEditable(isHeadlessAdmin()); checkBoxAllowNativeLanguageTechtree.setEditable(isHeadlessAdmin());
checkBoxAllowNativeLanguageTechtree.setEnabled(isHeadlessAdmin()); checkBoxAllowNativeLanguageTechtree.setEnabled(isHeadlessAdmin());
@ -2845,13 +2887,46 @@ void MenuStateConnectedGame::update() {
checkBoxAllowTeamUnitSharing.setEditable(isHeadlessAdmin()); checkBoxAllowTeamUnitSharing.setEditable(isHeadlessAdmin());
checkBoxAllowTeamResourceSharing.setEditable(isHeadlessAdmin()); checkBoxAllowTeamResourceSharing.setEditable(isHeadlessAdmin());
if(isHeadlessAdmin() == true) { if(isHeadlessAdmin() == true) {
bool hasOtherPlayer=false;
bool hasOpenSlot=false;
for(unsigned int i = 0; i < (unsigned int)GameConstants::maxPlayers; ++i) { for(unsigned int i = 0; i < (unsigned int)GameConstants::maxPlayers; ++i) {
listBoxControls[i].setEditable(isHeadlessAdmin()); if(displayedGamesettings.getFactionControl(i)==ctNetwork && clientInterface->getPlayerIndex()!=(int)i){
hasOpenSlot=true;
}
if(displayedGamesettings.getFactionControl(i)==ctNetwork &&
displayedGamesettings.getNetworkPlayerNameByPlayerIndex(i)!= GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME &&
displayedGamesettings.getNetworkPlayerNameByPlayerIndex(i)!= GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME ){
listBoxControls[i].setEditable(false);
if(clientInterface->getPlayerIndex()!=(int)i){
hasOtherPlayer=true;
}
}
else if(clientInterface->getPlayerIndex()==(int)i){
listBoxControls[i].setEditable(false);
}
else {
listBoxControls[i].setEditable(true);
}
listBoxRMultiplier[i].setEditable(isHeadlessAdmin()); listBoxRMultiplier[i].setEditable(isHeadlessAdmin());
listBoxFactions[i].setEditable(isHeadlessAdmin()); listBoxFactions[i].setEditable(isHeadlessAdmin());
listBoxTeams[i].setEditable(isHeadlessAdmin()); listBoxTeams[i].setEditable(isHeadlessAdmin());
} }
if (hasOtherPlayer) {
labelWaitingForPlayers.setText("");
labelWaitingForPlayers.setVisible(false);
} else if (hasOpenSlot) {
labelWaitingForPlayers.setText(lang.getString("WaitingForPlayers"));
labelWaitingForPlayers.setVisible(true);
} else {
labelWaitingForPlayers.setText(lang.getString("OpenANetworkSLot"));
labelWaitingForPlayers.setVisible(true);
}
}
else {
labelWaitingForPlayers.setText("");
labelWaitingForPlayers.setVisible(false);
} }
if(difftime((long int)time(NULL),lastNetworkSendPing) >= GameConstants::networkPingInterval) { if(difftime((long int)time(NULL),lastNetworkSendPing) >= GameConstants::networkPingInterval) {
@ -2874,7 +2949,7 @@ void MenuStateConnectedGame::update() {
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
if(fileFTPProgressList.empty() == true) { if(fileFTPProgressList.empty() == true) {
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
const vector<string> languageList = clientInterface->getGameSettings()->getUniqueNetworkPlayerLanguages(); const vector<string> languageList = displayedGamesettings.getUniqueNetworkPlayerLanguages();
for(unsigned int i = 0; i < languageList.size(); ++i) { for(unsigned int i = 0; i < languageList.size(); ++i) {
clientInterface->sendTextMessage(lang.getString("ConnectionTimedOut",languageList[i]) + " : " + doubleToStr(clientInterface->getLastPingLag(),2),-1,false,languageList[i]); clientInterface->sendTextMessage(lang.getString("ConnectionTimedOut",languageList[i]) + " : " + doubleToStr(clientInterface->getLastPingLag(),2),-1,false,languageList[i]);
sleep(1); sleep(1);
@ -2887,13 +2962,6 @@ void MenuStateConnectedGame::update() {
pingCount++; pingCount++;
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
} }
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
//update status label
if(clientInterface != NULL && clientInterface->isConnected()) {
buttonDisconnect.setText(lang.getString("Disconnect")); buttonDisconnect.setText(lang.getString("Disconnect"));
if(clientInterface->getAllowDownloadDataSynch() == false) { if(clientInterface->getAllowDownloadDataSynch() == false) {
@ -2905,64 +2973,63 @@ void MenuStateConnectedGame::update() {
label = label + ", " + clientInterface->getVersionString(); label = label + ", " + clientInterface->getVersionString();
const GameSettings *gameSettings = clientInterface->getGameSettings();
if(clientInterface->getAllowGameDataSynchCheck() == false && if(clientInterface->getAllowGameDataSynchCheck() == false &&
gameSettings->getTileset() != "" && displayedGamesettings.getTileset() != "" &&
gameSettings->getTech() != "" && displayedGamesettings.getTech() != "" &&
gameSettings->getMap() != "") { displayedGamesettings.getMap() != "") {
Config &config = Config::getInstance(); Config &config = Config::getInstance();
MutexSafeWrapper safeMutexFTPProgress(ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL,string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexFTPProgress(ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL,string(__FILE__) + "_" + intToStr(__LINE__));
uint32 tilesetCRC = lastCheckedCRCTilesetValue; uint32 tilesetCRC = lastCheckedCRCTilesetValue;
if(lastCheckedCRCTilesetName != gameSettings->getTileset() && if(lastCheckedCRCTilesetName != displayedGamesettings.getTileset() &&
gameSettings->getTileset() != "") { displayedGamesettings.getTileset() != "") {
//console.addLine("Checking tileset CRC [" + gameSettings->getTileset() + "]"); //console.addLine("Checking tileset CRC [" + displayedGamesettings.getTileset() + "]");
tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + gameSettings->getTileset() + string("/*"), ".xml", NULL); tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + displayedGamesettings.getTileset() + string("/*"), ".xml", NULL);
if(tilesetCRC == 0 || tilesetCRC != gameSettings->getTilesetCRC()) { if(tilesetCRC == 0 || tilesetCRC != displayedGamesettings.getTilesetCRC()) {
tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + gameSettings->getTileset() + string("/*"), ".xml", NULL, true); tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + displayedGamesettings.getTileset() + string("/*"), ".xml", NULL, true);
} }
// Test data synch // Test data synch
//tilesetCRC++; //tilesetCRC++;
lastCheckedCRCTilesetValue = tilesetCRC; lastCheckedCRCTilesetValue = tilesetCRC;
lastCheckedCRCTilesetName = gameSettings->getTileset(); lastCheckedCRCTilesetName = displayedGamesettings.getTileset();
} }
uint32 techCRC = lastCheckedCRCTechtreeValue; uint32 techCRC = lastCheckedCRCTechtreeValue;
if(lastCheckedCRCTechtreeName != gameSettings->getTech() && if(lastCheckedCRCTechtreeName != displayedGamesettings.getTech() &&
gameSettings->getTech() != "") { displayedGamesettings.getTech() != "") {
//console.addLine("Checking techtree CRC [" + gameSettings->getTech() + "]"); //console.addLine("Checking techtree CRC [" + displayedGamesettings.getTech() + "]");
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml", NULL); techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + displayedGamesettings.getTech() + string("/*"), ".xml", NULL);
//clientInterface->sendTextMessage("#1 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(gameSettings->getTechCRC()),-1, true, ""); //clientInterface->sendTextMessage("#1 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(displayedGamesettings.getTechCRC()),-1, true, "");
if(techCRC == 0 || techCRC != gameSettings->getTechCRC()) { if(techCRC == 0 || techCRC != displayedGamesettings.getTechCRC()) {
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml", NULL, true); techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + displayedGamesettings.getTech() + string("/*"), ".xml", NULL, true);
//clientInterface->sendTextMessage("#2 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(gameSettings->getTechCRC()),-1, true, ""); //clientInterface->sendTextMessage("#2 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(displayedGamesettings.getTechCRC()),-1, true, "");
} }
if(techCRC != 0 && techCRC != gameSettings->getTechCRC() && if(techCRC != 0 && techCRC != displayedGamesettings.getTechCRC() &&
listBoxTechTree.getSelectedItemIndex() >= 0 && listBoxTechTree.getSelectedItemIndex() >= 0 &&
listBoxTechTree.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) { listBoxTechTree.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
//time_t now = time(NULL); //time_t now = time(NULL);
time_t lastUpdateDate = getFolderTreeContentsCheckSumRecursivelyLastGenerated(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml"); time_t lastUpdateDate = getFolderTreeContentsCheckSumRecursivelyLastGenerated(config.getPathListForType(ptTechs,""), string("/") + displayedGamesettings.getTech() + string("/*"), ".xml");
const time_t REFRESH_CRC_DAY_SECONDS = 60 * 60 * 1; const time_t REFRESH_CRC_DAY_SECONDS = 60 * 60 * 1;
if( lastUpdateDate <= 0 || if( lastUpdateDate <= 0 ||
difftime((long int)time(NULL),lastUpdateDate) >= REFRESH_CRC_DAY_SECONDS) { difftime((long int)time(NULL),lastUpdateDate) >= REFRESH_CRC_DAY_SECONDS) {
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml", NULL, true); techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + displayedGamesettings.getTech() + string("/*"), ".xml", NULL, true);
//clientInterface->sendTextMessage("#3 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(gameSettings->getTechCRC()),-1, true, ""); //clientInterface->sendTextMessage("#3 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(displayedGamesettings.getTechCRC()),-1, true, "");
} }
} }
// Test data synch // Test data synch
//techCRC++; //techCRC++;
lastCheckedCRCTechtreeValue = techCRC; lastCheckedCRCTechtreeValue = techCRC;
lastCheckedCRCTechtreeName = gameSettings->getTech(); lastCheckedCRCTechtreeName = displayedGamesettings.getTech();
loadFactions(gameSettings,false); loadFactions(&displayedGamesettings,false);
factionCRCList.clear(); factionCRCList.clear();
for(unsigned int factionIdx = 0; factionIdx < factionFiles.size(); ++factionIdx) { for(unsigned int factionIdx = 0; factionIdx < factionFiles.size(); ++factionIdx) {
string factionName = factionFiles[factionIdx]; string factionName = factionFiles[factionIdx];
@ -2972,28 +3039,28 @@ void MenuStateConnectedGame::update() {
uint32 factionCRC = 0; uint32 factionCRC = 0;
//time_t now = time(NULL); //time_t now = time(NULL);
time_t lastUpdateDate = getFolderTreeContentsCheckSumRecursivelyLastGenerated(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml"); time_t lastUpdateDate = getFolderTreeContentsCheckSumRecursivelyLastGenerated(config.getPathListForType(ptTechs,""), "/" + displayedGamesettings.getTech() + "/factions/" + factionName + "/*", ".xml");
const time_t REFRESH_CRC_DAY_SECONDS = 60 * 60 * 24; const time_t REFRESH_CRC_DAY_SECONDS = 60 * 60 * 24;
if( lastUpdateDate <= 0 || if( lastUpdateDate <= 0 ||
difftime((long int)time(NULL),lastUpdateDate) >= REFRESH_CRC_DAY_SECONDS || difftime((long int)time(NULL),lastUpdateDate) >= REFRESH_CRC_DAY_SECONDS ||
(techCRC != 0 && techCRC != gameSettings->getTechCRC())) { (techCRC != 0 && techCRC != displayedGamesettings.getTechCRC())) {
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true); factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + displayedGamesettings.getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
} }
else { else {
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL); factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + displayedGamesettings.getTech() + "/factions/" + factionName + "/*", ".xml", NULL);
} }
if(factionCRC == 0) { if(factionCRC == 0) {
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true); factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + displayedGamesettings.getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
} }
if(factionCRC != 0) { if(factionCRC != 0) {
vector<pair<string,uint32> > serverFactionCRCList = gameSettings->getFactionCRCList(); vector<pair<string,uint32> > serverFactionCRCList = displayedGamesettings.getFactionCRCList();
for(unsigned int factionIdx1 = 0; factionIdx1 < serverFactionCRCList.size(); ++factionIdx1) { for(unsigned int factionIdx1 = 0; factionIdx1 < serverFactionCRCList.size(); ++factionIdx1) {
pair<string,uint32> &serverFaction = serverFactionCRCList[factionIdx1]; pair<string,uint32> &serverFaction = serverFactionCRCList[factionIdx1];
if(serverFaction.first == factionName) { if(serverFaction.first == factionName) {
if(serverFaction.second != factionCRC) { if(serverFaction.second != factionCRC) {
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true); factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + displayedGamesettings.getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
} }
break; break;
} }
@ -3006,10 +3073,10 @@ void MenuStateConnectedGame::update() {
} }
uint32 mapCRC = lastCheckedCRCMapValue; uint32 mapCRC = lastCheckedCRCMapValue;
if(lastCheckedCRCMapName != gameSettings->getMap() && if(lastCheckedCRCMapName != displayedGamesettings.getMap() &&
gameSettings->getMap() != "") { displayedGamesettings.getMap() != "") {
Checksum checksum; Checksum checksum;
string file = Config::getMapPath(gameSettings->getMap(),"",false); string file = Config::getMapPath(displayedGamesettings.getMap(),"",false);
//console.addLine("Checking map CRC [" + file + "]"); //console.addLine("Checking map CRC [" + file + "]");
checksum.addFile(file); checksum.addFile(file);
mapCRC = checksum.getSum(); mapCRC = checksum.getSum();
@ -3017,22 +3084,23 @@ void MenuStateConnectedGame::update() {
//mapCRC++; //mapCRC++;
lastCheckedCRCMapValue = mapCRC; lastCheckedCRCMapValue = mapCRC;
lastCheckedCRCMapName = gameSettings->getMap(); lastCheckedCRCMapName = displayedGamesettings.getMap();
} }
safeMutexFTPProgress.ReleaseLock(); safeMutexFTPProgress.ReleaseLock();
bool dataSynchMismatch = ((mapCRC != 0 && mapCRC != gameSettings->getMapCRC()) || bool dataSynchMismatch = ((mapCRC != 0 && mapCRC != displayedGamesettings.getMapCRC()) ||
(tilesetCRC != 0 && tilesetCRC != gameSettings->getTilesetCRC()) || (tilesetCRC != 0 && tilesetCRC != displayedGamesettings.getTilesetCRC()) ||
(techCRC != 0 && techCRC != gameSettings->getTechCRC())); (techCRC != 0 && techCRC != displayedGamesettings.getTechCRC()));
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nmapCRC [%d] gameSettings->getMapCRC() [%d]\ntilesetCRC [%d] gameSettings->getTilesetCRC() [%d]\ntechCRC [%d] gameSettings->getTechCRC() [%d]\n",mapCRC,gameSettings->getMapCRC(),tilesetCRC,gameSettings->getTilesetCRC(),techCRC,gameSettings->getTechCRC()); //if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\nmapCRC [%d] displayedGamesettings.getMapCRC() [%d]\ntilesetCRC [%d] displayedGamesettings.getTilesetCRC() [%d]\ntechCRC [%d] displayedGamesettings.getTechCRC() [%d]\n",mapCRC,displayedGamesettings.getMapCRC(),tilesetCRC,displayedGamesettings.getTilesetCRC(),techCRC,displayedGamesettings.getTechCRC());
if(dataSynchMismatch == true) { if(dataSynchMismatch == true &&
//printf("Data not synched: lmap %u rmap: %u ltile: %d rtile: %u ltech: %u rtech: %u\n",mapCRC,gameSettings->getMapCRC(),tilesetCRC,gameSettings->getTilesetCRC(),techCRC,gameSettings->getTechCRC()); ( difftime((long int)time(NULL),broadcastServerSettingsDelayTimer) >= HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS)) {
//printf("Data not synched: lmap %u rmap: %u ltile: %d rtile: %u ltech: %u rtech: %u\n",mapCRC,displayedGamesettings.getMapCRC(),tilesetCRC,displayedGamesettings.getTilesetCRC(),techCRC,displayedGamesettings.getTechCRC());
string labelSynch = lang.getString("DataNotSynchedTitle"); string labelSynch = lang.getString("DataNotSynchedTitle");
if(mapCRC != 0 && mapCRC != gameSettings->getMapCRC() && if(mapCRC != 0 && mapCRC != displayedGamesettings.getMapCRC() &&
listBoxMap.getSelectedItemIndex() >= 0 && listBoxMap.getSelectedItemIndex() >= 0 &&
listBoxMap.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) { listBoxMap.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.getString("Map"); labelSynch = labelSynch + " " + lang.getString("Map");
@ -3051,7 +3119,7 @@ void MenuStateConnectedGame::update() {
} }
} }
if(tilesetCRC != 0 && tilesetCRC != gameSettings->getTilesetCRC() && if(tilesetCRC != 0 && tilesetCRC != displayedGamesettings.getTilesetCRC() &&
listBoxTileset.getSelectedItemIndex() >= 0 && listBoxTileset.getSelectedItemIndex() >= 0 &&
listBoxTileset.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) { listBoxTileset.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.getString("Tileset"); labelSynch = labelSynch + " " + lang.getString("Tileset");
@ -3069,7 +3137,7 @@ void MenuStateConnectedGame::update() {
} }
} }
if(techCRC != 0 && techCRC != gameSettings->getTechCRC() && if(techCRC != 0 && techCRC != displayedGamesettings.getTechCRC() &&
listBoxTechTree.getSelectedItemIndex() >= 0 && listBoxTechTree.getSelectedItemIndex() >= 0 &&
listBoxTechTree.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) { listBoxTechTree.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.getString("TechTree"); labelSynch = labelSynch + " " + lang.getString("TechTree");
@ -3092,7 +3160,7 @@ void MenuStateConnectedGame::update() {
string mismatchedFactionText = ""; string mismatchedFactionText = "";
vector<string> mismatchedFactionTextList; vector<string> mismatchedFactionTextList;
vector<pair<string,uint32> > serverFactionCRCList = gameSettings->getFactionCRCList(); vector<pair<string,uint32> > serverFactionCRCList = displayedGamesettings.getFactionCRCList();
for(unsigned int factionIdx = 0; factionIdx < serverFactionCRCList.size(); ++factionIdx) { for(unsigned int factionIdx = 0; factionIdx < serverFactionCRCList.size(); ++factionIdx) {
pair<string,uint32> &serverFaction = serverFactionCRCList[factionIdx]; pair<string,uint32> &serverFaction = serverFactionCRCList[factionIdx];
@ -3332,17 +3400,67 @@ void MenuStateConnectedGame::update() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start(); if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
try { try {
if(clientInterface->getGameSettingsReceived() && if(clientInterface->getGameSettingsReceived() && validDisplayedGamesettings &&
lastGameSettingsReceivedCount != clientInterface->getGameSettingsReceivedCount()) { lastGameSettingsReceivedCount != clientInterface->getGameSettingsReceivedCount()) {
broadCastGameSettingsToHeadlessServer(needToBroadcastServerSettings);
lastGameSettingsReceivedCount = clientInterface->getGameSettingsReceivedCount(); lastGameSettingsReceivedCount = clientInterface->getGameSettingsReceivedCount();
bool errorOnMissingData = (clientInterface->getAllowGameDataSynchCheck() == false); bool errorOnMissingData = (clientInterface->getAllowGameDataSynchCheck() == false);
GameSettings *gameSettings = clientInterface->getGameSettingsPtr();
//printf("Menu got new settings thisfactionindex = %d startlocation: %d control = %d\n",gameSettings->getThisFactionIndex(),clientInterface->getGameSettings()->getStartLocationIndex(clientInterface->getGameSettings()->getThisFactionIndex()),gameSettings->getFactionControl(clientInterface->getGameSettings()->getThisFactionIndex())); const GameSettings *receivedGameSettings= clientInterface->getGameSettings();
setupUIFromGameSettings(gameSettings, errorOnMissingData); //printf("Menu got new settings thisfactionindex = %d startlocation: %d control = %d\n",displayedGamesettings.getThisFactionIndex(),clientInterface->getGameSettings()->getStartLocationIndex(clientInterface->getGameSettings()->getThisFactionIndex()),displayedGamesettings.getFactionControl(clientInterface->getGameSettings()->getThisFactionIndex()));
if ( difftime((long int)time(NULL),noReceiveTimer) < 3 || difftime((long int)time(NULL),broadcastServerSettingsDelayTimer) < HEADLESSSERVER_BROADCAST_SETTINGS_SECONDS){
// copy my current settings in UI to displayedSettings;
loadGameSettings(&displayedGamesettings);
// check if there are any changed fields from others clients
if(isHeadlessAdmin()){
//printf("I am headless admin and will restore only some parts\n");
// only copy those parts which are editable by normal clients
for (int i=0;i<receivedGameSettings->getFactionCount();i++){
if(displayedGamesettings.getFactionControl(i)==ctNetwork){
if(originalGamesettings.getTeam(i)==displayedGamesettings.getTeam(i)){
displayedGamesettings.setTeam(i,receivedGameSettings->getTeam(i));
originalGamesettings.setTeam(i,receivedGameSettings->getTeam(i));
}
if(originalGamesettings.getFactionTypeName(i)==displayedGamesettings.getFactionTypeName(i)){
displayedGamesettings.setFactionTypeName(i,receivedGameSettings->getFactionTypeName(i));
originalGamesettings.setFactionTypeName(i,receivedGameSettings->getFactionTypeName(i));
}
displayedGamesettings.setNetworkPlayerGameStatus(i,receivedGameSettings->getNetworkPlayerGameStatus(i));
originalGamesettings.setNetworkPlayerGameStatus(i,receivedGameSettings->getNetworkPlayerGameStatus(i));
displayedGamesettings.setNetworkPlayerName(i,receivedGameSettings->getNetworkPlayerName(i));
originalGamesettings.setNetworkPlayerName(i,receivedGameSettings->getNetworkPlayerName(i));
}
}
}
else{
//printf("I am client and restore everything but not my line\n");
// copy all received fields just not those which are editable for normal client
//store my changes
int i=clientInterface->getPlayerIndex();
int team=displayedGamesettings.getTeam(i);
string faction=displayedGamesettings.getFactionTypeName(i);
int status=displayedGamesettings.getNetworkPlayerGameStatus(i);
string networkPlayerName=displayedGamesettings.getNetworkPlayerName(i);
displayedGamesettings=*receivedGameSettings;
originalGamesettings=*receivedGameSettings;
displayedGamesettings.setTeam(i,team);
originalGamesettings.setTeam(i,team);
displayedGamesettings.setFactionTypeName(i,faction);
originalGamesettings.setFactionTypeName(i,faction);
displayedGamesettings.setNetworkPlayerGameStatus(i,status);
originalGamesettings.setNetworkPlayerGameStatus(i,status);
displayedGamesettings.setNetworkPlayerName(i,networkPlayerName);
originalGamesettings.setNetworkPlayerName(i,networkPlayerName);
}
setupUIFromGameSettings(&displayedGamesettings, errorOnMissingData);
}
else {
// do nothing
setupUIFromGameSettings(&displayedGamesettings, errorOnMissingData);
}
broadCastGameSettingsToHeadlessServer(needToBroadcastServerSettings);
} }
// check if we are joining an in progress game // check if we are joining an in progress game
@ -3476,7 +3594,26 @@ void MenuStateConnectedGame::update() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
launchingNewGame = true; launchingNewGame = true;
program->setState(new Game(program, clientInterface->getGameSettings(),false));
GameSettings gameSettings = *clientInterface->getGameSettings();
// complete game settings with local stuff
if(gameSettings.getScenario()!="")
{
string scenario = gameSettings.getScenario();
listBoxScenario.setSelectedItem(formatString(scenario));
string file = Scenario::getScenarioPath(dirList, scenario);
bool isTutorial = Scenario::isGameTutorial(file);
Scenario::loadScenarioInfo(file, &scenarioInfo, isTutorial);
gameSettings.setScenarioDir(Scenario::getScenarioPath(dirList, scenarioInfo.name));
gameSettings.setDefaultResources(scenarioInfo.defaultResources);
gameSettings.setDefaultUnits(scenarioInfo.defaultUnits);
gameSettings.setDefaultVictoryConditions(scenarioInfo.defaultVictoryConditions);
}
program->setState(new Game(program, &gameSettings,false));
return; return;
} }
} }
@ -3489,12 +3626,11 @@ void MenuStateConnectedGame::update() {
// check for need to switch music on again // check for need to switch music on again
if(clientInterface != NULL) { if(clientInterface != NULL) {
GameSettings *gameSettings = clientInterface->getGameSettingsPtr();
int currentConnectionCount=0; int currentConnectionCount=0;
for(int i=0; i < GameConstants::maxPlayers; ++i) { for(int i=0; i < GameConstants::maxPlayers; ++i) {
if(gameSettings->getFactionControl(i)==ctNetwork && if(displayedGamesettings.getFactionControl(i)==ctNetwork &&
gameSettings->getNetworkPlayerName(i) != "" && displayedGamesettings.getNetworkPlayerName(i) != "" &&
gameSettings->getNetworkPlayerName(i) != GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME) displayedGamesettings.getNetworkPlayerName(i) != GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME)
{ {
currentConnectionCount++; currentConnectionCount++;
} }
@ -3827,13 +3963,14 @@ bool MenuStateConnectedGame::loadMapInfo(string file, MapInfo *mapInfo, bool loa
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
if(MapPreview::loadMapInfo(file, mapInfo, lang.getString("MaxPlayers"),lang.getString("Size"),true) == true) { if(MapPreview::loadMapInfo(file, mapInfo, lang.getString("MaxPlayers"),lang.getString("Size"),true) == true) {
for(int i = 0; i < GameConstants::maxPlayers; ++i) { for(int i = 0; i < GameConstants::maxPlayers; ++i) {
labelPlayers[i].setVisible(i+1 <= mapInfo->players); bool visible=i+1 <= mapInfo->players;
labelPlayerNames[i].setVisible(i+1 <= mapInfo->players); labelPlayers[i].setVisible(visible);
listBoxControls[i].setVisible(i+1 <= mapInfo->players); labelPlayerNames[i].setVisible(visible);
listBoxRMultiplier[i].setVisible(i+1 <= mapInfo->players); listBoxControls[i].setVisible(visible);
listBoxFactions[i].setVisible(i+1 <= mapInfo->players); listBoxRMultiplier[i].setVisible(visible);
listBoxTeams[i].setVisible(i+1 <= mapInfo->players); listBoxFactions[i].setVisible(visible);
labelNetStatus[i].setVisible(i+1 <= mapInfo->players); listBoxTeams[i].setVisible(visible);
labelNetStatus[i].setVisible(visible);
} }
// Not painting properly so this is on hold // Not painting properly so this is on hold
@ -4400,6 +4537,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
throw megaglest_runtime_error("gameSettings == NULL"); throw megaglest_runtime_error("gameSettings == NULL");
} }
checkBoxScenario.setValue((gameSettings->getScenario() != "")); checkBoxScenario.setValue((gameSettings->getScenario() != ""));
if(checkBoxScenario.getValue() == true) { if(checkBoxScenario.getValue() == true) {
int originalFOWValue = listBoxFogOfWar.getSelectedItemIndex(); int originalFOWValue = listBoxFogOfWar.getSelectedItemIndex();
@ -4427,6 +4565,9 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
listBoxFogOfWar.setSelectedItemIndex(0); listBoxFogOfWar.setSelectedItemIndex(0);
} }
checkBoxAllowTeamUnitSharing.setValue(scenarioInfo.allowTeamUnitSharing);
checkBoxAllowTeamResourceSharing.setValue(scenarioInfo.allowTeamResourceSharing);
if(originalFOWValue != listBoxFogOfWar.getSelectedItemIndex()) { if(originalFOWValue != listBoxFogOfWar.getSelectedItemIndex()) {
cleanupMapPreviewTexture(); cleanupMapPreviewTexture();
} }
@ -4440,8 +4581,8 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
//listBoxMap.setItems(formattedPlayerSortedMaps[gameSettings.getMapFilterIndex()]); //listBoxMap.setItems(formattedPlayerSortedMaps[gameSettings.getMapFilterIndex()]);
//printf("A gameSettings->getTileset() [%s]\n",gameSettings->getTileset().c_str()); //printf("A gameSettings->getTileset() [%s]\n",gameSettings->getTileset().c_str());
if(getMissingTilesetFromFTPServerInProgress == false && if ( getMissingTilesetFromFTPServerInProgress == false
gameSettings->getTileset() != "") { && gameSettings->getTileset() != "") {
// tileset // tileset
tilesets = tilesetFiles; tilesets = tilesetFiles;
std::for_each(tilesets.begin(), tilesets.end(), FormatString()); std::for_each(tilesets.begin(), tilesets.end(), FormatString());
@ -4601,9 +4742,11 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
loadFactions(gameSettings,false); loadFactions(gameSettings,false);
} }
if(getMissingMapFromFTPServerInProgress == false && if(getMissingMapFromFTPServerInProgress == false &&
gameSettings->getMap() != "") { gameSettings->getMap() != "") {
// map // map
bool missingMap=false;
string mapFile = gameSettings->getMap(); string mapFile = gameSettings->getMap();
mapFile = formatString(mapFile); mapFile = formatString(mapFile);
@ -4647,11 +4790,20 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
} }
maps.push_back(Lang::getInstance().getString("DataMissing","",true)); maps.push_back(Lang::getInstance().getString("DataMissing","",true));
mapFile = Lang::getInstance().getString("DataMissing","",true); mapFile = Lang::getInstance().getString("DataMissing","",true);
missingMap=true;
} }
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = " MG_SIZE_T_SPECIFIER ", maps.size() = " MG_SIZE_T_SPECIFIER ", getCurrentMapFile() [%s] mapFile [%s]\n", if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] listBoxMap.getSelectedItemIndex() = %d, mapFiles.size() = " MG_SIZE_T_SPECIFIER ", maps.size() = " MG_SIZE_T_SPECIFIER ", getCurrentMapFile() [%s] mapFile [%s]\n",
extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),maps.size(),getCurrentMapFile().c_str(),mapFile.c_str()); extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,listBoxMap.getSelectedItemIndex(),mapFiles.size(),maps.size(),getCurrentMapFile().c_str(),mapFile.c_str());
if( isHeadlessAdmin() && !missingMap && mapFile!=listBoxMap.getSelectedItem()){
//console.addLine("Headless server does not have map, switching to next one");
if(isfirstSwitchingMapMessage){
isfirstSwitchingMapMessage=false;
}else{
console.addLine(Lang::getInstance().getString("HeadlessServerDoesNotHaveMap","",true));
}
}
listBoxMap.setItems(maps); listBoxMap.setItems(maps);
listBoxMap.setSelectedItem(mapFile); listBoxMap.setSelectedItem(mapFile);
@ -4707,6 +4859,8 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
checkBoxAllowTeamResourceSharing.setValue(false); checkBoxAllowTeamResourceSharing.setValue(false);
} }
checkBoxAllowNativeLanguageTechtree.setValue(gameSettings->getNetworkAllowNativeLanguageTechtree());
// Control // Control
for(int i=0; i<GameConstants::maxPlayers; ++i) { for(int i=0; i<GameConstants::maxPlayers; ++i) {
listBoxControls[i].setSelectedItemIndex(ctClosed); listBoxControls[i].setSelectedItemIndex(ctClosed);
@ -4770,9 +4924,9 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
listBoxControls[slot].setSelectedItemIndex(gameSettings->getFactionControl(i),errorOnMissingData); listBoxControls[slot].setSelectedItemIndex(gameSettings->getFactionControl(i),errorOnMissingData);
listBoxRMultiplier[slot].setSelectedItemIndex(gameSettings->getResourceMultiplierIndex(i),errorOnMissingData); listBoxRMultiplier[slot].setSelectedItemIndex(gameSettings->getResourceMultiplierIndex(i),errorOnMissingData);
listBoxTeams[slot].setSelectedItemIndex(gameSettings->getTeam(i),errorOnMissingData); listBoxTeams[slot].setSelectedItemIndex(gameSettings->getTeam(i),errorOnMissingData);
listBoxFactions[slot].setSelectedItem(formatString(gameSettings->getFactionTypeName(i)),false); listBoxFactions[slot].setSelectedItem(formatString(gameSettings->getFactionTypeName(i)),false);
if( gameSettings->getFactionControl(i) == ctNetwork || if( gameSettings->getFactionControl(i) == ctNetwork ||
gameSettings->getFactionControl(i) == ctNetworkUnassigned) { gameSettings->getFactionControl(i) == ctNetworkUnassigned) {
labelNetStatus[slot].setText(gameSettings->getNetworkPlayerName(i)); labelNetStatus[slot].setText(gameSettings->getNetworkPlayerName(i));
@ -4814,14 +4968,13 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
labelPlayerNames[slot].setText(gameSettings->getNetworkPlayerName(i)); labelPlayerNames[slot].setText(gameSettings->getNetworkPlayerName(i));
} }
} }
}
settingsReceivedFromServer=true; settingsReceivedFromServer=true;
initialSettingsReceivedFromServer=true; initialSettingsReceivedFromServer=true;
needToSetChangedGameSettings = true; needToSetChangedGameSettings = true;
lastSetChangedGameSettings = time(NULL); lastSetChangedGameSettings = time(NULL);
} }
}
if(enableFactionTexturePreview == true) { if(enableFactionTexturePreview == true) {
if( clientInterface != NULL && clientInterface->isConnected() && if( clientInterface != NULL && clientInterface->isConnected() &&
@ -4838,7 +4991,6 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
} }
} }
checkBoxAllowNativeLanguageTechtree.setValue(gameSettings->getNetworkAllowNativeLanguageTechtree());
} }
void MenuStateConnectedGame::initFactionPreview(const GameSettings *gameSettings) { void MenuStateConnectedGame::initFactionPreview(const GameSettings *gameSettings) {
@ -4949,6 +5101,7 @@ void MenuStateConnectedGame::RestoreLastGameSettings() {
needToBroadcastServerSettings=true; needToBroadcastServerSettings=true;
broadcastServerSettingsDelayTimer=time(NULL); broadcastServerSettingsDelayTimer=time(NULL);
noReceiveTimer=time(NULL);
} }
@ -4961,11 +5114,12 @@ int MenuStateConnectedGame::setupMapList(string scenario) {
string scenarioDir = Scenario::getScenarioDir(dirList, scenario); string scenarioDir = Scenario::getScenarioDir(dirList, scenario);
vector<string> pathList = config.getPathListForType(ptMaps,scenarioDir); vector<string> pathList = config.getPathListForType(ptMaps,scenarioDir);
vector<string> allMaps = MapPreview::findAllValidMaps(pathList,scenarioDir,false,true,&invalidMapList); vector<string> allMaps = MapPreview::findAllValidMaps(pathList,scenarioDir,false,true,&invalidMapList);
// sort map list non case sensitive
std::sort(allMaps.begin(),allMaps.end(),compareNonCaseSensitive);
if(scenario != "") { if(scenario != "") {
vector<string> allMaps2 = MapPreview::findAllValidMaps(config.getPathListForType(ptMaps,""),"",false,true,&invalidMapList); vector<string> allMaps2 = MapPreview::findAllValidMaps(config.getPathListForType(ptMaps,""),"",false,true,&invalidMapList);
copy(allMaps2.begin(), allMaps2.end(), std::inserter(allMaps, allMaps.begin())); copy(allMaps2.begin(), allMaps2.end(), std::inserter(allMaps, allMaps.begin()));
std::sort(allMaps.begin(),allMaps.end()); std::sort(allMaps.begin(),allMaps.end(),compareNonCaseSensitive);
} }
if (allMaps.empty()) { if (allMaps.empty()) {

View File

@ -63,6 +63,7 @@ private:
GraphicLabel labelMapInfo; GraphicLabel labelMapInfo;
GraphicLabel labelStatus; GraphicLabel labelStatus;
GraphicLabel labelInfo; GraphicLabel labelInfo;
GraphicLabel labelWaitingForPlayers;
GraphicButton buttonRestoreLastSettings; GraphicButton buttonRestoreLastSettings;
//GraphicLabel labelPathFinderType; //GraphicLabel labelPathFinderType;
@ -89,7 +90,6 @@ private:
GraphicListBox listBoxPlayerStatus; GraphicListBox listBoxPlayerStatus;
GraphicLabel labelPlayerStatus[GameConstants::maxPlayers]; GraphicLabel labelPlayerStatus[GameConstants::maxPlayers];
int nonAdminPlayerStatusX;
GraphicLabel labelAllowObservers; GraphicLabel labelAllowObservers;
GraphicCheckBox checkBoxAllowObservers; GraphicCheckBox checkBoxAllowObservers;
@ -238,9 +238,18 @@ private:
time_t broadcastServerSettingsDelayTimer; time_t broadcastServerSettingsDelayTimer;
int lastGameSettingsReceivedCount; int lastGameSettingsReceivedCount;
time_t noReceiveTimer;
bool launchingNewGame; bool launchingNewGame;
bool isfirstSwitchingMapMessage;
std::auto_ptr<TechTree> techTree; std::auto_ptr<TechTree> techTree;
GameSettings originalGamesettings;
bool validOriginalGameSettings;
GameSettings displayedGamesettings;
bool validDisplayedGamesettings;
public: public:
MenuStateConnectedGame(Program *program, MainMenu *mainMenu, JoinMenu joinMenuInfo=jmSimple, bool openNetworkSlots= false); MenuStateConnectedGame(Program *program, MainMenu *mainMenu, JoinMenu joinMenuInfo=jmSimple, bool openNetworkSlots= false);

View File

@ -143,7 +143,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
this->dirList = Config::getInstance().getPathListForType(ptScenarios); this->dirList = Config::getInstance().getPathListForType(ptScenarios);
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox"); mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.getString("Ok")); mainMessageBox.init(lang.getString("Ok"),500,300);
mainMessageBox.setEnabled(false); mainMessageBox.setEnabled(false);
mainMessageBoxState=0; mainMessageBoxState=0;
@ -172,6 +172,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
needToSetChangedGameSettings = false; needToSetChangedGameSettings = false;
needToRepublishToMasterserver = false; needToRepublishToMasterserver = false;
needToBroadcastServerSettings = false; needToBroadcastServerSettings = false;
lastGameSettingsreceivedCount = -1;
showMasterserverError = false; showMasterserverError = false;
tMasterserverErrorElapsed = 0; tMasterserverErrorElapsed = 0;
masterServererErrorToShow = "---"; masterServererErrorToShow = "---";
@ -193,16 +194,33 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
int xoffset=10; int xoffset=10;
//create //create
int buttonx=200; int buttonx=170;
int buttony=180; int buttony=180;
// player status
listBoxPlayerStatus.registerGraphicComponent(containerName,"listBoxPlayerStatus");
listBoxPlayerStatus.init(buttonx, buttony, 150);
vector<string> playerStatuses;
playerStatuses.push_back(lang.getString("PlayerStatusSetup"));
playerStatuses.push_back(lang.getString("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerStatuses);
listBoxPlayerStatus.setSelectedItemIndex(2,true);
listBoxPlayerStatus.setTextColor(Vec3f(0.0f,1.0f,0.0f));
listBoxPlayerStatus.setLighted(false);
listBoxPlayerStatus.setVisible(true);
buttonx+=180;
buttonReturn.registerGraphicComponent(containerName,"buttonReturn"); buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(buttonx, buttony, 125); buttonReturn.init(buttonx, buttony, 125);
buttonx+=130;
buttonRestoreLastSettings.registerGraphicComponent(containerName,"buttonRestoreLastSettings"); buttonRestoreLastSettings.registerGraphicComponent(containerName,"buttonRestoreLastSettings");
buttonRestoreLastSettings.init(buttonx+130, buttony, 220); buttonRestoreLastSettings.init(buttonx, buttony, 220);
buttonx+=225;
buttonPlayNow.registerGraphicComponent(containerName,"buttonPlayNow"); buttonPlayNow.registerGraphicComponent(containerName,"buttonPlayNow");
buttonPlayNow.init(buttonx+130+225, buttony, 125); buttonPlayNow.init(buttonx, buttony, 125);
labelLocalGameVersion.registerGraphicComponent(containerName,"labelLocalGameVersion"); labelLocalGameVersion.registerGraphicComponent(containerName,"labelLocalGameVersion");
labelLocalGameVersion.init(10, networkHeadPos+labelOffset); labelLocalGameVersion.init(10, networkHeadPos+labelOffset);
@ -356,19 +374,6 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
checkBoxAllowNativeLanguageTechtree.init(xoffset+650, mapHeadPos-70); checkBoxAllowNativeLanguageTechtree.init(xoffset+650, mapHeadPos-70);
checkBoxAllowNativeLanguageTechtree.setValue(false); checkBoxAllowNativeLanguageTechtree.setValue(false);
// player status
listBoxPlayerStatus.registerGraphicComponent(containerName,"listBoxPlayerStatus");
listBoxPlayerStatus.init(810, buttony, 150);
vector<string> playerStatuses;
playerStatuses.push_back(lang.getString("PlayerStatusSetup"));
playerStatuses.push_back(lang.getString("PlayerStatusBeRightBack"));
playerStatuses.push_back(lang.getString("PlayerStatusReady"));
listBoxPlayerStatus.setItems(playerStatuses);
listBoxPlayerStatus.setSelectedItemIndex(2,true);
listBoxPlayerStatus.setTextColor(Vec3f(0.0f,1.0f,0.0f));
listBoxPlayerStatus.setLighted(false);
listBoxPlayerStatus.setVisible(true);
// Network Scenario // Network Scenario
int scenarioX=810; int scenarioX=810;
int scenarioY=140; int scenarioY=140;
@ -542,6 +547,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
listBoxTeams[i].registerGraphicComponent(containerName,"listBoxTeams" + intToStr(i)); listBoxTeams[i].registerGraphicComponent(containerName,"listBoxTeams" + intToStr(i));
listBoxTeams[i].init(xoffset+650, setupPos-30-i*rowHeight, 60); listBoxTeams[i].init(xoffset+650, setupPos-30-i*rowHeight, 60);
listBoxTeams[i].setLighted(true);
labelNetStatus[i].registerGraphicComponent(containerName,"labelNetStatus" + intToStr(i)); labelNetStatus[i].registerGraphicComponent(containerName,"labelNetStatus" + intToStr(i));
labelNetStatus[i].init(xoffset+715, setupPos-30-i*rowHeight, 60); labelNetStatus[i].init(xoffset+715, setupPos-30-i*rowHeight, 60);
@ -733,7 +739,7 @@ void MenuStateCustomGame::reloadUI() {
Config &config = Config::getInstance(); Config &config = Config::getInstance();
console.resetFonts(); console.resetFonts();
mainMessageBox.init(lang.getString("Ok")); mainMessageBox.init(lang.getString("Ok"),500,300);
if(EndsWith(glestVersionString, "-dev") == false){ if(EndsWith(glestVersionString, "-dev") == false){
@ -2192,8 +2198,15 @@ void MenuStateCustomGame::render() {
if(listBoxControls[i].getSelectedItemIndex()!=ctClosed){ if(listBoxControls[i].getSelectedItemIndex()!=ctClosed){
renderer.renderListBox(&listBoxRMultiplier[i]); renderer.renderListBox(&listBoxRMultiplier[i]);
renderer.renderListBox(&listBoxFactions[i]); renderer.renderListBox(&listBoxFactions[i]);
int teamnumber=listBoxTeams[i].getSelectedItemIndex();
Vec3f teamcolor=Vec3f(1.0f,1.0f,1.0f);
if(teamnumber>=0 && teamnumber<8){
teamcolor=crcPlayerTextureCache[teamnumber]->getPixmap()->getPixel3f(0, 0);
}
listBoxTeams[i].setTextColor(teamcolor);
renderer.renderListBox(&listBoxTeams[i]); renderer.renderListBox(&listBoxTeams[i]);
renderer.renderLabel(&labelNetStatus[i]); renderer.renderLabel(&labelNetStatus[i]);
} }
@ -2287,7 +2300,7 @@ void MenuStateCustomGame::render() {
renderer.renderChatManager(&chatManager); renderer.renderChatManager(&chatManager);
} }
} }
renderer.renderConsole(&console,showFullConsole,true); renderer.renderConsole(&console,showFullConsole?consoleFull:consoleStoredAndNormal);
} }
catch(const std::exception &ex) { catch(const std::exception &ex) {
char szBuf[8096]=""; char szBuf[8096]="";
@ -2439,7 +2452,10 @@ void MenuStateCustomGame::update() {
if(this->autoloadScenarioName != "") { if(this->autoloadScenarioName != "") {
listBoxScenario.setSelectedItem(formatString(this->autoloadScenarioName),false); listBoxScenario.setSelectedItem(formatString(this->autoloadScenarioName),false);
lastSetChangedGameSettings = time(NULL);
if(serverInterface != NULL){
lastGameSettingsreceivedCount=serverInterface->getGameSettingsUpdateCount();
}
if(listBoxScenario.getSelectedItem() != formatString(this->autoloadScenarioName)) { if(listBoxScenario.getSelectedItem() != formatString(this->autoloadScenarioName)) {
mainMessageBoxState=1; mainMessageBoxState=1;
showMessageBox( "Could not find scenario name: " + formatString(this->autoloadScenarioName), "Scenario Missing", false); showMessageBox( "Could not find scenario name: " + formatString(this->autoloadScenarioName), "Scenario Missing", false);
@ -2489,7 +2505,7 @@ void MenuStateCustomGame::update() {
publishText = lang.getString("PublishDisabled"); publishText = lang.getString("PublishDisabled");
} }
masterServererErrorToShow += publishText; masterServererErrorToShow += "\n\n"+ publishText;
showMasterserverError=false; showMasterserverError=false;
mainMessageBoxState=1; mainMessageBoxState=1;
showMessageBox( masterServererErrorToShow, lang.getString("ErrorFromMasterserver"), false); showMessageBox( masterServererErrorToShow, lang.getString("ErrorFromMasterserver"), false);
@ -2845,7 +2861,15 @@ void MenuStateCustomGame::update() {
if(needToPublishDelayed == false || headlessServerMode == true) { if(needToPublishDelayed == false || headlessServerMode == true) {
bool broadCastSettings = (difftime((long int)time(NULL),lastSetChangedGameSettings) >= BROADCAST_SETTINGS_SECONDS); bool broadCastSettings = (difftime((long int)time(NULL),lastSetChangedGameSettings) >= BROADCAST_SETTINGS_SECONDS);
//printf("broadCastSettings = %d\n",broadCastSettings); if(headlessServerMode==true){
// publish settings directly when we receive them
ServerInterface* serverInterface= NetworkManager::getInstance().getServerInterface();
if(lastGameSettingsreceivedCount<serverInterface->getGameSettingsUpdateCount()){
needToBroadcastServerSettings=true;
lastSetChangedGameSettings = time(NULL);
lastGameSettingsreceivedCount=serverInterface->getGameSettingsUpdateCount();
}
}
if(broadCastSettings == true) { if(broadCastSettings == true) {
needToBroadcastServerSettings=true; needToBroadcastServerSettings=true;
@ -3081,8 +3105,7 @@ void MenuStateCustomGame::publishToMasterserver() {
publishToServerInfo["binaryCompileDate"] = getCompileDateTime(); publishToServerInfo["binaryCompileDate"] = getCompileDateTime();
//game info: //game info:
publishToServerInfo["serverTitle"] = getHumanPlayerName() + "'s game"; publishToServerInfo["serverTitle"] = gameSettings.getGameName();
publishToServerInfo["serverTitle"] = labelGameName.getText();
//ip is automatically set //ip is automatically set
//game setup info: //game setup info:
@ -3342,7 +3365,7 @@ void MenuStateCustomGame::simpleTaskForClients(BaseThread *callingThread) {
} }
ServerInterface *serverInterface= NetworkManager::getInstance().getServerInterface(false); ServerInterface *serverInterface= NetworkManager::getInstance().getServerInterface(false);
if(serverInterface != NULL) { if(serverInterface != NULL) {
lastGameSettingsreceivedCount++;
if(this->headlessServerMode == false || (serverInterface->getGameSettingsUpdateCount() <= lastMasterServerSettingsUpdateCount)) { if(this->headlessServerMode == false || (serverInterface->getGameSettingsUpdateCount() <= lastMasterServerSettingsUpdateCount)) {
GameSettings gameSettings; GameSettings gameSettings;
loadGameSettings(&gameSettings); loadGameSettings(&gameSettings);
@ -3422,6 +3445,8 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
setupUIFromGameSettings(*settings); setupUIFromGameSettings(*settings);
} }
gameSettings->setGameName(labelGameName.getText());
// Test flags values // Test flags values
//gameSettings->setFlagTypes1(ft1_show_map_resources); //gameSettings->setFlagTypes1(ft1_show_map_resources);
// //
@ -3704,7 +3729,7 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, factionFiles[listBoxFactions[i].getSelectedItemIndex()] [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i,factionFiles[listBoxFactions[i].getSelectedItemIndex()].c_str()); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] i = %d, factionFiles[listBoxFactions[i].getSelectedItemIndex()] [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,i,factionFiles[listBoxFactions[i].getSelectedItemIndex()].c_str());
gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]); gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]);
gameSettings->setNetworkPlayerName(slotIndex, "Closed"); gameSettings->setNetworkPlayerName(slotIndex, GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME);
gameSettings->setNetworkPlayerUUID(slotIndex,""); gameSettings->setNetworkPlayerUUID(slotIndex,"");
gameSettings->setNetworkPlayerPlatform(slotIndex,""); gameSettings->setNetworkPlayerPlatform(slotIndex,"");
@ -3969,6 +3994,8 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin
else { else {
listBoxFogOfWar.setSelectedItemIndex(0); listBoxFogOfWar.setSelectedItemIndex(0);
} }
checkBoxAllowTeamUnitSharing.setValue(scenarioInfo.allowTeamUnitSharing);
checkBoxAllowTeamResourceSharing.setValue(scenarioInfo.allowTeamResourceSharing);
} }
setupMapList(gameSettings.getScenario()); setupMapList(gameSettings.getScenario());
setupTechList(gameSettings.getScenario(),false); setupTechList(gameSettings.getScenario(),false);
@ -4666,6 +4693,9 @@ void MenuStateCustomGame::processScenario() {
listBoxFogOfWar.setSelectedItemIndex(0); listBoxFogOfWar.setSelectedItemIndex(0);
} }
checkBoxAllowTeamUnitSharing.setValue(scenarioInfo.allowTeamUnitSharing);
checkBoxAllowTeamResourceSharing.setValue(scenarioInfo.allowTeamResourceSharing);
setupTechList(scenarioInfo.name, false); setupTechList(scenarioInfo.name, false);
listBoxTechTree.setSelectedItem(formatString(scenarioInfo.techTreeName)); listBoxTechTree.setSelectedItem(formatString(scenarioInfo.techTreeName));
reloadFactions(false,scenarioInfo.name); reloadFactions(false,scenarioInfo.name);
@ -4836,6 +4866,8 @@ void MenuStateCustomGame::SetupUIForScenarios() {
} }
listBoxFogOfWar.setEditable(false); listBoxFogOfWar.setEditable(false);
checkBoxAllowObservers.setEditable(false); checkBoxAllowObservers.setEditable(false);
checkBoxAllowTeamUnitSharing.setEditable(false);
checkBoxAllowTeamResourceSharing.setEditable(false);
//listBoxPathFinderType.setEditable(false); //listBoxPathFinderType.setEditable(false);
checkBoxEnableSwitchTeamMode.setEditable(false); checkBoxEnableSwitchTeamMode.setEditable(false);
listBoxAISwitchTeamAcceptPercent.setEditable(false); listBoxAISwitchTeamAcceptPercent.setEditable(false);
@ -4856,6 +4888,8 @@ void MenuStateCustomGame::SetupUIForScenarios() {
} }
listBoxFogOfWar.setEditable(true); listBoxFogOfWar.setEditable(true);
checkBoxAllowObservers.setEditable(true); checkBoxAllowObservers.setEditable(true);
checkBoxAllowTeamUnitSharing.setEditable(true);
checkBoxAllowTeamResourceSharing.setEditable(true);
//listBoxPathFinderType.setEditable(true); //listBoxPathFinderType.setEditable(true);
checkBoxEnableSwitchTeamMode.setEditable(true); checkBoxEnableSwitchTeamMode.setEditable(true);
listBoxAISwitchTeamAcceptPercent.setEditable(true); listBoxAISwitchTeamAcceptPercent.setEditable(true);
@ -4887,11 +4921,12 @@ int MenuStateCustomGame::setupMapList(string scenario) {
string scenarioDir = Scenario::getScenarioDir(dirList, scenario); string scenarioDir = Scenario::getScenarioDir(dirList, scenario);
vector<string> pathList = config.getPathListForType(ptMaps,scenarioDir); vector<string> pathList = config.getPathListForType(ptMaps,scenarioDir);
vector<string> allMaps = MapPreview::findAllValidMaps(pathList,scenarioDir,false,true,&invalidMapList); vector<string> allMaps = MapPreview::findAllValidMaps(pathList,scenarioDir,false,true,&invalidMapList);
// sort map list non case sensitive
std::sort(allMaps.begin(),allMaps.end(),compareNonCaseSensitive);
if(scenario != "") { if(scenario != "") {
vector<string> allMaps2 = MapPreview::findAllValidMaps(config.getPathListForType(ptMaps,""),"",false,true,&invalidMapList); vector<string> allMaps2 = MapPreview::findAllValidMaps(config.getPathListForType(ptMaps,""),"",false,true,&invalidMapList);
copy(allMaps2.begin(), allMaps2.end(), std::inserter(allMaps, allMaps.begin())); copy(allMaps2.begin(), allMaps2.end(), std::inserter(allMaps, allMaps.begin()));
std::sort(allMaps.begin(),allMaps.end()); std::sort(allMaps.begin(),allMaps.end(),compareNonCaseSensitive);
} }
if (allMaps.empty()) { if (allMaps.empty()) {

View File

@ -220,6 +220,8 @@ private:
string gameUUID; string gameUUID;
int lastGameSettingsreceivedCount;
public: public:
MenuStateCustomGame(Program *program, MainMenu *mainMenu , MenuStateCustomGame(Program *program, MainMenu *mainMenu ,
bool openNetworkSlots= false, ParentMenuState parentMenuState=pNewGame, bool openNetworkSlots= false, ParentMenuState parentMenuState=pNewGame,

View File

@ -141,7 +141,7 @@ void MenuStateGraphicInfo::render(){
renderer.renderLabel(&labelInternalInfo); renderer.renderLabel(&labelInternalInfo);
renderer.renderLabel(&labelMoreInfo); renderer.renderLabel(&labelMoreInfo);
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
} }
void MenuStateGraphicInfo::keyDown(SDL_KeyboardEvent key) { void MenuStateGraphicInfo::keyDown(SDL_KeyboardEvent key) {

View File

@ -445,7 +445,7 @@ void MenuStateKeysetup::render(){
renderer.renderScrollBar(&keyScrollBar); renderer.renderScrollBar(&keyScrollBar);
} }
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }

View File

@ -85,8 +85,14 @@ MenuStateLoadGame::MenuStateLoadGame(Program *program, MainMenu *mainMenu):
infoHeaderLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D()); infoHeaderLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
infoHeaderLabel.setText(lang.getString("SavegameInfo")); infoHeaderLabel.setText(lang.getString("SavegameInfo"));
versionWarningLabel.registerGraphicComponent(containerName,"versionWarningLabel");
versionWarningLabel.init(550, 350);
versionWarningLabel.setText("");
versionWarningLabel.setTextColor(Vec3f(1.0f,0.5f,0.5f));
infoTextLabel.registerGraphicComponent(containerName,"infoTextLabel"); infoTextLabel.registerGraphicComponent(containerName,"infoTextLabel");
infoTextLabel.init(550, 350); infoTextLabel.init(550, 310);
infoTextLabel.setText(""); infoTextLabel.setText("");
abortButton.registerGraphicComponent(containerName,"abortButton"); abortButton.registerGraphicComponent(containerName,"abortButton");
@ -337,9 +343,11 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) { if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str()); snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
infoTextLabel.setText(szBuf); versionWarningLabel.setText(szBuf);
} }
else { else {
versionWarningLabel.setText("");
}
XmlNode *gameNode = rootNode->getChild("Game"); XmlNode *gameNode = rootNode->getChild("Game");
GameSettings newGameSettings; GameSettings newGameSettings;
newGameSettings.loadGame(gameNode); newGameSettings.loadGame(gameNode);
@ -356,7 +364,6 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
newGameSettings.getFactionTypeName(newGameSettings.getThisFactionIndex()).c_str() : "")); newGameSettings.getFactionTypeName(newGameSettings.getThisFactionIndex()).c_str() : ""));
infoTextLabel.setText(szBuf); infoTextLabel.setText(szBuf);
} }
}
catch(const megaglest_runtime_error &ex) { catch(const megaglest_runtime_error &ex) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s Line: %d]\nError [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what()); snprintf(szBuf,8096,"In [%s::%s Line: %d]\nError [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,ex.what());
@ -401,6 +408,8 @@ void MenuStateLoadGame::render() {
renderer.renderLabel(&savedGamesLabel); renderer.renderLabel(&savedGamesLabel);
renderer.renderLabel(&infoHeaderLabel); renderer.renderLabel(&infoHeaderLabel);
renderer.renderLabel(&infoTextLabel); renderer.renderLabel(&infoTextLabel);
if(versionWarningLabel.getText()!="")
renderer.renderLabel(&versionWarningLabel);
renderer.renderButton(&abortButton); renderer.renderButton(&abortButton);
renderer.renderButton(&deleteButton); renderer.renderButton(&deleteButton);
@ -434,7 +443,7 @@ void MenuStateLoadGame::render() {
renderer.renderMessageBox(&mainMessageBox); renderer.renderMessageBox(&mainMessageBox);
} }
renderer.renderConsole(&console,false,false); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }

View File

@ -41,6 +41,7 @@ private:
GraphicLabel savedGamesLabel; GraphicLabel savedGamesLabel;
GraphicLabel infoHeaderLabel; GraphicLabel infoHeaderLabel;
GraphicLabel infoTextLabel; GraphicLabel infoTextLabel;
GraphicLabel versionWarningLabel;
GraphicLine lines[2]; GraphicLine lines[2];

View File

@ -790,7 +790,7 @@ void MenuStateMasterserver::render(){
ircClient->getHasJoinedChannel() == true) { ircClient->getHasJoinedChannel() == true) {
renderer.renderChatManager(&chatManager); renderer.renderChatManager(&chatManager);
} }
renderer.renderConsole(&consoleIRC,false,true,21); renderer.renderConsole(&consoleIRC,consoleStoredOnly,21);
} }
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
@ -857,7 +857,7 @@ void MenuStateMasterserver::update() {
button->setFont(CoreData::getInstance().getDisplayFontSmall()); button->setFont(CoreData::getInstance().getDisplayFontSmall());
button->setFont3D(CoreData::getInstance().getDisplayFontSmall3D()); button->setFont3D(CoreData::getInstance().getDisplayFontSmall3D());
button->setText(nickList[i]); 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->setEnabled(false);
button->setEditable(false); button->setEditable(false);
button->setCustomTexture(CoreData::getInstance().getCustomTexture()); button->setCustomTexture(CoreData::getInstance().getCustomTexture());

View File

@ -2386,7 +2386,7 @@ void MenuStateMods::render() {
} }
safeMutexFTPProgress.ReleaseLock(); safeMutexFTPProgress.ReleaseLock();
renderer.renderConsole(&console,showFullConsole,true,3); renderer.renderConsole(&console,consoleNormal,3);
if(mainMessageBox.getEnabled()) { if(mainMessageBox.getEnabled()) {
renderer.renderMessageBox(&mainMessageBox); renderer.renderMessageBox(&mainMessageBox);

View File

@ -137,7 +137,7 @@ void MenuStateNewGame::render(){
renderer.renderButton(&buttonTutorial); renderer.renderButton(&buttonTutorial);
renderer.renderButton(&buttonReturn); renderer.renderButton(&buttonReturn);
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }

View File

@ -227,6 +227,49 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
currentLine-=lineOffset; currentLine-=lineOffset;
labelHealthBars.registerGraphicComponent(containerName,"labelHealthBars");
labelHealthBars.init(currentLabelStart ,currentLine);
labelHealthBars.setText(lang.getString("Healthbar"));
listBoxHealthBars.registerGraphicComponent(containerName,"lisBoxtHealthBars");
listBoxHealthBars.init(currentColumnStart ,currentLine, 300 );
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsFactionDefault"));
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsOff"));
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsAlways"));
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsIfNeeded"));
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsSelected"));
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsSelectedOrNeeded"));
int hpMode=config.getInt("HealthBarMode","0");
int hpIndex=0;
switch (hpMode) {
case hbvUndefined:
hpIndex = 0;
break;
case hbvOff:
hpIndex = 1;
break;
case hbvAlways:
hpIndex = 2;
break;
case hbvIfNeeded:
hpIndex = 3;
break;
case hbvSelected:
hpIndex = 4;
break;
case hbvSelected | hbvIfNeeded:
hpIndex = 5;
break;
default:
hpIndex = 0;
break;
}
listBoxHealthBars.setSelectedItemIndex(hpIndex);
currentLine-=lineOffset;
labelChatStaysActive.registerGraphicComponent(containerName,"labelChatStaysActive"); labelChatStaysActive.registerGraphicComponent(containerName,"labelChatStaysActive");
labelChatStaysActive.init(currentLabelStart ,currentLine); labelChatStaysActive.init(currentLabelStart ,currentLine);
labelChatStaysActive.setText(lang.getString("ChatStaysActive")); labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
@ -274,7 +317,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
buttonReturn.setText(lang.getString("Return")); buttonReturn.setText(lang.getString("Return"));
// Transifex related UI // Transifex related UI
currentLine-=lineOffset*4; currentLine-=lineOffset*3;
labelCustomTranslation.registerGraphicComponent(containerName,"labelCustomTranslation"); labelCustomTranslation.registerGraphicComponent(containerName,"labelCustomTranslation");
labelCustomTranslation.init(currentLabelStart ,currentLine); labelCustomTranslation.init(currentLabelStart ,currentLine);
labelCustomTranslation.setText(lang.getString("CustomTranslation")); labelCustomTranslation.setText(lang.getString("CustomTranslation"));
@ -368,6 +411,7 @@ void MenuStateOptions::reloadUI() {
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup")); buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
labelVisibleHud.setText(lang.getString("VisibleHUD")); labelVisibleHud.setText(lang.getString("VisibleHUD"));
labelHealthBars.setText(lang.getString("HealthBars"));
labelChatStaysActive.setText(lang.getString("ChatStaysActive")); labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
labelTimeDisplay.setText(lang.getString("TimeDisplay")); labelTimeDisplay.setText(lang.getString("TimeDisplay"));
@ -922,6 +966,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
checkBoxMouseMoveScrollsWorld.mouseClick(x, y); checkBoxMouseMoveScrollsWorld.mouseClick(x, y);
listCameraMoveSpeed.mouseClick(x, y); listCameraMoveSpeed.mouseClick(x, y);
checkBoxVisibleHud.mouseClick(x, y); checkBoxVisibleHud.mouseClick(x, y);
listBoxHealthBars.mouseClick(x, y);
checkBoxChatStaysActive.mouseClick(x, y); checkBoxChatStaysActive.mouseClick(x, y);
checkBoxTimeDisplay.mouseClick(x, y); checkBoxTimeDisplay.mouseClick(x, y);
checkBoxLuaDisableSecuritySandbox.mouseClick(x, y); checkBoxLuaDisableSecuritySandbox.mouseClick(x, y);
@ -952,6 +997,7 @@ void MenuStateOptions::mouseMove(int x, int y, const MouseState *ms){
checkBoxDisableScreenshotConsoleText.mouseMove(x, y); checkBoxDisableScreenshotConsoleText.mouseMove(x, y);
checkBoxMouseMoveScrollsWorld.mouseMove(x, y); checkBoxMouseMoveScrollsWorld.mouseMove(x, y);
listCameraMoveSpeed.mouseMove(x, y); listCameraMoveSpeed.mouseMove(x, y);
listBoxHealthBars.mouseMove(x, y);
checkBoxVisibleHud.mouseMove(x, y); checkBoxVisibleHud.mouseMove(x, y);
checkBoxChatStaysActive.mouseMove(x, y); checkBoxChatStaysActive.mouseMove(x, y);
checkBoxTimeDisplay.mouseMove(x, y); checkBoxTimeDisplay.mouseMove(x, y);
@ -1039,6 +1085,8 @@ void MenuStateOptions::render(){
renderer.renderListBox(&listCameraMoveSpeed); renderer.renderListBox(&listCameraMoveSpeed);
renderer.renderLabel(&labelVisibleHud); renderer.renderLabel(&labelVisibleHud);
renderer.renderLabel(&labelHealthBars);
renderer.renderListBox(&listBoxHealthBars);
renderer.renderLabel(&labelChatStaysActive); renderer.renderLabel(&labelChatStaysActive);
renderer.renderLabel(&labelTimeDisplay); renderer.renderLabel(&labelTimeDisplay);
@ -1051,7 +1099,7 @@ void MenuStateOptions::render(){
} }
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }
@ -1077,6 +1125,34 @@ void MenuStateOptions::saveConfig(){
config.setBool("DisableScreenshotConsoleText", !checkBoxDisableScreenshotConsoleText.getValue()); config.setBool("DisableScreenshotConsoleText", !checkBoxDisableScreenshotConsoleText.getValue());
config.setBool("MouseMoveScrollsWorld", checkBoxMouseMoveScrollsWorld.getValue()); config.setBool("MouseMoveScrollsWorld", checkBoxMouseMoveScrollsWorld.getValue());
config.setString("CameraMoveSpeed", listCameraMoveSpeed.getSelectedItem()); config.setString("CameraMoveSpeed", listCameraMoveSpeed.getSelectedItem());
int hpIndex=listBoxHealthBars.getSelectedItemIndex();
int hpMode=hbvUndefined;
switch (hpIndex) {
case 0:
hpMode = hbvUndefined;
break;
case 1:
hpMode = hbvOff;
break;
case 2:
hpMode = hbvAlways;
break;
case 3:
hpMode = hbvIfNeeded;
break;
case 4:
hpMode = hbvSelected;
break;
case 5:
hpMode = hbvSelected | hbvIfNeeded;
break;
default:
hpMode = hbvUndefined;
break;
}
config.setInt("HealthBarMode",hpMode );
config.setBool("VisibleHud", checkBoxVisibleHud.getValue()); config.setBool("VisibleHud", checkBoxVisibleHud.getValue());
config.setBool("ChatStaysActive", checkBoxChatStaysActive.getValue()); config.setBool("ChatStaysActive", checkBoxChatStaysActive.getValue());
config.setBool("TimeDisplay", checkBoxTimeDisplay.getValue()); config.setBool("TimeDisplay", checkBoxTimeDisplay.getValue());

View File

@ -63,6 +63,9 @@ private:
GraphicLabel labelVisibleHud; GraphicLabel labelVisibleHud;
GraphicCheckBox checkBoxVisibleHud; GraphicCheckBox checkBoxVisibleHud;
GraphicLabel labelHealthBars;
GraphicListBox listBoxHealthBars;
GraphicLabel labelTimeDisplay; GraphicLabel labelTimeDisplay;
GraphicCheckBox checkBoxTimeDisplay; GraphicCheckBox checkBoxTimeDisplay;
GraphicLabel labelChatStaysActive; GraphicLabel labelChatStaysActive;

View File

@ -167,6 +167,21 @@ MenuStateOptionsGraphics::MenuStateOptionsGraphics(Program *program, MainMenu *m
listBoxFilter.setSelectedItem(config.getString("Filter")); listBoxFilter.setSelectedItem(config.getString("Filter"));
currentLine-=lineOffset; currentLine-=lineOffset;
//FilterMaxAnisotropy
labelFilterMaxAnisotropy.registerGraphicComponent(containerName,"labelFilterMaxAnisotropy");
labelFilterMaxAnisotropy.init(currentLabelStart, currentLine);
labelFilterMaxAnisotropy.setText(lang.getString("FilterMaxAnisotropy"));
listBoxFilterMaxAnisotropy.registerGraphicComponent(containerName,"listBoxFilterMaxAnisotropy");
listBoxFilterMaxAnisotropy.init(currentColumnStart, currentLine, 200);
listBoxFilterMaxAnisotropy.pushBackItem("1");
listBoxFilterMaxAnisotropy.pushBackItem("2");
listBoxFilterMaxAnisotropy.pushBackItem("4");
listBoxFilterMaxAnisotropy.pushBackItem("8");
listBoxFilterMaxAnisotropy.pushBackItem("16");
listBoxFilterMaxAnisotropy.setSelectedItem(config.getString("FilterMaxAnisotropy","1"));
currentLine-=lineOffset;
//selectionType //selectionType
labelSelectionType.registerGraphicComponent(containerName,"labelSelectionType"); labelSelectionType.registerGraphicComponent(containerName,"labelSelectionType");
labelSelectionType.init(currentLabelStart, currentLine); labelSelectionType.init(currentLabelStart, currentLine);
@ -404,6 +419,15 @@ void MenuStateOptionsGraphics::reloadUI() {
listboxData.push_back("Trilinear"); listboxData.push_back("Trilinear");
listBoxFilter.setItems(listboxData); listBoxFilter.setItems(listboxData);
labelFilterMaxAnisotropy.setText(lang.getString("FilterMaxAnisotropy"));
listboxData.clear();
listboxData.push_back("1");
listboxData.push_back("2");
listboxData.push_back("4");
listboxData.push_back("8");
listboxData.push_back("16");
listBoxFilterMaxAnisotropy.setItems(listboxData);
listboxData.clear(); listboxData.clear();
for (float f=0.0;f<2.1f;f=f+0.1f) { for (float f=0.0;f<2.1f;f=f+0.1f) {
listboxData.push_back(floatToStr(f)); listboxData.push_back(floatToStr(f));
@ -591,6 +615,14 @@ void MenuStateOptionsGraphics::mouseClick(int x, int y, MouseButton mouseButton)
if(selectedMode == NULL) { if(selectedMode == NULL) {
throw megaglest_runtime_error("selectedMode == NULL"); throw megaglest_runtime_error("selectedMode == NULL");
} }
#if defined(__APPLE__)
mainMessageBoxState=1;
mainMessageBox.init(lang.getString("Ok"),lang.getString("Cancel"));
screenModeChangedTimer= time(NULL);
showMessageBox(lang.getString("RestartNeeded"), lang.getString("ResolutionChanged"), false);
#else
WindowGl *window = this->program->getWindow(); WindowGl *window = this->program->getWindow();
window->ChangeVideoMode(true, window->ChangeVideoMode(true,
selectedMode->width, selectedMode->width,
@ -609,8 +641,9 @@ void MenuStateOptionsGraphics::mouseClick(int x, int y, MouseButton mouseButton)
mainMessageBoxState=1; mainMessageBoxState=1;
mainMessageBox.init(lang.getString("Ok"),lang.getString("Cancel")); mainMessageBox.init(lang.getString("Ok"),lang.getString("Cancel"));
screenModeChangedTimer= time(NULL); screenModeChangedTimer= time(NULL);
//showMessageBox(lang.getString("RestartNeeded"), lang.getString("ResolutionChanged"), false);
showMessageBox(lang.getString("ResolutionChanged"), lang.getString("Notice"), false); showMessageBox(lang.getString("ResolutionChanged"), lang.getString("Notice"), false);
#endif
//No saveConfig() here! this is done by the messageBox //No saveConfig() here! this is done by the messageBox
return; return;
} }
@ -687,6 +720,7 @@ void MenuStateOptionsGraphics::mouseClick(int x, int y, MouseButton mouseButton)
listBoxShadowTextureSize.mouseClick(x, y); listBoxShadowTextureSize.mouseClick(x, y);
listBoxShadowIntensity.mouseClick(x, y); listBoxShadowIntensity.mouseClick(x, y);
listBoxFilter.mouseClick(x, y); listBoxFilter.mouseClick(x, y);
listBoxFilterMaxAnisotropy.mouseClick(x, y);
if(listBoxGammaCorrection.mouseClick(x, y)){ if(listBoxGammaCorrection.mouseClick(x, y)){
float gammaValue=strToFloat(listBoxGammaCorrection.getSelectedItem()); float gammaValue=strToFloat(listBoxGammaCorrection.getSelectedItem());
if(gammaValue!=0.0){ if(gammaValue!=0.0){
@ -724,6 +758,7 @@ void MenuStateOptionsGraphics::mouseMove(int x, int y, const MouseState *ms){
buttonAutoConfig.mouseMove(x, y); buttonAutoConfig.mouseMove(x, y);
buttonVideoInfo.mouseMove(x, y); buttonVideoInfo.mouseMove(x, y);
listBoxFilter.mouseMove(x, y); listBoxFilter.mouseMove(x, y);
listBoxFilterMaxAnisotropy.mouseMove(x, y);
listBoxGammaCorrection.mouseMove(x, y); listBoxGammaCorrection.mouseMove(x, y);
listBoxShadowIntensity.mouseMove(x, y); listBoxShadowIntensity.mouseMove(x, y);
listBoxSelectionType.mouseMove(x, y); listBoxSelectionType.mouseMove(x, y);
@ -800,6 +835,7 @@ void MenuStateOptionsGraphics::render(){
renderer.renderCheckBox(&checkBoxMapPreview); renderer.renderCheckBox(&checkBoxMapPreview);
renderer.renderListBox(&listBoxLights); renderer.renderListBox(&listBoxLights);
renderer.renderListBox(&listBoxFilter); renderer.renderListBox(&listBoxFilter);
renderer.renderListBox(&listBoxFilterMaxAnisotropy);
renderer.renderListBox(&listBoxGammaCorrection); renderer.renderListBox(&listBoxGammaCorrection);
renderer.renderListBox(&listBoxShadowIntensity); renderer.renderListBox(&listBoxShadowIntensity);
renderer.renderLabel(&labelShadows); renderer.renderLabel(&labelShadows);
@ -811,6 +847,7 @@ void MenuStateOptionsGraphics::render(){
renderer.renderLabel(&labelMapPreview); renderer.renderLabel(&labelMapPreview);
renderer.renderLabel(&labelLights); renderer.renderLabel(&labelLights);
renderer.renderLabel(&labelFilter); renderer.renderLabel(&labelFilter);
renderer.renderLabel(&labelFilterMaxAnisotropy);
renderer.renderLabel(&labelGammaCorrection); renderer.renderLabel(&labelGammaCorrection);
renderer.renderLabel(&labelShadowIntensity); renderer.renderLabel(&labelShadowIntensity);
renderer.renderLabel(&labelScreenModes); renderer.renderLabel(&labelScreenModes);
@ -836,7 +873,7 @@ void MenuStateOptionsGraphics::render(){
renderer.renderCheckBox(&checkBoxVideos); renderer.renderCheckBox(&checkBoxVideos);
} }
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }
@ -864,6 +901,7 @@ void MenuStateOptionsGraphics::saveConfig(){
config.setBool("Windowed", checkBoxFullscreenWindowed.getValue()); config.setBool("Windowed", checkBoxFullscreenWindowed.getValue());
config.setString("Filter", listBoxFilter.getSelectedItem()); config.setString("Filter", listBoxFilter.getSelectedItem());
config.setInt("FilterMaxAnisotropy", strToInt(listBoxFilterMaxAnisotropy.getSelectedItem()));
config.setFloat("GammaValue", strToFloat(listBoxGammaCorrection.getSelectedItem())); config.setFloat("GammaValue", strToFloat(listBoxGammaCorrection.getSelectedItem()));
config.setFloat("ShadowIntensity", strToFloat(listBoxShadowIntensity.getSelectedItem())); config.setFloat("ShadowIntensity", strToFloat(listBoxShadowIntensity.getSelectedItem()));
config.setBool("Textures3D", checkBoxTextures3D.getValue()); config.setBool("Textures3D", checkBoxTextures3D.getValue());

View File

@ -39,6 +39,9 @@ private:
GraphicListBox listBoxShadows; GraphicListBox listBoxShadows;
GraphicLabel labelFilter; GraphicLabel labelFilter;
GraphicListBox listBoxFilter; GraphicListBox listBoxFilter;
GraphicLabel labelFilterMaxAnisotropy;
GraphicListBox listBoxFilterMaxAnisotropy;
GraphicLabel labelTextures3D; GraphicLabel labelTextures3D;
GraphicCheckBox checkBoxTextures3D; GraphicCheckBox checkBoxTextures3D;
GraphicLabel labelLights; GraphicLabel labelLights;

View File

@ -499,7 +499,7 @@ void MenuStateOptionsNetwork::render(){
} }
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }

View File

@ -410,7 +410,7 @@ void MenuStateOptionsSound::render(){
} }
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }

View File

@ -25,6 +25,7 @@
#include "network_message.h" #include "network_message.h"
#include "socket.h" #include "socket.h"
#include "auto_test.h" #include "auto_test.h"
#include <stdio.h>
#include "leak_dumper.h" #include "leak_dumper.h"
@ -34,10 +35,16 @@ namespace Glest{ namespace Game{
// class MenuStateRoot // class MenuStateRoot
// ===================================================== // =====================================================
bool MenuStateRoot::gameUpdateChecked = false;
MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu): MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
MenuState(program, mainMenu, "root") MenuState(program, mainMenu, "root"), updatesHttpServerThread(NULL)
{ {
containerName = "MainMenu"; containerName = "MainMenu";
ftpClientThread = NULL;
lastDownloadProgress = 0;
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
int yPos=440; int yPos=440;
@ -87,6 +94,10 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
errorMessageBox.init(lang.getString("Ok")); errorMessageBox.init(lang.getString("Ok"));
errorMessageBox.setEnabled(false); errorMessageBox.setEnabled(false);
ftpMessageBox.registerGraphicComponent(containerName,"ftpMessageBox");
ftpMessageBox.init(lang.getString("Yes"), lang.getString("No"));
ftpMessageBox.setEnabled(false);
//PopupMenu popupMenu; //PopupMenu popupMenu;
std::vector<string> menuItems; std::vector<string> menuItems;
menuItems.push_back("1"); menuItems.push_back("1");
@ -101,6 +112,57 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
GraphicComponent::applyAllCustomProperties(containerName); GraphicComponent::applyAllCustomProperties(containerName);
} }
MenuStateRoot::~MenuStateRoot() {
if(updatesHttpServerThread != NULL) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
updatesHttpServerThread->setSimpleTaskInterfaceValid(false);
updatesHttpServerThread->signalQuit();
updatesHttpServerThread->setThreadOwnerValid(false);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
if( updatesHttpServerThread->canShutdown(true) == true &&
updatesHttpServerThread->shutdownAndWait() == true) {
delete updatesHttpServerThread;
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
updatesHttpServerThread = NULL;
}
if(ftpClientThread != NULL) {
ftpClientThread->setCallBackObject(NULL);
ftpClientThread->signalQuit();
sleep(0);
if(ftpClientThread->canShutdown(true) == true &&
ftpClientThread->shutdownAndWait() == true) {
delete ftpClientThread;
}
else {
char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s %d] Error cannot shutdown ftpClientThread\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
//SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf);
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
//publishToMasterserverThread->cleanup();
}
ftpClientThread = NULL;
// ftpClientThread->signalQuit();
// ftpClientThread->setCallBackObject(NULL);
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
// if( ftpClientThread->shutdownAndWait() == true) {
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
// delete ftpClientThread;
// }
// ftpClientThread = NULL;
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
}
void MenuStateRoot::reloadUI() { void MenuStateRoot::reloadUI() {
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
@ -122,6 +184,8 @@ void MenuStateRoot::reloadUI() {
mainMessageBox.init(lang.getString("Yes"), lang.getString("No")); mainMessageBox.init(lang.getString("Yes"), lang.getString("No"));
errorMessageBox.init(lang.getString("Ok")); errorMessageBox.init(lang.getString("Ok"));
ftpMessageBox.init(lang.getString("Yes"), lang.getString("No"));
console.resetFonts(); console.resetFonts();
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName); GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
@ -163,6 +227,28 @@ void MenuStateRoot::mouseClick(int x, int y, MouseButton mouseButton){
errorMessageBox.setEnabled(false); errorMessageBox.setEnabled(false);
} }
} }
else if(ftpMessageBox.getEnabled()) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
int button= 0;
if(ftpMessageBox.mouseClick(x, y, button)) {
ftpMessageBox.setEnabled(false);
if(button == 0) {
startFTPClientIfRequired();
lastDownloadProgress = 0;
printf("Adding ftpFileName [%s] ftpFileURL [%s]\n",ftpFileName.c_str(),ftpFileURL.c_str());
if(ftpClientThread != NULL) ftpClientThread->addTempFileToRequests(ftpFileName,ftpFileURL);
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),mutexOwnerId);
if(ftpClientThread != NULL && ftpClientThread->getProgressMutex() != NULL) ftpClientThread->getProgressMutex()->setOwnerId(mutexOwnerId);
fileFTPProgressList[ftpFileName] = pair<int,string>(0,"");
safeMutexFTPProgress.ReleaseLock();
}
}
}
else if(mainMessageBox.getEnabled() == false && buttonNewGame.mouseClick(x, y)){ else if(mainMessageBox.getEnabled() == false && buttonNewGame.mouseClick(x, y)){
soundRenderer.playFx(coreData.getClickSoundB()); soundRenderer.playFx(coreData.getClickSoundB());
mainMenu->setState(new MenuStateNewGame(program, mainMenu)); mainMenu->setState(new MenuStateNewGame(program, mainMenu));
@ -196,6 +282,201 @@ void MenuStateRoot::mouseClick(int x, int y, MouseButton mouseButton){
} }
} }
void MenuStateRoot::startFTPClientIfRequired() {
if(ftpClientThread == NULL) {
// Setup File Transfer thread
Config &config = Config::getInstance();
vector<string> tilesetFiles;
vector<string> tilesetFilesUserData;
vector<string> techTreeFiles;
vector<string> techTreeFilesUserData;
findDirs(config.getPathListForType(ptTilesets), tilesetFiles);
findDirs(config.getPathListForType(ptTechs), techTreeFiles);
vector<string> mapPathList = config.getPathListForType(ptMaps);
std::pair<string,string> mapsPath;
if(mapPathList.empty() == false) {
mapsPath.first = mapPathList[0];
}
if(mapPathList.size() > 1) {
mapsPath.second = mapPathList[1];
}
std::pair<string,string> tilesetsPath;
vector<string> tilesetsList = Config::getInstance().getPathListForType(ptTilesets);
if(tilesetsList.empty() == false) {
tilesetsPath.first = tilesetsList[0];
if(tilesetsList.size() > 1) {
tilesetsPath.second = tilesetsList[1];
}
}
std::pair<string,string> techtreesPath;
vector<string> techtreesList = Config::getInstance().getPathListForType(ptTechs);
if(techtreesList.empty() == false) {
techtreesPath.first = techtreesList[0];
if(techtreesList.size() > 1) {
techtreesPath.second = techtreesList[1];
}
}
std::pair<string,string> scenariosPath;
vector<string> scenariosList = Config::getInstance().getPathListForType(ptScenarios);
if(scenariosList.empty() == false) {
scenariosPath.first = scenariosList[0];
if(scenariosList.size() > 1) {
scenariosPath.second = scenariosList[1];
}
}
string fileArchiveExtension = config.getString("FileArchiveExtension","");
string fileArchiveExtractCommand = config.getString("FileArchiveExtractCommand","");
string fileArchiveExtractCommandParameters = config.getString("FileArchiveExtractCommandParameters","");
int32 fileArchiveExtractCommandSuccessResult = config.getInt("FileArchiveExtractCommandSuccessResult","0");
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
console.setOnlyChatMessagesInStoredLines(false);
// Get path to temp files
string tempFilePath = "temp/";
if(getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) != "") {
tempFilePath = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) + tempFilePath;
}
else {
string userData = config.getString("UserData_Root","");
if(userData != "") {
endPathWithSlash(userData);
}
tempFilePath = userData + tempFilePath;
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Temp files path [%s]\n",tempFilePath.c_str());
ftpClientThread = new FTPClientThread(-1,"",
mapsPath,tilesetsPath,techtreesPath,scenariosPath,
this,fileArchiveExtension,fileArchiveExtractCommand,
fileArchiveExtractCommandParameters,
fileArchiveExtractCommandSuccessResult,
tempFilePath);
ftpClientThread->start();
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
}
}
void MenuStateRoot::FTPClient_CallbackEvent(string itemName,
FTP_Client_CallbackType type, pair<FTP_Client_ResultType,string> result,void *userdata) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
Lang &lang= Lang::getInstance();
if(type == ftp_cct_DownloadProgress) {
FTPClientCallbackInterface::FtpProgressStats *stats = (FTPClientCallbackInterface::FtpProgressStats *)userdata;
if(stats != NULL) {
int fileProgress = 0;
if(stats->download_total > 0) {
fileProgress = ((stats->download_now / stats->download_total) * 100.0);
}
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Got FTP Callback for [%s] current file [%s] fileProgress = %d [now = %f, total = %f]\n",itemName.c_str(),stats->currentFilename.c_str(), fileProgress,stats->download_now,stats->download_total);
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),mutexOwnerId);
if(ftpClientThread != NULL && ftpClientThread->getProgressMutex() != NULL) ftpClientThread->getProgressMutex()->setOwnerId(mutexOwnerId);
pair<int,string> lastProgress = fileFTPProgressList[itemName];
fileFTPProgressList[itemName] = pair<int,string>(fileProgress,stats->currentFilename);
safeMutexFTPProgress.ReleaseLock();
if(itemName != "" && (lastDownloadProgress < fileProgress && fileProgress % 25 == 0)) {
lastDownloadProgress = fileProgress;
char szBuf[8096]="";
snprintf(szBuf,8096,"Downloaded %d%% of file: %s",fileProgress,itemName.c_str());
console.addLine(szBuf);
}
}
}
else if(type == ftp_cct_ExtractProgress) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Got FTP extract Callback for [%s] result = %d [%s]\n",itemName.c_str(),result.first,result.second.c_str());
printf("Got FTP extract Callback for [%s] result = %d [%s]\n",itemName.c_str(),result.first,result.second.c_str());
if(userdata == NULL) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.getString("DataMissingExtractDownloadMod").c_str(),itemName.c_str());
//printf("%s\n",szBuf);
console.addLine(szBuf,true);
}
else {
char *szBuf = (char *)userdata;
//printf("%s\n",szBuf);
console.addLine(szBuf);
}
}
else if(type == ftp_cct_TempFile) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Got FTP Callback for [%s] result = %d [%s]\n",itemName.c_str(),result.first,result.second.c_str());
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),mutexOwnerId);
if(ftpClientThread != NULL && ftpClientThread->getProgressMutex() != NULL) ftpClientThread->getProgressMutex()->setOwnerId(mutexOwnerId);
fileFTPProgressList.erase(itemName);
safeMutexFTPProgress.ReleaseLock();
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("### downloaded TEMP file [%s] result = %d\n",itemName.c_str(),result.first);
if(result.first == ftp_crt_SUCCESS) {
// Get path to temp files
string tempFilePath = "temp/";
if(getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) != "") {
tempFilePath = getGameReadWritePath(GameConstants::path_logs_CacheLookupKey) + tempFilePath;
}
else {
Config &config = Config::getInstance();
string userData = config.getString("UserData_Root","");
if(userData != "") {
endPathWithSlash(userData);
}
tempFilePath = userData + tempFilePath;
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Temp files path [%s]\n",tempFilePath.c_str());
// Delete the downloaded archive
if(fileExists(tempFilePath + itemName)) {
removeFile(tempFilePath + itemName);
}
bool result = upgradeFilesInTemp();
if(result == false) {
string binaryName = Properties::getApplicationPath() + extractFileFromDirectoryPath(PlatformExceptionHandler::application_binary);
string binaryNameOld = Properties::getApplicationPath() + extractFileFromDirectoryPath(PlatformExceptionHandler::application_binary) + "__REMOVE";
bool resultRename = renameFile(binaryName,binaryNameOld);
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Rename: [%s] to [%s] result = %d\n",binaryName.c_str(),binaryNameOld.c_str(),resultRename);
printf("#1 Rename: [%s] to [%s] result = %d errno = %d\n",binaryName.c_str(),binaryNameOld.c_str(),resultRename, errno);
//result = upgradeFilesInTemp();
binaryName = Properties::getApplicationPath() + extractFileFromDirectoryPath(PlatformExceptionHandler::application_binary);
binaryNameOld = tempFilePath + extractFileFromDirectoryPath(PlatformExceptionHandler::application_binary);
resultRename = renameFile(binaryNameOld, binaryName);
//if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Rename: [%s] to [%s] result = %d\n",binaryName.c_str(),binaryNameOld.c_str(),resultRename);
printf("#2 Rename: [%s] to [%s] result = %d errno = %d\n",binaryNameOld.c_str(),binaryName.c_str(),resultRename, errno);
}
console.addLine("Successfully updated, please restart!",true);
}
else {
curl_version_info_data *curlVersion= curl_version_info(CURLVERSION_NOW);
char szBuf[8096]="";
snprintf(szBuf,8096,"FAILED to download the updates: [%s] using CURL version [%s] [%s]",itemName.c_str(),curlVersion->version,result.second.c_str());
console.addLine(szBuf,true);
showErrorMessageBox(szBuf, "ERROR", false);
}
}
}
void MenuStateRoot::mouseMove(int x, int y, const MouseState *ms){ void MenuStateRoot::mouseMove(int x, int y, const MouseState *ms){
popupMenu.mouseMove(x, y); popupMenu.mouseMove(x, y);
buttonNewGame.mouseMove(x, y); buttonNewGame.mouseMove(x, y);
@ -210,6 +491,9 @@ void MenuStateRoot::mouseMove(int x, int y, const MouseState *ms){
if (errorMessageBox.getEnabled()) { if (errorMessageBox.getEnabled()) {
errorMessageBox.mouseMove(x, y); errorMessageBox.mouseMove(x, y);
} }
if (ftpMessageBox.getEnabled()) {
ftpMessageBox.mouseMove(x, y);
}
} }
bool MenuStateRoot::isMasterserverMode() const { bool MenuStateRoot::isMasterserverMode() const {
@ -279,7 +563,7 @@ void MenuStateRoot::render() {
renderer.renderButton(&buttonExit); renderer.renderButton(&buttonExit);
renderer.renderLabel(&labelVersion); renderer.renderLabel(&labelVersion);
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
renderer.renderPopupMenu(&popupMenu); renderer.renderPopupMenu(&popupMenu);
@ -290,6 +574,9 @@ void MenuStateRoot::render() {
if(errorMessageBox.getEnabled()) { if(errorMessageBox.getEnabled()) {
renderer.renderMessageBox(&errorMessageBox); renderer.renderMessageBox(&errorMessageBox);
} }
if(ftpMessageBox.getEnabled()) {
renderer.renderMessageBox(&ftpMessageBox);
}
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }
@ -304,9 +591,109 @@ void MenuStateRoot::update() {
} }
return; return;
} }
if(gameUpdateChecked == false) {
gameUpdateChecked = true;
string updateCheckURL = Config::getInstance().getString("UpdateCheckURL","");
if(updateCheckURL != "") {
static string mutexOwnerId = string(extractFileFromDirectoryPath(__FILE__).c_str()) + string("_") + intToStr(__LINE__);
updatesHttpServerThread = new SimpleTaskThread(this,1,200);
updatesHttpServerThread->setUniqueID(mutexOwnerId);
updatesHttpServerThread->start();
}
}
console.update(); console.update();
} }
void MenuStateRoot::simpleTask(BaseThread *callingThread,void *userdata) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutexThreadOwner(callingThread->getMutexThreadOwnerValid(),mutexOwnerId);
if(callingThread->getQuitStatus() == true || safeMutexThreadOwner.isValidMutex() == false) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
return;
}
callingThread->getMutexThreadOwnerValid()->setOwnerId(mutexOwnerId);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
string updateCheckURL = Config::getInstance().getString("UpdateCheckURL","");
if(updateCheckURL != "") {
string baseURL = updateCheckURL;
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] About to call first http url, base [%s]..\n",__FILE__,__FUNCTION__,__LINE__,baseURL.c_str());
CURL *handle = SystemFlags::initHTTP();
CURLcode curlResult = CURLE_OK;
string updateMetaData = SystemFlags::getHTTP(baseURL,handle,-1,&curlResult);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("techsMetaData [%s] curlResult = %d\n",updateMetaData.c_str(),curlResult);
if(callingThread->getQuitStatus() == true || safeMutexThreadOwner.isValidMutex() == false) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
return;
}
if(curlResult != CURLE_OK) {
string curlError = curl_easy_strerror(curlResult);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d] curlError [%s]..\n",__FILE__,__FUNCTION__,__LINE__,curlError.c_str());
char szMsg[8096]="";
snprintf(szMsg,8096,"An error was detected while checking for new updates\n%s",curlError.c_str());
showErrorMessageBox(szMsg, "ERROR", false);
}
if(curlResult == CURLE_OK ||
(curlResult != CURLE_COULDNT_RESOLVE_HOST &&
curlResult != CURLE_COULDNT_CONNECT)) {
Properties props;
props.loadFromText(updateMetaData);
int compareResult = compareMajorMinorVersion(glestVersionString, props.getString("LatestGameVersion",""));
if(compareResult==0) {
if(glestVersionString != props.getString("LatestGameVersion","")) {
compareResult = -1;
}
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("compareResult = %d local [%s] remote [%s]\n",compareResult,glestVersionString.c_str(),props.getString("LatestGameVersion","").c_str());
if(compareResult < 0) {
string downloadBinaryKey = "LatestGameBinaryUpdateArchiveURL-" + getPlatformTypeNameString() + getPlatformArchTypeNameString();
if(props.hasString(downloadBinaryKey)) {
ftpFileName = extractFileFromDirectoryPath(props.getString(downloadBinaryKey));
ftpFileURL = props.getString(downloadBinaryKey);
}
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Checking update key downloadBinaryKey [%s] ftpFileURL [%s]\n",downloadBinaryKey.c_str(),ftpFileURL.c_str());
if(props.getBool("AllowUpdateDownloads","false") == false || ftpFileURL == "") {
char szMsg[8096]="";
snprintf(szMsg,8096,"A new update was detected: %s\nUpdate Date: %s\nPlease visit megaglest.org for details!",
props.getString("LatestGameVersion","?").c_str(),
props.getString("LatestGameVersionReleaseDate","?").c_str());
showFTPMessageBox(szMsg, "Update", false, true);
}
else {
char szMsg[8096]="";
snprintf(szMsg,8096,"A new update was detected: %s\nUpdate Date: %s\nDownload update now?",
props.getString("LatestGameVersion","?").c_str(),
props.getString("LatestGameVersionReleaseDate","?").c_str());
showFTPMessageBox(szMsg, "Update", false, false);
}
}
}
SystemFlags::cleanupHTTP(&handle);
}
}
void MenuStateRoot::keyDown(SDL_KeyboardEvent key) { void MenuStateRoot::keyDown(SDL_KeyboardEvent key) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
@ -345,11 +732,11 @@ void MenuStateRoot::keyDown(SDL_KeyboardEvent key) {
} }
void MenuStateRoot::showMessageBox(const string &text, const string &header, bool toggle) { void MenuStateRoot::showMessageBox(const string &text, const string &header, bool toggle) {
if(!toggle){ if(toggle == false) {
mainMessageBox.setEnabled(false); mainMessageBox.setEnabled(false);
} }
if(!mainMessageBox.getEnabled()){ if(mainMessageBox.getEnabled() == false) {
mainMessageBox.setText(text); mainMessageBox.setText(text);
mainMessageBox.setHeader(header); mainMessageBox.setHeader(header);
mainMessageBox.setEnabled(true); mainMessageBox.setEnabled(true);
@ -360,11 +747,11 @@ void MenuStateRoot::showMessageBox(const string &text, const string &header, boo
} }
void MenuStateRoot::showErrorMessageBox(const string &text, const string &header, bool toggle) { void MenuStateRoot::showErrorMessageBox(const string &text, const string &header, bool toggle) {
if(!toggle){ if(toggle == false) {
errorMessageBox.setEnabled(false); errorMessageBox.setEnabled(false);
} }
if(!errorMessageBox.getEnabled()){ if(errorMessageBox.getEnabled() == false) {
errorMessageBox.setText(text); errorMessageBox.setText(text);
errorMessageBox.setHeader(header); errorMessageBox.setHeader(header);
errorMessageBox.setEnabled(true); errorMessageBox.setEnabled(true);
@ -374,4 +761,28 @@ void MenuStateRoot::showErrorMessageBox(const string &text, const string &header
} }
} }
void MenuStateRoot::showFTPMessageBox(const string &text, const string &header, bool toggle, bool okOnly) {
if(toggle == false) {
ftpMessageBox.setEnabled(false);
}
Lang &lang= Lang::getInstance();
if(okOnly) {
ftpMessageBox.init(lang.getString("Ok"));
}
else {
ftpMessageBox.init(lang.getString("Yes"), lang.getString("No"));
}
if(ftpMessageBox.getEnabled() == false) {
ftpMessageBox.setText(text);
ftpMessageBox.setHeader(header);
ftpMessageBox.setEnabled(true);
}
else {
ftpMessageBox.setEnabled(false);
}
}
}}//end namespace }}//end namespace

View File

@ -13,6 +13,9 @@
#define _GLEST_GAME_MENUSTATEROOT_H_ #define _GLEST_GAME_MENUSTATEROOT_H_
#include "main_menu.h" #include "main_menu.h"
#include "simple_threads.h"
#include "miniftpclient.h"
#include "leak_dumper.h" #include "leak_dumper.h"
namespace Glest{ namespace Game{ namespace Glest{ namespace Game{
@ -24,7 +27,7 @@ namespace Glest{ namespace Game{
class GraphicMessageBox; class GraphicMessageBox;
class PopupMenu; class PopupMenu;
class MenuStateRoot: public MenuState { class MenuStateRoot: public MenuState, public SimpleTaskCallbackInterface, public FTPClientCallbackInterface {
private: private:
GraphicButton buttonNewGame; GraphicButton buttonNewGame;
GraphicButton buttonLoadGame; GraphicButton buttonLoadGame;
@ -36,20 +39,36 @@ private:
GraphicMessageBox mainMessageBox; GraphicMessageBox mainMessageBox;
GraphicMessageBox errorMessageBox; GraphicMessageBox errorMessageBox;
GraphicMessageBox ftpMessageBox;
PopupMenu popupMenu; PopupMenu popupMenu;
static bool gameUpdateChecked;
SimpleTaskThread *updatesHttpServerThread;
FTPClientThread *ftpClientThread;
std::map<string,pair<int,string> > fileFTPProgressList;
string ftpFileName;
string ftpFileURL;
int lastDownloadProgress;
virtual void simpleTask(BaseThread *callingThread,void *userdata);
void startFTPClientIfRequired();
virtual void FTPClient_CallbackEvent(string itemName,
FTP_Client_CallbackType type, pair<FTP_Client_ResultType,string> result,void *userdata);
public: public:
MenuStateRoot(Program *program, MainMenu *mainMenu); MenuStateRoot(Program *program, MainMenu *mainMenu);
virtual ~MenuStateRoot();
void mouseClick(int x, int y, MouseButton mouseButton); void mouseClick(int x, int y, MouseButton mouseButton);
void mouseMove(int x, int y, const MouseState *mouseState); void mouseMove(int x, int y, const MouseState *mouseState);
void render(); void render();
void update(); void update();
virtual void keyDown(SDL_KeyboardEvent key); virtual void keyDown(SDL_KeyboardEvent key);
void showMessageBox(const string &text, const string &header, bool toggle);
void showMessageBox(const string &text, const string &header, bool toggle);
void showErrorMessageBox(const string &text, const string &header, bool toggle); void showErrorMessageBox(const string &text, const string &header, bool toggle);
void showFTPMessageBox(const string &text, const string &header, bool toggle, bool okOnly);
virtual bool isMasterserverMode() const; virtual bool isMasterserverMode() const;
virtual void reloadUI(); virtual void reloadUI();

View File

@ -301,7 +301,7 @@ void MenuStateScenario::render(){
renderer.renderButton(&buttonReturn); renderer.renderButton(&buttonReturn);
renderer.renderButton(&buttonPlayNow); renderer.renderButton(&buttonPlayNow);
} }
renderer.renderConsole(&console,false,true); renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox(); if(program != NULL) program->renderProgramMsgBox();
} }

View File

@ -49,6 +49,8 @@ ServerLine::ServerLine(MasterServerInfo *mServerInfo, int lineIndex, int baseY,
//general info: //general info:
//i+= 10; //i+= 10;
glestVersionLabel.init(i, baseY - lineOffset); glestVersionLabel.init(i, baseY - lineOffset);
glestVersionLabel.setRenderBackground(true);
glestVersionLabel.setMaxEditRenderWidth(960); // use background for whole line
glestVersionLabel.setTextColor(color); glestVersionLabel.setTextColor(color);
glestVersionLabel.setText(masterServerInfo.getGlestVersion()); glestVersionLabel.setText(masterServerInfo.getGlestVersion());
glestVersionLabel.setFont(CoreData::getInstance().getDisplayFontSmall()); glestVersionLabel.setFont(CoreData::getInstance().getDisplayFontSmall());
@ -152,6 +154,7 @@ ServerLine::ServerLine(MasterServerInfo *mServerInfo, int lineIndex, int baseY,
i+= 130; i+= 130;
selectButton.init(i, baseY - lineOffset, 30); selectButton.init(i, baseY - lineOffset, 30);
selectButton.setText(">"); selectButton.setText(">");
selectButton.setAlwaysLighted(true);
//printf("glestVersionString [%s] masterServerInfo->getGlestVersion() [%s]\n",glestVersionString.c_str(),masterServerInfo->getGlestVersion().c_str()); //printf("glestVersionString [%s] masterServerInfo->getGlestVersion() [%s]\n",glestVersionString.c_str(),masterServerInfo->getGlestVersion().c_str());
compatible= checkVersionComptability(glestVersionString, masterServerInfo.getGlestVersion()); compatible= checkVersionComptability(glestVersionString, masterServerInfo.getGlestVersion());
@ -218,20 +221,6 @@ bool ServerLine::buttonMouseMove(int x, int y){
void ServerLine::render(){ void ServerLine::render(){
Renderer &renderer= Renderer::getInstance(); Renderer &renderer= Renderer::getInstance();
bool joinEnabled= (masterServerInfo.getNetworkSlots() > masterServerInfo.getConnectedClients());
if(joinEnabled == true){
if(compatible){
selectButton.setEnabled(true);
selectButton.setVisible(true);
renderer.renderButton(&selectButton);
}
}
else{
selectButton.setEnabled(false);
selectButton.setVisible(false);
}
//general info: //general info:
renderer.renderLabel(&glestVersionLabel); renderer.renderLabel(&glestVersionLabel);
renderer.renderLabel(&platformLabel); renderer.renderLabel(&platformLabel);
@ -264,6 +253,18 @@ void ServerLine::render(){
} }
renderer.renderLabel(&status); renderer.renderLabel(&status);
bool joinEnabled= (masterServerInfo.getNetworkSlots() > masterServerInfo.getConnectedClients());
if(joinEnabled == true){
if(compatible){
selectButton.setEnabled(true);
selectButton.setVisible(true);
renderer.renderButton(&selectButton);
}
}
else{
selectButton.setEnabled(false);
selectButton.setVisible(false);
}
} }
void ServerLine::setY(int y){ void ServerLine::setY(int y){

View File

@ -250,6 +250,11 @@ void ConnectionSlotThread::execute() {
//bool socketHasReadData = Socket::hasDataToRead(socket->getSocketId()); //bool socketHasReadData = Socket::hasDataToRead(socket->getSocketId());
bool socketHasReadData = Socket::hasDataToReadWithWait(socketId,150000); bool socketHasReadData = Socket::hasDataToReadWithWait(socketId,150000);
if(getQuitStatus() == true) {
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
break;
}
ConnectionSlotEvent eventCopy; ConnectionSlotEvent eventCopy;
eventCopy.eventType = eReceiveSocketData; eventCopy.eventType = eReceiveSocketData;
eventCopy.connectionSlot = this->slotInterface->getSlot(slotIndex,true); eventCopy.connectionSlot = this->slotInterface->getSlot(slotIndex,true);

View File

@ -2866,7 +2866,7 @@ std::map<string,string> ServerInterface::publishToMasterserver() {
publishToServerInfo["glestVersion"] = glestVersionString; publishToServerInfo["glestVersion"] = glestVersionString;
publishToServerInfo["platform"] = getPlatformNameString() + "-" + getGITRevisionString(); publishToServerInfo["platform"] = getPlatformNameString() + "-" + getGITRevisionString();
publishToServerInfo["binaryCompileDate"] = getCompileDateTime(); publishToServerInfo["binaryCompileDate"] = getCompileDateTime();
publishToServerInfo["serverTitle"] = getHumanPlayerName() + "'s game"; publishToServerInfo["serverTitle"] = this->getGameSettings()->getGameName();
publishToServerInfo["tech"] = this->getGameSettings()->getTech(); publishToServerInfo["tech"] = this->getGameSettings()->getTech();
publishToServerInfo["map"] = this->getGameSettings()->getMap(); publishToServerInfo["map"] = this->getGameSettings()->getMap();
publishToServerInfo["tileset"] = this->getGameSettings()->getTileset(); publishToServerInfo["tileset"] = this->getGameSettings()->getTileset();

View File

@ -673,6 +673,19 @@ bool Faction::canUnitsPathfind() {
return result; return result;
} }
void Faction::setLockedUnitForFaction(const UnitType *ut, bool lock) {
if (lock) {
lockedUnits.insert(ut);
} else {
std::set<const UnitType*>::iterator it;
it=lockedUnits.find(ut);
if(it!=lockedUnits.end()) {
lockedUnits.erase(it);
}
}
}
void Faction::signalWorkerThread(int frameIndex) { void Faction::signalWorkerThread(int frameIndex) {
if(workerThread != NULL) { if(workerThread != NULL) {
workerThread->signalPathfinder(frameIndex); workerThread->signalPathfinder(frameIndex);
@ -718,9 +731,13 @@ void Faction::init(
store[index].init(rt, 0); store[index].init(rt, 0);
this->world->initTeamResource(rt,this->teamIndex,0); this->world->initTeamResource(rt,this->teamIndex,0);
this->updateUnitTypeWithResourceCostCache(rt);
} }
} }
//initialize cache
for(int index = 0; index < techTree->getResourceTypeCount(); ++index) {
const ResourceType *rt = techTree->getResourceType(index);
this->updateUnitTypeWithResourceCostCache(rt);
}
texture= Renderer::getInstance().newTexture2D(rsGame); texture= Renderer::getInstance().newTexture2D(rsGame);
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey); string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
@ -913,6 +930,10 @@ bool Faction::reqsOk(const RequirableType *rt) const {
return false; return false;
} }
} }
if(producedUnitType != NULL && isUnitLocked(producedUnitType)) {
return false;
}
} }
return true; return true;
@ -1203,13 +1224,13 @@ void Faction::applyCostsOnInterval(const ResourceType *rtApply) {
//decrease unit hp //decrease unit hp
if(scriptManager->getPlayerModifiers(this->index)->getConsumeEnabled() == true) { if(scriptManager->getPlayerModifiers(this->index)->getConsumeEnabled() == true) {
bool decHpResult = unit->decHp(unit->getType()->getMaxHp() / 3); bool decHpResult = unit->decHp(unit->getType()->getTotalMaxHp(unit->getTotalUpgrade()) / 3);
if(decHpResult) { if(decHpResult) {
unit->setCauseOfDeath(ucodStarvedResource); unit->setCauseOfDeath(ucodStarvedResource);
world->getStats()->die(unit->getFactionIndex(),unit->getType()->getCountUnitDeathInStats()); world->getStats()->die(unit->getFactionIndex(),unit->getType()->getCountUnitDeathInStats());
scriptManager->onUnitDied(unit); scriptManager->onUnitDied(unit);
} }
StaticSound *sound= unit->getType()->getFirstStOfClass(scDie)->getSound(); StaticSound *sound= static_cast<const DieSkillType *>(unit->getType()->getFirstStOfClass(scDie))->getSound();
if(sound != NULL && if(sound != NULL &&
(thisFaction == true || world->showWorldForPlayer(world->getThisTeamIndex()) == true)) { (thisFaction == true || world->showWorldForPlayer(world->getThisTeamIndex()) == true)) {
SoundRenderer::getInstance().playFx(sound); SoundRenderer::getInstance().playFx(sound);
@ -1261,6 +1282,20 @@ bool Faction::isAlly(const Faction *faction) {
// ================== misc ================== // ================== misc ==================
void Faction::incResourceAmount(const ResourceType *rt, int amount) { void Faction::incResourceAmount(const ResourceType *rt, int amount) {
if (world != NULL && world->getGame() != NULL
&& world->getGame()->isFlagType1BitEnabled(
ft1_allow_shared_team_resources) == true) {
for(int i=0; i < (int)resources.size(); ++i) {
Resource *r= &resources[i];
if(r->getType()==rt) {
r->setAmount(r->getAmount()+amount);
if(r->getType()->getClass() != rcStatic && (getResource(rt,false)->getAmount()+amount)>getStoreAmount(rt,false)) {
r->setAmount(getStoreAmount(rt,false)-(getResource(rt,false)->getAmount()-r->getAmount()));
}
return;
}
}
} else {
for(int i=0; i < (int)resources.size(); ++i) { for(int i=0; i < (int)resources.size(); ++i) {
Resource *r= &resources[i]; Resource *r= &resources[i];
if(r->getType()==rt) { if(r->getType()==rt) {
@ -1271,6 +1306,7 @@ void Faction::incResourceAmount(const ResourceType *rt, int amount) {
return; return;
} }
} }
}
assert(false); assert(false);
} }
@ -1318,7 +1354,7 @@ void Faction::removeUnit(Unit *unit){
//assert(false); //assert(false);
} }
void Faction::addStore(const UnitType *unitType, bool replaceStorage) { void Faction::addStore(const UnitType *unitType) {
assert(unitType != NULL); assert(unitType != NULL);
for(int newUnitStoredResourceIndex = 0; for(int newUnitStoredResourceIndex = 0;
newUnitStoredResourceIndex < unitType->getStoredResourceCount(); newUnitStoredResourceIndex < unitType->getStoredResourceCount();
@ -1331,16 +1367,11 @@ void Faction::addStore(const UnitType *unitType, bool replaceStorage) {
Resource *storedResource= &store[currentStoredResourceIndex]; Resource *storedResource= &store[currentStoredResourceIndex];
if(storedResource->getType() == newUnitStoredResource->getType()) { if(storedResource->getType() == newUnitStoredResource->getType()) {
if(replaceStorage == true) {
storedResource->setAmount(newUnitStoredResource->getAmount());
}
else {
storedResource->setAmount(storedResource->getAmount() + newUnitStoredResource->getAmount()); storedResource->setAmount(storedResource->getAmount() + newUnitStoredResource->getAmount());
} }
} }
} }
} }
}
void Faction::removeStore(const UnitType *unitType){ void Faction::removeStore(const UnitType *unitType){
assert(unitType != NULL); assert(unitType != NULL);
@ -1357,6 +1388,17 @@ void Faction::removeStore(const UnitType *unitType){
} }
void Faction::limitResourcesToStore() { void Faction::limitResourcesToStore() {
if (world != NULL && world->getGame() != NULL
&& world->getGame()->isFlagType1BitEnabled(
ft1_allow_shared_team_resources) == true) {
for(int i=0; i < (int)resources.size(); ++i) {
Resource *r= &resources[i];
const ResourceType *rt= r->getType();
if(rt->getClass() != rcStatic && (getResource(rt,false)->getAmount())>getStoreAmount(rt,false)) {
r->setAmount(getStoreAmount(rt,false)-(getResource(rt,false)->getAmount()-r->getAmount()));
}
}
} else {
for(int i=0; i < (int)resources.size(); ++i) { for(int i=0; i < (int)resources.size(); ++i) {
Resource *r= &resources[i]; Resource *r= &resources[i];
Resource *s= &store[i]; Resource *s= &store[i];
@ -1365,6 +1407,7 @@ void Faction::limitResourcesToStore() {
} }
} }
} }
}
void Faction::resetResourceAmount(const ResourceType *rt){ void Faction::resetResourceAmount(const ResourceType *rt){
for(int i=0; i < (int)resources.size(); ++i){ for(int i=0; i < (int)resources.size(); ++i){
@ -2250,6 +2293,13 @@ void Faction::saveGame(XmlNode *rootNode) {
factionNode->addAttribute("currentSwitchTeamVoteFactionIndex",intToStr(currentSwitchTeamVoteFactionIndex), mapTagReplacements); factionNode->addAttribute("currentSwitchTeamVoteFactionIndex",intToStr(currentSwitchTeamVoteFactionIndex), mapTagReplacements);
factionNode->addAttribute("allowSharedTeamUnits",intToStr(allowSharedTeamUnits), mapTagReplacements); factionNode->addAttribute("allowSharedTeamUnits",intToStr(allowSharedTeamUnits), mapTagReplacements);
for(std::set<const UnitType*>::iterator iterMap = lockedUnits.begin();
iterMap != lockedUnits.end(); ++iterMap) {
XmlNode *lockedUnitsListNode = factionNode->addChild("lockedUnitList");
const UnitType *ut=*iterMap;
lockedUnitsListNode->addAttribute("value",ut->getName(false), mapTagReplacements);
}
for(std::map<int,int>::iterator iterMap = unitsMovingList.begin(); for(std::map<int,int>::iterator iterMap = unitsMovingList.begin();
iterMap != unitsMovingList.end(); ++iterMap) { iterMap != unitsMovingList.end(); ++iterMap) {
@ -2342,6 +2392,14 @@ void Faction::loadGame(const XmlNode *rootNode, int factionIndex,GameSettings *s
random.setLastNumber(factionNode->getAttribute("random")->getIntValue()); random.setLastNumber(factionNode->getAttribute("random")->getIntValue());
vector<XmlNode *> lockedUnitsListNodeList = factionNode->getChildList("lockedUnitList");
for(unsigned int i = 0; i < lockedUnitsListNodeList.size(); ++i) {
XmlNode *lockedUnitsListNode = lockedUnitsListNodeList[i];
string unitName = lockedUnitsListNode->getAttribute("value")->getValue();
lockedUnits.insert(getType()->getUnitType(unitName));
}
vector<XmlNode *> unitsMovingListNodeList = factionNode->getChildList("unitsMovingList"); vector<XmlNode *> unitsMovingListNodeList = factionNode->getChildList("unitsMovingList");
for(unsigned int i = 0; i < unitsMovingListNodeList.size(); ++i) { for(unsigned int i = 0; i < unitsMovingListNodeList.size(); ++i) {
XmlNode *unitsMovingListNode = unitsMovingListNodeList[i]; XmlNode *unitsMovingListNode = unitsMovingListNodeList[i];

View File

@ -174,6 +174,8 @@ private:
std::map<int,int> unitsMovingList; std::map<int,int> unitsMovingList;
std::map<int,int> unitsPathfindingList; std::map<int,int> unitsPathfindingList;
std::set<const UnitType*> lockedUnits;
TechTree *techTree; TechTree *techTree;
const XmlNode *loadWorldNode; const XmlNode *loadWorldNode;
@ -244,6 +246,9 @@ public:
void clearUnitsPathfinding(); void clearUnitsPathfinding();
bool canUnitsPathfind(); bool canUnitsPathfind();
void setLockedUnitForFaction(const UnitType *ut, bool lock);
bool isUnitLocked(const UnitType *ut) const { return lockedUnits.find(ut)!=lockedUnits.end(); }
void init( void init(
FactionType *factionType, ControlType control, TechTree *techTree, Game *game, FactionType *factionType, ControlType control, TechTree *techTree, Game *game,
int factionIndex, int teamIndex, int startLocationIndex, bool thisFaction, int factionIndex, int teamIndex, int startLocationIndex, bool thisFaction,
@ -324,7 +329,7 @@ public:
Unit *findUnit(int id) const; Unit *findUnit(int id) const;
void addUnit(Unit *unit); void addUnit(Unit *unit);
void removeUnit(Unit *unit); void removeUnit(Unit *unit);
void addStore(const UnitType *unitType, bool replaceStorage); void addStore(const UnitType *unitType);
void removeStore(const UnitType *unitType); void removeStore(const UnitType *unitType);
//resources //resources

View File

@ -113,6 +113,7 @@ void Object::initParticlesFromTypes(const ModelParticleSystemTypes *particleType
for(ObjectParticleSystemTypes::const_iterator it= particleTypes->begin(); it != particleTypes->end(); ++it){ for(ObjectParticleSystemTypes::const_iterator it= particleTypes->begin(); it != particleTypes->end(); ++it){
UnitParticleSystem *ups= new UnitParticleSystem(200); UnitParticleSystem *ups= new UnitParticleSystem(200);
ups->setParticleOwner(this); ups->setParticleOwner(this);
ups->setParticleType((*it));
(*it)->setValues(ups); (*it)->setValues(ups);
ups->setPos(this->pos); ups->setPos(this->pos);
ups->setRotation(this->rotation); ups->setRotation(this->rotation);

View File

@ -36,7 +36,7 @@ using namespace Shared::Util;
namespace Glest{ namespace Game{ namespace Glest{ namespace Game{
const int CHANGE_COMMAND_SPEED = 325; const int CHANGE_COMMAND_SPEED = 325;
const int MIN_FRAMECOUNT_CHANGE_COMMAND_SPEED = 160; const uint32 MIN_FRAMECOUNT_CHANGE_COMMAND_SPEED = 160;
//Mutex Unit::mutexDeletedUnits; //Mutex Unit::mutexDeletedUnits;
//map<void *,bool> Unit::deletedUnits; //map<void *,bool> Unit::deletedUnits;
@ -323,6 +323,9 @@ void UnitAttackBoostEffect::setSource(const Unit *unit) {
void UnitAttackBoostEffect::applyLoadedAttackBoostParticles(UnitParticleSystemType *upstPtr,const XmlNode *node, Unit* unit) { void UnitAttackBoostEffect::applyLoadedAttackBoostParticles(UnitParticleSystemType *upstPtr,const XmlNode *node, Unit* unit) {
if (upstPtr != NULL) { if (upstPtr != NULL) {
bool showUnitParticles = Config::getInstance().getBool("UnitParticles","true"); bool showUnitParticles = Config::getInstance().getBool("UnitParticles","true");
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
showUnitParticles = false;
}
if (showUnitParticles == true) { if (showUnitParticles == true) {
upst = new UnitParticleSystemType(); upst = new UnitParticleSystemType();
*upst = *upstPtr; *upst = *upstPtr;
@ -331,10 +334,12 @@ void UnitAttackBoostEffect::applyLoadedAttackBoostParticles(UnitParticleSystemTy
ups = new UnitParticleSystem(200); ups = new UnitParticleSystem(200);
//ups->loadGame(node2); //ups->loadGame(node2);
ups->setParticleOwner(unit); ups->setParticleOwner(unit);
ups->setParticleType(upst);
upst->setValues(ups); upst->setValues(ups);
ups->setPos(unit->getCurrVector()); ups->setPos(unit->getCurrVectorForParticlesystems());
ups->setRotation(unit->getRotation()); ups->setRotation(unit->getRotation());
ups->setUnitModel(unit->getCurrentModelPtr()); unit->setMeshPosInParticleSystem(ups);
if (unit->getFaction()->getTexture()) { if (unit->getFaction()->getTexture()) {
ups->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0, 0)); ups->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0, 0));
} }
@ -576,6 +581,7 @@ Unit::Unit(int id, UnitPathInterface *unitpath, const Vec2i &pos,
this->lastHarvestResourceTarget.first = Vec2i(0); this->lastHarvestResourceTarget.first = Vec2i(0);
this->morphFieldsBlocked=false; this->morphFieldsBlocked=false;
//this->lastBadHarvestListPurge = 0; //this->lastBadHarvestListPurge = 0;
this->oldTotalSight = 0;
level= NULL; level= NULL;
loadType= NULL; loadType= NULL;
@ -666,27 +672,7 @@ Unit::~Unit() {
} }
safeMutex.ReleaseLock(); safeMutex.ReleaseLock();
// If the unit is not visible we better make sure we cleanup associated particles cleanupAllParticlesystems();
if(this->getVisible() == false) {
Renderer::getInstance().cleanupUnitParticleSystems(unitParticleSystems,rsGame);
Renderer::getInstance().cleanupParticleSystems(fireParticleSystems,rsGame);
// Must set this to null of it will be used below in stopDamageParticles()
if(Renderer::getInstance().validateParticleSystemStillExists(this->fire,rsGame) == false) {
this->fire = NULL;
}
}
// fade(and by this remove) all unit particle systems
queuedUnitParticleSystemTypes.clear();
while(unitParticleSystems.empty() == false) {
if(Renderer::getInstance().validateParticleSystemStillExists(unitParticleSystems.back(),rsGame) == true) {
unitParticleSystems.back()->fade();
}
unitParticleSystems.pop_back();
}
stopDamageParticles(true);
while(currentAttackBoostEffects.empty() == false) { while(currentAttackBoostEffects.empty() == false) {
//UnitAttackBoostEffect &effect = currentAttackBoostEffects.back(); //UnitAttackBoostEffect &effect = currentAttackBoostEffects.back();
@ -726,6 +712,29 @@ Unit::~Unit() {
#endif #endif
} }
void Unit::cleanupAllParticlesystems() {
Renderer::getInstance().cleanupUnitParticleSystems(unitParticleSystems,rsGame);
Renderer::getInstance().cleanupParticleSystems(fireParticleSystems,rsGame);
// Must set this to null of it will be used below in stopDamageParticles()
if(Renderer::getInstance().validateParticleSystemStillExists(this->fire,rsGame) == false) {
this->fire = NULL;
}
// fade(and by this remove) all unit particle systems
queuedUnitParticleSystemTypes.clear();
while(unitParticleSystems.empty() == false) {
if(Renderer::getInstance().validateParticleSystemStillExists(unitParticleSystems.back(),rsGame) == true) {
unitParticleSystems.back()->fade();
}
unitParticleSystems.pop_back();
}
stopDamageParticles(true);
}
ParticleSystem * Unit::getFire() const { ParticleSystem * Unit::getFire() const {
if(this->fire != NULL && if(this->fire != NULL &&
Renderer::getInstance().validateParticleSystemStillExists(this->fire,rsGame) == false) { Renderer::getInstance().validateParticleSystemStillExists(this->fire,rsGame) == false) {
@ -1045,7 +1054,7 @@ float Unit::getEpRatio() const {
throw megaglest_runtime_error(szBuf); throw megaglest_runtime_error(szBuf);
} }
if(type->getMaxHp() == 0) { if(type->getTotalMaxHp(&totalUpgrade) == 0) {
return 0.f; return 0.f;
} }
else { else {
@ -1288,12 +1297,16 @@ void Unit::setCurrSkill(const SkillType *currSkill) {
unitParticleSystems.empty() == true) { unitParticleSystems.empty() == true) {
//printf("START - particle system type\n"); //printf("START - particle system type\n");
for(UnitParticleSystemTypes::const_iterator it= currSkill->unitParticleSystemTypes.begin(); it != currSkill->unitParticleSystemTypes.end(); ++it) { /*
for(UnitParticleSystemTypes::const_iterator it= currSkill->unitParticleSystemTypes.begin();
it != currSkill->unitParticleSystemTypes.end(); ++it) {
if((*it)->getStartTime() == 0.0) { if((*it)->getStartTime() == 0.0) {
//printf("Adding NON-queued particle system type [%s] [%f] [%f]\n",(*it)->getType().c_str(),(*it)->getStartTime(),(*it)->getEndTime()); //printf("Adding NON-queued particle system type [%s] [%f] [%f]\n",(*it)->getType().c_str(),(*it)->getStartTime(),(*it)->getEndTime());
UnitParticleSystem *ups = new UnitParticleSystem(200); UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this); ups->setParticleOwner(this);
ups->setParticleType((*it));
(*it)->setValues(ups); (*it)->setValues(ups);
ups->setPos(getCurrVector()); ups->setPos(getCurrVector());
ups->setRotation(getRotation()); ups->setRotation(getRotation());
@ -1310,6 +1323,8 @@ void Unit::setCurrSkill(const SkillType *currSkill) {
queuedUnitParticleSystemTypes.push_back(*it); queuedUnitParticleSystemTypes.push_back(*it);
} }
} }
*/
checkCustomizedUnitParticleListTriggers(currSkill->unitParticleSystemTypes,true);
} }
progress2= 0; progress2= 0;
if(this->currSkill != currSkill) { if(this->currSkill != currSkill) {
@ -1351,7 +1366,7 @@ void Unit::setTarget(const Unit *unit){
//ser field and vector //ser field and vector
targetField= unit->getCurrField(); targetField= unit->getCurrField();
targetVec= unit->getCurrVector(); targetVec= unit->getCurrVectorAsTarget();
targetRef= unit; targetRef= unit;
} }
@ -1381,10 +1396,10 @@ void Unit::setPos(const Vec2i &pos, bool clearPathFinder) {
logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__); logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
} }
void Unit::refreshPos() { void Unit::refreshPos(bool forceRefresh) {
// Attempt to improve performance // Attempt to improve performance
this->exploreCells(); this->exploreCells(forceRefresh);
calculateFogOfWarRadius(); calculateFogOfWarRadius(forceRefresh);
} }
FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const { FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
@ -1393,7 +1408,7 @@ FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
} }
//iterate through all cells //iterate through all cells
int sightRange= this->getType()->getSight(); int sightRange= this->getType()->getTotalSight(this->getTotalUpgrade());
int radius = sightRange + World::indirectSightRange; int radius = sightRange + World::indirectSightRange;
PosCircularIterator pci(map, this->getPosNotThreadSafe(), radius); PosCircularIterator pci(map, this->getPosNotThreadSafe(), radius);
FowAlphaCellsLookupItem result; FowAlphaCellsLookupItem result;
@ -1425,9 +1440,9 @@ FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
return result; return result;
} }
void Unit::calculateFogOfWarRadius() { void Unit::calculateFogOfWarRadius(bool forceRefresh) {
if(game->getWorld()->getFogOfWar() == true) { if(game->getWorld()->getFogOfWar() == true) {
if(this->pos != this->cachedFowPos) { if(forceRefresh || this->pos != this->cachedFowPos) {
cachedFow = getFogOfWarRadius(false); cachedFow = getFogOfWarRadius(false);
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__); static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutex(mutexCommands,mutexOwnerId); MutexSafeWrapper safeMutex(mutexCommands,mutexOwnerId);
@ -1587,7 +1602,16 @@ bool Unit::checkModelStateInfoForNewHpValue() {
return result; return result;
} }
Vec3f Unit::getCurrVector() const{ Vec3f Unit::getCurrVectorForParticlesystems() const{
if(getFaction()->getType()->isFlatParticlePositions()){
return getCurrVectorFlat();
}
else {
return getCurrMidHeightVector();
}
}
Vec3f Unit::getCurrMidHeightVector() const{
if(type == NULL) { if(type == NULL) {
char szBuf[8096]=""; char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s Line: %d] ERROR: type == NULL, Unit = [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,this->toString().c_str()); snprintf(szBuf,8096,"In [%s::%s Line: %d] ERROR: type == NULL, Unit = [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,this->toString().c_str());
@ -1602,6 +1626,36 @@ Vec3f Unit::getCurrVector() const{
return result; return result;
} }
Vec3f Unit::getCurrVectorAsTarget() const{
if(type == NULL) {
char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s Line: %d] ERROR: type == NULL, Unit = [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,this->toString().c_str());
throw megaglest_runtime_error(szBuf);
}
Vec3f result = getCurrVectorFlat() + Vec3f(0.f, type->getTargetHeight() / 2.f, 0.f);
result.x = truncateDecimal<float>(result.x,6);
result.y = truncateDecimal<float>(result.y,6);
result.z = truncateDecimal<float>(result.z,6);
return result;
}
Vec3f Unit::getCurrBurnVector() const{
if(type == NULL) {
char szBuf[8096]="";
snprintf(szBuf,8096,"In [%s::%s Line: %d] ERROR: type == NULL, Unit = [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,this->toString().c_str());
throw megaglest_runtime_error(szBuf);
}
Vec3f result = getCurrVectorFlat() + Vec3f(0.f, type->getBurnHeight() / 2.f, 0.f);
result.x = truncateDecimal<float>(result.x,6);
result.y = truncateDecimal<float>(result.y,6);
result.z = truncateDecimal<float>(result.z,6);
return result;
}
Vec3f Unit::getCurrVectorFlat() const{ Vec3f Unit::getCurrVectorFlat() const{
return getVectorFlat(lastPos, pos); return getVectorFlat(lastPos, pos);
} }
@ -1945,19 +1999,38 @@ void Unit::born(const CommandType *ct) {
throw megaglest_runtime_error(szBuf); throw megaglest_runtime_error(szBuf);
} }
faction->addStore(type,false); faction->addStore(type);
faction->applyStaticProduction(type,ct); faction->applyStaticProduction(type,ct);
setCurrSkill(scStop); setCurrSkill(scStop);
checkItemInVault(&this->hp,this->hp); checkItemInVault(&this->hp,this->hp);
int original_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->getTotalMaxHp(&totalUpgrade) * 100 / type->getStartHpPercentage();
}
if(original_hp != this->hp) { if(original_hp != this->hp) {
//printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__); //printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
game->getScriptManager()->onUnitTriggerEvent(this,utet_HPChanged); game->getScriptManager()->onUnitTriggerEvent(this,utet_HPChanged);
//printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__); //printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
} }
addItemToVault(&this->hp,this->hp); addItemToVault(&this->hp,this->hp);
//set ep from start ep
checkItemInVault(&this->ep,this->ep);
if(type->getStartEpType() == UnitType::stValue) {
this->ep= type->getStartEpValue();
}
else {
this->ep= type->getTotalMaxEp(&totalUpgrade) * 100 / type->getStartEpPercentage();
}
} }
void Unit::kill() { void Unit::kill() {
@ -2350,13 +2423,11 @@ void Unit::updateAttackBoostProgress(const Game* game) {
attackBoost->radius); attackBoost->radius);
if(debugBoost) printf("Line: %d candidates unit size: " MG_SIZE_T_SPECIFIER " attackBoost: %s\n",__LINE__,candidates.size(),attackBoost->getDesc(false).c_str()); if(debugBoost) printf("Line: %d candidates unit size: " MG_SIZE_T_SPECIFIER " attackBoost: %s\n",__LINE__,candidates.size(),attackBoost->getDesc(false).c_str());
for (unsigned int i = 0; i < candidates.size(); ++i) { for (unsigned int i = 0; i < candidates.size(); ++i) {
Unit *affectedUnit = candidates[i]; Unit *affectedUnit = candidates[i];
if (attackBoost->isAffected(this, affectedUnit) == true) { if (attackBoost->isAffected(this, affectedUnit) == true) {
if (affectedUnit->applyAttackBoost(attackBoost, this) == true) { if (affectedUnit->applyAttackBoost(attackBoost, this) == true) {
currentAttackBoostOriginatorEffect.currentAttackBoostUnits.push_back(affectedUnit->getId()); currentAttackBoostOriginatorEffect.currentAttackBoostUnits.push_back(affectedUnit->getId());
//printf("+ #1 APPLY ATTACK BOOST to unit [%s - %d]\n",affectedUnit->getType()->getName().c_str(),affectedUnit->getId()); //printf("+ #1 APPLY ATTACK BOOST to unit [%s - %d]\n",affectedUnit->getType()->getName().c_str(),affectedUnit->getId());
} }
} }
@ -2374,12 +2445,14 @@ void Unit::updateAttackBoostProgress(const Game* game) {
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups = new UnitParticleSystem(200); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups = new UnitParticleSystem(200);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleOwner(this); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleOwner(this);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleType(currentAttackBoostOriginatorEffect.currentAppliedEffect->upst);
currentAttackBoostOriginatorEffect.currentAppliedEffect->upst->setValues( currentAttackBoostOriginatorEffect.currentAppliedEffect->upst->setValues(
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos( currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(
getCurrVector()); getCurrVectorForParticlesystems());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation()); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
if (getFaction()->getTexture()) { if (getFaction()->getTexture()) {
currentAttackBoostOriginatorEffect. currentAttackBoostOriginatorEffect.
@ -2485,12 +2558,14 @@ void Unit::updateAttackBoostProgress(const Game* game) {
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups = new UnitParticleSystem(200); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups = new UnitParticleSystem(200);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleOwner(this); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleOwner(this);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleType(currentAttackBoostOriginatorEffect.currentAppliedEffect->upst);
currentAttackBoostOriginatorEffect.currentAppliedEffect->upst->setValues( currentAttackBoostOriginatorEffect.currentAppliedEffect->upst->setValues(
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos( currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(
getCurrVector()); getCurrVectorForParticlesystems());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation()); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
if (getFaction()->getTexture()) { if (getFaction()->getTexture()) {
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setFactionColor( currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setFactionColor(
@ -2550,6 +2625,12 @@ bool Unit::update() {
//speed //speed
int speed= currSkill->getTotalSpeed(&totalUpgrade); int speed= currSkill->getTotalSpeed(&totalUpgrade);
if( oldTotalSight != getType()->getTotalSight(this->getTotalUpgrade())){
oldTotalSight= getType()->getTotalSight(this->getTotalUpgrade());
// refresh FogOfWar and so on, because sight ha changed since last update
refreshPos(true);
}
if(changedActiveCommand) { if(changedActiveCommand) {
if(changedActiveCommandFrame - lastChangedActiveCommandFrame >= MIN_FRAMECOUNT_CHANGE_COMMAND_SPEED) { if(changedActiveCommandFrame - lastChangedActiveCommandFrame >= MIN_FRAMECOUNT_CHANGE_COMMAND_SPEED) {
//printf("Line: %d speed = %d changedActiveCommandFrame [%u] lastChangedActiveCommandFrame [%u] skill [%s] command [%s]\n",__LINE__,speed,changedActiveCommandFrame,lastChangedActiveCommandFrame,currSkill->toString(false).c_str(),getCurrCommand()->toString(false).c_str()); //printf("Line: %d speed = %d changedActiveCommandFrame [%u] lastChangedActiveCommandFrame [%u] skill [%s] command [%s]\n",__LINE__,speed,changedActiveCommandFrame,lastChangedActiveCommandFrame,currSkill->toString(false).c_str(),getCurrCommand()->toString(false).c_str());
@ -2566,6 +2647,9 @@ bool Unit::update() {
this->lastAnimProgress= this->animProgress; this->lastAnimProgress= this->animProgress;
const Game *game = Renderer::getInstance().getGame(); const Game *game = Renderer::getInstance().getGame();
if(animProgress==0){
AnimCycleStarts();
}
progress = getUpdatedProgress(progress, progress = getUpdatedProgress(progress,
GameConstants::updateFps, GameConstants::updateFps,
speed, diagonalFactor, heightFactor); speed, diagonalFactor, heightFactor);
@ -2611,7 +2695,15 @@ bool Unit::update() {
int64 heightFactor = getHeightFactor(ANIMATION_SPEED_MULTIPLIER); int64 heightFactor = getHeightFactor(ANIMATION_SPEED_MULTIPLIER);
int64 speedDenominator = speedDivider * int64 speedDenominator = speedDivider *
game->getWorld()->getUpdateFps(this->getFactionIndex()); 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 // Ensure we increment at least a value of 1 of the action will be stuck infinitely
if(currSkill->getAnimSpeed() > 0 && heightFactor > 0 && progressIncrease == 0) { if(currSkill->getAnimSpeed() > 0 && heightFactor > 0 && progressIncrease == 0) {
progressIncrease = 1; progressIncrease = 1;
@ -2656,28 +2748,28 @@ bool Unit::update() {
} }
if (this->fire != NULL) { if (this->fire != NULL) {
this->fire->setPos(getCurrVector()); this->fire->setPos(getCurrBurnVector());
} }
for(UnitParticleSystems::iterator it= unitParticleSystems.begin(); it != unitParticleSystems.end(); ++it) { for(UnitParticleSystems::iterator it= unitParticleSystems.begin(); it != unitParticleSystems.end(); ++it) {
if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) { if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) {
(*it)->setPos(getCurrVector()); (*it)->setPos(getCurrVectorForParticlesystems());
(*it)->setRotation(getRotation()); (*it)->setRotation(getRotation());
(*it)->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(*it);
} }
} }
for(UnitParticleSystems::iterator it= damageParticleSystems.begin(); it != damageParticleSystems.end(); ++it) { for(UnitParticleSystems::iterator it= damageParticleSystems.begin(); it != damageParticleSystems.end(); ++it) {
if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) { if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) {
(*it)->setPos(getCurrVector()); (*it)->setPos(getCurrVectorForParticlesystems());
(*it)->setRotation(getRotation()); (*it)->setRotation(getRotation());
(*it)->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(*it);
} }
} }
for(UnitParticleSystems::iterator it= smokeParticleSystems.begin(); it != smokeParticleSystems.end(); ++it) { for(UnitParticleSystems::iterator it= smokeParticleSystems.begin(); it != smokeParticleSystems.end(); ++it) {
if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) { if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) {
(*it)->setPos(getCurrVector()); (*it)->setPos(getCurrMidHeightVector());
(*it)->setRotation(getRotation()); (*it)->setRotation(getRotation());
(*it)->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(*it);
} }
} }
@ -2687,9 +2779,9 @@ bool Unit::update() {
if(effect != NULL && effect->ups != NULL) { if(effect != NULL && effect->ups != NULL) {
bool particleValid = Renderer::getInstance().validateParticleSystemStillExists(effect->ups,rsGame); bool particleValid = Renderer::getInstance().validateParticleSystemStillExists(effect->ups,rsGame);
if(particleValid == true) { if(particleValid == true) {
effect->ups->setPos(getCurrVector()); effect->ups->setPos(getCurrVectorForParticlesystems());
effect->ups->setRotation(getRotation()); effect->ups->setRotation(getRotation());
effect->ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(effect->ups);
} }
//printf("i = %d particleValid = %d\n",i,particleValid); //printf("i = %d particleValid = %d\n",i,particleValid);
@ -2702,9 +2794,9 @@ bool Unit::update() {
if(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups != NULL) { if(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups != NULL) {
bool particleValid = Renderer::getInstance().validateParticleSystemStillExists(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups,rsGame); bool particleValid = Renderer::getInstance().validateParticleSystemStillExists(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups,rsGame);
if(particleValid == true) { if(particleValid == true) {
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(getCurrVector()); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(getCurrVectorForParticlesystems());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation()); currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
} }
} }
} }
@ -2756,10 +2848,12 @@ void Unit::updateTimedParticles() {
UnitParticleSystem *ups = new UnitParticleSystem(200); UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this); ups->setParticleOwner(this);
ups->setParticleType(pst);
pst->setValues(ups); pst->setValues(ups);
ups->setPos(getCurrVector()); ups->setPos(getCurrVectorForParticlesystems());
ups->setRotation(getRotation()); ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(ups);
if(getFaction()->getTexture()) { if(getFaction()->getTexture()) {
ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
@ -2849,7 +2943,7 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) {
int prevMaxHpRegen = totalUpgrade.getMaxHpRegeneration(); int prevMaxHpRegen = totalUpgrade.getMaxHpRegeneration();
//printf("#1 wasAlive = %d hp = %d boosthp = %d\n",wasAlive,hp,boost->boostUpgrade.getMaxHp()); //printf("#1 wasAlive = %d hp = %d boosthp = %d\n",wasAlive,hp,boost->boostUpgrade.getMaxHp());
totalUpgrade.apply(&boost->boostUpgrade, this); totalUpgrade.apply(source->getId(),&boost->boostUpgrade, this);
checkItemInVault(&this->hp,this->hp); checkItemInVault(&this->hp,this->hp);
//hp += boost->boostUpgrade.getMaxHp(); //hp += boost->boostUpgrade.getMaxHp();
@ -2897,10 +2991,12 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) {
effect->ups = new UnitParticleSystem(200); effect->ups = new UnitParticleSystem(200);
effect->ups->setParticleOwner(this); effect->ups->setParticleOwner(this);
effect->ups->setParticleType(effect->upst);
effect->upst->setValues(effect->ups); effect->upst->setValues(effect->ups);
effect->ups->setPos(getCurrVector()); effect->ups->setPos(getCurrVectorForParticlesystems());
effect->ups->setRotation(getRotation()); effect->ups->setRotation(getRotation());
effect->ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(effect->ups);
if(getFaction()->getTexture()) { if(getFaction()->getTexture()) {
effect->ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); effect->ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
} }
@ -2933,7 +3029,7 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) {
Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats());
game->getScriptManager()->onUnitDied(this); game->getScriptManager()->onUnitDied(this);
StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); StaticSound *sound= static_cast<const DieSkillType *>(this->getType()->getFirstStOfClass(scDie))->getSound();
if(sound != NULL && if(sound != NULL &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -2967,7 +3063,7 @@ void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) {
int originalHp = hp; int originalHp = hp;
int prevMaxHp = totalUpgrade.getMaxHp(); int prevMaxHp = totalUpgrade.getMaxHp();
int prevMaxHpRegen = totalUpgrade.getMaxHpRegeneration(); int prevMaxHpRegen = totalUpgrade.getMaxHpRegeneration();
totalUpgrade.deapply(&boost->boostUpgrade, this); totalUpgrade.deapply(source->getId(),&boost->boostUpgrade, this->getId());
checkItemInVault(&this->hp,this->hp); checkItemInVault(&this->hp,this->hp);
int original_hp = this->hp; int original_hp = this->hp;
@ -3031,7 +3127,7 @@ void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) {
Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats());
game->getScriptManager()->onUnitDied(this); game->getScriptManager()->onUnitDied(this);
StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); StaticSound *sound= static_cast<const DieSkillType *>(this->getType()->getFirstStOfClass(scDie))->getSound();
if(sound != NULL && if(sound != NULL &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -3103,7 +3199,7 @@ void Unit::tick() {
Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats());
game->getScriptManager()->onUnitDied(this); game->getScriptManager()->onUnitDied(this);
} }
StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); StaticSound *sound= static_cast<const DieSkillType *>(this->getType()->getFirstStOfClass(scDie))->getSound();
if(sound != NULL && if(sound != NULL &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -3114,11 +3210,11 @@ void Unit::tick() {
} }
//regenerate hp //regenerate hp
else { else {
if(type->getHpRegeneration() >= 0) { if(type->getTotalMaxHpRegeneration(&totalUpgrade) >= 0) {
if( currSkill->getClass() != scBeBuilt){ if( currSkill->getClass() != scBeBuilt){
checkItemInVault(&this->hp,this->hp); checkItemInVault(&this->hp,this->hp);
int original_hp = this->hp; int original_hp = this->hp;
this->hp += type->getHpRegeneration(); this->hp += type->getTotalMaxHpRegeneration(&totalUpgrade);
if(this->hp > type->getTotalMaxHp(&totalUpgrade)) { if(this->hp > type->getTotalMaxHp(&totalUpgrade)) {
this->hp = type->getTotalMaxHp(&totalUpgrade); this->hp = type->getTotalMaxHp(&totalUpgrade);
} }
@ -3135,14 +3231,14 @@ void Unit::tick() {
} }
// If we have negative regeneration then check if the unit should die // If we have negative regeneration then check if the unit should die
else { else {
bool decHpResult = decHp(-type->getHpRegeneration()); bool decHpResult = decHp(-type->getTotalMaxHpRegeneration(&totalUpgrade));
if(decHpResult) { if(decHpResult) {
this->setCauseOfDeath(ucodStarvedRegeneration); this->setCauseOfDeath(ucodStarvedRegeneration);
Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats()); Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats());
game->getScriptManager()->onUnitDied(this); game->getScriptManager()->onUnitDied(this);
} }
StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound(); StaticSound *sound= static_cast<const DieSkillType *>(this->getType()->getFirstStOfClass(scDie))->getSound();
if(sound != NULL && if(sound != NULL &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() || (this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) { (game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -3536,7 +3632,7 @@ bool Unit::morph(const MorphCommandType *mct) {
} }
map->clearUnitCells(this, pos, false); map->clearUnitCells(this, pos, false);
if(map->isFreeCellsOrHasUnit(pos, morphUnitType->getSize(), morphUnitField, this,morphUnitType)) { if(map->canMorph(pos,this,morphUnitType)) {
map->clearUnitCells(this, pos, true); map->clearUnitCells(this, pos, true);
faction->deApplyStaticCosts(type,mct); faction->deApplyStaticCosts(type,mct);
@ -3553,6 +3649,8 @@ bool Unit::morph(const MorphCommandType *mct) {
} }
} }
//stopDamageParticles(true);
cleanupAllParticlesystems();
checkItemInVault(&this->hp,this->hp); checkItemInVault(&this->hp,this->hp);
int original_hp = this->hp; int original_hp = this->hp;
@ -3574,7 +3672,10 @@ bool Unit::morph(const MorphCommandType *mct) {
map->putUnitCells(this, this->pos); map->putUnitCells(this, this->pos);
this->faction->applyDiscount(morphUnitType, mct->getDiscount()); this->faction->applyDiscount(morphUnitType, mct->getDiscount());
this->faction->addStore(this->type,mct->getReplaceStorage()); // add new storage
this->faction->addStore(this->type);
// remove former storage
this->faction->removeStore(this->preMorph_type);
this->faction->applyStaticProduction(morphUnitType,mct); this->faction->applyStaticProduction(morphUnitType,mct);
this->level= NULL; this->level= NULL;
@ -3636,6 +3737,11 @@ float Unit::computeHeight(const Vec2i &pos) const {
return height; return height;
} }
void Unit::AnimCycleStarts(){
// we need to queue timed particles if progress starts
queueTimedParticles(currSkill->unitParticleSystemTypes);
}
void Unit::updateTarget(){ void Unit::updateTarget(){
Unit *target= targetRef.getUnit(); Unit *target= targetRef.getUnit();
if(target!=NULL){ if(target!=NULL){
@ -3649,7 +3755,7 @@ void Unit::updateTarget(){
#else #else
targetRotation= radToDeg(atan2(relPosf.x, relPosf.y)); targetRotation= radToDeg(atan2(relPosf.x, relPosf.y));
#endif #endif
targetVec= target->getCurrVector(); targetVec= target->getCurrVectorAsTarget();
} }
} }
@ -3945,8 +4051,171 @@ void Unit::stopDamageParticles(bool force) {
checkCustomizedParticleTriggers(force); checkCustomizedParticleTriggers(force);
} }
void Unit::checkCustomizedUnitParticleListTriggers(const UnitParticleSystemTypes &unitParticleSystemTypesList,
bool applySkillChangeParticles) {
if(showUnitParticles == true) {
vector<ParticleSystemTypeInterface *> systemTypesInUse;
if(unitParticleSystems.empty() == false) {
for(int index = (int)unitParticleSystems.size() - 1; index >= 0; index--) {
UnitParticleSystem *ps = unitParticleSystems[index];
if(ps != NULL) {
if(Renderer::getInstance().validateParticleSystemStillExists(ps,rsGame) == true) {
bool stopParticle = false;
if((ps->getParticleType() != NULL &&
ps->getParticleType()->getMinmaxEnabled())) {
if(ps->getParticleType() != NULL) {
if(ps->getParticleType()->getMinmaxIsPercent() == false) {
if(hp < ps->getParticleType()->getMinHp() || hp > ps->getParticleType()->getMaxHp()) {
stopParticle = true;
//printf("STOP Particle line: %d\n",__LINE__);
}
}
else {
int hpPercent = (hp / type->getTotalMaxHp(&totalUpgrade) * 100);
if(hpPercent < ps->getParticleType()->getMinHp() || hpPercent > ps->getParticleType()->getMaxHp()) {
stopParticle = true;
//printf("STOP Particle line: %d\n",__LINE__);
}
}
}
if(stopParticle == true) {
ps->fade();
unitParticleSystems.erase(unitParticleSystems.begin() + index);
}
}
if(ps->getParticleType() != NULL && stopParticle == false) {
systemTypesInUse.push_back(ps->getParticleType());
}
}
}
}
}
//printf("Check Particle start line: %d size: %d\n",__LINE__,(int)unitParticleSystemTypesList.size());
if(unitParticleSystemTypesList.empty() == false) {
//for(unsigned int index = 0; index < unitParticleSystemTypesList.size(); ++index) {
for(UnitParticleSystemTypes::const_iterator iterParticleType = unitParticleSystemTypesList.begin();
iterParticleType != unitParticleSystemTypesList.end(); ++iterParticleType) {
UnitParticleSystemType *pst = *iterParticleType;
vector<ParticleSystemTypeInterface *>::iterator iterFind = std::find(systemTypesInUse.begin(),systemTypesInUse.end(),pst);
//printf("Check Particle line: %d isenabled: %d already in use: %d\n",__LINE__,pst->getMinmaxEnabled(),(iterFind == systemTypesInUse.end()));
bool showParticle = applySkillChangeParticles;
if(pst->getMinmaxEnabled() == true) {
//printf("Check Particle line: %d isenabled: %d already in use: %d\n",__LINE__,pst->getMinmaxEnabled(),(iterFind != systemTypesInUse.end()));
showParticle = false;
if(iterFind == systemTypesInUse.end()) {
if(pst->getMinmaxIsPercent() == false) {
if(hp >= pst->getMinHp() && hp <= pst->getMaxHp()) {
showParticle = true;
//printf("START Particle line: %d\n",__LINE__);
}
}
else {
int hpPercent = (hp / type->getTotalMaxHp(&totalUpgrade) * 100);
if(hpPercent >= pst->getMinHp() && hpPercent <= pst->getMaxHp()) {
showParticle = true;
//printf("START Particle line: %d\n",__LINE__);
}
}
}
}
if(showParticle == true){
if(pst->getStartTime() == 0.0) {
UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this);
ups->setParticleType(pst);
pst->setValues(ups);
ups->setPos(getCurrVectorForParticlesystems());
ups->setRotation(getRotation());
setMeshPosInParticleSystem(ups);
if(getFaction()->getTexture()) {
ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
}
unitParticleSystems.push_back(ups);
Renderer::getInstance().manageParticleSystem(ups, rsGame);
}
else {
// do nothing, timed particles are handled below in queueTimedParticles()
}
}
}
}
}
}
void Unit::queueTimedParticles(const UnitParticleSystemTypes &unitParticleSystemTypesList){
if(showUnitParticles == true) {
for(UnitParticleSystemTypes::const_iterator iterParticleType = unitParticleSystemTypesList.begin();
iterParticleType != unitParticleSystemTypesList.end(); ++iterParticleType) {
UnitParticleSystemType *pst = *iterParticleType;
if(pst->getMinmaxEnabled() == false) {
if(pst->getStartTime() != 0.0) {
queuedUnitParticleSystemTypes.push_back(pst);
}
}
}
}
}
void Unit::setMeshPosInParticleSystem(UnitParticleSystem *ups){
if(ups->getMeshName()!=""){
string meshName=ups->getMeshName();
Model *model= getCurrentModelPtr();
model->updateInterpolationVertices(getAnimProgressAsFloat(), isAlive() && !isAnimProgressBound());
bool foundMesh=false;
for(unsigned int i=0; i<model->getMeshCount() ; i++){
//printf("meshName=%s\n",unitModel->getMesh(i)->getName().c_str());
if(model->getMesh(i)->getName()==meshName){
const InterpolationData *data=model->getMesh(i)->getInterpolationData();
const Vec3f *verticepos=data->getVertices();
ups->setMeshPos(Vec3f(verticepos->x,verticepos->y,verticepos->z));
foundMesh=true;
break;
}
}
if( foundMesh == false ) {
string meshesFound="";
for(unsigned i=0; i<model->getMeshCount() ; i++){
meshesFound+= model->getMesh(i)->getName()+", ";
}
string errorString = "Warning: Particle system is trying to find mesh'"+meshName+"', but just found:\n'"+meshesFound+"' in file:\n'"+model->getFileName()+"'\n";
//throw megaglest_runtime_error(errorString);
printf("%s",errorString.c_str());
}
}
}
void Unit::checkCustomizedUnitParticleTriggers() {
if(currSkill != NULL) {
checkCustomizedUnitParticleListTriggers(currSkill->unitParticleSystemTypes,false);
}
}
void Unit::checkCustomizedParticleTriggers(bool force) { void Unit::checkCustomizedParticleTriggers(bool force) {
// Now check if we have special hp triggered particles //
// Now check if we have special pre-exisitng hp triggered particles and
// end those that should no longer display
//
// end s particles
if(damageParticleSystems.empty() == false) { if(damageParticleSystems.empty() == false) {
for(int i = (int)damageParticleSystems.size()-1; i >= 0; --i) { for(int i = (int)damageParticleSystems.size()-1; i >= 0; --i) {
UnitParticleSystem *ps = damageParticleSystems[i]; UnitParticleSystem *ps = damageParticleSystems[i];
@ -3996,7 +4265,9 @@ void Unit::checkCustomizedParticleTriggers(bool force) {
} }
} }
// Now check if we have special hp triggered particles //
// Now check if we have new special hp triggered particles to display
//
//start additional particles //start additional particles
if(showUnitParticles && if(showUnitParticles &&
type->damageParticleSystemTypes.empty() == false && type->damageParticleSystemTypes.empty() == false &&
@ -4025,10 +4296,12 @@ void Unit::checkCustomizedParticleTriggers(bool force) {
UnitParticleSystem *ups = new UnitParticleSystem(200); UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this); ups->setParticleOwner(this);
ups->setParticleType(pst);
pst->setValues(ups); pst->setValues(ups);
ups->setPos(getCurrVector()); ups->setPos(getCurrVectorForParticlesystems());
ups->setRotation(getRotation()); ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(ups);
if(getFaction()->getTexture()) { if(getFaction()->getTexture()) {
ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
} }
@ -4039,10 +4312,12 @@ void Unit::checkCustomizedParticleTriggers(bool force) {
} }
} }
} }
checkCustomizedUnitParticleTriggers();
} }
void Unit::startDamageParticles() { void Unit::startDamageParticles() {
if(hp < type->getMaxHp() / 2 && hp > 0 && alive == true) { if(hp < type->getTotalMaxHp(&totalUpgrade) / 2 && hp > 0 && alive == true) {
//start additional particles //start additional particles
if( showUnitParticles && if( showUnitParticles &&
type->damageParticleSystemTypes.empty() == false ) { type->damageParticleSystemTypes.empty() == false ) {
@ -4052,10 +4327,12 @@ void Unit::startDamageParticles() {
if(pst->getMinmaxEnabled() == false && damageParticleSystemsInUse.find(i) == damageParticleSystemsInUse.end()) { if(pst->getMinmaxEnabled() == false && damageParticleSystemsInUse.find(i) == damageParticleSystemsInUse.end()) {
UnitParticleSystem *ups = new UnitParticleSystem(200); UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this); ups->setParticleOwner(this);
ups->setParticleType(pst);
pst->setValues(ups); pst->setValues(ups);
ups->setPos(getCurrVector()); ups->setPos(getCurrVectorForParticlesystems());
ups->setRotation(getRotation()); ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(ups);
if(getFaction()->getTexture()) { if(getFaction()->getTexture()) {
ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
} }
@ -4072,7 +4349,7 @@ void Unit::startDamageParticles() {
fps->setParticleOwner(this); fps->setParticleOwner(this);
const Game *game = Renderer::getInstance().getGame(); const Game *game = Renderer::getInstance().getGame();
fps->setSpeed(2.5f / game->getWorld()->getUpdateFps(this->getFactionIndex())); fps->setSpeed(2.5f / game->getWorld()->getUpdateFps(this->getFactionIndex()));
fps->setPos(getCurrVector()); fps->setPos(getCurrBurnVector());
fps->setRadius(type->getSize()/3.f); fps->setRadius(type->getSize()/3.f);
fps->setTexture(CoreData::getInstance().getFireTexture()); fps->setTexture(CoreData::getInstance().getFireTexture());
fps->setParticleSize(type->getSize()/3.f); fps->setParticleSize(type->getSize()/3.f);
@ -4086,9 +4363,9 @@ void Unit::startDamageParticles() {
ups->setParticleOwner(this); ups->setParticleOwner(this);
ups->setColorNoEnergy(Vec4f(0.0f, 0.0f, 0.0f, 0.13f)); ups->setColorNoEnergy(Vec4f(0.0f, 0.0f, 0.0f, 0.13f));
ups->setColor(Vec4f(0.115f, 0.115f, 0.115f, 0.22f)); ups->setColor(Vec4f(0.115f, 0.115f, 0.115f, 0.22f));
ups->setPos(getCurrVector()); ups->setPos(getCurrBurnVector());
ups->setRotation(getRotation()); ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr()); setMeshPosInParticleSystem(ups);
ups->setBlendMode(ups->strToBlendMode("black")); ups->setBlendMode(ups->strToBlendMode("black"));
ups->setOffset(Vec3f(0,2,0)); ups->setOffset(Vec3f(0,2,0));
ups->setDirection(Vec3f(0,1,-0.2f)); ups->setDirection(Vec3f(0,1,-0.2f));
@ -4112,11 +4389,6 @@ void Unit::startDamageParticles() {
checkCustomizedParticleTriggers(false); checkCustomizedParticleTriggers(false);
} }
//void Unit::setTargetVec(const Vec3f &targetVec) {
// this->targetVec= targetVec;
// logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
//}
void Unit::setMeetingPos(const Vec2i &meetingPos) { void Unit::setMeetingPos(const Vec2i &meetingPos) {
this->meetingPos= meetingPos; this->meetingPos= meetingPos;
map->clampPos(this->meetingPos); map->clampPos(this->meetingPos);
@ -4145,10 +4417,10 @@ uint32 Unit::getFrameCount() const {
return frameCount; return frameCount;
} }
void Unit::exploreCells() { void Unit::exploreCells(bool forceRefresh) {
if(this->isOperative() == true) { if(this->isOperative() == true) {
const Vec2i &newPos = this->getCenteredPos(); const Vec2i &newPos = this->getCenteredPos();
int sightRange = this->getType()->getSight(); int sightRange = this->getType()->getTotalSight(this->getTotalUpgrade());
int teamIndex = this->getTeam(); int teamIndex = this->getTeam();
if(game == NULL) { if(game == NULL) {
@ -4159,7 +4431,8 @@ void Unit::exploreCells() {
} }
// Try the local unit exploration cache // Try the local unit exploration cache
if(cacheExploredCellsKey.first == newPos && if( !forceRefresh &&
cacheExploredCellsKey.first == newPos &&
cacheExploredCellsKey.second == sightRange) { cacheExploredCellsKey.second == sightRange) {
game->getWorld()->exploreCells(teamIndex, cacheExploredCells); game->getWorld()->exploreCells(teamIndex, cacheExploredCells);
} }
@ -5044,7 +5317,8 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
//result->fire->setTexture(CoreData::getInstance().getFireTexture()); //result->fire->setTexture(CoreData::getInstance().getFireTexture());
result->fireParticleSystems.push_back(result->fire); result->fireParticleSystems.push_back(result->fire);
//Renderer::getInstance().manageParticleSystem(result->fire, rsGame); //printf("Load MAIN fire particle result->fire = %p\n",result->fire);
Renderer::getInstance().addToDeferredParticleSystemList(make_pair(result->fire, rsGame)); Renderer::getInstance().addToDeferredParticleSystemList(make_pair(result->fire, rsGame));
} }
@ -5169,18 +5443,22 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
for(int i = 0; i < (int)unitParticleSystemNodeList.size(); ++i) { for(int i = 0; i < (int)unitParticleSystemNodeList.size(); ++i) {
XmlNode *node = unitParticleSystemNodeList[i]; XmlNode *node = unitParticleSystemNodeList[i];
if(result->fire == NULL || linkFireIndex != i) {
FireParticleSystem *ups = new FireParticleSystem(); FireParticleSystem *ups = new FireParticleSystem();
ups->setParticleOwner(result);
ups->loadGame(node); ups->loadGame(node);
//ups->setTexture(CoreData::getInstance().getFireTexture()); //ups->setTexture(CoreData::getInstance().getFireTexture());
result->fireParticleSystems.push_back(ups); result->fireParticleSystems.push_back(ups);
if(linkFireIndex >= 0 && linkFireIndex == i) { //printf("Load fire particle i = %d linkFireIndex = %d result->fire = %p ups = %p\n",i,linkFireIndex,result->fire,ups);
if(result->fire == NULL && linkFireIndex >= 0 && linkFireIndex == i) {
result->fire = ups; result->fire = ups;
} }
//Renderer::getInstance().manageParticleSystem(result->fire, rsGame);
Renderer::getInstance().addToDeferredParticleSystemList(make_pair(ups, rsGame)); Renderer::getInstance().addToDeferredParticleSystemList(make_pair(ups, rsGame));
} }
} }
}
// vector<UnitParticleSystem*> smokeParticleSystems; // vector<UnitParticleSystem*> smokeParticleSystems;
// for(unsigned int i = 0; i < smokeParticleSystems.size(); ++i) { // for(unsigned int i = 0; i < smokeParticleSystems.size(); ++i) {

View File

@ -370,6 +370,7 @@ private:
int32 kills; int32 kills;
int32 enemyKills; int32 enemyKills;
bool morphFieldsBlocked; bool morphFieldsBlocked;
int oldTotalSight;
UnitReference targetRef; UnitReference targetRef;
@ -519,7 +520,7 @@ public:
const FowAlphaCellsLookupItem & getCachedFow() const { return cachedFow; } const FowAlphaCellsLookupItem & getCachedFow() const { return cachedFow; }
FowAlphaCellsLookupItem getFogOfWarRadius(bool useCache) const; FowAlphaCellsLookupItem getFogOfWarRadius(bool useCache) const;
void calculateFogOfWarRadius(); void calculateFogOfWarRadius(bool forceRefresh=false);
//queries //queries
Command *getCurrrentCommandThreadSafe(); Command *getCurrrentCommandThreadSafe();
@ -626,7 +627,7 @@ public:
inline void setLoadType(const ResourceType *loadType) {this->loadType= loadType;} inline void setLoadType(const ResourceType *loadType) {this->loadType= loadType;}
inline void setProgress2(int progress2) {this->progress2= progress2;} inline void setProgress2(int progress2) {this->progress2= progress2;}
void setPos(const Vec2i &pos,bool clearPathFinder=false); void setPos(const Vec2i &pos,bool clearPathFinder=false);
void refreshPos(); void refreshPos(bool forceRefresh=false);
void setTargetPos(const Vec2i &targetPos); void setTargetPos(const Vec2i &targetPos);
void setTarget(const Unit *unit); void setTarget(const Unit *unit);
//void setTargetVec(const Vec3f &targetVec); //void setTargetVec(const Vec3f &targetVec);
@ -637,7 +638,10 @@ public:
//render related //render related
const Model *getCurrentModel(); const Model *getCurrentModel();
Model *getCurrentModelPtr(); Model *getCurrentModelPtr();
Vec3f getCurrVector() const; Vec3f getCurrMidHeightVector() const;
Vec3f getCurrVectorForParticlesystems() const;
Vec3f getCurrVectorAsTarget() const;
Vec3f getCurrBurnVector() const;
Vec3f getCurrVectorFlat() const; Vec3f getCurrVectorFlat() const;
Vec3f getVectorFlat(const Vec2i &lastPosValue, const Vec2i &curPosValue) const; Vec3f getVectorFlat(const Vec2i &lastPosValue, const Vec2i &curPosValue) const;
@ -708,7 +712,7 @@ public:
inline string getCurrentUnitTitle() const {return currentUnitTitle;} inline string getCurrentUnitTitle() const {return currentUnitTitle;}
void setCurrentUnitTitle(string value) { currentUnitTitle = value;} void setCurrentUnitTitle(string value) { currentUnitTitle = value;}
void exploreCells(); void exploreCells(bool forceRefresh=false);
inline bool getInBailOutAttempt() const { return inBailOutAttempt; } inline bool getInBailOutAttempt() const { return inBailOutAttempt; }
inline void setInBailOutAttempt(bool value) { inBailOutAttempt = value; } inline void setInBailOutAttempt(bool value) { inBailOutAttempt = value; }
@ -785,6 +789,7 @@ public:
inline void setUsePathfinderExtendedMaxNodes(bool value) { usePathfinderExtendedMaxNodes = value; } inline void setUsePathfinderExtendedMaxNodes(bool value) { usePathfinderExtendedMaxNodes = value; }
void updateTimedParticles(); void updateTimedParticles();
void setMeshPosInParticleSystem(UnitParticleSystem *ups);
virtual string getUniquePickName() const; virtual string getUniquePickName() const;
void saveGame(XmlNode *rootNode); void saveGame(XmlNode *rootNode);
@ -806,12 +811,14 @@ public:
private: private:
void cleanupAllParticlesystems();
bool isNetworkCRCEnabled(); bool isNetworkCRCEnabled();
string getNetworkCRCDecHpList() const; string getNetworkCRCDecHpList() const;
string getParticleInfo() const; string getParticleInfo() const;
float computeHeight(const Vec2i &pos) const; float computeHeight(const Vec2i &pos) const;
void calculateXZRotation(); void calculateXZRotation();
void AnimCycleStarts();
void updateTarget(); void updateTarget();
void clearCommands(); void clearCommands();
void deleteQueuedCommand(Command *command); void deleteQueuedCommand(Command *command);
@ -820,7 +827,13 @@ private:
void startDamageParticles(); void startDamageParticles();
uint32 getFrameCount() const; uint32 getFrameCount() const;
void checkCustomizedParticleTriggers(bool force); void checkCustomizedParticleTriggers(bool force);
void checkCustomizedUnitParticleTriggers();
void checkCustomizedUnitParticleListTriggers(const UnitParticleSystemTypes &unitParticleSystemTypesList,
bool applySkillChangeParticles);
void queueTimedParticles(const UnitParticleSystemTypes &unitParticleSystemTypesList);
bool checkModelStateInfoForNewHpValue(); bool checkModelStateInfoForNewHpValue();
void checkUnitLevel(); void checkUnitLevel();

View File

@ -9,6 +9,13 @@
// License, or (at your option) any later version // License, or (at your option) any later version
// ============================================================== // ==============================================================
/**
* @file
* Contains the Upgrade and UpgradeManager classes. This is what the factions need to manage
* upgrades (including starting, canceling, and finishing upgrades, figuring out which
* upgrades we have done, etc).
*/
#ifndef _GLEST_GAME_UPGRADE_H_ #ifndef _GLEST_GAME_UPGRADE_H_
#define _GLEST_GAME_UPGRADE_H_ #define _GLEST_GAME_UPGRADE_H_
@ -33,25 +40,32 @@ class Unit;
class UpgradeType; class UpgradeType;
class Faction; class Faction;
/**
* Stores the state of the upgrade (whether or not the upgrading process is complete).
*/
// TODO: Don't make this global; move it inside Upgrade
enum UpgradeState { enum UpgradeState {
usUpgrading, usUpgrading, /**< The upgrade is currently in progress. */
usUpgraded, usUpgraded, /**< The upgrade is completed. */
upgradeStateCount upgradeStateCount // TODO: This should be unnecessary -- there's no need to iterate over this enum
}; };
class UpgradeManager; class UpgradeManager;
class TotalUpgrade; class TotalUpgrade;
// ===================================================== /**
// class Upgrade * An instance of an upgrade. Factions will typically have one upgrade of each type. This object
// * groups the type, faction, and upgrade state (ie, has the upgrade been obtained yet?).
/// A bonus to an UnitType */
// =====================================================
class Upgrade { class Upgrade {
private: private:
UpgradeState state; UpgradeState state;
// TODO: I believe this is unnecessary. As far as I can tell, it's only used for checking
// that the unit we're applying UpgradeManager::computeTotalUpgrade to is in this faction. However,
// I don't see an circumstances when it wouldn't be (since the UpgradeManager already an aggregate
// of a faction and Unit directly gets the UpgradeManager from the faction (so it must have the
// same faction as the upgrades in the UpgradeManager).
int factionIndex; int factionIndex;
const UpgradeType *type; const UpgradeType *type;
@ -59,50 +73,136 @@ private:
Upgrade(); Upgrade();
public: public:
/**
* Creates an upgrade. The upgrade state will be set to UpgradeState::usUpgrading.
* @param upgradeType The type of the upgrade that this corresponds to. Upgrade types are
* essentially "classes" for upgrades.
* @param factionIndex The index of the faction that the upgrade belongs to.
*/
Upgrade(const UpgradeType *upgradeType, int factionIndex); Upgrade(const UpgradeType *upgradeType, int factionIndex);
private: private:
//get
UpgradeState getState() const; UpgradeState getState() const;
int getFactionIndex() const; int getFactionIndex() const;
const UpgradeType * getType() const; const UpgradeType * getType() const;
//set
void setState(UpgradeState state); void setState(UpgradeState state);
/**
* Retrieves a string representation of the upgrade (detailing its state, type, and faction).
*/
std::string toString() const; std::string toString() const;
/**
* Saves the object state into the given node.
* @param rootNode The UpgradeManager node to save object info to.
*/
void saveGame(XmlNode *rootNode); void saveGame(XmlNode *rootNode);
/**
* Loads the object state from the given node.
* @param rootNode The UpgradeManager node to retrieve object info from.
* @param faction The faction that the upgrade belongs to. Used to convert the upgrade type from
* the XML string.
*/
static Upgrade * loadGame(const XmlNode *rootNode,Faction *faction); static Upgrade * loadGame(const XmlNode *rootNode,Faction *faction);
}; };
/**
// =============================== * Manages upgrades by starting, stopping, and finishing upgrades. Each faction has their own
// class UpgradeManager * upgrade manager.
// =============================== */
class UpgradeManager{ class UpgradeManager{
private: private:
typedef vector<Upgrade*> Upgrades; typedef vector<Upgrade*> Upgrades;
typedef map<const UpgradeType *,int> UgradesLookup; typedef map<const UpgradeType *,int> UgradesLookup;
/**
* List of upgrades that the upgrade manager is working with (either in progress or finished).
*/
Upgrades upgrades; Upgrades upgrades;
/**
* Maps UpgradeType to the index of the upgrade in UpgradeManager::upgrades.
*/
UgradesLookup upgradesLookup; UgradesLookup upgradesLookup;
public: public:
~UpgradeManager(); ~UpgradeManager();
int getUpgradeCount() const {return (int)upgrades.size();} int getUpgradeCount() const {return (int)upgrades.size();}
/**
* Starts an upgrade.
* @param upgradeType The type of the upgrade to start.
* @param factionIndex Passed to the constructor of the Upgrade.
*/
void startUpgrade(const UpgradeType *upgradeType, int factionIndex); void startUpgrade(const UpgradeType *upgradeType, int factionIndex);
/**
* Cancels an upgrade before it is finished. The upgrade is removed from the UpgradeManager.
* @param upgradeType The type of the upgrade to remove.
* @throws megaglest_runtime_error If there is no upgrade of the desired type in the UpgradeManager.
*/
void cancelUpgrade(const UpgradeType *upgradeType); void cancelUpgrade(const UpgradeType *upgradeType);
/**
* Sets an Upgrade in the UpgradeManager as finished (ie, the state is UpgradeState::usUpgraded).
* @param upgradeType The type of the upgrade to complete.
* @throws megaglest_runtime_error If there is no upgrade of the desired type in the UpgradeManager.
*/
void finishUpgrade(const UpgradeType *upgradeType); void finishUpgrade(const UpgradeType *upgradeType);
/**
* Returns true if an Upgrade of the desired type has state UpgradeState::usUpgraded (ie, is
* finished upgrading).
* @param upgradeType The type of the upgrade in question.
*/
bool isUpgraded(const UpgradeType *upgradeType) const; bool isUpgraded(const UpgradeType *upgradeType) const;
/**
* Returns true if an Upgrade of the desired type has state UpgradeState::usUpgrading (ie, is
* currently in progress).
* @param upgradeType The type of the upgrade in question.
*/
bool isUpgrading(const UpgradeType *upgradeType) const; bool isUpgrading(const UpgradeType *upgradeType) const;
/**
* Returns true if an Upgrade of the desired type exists in the UpgradeManager.
* @param upgradeType The type of the upgrade in question.
*/
bool isUpgradingOrUpgraded(const UpgradeType *upgradeType) const; bool isUpgradingOrUpgraded(const UpgradeType *upgradeType) const;
/**
* [Sums up](@ref TotalUpgrade::sum) the effect of all upgrades for this faction as they apply
* to a particular unit.
* @param unit The unit that the TotalUpgrade applies to. This is necessary because some
* upgrades provide percentage boosts.
* @param totalUpgrade The TotalUpgrade object to modify. Note that it is cleared before values
* are calculated.
*/
void computeTotalUpgrade(const Unit *unit, TotalUpgrade *totalUpgrade) const; void computeTotalUpgrade(const Unit *unit, TotalUpgrade *totalUpgrade) const;
/**
* Retrieves a string representation of the UpgradeManager. Contains the contents of
* Upgrade::toString for all upgrades in the UpgradeManager.
*/
std::string toString() const; std::string toString() const;
/**
* Adds a node for the UpgradeManager that contains all the upgrade nodes, saving the object's
* state.
* @param rootNode The faction node to add the UpgradeManager node to.
* @see Upgrade::saveGame
*/
void saveGame(XmlNode *rootNode); void saveGame(XmlNode *rootNode);
/**
* Loads all the upgrades from the UpgradeManager node, effectively reloading the object's
* state.
* @param rootNode The faction node to get the UpgradeManager node from.
* @param faction Only passed to Upgrade::loadGame (which does the actual loading of each
* Upgrade object.
*/
void loadGame(const XmlNode *rootNode,Faction *faction); void loadGame(const XmlNode *rootNode,Faction *faction);
}; };

Some files were not shown because too many files have changed in this diff Show More