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/
language: cpp
compiler:
- gcc
- clang
matrix:
#include:
# - compiler: gcc
# - compiler: clang
allow_failures:
- compiler: clang
git:
submodules: false
#branches:
# only:
# - master
before_install:
- sudo apt-get update -qq # UPDATE REPOS
- sudo mk/linux/setupBuildDeps.sh --quiet # INSTALL DEPENDENCIES HERE
#- sudo apt-get upgrade -qq # UPGRADE SYSTEM TO LATEST PATCH LEVEL
- sudo apt-get install -y -qq
- sudo mk/linux/setupBuildDeps.sh --quiet # INSTALL OUR DEPENDENCIES
script:
# ALL THE BUILD COMMANDS HERE
- mk/linux/build-mg.sh -c 4
notifications:
irc:
channels:

View File

@ -78,9 +78,10 @@ else()
endif()
endif()
## Compiler flags
## Compiler flags, CPACK configuration and other Apple specific code.
IF(APPLE)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
include(${PROJECT_SOURCE_DIR}/mk/macosx/CMakeLists.txt)
ENDIF(APPLE)
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")
ENDIF()
# Default compiler flags
SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE}")
# Debug compiler flags
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3")
# Release compiler flags
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE} -O3 ")
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## 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()
# Release with debug info compiler flags
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 ")
# Release minimum size compiler flags
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
SET(HAS_GIT "FALSE")
@ -239,12 +252,11 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
ENDIF()
ENDIF()
IF(APPLE AND NOT CMAKE_COMPILER_IS_GNUCXX)
SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_LIVE_REV_CMD}\\\\''")
ELSE()
SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_LIVE_REV_CMD}\\\"'")
# SET(SVN_VERSION_CMD "-DSVNVERSION='\\\"`svnversion -n ${PROJECT_SOURCE_DIR}`\\\"'")
ENDIF()
IF(CMAKE_GENERATOR STREQUAL Xcode)
SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_LIVE_REV_CMD}\\\\''")
ELSE()
SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_LIVE_REV_CMD}\\\"'")
ENDIF()
IF(CMAKE_INSTALL_PREFIX STREQUAL "")
MESSAGE(STATUS "*NOTE: NOT USING a Custom Data Install Path...")
@ -266,11 +278,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
ENDIF()
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)")
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()
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()
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}]")
ENDIF()
SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
@ -287,12 +296,15 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
# We do some funky character escaping to get the right stuff written out to
# the final Makefile so we get the GIT Global Revsion #
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE}")
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
string(REPLACE "'" "\"" CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
IF( CMAKE_BUILD_TYPE STREQUAL Debug )
IF( CMAKE_BUILD_TYPE STREQUAL None )
message("CMAKE_CXX_FLAGS_NONE: ${CMAKE_CXX_FLAGS_NONE}")
ELSEIF( CMAKE_BUILD_TYPE STREQUAL Debug )
message("CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
ELSEIF( CMAKE_BUILD_TYPE STREQUAL Release )
message("CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
@ -353,10 +365,6 @@ IF(EXISTS "${PROJECT_SOURCE_DIR}/source/")
#endif()
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 )
ENDIF()
@ -373,38 +381,7 @@ 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")
ENDIF()
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mark Vejvoda") #required
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "
libcurl4-gnutls-dev | libcurl4-nss-dev,
libfontconfig1-dev,
libftgl-dev,
libglew-dev,
libircclient-dev,
libjpeg-dev,
liblua5.1-0-dev,
libminiupnpc-dev,
libogg-dev,
libopenal-dev,
libpng12-dev,
libsdl1.2-dev,
libvlc-dev,
libvorbis-dev,
libwxgtk2.8-dev,
libxerces-c2-dev,
libxml2-dev,
libz-dev,
libfribidi-dev")
#find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
#if(DPKG_PROGRAM)
# execute_process(
# COMMAND ${DPKG_PROGRAM} --print-architecture
# OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
# OUTPUT_STRIP_TRAILING_WHITESPACE
# )
#endif(DPKG_PROGRAM)
# CPack configuration shared accross platforms
SET(CPACK_PACKAGE_NAME ${PKG_NAME})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MegaGlest")
SET(CPACK_PACKAGE_VENDOR "megaglest.org")
@ -414,12 +391,50 @@ 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_MUI_ICON "${PROJECT_SOURCE_DIR}/mk/windoze/glest.ico")
SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/mk/windoze/megaglest.ico")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://megaglest.org")
ENDIF()
# Debian specific generator options
IF(NOT DEFINED CPACK_GENERATOR)
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mark Vejvoda") #required
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "
libcurl4-gnutls-dev | libcurl4-nss-dev,
libfontconfig1-dev,
libftgl-dev,
libglew-dev,
libircclient-dev,
libjpeg-dev,
liblua5.1-0-dev,
libminiupnpc-dev,
libogg-dev,
libopenal-dev,
libpng12-dev,
libsdl1.2-dev,
libvlc-dev,
libvorbis-dev,
libwxgtk2.8-dev,
libxerces-c2-dev,
libxml2-dev,
libz-dev,
libfribidi-dev")
#find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
#if(DPKG_PROGRAM)
# execute_process(
# COMMAND ${DPKG_PROGRAM} --print-architecture
# OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
# OUTPUT_STRIP_TRAILING_WHITESPACE
# )
#endif(DPKG_PROGRAM)
ENDIF(NOT DEFINED CPACK_GENERATOR)
IF(CPACK_GENERATOR STREQUAL "NSIS")
SET(CPACK_NSIS_DISPLAY_NAME "MegaGlest")
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_NSIS_URL_INFO_ABOUT "http://megaglest.org")
ENDIF(CPACK_GENERATOR STREQUAL "NSIS")
INCLUDE(CPack)
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:
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
- 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)
# 2. Set the two vars below:
# WANT_CLANG=YES and CLANG_BIN_PATH=<path_to_the_clang_binary>
CLANG_BIN_PATH=$( which clang )
CLANGPP_BIN_PATH=$( which clang++ )
CLANG_BIN_PATH=$( which clang 2>/dev/null )
CLANGPP_BIN_PATH=$( which clang++ 2>/dev/null )
cd ${SCRIPTDIR}
@ -174,12 +174,12 @@ if [ $CLANG_FORCED = 1 ]; then
# If both the $CC and $CXX environment variable point to something containing
# "clang", use whatever these environment variables point to.
elif [ "`echo $CC | grep -oF 'clang'`" = 'clang' -a "`echo $CXX | grep -oF 'clang'`" = 'clang' ]; then
if [ `echo $CC | grep -Fq '/'` = '/' ]; then
if [ "`echo $CC | grep -Fo '/'`" = '/' ]; then
CLANG_CC=$CC
else
CLANG_CC=`which $CC`
fi
if [ `echo $CXX | grep -Fq '/'` = '/' ]; then
if [ "`echo $CXX | grep -Fo '/'`" = '/' ]; then
CLANG_CXX=$CXX
else
CLANG_CXX=`which $CXX`

View File

@ -32,6 +32,9 @@ PROJECT=MegaGlest
# E-Mail address of registered Coverity Scan user with project access
# EMAIL=x
# Where to store the data gathered by the Coverity Scan Build Tool
BUILDTOOL=cov-int
# read in config settings
if [ ! -f ${CURRENTDIR}/.coverity-scan ] ; then
echo "-----------------------------------------"
@ -44,24 +47,17 @@ fi
# echo "Read config values: TOKEN [$TOKEN] EMAIL [$EMAIL] COVERITY_ANALYSIS_ROOT [$COVERITY_ANALYSIS_ROOT] NUMCORES [${NUMCORES}]"
# 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
detect_system
computername=$(hostname)
#DESCRIPTION=${distribution}-${release}-${architecture}_${computername}
DESCRIPTION=${distribution}-${architecture}_${computername}
# 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}
#DESCRIPTION=${distribution}-${release}-${architecture}_${hostname}
DESCRIPTION=${GITBRANCH}.${GITVERSION_SHA1}.${distribution}-${architecture}.${hostname}
FILENAME=${PROJECT}.${DESCRIPTION}
# echo "FILENAME = [${FILENAME}]"
# exit 1
@ -105,3 +101,6 @@ else
rm -rf ${BUILDTOOL}/
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
echo "copying binaries ..."
cp -r lib/* "$RELEASEDIR/lib"
cp *.ico "$RELEASEDIR/"
cp {../shared/,}*.ico "$RELEASEDIR/"
cp *.bmp "$RELEASEDIR/"
cp *.png "$RELEASEDIR/"
cp *.xpm "$RELEASEDIR/"
cp *.ini "$RELEASEDIR/"
cp {../shared/,}*.ini "$RELEASEDIR/"
cp megaglest "$RELEASEDIR/"
cp megaglest_editor "$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/"
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"
echo "creating data archive: $PACKAGE"
[[ -f "${RELEASEDIR_ROOT}/$PACKAGE" ]] && rm "${RELEASEDIR_ROOT}/$PACKAGE"

View File

@ -79,6 +79,8 @@ cd "$CURRENTDIR"
# START
# remove embedded data
rm -rf "$RELEASEDIR/data/core/fonts"
# remove cegui data
rm -rf "$RELEASEDIR/data/cegui"
# END
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_BINARY=3.9.1
MG_VERSION=3.10.0-dev
MG_VERSION=3.11.0
if [ "$1" = "--oldversion" ]; then
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_VERSION = "3.10.0-dev";
local GAME_INSTALL_SIZE = 680000000;
local GAME_VERSION = "3.11.0";
local _ = MojoSetup.translate

View File

@ -153,6 +153,12 @@ case $distribution in
$installcommand
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'
unsupported_release
@ -167,7 +173,7 @@ case $distribution in
fi
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
if [ $? != 0 ]; then error_during_installation; exit 1; fi
@ -180,7 +186,7 @@ case $distribution in
esac
;;
SuSE|SUSE?LINUX|Opensuse)
SuSE|SUSE?LINUX|Opensuse*|openSUSE*)
case $release in
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'
@ -192,6 +198,11 @@ case $distribution in
$installcommand
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'
unsupported_release

View File

@ -202,6 +202,15 @@ GCRYPT_LINKEDLIBNAME='libgcrypt.so.11'
GCRYPT_LIBLOOKUP1=${GCRYPT_LINKEDLIBNAME}
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
DIRECTFB_LINKEDLIBNAME='libdirectfb-1.2.so.0'
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/${VLC_LINKEDLIBNAME}" "$VLC_LIBLOOKUP1" "$VLC_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 $@

View File

@ -25,38 +25,34 @@ IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
ENDIF()
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
#extracting the current version...
EXECUTE_PROCESS(
COMMAND /usr/bin/sed
-n -e "s/.*glestVersionString = \"v\\\(.*\\\)\";.*/\\1/p"
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")
# This changes Info.plist from something with variables and CMakeisms to
# something that can be installed on disk.
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist"
"${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
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
"${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt")
set (CPACK_GENERATOR Bundle)
set (CPACK_BUNDLE_NAME "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_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_SOURCE_DIR}/mk/macosx/Info.plist.template")
# Install files in to the package (FIXME: how? we sure?)
INSTALL(FILES
${LUA_LIBRARIES}
DESTINATION ../Frameworks
@ -73,6 +69,4 @@ STRING(REGEX REPLACE ";.*" "" SDL_LIBRARY_DIR "${SDL_LIBRARY}")
# ${PNG_LIBRARY}
# DESTINATION ../Frameworks
# )
include (CPack)

View File

@ -5,13 +5,13 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>MegaGlest</string>
<string>megaglest</string>
<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>
<string>MegaGlest</string>
<key>CFBundleIdentifier</key>
<string>geovah.MegaGlest</string>
<string>org.megaglest.v${VER_MAJOR}-${VER_MINOR}-${VER_RELEASE}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MEGAGLEST_VERSION}</string>
<string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}</string>
<key>CFBundleSignature</key>
<string>????</string>
<string>MGGL</string>
<key>CFBundleVersion</key>
<string>${MEGAGLEST_VERSION}</string>
<string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>

View File

@ -42,6 +42,7 @@ HotKeySelectedUnitsAttack=A
HotKeySelectedUnitsStop=S
HotKeyToggleOSMouseEnabled=/
ChatTeamMode=H
ToggleHealthbars=#
ToggleMusic=K
SaveGUILayout=f10
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|Win32 = Release with error catching|Win32
Release with error catching|x64 = Release with error catching|x64
Release_NO_STREFLOP|Mixed Platforms = Release_NO_STREFLOP|Mixed Platforms
Release_NO_STREFLOP|Win32 = Release_NO_STREFLOP|Win32
Release_NO_STREFLOP|x64 = Release_NO_STREFLOP|x64
Release_WITHOUT_STREFLOP|Mixed Platforms = Release_WITHOUT_STREFLOP|Mixed Platforms
Release_WITHOUT_STREFLOP|Win32 = Release_WITHOUT_STREFLOP|Win32
Release_WITHOUT_STREFLOP|x64 = Release_WITHOUT_STREFLOP|x64
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
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|x64.ActiveCfg = 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_NO_STREFLOP|Mixed Platforms.Build.0 = Release|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|Win32.ActiveCfg = Release|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|Win32.Build.0 = Release|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|x64.ActiveCfg = Release|x64
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_NO_STREFLOP|x64.Build.0 = Release|x64
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{407355A4-D12A-4E3B-A7EB-A835E573B376}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|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.Build.0 = 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|x64.ActiveCfg = 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_NO_STREFLOP|Mixed Platforms.Build.0 = Release|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|Win32.ActiveCfg = Release|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|Win32.Build.0 = Release|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|x64.ActiveCfg = Release|x64
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_NO_STREFLOP|x64.Build.0 = Release|x64
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{3BAC3FE8-1CC4-487D-802A-E0A04B39BB6A}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|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.Build.0 = 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|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_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_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|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|x64
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{8DAA0C24-95CD-4F66-B4C5-19ABDD771746}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_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.Build.0 = 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|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_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_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|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{6B0C65F1-D031-46AF-AC0D-7C38892D2952}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_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.Build.0 = 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|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_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_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|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_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.Build.0 = 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|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_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_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|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_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.Build.0 = 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|x64.ActiveCfg = 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_NO_STREFLOP|Mixed Platforms.Build.0 = Release|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|Win32.ActiveCfg = Release|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|Win32.Build.0 = Release|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|x64.ActiveCfg = Release|x64
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_NO_STREFLOP|x64.Build.0 = Release|x64
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{9A3DE527-6000-40BB-B971-F0FCAD9FF519}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_STREFLOP|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.Build.0 = 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|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_NO_STREFLOP|Mixed Platforms.ActiveCfg = Release_NO_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|Mixed Platforms.Build.0 = Release_NO_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|Win32.ActiveCfg = Release_NO_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|Win32.Build.0 = Release_NO_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_NO_STREFLOP|x64.ActiveCfg = Release_NO_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|Mixed Platforms.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|Mixed Platforms.Build.0 = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|Win32.ActiveCfg = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|Win32.Build.0 = Release_WITHOUT_STREFLOP|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release_WITHOUT_STREFLOP|x64.ActiveCfg = Release_WITHOUT_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.Build.0 = Release|Win32
{CDF4DDB9-945E-4D0D-9F0E-2BBEB5D22141}.Release|Win32.ActiveCfg = Release|Win32

View File

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

View File

@ -2,10 +2,10 @@
; General Attributes
!define APNAME MegaGlest
!define APVER 3.10.0-dev
!define APVER 3.11.0
!define APNAME_OLD Mega-Glest
!define APVER_OLD 3.9.1
!define APVER_UPDATE 3.10.0-dev
!define APVER_UPDATE 3.11.0
Name "${APNAME} ${APVER_UPDATE}"
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,16 +93,18 @@ copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
rem Build Mega-Glest in release mode
ECHO --------------------------------
Echo Building Mega-Glest using Visual Studio 2010...
Echo Building MegaGlest using Visual Studio 2010...
set CL=
del ..\..\source\glest_game\facilities\gitversion.h
if not "%GITVERSION_SHA1%" == "." set CL=/DGITVERSIONHEADER
if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%]
if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%]
if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h
if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
del /Q /F Release\*.tlog
set msBuildMaxCPU=
SET BuildInParallel=false
SET BuildInParallelCount=

View File

@ -117,7 +117,7 @@ copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
rem Build Mega-Glest in release mode
ECHO --------------------------------
Echo Building Mega-Glest using Visual Studio 2012...
Echo Building MegaGlest using Visual Studio 2012...
set CL=/MP
rem set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE%
@ -138,10 +138,12 @@ rem set PlatformToolset=V110
del ..\..\source\glest_game\facilities\gitversion.h
if not "%GITVERSION_SHA1%" == "." set CL=/DGITVERSIONHEADER
if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%]
if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%]
if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h
if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
del /Q /F Release\*.tlog
rem set VisualStudioVersion=11.0
set msBuildMaxCPU=
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 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 %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
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
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\resource_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\unit_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\resource_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\unit_type.h" />
<ClInclude Include="..\..\source\glest_game\types\upgrade_type.h" />

View File

@ -9,6 +9,22 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -31,12 +47,36 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
@ -51,9 +91,21 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -68,20 +120,48 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">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_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_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_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_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_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_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>g2xml</TargetName>
</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'">
<TargetName>g2xmlx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</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'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -140,6 +220,50 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
</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'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
@ -163,6 +287,52 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</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>
<ClCompile Include="..\..\..\source\tools\glexemel\g2xml.c" />
</ItemGroup>

View File

@ -17,6 +17,14 @@
<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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -43,10 +51,18 @@
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
@ -65,9 +81,15 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -82,22 +104,34 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">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_WITHOUT_STREFLOP|Win32'">.\..\..\..\data\glest_game\</OutDir>
<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_WITHOUT_STREFLOP|Win32'">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>
<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|x64'">true</LinkIncremental>
<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_WITHOUT_STREFLOP|x64'">megaglest_g3dviewerx64</TargetName>
<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_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -188,6 +222,42 @@
</DataExecutionPrevention>
</Link>
</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'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -225,6 +295,43 @@
</DataExecutionPrevention>
</Link>
</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'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
@ -305,4 +412,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -17,6 +17,14 @@
<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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -43,10 +51,18 @@
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
@ -65,9 +81,15 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -82,22 +104,34 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">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_WITHOUT_STREFLOP|Win32'">.\..\..\..\data\glest_game\</OutDir>
<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_WITHOUT_STREFLOP|Win32'">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>
<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|x64'">true</LinkIncremental>
<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_WITHOUT_STREFLOP|x64'">megaglest_editorx64</TargetName>
<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_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -187,6 +221,41 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
</Link>
</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'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -224,6 +293,43 @@
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Link>
</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'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
@ -302,4 +408,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -17,6 +17,14 @@
<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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -48,12 +56,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
@ -76,9 +96,15 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -91,9 +117,13 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\..\..\..\data\glest_game\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<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_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<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_WITHOUT_STREFLOP|x64'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
<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|x64'">false</LinkIncremental>
<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_WITHOUT_STREFLOP|x64'">megaglestx64</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|x64'">
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -247,6 +283,56 @@
</IgnoreAllDefaultLibraries>
</Link>
</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'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -297,6 +383,56 @@
</IgnoreAllDefaultLibraries>
</Link>
</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'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
@ -435,6 +571,7 @@
<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_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\type_instances\command.cpp" />
<ClCompile Include="..\..\..\source\glest_game\type_instances\faction.cpp" />
@ -562,4 +699,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -25,6 +25,14 @@
<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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -66,12 +74,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</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">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
@ -99,9 +119,15 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -114,7 +140,9 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<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_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug-MT|Win32'">$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
@ -123,11 +151,19 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>libstreflop</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<TargetName>libstreflop</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>libstreflop</TargetName>
<OutDir>.\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</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'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -184,6 +220,33 @@
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</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'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -213,6 +276,35 @@
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</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'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
@ -378,4 +470,4 @@
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</ImportGroup>
</Project>
</Project>

View File

@ -9,6 +9,22 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -42,6 +58,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@ -49,6 +79,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</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" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
@ -61,9 +105,21 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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 Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
@ -77,12 +133,34 @@
<OutDir>.\..\..\..\data\glest_game\</OutDir>
<TargetName>megaglest_tests</TargetName>
</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'">
<TargetName>megaglest_testsx64</TargetName>
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</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'">
<ClCompile>
<PrecompiledHeader>
@ -158,6 +236,68 @@
<Message>Run unit tests</Message>
</PostBuildEvent>
</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'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@ -192,6 +332,74 @@
<Message>Run unit tests</Message>
</PostBuildEvent>
</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>
<ClCompile Include="..\..\..\source\tests\shared_lib\graphics\font_test.cpp" />
<ClCompile Include="..\..\..\source\tests\shared_lib\graphics\math_util_test.cpp" />

View File

@ -17,6 +17,14 @@
<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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -48,12 +56,24 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</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">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
@ -74,9 +94,15 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -89,19 +115,30 @@
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<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_WITHOUT_STREFLOP|Win32'">$(Configuration)/$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|Win32'">$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>libglest</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_WITHOUT_STREFLOP|Win32'">
<TargetName>libglest</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>libglest</TargetName>
<OutDir>.\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<ExecutablePath>$(ExecutablePath)</ExecutablePath>
</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'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -193,6 +230,36 @@
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Lib>
</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'">
<ClCompile>
<AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
@ -226,6 +293,39 @@
<IgnoreSpecificDefaultLibraries>;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
</Lib>
</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'">
<ClCompile>
<AdditionalOptions>/arch:SSE2 %(AdditionalOptions)</AdditionalOptions>
@ -492,4 +592,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -9,6 +9,22 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</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">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -31,12 +47,36 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</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">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
@ -51,9 +91,21 @@
<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" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</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">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -68,20 +120,48 @@
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">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_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_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_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_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_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_WITHOUT_STREFLOP|x64'">false</GenerateManifest>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release_NO_STREFLOP|x64'">false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>xml2g</TargetName>
</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'">
<TargetName>xml2gx64</TargetName>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<OutDir>$(SolutionDir)</OutDir>
</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'">
<ClCompile>
<Optimization>Disabled</Optimization>
@ -149,6 +229,56 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
</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'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
@ -175,6 +305,58 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</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>
<ClCompile Include="..\..\..\source\tools\glexemel\xml2g.c" />
</ItemGroup>

2
source/.gitignore vendored
View File

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

View File

@ -201,6 +201,7 @@ public:
void onKeyDown(wxKeyEvent &event);
void setCurrentGLContext();
wxGLContext * getCtx() { return context; }
private:
MainWindow *mainWindow;
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);
}
void Renderer::endModel(ResourceScope rs,Model *model) {
modelManager->endModel(model);
}
void Renderer::init() {
assertGl();

View File

@ -147,6 +147,7 @@ public:
Texture2D * getNewTexture2D();
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(); }
void initTextureManager();

View File

@ -208,6 +208,7 @@ IF(BUILD_MEGAGLEST)
ENDIF()
IF(WIN32)
SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE} -Wl,-subsystem,console -mconsole")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wl,-subsystem,console -mconsole")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-subsystem,console -mconsole")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wl,-subsystem,console -mconsole")

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;
for(int i=0; i<aiInterface->getMyUnitCount(); ++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){
units.push_back(i);
}
@ -553,55 +553,57 @@ vector<int> Ai::findUnitsHarvestingResourceType(const ResourceType *rt) {
Map *map= aiInterface->getMap();
for(int i = 0; i < aiInterface->getMyUnitCount(); ++i) {
const Unit *unit= aiInterface->getMyUnit(i);
if(unit->getType()->hasCommandClass(ccHarvest)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccHarvest) {
Command *command= unit->getCurrCommand();
const HarvestCommandType *hct= dynamic_cast<const HarvestCommandType*>(command->getCommandType());
if(hct != NULL) {
const Vec2i unitTargetPos = unit->getTargetPos();
SurfaceCell *sc= map->getSurfaceCell(Map::toSurfCoords(unitTargetPos));
Resource *r= sc->getResource();
if (r != NULL && r->getType() == rt) {
units.push_back(i);
}
}
}
}
else if(unit->getType()->hasCommandClass(ccProduce)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccProduce) {
Command *command= unit->getCurrCommand();
const ProduceCommandType *pct= dynamic_cast<const ProduceCommandType*>(command->getCommandType());
if(pct != NULL) {
const UnitType *ut = pct->getProducedUnit();
if(ut != NULL) {
const Resource *r = ut->getCost(rt);
if(r != NULL) {
if (r != NULL && r->getAmount() < 0) {
units.push_back(i);
}
if(unit->getType()->isCommandable()) {
if(unit->getType()->hasCommandClass(ccHarvest)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccHarvest) {
Command *command= unit->getCurrCommand();
const HarvestCommandType *hct= dynamic_cast<const HarvestCommandType*>(command->getCommandType());
if(hct != NULL) {
const Vec2i unitTargetPos = unit->getTargetPos();
SurfaceCell *sc= map->getSurfaceCell(Map::toSurfCoords(unitTargetPos));
Resource *r= sc->getResource();
if (r != NULL && r->getType() == rt) {
units.push_back(i);
}
}
}
}
}
}
}
else if(unit->getType()->hasCommandClass(ccBuild)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccBuild) {
Command *command= unit->getCurrCommand();
const BuildCommandType *bct= dynamic_cast<const BuildCommandType*>(command->getCommandType());
if(bct != NULL) {
for(int j = 0; j < bct->getBuildingCount(); ++j) {
const UnitType *ut = bct->getBuilding(j);
else if(unit->getType()->hasCommandClass(ccProduce)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccProduce) {
Command *command= unit->getCurrCommand();
const ProduceCommandType *pct= dynamic_cast<const ProduceCommandType*>(command->getCommandType());
if(pct != NULL) {
const UnitType *ut = pct->getProducedUnit();
if(ut != NULL) {
const Resource *r = ut->getCost(rt);
if(r != NULL) {
if (r != NULL && r->getAmount() < 0) {
units.push_back(i);
break;
}
}
}
}
}
}
}
}
else if(unit->getType()->hasCommandClass(ccBuild)) {
if(unit->anyCommand() && unit->getCurrCommand()->getCommandType()->getClass() == ccBuild) {
Command *command= unit->getCurrCommand();
const BuildCommandType *bct= dynamic_cast<const BuildCommandType*>(command->getCommandType());
if(bct != NULL) {
for(int j = 0; j < bct->getBuildingCount(); ++j) {
const UnitType *ut = bct->getBuilding(j);
if(ut != NULL) {
const Resource *r = ut->getCost(rt);
if(r != NULL) {
if (r != NULL && r->getAmount() < 0) {
units.push_back(i);
break;
}
}
}
}
}
}
}
}
}
@ -614,7 +616,7 @@ vector<int> Ai::findUnitsDoingCommand(CommandClass currentCommand) {
for(int i = 0; i < aiInterface->getMyUnitCount(); ++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) {
units.push_back(i);
}
@ -630,7 +632,7 @@ bool Ai::findAbleUnit(int *unitIndex, CommandClass ability, CommandClass current
*unitIndex= -1;
for(int i=0; i<aiInterface->getMyUnitCount(); ++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){
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(aiInterface->reqsOk(ct)){
defCt= ct;
//defCt= ct;
producers.push_back(i);
producersDefaultCommandType[i].push_back(ct);
}
@ -1779,7 +1779,7 @@ void AiRuleBuild::buildSpecific(const BuildTask *bt) {
if(aiInterface->reqsOk(bct)) {
builders.push_back(i);
buildersDefaultCommandType[i].push_back(bct);
defBct= bct;
//defBct= bct;
}
}
}

View File

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

View File

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

View File

@ -19,6 +19,7 @@
#include "platform_util.h"
#include "conversion.h"
#include "cache_manager.h"
#include "errno.h"
#include "leak_dumper.h"
using namespace Shared::Util;
@ -27,7 +28,13 @@ using namespace Shared::Platform;
namespace Glest { namespace Game {
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)
const string GIT_RawRev = string(GITVERSION);
const string GIT_Rev = string("Rev: ") + string(GITVERSION);
@ -47,7 +54,7 @@ string getCrashDumpFileName(){
return "megaglest" + glestVersionString + ".dmp";
}
string getPlatformNameString() {
string getPlatformTypeNameString() {
static string platform;
if(platform == "") {
#if defined(WIN32)
@ -89,27 +96,42 @@ string getPlatformNameString() {
#else
platform = "???";
#endif
}
return platform;
}
string getPlatformArchTypeNameString() {
static string platform;
if(platform == "") {
#if defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) || defined(_WIN64)
platform += "-X64";
platform = "-X64";
#elif defined(_M_ALPHA) || defined(__alpha__)
platform += "-ALPHA";
platform = "-ALPHA";
#elif defined(_M_IA64) || defined(__ia64__)
platform += "-IA64";
platform = "-IA64";
#elif defined(_M_MRX000) || defined(__mips__)
platform += "-MIPS";
platform = "-MIPS";
#elif defined(_M_PPC) || defined(__powerpc__)
platform += "-POWERPC";
platform = "-POWERPC";
#elif defined(__sparc__)
platform += "-SPARC";
platform = "-SPARC";
#elif defined(_M_ARM_FP) || defined(__arm__) || defined(_M_ARM)
platform += "-ARM";
platform = "-ARM";
#endif
}
return platform;
}
string getPlatformNameString() {
static string platform;
if(platform == "") {
platform = getPlatformTypeNameString() + getPlatformArchTypeNameString();
}
return platform;
}
string getGITRevisionString() {
return GIT_Rev;
}
@ -191,7 +213,7 @@ string getAboutString1(int i) {
case 0: return "MegaGlest " + glestVersionString + " (" + "Shared Library " + sharedLibVersionString + ")";
case 1: return "Built: " + string(__DATE__) + " " + GIT_Rev;
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 "";
}
@ -349,4 +371,40 @@ void initSpecialStrings() {
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

View File

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

View File

@ -103,21 +103,29 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) {
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
//toggle team mode
if(editEnabled == false && disableTeamMode == false &&
if(editEnabled == false &&
isKeyPressed(configKeys.getSDLKey("ChatTeamMode"),key) == true) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym,key.keysym.sym);
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);
if (!inMenu) {
if (teamMode == true) {
teamMode = false;
console->addLine(lang.getString("ChatMode") + ": " + lang.getString("All"));
} else {
teamMode = true;
console->addLine(lang.getString("ChatMode") + ": " + lang.getString("Team"));
if (!inMenu) {
if (teamMode == true) {
teamMode = false;
console->addLine(lang.getString("ChatMode") + ": " + lang.getString("All"));
} else {
teamMode = true;
console->addLine(lang.getString("ChatMode") + ": " + lang.getString("Team"));
}
}
}
}
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);

View File

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

View File

@ -115,6 +115,7 @@ Game::Game() : ProgramState(NULL) {
renderFpsAvgTest=0;
renderExtraTeamColor=0;
photoModeEnabled=false;
healthbarMode=hbvUndefined;
visibleHUD=false;
timeDisplay=false;
withRainEffect=false;
@ -190,11 +191,15 @@ void Game::resetMembers() {
GameConstants::updateFps= 40;
GameConstants::cameraFps= 100;
captureAvgTestStatus = false;
updateFpsAvgTest=0;
renderFpsAvgTest=0;
lastRenderLog2d = 0;
lastMasterServerGameStatsDump = 0;
totalRenderFps = 0;
lastMaxUnitCalcTime = 0;
renderExtraTeamColor = 0;
playerIndexDisconnect=0;
lastMasterServerGameStatsDump=0;
highlightCellTexture=NULL;
totalRenderFps =0;
lastMaxUnitCalcTime =0;
renderExtraTeamColor =0;
mouseMoved= false;
quitTriggeredIndicator = false;
@ -235,6 +240,7 @@ void Game::resetMembers() {
scrollSpeed = Config::getInstance().getFloat("UiScrollSpeed","1.5");
photoModeEnabled = Config::getInstance().getBool("PhotoMode","false");
healthbarMode = Config::getInstance().getInt("HealthBarMode","0");
visibleHUD = Config::getInstance().getBool("VisibleHud","true");
timeDisplay = Config::getInstance().getBool("TimeDisplay","true");
withRainEffect = Config::getInstance().getBool("RainEffect","true");
@ -269,6 +275,7 @@ void Game::resetMembers() {
this->speed= 1;
showFullConsole= false;
setMarker = false;
cameraDragAllowed=false;
camLeftButtonDown=false;
camRightButtonDown=false;
camUpButtonDown=false;
@ -309,6 +316,11 @@ Game::Game(Program *program, const GameSettings *gameSettings,bool masterserverM
this->masterserverMode = masterserverMode;
videoPlayer = NULL;
playingStaticVideo = false;
highlightCellTexture = NULL;
playerIndexDisconnect=0;
updateFpsAvgTest=0;
renderFpsAvgTest=0;
cameraDragAllowed=false;
if(this->masterserverMode == true) {
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__);
quitGame();
sleep(0);
Object::setStateCallback(NULL);
thisGamePtr = NULL;
@ -1242,7 +1255,8 @@ void Game::init(bool initForPreviewOnly) {
//message box
errorMessageBox.init(lang.getString("Ok"));
errorMessageBox.setEnabled(false);
errorMessageBox.setY(mainMessageBox.getY() - mainMessageBox.getH() - 10);
errorMessageBox.setY(20);
//init world, and place camera
commander.init(&world);
@ -2169,7 +2183,7 @@ void Game::update() {
}
if(currentCameraFollowUnit != NULL) {
Vec3f c=currentCameraFollowUnit->getCurrVector();
Vec3f c=currentCameraFollowUnit->getCurrMidHeightVector();
int rotation=currentCameraFollowUnit->getRotation();
float angle=rotation+180;
@ -4109,8 +4123,7 @@ void Game::mouseDownLeft(int x, int y) {
if(setMarker) {
Vec2i targetPos;
Vec2i screenPos(x,y-60);
Renderer &renderer= Renderer::getInstance();
renderer.computePosition(screenPos, targetPos);
targetPos=getMouseCellPos();
//Vec2i surfaceCellPos = map->toSurfCoords(targetPos);
@ -4124,8 +4137,7 @@ void Game::mouseDownLeft(int x, int y) {
if(originalIsMarkCellEnabled == true && isMarkCellEnabled == true) {
Vec2i targetPos;
Vec2i screenPos(x,y-60);
Renderer &renderer= Renderer::getInstance();
renderer.computePosition(screenPos, targetPos);
targetPos=getMouseCellPos();
Vec2i surfaceCellPos = map->toSurfCoords(targetPos);
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);
//renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos);
renderer.forceQuadCacheUpdate();
Renderer::getInstance().forceQuadCacheUpdate();
}
if(originalIsUnMarkCellEnabled == true && isUnMarkCellEnabled == true) {
Vec2i targetPos;
Vec2i screenPos(x,y-35);
Renderer &renderer= Renderer::getInstance();
renderer.computePosition(screenPos, targetPos);
targetPos=getMouseCellPos();
Vec2i surfaceCellPos = map->toSurfCoords(targetPos);
// if(mapMarkedCellList.find(surfaceCellPos) != mapMarkedCellList.end()) {
@ -4164,7 +4175,7 @@ void Game::mouseDownLeft(int x, int y) {
//Renderer &renderer= Renderer::getInstance();
//renderer.updateMarkedCellScreenPosQuadCache(surfaceCellPos);
renderer.forceQuadCacheUpdate();
Renderer::getInstance().forceQuadCacheUpdate();
}
}
}
@ -4246,9 +4257,8 @@ void Game::mouseDownRight(int x, int y) {
else {
Vec2i targetPos;
Vec2i screenPos(x,y);
Renderer &renderer= Renderer::getInstance();
renderer.computePosition(screenPos, targetPos);
if(renderer.computePosition(screenPos, targetPos) == true &&
targetPos=getMouseCellPos();
if(isValidMouseCellPos() == true &&
map->isInsideSurface(map->toSurfCoords(targetPos)) == true) {
gui.mouseDownRightGraphics(x, y,false);
}
@ -4508,7 +4518,7 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
lastMousePos.y = mouseY;
Renderer &renderer= Renderer::getInstance();
renderer.computePosition(Vec2i(mouseX, mouseY), mouseCellPos);
renderer.ccomputePosition(Vec2i(mouseX, mouseY), mouseCellPos);
}
catch(const exception &ex) {
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) {
if(this->masterserverMode == true) {
return;
@ -4566,7 +4585,7 @@ void Game::startCameraFollowUnit() {
if(currentUnit != NULL) {
currentCameraFollowUnit = currentUnit;
getGameCameraPtr()->setState(GameCamera::sUnit);
getGameCameraPtr()->setPos(currentCameraFollowUnit->getCurrVector());
getGameCameraPtr()->setPos(currentCameraFollowUnit->getCurrMidHeightVector());
int rotation=currentCameraFollowUnit->getRotation();
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
//else if(key == configKeys.getCharKey("ToggleMusic")) {
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();
//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) 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) chrono.start();
//renderOnTopBars (aka Healthbars)
if(photoModeEnabled == false) {
renderer.renderHealthBars(healthbarMode);
}
//mouse 3d
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());
@ -5391,29 +5448,31 @@ string Game::getDebugStats(std::map<int,string> &factionDebugInfo) {
for(int i = 0; i < world.getFactionCount(); ++i) {
string factionInfo = this->gameSettings.getNetworkPlayerName(i);
//factionInfo += " [" + this->gameSettings.getNetworkPlayerUUID(i) + "]";
float multi=world.getStats()->getResourceMultiplier(i);
string multiplier="["+floatToStr(multi,1)+"]";
switch(this->gameSettings.getFactionControl(i)) {
case ctCpuEasy:
factionInfo += " CPU Easy";
factionInfo += " CPU Easy"+multiplier;
break;
case ctCpu:
factionInfo += " CPU Normal";
factionInfo += " CPU Normal"+multiplier;
break;
case ctCpuUltra:
factionInfo += " CPU Ultra";
factionInfo += " CPU Ultra"+multiplier;
break;
case ctCpuMega:
factionInfo += " CPU Mega";
factionInfo += " CPU Mega"+multiplier;
break;
}
factionInfo += " [" + formatString(this->gameSettings.getFactionTypeName(i)) +
" team: " + intToStr(this->gameSettings.getTeam(i)) + "]";
// bool showResourceDebugInfo = false;
// bool showResourceDebugInfo = true;
// if(showResourceDebugInfo == true) {
// factionInfo +=" res: ";
// 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 += " ";
// }
// }
@ -5627,7 +5686,7 @@ void Game::render2d() {
if(this->masterserverMode == false) {
renderer.renderResourceStatus();
}
renderer.renderConsole(&console,showFullConsole);
renderer.renderConsole(&console,showFullConsole?consoleFull:consoleNormal);
}
//2d mouse
@ -6648,7 +6707,7 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
Lang &lang= Lang::getInstance();
string gameVer = versionNode->getAttribute("version")->getValue();
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) {
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);
@ -6709,7 +6768,10 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
Lang &lang= Lang::getInstance();
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]="";
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
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 *statsNode = worldNode->getChild("Stats");
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
minimapNode->clearChild("fowPixmap1");
@ -6799,7 +6867,13 @@ void Game::loadGame(string name,Program *programPtr,bool isMasterserverMode,cons
newGame->tickCount = gameNode->getAttribute("tickCount")->getIntValue();
//bool paused;
newGame->paused = gameNode->getAttribute("paused")->getIntValue() != 0;
if(newGame->inJoinGameLoading==true){
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;
newGame->gameOver = gameNode->getAttribute("gameOver")->getIntValue() != 0;
//bool renderNetworkStatus;

View File

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

View File

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

View File

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

View File

@ -252,6 +252,7 @@ void ScriptManager::init(World* world, GameCamera *gameCamera, const XmlNode *ro
luaScript.registerFunction(shakeCameraOnUnit, "shakeCameraOnUnit");
luaScript.registerFunction(createUnit, "createUnit");
luaScript.registerFunction(createUnitNoSpacing, "createUnitNoSpacing");
luaScript.registerFunction(setLockedUnitForFaction, "setLockedUnitForFaction");
luaScript.registerFunction(destroyUnit, "destroyUnit");
luaScript.registerFunction(giveKills, "giveKills");
luaScript.registerFunction(morphToUnit, "morphToUnit");
@ -1032,8 +1033,11 @@ void ScriptManager::shakeCamera(int shakeIntensity, int shakeDuration, bool came
if (cameraDistanceAffected) {
Unit *unit = world->findUnitById(unitId);
gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, unit->getCurrVector());
} else {
if(unit) {
gameCamera->shake(shakeDuration, shakeIntensity,cameraDistanceAffected, unit->getCurrMidHeightVector());
}
}
else {
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);
}
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){
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);
@ -1531,6 +1545,17 @@ int ScriptManager::getUnitFaction(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__);
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);
}
@ -1709,7 +1734,7 @@ int ScriptManager::isFreeCellsOrHasUnit(int field, int unitId, Vec2i pos) {
if(unit == NULL) {
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);
@ -1719,7 +1744,7 @@ int ScriptManager::isFreeCellsOrHasUnit(int field, int unitId, 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__);
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);
@ -2314,6 +2339,33 @@ int ScriptManager::destroyUnit(LuaHandle* luaHandle) {
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) {
LuaArguments luaArguments(luaHandle);
@ -3414,6 +3466,7 @@ int ScriptManager::getUnitFaction(LuaHandle* luaHandle){
return luaArguments.getReturnCount();
}
int ScriptManager::getUnitName(LuaHandle* luaHandle){
LuaArguments luaArguments(luaHandle);
try {
@ -3435,6 +3488,28 @@ int ScriptManager::getUnitName(LuaHandle* luaHandle){
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){
LuaArguments luaArguments(luaHandle);
try {

View File

@ -282,6 +282,7 @@ private:
void createUnit(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 giveKills(int unitId, int amount);
void morphToUnit(int unitId,const string &morphName, int ignoreRequirements);
@ -356,6 +357,7 @@ private:
Vec2i getUnitPosition(int unitId);
int getUnitFaction(int unitId);
const string getUnitName(int unitId);
const string getUnitDisplayName(int unitId);
int getResourceAmount(const string &resourceName, int factionIndex);
const string &getLastCreatedUnitName();
int getLastCreatedUnitId();
@ -447,6 +449,7 @@ private:
static int createUnit(LuaHandle* luaHandle);
static int createUnitNoSpacing(LuaHandle* luaHandle);
static int setLockedUnitForFaction(LuaHandle* luaHandle);
static int destroyUnit(LuaHandle* luaHandle);
static int giveKills(LuaHandle* luaHandle);
static int morphToUnit(LuaHandle* luaHandle);
@ -521,6 +524,7 @@ private:
static int getUnitPosition(LuaHandle* luaHandle);
static int getUnitFaction(LuaHandle* luaHandle);
static int getUnitName(LuaHandle* luaHandle);
static int getUnitDisplayName(LuaHandle* luaHandle);
static int getResourceAmount(LuaHandle* luaHandle);
static int getLastCreatedUnitName(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::NETWORK_SLOT_UNCONNECTED_SLOTNAME = "???";
const char *GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME = "Closed";
const char *GameConstants::folder_path_screenshots = "screens/";

View File

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

View File

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

View File

@ -3,9 +3,9 @@
//
// Copyright (C) 2010-2010 Titus Tscharntke
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
@ -57,6 +57,8 @@ ParticleSystemType::ParticleSystemType() {
size=0;
sizeNoEnergy=0;
speed=0;
speedUpRelative=0;
speedUpConstant=0;
gravity=0;
emissionRate=0;
energyMax=0;
@ -107,6 +109,8 @@ void ParticleSystemType::copyAll(const ParticleSystemType &src) {
this->size = src.size;
this->sizeNoEnergy = src.sizeNoEnergy;
this->speed = src.speed;
this->speedUpRelative = src.speedUpRelative;
this->speedUpConstant = src.speedUpConstant;
this->gravity = src.gravity;
this->emissionRate = src.emissionRate;
this->energyMax = src.energyMax;
@ -160,7 +164,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
else {
texture= NULL;
}
//model
if(particleSystemNode->hasChild("model")){
const XmlNode *modelNode= particleSystemNode->getChild("model");
@ -172,7 +176,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
string path= modelNode->getAttribute("path")->getRestrictedValue(currentPath);
model= renderer->newModel(rsGame,path, false, &loadedFileList, &parentLoader);
loadedFileList[path].push_back(make_pair(parentLoader,modelNode->getAttribute("path")->getRestrictedValue()));
if(modelNode->hasChild("cycles")) {
modelCycle = modelNode->getChild("cycles")->getAttribute("value")->getFloatValue();
if(modelCycle < 0.0)
@ -220,6 +224,17 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
const XmlNode *speedNode= particleSystemNode->getChild("speed");
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
const XmlNode *gravityNode= particleSystemNode->getChild("gravity");
gravity= gravityNode->getAttribute("value")->getFloatValue()/GameConstants::updateFps;
@ -235,7 +250,7 @@ void ParticleSystemType::load(const XmlNode *particleSystemNode, const string &d
//speed
const XmlNode *energyVarNode= particleSystemNode->getChild("energy-var");
energyVar= energyVarNode->getAttribute("value")->getIntValue();
//teamcolorNoEnergy
if(particleSystemNode->hasChild("teamcolorNoEnergy")){
const XmlNode *teamcolorNoEnergyNode= particleSystemNode->getChild("teamcolorNoEnergy");
@ -290,6 +305,7 @@ void ParticleSystemType::setValues(AttackParticleSystem *ats){
for(Children::iterator i=children.begin(); i!=children.end(); ++i){
UnitParticleSystem *child = new UnitParticleSystem();
child->setParticleOwner(ats->getParticleOwner());
child->setParticleType((*i));
(*i)->setValues(child);
ats->addChild(child);
child->setState(ParticleSystem::sPlay);
@ -300,6 +316,8 @@ void ParticleSystemType::setValues(AttackParticleSystem *ats){
ats->setColor(color);
ats->setColorNoEnergy(colorNoEnergy);
ats->setSpeed(speed);
ats->setSpeedUpRelative(speedUpRelative);
ats->setSpeedUpConstant(speedUpConstant);
ats->setGravity(gravity);
ats->setParticleSize(size);
ats->setSizeNoEnergy(sizeNoEnergy);
@ -328,6 +346,12 @@ void ParticleSystemType::loadGame(const XmlNode *rootNode) {
size = particleSystemTypeNode->getAttribute("size")->getFloatValue();
sizeNoEnergy = particleSystemTypeNode->getAttribute("sizeNoEnergy")->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();
emissionRate = particleSystemTypeNode->getAttribute("emissionRate")->getFloatValue();
energyMax = particleSystemTypeNode->getAttribute("energyMax")->getIntValue();
@ -348,7 +372,6 @@ void ParticleSystemType::loadGame(const XmlNode *rootNode) {
children.push_back(child);
}
}
minmaxEnabled = (particleSystemTypeNode->getAttribute("minmaxEnabled")->getIntValue() != 0);
minHp = particleSystemTypeNode->getAttribute("minHp")->getIntValue();
maxHp = particleSystemTypeNode->getAttribute("maxHp")->getIntValue();
@ -379,6 +402,10 @@ void ParticleSystemType::saveGame(XmlNode *rootNode) {
particleSystemTypeNode->addAttribute("sizeNoEnergy",floatToStr(sizeNoEnergy,6), mapTagReplacements);
// float speed;
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;
particleSystemTypeNode->addAttribute("gravity",floatToStr(gravity,6), mapTagReplacements);
// float emissionRate;
@ -441,7 +468,7 @@ void ParticleSystemTypeProjectile::load(const XmlNode* particleFileNode, const s
particleFileNode->setSuper(particleSystemNode);
particleSystemNode= particleFileNode;
}
ParticleSystemType::load(particleSystemNode, dir, renderer, loadedFileList,parentLoader, techtreePath);
//trajectory values
@ -535,7 +562,7 @@ void ParticleSystemTypeSplash::load(const XmlNode* particleFileNode, const strin
loadedFileList[path].push_back(make_pair(parentLoader,parentLoader));
const XmlNode *particleSystemNode= xmlTree.getRootNode();
if(particleFileNode){
// immediate children in the particleFileNode will override the particleSystemNode
particleFileNode->setSuper(particleSystemNode);
@ -547,7 +574,7 @@ void ParticleSystemTypeSplash::load(const XmlNode* particleFileNode, const strin
//emission rate fade
const XmlNode *emissionRateFadeNode= particleSystemNode->getChild("emission-rate-fade");
emissionRateFade= emissionRateFadeNode->getAttribute("value")->getFloatValue();
//spread values
const XmlNode *verticalSpreadNode= particleSystemNode->getChild("vertical-spread");
verticalSpreadA= verticalSpreadNode->getAttribute("a")->getFloatValue(0.0f, 1.0f);

View File

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

View File

@ -582,10 +582,15 @@ void Renderer::manageDeferredParticleSystems() {
CoreData::TextureSystemType textureSystemId =
static_cast<CoreData::TextureSystemType>(
ps->getTextureFileLoadDeferredSystemId());
//printf("Load DEFERRED particle i = %d textureSystemId = %d\n",i,textureSystemId);
if(textureSystemId != CoreData::tsyst_NONE) {
Texture2D *texture= CoreData::getInstance().getTextureBySystemId(textureSystemId);
//printf("Loading texture from system [%d] [%p]\n",textureSystemId,texture);
ps->setTexture(texture);
//printf("#2 Load DEFERRED particle i = %d textureSystemId = %d, texture = %p\n",i,textureSystemId,texture);
}
else {
Texture2D *texture= newTexture2D(rs);
@ -601,6 +606,7 @@ void Renderer::manageDeferredParticleSystems() {
texture->load(textureFile);
ps->setTexture(texture);
}
//printf("#3 Load DEFERRED particle i = %d textureSystemId = %d, texture = %p\n",i,textureSystemId,texture);
}
}
if(dynamic_cast<GameParticleSystem *>(ps) != NULL) {
@ -977,7 +983,7 @@ bool Renderer::validateParticleSystemStillExists(ParticleSystem * particleSystem
}
void Renderer::removeParticleSystemsForParticleOwner(ParticleOwner * particleOwner,ResourceScope rs) {
return particleManager[rs]->removeParticleSystemsForParticleOwner(particleOwner);
particleManager[rs]->removeParticleSystemsForParticleOwner(particleOwner);
}
void Renderer::cleanupParticleSystems(vector<ParticleSystem *> &particleSystems, ResourceScope rs) {
@ -1061,11 +1067,11 @@ void Renderer::setupLighting() {
Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex];
if(world->toRenderUnit(unit) &&
unit->getCurrVector().dist(gameCamera->getPos()) < maxLightDist &&
unit->getCurrMidHeightVector().dist(gameCamera->getPos()) < maxLightDist &&
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());
Vec4f pos= Vec4f(unit->getCurrVector());
Vec4f pos= Vec4f(unit->getCurrMidHeightVector());
pos.y+=4.f;
GLenum lightEnum= GL_LIGHT0 + lightCount;
@ -1642,11 +1648,11 @@ void Renderer::renderMouse2d(int x, int y, int anim, float fade) {
if(game->isMarkCellMode() == true) {
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) {
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);
}
void Renderer::renderConsole(const Console *console,const bool showFullConsole,
const bool showMenuConsole, int overrideMaxConsoleLines){
void Renderer::renderConsole(const Console *console, ConsoleMode mode , int overrideMaxConsoleLines){
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
}
@ -2095,7 +2100,7 @@ void Renderer::renderConsole(const Console *console,const bool showFullConsole,
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
if(showFullConsole) {
if(mode==consoleFull) {
int x= console->getXPos()-5;
int y= console->getYPos()-5;
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);
for(int i = 0; i < console->getStoredLineCount() && i < allowedMaxLines; ++i) {
const ConsoleLineInfo &lineInfo = console->getStoredLineItem(i);
@ -2144,7 +2149,39 @@ void Renderer::renderConsole(const Console *console,const bool showFullConsole,
}
}
}
else {
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 {
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) {
const ConsoleLineInfo &lineInfo = console->getLineItem(i);
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() {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
}
const World *world = game->getWorld();
Config &config= Config::getInstance();
if(world->getThisFactionIndex() < 0 ||
world->getThisFactionIndex() >= world->getFactionCount()) {
@ -2368,64 +2393,45 @@ void Renderer::renderResourceStatus() {
int rowsRendered = 0;
int resourceCountRendered = 0;
for(int techTreeResourceTypeIndex = 0;
techTreeResourceTypeIndex < world->getTechTree()->getResourceTypeCount();
++techTreeResourceTypeIndex) {
bool twoRessourceLines=false;
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 ) {
continue;
bool renderSharedTeamResources=false;
bool renderSharedTeamUnits=false;
bool renderLocalFactionResources=false;
if(config.getBool("TwoLineTeamResourceRendering","false") == true) {
if( sharedTeamResources == true || sharedTeamUnits == true){
twoRessourceLines=true;
}
const Faction *factionForResourceView = thisFaction;
bool localFactionResourcesOnly = false;
if(renderResourcesInTeamMode() == 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->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 {
factionForResourceView = thisFaction;
localFactionResourcesOnly = true;
}
}
if(sharedTeamResources == true){
renderSharedTeamResources=true;
renderSharedTeamUnits=true;
}
//if any unit produces the resource
bool showResource = world->showResourceTypeForFaction(rt, factionForResourceView, false);
if(showResource == true) {
rowsRendered = renderResource(factionForResourceView,localFactionResourcesOnly,
rt, 0, resourceCountRendered);
else if(sharedTeamUnits == true){
renderSharedTeamUnits=true;
renderLocalFactionResources=true;
}
else{
renderLocalFactionResources=true;
}
}
else {
if(sharedTeamResources == true)
renderSharedTeamResources=true;
else if(sharedTeamUnits == true)
renderSharedTeamUnits=true;
else
renderLocalFactionResources=true;
}
// 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++;
}
if(renderSharedTeamResources == true) {
resourceCountRendered = 0;
for(int techTreeResourceTypeIndex = 0;
techTreeResourceTypeIndex < world->getTechTree()->getResourceTypeCount();
@ -2437,15 +2443,92 @@ void Renderer::renderResourceStatus() {
continue;
}
const Faction *factionForResourceView = thisFaction;
bool localFactionResourcesOnly = false;
bool showResource = world->showResourceTypeForFaction(rt, factionForResourceView, localFactionResourcesOnly);
bool showResource = world->showResourceTypeForTeam(rt, thisFaction->getTeam());
if(showResource == true) {
renderResource(factionForResourceView,localFactionResourcesOnly,
rt, rowsRendered, resourceCountRendered);
rowsRendered = renderResource(thisFaction,
false, twoRessourceLines, rt, 0,
resourceCountRendered);
}
}
if(resourceCountRendered > 0) {
rowsRendered++;
}
}
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) {
renderResource(factionForResourceView, localFactionResourcesOnly,
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();
@ -2454,29 +2537,35 @@ void Renderer::renderResourceStatus() {
}
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 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
if(localFactionResourcesOnly == true) {
string str = "*";
Vec4f resourceFontColor = Vec4f(factionForResourceView->getTexture()->getPixmapConst()->getPixel3f(0,0));
int resourceCol = 0;
int resourceRow = startRow;
if(renderText3DEnabled == true) {
renderTextShadow3D(
str, CoreData::getInstance().getDisplayFontSmall3D(),
resourceFontColor,
resourceCol * 100 + 190, metrics.getVirtualH()-30 - (30 * resourceRow), false);
}
else {
renderTextShadow(
str, CoreData::getInstance().getDisplayFontSmall(),
resourceFontColor,
resourceCol * 100 + 190, metrics.getVirtualH()-30 - (30 * resourceRow), false);
}
int x=resourceCol * 100 + 190;
int y=resourceYStart - (resourceRowHeigth * resourceRow);
int h=16;
int w=8;
glColor3f(resourceFontColor.x,resourceFontColor.y,resourceFontColor.z);
glBegin(GL_TRIANGLE_STRIP);
glVertex2i(x, y+h);
glVertex2i(x, y);
glVertex2i(x+w, y+h/2);
glEnd();
}
const Resource *r = factionForResourceView->getResource(rt,localFactionResourcesOnly);
@ -2495,17 +2584,14 @@ int Renderer::renderResource(const Faction *factionForResourceView,bool localFac
isNegativeConsumableDisplayCycle = true;
if(r->getBalance() * 1 + r->getAmount() < 0) {
glColor3f(RED.x,RED.y,RED.z);
resourceFontColor = RED;
}
else if(r->getBalance() * 3 + r->getAmount() < 0) {
glColor3f(ORANGE.x,ORANGE.y,ORANGE.z);
resourceFontColor = ORANGE;
}
else if(r->getBalance() * 5 + r->getAmount() < 0) {
glColor3f(YELLOW.x,YELLOW.y,YELLOW.z);
resourceFontColor = YELLOW;
}
@ -2516,11 +2602,11 @@ int Renderer::renderResource(const Faction *factionForResourceView,bool localFac
if(isNegativeConsumableDisplayCycle == false) {
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 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) {
str+= "/" + intToStr(factionForResourceView->getStoreAmount(rt,localFactionResourcesOnly));
@ -2539,13 +2625,13 @@ int Renderer::renderResource(const Faction *factionForResourceView,bool localFac
renderTextShadow3D(
str, CoreData::getInstance().getDisplayFontSmall3D(),
resourceFontColor,
resourceCol * 100 + 220, metrics.getVirtualH()-30 - (30 * resourceRow), false);
resourceCol * 100 + 220, resourceYStart - (resourceRowHeigth * resourceRow), false);
}
else {
renderTextShadow(
str, CoreData::getInstance().getDisplayFontSmall(),
resourceFontColor,
resourceCol * 100 + 220, metrics.getVirtualH()-30 - (30 * resourceRow), false);
resourceCol * 100 + 220, resourceYStart - (resourceRowHeigth * resourceRow), false);
}
++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 )
{
int x= label->getX();
@ -3701,6 +3814,7 @@ void Renderer::renderListBox(GraphicListBox *listBox) {
}
void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
const int headerHeight=25;
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
}
@ -3732,18 +3846,18 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
glColor4f(0.0f, 0.0f, 0.0f, 0.8f) ;
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->getW(), messageBox->getY() + 9*messageBox->getH()/10);
glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY() + messageBox->getH()-headerHeight);
glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY());
glEnd();
glColor4f(0.0f, 0.0f, 0.0f, 0.8f) ;
glBegin(GL_TRIANGLE_STRIP);
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()+9*messageBox->getH()/10);
glVertex2i(messageBox->getX() + messageBox->getW(), messageBox->getY()+messageBox->getH()-headerHeight);
glEnd();
glBegin(GL_LINE_LOOP);
@ -3762,10 +3876,10 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
glBegin(GL_LINE_STRIP);
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) ;
glVertex2i(messageBox->getX()+ messageBox->getW(), messageBox->getY() + 90*messageBox->getH()/100);
glVertex2i(messageBox->getX()+ messageBox->getW(), messageBox->getY() + messageBox->getH()-headerHeight);
glEnd();
glPopAttrib();
@ -3796,12 +3910,12 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
//text
renderTextShadow3D(
wrappedText, messageBox->getFont3D(), fontColor,
messageBox->getX()+15, messageBox->getY()+7*messageBox->getH()/10,
messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight*2,
false );
renderTextShadow3D(
messageBox->getHeader(), messageBox->getFont3D(),fontColor,
messageBox->getX()+15, messageBox->getY()+93*messageBox->getH()/100,
messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight+8,
false );
}
@ -3809,12 +3923,12 @@ void Renderer::renderMessageBox(GraphicMessageBox *messageBox) {
//text
renderTextShadow(
wrappedText, messageBox->getFont(), fontColor,
messageBox->getX()+15, messageBox->getY()+7*messageBox->getH()/10,
messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight*2,
false );
renderTextShadow(
messageBox->getHeader(), messageBox->getFont(),fontColor,
messageBox->getX()+15, messageBox->getY()+93*messageBox->getH()/100,
messageBox->getX()+15, messageBox->getY()+messageBox->getH()-headerHeight+8,
false );
}
}
@ -5393,7 +5507,7 @@ void Renderer::renderMorphEffects(){
void Renderer::renderSelectionEffects() {
void Renderer::renderSelectionEffects(int healthbarMode) {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
}
@ -5427,24 +5541,41 @@ void Renderer::renderSelectionEffects() {
currVec.y+= 0.3f;
//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( showDebugUI == true &&
((showDebugUILevel & debugui_unit_titles) == debugui_unit_titles) &&
unit->getCommandSize() > 0 &&
dynamic_cast<const BuildCommandType *>(unit->getCurrCommand()->getCommandType()) != NULL) {
glColor4f(unit->getHpRatio(), unit->getHpRatio(), unit->getHpRatio(), 0.3f);
glColor4f(hpRatio, hpRatio, hpRatio, 0.3f);
}
else {
glColor4f(0, unit->getHpRatio(), 0, 0.3f);
glColor4f(0, hpRatio, 0, 0.3f);
}
}
else if ( world->getThisTeamIndex() == unit->getTeam()) {
glColor4f(unit->getHpRatio(), unit->getHpRatio(), 0, 0.3f);
glColor4f(hpRatio, hpRatio, 0, 0.3f);
}
else{
glColor4f(unit->getHpRatio(), 0, 0, 0.3f);
else {
glColor4f(hpRatio, 0, 0, 0.3f);
}
renderSelectionCircle(currVec, unit->getType()->getSize(), selectionCircleRadius);
renderSelectionCircle(currVec, unit->getType()->getSize(), selectionCircleRadius,selectionCircleThickness);
if( showDebugUI == true &&
(showDebugUILevel & debugui_unit_titles) == debugui_unit_titles) {
@ -5468,7 +5599,7 @@ void Renderer::renderSelectionEffects() {
}
//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);
renderSelectionCircle(currVec, unit->getType()->getSize(), magicCircleRadius);
}
@ -5480,7 +5611,7 @@ void Renderer::renderSelectionEffects() {
if(effect.skillType->isAttackBoostEnabled() == true) {
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) {
// Remove attack boost upgrades from unit
@ -5610,6 +5741,116 @@ void Renderer::renderSelectionEffects() {
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(){
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
@ -6193,7 +6434,7 @@ void Renderer::renderVisibleMarkedCells(bool renderTextHint,int x, int y) {
std::map<Vec2i, MarkedCell> markedCells = game->getMapMarkedCellList();
if(markedCells.empty() == false) {
const Texture2D *texture= game->getMarkCellTexture();
const int yOffset = 10;
const int yOffset = -40;
for(std::map<Vec2i, MarkedCell>::iterator iterMap =markedCells.begin();
iterMap != markedCells.end(); ++iterMap) {
@ -6684,7 +6925,7 @@ void Renderer::renderMenuBackground(Camera *camera, float fade, Model *mainModel
// ==================== computing ====================
bool Renderer::computePosition(const Vec2i &screenPos, Vec2i &worldPos, bool exactCoords) {
bool Renderer::ccomputePosition(const Vec2i &screenPos, Vec2i &worldPos, bool exactCoords) {
assertGl();
const Map* map= game->getWorld()->getMap();
const Metrics &metrics= Metrics::getInstance();
@ -6820,7 +7061,7 @@ void Renderer::selectUsingFrustumSelection(Selection::UnitContainer &units,
visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++visibleUnitIndex) {
Unit *unit = qCache.visibleQuadUnitList[visibleUnitIndex];
if(unit != NULL && unit->isAlive()) {
Vec3f unitPos = unit->getCurrVector();
Vec3f unitPos = unit->getCurrMidHeightVector();
bool insideQuad = CubeInFrustum(quadSelectionCacheItem.frustumData,
unitPos.x, unitPos.y, unitPos.z, unit->getType()->getRenderSize());
if(insideQuad == true) {
@ -7519,7 +7760,10 @@ vector<Unit *> Renderer::renderUnitsFast(bool renderingShadows, bool colorPickin
renderOnlyBuildings=true;
}
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);
renderOnlyBuildings=false;
}
@ -7527,6 +7771,11 @@ vector<Unit *> Renderer::renderUnitsFast(bool renderingShadows, bool colorPickin
visibleUnitIndex < (int)qCache.visibleQuadUnitList.size(); ++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)){
continue;
}
@ -8215,6 +8464,174 @@ void Renderer::enableProjectiveTexturing() {
}
// ==================== 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) {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
@ -8234,6 +8651,13 @@ void Renderer::renderSelectionCircle(Vec3f v, int size, float radius, float thic
gluDeleteQuadric(disc);
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,
@ -8697,7 +9121,7 @@ VisibleQuadContainerCache & Renderer::getQuadCache( bool updateOnDirtyFrame,
bool unitCheckedForRender = false;
if(VisibleQuadContainerCache::enableFrustumCalcs == true) {
//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);
if(insideQuad == false || renderInMap == false) {
unit->setVisible(false);
@ -9423,6 +9847,9 @@ Texture2D * Renderer::findTexture(string logoFilename) {
void Renderer::cycleShowDebugUILevel() {
//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 ||
(showDebugUILevel & debugui_unit_titles) != debugui_unit_titles) {
showDebugUILevel |= debugui_fps;

View File

@ -183,6 +183,15 @@ public:
//uint32 m_nVBOIndexes; // Indexes VBO Name
};
enum ConsoleMode {
consoleOff,
consoleNormal,
consoleFull,
consoleStoredOnly,
consoleStoredAndNormal,
consoleCount
};
class Renderer : public RendererInterface,
public BaseRenderer,
@ -496,7 +505,7 @@ public:
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 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 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 renderUnitsToBuild(const int renderFps);
void renderSelectionEffects();
void renderSelectionEffects(int healthbarMode);
void renderHealthBars(int healthbarMode);
void renderWaterEffects();
void renderHud();
void renderMinimap();
@ -558,7 +568,7 @@ public:
void renderMenuBackground(Camera *camera, float fade, Model *mainModel, vector<Model *> characterModels,const Vec3f characterPosition, float anim);
//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 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);
@ -680,6 +690,9 @@ private:
//private aux drawing
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 renderArrow(const Vec3f &pos1, const Vec3f &pos2, const Vec3f &color, float width);
void renderTile(const Vec2i &pos);
@ -695,9 +708,8 @@ private:
void render3dSetup();
void render3dMenuSetup(const MainMenu *mm);
bool renderResourcesInTeamMode();
int renderResource(const Faction *factionForResourceView,
bool localFactionResourcesOnly, const ResourceType *rt,
bool localFactionResourcesOnly,bool twoResourceLines, const ResourceType *rt,
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){
UnitParticleSystem *child = new UnitParticleSystem();
child->setParticleOwner(ups->getParticleOwner());
child->setParticleType((*i));
(*i)->setValues(child);
ups->addChild(child);
}
@ -233,6 +234,8 @@ const void UnitParticleSystemType::setValues(UnitParticleSystem *ups){
ups->setColor(color);
ups->setColorNoEnergy(colorNoEnergy);
ups->setSpeed(speed);
ups->setSpeedUpRelative(speedUpRelative);
ups->setSpeedUpConstant(speedUpConstant);
ups->setGravity(gravity);
ups->setParticleSize(size);
ups->setSizeNoEnergy(sizeNoEnergy);

View File

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

View File

@ -71,6 +71,11 @@ bool Selection::select(Unit *unit) {
return false;
}
//check if commandable
if(unit->getType()->isCommandable() == false && isEmpty() == false) {
return false;
}
//check if multisel
if(unit->getType()->getMultiSelect() == false && isEmpty() == false) {
return false;
@ -181,7 +186,8 @@ bool Selection::isCommandable() const {
return
isEmpty() == 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 {
@ -198,7 +204,7 @@ bool Selection::isMeetable() const{
}
Vec3f Selection::getRefPos() const{
return getFrontUnit()->getCurrVector();
return getFrontUnit()->getCurrMidHeightVector();
}
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;
/**
* @namespace Glest
* Namespace used for all %Glest related code.
*/
/**
* @namespace Game
* Namespace used for game related code.
*/
namespace Glest { namespace Game {
static string tempDataLocation = getUserHome();
@ -1139,6 +1147,7 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
Renderer &renderer= Renderer::getInstance();
if(keystate.mod & (KMOD_LALT | KMOD_RALT)) {
renderer.cycleShowDebugUILevel();
printf("**Cycled Debug UI level to: %d\n",renderer.getShowDebugUILevel());
}
else {
bool showDebugUI = renderer.getShowDebugUI();
@ -3503,8 +3512,8 @@ int handleCreateDataArchivesCommand(int argc, char** argv) {
printf("Compress item [%s] is not valid!\n",compress_item.c_str());
return_value = 1;
}
return_value = 0;
else
return_value = 0;
}
else {
printf("\nInvalid missing map specified on commandline [%s] value [%s]\n\n",argv[foundParamIndIndex],(paramPartTokens.size() >= 2 ? paramPartTokens[1].c_str() : NULL));
@ -4430,6 +4439,10 @@ int glestMain(int argc, char** argv) {
}
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) {
int foundParamIndIndex = -1;
@ -5051,7 +5064,7 @@ int glestMain(int argc, char** argv) {
gameSettings->setFactionControl(i, ct);
gameSettings->setStartLocationIndex(i, i);
gameSettings->setResourceMultiplierIndex(i, 10);
gameSettings->setNetworkPlayerName(i, "Closed");
gameSettings->setNetworkPlayerName(i, GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME);
}
ControlType ct= ctHuman;
@ -5351,7 +5364,8 @@ int glestMain(int argc, char** argv) {
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);
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__);
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 string ITEM_MISSING = "***missing***";
// 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";
const int mapPreviewTexture_X = 5;
@ -71,6 +71,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
switchSetupRequestFlagType |= ssrft_NetworkPlayerName;
updateDataSynchDetailText = false;
launchingNewGame = false;
isfirstSwitchingMapMessage = true;
this->zoomedMap = false;
this->render_mapPreviewTexture_X = mapPreviewTexture_X;
@ -81,6 +82,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
needToBroadcastServerSettings=false;
broadcastServerSettingsDelayTimer=0;
lastGameSettingsReceivedCount=0;
noReceiveTimer=time(NULL)-100; // old but inititialized ( must be an "old" time )
soundConnectionCount=0;
@ -132,6 +134,9 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
settingsReceivedFromServer=false;
initialSettingsReceivedFromServer=false;
validOriginalGameSettings=false;
validDisplayedGamesettings=false;
returnMenuInfo=joinMenuInfo;
Lang &lang= Lang::getInstance();
@ -179,6 +184,13 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelInfo.setFont(CoreData::getInstance().getMenuFontBig());
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);
labelDataSynchInfo.registerGraphicComponent(containerName,"labelDataSynchInfo");
labelDataSynchInfo.init(30, networkHeadPos-60);
@ -193,7 +205,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
labelFogOfWar.setText(lang.getString("FogOfWar"));
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("Explored"));
listBoxFogOfWar.pushBackItem(lang.getString("Disabled"));
@ -273,16 +285,6 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
buttonCancelDownloads.init(xoffset+620, 180, 150);
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
xoffset=70;
//map listBox
@ -362,6 +364,7 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
listBoxTeams[i].registerGraphicComponent(containerName,"listBoxTeams" + intToStr(i));
listBoxTeams[i].init(xoffset+650, setupPos-30-i*rowHeight, 60);
listBoxTeams[i].setEditable(false);
listBoxTeams[i].setLighted(true);
labelNetStatus[i].registerGraphicComponent(containerName,"labelNetStatus" + intToStr(i));
labelNetStatus[i].init(xoffset+715, setupPos-30-i*rowHeight, 60);
@ -453,17 +456,33 @@ MenuStateConnectedGame::MenuStateConnectedGame(Program *program, MainMenu *mainM
setupMapList("");
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.init(220, 180, 125);
buttonPlayNow.init(buttonx, buttony, 125);
buttonPlayNow.setText(lang.getString("PlayNow"));
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:
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
@ -641,6 +660,9 @@ void MenuStateConnectedGame::reloadUI() {
labelInfo.setFont(CoreData::getInstance().getMenuFontBig());
labelInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelWaitingForPlayers.setFont(CoreData::getInstance().getMenuFontBig());
labelWaitingForPlayers.setFont3D(CoreData::getInstance().getMenuFontBig3D());
labelDataSynchInfo.setFont(CoreData::getInstance().getMenuFontBig());
labelDataSynchInfo.setFont3D(CoreData::getInstance().getMenuFontBig3D());
@ -1531,6 +1553,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
switchSetupRequestFlagType,
lang.getLanguage());
switchSetupRequestFlagType= ssrft_None;
noReceiveTimer=time(NULL);
}
break;
}
@ -1571,7 +1594,7 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
}
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);
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(i == clientInterface->getPlayerIndex()){
if(clientInterface != NULL && i == clientInterface->getPlayerIndex()){
setActiveInputLabel(&labelPlayerNames[i]);
}
}
@ -1724,14 +1747,17 @@ void MenuStateConnectedGame::broadCastGameSettingsToHeadlessServer(bool forceNow
}
}
GameSettings gameSettings = *clientInterface->getGameSettings();
loadGameSettings(&gameSettings);
if(validDisplayedGamesettings){
loadGameSettings(&displayedGamesettings);
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("broadcast settings:\n%s\n",gameSettings.toString().c_str());
//printf("Client sending map [%s] admin key [%d]\n",gameSettings.getMap().c_str(),gameSettings.getMasterserver_admin());
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("broadcast settings:\n%s\n",displayedGamesettings.toString().c_str());
clientInterface->broadcastGameSetup(&gameSettings);
//printf("Client sending map [%s] admin key [%d]\n",gameSettings.getMap().c_str(),gameSettings.getMasterserver_admin());
clientInterface->broadcastGameSetup(&displayedGamesettings);
noReceiveTimer=time(NULL);
}
}
}
@ -2287,7 +2313,7 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) {
gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]);
gameSettings->setNetworkPlayerStatuses(slotIndex, npst_None);
gameSettings->setNetworkPlayerName(slotIndex, "Closed");
gameSettings->setNetworkPlayerName(slotIndex, GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME);
closedCount++;
}
@ -2475,14 +2501,6 @@ void MenuStateConnectedGame::render() {
try {
Renderer &renderer= Renderer::getInstance();
if(isHeadlessAdmin() == true) {
listBoxPlayerStatus.setX(buttonRestoreLastSettings.getX() +
buttonRestoreLastSettings.getW() + 20);
}
else {
listBoxPlayerStatus.setX(nonAdminPlayerStatusX);
}
if(mainMessageBox.getEnabled()) {
renderer.renderMessageBox(&mainMessageBox);
}
@ -2510,10 +2528,8 @@ void MenuStateConnectedGame::render() {
delete factionVideo;
factionVideo = NULL;
NetworkManager &networkManager= NetworkManager::getInstance();
ClientInterface* clientInterface= networkManager.getClientInterface();
if(clientInterface != NULL) {
initFactionPreview(clientInterface->getGameSettings());
if(validDisplayedGamesettings) {
initFactionPreview(&displayedGamesettings);
}
}
}
@ -2575,15 +2591,18 @@ void MenuStateConnectedGame::render() {
ClientInterface *clientInterface = networkManager.getClientInterface();
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
if(listBoxControls[i].getSelectedItemIndex() == ctNetworkUnassigned) {
bool renderIt=true;
//printf("Player #%d [%s] control = %d\n",i,labelPlayerNames[i].getText().c_str(),listBoxControls[i].getSelectedItemIndex());
labelPlayers[i].setVisible(true);
labelPlayerNames[i].setVisible(true);
listBoxControls[i].setVisible(true);
listBoxRMultiplier[i].setVisible(true);
listBoxFactions[i].setVisible(true);
listBoxTeams[i].setVisible(true);
labelNetStatus[i].setVisible(true);
if(labelNetStatus[i].getText() == GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME){
renderIt=false;
}
labelPlayers[i].setVisible(renderIt);
labelPlayerNames[i].setVisible(renderIt);
listBoxControls[i].setVisible(renderIt);
listBoxRMultiplier[i].setVisible(renderIt);
listBoxFactions[i].setVisible(renderIt);
listBoxTeams[i].setVisible(renderIt);
labelNetStatus[i].setVisible(renderIt);
}
if(listBoxControls[i].getSelectedItemIndex() != ctClosed) {
@ -2631,6 +2650,12 @@ void MenuStateConnectedGame::render() {
if(listBoxControls[i].getSelectedItemIndex() != ctClosed) {
renderer.renderListBox(&listBoxRMultiplier[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]);
bool canGrabSlot = false;
@ -2672,9 +2697,11 @@ void MenuStateConnectedGame::render() {
if(difftime((long int)time(NULL),timerLabelFlash) < 1) {
renderer.renderLabel(&labelDataSynchInfo,&RED);
renderer.renderLabel(&labelWaitingForPlayers,&YELLOW);
}
else {
renderer.renderLabel(&labelDataSynchInfo,&WHITE);
renderer.renderLabel(&labelWaitingForPlayers,&WHITE);
}
renderer.renderLabel(&labelMap);
@ -2792,7 +2819,7 @@ void MenuStateConnectedGame::render() {
}
}
renderer.renderChatManager(&chatManager);
renderer.renderConsole(&console,showFullConsole,true);
renderer.renderConsole(&console,showFullConsole?consoleFull:consoleStoredAndNormal);
if(difftime((long int)time(NULL),timerLabelFlash) > 2) {
timerLabelFlash = time(NULL);
@ -2827,6 +2854,21 @@ void MenuStateConnectedGame::update() {
//printf("#2 admin key [%d] client key [%d]\n",settings->getMasterserver_admin(),clientInterface->getSessionKey());
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.setEnabled(isHeadlessAdmin());
@ -2845,13 +2887,46 @@ void MenuStateConnectedGame::update() {
checkBoxAllowTeamUnitSharing.setEditable(isHeadlessAdmin());
checkBoxAllowTeamResourceSharing.setEditable(isHeadlessAdmin());
if(isHeadlessAdmin() == true) {
bool hasOtherPlayer=false;
bool hasOpenSlot=false;
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());
listBoxFactions[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) {
@ -2874,7 +2949,7 @@ void MenuStateConnectedGame::update() {
MutexSafeWrapper safeMutexFTPProgress((ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
if(fileFTPProgressList.empty() == true) {
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) {
clientInterface->sendTextMessage(lang.getString("ConnectionTimedOut",languageList[i]) + " : " + doubleToStr(clientInterface->getLastPingLag(),2),-1,false,languageList[i]);
sleep(1);
@ -2887,13 +2962,6 @@ void MenuStateConnectedGame::update() {
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::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"));
if(clientInterface->getAllowDownloadDataSynch() == false) {
@ -2905,64 +2973,63 @@ void MenuStateConnectedGame::update() {
label = label + ", " + clientInterface->getVersionString();
const GameSettings *gameSettings = clientInterface->getGameSettings();
if(clientInterface->getAllowGameDataSynchCheck() == false &&
gameSettings->getTileset() != "" &&
gameSettings->getTech() != "" &&
gameSettings->getMap() != "") {
displayedGamesettings.getTileset() != "" &&
displayedGamesettings.getTech() != "" &&
displayedGamesettings.getMap() != "") {
Config &config = Config::getInstance();
MutexSafeWrapper safeMutexFTPProgress(ftpClientThread != NULL ? ftpClientThread->getProgressMutex() : NULL,string(__FILE__) + "_" + intToStr(__LINE__));
uint32 tilesetCRC = lastCheckedCRCTilesetValue;
if(lastCheckedCRCTilesetName != gameSettings->getTileset() &&
gameSettings->getTileset() != "") {
//console.addLine("Checking tileset CRC [" + gameSettings->getTileset() + "]");
tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + gameSettings->getTileset() + string("/*"), ".xml", NULL);
if(tilesetCRC == 0 || tilesetCRC != gameSettings->getTilesetCRC()) {
tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + gameSettings->getTileset() + string("/*"), ".xml", NULL, true);
if(lastCheckedCRCTilesetName != displayedGamesettings.getTileset() &&
displayedGamesettings.getTileset() != "") {
//console.addLine("Checking tileset CRC [" + displayedGamesettings.getTileset() + "]");
tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + displayedGamesettings.getTileset() + string("/*"), ".xml", NULL);
if(tilesetCRC == 0 || tilesetCRC != displayedGamesettings.getTilesetCRC()) {
tilesetCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTilesets,""), string("/") + displayedGamesettings.getTileset() + string("/*"), ".xml", NULL, true);
}
// Test data synch
//tilesetCRC++;
lastCheckedCRCTilesetValue = tilesetCRC;
lastCheckedCRCTilesetName = gameSettings->getTileset();
lastCheckedCRCTilesetName = displayedGamesettings.getTileset();
}
uint32 techCRC = lastCheckedCRCTechtreeValue;
if(lastCheckedCRCTechtreeName != gameSettings->getTech() &&
gameSettings->getTech() != "") {
//console.addLine("Checking techtree CRC [" + gameSettings->getTech() + "]");
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml", NULL);
//clientInterface->sendTextMessage("#1 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(gameSettings->getTechCRC()),-1, true, "");
if(lastCheckedCRCTechtreeName != displayedGamesettings.getTech() &&
displayedGamesettings.getTech() != "") {
//console.addLine("Checking techtree CRC [" + displayedGamesettings.getTech() + "]");
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + displayedGamesettings.getTech() + string("/*"), ".xml", NULL);
//clientInterface->sendTextMessage("#1 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(displayedGamesettings.getTechCRC()),-1, true, "");
if(techCRC == 0 || techCRC != gameSettings->getTechCRC()) {
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml", NULL, true);
//clientInterface->sendTextMessage("#2 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(gameSettings->getTechCRC()),-1, true, "");
if(techCRC == 0 || techCRC != displayedGamesettings.getTechCRC()) {
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + displayedGamesettings.getTech() + string("/*"), ".xml", NULL, 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.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
//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;
if( lastUpdateDate <= 0 ||
difftime((long int)time(NULL),lastUpdateDate) >= REFRESH_CRC_DAY_SECONDS) {
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + gameSettings->getTech() + string("/*"), ".xml", NULL, true);
//clientInterface->sendTextMessage("#3 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(gameSettings->getTechCRC()),-1, true, "");
techCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), string("/") + displayedGamesettings.getTech() + string("/*"), ".xml", NULL, true);
//clientInterface->sendTextMessage("#3 TechCRC = " + intToStr(techCRC) + " remoteCRC = " + intToStr(displayedGamesettings.getTechCRC()),-1, true, "");
}
}
// Test data synch
//techCRC++;
lastCheckedCRCTechtreeValue = techCRC;
lastCheckedCRCTechtreeName = gameSettings->getTech();
lastCheckedCRCTechtreeName = displayedGamesettings.getTech();
loadFactions(gameSettings,false);
loadFactions(&displayedGamesettings,false);
factionCRCList.clear();
for(unsigned int factionIdx = 0; factionIdx < factionFiles.size(); ++factionIdx) {
string factionName = factionFiles[factionIdx];
@ -2972,28 +3039,28 @@ void MenuStateConnectedGame::update() {
uint32 factionCRC = 0;
//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;
if( lastUpdateDate <= 0 ||
difftime((long int)time(NULL),lastUpdateDate) >= REFRESH_CRC_DAY_SECONDS ||
(techCRC != 0 && techCRC != gameSettings->getTechCRC())) {
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + gameSettings->getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
(techCRC != 0 && techCRC != displayedGamesettings.getTechCRC())) {
factionCRC = getFolderTreeContentsCheckSumRecursively(config.getPathListForType(ptTechs,""), "/" + displayedGamesettings.getTech() + "/factions/" + factionName + "/*", ".xml", NULL, true);
}
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) {
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) {
vector<pair<string,uint32> > serverFactionCRCList = gameSettings->getFactionCRCList();
vector<pair<string,uint32> > serverFactionCRCList = displayedGamesettings.getFactionCRCList();
for(unsigned int factionIdx1 = 0; factionIdx1 < serverFactionCRCList.size(); ++factionIdx1) {
pair<string,uint32> &serverFaction = serverFactionCRCList[factionIdx1];
if(serverFaction.first == factionName) {
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;
}
@ -3006,10 +3073,10 @@ void MenuStateConnectedGame::update() {
}
uint32 mapCRC = lastCheckedCRCMapValue;
if(lastCheckedCRCMapName != gameSettings->getMap() &&
gameSettings->getMap() != "") {
if(lastCheckedCRCMapName != displayedGamesettings.getMap() &&
displayedGamesettings.getMap() != "") {
Checksum checksum;
string file = Config::getMapPath(gameSettings->getMap(),"",false);
string file = Config::getMapPath(displayedGamesettings.getMap(),"",false);
//console.addLine("Checking map CRC [" + file + "]");
checksum.addFile(file);
mapCRC = checksum.getSum();
@ -3017,22 +3084,23 @@ void MenuStateConnectedGame::update() {
//mapCRC++;
lastCheckedCRCMapValue = mapCRC;
lastCheckedCRCMapName = gameSettings->getMap();
lastCheckedCRCMapName = displayedGamesettings.getMap();
}
safeMutexFTPProgress.ReleaseLock();
bool dataSynchMismatch = ((mapCRC != 0 && mapCRC != gameSettings->getMapCRC()) ||
(tilesetCRC != 0 && tilesetCRC != gameSettings->getTilesetCRC()) ||
(techCRC != 0 && techCRC != gameSettings->getTechCRC()));
bool dataSynchMismatch = ((mapCRC != 0 && mapCRC != displayedGamesettings.getMapCRC()) ||
(tilesetCRC != 0 && tilesetCRC != displayedGamesettings.getTilesetCRC()) ||
(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) {
//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());
if(dataSynchMismatch == true &&
( 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");
if(mapCRC != 0 && mapCRC != gameSettings->getMapCRC() &&
if(mapCRC != 0 && mapCRC != displayedGamesettings.getMapCRC() &&
listBoxMap.getSelectedItemIndex() >= 0 &&
listBoxMap.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
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.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
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.getSelectedItem() != Lang::getInstance().getString("DataMissing","",true)) {
labelSynch = labelSynch + " " + lang.getString("TechTree");
@ -3092,7 +3160,7 @@ void MenuStateConnectedGame::update() {
string mismatchedFactionText = "";
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) {
pair<string,uint32> &serverFaction = serverFactionCRCList[factionIdx];
@ -3332,17 +3400,67 @@ void MenuStateConnectedGame::update() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugPerformance).enabled && chrono.getMillis() > 0) chrono.start();
try {
if(clientInterface->getGameSettingsReceived() &&
if(clientInterface->getGameSettingsReceived() && validDisplayedGamesettings &&
lastGameSettingsReceivedCount != clientInterface->getGameSettingsReceivedCount()) {
broadCastGameSettingsToHeadlessServer(needToBroadcastServerSettings);
lastGameSettingsReceivedCount = clientInterface->getGameSettingsReceivedCount();
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
@ -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__);
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;
}
}
@ -3489,12 +3626,11 @@ void MenuStateConnectedGame::update() {
// check for need to switch music on again
if(clientInterface != NULL) {
GameSettings *gameSettings = clientInterface->getGameSettingsPtr();
int currentConnectionCount=0;
for(int i=0; i < GameConstants::maxPlayers; ++i) {
if(gameSettings->getFactionControl(i)==ctNetwork &&
gameSettings->getNetworkPlayerName(i) != "" &&
gameSettings->getNetworkPlayerName(i) != GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME)
if(displayedGamesettings.getFactionControl(i)==ctNetwork &&
displayedGamesettings.getNetworkPlayerName(i) != "" &&
displayedGamesettings.getNetworkPlayerName(i) != GameConstants::NETWORK_SLOT_UNCONNECTED_SLOTNAME)
{
currentConnectionCount++;
}
@ -3827,13 +3963,14 @@ bool MenuStateConnectedGame::loadMapInfo(string file, MapInfo *mapInfo, bool loa
Lang &lang= Lang::getInstance();
if(MapPreview::loadMapInfo(file, mapInfo, lang.getString("MaxPlayers"),lang.getString("Size"),true) == true) {
for(int i = 0; i < GameConstants::maxPlayers; ++i) {
labelPlayers[i].setVisible(i+1 <= mapInfo->players);
labelPlayerNames[i].setVisible(i+1 <= mapInfo->players);
listBoxControls[i].setVisible(i+1 <= mapInfo->players);
listBoxRMultiplier[i].setVisible(i+1 <= mapInfo->players);
listBoxFactions[i].setVisible(i+1 <= mapInfo->players);
listBoxTeams[i].setVisible(i+1 <= mapInfo->players);
labelNetStatus[i].setVisible(i+1 <= mapInfo->players);
bool visible=i+1 <= mapInfo->players;
labelPlayers[i].setVisible(visible);
labelPlayerNames[i].setVisible(visible);
listBoxControls[i].setVisible(visible);
listBoxRMultiplier[i].setVisible(visible);
listBoxFactions[i].setVisible(visible);
listBoxTeams[i].setVisible(visible);
labelNetStatus[i].setVisible(visible);
}
// Not painting properly so this is on hold
@ -4400,6 +4537,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
throw megaglest_runtime_error("gameSettings == NULL");
}
checkBoxScenario.setValue((gameSettings->getScenario() != ""));
if(checkBoxScenario.getValue() == true) {
int originalFOWValue = listBoxFogOfWar.getSelectedItemIndex();
@ -4427,6 +4565,9 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
listBoxFogOfWar.setSelectedItemIndex(0);
}
checkBoxAllowTeamUnitSharing.setValue(scenarioInfo.allowTeamUnitSharing);
checkBoxAllowTeamResourceSharing.setValue(scenarioInfo.allowTeamResourceSharing);
if(originalFOWValue != listBoxFogOfWar.getSelectedItemIndex()) {
cleanupMapPreviewTexture();
}
@ -4440,8 +4581,8 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
//listBoxMap.setItems(formattedPlayerSortedMaps[gameSettings.getMapFilterIndex()]);
//printf("A gameSettings->getTileset() [%s]\n",gameSettings->getTileset().c_str());
if(getMissingTilesetFromFTPServerInProgress == false &&
gameSettings->getTileset() != "") {
if ( getMissingTilesetFromFTPServerInProgress == false
&& gameSettings->getTileset() != "") {
// tileset
tilesets = tilesetFiles;
std::for_each(tilesets.begin(), tilesets.end(), FormatString());
@ -4601,9 +4742,11 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
loadFactions(gameSettings,false);
}
if(getMissingMapFromFTPServerInProgress == false &&
gameSettings->getMap() != "") {
// map
bool missingMap=false;
string mapFile = gameSettings->getMap();
mapFile = formatString(mapFile);
@ -4647,11 +4790,20 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
}
maps.push_back(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",
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.setSelectedItem(mapFile);
@ -4707,6 +4859,8 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
checkBoxAllowTeamResourceSharing.setValue(false);
}
checkBoxAllowNativeLanguageTechtree.setValue(gameSettings->getNetworkAllowNativeLanguageTechtree());
// Control
for(int i=0; i<GameConstants::maxPlayers; ++i) {
listBoxControls[i].setSelectedItemIndex(ctClosed);
@ -4770,9 +4924,9 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
listBoxControls[slot].setSelectedItemIndex(gameSettings->getFactionControl(i),errorOnMissingData);
listBoxRMultiplier[slot].setSelectedItemIndex(gameSettings->getResourceMultiplierIndex(i),errorOnMissingData);
listBoxTeams[slot].setSelectedItemIndex(gameSettings->getTeam(i),errorOnMissingData);
listBoxFactions[slot].setSelectedItem(formatString(gameSettings->getFactionTypeName(i)),false);
if( gameSettings->getFactionControl(i) == ctNetwork ||
gameSettings->getFactionControl(i) == ctNetworkUnassigned) {
labelNetStatus[slot].setText(gameSettings->getNetworkPlayerName(i));
@ -4814,13 +4968,12 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
labelPlayerNames[slot].setText(gameSettings->getNetworkPlayerName(i));
}
}
settingsReceivedFromServer=true;
initialSettingsReceivedFromServer=true;
needToSetChangedGameSettings = true;
lastSetChangedGameSettings = time(NULL);
}
settingsReceivedFromServer=true;
initialSettingsReceivedFromServer=true;
needToSetChangedGameSettings = true;
lastSetChangedGameSettings = time(NULL);
}
if(enableFactionTexturePreview == true) {
@ -4838,7 +4991,6 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
}
}
checkBoxAllowNativeLanguageTechtree.setValue(gameSettings->getNetworkAllowNativeLanguageTechtree());
}
void MenuStateConnectedGame::initFactionPreview(const GameSettings *gameSettings) {
@ -4949,6 +5101,7 @@ void MenuStateConnectedGame::RestoreLastGameSettings() {
needToBroadcastServerSettings=true;
broadcastServerSettingsDelayTimer=time(NULL);
noReceiveTimer=time(NULL);
}
@ -4961,11 +5114,12 @@ int MenuStateConnectedGame::setupMapList(string scenario) {
string scenarioDir = Scenario::getScenarioDir(dirList, scenario);
vector<string> pathList = config.getPathListForType(ptMaps,scenarioDir);
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 != "") {
vector<string> allMaps2 = MapPreview::findAllValidMaps(config.getPathListForType(ptMaps,""),"",false,true,&invalidMapList);
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()) {

View File

@ -63,6 +63,7 @@ private:
GraphicLabel labelMapInfo;
GraphicLabel labelStatus;
GraphicLabel labelInfo;
GraphicLabel labelWaitingForPlayers;
GraphicButton buttonRestoreLastSettings;
//GraphicLabel labelPathFinderType;
@ -89,7 +90,6 @@ private:
GraphicListBox listBoxPlayerStatus;
GraphicLabel labelPlayerStatus[GameConstants::maxPlayers];
int nonAdminPlayerStatusX;
GraphicLabel labelAllowObservers;
GraphicCheckBox checkBoxAllowObservers;
@ -238,9 +238,18 @@ private:
time_t broadcastServerSettingsDelayTimer;
int lastGameSettingsReceivedCount;
time_t noReceiveTimer;
bool launchingNewGame;
bool isfirstSwitchingMapMessage;
std::auto_ptr<TechTree> techTree;
GameSettings originalGamesettings;
bool validOriginalGameSettings;
GameSettings displayedGamesettings;
bool validDisplayedGamesettings;
public:
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);
mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox");
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.init(lang.getString("Ok"),500,300);
mainMessageBox.setEnabled(false);
mainMessageBoxState=0;
@ -172,6 +172,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
needToSetChangedGameSettings = false;
needToRepublishToMasterserver = false;
needToBroadcastServerSettings = false;
lastGameSettingsreceivedCount = -1;
showMasterserverError = false;
tMasterserverErrorElapsed = 0;
masterServererErrorToShow = "---";
@ -193,16 +194,33 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
int xoffset=10;
//create
int buttonx=200;
int buttonx=170;
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.init(buttonx, buttony, 125);
buttonx+=130;
buttonRestoreLastSettings.registerGraphicComponent(containerName,"buttonRestoreLastSettings");
buttonRestoreLastSettings.init(buttonx+130, buttony, 220);
buttonRestoreLastSettings.init(buttonx, buttony, 220);
buttonx+=225;
buttonPlayNow.registerGraphicComponent(containerName,"buttonPlayNow");
buttonPlayNow.init(buttonx+130+225, buttony, 125);
buttonPlayNow.init(buttonx, buttony, 125);
labelLocalGameVersion.registerGraphicComponent(containerName,"labelLocalGameVersion");
labelLocalGameVersion.init(10, networkHeadPos+labelOffset);
@ -356,19 +374,6 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
checkBoxAllowNativeLanguageTechtree.init(xoffset+650, mapHeadPos-70);
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
int scenarioX=810;
int scenarioY=140;
@ -542,6 +547,7 @@ MenuStateCustomGame::MenuStateCustomGame(Program *program, MainMenu *mainMenu,
listBoxTeams[i].registerGraphicComponent(containerName,"listBoxTeams" + intToStr(i));
listBoxTeams[i].init(xoffset+650, setupPos-30-i*rowHeight, 60);
listBoxTeams[i].setLighted(true);
labelNetStatus[i].registerGraphicComponent(containerName,"labelNetStatus" + intToStr(i));
labelNetStatus[i].init(xoffset+715, setupPos-30-i*rowHeight, 60);
@ -733,7 +739,7 @@ void MenuStateCustomGame::reloadUI() {
Config &config = Config::getInstance();
console.resetFonts();
mainMessageBox.init(lang.getString("Ok"));
mainMessageBox.init(lang.getString("Ok"),500,300);
if(EndsWith(glestVersionString, "-dev") == false){
@ -2192,8 +2198,15 @@ void MenuStateCustomGame::render() {
if(listBoxControls[i].getSelectedItemIndex()!=ctClosed){
renderer.renderListBox(&listBoxRMultiplier[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.renderLabel(&labelNetStatus[i]);
}
@ -2287,7 +2300,7 @@ void MenuStateCustomGame::render() {
renderer.renderChatManager(&chatManager);
}
}
renderer.renderConsole(&console,showFullConsole,true);
renderer.renderConsole(&console,showFullConsole?consoleFull:consoleStoredAndNormal);
}
catch(const std::exception &ex) {
char szBuf[8096]="";
@ -2439,7 +2452,10 @@ void MenuStateCustomGame::update() {
if(this->autoloadScenarioName != "") {
listBoxScenario.setSelectedItem(formatString(this->autoloadScenarioName),false);
lastSetChangedGameSettings = time(NULL);
if(serverInterface != NULL){
lastGameSettingsreceivedCount=serverInterface->getGameSettingsUpdateCount();
}
if(listBoxScenario.getSelectedItem() != formatString(this->autoloadScenarioName)) {
mainMessageBoxState=1;
showMessageBox( "Could not find scenario name: " + formatString(this->autoloadScenarioName), "Scenario Missing", false);
@ -2489,7 +2505,7 @@ void MenuStateCustomGame::update() {
publishText = lang.getString("PublishDisabled");
}
masterServererErrorToShow += publishText;
masterServererErrorToShow += "\n\n"+ publishText;
showMasterserverError=false;
mainMessageBoxState=1;
showMessageBox( masterServererErrorToShow, lang.getString("ErrorFromMasterserver"), false);
@ -2845,7 +2861,15 @@ void MenuStateCustomGame::update() {
if(needToPublishDelayed == false || headlessServerMode == true) {
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) {
needToBroadcastServerSettings=true;
@ -3081,8 +3105,7 @@ void MenuStateCustomGame::publishToMasterserver() {
publishToServerInfo["binaryCompileDate"] = getCompileDateTime();
//game info:
publishToServerInfo["serverTitle"] = getHumanPlayerName() + "'s game";
publishToServerInfo["serverTitle"] = labelGameName.getText();
publishToServerInfo["serverTitle"] = gameSettings.getGameName();
//ip is automatically set
//game setup info:
@ -3342,7 +3365,7 @@ void MenuStateCustomGame::simpleTaskForClients(BaseThread *callingThread) {
}
ServerInterface *serverInterface= NetworkManager::getInstance().getServerInterface(false);
if(serverInterface != NULL) {
lastGameSettingsreceivedCount++;
if(this->headlessServerMode == false || (serverInterface->getGameSettingsUpdateCount() <= lastMasterServerSettingsUpdateCount)) {
GameSettings gameSettings;
loadGameSettings(&gameSettings);
@ -3422,6 +3445,8 @@ void MenuStateCustomGame::loadGameSettings(GameSettings *gameSettings,bool force
setupUIFromGameSettings(*settings);
}
gameSettings->setGameName(labelGameName.getText());
// Test flags values
//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());
gameSettings->setFactionTypeName(slotIndex, factionFiles[listBoxFactions[i].getSelectedItemIndex()]);
gameSettings->setNetworkPlayerName(slotIndex, "Closed");
gameSettings->setNetworkPlayerName(slotIndex, GameConstants::NETWORK_SLOT_CLOSED_SLOTNAME);
gameSettings->setNetworkPlayerUUID(slotIndex,"");
gameSettings->setNetworkPlayerPlatform(slotIndex,"");
@ -3969,6 +3994,8 @@ void MenuStateCustomGame::setupUIFromGameSettings(const GameSettings &gameSettin
else {
listBoxFogOfWar.setSelectedItemIndex(0);
}
checkBoxAllowTeamUnitSharing.setValue(scenarioInfo.allowTeamUnitSharing);
checkBoxAllowTeamResourceSharing.setValue(scenarioInfo.allowTeamResourceSharing);
}
setupMapList(gameSettings.getScenario());
setupTechList(gameSettings.getScenario(),false);
@ -4666,6 +4693,9 @@ void MenuStateCustomGame::processScenario() {
listBoxFogOfWar.setSelectedItemIndex(0);
}
checkBoxAllowTeamUnitSharing.setValue(scenarioInfo.allowTeamUnitSharing);
checkBoxAllowTeamResourceSharing.setValue(scenarioInfo.allowTeamResourceSharing);
setupTechList(scenarioInfo.name, false);
listBoxTechTree.setSelectedItem(formatString(scenarioInfo.techTreeName));
reloadFactions(false,scenarioInfo.name);
@ -4836,6 +4866,8 @@ void MenuStateCustomGame::SetupUIForScenarios() {
}
listBoxFogOfWar.setEditable(false);
checkBoxAllowObservers.setEditable(false);
checkBoxAllowTeamUnitSharing.setEditable(false);
checkBoxAllowTeamResourceSharing.setEditable(false);
//listBoxPathFinderType.setEditable(false);
checkBoxEnableSwitchTeamMode.setEditable(false);
listBoxAISwitchTeamAcceptPercent.setEditable(false);
@ -4856,6 +4888,8 @@ void MenuStateCustomGame::SetupUIForScenarios() {
}
listBoxFogOfWar.setEditable(true);
checkBoxAllowObservers.setEditable(true);
checkBoxAllowTeamUnitSharing.setEditable(true);
checkBoxAllowTeamResourceSharing.setEditable(true);
//listBoxPathFinderType.setEditable(true);
checkBoxEnableSwitchTeamMode.setEditable(true);
listBoxAISwitchTeamAcceptPercent.setEditable(true);
@ -4887,11 +4921,12 @@ int MenuStateCustomGame::setupMapList(string scenario) {
string scenarioDir = Scenario::getScenarioDir(dirList, scenario);
vector<string> pathList = config.getPathListForType(ptMaps,scenarioDir);
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 != "") {
vector<string> allMaps2 = MapPreview::findAllValidMaps(config.getPathListForType(ptMaps,""),"",false,true,&invalidMapList);
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()) {

View File

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

View File

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

View File

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

View File

@ -85,8 +85,14 @@ MenuStateLoadGame::MenuStateLoadGame(Program *program, MainMenu *mainMenu):
infoHeaderLabel.setFont3D(CoreData::getInstance().getMenuFontBig3D());
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.init(550, 350);
infoTextLabel.init(550, 310);
infoTextLabel.setText("");
abortButton.registerGraphicComponent(containerName,"abortButton");
@ -337,25 +343,26 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){
if(gameVer != glestVersionString && checkVersionComptability(gameVer, glestVersionString) == false) {
char szBuf[8096]="";
snprintf(szBuf,8096,lang.getString("SavedGameBadVersion").c_str(),gameVer.c_str(),glestVersionString.c_str());
infoTextLabel.setText(szBuf);
versionWarningLabel.setText(szBuf);
}
else {
XmlNode *gameNode = rootNode->getChild("Game");
GameSettings newGameSettings;
newGameSettings.loadGame(gameNode);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.getString("LoadSavedGameInfo").c_str(),
newGameSettings.getMap().c_str(),
newGameSettings.getTileset().c_str(),
newGameSettings.getTech().c_str(),
newGameSettings.getScenario().c_str(),
newGameSettings.getFactionCount(),
(newGameSettings.getThisFactionIndex() >= 0 &&
newGameSettings.getThisFactionIndex() < newGameSettings.getFactionCount() ?
newGameSettings.getFactionTypeName(newGameSettings.getThisFactionIndex()).c_str() : ""));
infoTextLabel.setText(szBuf);
versionWarningLabel.setText("");
}
XmlNode *gameNode = rootNode->getChild("Game");
GameSettings newGameSettings;
newGameSettings.loadGame(gameNode);
char szBuf[8096]="";
snprintf(szBuf,8096,lang.getString("LoadSavedGameInfo").c_str(),
newGameSettings.getMap().c_str(),
newGameSettings.getTileset().c_str(),
newGameSettings.getTech().c_str(),
newGameSettings.getScenario().c_str(),
newGameSettings.getFactionCount(),
(newGameSettings.getThisFactionIndex() >= 0 &&
newGameSettings.getThisFactionIndex() < newGameSettings.getFactionCount() ?
newGameSettings.getFactionTypeName(newGameSettings.getThisFactionIndex()).c_str() : ""));
infoTextLabel.setText(szBuf);
}
catch(const megaglest_runtime_error &ex) {
char szBuf[8096]="";
@ -401,6 +408,8 @@ void MenuStateLoadGame::render() {
renderer.renderLabel(&savedGamesLabel);
renderer.renderLabel(&infoHeaderLabel);
renderer.renderLabel(&infoTextLabel);
if(versionWarningLabel.getText()!="")
renderer.renderLabel(&versionWarningLabel);
renderer.renderButton(&abortButton);
renderer.renderButton(&deleteButton);
@ -434,7 +443,7 @@ void MenuStateLoadGame::render() {
renderer.renderMessageBox(&mainMessageBox);
}
renderer.renderConsole(&console,false,false);
renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox();
}

View File

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

View File

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

View File

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

View File

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

View File

@ -227,6 +227,49 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
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.init(currentLabelStart ,currentLine);
labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
@ -274,7 +317,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
buttonReturn.setText(lang.getString("Return"));
// Transifex related UI
currentLine-=lineOffset*4;
currentLine-=lineOffset*3;
labelCustomTranslation.registerGraphicComponent(containerName,"labelCustomTranslation");
labelCustomTranslation.init(currentLabelStart ,currentLine);
labelCustomTranslation.setText(lang.getString("CustomTranslation"));
@ -368,6 +411,7 @@ void MenuStateOptions::reloadUI() {
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
labelVisibleHud.setText(lang.getString("VisibleHUD"));
labelHealthBars.setText(lang.getString("HealthBars"));
labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
labelTimeDisplay.setText(lang.getString("TimeDisplay"));
@ -922,6 +966,7 @@ void MenuStateOptions::mouseClick(int x, int y, MouseButton mouseButton){
checkBoxMouseMoveScrollsWorld.mouseClick(x, y);
listCameraMoveSpeed.mouseClick(x, y);
checkBoxVisibleHud.mouseClick(x, y);
listBoxHealthBars.mouseClick(x, y);
checkBoxChatStaysActive.mouseClick(x, y);
checkBoxTimeDisplay.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);
checkBoxMouseMoveScrollsWorld.mouseMove(x, y);
listCameraMoveSpeed.mouseMove(x, y);
listBoxHealthBars.mouseMove(x, y);
checkBoxVisibleHud.mouseMove(x, y);
checkBoxChatStaysActive.mouseMove(x, y);
checkBoxTimeDisplay.mouseMove(x, y);
@ -1039,6 +1085,8 @@ void MenuStateOptions::render(){
renderer.renderListBox(&listCameraMoveSpeed);
renderer.renderLabel(&labelVisibleHud);
renderer.renderLabel(&labelHealthBars);
renderer.renderListBox(&listBoxHealthBars);
renderer.renderLabel(&labelChatStaysActive);
renderer.renderLabel(&labelTimeDisplay);
@ -1051,7 +1099,7 @@ void MenuStateOptions::render(){
}
renderer.renderConsole(&console,false,true);
renderer.renderConsole(&console);
if(program != NULL) program->renderProgramMsgBox();
}
@ -1077,6 +1125,34 @@ void MenuStateOptions::saveConfig(){
config.setBool("DisableScreenshotConsoleText", !checkBoxDisableScreenshotConsoleText.getValue());
config.setBool("MouseMoveScrollsWorld", checkBoxMouseMoveScrollsWorld.getValue());
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("ChatStaysActive", checkBoxChatStaysActive.getValue());
config.setBool("TimeDisplay", checkBoxTimeDisplay.getValue());

View File

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

View File

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

View File

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

View File

@ -499,7 +499,7 @@ void MenuStateOptionsNetwork::render(){
}
renderer.renderConsole(&console,false,true);
renderer.renderConsole(&console);
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();
}

View File

@ -25,6 +25,7 @@
#include "network_message.h"
#include "socket.h"
#include "auto_test.h"
#include <stdio.h>
#include "leak_dumper.h"
@ -34,10 +35,16 @@ namespace Glest{ namespace Game{
// class MenuStateRoot
// =====================================================
bool MenuStateRoot::gameUpdateChecked = false;
MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
MenuState(program, mainMenu, "root")
MenuState(program, mainMenu, "root"), updatesHttpServerThread(NULL)
{
containerName = "MainMenu";
ftpClientThread = NULL;
lastDownloadProgress = 0;
Lang &lang= Lang::getInstance();
int yPos=440;
@ -87,6 +94,10 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
errorMessageBox.init(lang.getString("Ok"));
errorMessageBox.setEnabled(false);
ftpMessageBox.registerGraphicComponent(containerName,"ftpMessageBox");
ftpMessageBox.init(lang.getString("Yes"), lang.getString("No"));
ftpMessageBox.setEnabled(false);
//PopupMenu popupMenu;
std::vector<string> menuItems;
menuItems.push_back("1");
@ -101,6 +112,57 @@ MenuStateRoot::MenuStateRoot(Program *program, MainMenu *mainMenu):
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() {
Lang &lang= Lang::getInstance();
@ -122,6 +184,8 @@ void MenuStateRoot::reloadUI() {
mainMessageBox.init(lang.getString("Yes"), lang.getString("No"));
errorMessageBox.init(lang.getString("Ok"));
ftpMessageBox.init(lang.getString("Yes"), lang.getString("No"));
console.resetFonts();
GraphicComponent::reloadFontsForRegisterGraphicComponents(containerName);
@ -163,6 +227,28 @@ void MenuStateRoot::mouseClick(int x, int y, MouseButton mouseButton){
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)){
soundRenderer.playFx(coreData.getClickSoundB());
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){
popupMenu.mouseMove(x, y);
buttonNewGame.mouseMove(x, y);
@ -210,6 +491,9 @@ void MenuStateRoot::mouseMove(int x, int y, const MouseState *ms){
if (errorMessageBox.getEnabled()) {
errorMessageBox.mouseMove(x, y);
}
if (ftpMessageBox.getEnabled()) {
ftpMessageBox.mouseMove(x, y);
}
}
bool MenuStateRoot::isMasterserverMode() const {
@ -279,7 +563,7 @@ void MenuStateRoot::render() {
renderer.renderButton(&buttonExit);
renderer.renderLabel(&labelVersion);
renderer.renderConsole(&console,false,true);
renderer.renderConsole(&console);
renderer.renderPopupMenu(&popupMenu);
@ -290,6 +574,9 @@ void MenuStateRoot::render() {
if(errorMessageBox.getEnabled()) {
renderer.renderMessageBox(&errorMessageBox);
}
if(ftpMessageBox.getEnabled()) {
renderer.renderMessageBox(&ftpMessageBox);
}
if(program != NULL) program->renderProgramMsgBox();
}
@ -304,9 +591,109 @@ void MenuStateRoot::update() {
}
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();
}
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) {
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);
@ -344,34 +731,58 @@ void MenuStateRoot::keyDown(SDL_KeyboardEvent key) {
}
void MenuStateRoot::showMessageBox(const string &text, const string &header, bool toggle){
if(!toggle){
void MenuStateRoot::showMessageBox(const string &text, const string &header, bool toggle) {
if(toggle == false) {
mainMessageBox.setEnabled(false);
}
if(!mainMessageBox.getEnabled()){
if(mainMessageBox.getEnabled() == false) {
mainMessageBox.setText(text);
mainMessageBox.setHeader(header);
mainMessageBox.setEnabled(true);
}
else{
else {
mainMessageBox.setEnabled(false);
}
}
void MenuStateRoot::showErrorMessageBox(const string &text, const string &header, bool toggle){
if(!toggle){
void MenuStateRoot::showErrorMessageBox(const string &text, const string &header, bool toggle) {
if(toggle == false) {
errorMessageBox.setEnabled(false);
}
if(!errorMessageBox.getEnabled()){
if(errorMessageBox.getEnabled() == false) {
errorMessageBox.setText(text);
errorMessageBox.setHeader(header);
errorMessageBox.setEnabled(true);
}
else{
else {
errorMessageBox.setEnabled(false);
}
}
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

View File

@ -13,6 +13,9 @@
#define _GLEST_GAME_MENUSTATEROOT_H_
#include "main_menu.h"
#include "simple_threads.h"
#include "miniftpclient.h"
#include "leak_dumper.h"
namespace Glest{ namespace Game{
@ -24,7 +27,7 @@ namespace Glest{ namespace Game{
class GraphicMessageBox;
class PopupMenu;
class MenuStateRoot: public MenuState {
class MenuStateRoot: public MenuState, public SimpleTaskCallbackInterface, public FTPClientCallbackInterface {
private:
GraphicButton buttonNewGame;
GraphicButton buttonLoadGame;
@ -36,20 +39,36 @@ private:
GraphicMessageBox mainMessageBox;
GraphicMessageBox errorMessageBox;
GraphicMessageBox ftpMessageBox;
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:
MenuStateRoot(Program *program, MainMenu *mainMenu);
virtual ~MenuStateRoot();
void mouseClick(int x, int y, MouseButton mouseButton);
void mouseMove(int x, int y, const MouseState *mouseState);
void render();
void update();
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 showFTPMessageBox(const string &text, const string &header, bool toggle, bool okOnly);
virtual bool isMasterserverMode() const;
virtual void reloadUI();

View File

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

View File

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

View File

@ -250,6 +250,11 @@ void ConnectionSlotThread::execute() {
//bool socketHasReadData = Socket::hasDataToRead(socket->getSocketId());
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;
eventCopy.eventType = eReceiveSocketData;
eventCopy.connectionSlot = this->slotInterface->getSlot(slotIndex,true);

View File

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

View File

@ -673,6 +673,19 @@ bool Faction::canUnitsPathfind() {
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) {
if(workerThread != NULL) {
workerThread->signalPathfinder(frameIndex);
@ -718,9 +731,13 @@ void Faction::init(
store[index].init(rt, 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);
string data_path = getGameReadWritePath(GameConstants::path_data_CacheLookupKey);
@ -913,6 +930,10 @@ bool Faction::reqsOk(const RequirableType *rt) const {
return false;
}
}
if(producedUnitType != NULL && isUnitLocked(producedUnitType)) {
return false;
}
}
return true;
@ -1203,13 +1224,13 @@ void Faction::applyCostsOnInterval(const ResourceType *rtApply) {
//decrease unit hp
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) {
unit->setCauseOfDeath(ucodStarvedResource);
world->getStats()->die(unit->getFactionIndex(),unit->getType()->getCountUnitDeathInStats());
scriptManager->onUnitDied(unit);
}
StaticSound *sound= unit->getType()->getFirstStOfClass(scDie)->getSound();
StaticSound *sound= static_cast<const DieSkillType *>(unit->getType()->getFirstStOfClass(scDie))->getSound();
if(sound != NULL &&
(thisFaction == true || world->showWorldForPlayer(world->getThisTeamIndex()) == true)) {
SoundRenderer::getInstance().playFx(sound);
@ -1261,14 +1282,29 @@ bool Faction::isAlly(const Faction *faction) {
// ================== misc ==================
void Faction::incResourceAmount(const ResourceType *rt, int amount) {
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 && r->getAmount()>getStoreAmount(rt)) {
r->setAmount(getStoreAmount(rt));
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) {
Resource *r= &resources[i];
if(r->getType()==rt) {
r->setAmount(r->getAmount()+amount);
if(r->getType()->getClass() != rcStatic && r->getAmount()>getStoreAmount(rt)) {
r->setAmount(getStoreAmount(rt));
}
return;
}
return;
}
}
assert(false);
@ -1318,7 +1354,7 @@ void Faction::removeUnit(Unit *unit){
//assert(false);
}
void Faction::addStore(const UnitType *unitType, bool replaceStorage) {
void Faction::addStore(const UnitType *unitType) {
assert(unitType != NULL);
for(int newUnitStoredResourceIndex = 0;
newUnitStoredResourceIndex < unitType->getStoredResourceCount();
@ -1331,12 +1367,7 @@ void Faction::addStore(const UnitType *unitType, bool replaceStorage) {
Resource *storedResource= &store[currentStoredResourceIndex];
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());
}
}
}
@ -1357,11 +1388,23 @@ void Faction::removeStore(const UnitType *unitType){
}
void Faction::limitResourcesToStore() {
for(int i=0; i < (int)resources.size(); ++i) {
Resource *r= &resources[i];
Resource *s= &store[i];
if(r->getType()->getClass() != rcStatic && r->getAmount()>s->getAmount()) {
r->setAmount(s->getAmount());
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) {
Resource *r= &resources[i];
Resource *s= &store[i];
if(r->getType()->getClass() != rcStatic && r->getAmount()>s->getAmount()) {
r->setAmount(s->getAmount());
}
}
}
}
@ -2250,6 +2293,13 @@ void Faction::saveGame(XmlNode *rootNode) {
factionNode->addAttribute("currentSwitchTeamVoteFactionIndex",intToStr(currentSwitchTeamVoteFactionIndex), 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();
iterMap != unitsMovingList.end(); ++iterMap) {
@ -2342,6 +2392,14 @@ void Faction::loadGame(const XmlNode *rootNode, int factionIndex,GameSettings *s
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");
for(unsigned int i = 0; i < unitsMovingListNodeList.size(); ++i) {
XmlNode *unitsMovingListNode = unitsMovingListNodeList[i];

View File

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

View File

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

View File

@ -36,7 +36,7 @@ using namespace Shared::Util;
namespace Glest{ namespace Game{
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;
//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) {
if (upstPtr != NULL) {
bool showUnitParticles = Config::getInstance().getBool("UnitParticles","true");
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
showUnitParticles = false;
}
if (showUnitParticles == true) {
upst = new UnitParticleSystemType();
*upst = *upstPtr;
@ -331,10 +334,12 @@ void UnitAttackBoostEffect::applyLoadedAttackBoostParticles(UnitParticleSystemTy
ups = new UnitParticleSystem(200);
//ups->loadGame(node2);
ups->setParticleOwner(unit);
ups->setParticleType(upst);
upst->setValues(ups);
ups->setPos(unit->getCurrVector());
ups->setPos(unit->getCurrVectorForParticlesystems());
ups->setRotation(unit->getRotation());
ups->setUnitModel(unit->getCurrentModelPtr());
unit->setMeshPosInParticleSystem(ups);
if (unit->getFaction()->getTexture()) {
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->morphFieldsBlocked=false;
//this->lastBadHarvestListPurge = 0;
this->oldTotalSight = 0;
level= NULL;
loadType= NULL;
@ -666,27 +672,7 @@ Unit::~Unit() {
}
safeMutex.ReleaseLock();
// If the unit is not visible we better make sure we cleanup associated particles
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);
cleanupAllParticlesystems();
while(currentAttackBoostEffects.empty() == false) {
//UnitAttackBoostEffect &effect = currentAttackBoostEffects.back();
@ -726,6 +712,29 @@ Unit::~Unit() {
#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 {
if(this->fire != NULL &&
Renderer::getInstance().validateParticleSystemStillExists(this->fire,rsGame) == false) {
@ -1045,7 +1054,7 @@ float Unit::getEpRatio() const {
throw megaglest_runtime_error(szBuf);
}
if(type->getMaxHp() == 0) {
if(type->getTotalMaxHp(&totalUpgrade) == 0) {
return 0.f;
}
else {
@ -1288,12 +1297,16 @@ void Unit::setCurrSkill(const SkillType *currSkill) {
unitParticleSystems.empty() == true) {
//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) {
//printf("Adding NON-queued particle system type [%s] [%f] [%f]\n",(*it)->getType().c_str(),(*it)->getStartTime(),(*it)->getEndTime());
UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this);
ups->setParticleType((*it));
(*it)->setValues(ups);
ups->setPos(getCurrVector());
ups->setRotation(getRotation());
@ -1310,6 +1323,8 @@ void Unit::setCurrSkill(const SkillType *currSkill) {
queuedUnitParticleSystemTypes.push_back(*it);
}
}
*/
checkCustomizedUnitParticleListTriggers(currSkill->unitParticleSystemTypes,true);
}
progress2= 0;
if(this->currSkill != currSkill) {
@ -1351,7 +1366,7 @@ void Unit::setTarget(const Unit *unit){
//ser field and vector
targetField= unit->getCurrField();
targetVec= unit->getCurrVector();
targetVec= unit->getCurrVectorAsTarget();
targetRef= unit;
}
@ -1381,10 +1396,10 @@ void Unit::setPos(const Vec2i &pos, bool clearPathFinder) {
logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
}
void Unit::refreshPos() {
void Unit::refreshPos(bool forceRefresh) {
// Attempt to improve performance
this->exploreCells();
calculateFogOfWarRadius();
this->exploreCells(forceRefresh);
calculateFogOfWarRadius(forceRefresh);
}
FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
@ -1393,7 +1408,7 @@ FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
}
//iterate through all cells
int sightRange= this->getType()->getSight();
int sightRange= this->getType()->getTotalSight(this->getTotalUpgrade());
int radius = sightRange + World::indirectSightRange;
PosCircularIterator pci(map, this->getPosNotThreadSafe(), radius);
FowAlphaCellsLookupItem result;
@ -1425,9 +1440,9 @@ FowAlphaCellsLookupItem Unit::getFogOfWarRadius(bool useCache) const {
return result;
}
void Unit::calculateFogOfWarRadius() {
void Unit::calculateFogOfWarRadius(bool forceRefresh) {
if(game->getWorld()->getFogOfWar() == true) {
if(this->pos != this->cachedFowPos) {
if(forceRefresh || this->pos != this->cachedFowPos) {
cachedFow = getFogOfWarRadius(false);
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
MutexSafeWrapper safeMutex(mutexCommands,mutexOwnerId);
@ -1587,7 +1602,16 @@ bool Unit::checkModelStateInfoForNewHpValue() {
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) {
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());
@ -1602,6 +1626,36 @@ Vec3f Unit::getCurrVector() const{
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{
return getVectorFlat(lastPos, pos);
}
@ -1945,19 +1999,38 @@ void Unit::born(const CommandType *ct) {
throw megaglest_runtime_error(szBuf);
}
faction->addStore(type,false);
faction->addStore(type);
faction->applyStaticProduction(type,ct);
setCurrSkill(scStop);
checkItemInVault(&this->hp,this->hp);
int original_hp = this->hp;
this->hp= type->getMaxHp();
//set hp from start hp
checkItemInVault(&this->ep,this->ep);
if(type->getStartHpType() == UnitType::stValue) {
this->hp= type->getStartHpValue();
}
else {
this->hp= type->getTotalMaxHp(&totalUpgrade) * 100 / type->getStartHpPercentage();
}
if(original_hp != this->hp) {
//printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
game->getScriptManager()->onUnitTriggerEvent(this,utet_HPChanged);
//printf("File: %s line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
}
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() {
@ -2350,13 +2423,11 @@ void Unit::updateAttackBoostProgress(const Game* game) {
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());
for (unsigned int i = 0; i < candidates.size(); ++i) {
Unit *affectedUnit = candidates[i];
if (attackBoost->isAffected(this, affectedUnit) == true) {
if (affectedUnit->applyAttackBoost(attackBoost, this) == true) {
currentAttackBoostOriginatorEffect.currentAttackBoostUnits.push_back(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->setParticleOwner(this);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleType(currentAttackBoostOriginatorEffect.currentAppliedEffect->upst);
currentAttackBoostOriginatorEffect.currentAppliedEffect->upst->setValues(
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(
getCurrVector());
getCurrVectorForParticlesystems());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
if (getFaction()->getTexture()) {
currentAttackBoostOriginatorEffect.
@ -2485,12 +2558,14 @@ void Unit::updateAttackBoostProgress(const Game* game) {
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups = new UnitParticleSystem(200);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleOwner(this);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setParticleType(currentAttackBoostOriginatorEffect.currentAppliedEffect->upst);
currentAttackBoostOriginatorEffect.currentAppliedEffect->upst->setValues(
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(
getCurrVector());
getCurrVectorForParticlesystems());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setRotation(getRotation());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups);
if (getFaction()->getTexture()) {
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setFactionColor(
@ -2550,6 +2625,12 @@ bool Unit::update() {
//speed
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(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());
@ -2566,6 +2647,9 @@ bool Unit::update() {
this->lastAnimProgress= this->animProgress;
const Game *game = Renderer::getInstance().getGame();
if(animProgress==0){
AnimCycleStarts();
}
progress = getUpdatedProgress(progress,
GameConstants::updateFps,
speed, diagonalFactor, heightFactor);
@ -2611,7 +2695,15 @@ bool Unit::update() {
int64 heightFactor = getHeightFactor(ANIMATION_SPEED_MULTIPLIER);
int64 speedDenominator = speedDivider *
game->getWorld()->getUpdateFps(this->getFactionIndex());
int64 progressIncrease = (currSkill->getAnimSpeed() * heightFactor) / speedDenominator;
// Override the animation speed for attacks that have upgraded the attack speed
int animSpeed = currSkill->getAnimSpeed();
if(currSkill->getClass() == scAttack) {
int animSpeedBoost = ((AttackSkillType *) currSkill)->getAnimSpeedBoost(&totalUpgrade);
animSpeed += animSpeedBoost;
}
int64 progressIncrease = (animSpeed * heightFactor) / speedDenominator;
// Ensure we increment at least a value of 1 of the action will be stuck infinitely
if(currSkill->getAnimSpeed() > 0 && heightFactor > 0 && progressIncrease == 0) {
progressIncrease = 1;
@ -2656,28 +2748,28 @@ bool Unit::update() {
}
if (this->fire != NULL) {
this->fire->setPos(getCurrVector());
this->fire->setPos(getCurrBurnVector());
}
for(UnitParticleSystems::iterator it= unitParticleSystems.begin(); it != unitParticleSystems.end(); ++it) {
if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) {
(*it)->setPos(getCurrVector());
(*it)->setPos(getCurrVectorForParticlesystems());
(*it)->setRotation(getRotation());
(*it)->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(*it);
}
}
for(UnitParticleSystems::iterator it= damageParticleSystems.begin(); it != damageParticleSystems.end(); ++it) {
if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) {
(*it)->setPos(getCurrVector());
(*it)->setPos(getCurrVectorForParticlesystems());
(*it)->setRotation(getRotation());
(*it)->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(*it);
}
}
for(UnitParticleSystems::iterator it= smokeParticleSystems.begin(); it != smokeParticleSystems.end(); ++it) {
if(Renderer::getInstance().validateParticleSystemStillExists((*it),rsGame) == true) {
(*it)->setPos(getCurrVector());
(*it)->setPos(getCurrMidHeightVector());
(*it)->setRotation(getRotation());
(*it)->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(*it);
}
}
@ -2687,9 +2779,9 @@ bool Unit::update() {
if(effect != NULL && effect->ups != NULL) {
bool particleValid = Renderer::getInstance().validateParticleSystemStillExists(effect->ups,rsGame);
if(particleValid == true) {
effect->ups->setPos(getCurrVector());
effect->ups->setPos(getCurrVectorForParticlesystems());
effect->ups->setRotation(getRotation());
effect->ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(effect->ups);
}
//printf("i = %d particleValid = %d\n",i,particleValid);
@ -2702,9 +2794,9 @@ bool Unit::update() {
if(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups != NULL) {
bool particleValid = Renderer::getInstance().validateParticleSystemStillExists(currentAttackBoostOriginatorEffect.currentAppliedEffect->ups,rsGame);
if(particleValid == true) {
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(getCurrVector());
currentAttackBoostOriginatorEffect.currentAppliedEffect->ups->setPos(getCurrVectorForParticlesystems());
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);
ups->setParticleOwner(this);
ups->setParticleType(pst);
pst->setValues(ups);
ups->setPos(getCurrVector());
ups->setPos(getCurrVectorForParticlesystems());
ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(ups);
if(getFaction()->getTexture()) {
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();
//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);
//hp += boost->boostUpgrade.getMaxHp();
@ -2897,10 +2991,12 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) {
effect->ups = new UnitParticleSystem(200);
effect->ups->setParticleOwner(this);
effect->ups->setParticleType(effect->upst);
effect->upst->setValues(effect->ups);
effect->ups->setPos(getCurrVector());
effect->ups->setPos(getCurrVectorForParticlesystems());
effect->ups->setRotation(getRotation());
effect->ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(effect->ups);
if(getFaction()->getTexture()) {
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());
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 &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -2967,7 +3063,7 @@ void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) {
int originalHp = hp;
int prevMaxHp = totalUpgrade.getMaxHp();
int prevMaxHpRegen = totalUpgrade.getMaxHpRegeneration();
totalUpgrade.deapply(&boost->boostUpgrade, this);
totalUpgrade.deapply(source->getId(),&boost->boostUpgrade, this->getId());
checkItemInVault(&this->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());
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 &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -3103,7 +3199,7 @@ void Unit::tick() {
Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats());
game->getScriptManager()->onUnitDied(this);
}
StaticSound *sound= this->getType()->getFirstStOfClass(scDie)->getSound();
StaticSound *sound= static_cast<const DieSkillType *>(this->getType()->getFirstStOfClass(scDie))->getSound();
if(sound != NULL &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -3114,11 +3210,11 @@ void Unit::tick() {
}
//regenerate hp
else {
if(type->getHpRegeneration() >= 0) {
if(type->getTotalMaxHpRegeneration(&totalUpgrade) >= 0) {
if( currSkill->getClass() != scBeBuilt){
checkItemInVault(&this->hp,this->hp);
int original_hp = this->hp;
this->hp += type->getHpRegeneration();
this->hp += type->getTotalMaxHpRegeneration(&totalUpgrade);
if(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
else {
bool decHpResult = decHp(-type->getHpRegeneration());
bool decHpResult = decHp(-type->getTotalMaxHpRegeneration(&totalUpgrade));
if(decHpResult) {
this->setCauseOfDeath(ucodStarvedRegeneration);
Unit::game->getWorld()->getStats()->die(getFactionIndex(),getType()->getCountUnitDeathInStats());
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 &&
(this->getFactionIndex() == Unit::game->getWorld()->getThisFactionIndex() ||
(game->getWorld()->showWorldForPlayer(game->getWorld()->getThisTeamIndex()) == true))) {
@ -3536,7 +3632,7 @@ bool Unit::morph(const MorphCommandType *mct) {
}
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);
faction->deApplyStaticCosts(type,mct);
@ -3553,6 +3649,8 @@ bool Unit::morph(const MorphCommandType *mct) {
}
}
//stopDamageParticles(true);
cleanupAllParticlesystems();
checkItemInVault(&this->hp,this->hp);
int original_hp = this->hp;
@ -3574,7 +3672,10 @@ bool Unit::morph(const MorphCommandType *mct) {
map->putUnitCells(this, this->pos);
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->level= NULL;
@ -3636,6 +3737,11 @@ float Unit::computeHeight(const Vec2i &pos) const {
return height;
}
void Unit::AnimCycleStarts(){
// we need to queue timed particles if progress starts
queueTimedParticles(currSkill->unitParticleSystemTypes);
}
void Unit::updateTarget(){
Unit *target= targetRef.getUnit();
if(target!=NULL){
@ -3649,7 +3755,7 @@ void Unit::updateTarget(){
#else
targetRotation= radToDeg(atan2(relPosf.x, relPosf.y));
#endif
targetVec= target->getCurrVector();
targetVec= target->getCurrVectorAsTarget();
}
}
@ -3945,8 +4051,171 @@ void Unit::stopDamageParticles(bool 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) {
// 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) {
for(int i = (int)damageParticleSystems.size()-1; i >= 0; --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
if(showUnitParticles &&
type->damageParticleSystemTypes.empty() == false &&
@ -4025,10 +4296,12 @@ void Unit::checkCustomizedParticleTriggers(bool force) {
UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this);
ups->setParticleType(pst);
pst->setValues(ups);
ups->setPos(getCurrVector());
ups->setPos(getCurrVectorForParticlesystems());
ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(ups);
if(getFaction()->getTexture()) {
ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
}
@ -4039,10 +4312,12 @@ void Unit::checkCustomizedParticleTriggers(bool force) {
}
}
}
checkCustomizedUnitParticleTriggers();
}
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
if( showUnitParticles &&
type->damageParticleSystemTypes.empty() == false ) {
@ -4052,10 +4327,12 @@ void Unit::startDamageParticles() {
if(pst->getMinmaxEnabled() == false && damageParticleSystemsInUse.find(i) == damageParticleSystemsInUse.end()) {
UnitParticleSystem *ups = new UnitParticleSystem(200);
ups->setParticleOwner(this);
ups->setParticleType(pst);
pst->setValues(ups);
ups->setPos(getCurrVector());
ups->setPos(getCurrVectorForParticlesystems());
ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(ups);
if(getFaction()->getTexture()) {
ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
}
@ -4072,7 +4349,7 @@ void Unit::startDamageParticles() {
fps->setParticleOwner(this);
const Game *game = Renderer::getInstance().getGame();
fps->setSpeed(2.5f / game->getWorld()->getUpdateFps(this->getFactionIndex()));
fps->setPos(getCurrVector());
fps->setPos(getCurrBurnVector());
fps->setRadius(type->getSize()/3.f);
fps->setTexture(CoreData::getInstance().getFireTexture());
fps->setParticleSize(type->getSize()/3.f);
@ -4086,9 +4363,9 @@ void Unit::startDamageParticles() {
ups->setParticleOwner(this);
ups->setColorNoEnergy(Vec4f(0.0f, 0.0f, 0.0f, 0.13f));
ups->setColor(Vec4f(0.115f, 0.115f, 0.115f, 0.22f));
ups->setPos(getCurrVector());
ups->setPos(getCurrBurnVector());
ups->setRotation(getRotation());
ups->setUnitModel(getCurrentModelPtr());
setMeshPosInParticleSystem(ups);
ups->setBlendMode(ups->strToBlendMode("black"));
ups->setOffset(Vec3f(0,2,0));
ups->setDirection(Vec3f(0,1,-0.2f));
@ -4112,11 +4389,6 @@ void Unit::startDamageParticles() {
checkCustomizedParticleTriggers(false);
}
//void Unit::setTargetVec(const Vec3f &targetVec) {
// this->targetVec= targetVec;
// logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__);
//}
void Unit::setMeetingPos(const Vec2i &meetingPos) {
this->meetingPos= meetingPos;
map->clampPos(this->meetingPos);
@ -4145,10 +4417,10 @@ uint32 Unit::getFrameCount() const {
return frameCount;
}
void Unit::exploreCells() {
void Unit::exploreCells(bool forceRefresh) {
if(this->isOperative() == true) {
const Vec2i &newPos = this->getCenteredPos();
int sightRange = this->getType()->getSight();
int sightRange = this->getType()->getTotalSight(this->getTotalUpgrade());
int teamIndex = this->getTeam();
if(game == NULL) {
@ -4159,7 +4431,8 @@ void Unit::exploreCells() {
}
// Try the local unit exploration cache
if(cacheExploredCellsKey.first == newPos &&
if( !forceRefresh &&
cacheExploredCellsKey.first == newPos &&
cacheExploredCellsKey.second == sightRange) {
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->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));
}
@ -5169,16 +5443,20 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
for(int i = 0; i < (int)unitParticleSystemNodeList.size(); ++i) {
XmlNode *node = unitParticleSystemNodeList[i];
FireParticleSystem *ups = new FireParticleSystem();
ups->loadGame(node);
//ups->setTexture(CoreData::getInstance().getFireTexture());
result->fireParticleSystems.push_back(ups);
if(result->fire == NULL || linkFireIndex != i) {
FireParticleSystem *ups = new FireParticleSystem();
ups->setParticleOwner(result);
ups->loadGame(node);
//ups->setTexture(CoreData::getInstance().getFireTexture());
result->fireParticleSystems.push_back(ups);
if(linkFireIndex >= 0 && linkFireIndex == i) {
result->fire = ups;
//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;
}
Renderer::getInstance().addToDeferredParticleSystemList(make_pair(ups, rsGame));
}
//Renderer::getInstance().manageParticleSystem(result->fire, rsGame);
Renderer::getInstance().addToDeferredParticleSystemList(make_pair(ups, rsGame));
}
}

View File

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

View File

@ -9,6 +9,13 @@
// 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_
#define _GLEST_GAME_UPGRADE_H_
@ -33,25 +40,32 @@ class Unit;
class UpgradeType;
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 {
usUpgrading,
usUpgraded,
usUpgrading, /**< The upgrade is currently in progress. */
usUpgraded, /**< The upgrade is completed. */
upgradeStateCount
upgradeStateCount // TODO: This should be unnecessary -- there's no need to iterate over this enum
};
class UpgradeManager;
class TotalUpgrade;
// =====================================================
// class Upgrade
//
/// A bonus to an UnitType
// =====================================================
/**
* 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?).
*/
class Upgrade {
private:
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;
const UpgradeType *type;
@ -59,50 +73,136 @@ private:
Upgrade();
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);
private:
//get
UpgradeState getState() const;
int getFactionIndex() const;
const UpgradeType * getType() const;
//set
void setState(UpgradeState state);
/**
* Retrieves a string representation of the upgrade (detailing its state, type, and faction).
*/
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);
/**
* 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);
};
// ===============================
// class UpgradeManager
// ===============================
/**
* Manages upgrades by starting, stopping, and finishing upgrades. Each faction has their own
* upgrade manager.
*/
class UpgradeManager{
private:
private:
typedef vector<Upgrade*> Upgrades;
typedef map<const UpgradeType *,int> UgradesLookup;
/**
* List of upgrades that the upgrade manager is working with (either in progress or finished).
*/
Upgrades upgrades;
/**
* Maps UpgradeType to the index of the upgrade in UpgradeManager::upgrades.
*/
UgradesLookup upgradesLookup;
public:
~UpgradeManager();
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);
/**
* 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);
/**
* 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);
/**
* 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 isUpgrading(const UpgradeType *upgradeType) const;
bool isUpgradingOrUpgraded(const UpgradeType *upgradeType) const;
void computeTotalUpgrade(const Unit *unit, TotalUpgrade *totalUpgrade) 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;
/**
* 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;
/**
* [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;
/**
* Retrieves a string representation of the UpgradeManager. Contains the contents of
* Upgrade::toString for all upgrades in the UpgradeManager.
*/
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);
/**
* 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);
};

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