Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
filux 2015-02-27 21:01:47 +01:00
commit 2eb3f7f6d3
52 changed files with 1271 additions and 770 deletions

View File

@ -16,9 +16,9 @@ endif(NOT DEFINED CMAKE_BUILD_TYPE)
# add additional CMake modules # add additional CMake modules
MESSAGE(STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}") MESSAGE(STATUS "CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/mk/cmake/Modules) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/mk/cmake/Modules)
IF(CMAKE_BUILD_TYPE)
MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}") MESSAGE(STATUS "Build type for this compile will be: ${CMAKE_BUILD_TYPE}")
ENDIF()
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_COMPILER_IS_GNUCXX "YES") SET(CMAKE_COMPILER_IS_GNUCXX "YES")
# ADD_DEFINITIONS("-Qunused-arguments -Wno-switch") # ADD_DEFINITIONS("-Qunused-arguments -Wno-switch")
@ -31,6 +31,7 @@ OPTION(BUILD_MEGAGLEST_MAP_EDITOR "Build map editor" ON)
OPTION(BUILD_MEGAGLEST "Build MegaGlest" ON) OPTION(BUILD_MEGAGLEST "Build MegaGlest" ON)
OPTION(BUILD_MEGAGLEST_TESTS "Build MegaGlest Unit Tests" OFF) OPTION(BUILD_MEGAGLEST_TESTS "Build MegaGlest Unit Tests" OFF)
OPTION(WITH_VLC "Use libVLC to play videos" ON) OPTION(WITH_VLC "Use libVLC to play videos" ON)
OPTION(SINGLE_INSTALL_DIRECTORY "Use single install directory for everything. It is useful for example for MacOS cpack bundles." OFF)
FIND_PROGRAM(HELP2MAN "help2man") FIND_PROGRAM(HELP2MAN "help2man")
@ -45,42 +46,38 @@ include(${CMAKE_SOURCE_DIR}/mk/cmake/Modules/SpecialMacros.cmake)
SET(PKG_NAME "megaglest") SET(PKG_NAME "megaglest")
# read version # read version
file(READ ${PROJECT_SOURCE_DIR}/source/glest_game/facilities/game_util.cpp MG_VERSION_H_CONTENTS) FILE(READ ${PROJECT_SOURCE_DIR}/source/glest_game/facilities/game_util.cpp MG_VERSION_H_CONTENTS)
# find the version string
#
MESSAGE(STATUS "Determining version number system type to use:") MESSAGE(STATUS "Determining version number system type to use:")
string (REGEX MATCH "\"v([0-9]).([0-9]).([0-9].*)[^\";]" _threePartMatch ${MG_VERSION_H_CONTENTS}) SET(Begin_otv_string "string glestVersionString")
if(NOT _threePartMatch) STRING(REGEX MATCH "${Begin_otv_string}[ \t]*=[ \t]*\"[ \t]*v[ \t]*([0-9][^\\.]*)(\\.)([^\\.]*)(\\.)([^\"\\.;]*)\";" _threePartMatch "${MG_VERSION_H_CONTENTS}")
MESSAGE(STATUS "** Trying 2 part versioning] ") STRING(REGEX MATCH "${Begin_otv_string}[ \t]*=[ \t]*\"[ \t]*v[ \t]*([0-9][^\\.]*)(\\.)([^\"\\.;]*)\";" _twoPartMatch "${MG_VERSION_H_CONTENTS}")
string (REGEX MATCH "\"v([0-9]).([0-9].*)[^\";]" _threePartMatch ${MG_VERSION_H_CONTENTS}) STRING(REGEX MATCH "${Begin_otv_string}[ \t]*=[ \t]*\"[ \t]*v[ \t]*([0-9][^\"\\.;]*)\";" _onePartMatch "${MG_VERSION_H_CONTENTS}")
IF(_threePartMatch)
if (_threePartMatch) MESSAGE(STATUS "** Trying 3 part versioning ")
# parse the parts of the version string STRING(REGEX REPLACE "[^=]*=[ \t]*\"[ \t]*v[ \t]*([0-9][^\\.]*)\\.[^\\.]*\\..*" "\\1" VER_MAJOR "${_threePartMatch}")
STRING(REGEX REPLACE "\"v([0-9])\\.[0-9].*" "\\1" VER_MAJOR "${_threePartMatch}") STRING(REGEX REPLACE "[^=]*=[ \t]*\"[ \t]*v[ \t]*[0-9][^\\.]*\\.([^\\.]*)\\..*" "\\1" VER_MINOR "${_threePartMatch}")
STRING(REGEX REPLACE "\"v[0-9]\\.([0-9]).*" "\\1" VER_MINOR "${_threePartMatch}") STRING(REGEX REPLACE "[^=]*=[ \t]*\"[ \t]*v[ \t]*[0-9][^\\.]*\\.[^\\.]*\\.([^\"\\.;]*).*" "\\1" VER_PATCH "${_threePartMatch}")
SET(MEGAGLEST_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}")
MESSAGE(STATUS "MegaGlest Version is [${VER_MAJOR}.${VER_MINOR}] ") ELSEIF(_twoPartMatch)
endif() MESSAGE(STATUS "** Trying 2 part versioning ")
# parse the version string STRING(REGEX REPLACE "[^=]*=[ \t]*\"[ \t]*v[ \t]*([0-9][^\\.]*)\\..*" "\\1" VER_MAJOR "${_twoPartMatch}")
else() STRING(REGEX REPLACE "[^=]*=[ \t]*\"[ \t]*v[ \t]*[0-9][^\\.]*\\.([^\"\\.;]*).*" "\\1" VER_MINOR "${_twoPartMatch}")
MESSAGE(STATUS "** Trying 3 part versioning] ") SET(VER_PATCH "0")
if (_threePartMatch) SET(MEGAGLEST_VERSION "${VER_MAJOR}.${VER_MINOR}")
# parse the parts of the version string ELSEIF(_onePartMatch)
STRING(REGEX REPLACE "\"v([0-9])\\.[0-9]\\.[0-9].*" "\\1" VER_MAJOR "${_threePartMatch}") MESSAGE(STATUS "** Trying 1 part versioning ")
STRING(REGEX REPLACE "\"v[0-9]\\.([0-9])\\.[0-9].*" "\\1" VER_MINOR "${_threePartMatch}") STRING(REGEX REPLACE "[^=]*=[ \t]*\"[ \t]*v[ \t]*([0-9][^\"\\.;]*).*" "\\1" VER_MAJOR "${_onePartMatch}")
STRING(REGEX REPLACE "\"v[0-9]\\.[0-9]\\.([0-9]).*" "\\1" VER_RELEASE "${_threePartMatch}") SET(VER_MINOR "0")
SET(VER_PATCH "0")
#MESSAGE(STATUS "******* TEST3 MegaGlest Version #1 is [${VER_MAJOR}] ") SET(MEGAGLEST_VERSION "${VER_MAJOR}")
#MESSAGE(STATUS "******* TEST3 MegaGlest Version #2 is [${VER_MINOR}] ") ENDIF()
#MESSAGE(STATUS "******* TEST3 MegaGlest Version #3 is [${VER_RELEASE}] ") FOREACH(ver_var VER_MAJOR;VER_MINOR;VER_PATCH;MEGAGLEST_VERSION)
STRING(REGEX REPLACE "[ \t]" "" "${ver_var}" "${${ver_var}}")
MESSAGE(STATUS "MegaGlest Version is [${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}] ") ENDFOREACH()
endif() MESSAGE(STATUS "Detected MegaGlest Version is [v${MEGAGLEST_VERSION}] ")
endif()
## Compiler flags, CPACK configuration and other Apple specific code. ## Compiler flags, CPACK configuration and other Apple specific code.
IF(APPLE) IF(APPLE)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
include(${PROJECT_SOURCE_DIR}/mk/macosx/CMakeLists.txt) include(${PROJECT_SOURCE_DIR}/mk/macosx/CMakeLists.txt)
ENDIF(APPLE) ENDIF(APPLE)
@ -215,17 +212,17 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") ## Strip binary
ENDIF() ENDIF()
# Get the git revision info for the binary # Get the git revision info for the binary
SET(HAS_GIT "FALSE") SET(HAS_GIT "FALSE")
SET(GIT_LIVE_REV_CMD "") SET(GIT_LIVE_REV_CMD "")
OPTION(WANT_GIT_STAMP "use git revision stamp" ON) OPTION(WANT_GIT_STAMP "use git revision stamp" ON)
IF(WANT_GIT_STAMP) IF(WANT_GIT_STAMP)
# The stuff below gets GIT Global Revision # but ONLY when calling cmake! # The stuff below gets GIT Global Revision # but ONLY when calling cmake!
# the FindGit.cmake module is part of the standard distribution # the FindGit.cmake module is part of the standard distribution
include(FindGit) include(FindGit)
IF(GIT_FOUND) IF(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git/")
SET(HAS_GIT "TRUE") SET(HAS_GIT "TRUE")
MESSAGE(STATUS "Found GIT and using GIT version stamping...") MESSAGE(STATUS "Found GIT and using GIT version stamping...")
@ -245,54 +242,81 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
SET(GIT_LIVE_REV_CMD "`git rev-list HEAD --count`.`git log -1 --format=%h`") SET(GIT_LIVE_REV_CMD "`cd '${PROJECT_SOURCE_DIR}' && git rev-list HEAD --count`.`cd '${PROJECT_SOURCE_DIR}' && git log -1 --format=%h`")
MESSAGE(STATUS "Using GIT revision stamp: [${GIT_COMMIT_COUNT}.${GIT_SHA1}] CMD [${GIT_LIVE_REV_CMD}]") MESSAGE(STATUS "Using GIT revision stamp: [${GIT_COMMIT_COUNT}.${GIT_SHA1}] CMD [${GIT_LIVE_REV_CMD}]")
ENDIF()
ENDIF()
IF(CMAKE_GENERATOR STREQUAL Xcode) IF(CMAKE_GENERATOR STREQUAL Xcode)
SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_LIVE_REV_CMD}\\\\''") SET(GIT_VERSION_CMD "-DGITVERSION='\\\\'${GIT_COMMIT_COUNT}.${GIT_SHA1}\\\\''")
ELSE() ELSE()
SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_LIVE_REV_CMD}\\\"'") SET(GIT_VERSION_CMD "-DGITVERSION='\\\"${GIT_LIVE_REV_CMD}\\\"'")
ENDIF()
ENDIF()
ENDIF() ENDIF()
IF(CMAKE_INSTALL_PREFIX STREQUAL "") IF(CMAKE_INSTALL_PREFIX STREQUAL "")
MESSAGE(STATUS "*NOTE: NOT USING a Custom Data Install Path...") MESSAGE(STATUS "*NOTE: NOT USING a Custom Data Install Path...")
ELSE() ELSE()
IF(SINGLE_INSTALL_DIRECTORY AND NOT MEGAGLEST_SINGLE_DIRECTORY_INSTALL_PATH)
SET(MEGAGLEST_SINGLE_DIRECTORY_INSTALL_PATH "megaglest-game/" CACHE STRING "The single directory installation path for game (this is appended to the CMAKE_INSTALL_PREFIX)")
ENDIF()
IF(NOT MEGAGLEST_BIN_INSTALL_PATH) IF(NOT MEGAGLEST_BIN_INSTALL_PATH)
SET(MEGAGLEST_BIN_INSTALL_PATH "bin/" CACHE STRING "The installation path for binaries (this is appended to the CMAKE_INSTALL_PREFIX)") IF(NOT SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_BIN_INSTALL_PATH "bin/" CACHE STRING "The installation path for binaries (this is appended to the CMAKE_INSTALL_PREFIX)")
ELSE()
SET(MEGAGLEST_BIN_INSTALL_PATH "${MEGAGLEST_SINGLE_DIRECTORY_INSTALL_PATH}")
ENDIF()
ENDIF() ENDIF()
IF(NOT MEGAGLEST_DATA_INSTALL_PATH) IF(NOT MEGAGLEST_DATA_INSTALL_PATH)
SET(MEGAGLEST_DATA_INSTALL_PATH "share/megaglest/" CACHE STRING "The installation path for data files (this is appended to the CMAKE_INSTALL_PREFIX)") IF(NOT SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_DATA_INSTALL_PATH "share/megaglest/" CACHE STRING "The installation path for data files (this is appended to the CMAKE_INSTALL_PREFIX)")
ELSE()
SET(MEGAGLEST_DATA_INSTALL_PATH "${MEGAGLEST_SINGLE_DIRECTORY_INSTALL_PATH}")
ENDIF()
ENDIF() ENDIF()
IF(NOT MEGAGLEST_DESKTOP_INSTALL_PATH) IF(NOT MEGAGLEST_DESKTOP_INSTALL_PATH)
SET(MEGAGLEST_DESKTOP_INSTALL_PATH "share/applications/" CACHE STRING "The installation path for desktop files (this is appended to the CMAKE_INSTALL_PREFIX)") IF(NOT SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_DESKTOP_INSTALL_PATH "share/applications/" CACHE STRING "The installation path for desktop files (this is appended to the CMAKE_INSTALL_PREFIX)")
ELSE()
SET(MEGAGLEST_DESKTOP_INSTALL_PATH "${MEGAGLEST_SINGLE_DIRECTORY_INSTALL_PATH}")
ENDIF()
ENDIF() ENDIF()
IF(NOT MEGAGLEST_ICON_INSTALL_PATH) IF(NOT MEGAGLEST_ICON_INSTALL_PATH)
SET(MEGAGLEST_ICON_INSTALL_PATH "share/pixmaps/" CACHE STRING "The installation path for icon files (this is appended to the CMAKE_INSTALL_PREFIX)") IF(NOT SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_ICON_INSTALL_PATH "share/pixmaps/" CACHE STRING "The installation path for icon files (this is appended to the CMAKE_INSTALL_PREFIX)")
ELSE()
SET(MEGAGLEST_ICON_INSTALL_PATH "${MEGAGLEST_SINGLE_DIRECTORY_INSTALL_PATH}")
ENDIF()
ENDIF() ENDIF()
IF(NOT MEGAGLEST_MANPAGE_INSTALL_PATH) IF(NOT MEGAGLEST_MANPAGE_INSTALL_PATH AND NOT SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_MANPAGE_INSTALL_PATH "share/man/man6/" CACHE STRING "The installation path for manpage files (this is appended to the CMAKE_INSTALL_PREFIX)") IF(NOT SINGLE_INSTALL_DIRECTORY)
SET(MEGAGLEST_MANPAGE_INSTALL_PATH "share/man/man6/" CACHE STRING "The installation path for manpage files (this is appended to the CMAKE_INSTALL_PREFIX)")
ELSE()
SET(MEGAGLEST_MANPAGE_INSTALL_PATH "${MEGAGLEST_SINGLE_DIRECTORY_INSTALL_PATH}")
ENDIF()
ENDIF()
IF(NOT CUSTOM_DATA_INSTALL_PATH AND NOT SINGLE_INSTALL_DIRECTORY)
SET(CUSTOM_DATA_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_DATA_INSTALL_PATH}" CACHE STRING "The FULL installation path for data files (this is build automatically by combining CMAKE_INSTALL_PREFIX and MEGAGLEST_DATA_INSTALL_PATH)")
SET(CUSTOM_DATA_INSTALL_PATH_VALUE "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}")
ENDIF() ENDIF()
IF(NOT CUSTOM_DATA_INSTALL_PATH) SET(PKG_DATADIR ${CUSTOM_DATA_INSTALL_PATH_VALUE})
SET (CUSTOM_DATA_INSTALL_PATH "\"${CMAKE_INSTALL_PREFIX}/${MEGAGLEST_DATA_INSTALL_PATH}\"" CACHE STRING "The FULL installation path for data files (this is build automatically by combining CMAKE_INSTALL_PREFIX and MEGAGLEST_DATA_INSTALL_PATH)") SET(PKG_BINDIR ${MEGAGLEST_BIN_INSTALL_PATH})
ENDIF()
SET(CUSTOM_DATA_INSTALL_PATH_VALUE "-DCUSTOM_DATA_INSTALL_PATH=${CUSTOM_DATA_INSTALL_PATH}")
SET(PKG_DATADIR ${CUSTOM_DATA_INSTALL_PATH_VALUE})
SET(PKG_BINDIR ${MEGAGLEST_BIN_INSTALL_PATH})
MESSAGE(STATUS "*NOTE: Custom Data Install Path is [${CUSTOM_DATA_INSTALL_PATH}]") MESSAGE(STATUS "*NOTE: Custom Data Install Path is [${CUSTOM_DATA_INSTALL_PATH}]")
ENDIF() ENDIF()
SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") IF(HAS_GIT STREQUAL "TRUE")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE} ${GIT_VERSION_CMD}")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GIT_VERSION_CMD}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GIT_VERSION_CMD}")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${GIT_VERSION_CMD} ${CUSTOM_DATA_INSTALL_PATH_VALUE}") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${GIT_VERSION_CMD}")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${GIT_VERSION_CMD}")
ENDIF()
SET(CMAKE_CXX_FLAGS_NONE "${CMAKE_CXX_FLAGS_NONE} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${CUSTOM_DATA_INSTALL_PATH_VALUE}")
# We do some funky character escaping to get the right stuff written out to # We do some funky character escaping to get the right stuff written out to
# the final Makefile so we get the GIT Global Revsion # # the final Makefile so we get the GIT Global Revsion #
@ -308,9 +332,9 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
message("CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}") message("CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
ELSEIF( CMAKE_BUILD_TYPE STREQUAL Release ) ELSEIF( CMAKE_BUILD_TYPE STREQUAL Release )
message("CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}") message("CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
ELSEIF( CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO ) ELSEIF( CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo )
message("CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") message("CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
ELSEIF( CMAKE_BUILD_TYPE STREQUAL MINSIZEREL ) ELSEIF( CMAKE_BUILD_TYPE STREQUAL MinSizeRel )
message("CMAKE_CXX_FLAGS_MINSIZEREL: ${CMAKE_CXX_FLAGS_MINSIZEREL}") message("CMAKE_CXX_FLAGS_MINSIZEREL: ${CMAKE_CXX_FLAGS_MINSIZEREL}")
ENDIF() ENDIF()
@ -388,9 +412,10 @@ SET(CPACK_PACKAGE_VENDOR "megaglest.org")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "megaglest") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "megaglest")
SET(CPACK_PACKAGE_VERSION_MAJOR ${VER_MAJOR}) SET(CPACK_PACKAGE_VERSION "${MEGAGLEST_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR ${VER_MINOR}) SET(CPACK_PACKAGE_VERSION_MAJOR "${VER_MAJOR}")
SET(CPACK_PACKAGE_VERSION_PATCH ${VER_RELEASE}) SET(CPACK_PACKAGE_VERSION_MINOR "${VER_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${VER_PATCH}")
# Debian specific generator options # Debian specific generator options
@ -417,6 +442,7 @@ IF(NOT DEFINED CPACK_GENERATOR)
libxml2-dev, libxml2-dev,
libz-dev, libz-dev,
libfribidi-dev") libfribidi-dev")
# FIXME ^ cpack configuration should be fixed and tested
#find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems") #find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
#if(DPKG_PROGRAM) #if(DPKG_PROGRAM)
@ -441,12 +467,9 @@ get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITION
foreach( d ${DirDefs} ) foreach( d ${DirDefs} )
message( STATUS "=====> Found Define: " ${d} ) message( STATUS "=====> Found Define: " ${d} )
endforeach() endforeach()
message( STATUS "=====> DirDefs: " ${DirDefs} ) #MESSAGE( STATUS "=====> DirDefs: " ${DirDefs} )
#MESSAGE(STATUS "*** Compiler definitions are [${COMPILE_DEFINITIONS}]") #MESSAGE(STATUS "*** Compiler definitions are [${COMPILE_DEFINITIONS}]")
MARK_AS_ADVANCED(SDLMAIN_LIBRARY) MARK_AS_ADVANCED(SDLMAIN_LIBRARY)
MARK_AS_ADVANCED(SDL_INCLUDE_DIR) MARK_AS_ADVANCED(SDL_INCLUDE_DIR)
MARK_AS_ADVANCED(SDL_LIBRARY) MARK_AS_ADVANCED(SDL_LIBRARY)

@ -1 +1 @@
Subproject commit 12bb08b14d36fb86a327bcf480872884ce9121ec Subproject commit 0d7df6aa3c71b2c85183dbb50c9dbd426fe073db

View File

@ -11,30 +11,14 @@ Source and Data Archives:
========================= =========================
There are 3 archives that are built for a given release (starting with versions There are 3 archives that are built for a given release (starting with versions
after 3.6.0). In order to build a release you must have all files checked out after 3.6.0). In order to build a release you must have all git repositories
of svn for that specific release (example: trunk) checked out for that specific release (example, tag: 3.11.0) or downloaded all
source archives/"tarballs" which in their name have same version, equal to tag.
To set the current version for release, modify the file mk/linux/mg-version.sh
and change the two variables:
OLD_MG_VERSION=3.6.0.1
MG_VERSION=3.6.0.2
*Note: Please ensure the MG_VERSION variable matches the version set in the
MegaGlest binary, this can be checked by running: ./megaglest --version
It is possible to have the mg-version.sh script NOT match the binary in cases
where we are releasing binary compatible updates to the archives in which case
we typically use a forth digit in the version # (as seen above)
After setting the correct verions in mg-version.sh you should call:
./mg-version-synch.sh
This will update associated installers to use the correct version stamps
To set the actual binary to the desired version you must manually edit
glest_game/facilities/game_util.cpp
const string glestVersionString = "v3.8-dev";
To set the current version for release, modify the file source/version.txt
and change there available variables, then run mk/linux/mg-version-synch.sh script
for updating version number everywhere where it is needed and then you only have
to commit changed files.
#1. The source archive: #1. The source archive:
This archive contains source code for binary compilation of the application and This archive contains source code for binary compilation of the application and

View File

@ -20,9 +20,10 @@ MESSAGE(STATUS "** Searching for library: FriBiDi...")
# Set variable in temp var, otherwise FIND_PATH might fail # Set variable in temp var, otherwise FIND_PATH might fail
# unset isn't present in the required version of cmake. # unset isn't present in the required version of cmake.
FIND_PATH(xFRIBIDI_INCLUDE_DIR fribidi.h FIND_PATH(xFRIBIDI_INCLUDE_DIR fribidi.h
/usr/local/include/fribidi /usr/local/include/fribidi
/usr/include/fribidi /usr/include/fribidi
) /opt/local/include/fribidi
)
set(FRIBIDI_INCLUDE_DIR ${xFRIBIDI_INCLUDE_DIR}) set(FRIBIDI_INCLUDE_DIR ${xFRIBIDI_INCLUDE_DIR})
SET(FRIBIDI_NAMES ${FRIBIDI_NAMES} fribidi libfribidi) SET(FRIBIDI_NAMES ${FRIBIDI_NAMES} fribidi libfribidi)
@ -35,8 +36,10 @@ ENDIF()
MESSAGE(STATUS "** Searching for library names: [${FRIBIDI_NAMES}] ...") MESSAGE(STATUS "** Searching for library names: [${FRIBIDI_NAMES}] ...")
FIND_LIBRARY(FRIBIDI_LIBRARY FIND_LIBRARY(FRIBIDI_LIBRARY
NAMES ${FRIBIDI_NAMES} NAMES ${FRIBIDI_NAMES}
PATHS /usr/lib /usr/local/lib PATHS /usr/lib
/usr/local/lib
/opt/local/lib
) )
IF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR) IF (FRIBIDI_LIBRARY AND FRIBIDI_INCLUDE_DIR)

View File

@ -46,7 +46,9 @@ OPTION(FORCE_IRCCLIENT_DYNAMIC_LIBS "force the use of dynamic libs for IRCCLIENT
MESSAGE(STATUS "Force IRCCLient dynamic: ${FORCE_IRCCLIENT_DYNAMIC_LIBS}") MESSAGE(STATUS "Force IRCCLient dynamic: ${FORCE_IRCCLIENT_DYNAMIC_LIBS}")
IF(WANT_STATIC_LIBS AND NOT FORCE_IRCCLIENT_DYNAMIC_LIBS) IF(WANT_STATIC_LIBS AND NOT FORCE_IRCCLIENT_DYNAMIC_LIBS)
SET(IRCCLIENT_FIND_LIBRARIES libircclient.a) SET(IRCCLIENT_FIND_LIBRARIES libircclient.a ircclient.a)
ELSE()
SET(IRCCLIENT_FIND_LIBRARIES libircclient ircclient)
ENDIF() ENDIF()
FIND_LIBRARY(IRCCLIENT_LIBRARY FIND_LIBRARY(IRCCLIENT_LIBRARY

View File

@ -140,6 +140,16 @@ echo ' [ '"$distribution"' ] [ '"$release"' ] [ '"$codename"' ] [ '"$architectur
case $distribution in case $distribution in
Debian)
case $release in
6.*|7.*) ;;
*)
echo 'Turning ON dynamic FTGL, LUA, JPEG, PNG, IRCCLIENT ...'
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DFTGL_STATIC=OFF -DLUA_STATIC=OFF -DJPEG_STATIC=OFF -DPNG_STATIC=OFF -DFORCE_IRCCLIENT_DYNAMIC_LIBS=ON"
;;
esac
;;
SuSE|SUSE?LINUX|Opensuse) SuSE|SUSE?LINUX|Opensuse)
case $release in case $release in
*) *)

View File

@ -59,6 +59,7 @@ cp *.bmp "$RELEASEDIR/"
cp *.png "$RELEASEDIR/" cp *.png "$RELEASEDIR/"
cp *.xpm "$RELEASEDIR/" cp *.xpm "$RELEASEDIR/"
cp {../shared/,}*.ini "$RELEASEDIR/" cp {../shared/,}*.ini "$RELEASEDIR/"
if [ -e "$RELEASEDIR/glest-dev.ini" ]; then rm "$RELEASEDIR/glest-dev.ini"; fi
cp megaglest "$RELEASEDIR/" cp megaglest "$RELEASEDIR/"
cp megaglest_editor "$RELEASEDIR/" cp megaglest_editor "$RELEASEDIR/"
cp megaglest_g3dviewer "$RELEASEDIR/" cp megaglest_g3dviewer "$RELEASEDIR/"

View File

@ -7,16 +7,26 @@
# Consider setting this for small packages if there's plenty of RAM and CPU available: # Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e" #export XZ_OPT="$XZ_OPT -9e"
KERNEL="$(uname -s | tr '[A-Z]' '[a-z]')"
if [ "$KERNEL" = "darwin" ]; then
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
else
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
fi
cd "$CURRENTDIR"
VERSION=`./mg-version.sh --version` VERSION=`./mg-version.sh --version`
RELEASENAME=megaglest-standalone-data RELEASENAME=megaglest-standalone-data
PACKAGE="$RELEASENAME-$VERSION.tar.xz" PACKAGE="$RELEASENAME-$VERSION.tar.xz"
CURRENTDIR="$(dirname $(readlink -f $0))" RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release/"
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}" RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
PROJDIR="$CURRENTDIR/../../" PROJDIR="$CURRENTDIR/../../"
REPODIR="$CURRENTDIR/../../" REPODIR="$CURRENTDIR/../../"
echo "Creating data package in $RELEASEDIR" if [ "$KERNEL" != "darwin" ]; then
echo "Creating data package in $RELEASEDIR"
else
echo "Creating data directory $RELEASEDIR"
fi
[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR" [[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR"
mkdir -p "$RELEASEDIR" mkdir -p "$RELEASEDIR"
@ -74,11 +84,12 @@ rm -rf "$RELEASEDIR/data/cegui"
# END # END
cd "$CURRENTDIR" cd "$CURRENTDIR"
echo "creating data archive: $PACKAGE" if [ "$KERNEL" != "darwin" ]; then
[[ -f "${RELEASEDIR_ROOT}/$PACKAGE" ]] && rm "${RELEASEDIR_ROOT}/$PACKAGE" echo "creating data archive: $PACKAGE"
cd $RELEASEDIR [[ -f "${RELEASEDIR_ROOT}/$PACKAGE" ]] && rm "${RELEASEDIR_ROOT}/$PACKAGE"
tar -cf - * | xz > ../$PACKAGE cd $RELEASEDIR
cd $CURRENTDIR tar -cf - * | xz > ../$PACKAGE
cd $CURRENTDIR
ls -la ${RELEASEDIR_ROOT}/$PACKAGE
ls -la ${RELEASEDIR_ROOT}/$PACKAGE
fi

View File

@ -1,45 +1,106 @@
#!/bin/bash #!/bin/sh
# Use this script to synchronize other scripts and installers with the version # Use this script to synchronize other scripts and installers with the version
# in mg-version.sh for a Version Release # in mg-version.sh for a Version Release
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com> # Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+ # Copyright (c) 2011-2015 Mark Vejvoda under GNU GPL v3.0+
CURRENT_VERSION=`./mg-version.sh --version` CURRENT_VERSION=`./mg-version.sh --version`
OLD_VERSION=`./mg-version.sh --oldversion_binary` OLD_VERSION=`./mg-version.sh --oldversion_binary`
VERSION_INFO_FILE="$(dirname "$(readlink -f "$0")")/../../source/version.txt"
LastCompatibleSaveGameVersion="$(awk -F '=' '/^LastCompatibleSaveGameVersion =/ {print $2}' "$VERSION_INFO_FILE" | awk -F '"' '{print $2}')"
MapeditorVersion="$CURRENT_VERSION"
G3dviewerVersion="$CURRENT_VERSION"
modifymore="yes"
echo
echo '===== Updating Game ======'
# const string glestVersionString = "v3.12-dev";
echo 'Game version # before:'
grep -E '^const string glestVersionString = "[^"]*";$' ../../source/glest_game/facilities/game_util.cpp
sed -i 's/^const string glestVersionString = "[^"]*";$/const string glestVersionString = "v'$CURRENT_VERSION'";/' ../../source/glest_game/facilities/game_util.cpp
echo 'Game version # after:'
grep -E '^const string glestVersionString = "[^"]*";$' ../../source/glest_game/facilities/game_util.cpp
echo
if [ "$modifymore" = "yes" ]; then
# const string lastCompatibleSaveGameVersionString = "v3.9.0";
echo 'Compatible Save Game version # before:'
grep -E '^const string lastCompatibleSaveGameVersionString = "[^"]*";$' ../../source/glest_game/facilities/game_util.cpp
sed -i 's/^const string lastCompatibleSaveGameVersionString = "[^"]*";$/const string lastCompatibleSaveGameVersionString = "v'$LastCompatibleSaveGameVersion'";/' ../../source/glest_game/facilities/game_util.cpp
echo 'Compatible Save Game version # after:'
grep -E '^const string lastCompatibleSaveGameVersionString = "[^"]*";$' ../../source/glest_game/facilities/game_util.cpp
echo
fi
if [ "$modifymore" = "yes" ] && [ "$(git status >/dev/null 2>&1; echo "$?")" -eq "0" ]; then
# const string GIT_RawRev = "$4446.1a8673f$";
GitCommitForRelease="`git rev-list HEAD --count`.`git log -1 --format=%h`";
echo 'GitCommitForRelease # before:'
grep -E '^GitCommitForRelease = "[^"]*";$' "$VERSION_INFO_FILE"
grep -E '^const string GIT_RawRev = "\$[^"$]*\$";$' ../../source/glest_game/facilities/game_util.cpp
sed -i 's/^GitCommitForRelease = "[^"]*";$/GitCommitForRelease = "'$GitCommitForRelease'";/' "$VERSION_INFO_FILE"
sed -i 's/^const string GIT_RawRev = "$[^"]*";$/const string GIT_RawRev = "$'$GitCommitForRelease'$";/' ../../source/glest_game/facilities/game_util.cpp
echo 'GitCommitForRelease # after:'
grep -E '^GitCommitForRelease = "[^"]*";$' "$VERSION_INFO_FILE"
grep -E '^const string GIT_RawRev = "\$[^"$]*\$";$' ../../source/glest_game/facilities/game_util.cpp
fi
echo
if [ "$modifymore" = "yes" ]; then
echo '===== Updating Mapeditor ======'
# const string mapeditorVersionString = "v1.6.1";
echo 'Mapeditor version # before:'
grep -E '^const string mapeditorVersionString = "[^"]*";$' ../../source/glest_map_editor/main.cpp
sed -i 's/^const string mapeditorVersionString = "[^"]*";$/const string mapeditorVersionString = "v'$MapeditorVersion'";/' ../../source/glest_map_editor/main.cpp
echo 'Mapeditor version # after:'
grep -E '^const string mapeditorVersionString = "[^"]*";$' ../../source/glest_map_editor/main.cpp
echo
echo '===== Updating G3dviewer ======'
# const string g3dviewerVersionString= "v1.3.6";
echo 'G3dviewer version # before:'
grep -E '^const string g3dviewerVersionString= "[^"]*";$' ../../source/g3d_viewer/main.cpp
sed -i 's/^const string g3dviewerVersionString= "[^"]*";$/const string g3dviewerVersionString= "v'$G3dviewerVersion'";/' ../../source/g3d_viewer/main.cpp
echo 'G3dviewer version # after:'
grep -E '^const string g3dviewerVersionString= "[^"]*";$' ../../source/g3d_viewer/main.cpp
fi
echo
echo '===== Updating Linux Installer ======' echo '===== Updating Linux Installer ======'
# local GAME_VERSION = "x.x.x"; # local GAME_VERSION = "x.x.x";
echo 'Linux Installer version # before:' echo 'Linux Installer version # before:'
grep -E '^local GAME_VERSION = "[^"]*";$' mojosetup/megaglest-installer/scripts/config.lua;sed -i 's/^local GAME_VERSION = "[^"]*";$/local GAME_VERSION = "'$CURRENT_VERSION'";/' mojosetup/megaglest-installer/scripts/config.lua grep -E '^local GAME_VERSION = "[^"]*";$' mojosetup/megaglest-installer/scripts/config.lua
sed -i 's/^local GAME_VERSION = "[^"]*";$/local GAME_VERSION = "'$CURRENT_VERSION'";/' mojosetup/megaglest-installer/scripts/config.lua
echo 'Linux Installer version # after:' echo 'Linux Installer version # after:'
grep -E '^local GAME_VERSION = "[^"]*";$' mojosetup/megaglest-installer/scripts/config.lua grep -E '^local GAME_VERSION = "[^"]*";$' mojosetup/megaglest-installer/scripts/config.lua
echo
echo '===== Updating Windows Installer ======' echo '===== Updating Windows Installer ======'
# !define APVER 3.6.0 # !define APVER 3.6.0
echo 'Windows Installer version # before:' echo 'Windows Installer version # before:'
grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi;sed -i 's/^\!define APVER [^"]*$/\!define APVER '$CURRENT_VERSION'/' ../windoze/Installer/MegaGlestInstaller.nsi grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi
sed -i 's/^\!define APVER [^"]*$/\!define APVER '$CURRENT_VERSION'/' ../windoze/Installer/MegaGlestInstaller.nsi
echo 'Windows Installer version # after:' echo 'Windows Installer version # after:'
grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi
echo
echo 'Windows Installer version # before:' if [ "$modifymore" = "yes" ]; then
grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi;sed -i 's/^\!define APVER_OLD [^"]*$/\!define APVER_OLD '$OLD_VERSION'/' ../windoze/Installer/MegaGlestInstaller.nsi echo 'Windows Installer version # before:'
echo 'Windows Installer version # after:' grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi
grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi sed -i 's/^\!define APVER_OLD [^"]*$/\!define APVER_OLD '$OLD_VERSION'/' ../windoze/Installer/MegaGlestInstaller.nsi
echo 'Windows Installer version # after:'
echo '===== Updating Windows Updater ======' grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestInstaller.nsi
echo 'Windows Updater version # before:' echo
grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi;sed -i 's/^\!define APVER [^"]*$/\!define APVER '$CURRENT_VERSION'/' ../windoze/Installer/MegaGlestUpdater.nsi echo '===== Updating Windows Updater ======'
echo 'Windows Updater version # after:' echo 'Windows Updater version # before:'
grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi
sed -i 's/^\!define APVER [^"]*$/\!define APVER '$CURRENT_VERSION'/' ../windoze/Installer/MegaGlestUpdater.nsi
echo 'Windows Updater version # before:' echo 'Windows Updater version # after:'
grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi;sed -i 's/^\!define APVER_OLD [^"]*$/\!define APVER_OLD '$OLD_VERSION'/' ../windoze/Installer/MegaGlestUpdater.nsi grep -E '^\!define APVER [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi
echo 'Windows Updater version # after:' echo
grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi echo 'Windows Updater version # before:'
grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi
grep -E '^\!define APVER_UPDATE [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi;sed -i 's/^\!define APVER_UPDATE [^"]*$/\!define APVER_UPDATE '$CURRENT_VERSION'/' ../windoze/Installer/MegaGlestUpdater.nsi sed -i 's/^\!define APVER_OLD [^"]*$/\!define APVER_OLD '$OLD_VERSION'/' ../windoze/Installer/MegaGlestUpdater.nsi
echo 'Windows Updater version # after:' echo 'Windows Updater version # after:'
grep -E '^\!define APVER_UPDATE [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi grep -E '^\!define APVER_OLD [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi
echo
echo 'Windows Updater version # before:'
grep -E '^\!define APVER_UPDATE [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi
sed -i 's/^\!define APVER_UPDATE [^"]*$/\!define APVER_UPDATE '$CURRENT_VERSION'/' ../windoze/Installer/MegaGlestUpdater.nsi
echo 'Windows Updater version # after:'
grep -E '^\!define APVER_UPDATE [^"]*$' ../windoze/Installer/MegaGlestUpdater.nsi
echo
fi

View File

@ -1,12 +1,19 @@
#!/bin/bash #!/bin/sh
# Use this script to idenitfy previous and current Version for a Version Release # Use this script to idenitfy previous and current Version for a Version Release
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com> # Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+ # Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+
OLD_MG_VERSION=3.9.1 KERNEL="$(uname -s | tr '[A-Z]' '[a-z]')"
OLD_MG_VERSION_BINARY=3.9.1 if [ "$KERNEL" = "darwin" ]; then
MG_VERSION=3.11.0 CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
else
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
fi
VERSION_INFO_FILE="$CURRENTDIR/../../source/version.txt"
OLD_MG_VERSION="$(awk -F '=' '/^OldReleaseGameVersion =/ {print $2}' "$VERSION_INFO_FILE" | awk -F '"' '{print $2}')"
OLD_MG_VERSION_BINARY="$OLD_MG_VERSION"
MG_VERSION="$(awk -F '=' '/^CurrentGameVersion =/ {print $2}' "$VERSION_INFO_FILE" | awk -F '"' '{print $2}')"
if [ "$1" = "--oldversion" ]; then if [ "$1" = "--oldversion" ]; then
echo "$OLD_MG_VERSION" echo "$OLD_MG_VERSION"

View File

@ -183,7 +183,7 @@ if [ $REPACKONLY -eq 0 ]; then
cp "$CURRENTDIR/$megaglest_linux_path/start_megaglest" $INSTALLDATADIR cp "$CURRENTDIR/$megaglest_linux_path/start_megaglest" $INSTALLDATADIR
cp "$CURRENTDIR/$megaglest_linux_path/megaglest" ${INSTALLDATADIR} cp "$CURRENTDIR/$megaglest_linux_path/megaglest" ${INSTALLDATADIR}
cp "$CURRENTDIR/$megaglest_linux_path/glest.ini" $INSTALLDATADIR cp "$CURRENTDIR/$megaglest_linux_path/glest.ini" $INSTALLDATADIR
cp "$CURRENTDIR/$megaglest_linux_path/megaglest.bmp" $INSTALLDATADIR cp "$CURRENTDIR/$megaglest_linux_path/megaglest.png" $INSTALLDATADIR
cp "$CURRENTDIR/$megaglest_shared_path/glestkeys.ini" $INSTALLDATADIR cp "$CURRENTDIR/$megaglest_shared_path/glestkeys.ini" $INSTALLDATADIR
cp "$CURRENTDIR/$megaglest_linux_path/start_megaglest_mapeditor" $INSTALLDATADIR cp "$CURRENTDIR/$megaglest_linux_path/start_megaglest_mapeditor" $INSTALLDATADIR
cp "$CURRENTDIR/$megaglest_linux_path/megaglest_editor" ${INSTALLDATADIR} cp "$CURRENTDIR/$megaglest_linux_path/megaglest_editor" ${INSTALLDATADIR}

View File

@ -1,5 +1,5 @@
local GAME_INSTALL_SIZE = 680000000; local GAME_INSTALL_SIZE = 680000000;
local GAME_VERSION = "3.11.0"; local GAME_VERSION = "3.12-dev";
local _ = MojoSetup.translate local _ = MojoSetup.translate
@ -119,7 +119,7 @@ Setup.Package
genericname = _("MegaGlest"), genericname = _("MegaGlest"),
tooltip = _("A real time strategy game."), tooltip = _("A real time strategy game."),
builtin_icon = false, builtin_icon = false,
icon = "megaglest.ico", icon = "megaglest.png",
commandline = "%0/start_megaglest", commandline = "%0/start_megaglest",
category = "Game;StrategyGame" category = "Game;StrategyGame"
}, },
@ -131,7 +131,7 @@ Setup.Package
genericname = _("MegaGlest"), genericname = _("MegaGlest"),
tooltip = _("A real time strategy game."), tooltip = _("A real time strategy game."),
builtin_icon = false, builtin_icon = false,
icon = "editor.ico", icon = "megaglest.png",
commandline = "%0/start_megaglest_mapeditor", commandline = "%0/start_megaglest_mapeditor",
category = "Game;StrategyGame", category = "Game;StrategyGame",
--mimetype = {"application/x-gbm", "application/mgm"} --mimetype = {"application/x-gbm", "application/mgm"}
@ -144,7 +144,7 @@ Setup.Package
genericname = _("MegaGlest"), genericname = _("MegaGlest"),
tooltip = _("A real time strategy game."), tooltip = _("A real time strategy game."),
builtin_icon = false, builtin_icon = false,
icon = "g3dviewer.ico", icon = "megaglest.png",
commandline = "%0/start_megaglest_g3dviewer", commandline = "%0/start_megaglest_g3dviewer",
category = "Game;StrategyGame", category = "Game;StrategyGame",
--mimetype = {"application/x-g3d"} --mimetype = {"application/x-g3d"}
@ -157,7 +157,7 @@ Setup.Package
genericname = _("MegaGlest"), genericname = _("MegaGlest"),
tooltip = _("A real time strategy game."), tooltip = _("A real time strategy game."),
builtin_icon = false, builtin_icon = false,
icon = "megaglest-uninstall.ico", icon = "megaglest-uninstall.ico",
commandline = "%0/uninstall-megaglest.sh", commandline = "%0/uninstall-megaglest.sh",
category = "Game;StrategyGame" category = "Game;StrategyGame"
} }

View File

@ -106,121 +106,117 @@ error_during_installation () {
echo 'If you can come up with something which works for you, please report back to us, too. Thanks!' echo 'If you can come up with something which works for you, please report back to us, too. Thanks!'
} }
if [ "$quiet" -eq "1" ]; then
APT_OPTIONS="$APT_OPTIONS -y -q"
URPMI_OPTIONS="$URPMI_OPTIONS -q --auto"
fi
case $distribution in case $distribution in
Debian) Debian)
if [ $quiet = 1 ]; then
APT_OPTIONS="$APT_OPTIONS -y -q"
fi
case $release in case $release in
6.0*|unstable) oldstable|6|6.*)
# No libvlc-dev since version (1.1.3) in Debian 6.0/Squeeze is incompatible, no libluajit-5.1-dev because it is not available on Debian 6.0/Squeeze, cf. http://glest.org/glest_board/?topic=8460 # No libvlc-dev since version (1.1.3) in Debian 6.0/Squeeze is incompatible, no libluajit-5.1-dev because it is not available on Debian 6.0/Squeeze, cf. http://glest.org/glest_board/?topic=8460
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 libminiupnpc-dev librtmp-dev libgtk2.0-dev libcppunit-dev' installcommand="apt-get install $APT_OPTIONS build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libminiupnpc-dev librtmp-dev libgtk2.0-dev libcppunit-dev"
$installcommand $installcommand
if [ $? != 0 ]; then if [ "$?" -ne "0" ]; then
error_during_installation; error_during_installation;
echo '' echo ''
echo 'Be sure to have the squeeze-backports repository installed, it is required for libminiupnpc-dev.' echo 'Be sure to have the squeeze-backports repository installed, it is required for libminiupnpc-dev.'
exit 1; exit 1;
fi fi
;; ;;
stable|7|7.*)
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 libminiupnpc-dev librtmp-dev libgtk2.0-dev libcppunit-dev"
$installcommand
if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
;;
testing|unstable|8|8.0|9|9.0)
installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl1.2-dev libopenal-dev liblua5.2-dev libjpeg-dev libpng12-dev libfreetype6-dev libwxgtk3.0-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn11-dev libgnutls-dev"
$installcommand
if [ "$?" -ne "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 libminiupnpc-dev librtmp-dev libgtk2.0-dev libcppunit-dev' installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl1.2-dev libopenal-dev liblua5.2-dev libjpeg-dev libpng12-dev libfreetype6-dev libwxgtk3.0-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn11-dev libgnutls-dev"
unsupported_release unsupported_release; exit 1
exit 1
;; ;;
esac esac
;; ;;
Ubuntu) Ubuntu)
if [ $quiet = 1 ]; then
APT_OPTIONS="$APT_OPTIONS -y -q"
fi
case $release in case $release in
8.04)
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 libcppunit-dev'
$installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi
;;
10.04) 10.04)
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 libglew1.5-dev libftgl-dev libfribidi-dev libcppunit-dev' #LTS
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 libglew1.5-dev libftgl-dev libfribidi-dev libcppunit-dev"
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
;; ;;
11.10|12.04|12.10|13.04|13.10) 12.04|14.04)
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' #LTS
installcommand="apt-get install $APT_OPTIONS build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev"
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
;; ;;
14.04|14.10) 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="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl1.2-dev libopenal-dev liblua5.2-dev libjpeg-dev libpng12-dev libfreetype6-dev libwxgtk3.0-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn11-dev libgnutls-dev"
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
;; ;;
*) *)
installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev' installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl1.2-dev libopenal-dev liblua5.2-dev libjpeg-dev libpng12-dev libfreetype6-dev libwxgtk3.0-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn11-dev libgnutls-dev"
unsupported_release unsupported_release
exit 1 exit 1
;; ;;
esac esac
;; ;;
LinuxMint) LinuxMint)
if [ $quiet = 1 ]; then
APT_OPTIONS="$APT_OPTIONS -y -q"
fi
case $release in case $release in
13)
13|14|15|16) #LTS
installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev' installcommand="apt-get install $APT_OPTIONS build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev"
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
;; ;;
*) *)
installcommand='apt-get install '"$APT_OPTIONS"' build-essential cmake libsdl1.2-dev libalut-dev libgl1-mesa-dev libglu1-mesa-dev libvorbis-dev libwxbase2.8-dev libwxgtk2.8-dev libx11-dev liblua5.1-0-dev libjpeg-dev libpng12-dev libcurl4-gnutls-dev libxml2-dev libircclient-dev libglew-dev libftgl-dev libfribidi-dev libvlc-dev libcppunit-dev' installcommand="apt-get install $APT_OPTIONS build-essential cmake libcurl4-gnutls-dev libsdl1.2-dev libopenal-dev liblua5.2-dev libjpeg-dev libpng12-dev libfreetype6-dev libwxgtk3.0-dev libcppunit-dev libfribidi-dev libftgl-dev libglew-dev libogg-dev libvorbis-dev libminiupnpc-dev libircclient-dev libvlc-dev libxml2-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev librtmp-dev libkrb5-dev libldap2-dev libidn11-dev libgnutls-dev"
unsupported_release unsupported_release
exit 1 exit 1
;; ;;
esac esac
;; ;;
SuSE|SUSE?LINUX|Opensuse*|openSUSE*) SuSE|SUSE?LINUX|Opensuse*|openSUSE*)
case $release in case $release in
11.2|11.3|11.4|12.1) 11.4)
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' #LTS
installcommand="zypper install gcc gcc-c++ cmake libSDL-devel MesaGLw-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel"
$installcommand $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
;;
12.2)
installcommand='zypper install gcc gcc-c++ cmake libSDL-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
$installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi
;; ;;
13.1) 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' #LTS
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 $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
;; ;;
*) *)
installcommand='zypper install gcc gcc-c++ cmake libSDL-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel' installcommand="zypper install gcc gcc-c++ cmake libSDL-devel Mesa-libGL-devel freeglut-devel libvorbis-devel wxGTK-devel lua-devel libjpeg-devel libpng14-devel libcurl-devel openal-soft-devel xorg-x11-libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel"
unsupported_release unsupported_release
exit 1 exit 1
;; ;;
esac esac
;; ;;
Fedora) Fedora)
case $release in case $release in
13|14|15|16|17|18) #18)
installcommand='yum groupinstall development-tools' # installcommand='yum groupinstall development-tools'
$installcommand # $installcommand
if [ $? != 0 ]; then error_during_installation; exit 1; fi # if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
installcommand='yum install cmake SDL-devel mesa-libGL-devel mesa-libGLU-devel libvorbis-devel wxBase wxGTK-devel lua-devel libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel' # installcommand='yum install cmake SDL-devel mesa-libGL-devel mesa-libGLU-devel libvorbis-devel wxBase wxGTK-devel lua-devel libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
$installcommand # $installcommand
;; # if [ "$?" -ne "0" ]; then error_during_installation; exit 1; fi
# ;;
*) *)
installcommand='yum groupinstall "Development Tools"; yum install cmake SDL-devel mesa-libGL-devel mesa-libGLU-devel libvorbis-devel wxBase wxGTK-devel lua-devel libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel' installcommand='yum groupinstall "Development Tools"; yum install cmake SDL-devel mesa-libGL-devel mesa-libGLU-devel libvorbis-devel wxBase wxGTK-devel lua-devel libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libX11-devel libxml2-devel libircclient-devel glew-devel ftgl-devel fribidi-devel cppunit-devel'
unsupported_release unsupported_release
@ -229,6 +225,18 @@ case $distribution in
esac esac
;; ;;
Mageia)
if [ "$architecture" = "x86_64" ]; then lib="lib64"; else lib="lib"; fi
case $release in
*)
installcommand="urpmi $URPMI_OPTIONS gcc gcc-c++ cmake make ${lib}curl-devel ${lib}SDL-devel ${lib}openal-devel ${lib}lua-devel ${lib}jpeg-devel ${lib}png-devel ${lib}freetype6-devel ${lib}wxgtku2.9-devel ${lib}cppunit-devel ${lib}fribidi-devel ${lib}ftgl-devel ${lib}glew-devel ${lib}ogg-devel ${lib}vorbis-devel ${lib}miniupnpc-devel ${lib}ircclient-static-devel ${lib}vlc-devel ${lib}xml2-devel ${lib}x11-devel ${lib}mesagl1-devel ${lib}mesaglu1-devel"
# mageia uses link patches
unsupported_release
exit 1
;;
esac
;;
archlinux) archlinux)
case $release in case $release in
rolling) rolling)

View File

@ -23,9 +23,14 @@
# #
# Please read http://wiki.megaglest.org/Dedicated_Server for more information # Please read http://wiki.megaglest.org/Dedicated_Server for more information
# #
# ----------------------------------------------------------------------------
# Written by Tom Reynolds <tomreyn[at]megaglest.org>
# Copyright (c) 2013 Tom Reynolds, The Megaglest Team, under GNU GPL v3.0+
# ----------------------------------------------------------------------------
LANG=C
# Install location # Install location
DIR_GAME=~/megaglest DIR_GAME="$(dirname "$(readlink -f "$0")")"
# Log file location (beware, this can grow large) # Log file location (beware, this can grow large)
#LOG_SERVER=/dev/null #LOG_SERVER=/dev/null
@ -42,7 +47,7 @@ while true; do
if [ -f "core" ]; then mv -f "core" "core.1"; fi if [ -f "core" ]; then mv -f "core" "core.1"; fi
date > "$LOG_SERVER" date > "$LOG_SERVER"
echo 'Starting server...' | tee -a "$LOG_SERVER" echo 'Starting server...' | tee -a "$LOG_SERVER"
./start_megaglest --ini-path=./ --data-path=./ --headless-server-mode=vps,exit >> "$LOG_SERVER" 2>&1 ./start_megaglest --headless-server-mode=vps,exit >> "$LOG_SERVER" 2>&1
if [ $? -ne 0 ]; if [ $? -ne 0 ];
then then
echo 'ERROR: Server has quit unexpectedly.' >> "$LOG_SERVER" echo 'ERROR: Server has quit unexpectedly.' >> "$LOG_SERVER"

13
mk/macosx/.gitignore vendored Normal file
View File

@ -0,0 +1,13 @@
/megaglest
/megaglest.6
/megaglest_*
/[Mm]ega[Gg]lest*.dmg
core
core.bak
/p7zip/
/build/
/[Rr]elease/
/[Dd]ebug/
/mydata/

View File

@ -1,72 +1,64 @@
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4 # Anything <= 10.3 isn't supported. We want 32-bit Intel/PPC on 10.4, 10.5.
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support. # On 10.6 32/64-bit Intel. On >= 10.7 unset architecture mean default 64-bit Intel.
# These are just defaults/recommendations, but how we want to build # Using oldest available sdk with current Xcode is recommended.
# out of the box. But the user needs to be able to change these options. # User needs to be able to change these options.
# So we must only set the values the first time CMake is run, or we # So we must only set the values the first time CMake is run, or we
# will overwrite any changes the user sets. # will overwrite any changes the user sets.
# FORCE is used because the options are not reflected in the UI otherwise. # FORCE is used because the options are not reflected in the UI otherwise.
# Seems like a good place to add version specific compiler flags too. # Seems like a good place to add version specific compiler flags too.
IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) IF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
IF(EXISTS /Developer/SDKs/MacOSX10.6.sdk) IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for OSX" FORCE) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.6 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE) #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
ELSEIF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
# 64-bit compiles are not supported with Carbon. We should enable
# 64-bit compilation by default once osgviewer has been
# rewritten with Cocoa.
#SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSE()
# No Universal Binary support
# Should break down further to set the -mmacosx-version-min,
# but the SDK detection is too unreliable here.
ENDIF() ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE) ENDIF(NOT CONFIG_HAS_BEEN_RUN_BEFORE)
# don't try to be too much "modern"
ADD_DEFINITIONS(-Wno-deprecated -Wno-deprecated-declarations)
# Include extra paths to search for includes; this is the default system wide macports path. # Include extra paths to search for includes; this is the default system wide macports path.
INCLUDE_DIRECTORIES(/opt/local/include) INCLUDE_DIRECTORIES(/opt/local/include)
LINK_DIRECTORIES(/opt/local/lib) LINK_DIRECTORIES(/opt/local/lib)
##install part ##install part
# This file is in git CRLF but that causes the cpack run to fail
#CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt"
# "${CMAKE_CURRENT_BINARY_DIR}/docs/COPYRIGHT.source_code.txt" NEWLINE_STYLE UNIX)
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/docs/COPYRIGHT.source_code.txt")
# This changes Info.plist from something with variables and CMakeisms to # This changes Info.plist from something with variables and CMakeisms to
# something that can be installed on disk. # something that can be installed on disk.
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/Info.plist" CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/bundle_resources/Info.plist.in"
"${CMAKE_CURRENT_BINARY_DIR}/Info.plist") "${CMAKE_CURRENT_BINARY_DIR}/mk/macosx/bundle_resources/Info.plist")
SET(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/mk/macosx/bundle_resources/Info.plist")
include (InstallRequiredSystemLibraries) include (InstallRequiredSystemLibraries)
# Use bundle generator (OSX has 3 other options if you feel adventurous) # Use bundle generator (OSX has 3 other options if you feel adventurous)
set (CPACK_GENERATOR "Bundle") SET(CPACK_GENERATOR "Bundle")
SET(CPACK_BUNDLE_NAME "MegaGlest")
# The following CPACK_* options are all required SET(CPACK_PACKAGE_FILE_NAME "MegaGlest-game-macos-${MEGAGLEST_VERSION}")
set (CPACK_PACKAGE_FILE_NAME MegaGlest-${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}) SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/bundle_resources/MegaGlest.icns")
set (CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/MegaGlest.icns") SET(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/mk/macosx/bundle_resources/MegaGlest.icns")
SET(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/mk/macosx/bundle_resources/MegaGlest.sh")
set (CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_CURRENT_SOURCE_DIR}/docs/COPYRIGHT.source_code.txt")
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_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
# Install files in to the package (FIXME: how? we sure?) # Install files in to the package (FIXME: how? we sure?)
INSTALL(FILES INSTALL(FILES
${LUA_LIBRARIES} ${LUA_LIBRARIES}
DESTINATION ../Frameworks DESTINATION ../Frameworks
) )
#the SDL_LIBRARY is seen as a framework thus we need to remove the suffix... #the SDL_LIBRARY is seen as a framework thus we need to remove the suffix...
STRING(REGEX REPLACE ";.*" "" SDL_LIBRARY_DIR "${SDL_LIBRARY}") STRING(REGEX REPLACE ";.*" "" SDL_LIBRARY_DIR "${SDL_LIBRARY}")
#INSTALL(DIRECTORY #INSTALL(DIRECTORY
# ${OGG_LIBRARY} # ${OGG_LIBRARY}
# ${XERCESC_LIBRARY} # ${XERCESC_LIBRARY}
# ${VORBIS_LIBRARY} # ${VORBIS_LIBRARY}
# ${SDL_LIBRARY_DIR} # ${SDL_LIBRARY_DIR}
# ${PNG_LIBRARY} # ${PNG_LIBRARY}
# DESTINATION ../Frameworks # DESTINATION ../Frameworks
# ) # )

View File

@ -1,2 +0,0 @@
APPL????
APPL????

214
mk/macosx/build-mg.sh Executable file
View File

@ -0,0 +1,214 @@
#!/bin/sh
# Use this script to build MegaGlest using cmake
# ----------------------------------------------------------------------------
# 2011 Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# 2015 Rewritten by filux <heross(@@)o2.pl>
# Copyright (c) 2011-2015 under GNU GPL v3.0+
# ----------------------------------------------------------------------------
# Default to English language output so we can understand your bug reports
export LANG=C
SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)"
BUILD_BUNDLE=0
CPU_COUNT=-1
CMAKE_ONLY=0
MAKE_ONLY=0
USE_XCODE=0
CLANG_FORCED=0
WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=ON"
LUA_FORCED_VERSION=0
while getopts "c:dfhl:mnxb" option; do
case "${option}" in
c) CPU_COUNT=${OPTARG};;
d) WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=OFF";;
f) CLANG_FORCED=1;;
h) echo "Usage: $0 <option>"
echo " where <option> can be: -b, -c x, -d, -f, -m, -n, -h, -l x, -x"
echo " option descriptions:"
echo " -b : Force default configuration designed for bundle/release."
echo " -c x : Force the cpu / cores count to x - example: -c 4"
echo " -d : Force DYNAMIC compile (do not want static libs)"
echo " -f : Force using Clang compiler"
echo " -l x : Force using LUA version x - example: -l 51"
echo " -m : Force running CMAKE only to create Make files (do not compile)"
echo " -n : Force running MAKE only to compile (assume CMAKE already built make files)"
echo " -x : Force usage of Xcode and xcodebuild"
echo " -h : Display this help usage"
exit 0;;
l) LUA_FORCED_VERSION=${OPTARG};;
m) CMAKE_ONLY=1;;
n) MAKE_ONLY=1;;
x) USE_XCODE=1;;
b) BUILD_BUNDLE=1
#CPU_COUNT=-1
CMAKE_ONLY=0
MAKE_ONLY=0
USE_XCODE=0
CLANG_FORCED=0
WANT_STATIC_LIBS="-DWANT_STATIC_LIBS=ON"
LUA_FORCED_VERSION=0;;
\?)
echo "Script Invalid option: -$OPTARG" >&2
exit 1;;
esac
done
CLANG_BIN_PATH="$(which clang 2>/dev/null)"
CLANGPP_BIN_PATH="$(which clang++ 2>/dev/null)"
GCC_BIN_PATH="/opt/local/bin/gcc"
GCCPP_BIN_PATH="/opt/local/bin/g++"
# ^ install latest (not beta) gcc from "mac ports" and then choose it as default gcc version by "port select ..."
# ( ^ same situation is with wxwidgets )
cd ${SCRIPTDIR}
if [ "$BUILD_BUNDLE" -eq "1" ] && [ -d "p7zip" ]; then rm -rf "p7zip"; fi
if [ -e ".p7zip.zip" ] && [ "$(find ./ -name ".p7zip.zip" -mtime +90)" ]; then rm ".p7zip.zip"; rm -rf "p7zip"; fi
if [ ! -e ".p7zip.zip" ]; then
curl -L -o .p7zip.zip https://github.com/MegaGlest/megaglest-source/releases/download/3.2.3/p7zip.zip 2>/dev/null
if [ -e ".p7zip.zip" ]; then touch -m ".p7zip.zip"; fi
fi
if [ ! -d "p7zip" ]; then unzip .p7zip.zip >/dev/null; fi
# Google breakpad integration (cross platform memory dumps) - OPTIONAL
# Set this to the root path of your Google breakpad subversion working copy.
# By default, this script looks for a "google-breakpad" sub-directory within
# the directory this script resides in. If this directory is not found, Cmake
# will warn about it later.
# Instead of editing this variable, consider creating a symbolic link:
# ln -s ../../google-breakpad google-breakpad
BREAKPAD_ROOT="$SCRIPTDIR/../../google-breakpad/"
# Build threads
# By default we use all physical CPU cores to build.
NUMCORES="$(sysctl -n hw.ncpu)"
echo "CPU cores detected: $NUMCORES"
if [ "$NUMCORES" = '' ]; then NUMCORES=1; fi
if [ "$CPU_COUNT" != -1 ]; then NUMCORES=$CPU_COUNT; fi
echo "CPU cores to be used: $NUMCORES"
if [ "$BUILD_BUNDLE" -eq "1" ] && [ -d "build" ]; then rm -rf build; fi
if [ $MAKE_ONLY = 0 ]; then mkdir -p build; fi
cd build
if [ $MAKE_ONLY = 0 ] && [ -f 'CMakeCache.txt' ]; then rm -f 'CMakeCache.txt'; fi
distribution="$(sw_vers -productName)"
release="$(sw_vers -productVersion)"
xcode_ver="$(xcodebuild -version | awk '/Xcode/ {print $2}')"
architecture="$(uname -m)"
echo 'We have detected the following system:'
echo " [ $distribution ] [ $release ] [ $architecture ] [ $xcode_ver ]"
case $release in
*) echo 'Turning ON dynamic PNG ...'
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DPNG_STATIC=OFF";;
esac
case $xcode_ver in
# en.wikipedia.org/wiki/Xcode, Version, OS X SDK(s) <- lowest, but not less than 10.4
2.*|3.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.4";;
4.0*|4.1*|4.2*|4.3*) CMAKE_OSX_DEPLOYMENT_TARGET="10.6";;
4.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.7";;
5.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.8";;
6.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.9";;
7.*) CMAKE_OSX_DEPLOYMENT_TARGET="10.10";;
# ^ last one expected for future
esac
case $CMAKE_OSX_DEPLOYMENT_TARGET in
10.4*|10.5*) CMAKE_OSX_ARCHITECTURES="ppc;i386";;
10.6*) CMAKE_OSX_ARCHITECTURES="i386;x86_64";;
esac
if [ "$CMAKE_OSX_DEPLOYMENT_TARGET" != "" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
fi
if [ "$CMAKE_OSX_ARCHITECTURES" != "" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}"
fi
if [ "$USE_XCODE" -ne "1" ]; then
if [ "$CLANG_FORCED" -eq "1" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_C_COMPILER=${CLANG_BIN_PATH} -DCMAKE_CXX_COMPILER=${CLANGPP_BIN_PATH}"
echo "USER WANTS to use CLANG / LLVM compiler!"
else
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_C_COMPILER=${GCC_BIN_PATH} -DCMAKE_CXX_COMPILER=${GCCPP_BIN_PATH}"
fi
fi
LUA_FORCED_CMAKE=
if [ "$LUA_FORCED_VERSION" -ne "0" ]; then
if [ "$LUA_FORCED_VERSION" -eq "52" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DFORCE_LUA_5_2=ON"
echo "USER WANTS TO FORCE USE of LUA 5.2"
elif [ "$LUA_FORCED_VERSION" -eq "51" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DFORCE_LUA_5_1=ON"
echo "USER WANTS TO FORCE USE of LUA 5.1"
fi
fi
if [ "$MAKE_ONLY" -eq "0" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DWANT_DEV_OUTPATH=ON $WANT_STATIC_LIBS -DBREAKPAD_ROOT=$BREAKPAD_ROOT"
if [ "$BUILD_BUNDLE" -ne "1" ]; then
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=''"
if [ "$CLANG_FORCED" -eq "1" ] || [ "$USE_XCODE" -eq "1" ]; then
#^ Remove this condition when it V will start working on gcc
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DBUILD_MEGAGLEST_TESTS=ON"
else
rm -f ../megaglest_tests
fi
rm -f ../MegaGlest*.dmg
else
EXTRA_CMAKE_OPTIONS="${EXTRA_CMAKE_OPTIONS} -DCPACK_GENERATOR=Bundle -DSINGLE_INSTALL_DIRECTORY=ON -DBUILD_MEGAGLEST_MAP_EDITOR=OFF -DBUILD_MEGAGLEST_MODEL_VIEWER=OFF"
rm -f ../megaglest_editor ../megaglest_g3dviewer ../megaglest_tests
fi
echo "Calling cmake with EXTRA_CMAKE_OPTIONS = ${EXTRA_CMAKE_OPTIONS}"
if [ "$USE_XCODE" -eq "1" ]; then
cmake -GXcode $EXTRA_CMAKE_OPTIONS ../../..
if [ "$?" -ne "0" ]; then echo 'ERROR: CMAKE failed.' >&2; exit 1; fi
else
cmake —G"Unix Makefiles" $EXTRA_CMAKE_OPTIONS ../../..
if [ "$?" -ne "0" ]; then echo 'ERROR: CMAKE failed.' >&2; exit 1; fi
fi
fi
if [ "$CMAKE_ONLY" -eq "1" ]; then
echo "==================> You may now call make with $NUMCORES cores... <=================="
else
if [ "$USE_XCODE" -eq "1" ]; then
echo "==================> About to call xcodebuild... <================================="
xcodebuild | egrep "(error|warning):"
if [ "$?" -ne "0" ]; then echo 'ERROR: xcodebuild failed.' >&2; exit 2; fi
else
echo "==================> About to call make with $NUMCORES cores... <=================="
make -j$NUMCORES
if [ "$?" -ne "0" ]; then echo 'ERROR: MAKE failed.' >&2; exit 2; fi
fi
if [ -d "../Debug" ]; then mv -f ../Debug/megaglest* "$SCRIPTDIR"; rm -rf ../Debug
elif [ -d "../Release" ]; then mv -f ../Release/megaglest* "$SCRIPTDIR"; rm -rf ../Release; fi
cd ..
if [ "$BUILD_BUNDLE" -ne "1" ]; then
echo ''
echo 'BUILD COMPLETE.'
echo ''
echo '- - - - - - - - - - - - - - - - - - - -'
echo 'Mini test:'
echo '>>> megaglest --version'
./megaglest --version | head -3
echo '>>> megaglest_editor --help'
./megaglest_editor --help | head -3
echo '>>> megaglest_g3dviewer --help'
./megaglest_g3dviewer --help | head -3
echo 'Dependencies:'
otool -L megaglest
echo '- - - - - - - - - - - - - - - - - - - -'
echo ''
echo 'To launch MegaGlest from the current directory, use:'
echo ' ./megaglest'
echo ''
else
ls -lhA megaglest
echo ''
./megaglest --version
echo ''
fi
fi

View File

@ -3,15 +3,15 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>English</string> <string>en</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>megaglest</string> <string>MegaGlest</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}, © 2001-2015 The Glest Team All Rights Reserved.</string> <string>v${MEGAGLEST_VERSION}, © 2001-2015 The MegaGlest Team.</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>MegaGlest</string> <string>MegaGlest</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>org.megaglest.v${VER_MAJOR}-${VER_MINOR}-${VER_RELEASE}</string> <string>org.megaglest.v${MEGAGLEST_VERSION}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
@ -19,11 +19,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}</string> <string>${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>MGGL</string> <string>MGGL</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${VER_MAJOR}.${VER_MINOR}.${VER_RELEASE}</string> <string>${VER_MAJOR}.${VER_MINOR}.${VER_PATCH}</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View File

@ -0,0 +1,12 @@
#!/bin/sh
# Use this script in bundle to run game
# ----------------------------------------------------------------------------
# Copyright (c) 2015 under GNU GPL v3.0+
export LANG=C
SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)"
export DYLD_LIBRARY_PATH="$SCRIPTDIR/../FRAMEWORKS"
export PATH="$SCRIPTDIR/../Resources/megaglest-game:$PATH"
exec "$SCRIPTDIR/../Resources/megaglest-game/megaglest"
exit "$?"

3
mk/macosx/glest-dev.ini Normal file
View File

@ -0,0 +1,3 @@
DataPath=$APPLICATIONPATH/../../data/glest_game/
ServerListPath=$APPLICATIONPATH/../shared/
GlestKeysIniPath=$APPLICATIONPATH/../shared/

94
mk/macosx/glest.ini Normal file
View File

@ -0,0 +1,94 @@
; === propertyMap File ===
; This file defines default properties and values. Do not edit this file,
; instead, to modify, copy any properties to glestuser.ini, then change these as
; needed. Values contained in glestuser.ini will overwrite values found here.
;
; For explanation of these properties, please refer to the MegaGlest wiki at
; http://wiki.megaglest.org/
;
AiLog=0
AiRedir=false
AllowDownloadDataSynch=false
AllowGameDataSynchCheck=false
AllowRotateUnits=true
AnnouncementURL=http://master.megaglest.org/files/announcement.txt
AutoMaxFullScreen=false
AutoTest=false
CheckGlCaps=true
ColorBits=32
ConsoleMaxLines=8
ConsoleMaxLinesStored=25
ConsoleTimeout=20
DataPath=$APPLICATIONDATAPATH/
LogPath=$HOME/.megaglest/
DayTime=1000
DebugLogFile=debug.log
DebugMode=false
DebugPerformance=false
DebugNetwork=false
DebugWorldSynch=false
DepthBits=16
FactoryGraphics=OpenGL
FactorySound=OpenAL
FastSpeedLoops=8
FileArchiveExtension=.7z
FileArchiveExtractCommand=$APPLICATIONDATAPATH/p7zip/7z
FileArchiveExtractCommandParameters=x -o"{outputpath}" "{archivename}"
FileArchiveCompressCommand=$APPLICATIONDATAPATH/p7zip/7z
FileArchiveCompressCommandParameters=a -r -xr!?svn\* "{archivename}" "{archivefiles}"
FileArchiveCompressCommandSuccessResult=0
Filter=Bilinear
FilterMaxAnisotropy=1
FirstTime=false
FocusArrows=true
FogOfWarSmoothing=true
FogOfWarSmoothingFrameSkip=3
FontConsoleBaseSize=14
FontConsolePostfix=-*-*-*-*-*-*-*
FontConsolePrefix=-*-arial-*-r-*-*-
FontDisplayBaseSize=12
FontDisplayPostfix=-*-*-*-*-*-*-*
FontDisplayPrefix=-*-arial-*-r-*-*-
FontDisplaySmallBaseSize=12
FontMenuBigBaseSize=20
FontMenuBigPostfix=-*-*-*-*-*-*-*
FontMenuBigPrefix=-*-arial-*-r-*-*-
FontMenuNormalBaseSize=14
FontMenuNormalPostfix=-*-*-*-*-*-*-*
FontMenuNormalPrefix=-*-arial-*-r-*-*-
FontMenuVeryBigBaseSize=25
FontSizeAdjustment=0
FONT_HEIGHT_TEXT=yW
Lang=english
MaxLights=3
Masterserver=http://master.megaglest.org/
NetPlayerName=newbie
NetworkConsistencyChecks=true
PhotoMode=false
PortList=61357,61367,61377,61387,61397
PortServer=61357
RefreshFrequency=75
ScreenHeight=600
ScreenWidth=800
ServerIp=192.168.0.107
ShadowFrameSkip=2
ShadowTextureSize=512
Shadows=Projected
SoundStaticBuffers=16
SoundStreamingBuffers=4
SoundVolumeAmbient=80
SoundVolumeFx=80
SoundVolumeMusic=90
StencilBits=0
Textures3D=true
TranslationGetURL=https://www.transifex.com/api/2/project/megaglest/resource/$file/translation/$language
TranslationGetURLDetails=https://www.transifex.com/api/2/project/megaglest/resource/$file/?details
TranslationGetURLFileList=main-language-file|megapack-language-file|loading-screen-hints|tutorials-1-very-basic-tutorial|tutorials-2-basic-tutorial|tutorials-3-advanced-tutorial|scenarios-amazones|scenarios-amazones-light|scenarios-capture-enemy-flag|scenarios-storming
TranslationGetURLFileListMapping=data/lang/$language.lng|techs/megapack/lang/megapack_$language.lng|data/lang/hint/hint_$language.lng|tutorials/1_very_basic_tutorial/1_very_basic_tutorial_$language.lng|tutorials/2_basic_tutorial/2_basic_tutorial_$language.lng|tutorials/3_advanced_tutorial/3_advanced_tutorial_$language.lng|scenarios/amazones/amazones_$language.lng|scenarios/amazones_light/amazones_light_$language.lng|scenarios/capture_enemy_flag/capture_enemy_flag_$language.lng|scenarios/storming/storming_$language.lng
TranslationGetURLLanguage=en
TranslationGetURLPassword=
TranslationGetURLUser=<enter username>
UnitParticles=true
UserData_Root=$HOME/.megaglest/
VersionURL=http://master.megaglest.org/files/versions/
Windowed=true

View File

@ -0,0 +1,67 @@
#!/bin/sh
# Use this script to build MegaGlest Binary Archive for a Version Release
# ----------------------------------------------------------------------------
# 2011 Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# 2015 Rewritten by filux <heross(@@)o2.pl>
# Copyright (c) 2011-2015 under GNU GPL v3.0+
# ----------------------------------------------------------------------------
LANG=C
# set this to non 0 to skip building the binary
skipbinarybuild=0
# Consider setting this for small packages if there's plenty of RAM and CPU available:
#export XZ_OPT="$XZ_OPT -9e"
VERSION="$(../linux/mg-version.sh --version)"
kernel="macos"
RELEASENAME="megaglest-binary-$kernel"
PACKAGE="$RELEASENAME-$VERSION.tar.bz2"
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
echo "Creating binary package in $RELEASEDIR"
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
mkdir -p "$RELEASEDIR"
if [ "$skipbinarybuild" -eq "0" ]; then
echo "building binaries ..."
cd "$CURRENTDIR"
if [ -d "build" ]; then rm -rf "build"; fi
./build-mg.sh -b
if [ "$?" -ne "0" ]; then echo 'ERROR: "./build-mg.sh" failed.' >&2; exit 1; fi
else
echo "SKIPPING build of binaries ..."
fi
cd "$CURRENTDIR"
echo "copying binaries ..."
cp ../shared/*.ico "$RELEASEDIR"
if [ -e "$RELEASEDIR/glest.ico" ]; then rm "$RELEASEDIR/glest.ico"; fi
#cp bundle_resources/*.icns "$RELEASEDIR"
cp {../shared/,}*.ini "$RELEASEDIR"
if [ -e "$RELEASEDIR/glest-dev.ini" ]; then rm "$RELEASEDIR/glest-dev.ini"; fi
cp megaglest "$RELEASEDIR"
if [ -e "megaglest_editor" ]; then
cp megaglest_editor "$RELEASEDIR"
else
if [ -e "$RELEASEDIR/editor.ico" ]; then rm "$RELEASEDIR/editor.ico"; fi
fi
if [ -e "megaglest_g3dviewer" ]; then
cp megaglest_g3dviewer "$RELEASEDIR"
else
if [ -e "$RELEASEDIR/g3dviewer.ico" ]; then rm "$RELEASEDIR/g3dviewer.ico"; fi
fi
if [ -d "p7zip" ]; then cp -r p7zip "$RELEASEDIR"; fi
echo "creating $PACKAGE"
cd "$RELEASEDIR_ROOT"
if [ -f "$PACKAGE" ]; then rm "$PACKAGE"; fi
cd "$RELEASENAME"
tar -cf - * | bzip2 -9 > "../$PACKAGE"
cd "$CURRENTDIR"
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE"

View File

@ -0,0 +1,55 @@
#!/bin/sh
# Use this script to build MegaGlest release archives for a Version Release
# ----------------------------------------------------------------------------
# 2015 Written by filux <heross(@@)o2.pl>
# Copyright (c) 2015 under GNU GPL v3.0+
# ----------------------------------------------------------------------------
LANG=C
CURRENTDIR="$(cd "$(dirname "$0")"; pwd)"
cd "$CURRENTDIR"
VERSION="$(../linux/mg-version.sh --version)"
kernel="macos"
RELEASENAME="MegaGlest-game-$kernel"
PACKAGE="$RELEASENAME-$VERSION.zip"
PACKAGE2="$RELEASENAME-$VERSION.dmg"
RELEASEDIR_ROOT="$CURRENTDIR/../../../release"
RELEASEDIR="${RELEASEDIR_ROOT}/${RELEASENAME-$VERSION}"
BINARY_DIR="megaglest-binary-$kernel"
DATA_DIR="megaglest-standalone-data"
APP_RES_DIR="$RELEASEDIR/MegaGlest.app/Contents/Resources"
APP_BIN_DIR="$RELEASEDIR/MegaGlest.app/Contents/MacOS"
APP_PLIST_DIR="$RELEASEDIR/MegaGlest.app/Contents"
APP_GAME_DIR="$APP_RES_DIR/megaglest-game"
if [ -d "$RELEASEDIR" ]; then rm -rf "$RELEASEDIR"; fi
mkdir -p "$APP_GAME_DIR"
mkdir -p "$APP_BIN_DIR"
./make-binary-archive.sh
cp -r "$RELEASEDIR_ROOT/$BINARY_DIR/"* "$APP_GAME_DIR"
../linux/make-data-archive.sh
cp -r "$RELEASEDIR_ROOT/$DATA_DIR/"* "$APP_GAME_DIR"
cp "$CURRENTDIR/build/mk/macosx/bundle_resources/Info.plist" "$APP_PLIST_DIR"
cp "$CURRENTDIR/bundle_resources/MegaGlest.icns" "$APP_RES_DIR"
cp "$CURRENTDIR/bundle_resources/MegaGlest.sh" "$APP_BIN_DIR"
mv "$APP_BIN_DIR/MegaGlest.sh" "$APP_BIN_DIR/MegaGlest"
echo "creating $PACKAGE"
cd "$RELEASEDIR_ROOT"
if [ -f "$PACKAGE" ]; then rm "$PACKAGE"; fi
cd "$RELEASENAME"
zip -9r "../$PACKAGE" "MegaGlest.app" >/dev/null
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE"
echo "creating $PACKAGE2"
cd "$CURRENTDIR/build"
if [ -f "$RELEASEDIR_ROOT/$PACKAGE2" ]; then rm "$RELEASEDIR_ROOT/$PACKAGE2"; fi
cpack
mv -f MegaGlest*.dmg "$RELEASEDIR_ROOT"
ls -lhA "${RELEASEDIR_ROOT}/$PACKAGE2"
cd "$RELEASEDIR_ROOT"
find "${RELEASEDIR_ROOT}" -name "MegaGlest*" -type d | xargs rm -rf 2>/dev/null
find "${RELEASEDIR_ROOT}" -name "megaglest*" -type d | xargs rm -rf 2>/dev/null

View File

@ -0,0 +1,60 @@
#!/bin/sh
#
# Start a headless MegaGlest game server (and keep it running)
#
# Using this script, a headless game server is started, waiting for players to
# connect (if your firewall configuration permits). Players connect and start a
# game. As soon as the game ends, the server will quit, and this script will
# start up a new server immidiately. This is a stability measure to rule out
# the unlikely case where side effects (such as memory leaks or corruption)
# could drain on system resources.
#
# For this to work, Internet originated traffic must be able to reach the
# server on the following ports:
# TCP port 61357: game protocol port
# TCP port 61358: FTP control port
# TCP ports 61359 to 61366: FTP data ports
#
# Once publishing to the master server succeeded (this can be verified at
# <http://master.megaglest.org>) you may connect to your headless game server
# using a copy of MegaGlest you have installed on a Desktop computer. The first
# user connecting to a headless server controls it. If this user disconnects,
# the next user who connects (or had already connected) takes control.
#
# Please read http://wiki.megaglest.org/Dedicated_Server for more information
#
# ----------------------------------------------------------------------------
# Written by Tom Reynolds <tomreyn[at]megaglest.org>
# Copyright (c) 2013 Tom Reynolds, The Megaglest Team, under GNU GPL v3.0+
# ----------------------------------------------------------------------------
LANG=C
# Install location
DIR_GAME="$(cd "$(dirname "$0")"; pwd)"
# Log file location (beware, this can grow large)
#LOG_SERVER=/dev/null
LOG_SERVER=~/.megaglest/server.log
# ---
cd $DIR_GAME
#ulimit -c unlimited
while true; do
if [ -f "$LOG_SERVER" ]; then mv -f "$LOG_SERVER" "$LOG_SERVER.1"; fi
if [ -f "core" ]; then mv -f "core" "core.1"; fi
date > "$LOG_SERVER"
echo 'Starting server...' | tee -a "$LOG_SERVER"
./megaglest --headless-server-mode=vps,exit >> "$LOG_SERVER" 2>&1
if [ $? -ne 0 ];
then
echo 'ERROR: Server has quit unexpectedly.' >> "$LOG_SERVER"
echo 'ERROR: Server has quit unexpectedly.' >&2
echo ' Please inspect '"$LOG_SERVER"'.' >&2
exit 1
else
echo 'Server has quit.' | tee -a "$LOG_SERVER"
fi
done

View File

@ -1,6 +1,6 @@
; === propertyMap File === ; === propertyMap File ===
General=50.115.163.66 Initiate_1=94.23.148.250:62001
Fakir=54.207.6.180 Initiate_2=94.23.148.250:62012
Vega=23.94.101.97 Initiate_3=94.23.148.250:62023
This computer=127.0.0.1 This computer=127.0.0.1

View File

@ -3,8 +3,8 @@
!define APNAME MegaGlest !define APNAME MegaGlest
!define APNAME_OLD Mega-Glest !define APNAME_OLD Mega-Glest
!define APVER_OLD 3.9.1 !define APVER_OLD 3.11.0
!define APVER 3.11.0 !define APVER 3.12-dev
Name "${APNAME} ${APVER}" Name "${APNAME} ${APVER}"
SetCompressor /FINAL /SOLID lzma SetCompressor /FINAL /SOLID lzma

View File

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

View File

@ -1,6 +1,16 @@
#/bin/bash #/bin/bash
# This is a help script to build windows installers on a linux machine
#
# for this script nsis is needed:
# windows binaries must be in place ( for example from snapshots.megaglest.org )
CURRENTDIR="$(dirname $(readlink -f $0))"
cd "$CURRENTDIR"
# We need the AccessControl plugin for nsis and place this in plugins directory
# original from http://nsis.sourceforge.net/AccessControl_plug-in
wget http://downloads.megaglest.org/windowsInstallerHelp/AccessControl.dll -P plugins
wget http://downloads.megaglest.org/windowsInstallerHelp/AccessControl.txt -P plugins
# for this script nsis is needed
# windows binaries must be installed from snapshots.megaglest.org
makensis MegaGlestInstaller.nsi makensis MegaGlestInstaller.nsi

View File

@ -1,253 +0,0 @@
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

@ -6,6 +6,10 @@ SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
IF(BUILD_MEGAGLEST_MODEL_VIEWER) IF(BUILD_MEGAGLEST_MODEL_VIEWER)
MESSAGE(STATUS "Will try to build MegaGlest model viewer") MESSAGE(STATUS "Will try to build MegaGlest model viewer")
IF(UNIX AND APPLE AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
ADD_DEFINITIONS("-std=c++11")
ENDIF()
FIND_PACKAGE(SDL REQUIRED) FIND_PACKAGE(SDL REQUIRED)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
@ -128,13 +132,15 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER)
ENDFOREACH(DIR) ENDFOREACH(DIR)
OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF) OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF)
IF(WANT_DEV_OUTPATH) IF(WANT_DEV_OUTPATH)
IF(UNIX AND NOT APPLE) IF(UNIX AND NOT APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/)
ELSE() ELSEIF(UNIX AND APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/macosx/)
ENDIF() ELSE()
ENDIF() SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/)
ENDIF()
ENDIF()
SET(HELP2MAN_OUT_PATH ${EXECUTABLE_OUTPUT_PATH}) SET(HELP2MAN_OUT_PATH ${EXECUTABLE_OUTPUT_PATH})
IF("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "") IF("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "")
@ -163,7 +169,7 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER)
IF(EXISTS ${HELP2MAN}) IF(EXISTS ${HELP2MAN})
MESSAGE("***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]") MESSAGE("***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]")
SET(MG_MANPAGE_DESCRIPTION "G3D Model editor for the popular 3D realtime stragegy game") SET(MG_MANPAGE_DESCRIPTION "G3D Model editor for the popular 3D realtime strategy game")
IF(EXISTS ${XVFB_EXEC}) IF(EXISTS ${XVFB_EXEC})
MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} about to build manpage with it.") MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} about to build manpage with it.")
@ -199,12 +205,21 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER)
"${PROJECT_SOURCE_DIR}/mk/shared/g3dviewer.ico" "${PROJECT_SOURCE_DIR}/mk/shared/g3dviewer.ico"
DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH}) DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH})
# Installation of the program desktop file IF(UNIX AND NOT APPLE)
SET(MG_DESKTOP_FILE ${PROJECT_SOURCE_DIR}/mk/linux/megaglest_g3dviewer.desktop) # Installation of the program desktop file
SET(MG_DESKTOP_FILE ${PROJECT_SOURCE_DIR}/mk/linux/megaglest_g3dviewer.desktop)
INSTALL(FILES INSTALL(FILES
"${MG_DESKTOP_FILE}" "${MG_DESKTOP_FILE}"
DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH}) DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})
IF(NOT BUILD_MEGAGLEST)
INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.png"
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.xpm"
DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
ENDIF()
ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()

View File

@ -58,7 +58,7 @@ const char *folderDelimiter = "/";
//int GameConstants::updateFps= 40; //int GameConstants::updateFps= 40;
//int GameConstants::cameraFps= 100; //int GameConstants::cameraFps= 100;
const string g3dviewerVersionString= "v1.3.6"; const string g3dviewerVersionString= "v3.12-dev";
// Because g3d should always support alpha transparency // Because g3d should always support alpha transparency
string fileFormat = "png"; string fileFormat = "png";

View File

@ -217,13 +217,15 @@ IF(BUILD_MEGAGLEST)
ENDIF() ENDIF()
OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF) OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF)
IF(WANT_DEV_OUTPATH) IF(WANT_DEV_OUTPATH)
IF(UNIX AND NOT APPLE) IF(UNIX AND NOT APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/)
ELSE() ELSEIF(UNIX AND APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/macosx/)
ENDIF() ELSE()
ENDIF() SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/)
ENDIF()
ENDIF()
MESSAGE(STATUS "***Note: The final output path for Megaglest Game will be [${EXECUTABLE_OUTPUT_PATH}]") MESSAGE(STATUS "***Note: The final output path for Megaglest Game will be [${EXECUTABLE_OUTPUT_PATH}]")
@ -299,17 +301,27 @@ IF(BUILD_MEGAGLEST)
DESTINATION ${MEGAGLEST_MANPAGE_INSTALL_PATH}) DESTINATION ${MEGAGLEST_MANPAGE_INSTALL_PATH})
ENDIF() ENDIF()
# rename the ini for installation INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/shared/glestkeys.ini"
"${PROJECT_SOURCE_DIR}/mk/shared/servers.ini"
DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH})
IF(WIN32) IF(WIN32)
INSTALL(FILES INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/windoze/glest.ini" "${PROJECT_SOURCE_DIR}/mk/windoze/glest.ini"
"${PROJECT_SOURCE_DIR}/mk/shared/glestkeys.ini" DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH})
DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH}) ELSEIF(UNIX AND NOT APPLE)
ELSE() INSTALL(FILES
INSTALL(FILES "${PROJECT_SOURCE_DIR}/mk/linux/glest.ini"
"${PROJECT_SOURCE_DIR}/mk/linux/glest.ini" DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH})
"${PROJECT_SOURCE_DIR}/mk/shared/glestkeys.ini" ELSEIF(UNIX AND APPLE)
DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH}) INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/macosx/glest.ini"
DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH})
IF(SINGLE_INSTALL_DIRECTORY AND EXISTS "${PROJECT_SOURCE_DIR}/mk/macosx/p7zip/")
INSTALL(DIRECTORY
"${PROJECT_SOURCE_DIR}/mk/macosx/p7zip"
DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH})
ENDIF()
ENDIF() ENDIF()
# Installation of data files from outside normal data folder # Installation of data files from outside normal data folder
@ -317,21 +329,34 @@ IF(BUILD_MEGAGLEST)
# DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH}data/core/misc_textures # DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH}data/core/misc_textures
# OPTIONAL REGEX "/.git" EXCLUDE) # OPTIONAL REGEX "/.git" EXCLUDE)
MESSAGE(STATUS "**Source package detected git folder structure.") #MESSAGE(STATUS "**Source package detected git folder structure.")
# Installation of the program desktop file IF(NOT APPLE)
INSTALL(FILES # Installation of the program desktop file
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.desktop" INSTALL(FILES
DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH}) "${PROJECT_SOURCE_DIR}/mk/linux/megaglest.desktop"
DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})
ENDIF()
# Installation of the program desktop icon file # Installation of the program desktop icon file
INSTALL(FILES INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.png" "${PROJECT_SOURCE_DIR}/mk/shared/megaglest.ico"
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.xpm" DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.bmp" IF(UNIX AND NOT APPLE)
"${PROJECT_SOURCE_DIR}/mk/shared/editor.ico" INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/shared/glest.ico" "${PROJECT_SOURCE_DIR}/mk/linux/megaglest.png"
"${PROJECT_SOURCE_DIR}/mk/shared/g3dviewer.ico" "${PROJECT_SOURCE_DIR}/mk/linux/megaglest.xpm"
DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH}) DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
ENDIF() ELSEIF(UNIX AND APPLE)
IF(NOT SINGLE_INSTALL_DIRECTORY)
INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/macosx/bundle_resources/MegaGlest.icns"
DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
ENDIF()
ELSE()
INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.bmp"
DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
ENDIF()
ENDIF()
ENDIF() ENDIF()

View File

@ -32,7 +32,7 @@ const char *mailString = " http://bugs.megaglest.org";
// !! Use minor versions !! Only major and minor version control compatibility! // !! 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 // 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 // don't forget to update mk/linux/mg-version.sh
const string glestVersionString = "v3.11.0"; const string glestVersionString = "v3.12-dev";
const string lastCompatibleSaveGameVersionString = "v3.9.0"; const string lastCompatibleSaveGameVersionString = "v3.9.0";
#if defined(GITVERSION) #if defined(GITVERSION)
@ -43,7 +43,7 @@ const string lastCompatibleSaveGameVersionString = "v3.9.0";
const string GIT_RawRev = string(GITVERSION); const string GIT_RawRev = string(GITVERSION);
const string GIT_Rev = string("Rev: ") + string(GITVERSION); const string GIT_Rev = string("Rev: ") + string(GITVERSION);
#else #else
const string GIT_RawRev = "$4446.1a8673f$"; const string GIT_RawRev = "$5060.7451e49$";
const string GIT_Rev = "$Rev$"; const string GIT_Rev = "$Rev$";
#endif #endif

View File

@ -240,7 +240,7 @@ void Game::resetMembers() {
scrollSpeed = Config::getInstance().getFloat("UiScrollSpeed","1.5"); scrollSpeed = Config::getInstance().getFloat("UiScrollSpeed","1.5");
photoModeEnabled = Config::getInstance().getBool("PhotoMode","false"); photoModeEnabled = Config::getInstance().getBool("PhotoMode","false");
healthbarMode = Config::getInstance().getInt("HealthBarMode","0"); healthbarMode = Config::getInstance().getInt("HealthBarMode","4");
visibleHUD = Config::getInstance().getBool("VisibleHud","true"); visibleHUD = Config::getInstance().getBool("VisibleHud","true");
timeDisplay = Config::getInstance().getBool("TimeDisplay","true"); timeDisplay = Config::getInstance().getBool("TimeDisplay","true");
withRainEffect = Config::getInstance().getBool("RainEffect","true"); withRainEffect = Config::getInstance().getBool("RainEffect","true");
@ -1334,39 +1334,13 @@ void Game::init(bool initForPreviewOnly) {
} }
if(this->loadGameNode == NULL) { if(this->loadGameNode == NULL) {
gameCamera.init(map->getW(), map->getH()); initCamera(map);
// camera default height calculation
if(map->getCameraHeight()>0 && gameCamera.getCalculatedDefault()<map->getCameraHeight()){
gameCamera.setCalculatedDefault(map->getCameraHeight());
}
else if(gameCamera.getCalculatedDefault()<map->getMaxMapHeight()+13.0f){
gameCamera.setCalculatedDefault(map->getMaxMapHeight()+13.0f);
}
if(world.getThisFaction() != NULL) {
const Vec2i &v= map->getStartLocation(world.getThisFaction()->getStartLocationIndex());
gameCamera.setPos(Vec2f(v.x, v.y));
}
} }
else { else {
gui.loadGame(loadGameNode,&world); gui.loadGame(loadGameNode,&world);
if(inJoinGameLoading == true) { if(inJoinGameLoading == true) {
gameCamera.init(map->getW(), map->getH()); initCamera(map);
// camera default height calculation
if(map->getCameraHeight()>0 && gameCamera.getCalculatedDefault()<map->getCameraHeight()){
gameCamera.setCalculatedDefault(map->getCameraHeight());
}
else if(gameCamera.getCalculatedDefault()<map->getMaxMapHeight()+13.0f){
gameCamera.setCalculatedDefault(map->getMaxMapHeight()+13.0f);
}
if(world.getThisFaction() != NULL) {
const Vec2i &v= map->getStartLocation(world.getThisFaction()->getStartLocationIndex());
gameCamera.setPos(Vec2f(v.x, v.y));
}
} }
} }
@ -1634,6 +1608,23 @@ void Game::init(bool initForPreviewOnly) {
} }
} }
void Game::initCamera(Map *map){
gameCamera.init(map->getW(), map->getH());
// camera default height calculation
if(map->getCameraHeight()>0 && gameCamera.getCalculatedDefault()<map->getCameraHeight()){
gameCamera.setCalculatedDefault(map->getCameraHeight());
}
else if(gameCamera.getCalculatedDefault()<map->getMaxMapHeight()+13.0f){
gameCamera.setCalculatedDefault(map->getMaxMapHeight()+13.0f);
}
if(world.getThisFaction() != NULL) {
const Vec2i &v= map->getStartLocation(world.getThisFaction()->getStartLocationIndex());
gameCamera.setPos(Vec2f(v.x, v.y+gameCamera.getCalculatedDefault()/2));
}
}
// ==================== update ==================== // ==================== update ====================
void Game::reInitGUI() { void Game::reInitGUI() {
@ -4355,17 +4346,21 @@ void Game::mouseDoubleClickLeft(int x, int y) {
const Metrics &metrics= Metrics::getInstance(); const Metrics &metrics= Metrics::getInstance();
//display panel if(metrics.isInMinimap(x, y)){
if(metrics.isInDisplay(x, y) && !gui.isSelectingPos()) { // no double click on minimap
int xd= x - metrics.getDisplayX(); }
int yd= y - metrics.getDisplayY(); else {
if(gui.mouseValid(xd, yd)){ //display panel
return; if(metrics.isInDisplay(x, y) && !gui.isSelectingPos()) {
} int xd= x - metrics.getDisplayX();
int yd= y - metrics.getDisplayY();
if(gui.mouseValid(xd, yd)){
return;
}
}
//graphics panel
gui.mouseDoubleClickLeftGraphics(x, y);
} }
//graphics panel
gui.mouseDoubleClickLeftGraphics(x, y);
} }
catch(const exception &ex) { catch(const exception &ex) {
char szBuf[8096]=""; char szBuf[8096]="";

View File

@ -408,6 +408,7 @@ private:
void checkWinnerStandardHeadlessOrObserver(); void checkWinnerStandardHeadlessOrObserver();
void checkWinnerStandardPlayer(); void checkWinnerStandardPlayer();
std::map<int, int> getTeamsAlive(); std::map<int, int> getTeamsAlive();
void initCamera(Map *map);
virtual bool clientLagHandler(int slotIndex,bool networkPauseGameForLaggedClients); virtual bool clientLagHandler(int slotIndex,bool networkPauseGameForLaggedClients);
}; };

View File

@ -257,8 +257,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
if(selectingPos) { if(selectingPos) {
//give standard orders //give standard orders
Vec2i targetPos=game->getMouseCellPos(); Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() && if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
giveTwoClickOrders(x, y, prepared); giveTwoClickOrders(x, y, prepared);
} }
resetState(); resetState();
@ -267,8 +267,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
else if(selectingMeetingPoint) { else if(selectingMeetingPoint) {
if(selection.isCommandable()) { if(selection.isCommandable()) {
Vec2i targetPos=game->getMouseCellPos(); Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() && if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos); commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos);
} }
} }
@ -288,15 +288,15 @@ void Gui::mouseDownRightGraphics(int x, int y , bool prepared) {
else if(selection.isCommandable()) { else if(selection.isCommandable()) {
if(prepared) { if(prepared) {
Vec2i targetPos=game->getMouseCellPos(); Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() && if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true )) {
givePreparedDefaultOrders(x, y); givePreparedDefaultOrders(x, y);
} }
} }
else { else {
Vec2i targetPos=game->getMouseCellPos(); Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() && if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
giveDefaultOrders(x, y); giveDefaultOrders(x, y);
} }
} }

View File

@ -4607,7 +4607,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
// Is the item in the mod center? // Is the item in the mod center?
MutexSafeWrapper safeMutexThread((modHttpServerThread != NULL ? modHttpServerThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexThread((modHttpServerThread != NULL ? modHttpServerThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
if(tilesetCacheList.find(getMissingMapFromFTPServer) == tilesetCacheList.end()) { if(tilesetCacheList.find(getMissingTilesetFromFTPServer) == tilesetCacheList.end()) {
ftpMessageBox.init(lang.getString("Yes"),lang.getString("NoDownload")); ftpMessageBox.init(lang.getString("Yes"),lang.getString("NoDownload"));
} }
else { else {
@ -4775,7 +4775,7 @@ void MenuStateConnectedGame::setupUIFromGameSettings(GameSettings *gameSettings,
// Is the item in the mod center? // Is the item in the mod center?
MutexSafeWrapper safeMutexThread((modHttpServerThread != NULL ? modHttpServerThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__)); MutexSafeWrapper safeMutexThread((modHttpServerThread != NULL ? modHttpServerThread->getMutexThreadObjectAccessor() : NULL),string(__FILE__) + "_" + intToStr(__LINE__));
if(mapCacheList.find(getMissingTechtreeFromFTPServer) == mapCacheList.end()) { if(mapCacheList.find(getMissingMapFromFTPServer) == mapCacheList.end()) {
ftpMessageBox.init(lang.getString("Yes"),lang.getString("NoDownload")); ftpMessageBox.init(lang.getString("Yes"),lang.getString("NoDownload"));
} }
else { else {

View File

@ -240,7 +240,7 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu, Program
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsSelected")); listBoxHealthBars.pushBackItem(lang.getString("HealthbarsSelected"));
listBoxHealthBars.pushBackItem(lang.getString("HealthbarsSelectedOrNeeded")); listBoxHealthBars.pushBackItem(lang.getString("HealthbarsSelectedOrNeeded"));
int hpMode=config.getInt("HealthBarMode","0"); int hpMode=config.getInt("HealthBarMode","4");
int hpIndex=0; int hpIndex=0;
switch (hpMode) { switch (hpMode) {
case hbvUndefined: case hbvUndefined:
@ -411,7 +411,7 @@ void MenuStateOptions::reloadUI() {
buttonKeyboardSetup.setText(lang.getString("Keyboardsetup")); buttonKeyboardSetup.setText(lang.getString("Keyboardsetup"));
labelVisibleHud.setText(lang.getString("VisibleHUD")); labelVisibleHud.setText(lang.getString("VisibleHUD"));
labelHealthBars.setText(lang.getString("HealthBars")); labelHealthBars.setText(lang.getString("Healthbar"));
labelChatStaysActive.setText(lang.getString("ChatStaysActive")); labelChatStaysActive.setText(lang.getString("ChatStaysActive"));
labelTimeDisplay.setText(lang.getString("TimeDisplay")); labelTimeDisplay.setText(lang.getString("TimeDisplay"));

View File

@ -306,7 +306,7 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
string indent="->"; string indent="->";
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
if(getMaxHp() != 0) { if(getMaxHp() != 0 || getMaxHpRegeneration() != 0) {
str += indent+lang.getString("Hp",(translatedValue == true ? "" : "english")) + " +" + intToStr(maxHp); str += indent+lang.getString("Hp",(translatedValue == true ? "" : "english")) + " +" + intToStr(maxHp);
if(maxHpIsMultiplier) { if(maxHpIsMultiplier) {
str += "%"; str += "%";
@ -315,11 +315,11 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
// str += " +" + intToStr(getMaxHpFromBoosts()); // str += " +" + intToStr(getMaxHpFromBoosts());
// } // }
if(getMaxHpRegeneration() != 0) { if(getMaxHpRegeneration() != 0) {
str += " [" + intToStr(maxHpRegeneration); str += " (" + lang.getString("Regeneration",(translatedValue == true ? "" : "english")) + ": +" + intToStr(maxHpRegeneration);
// if(getMaxHpRegenerationFromBoosts() != 0) { // if(getMaxHpRegenerationFromBoosts() != 0) {
// str += " +" + intToStr(getMaxHpRegenerationFromBoosts()); // str += " +" + intToStr(getMaxHpRegenerationFromBoosts());
// } // }
str += "]"; str += ")";
} }
} }
@ -336,7 +336,7 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
// } // }
} }
if(getMaxEp() != 0) { if(getMaxEp() != 0 || getMaxEpRegeneration() != 0) {
if(str != "") { if(str != "") {
str += "\n"; str += "\n";
} }
@ -350,11 +350,11 @@ string UpgradeTypeBase::getDesc(bool translatedValue) const{
// } // }
if(getMaxEpRegeneration() != 0) { if(getMaxEpRegeneration() != 0) {
str += " [" + intToStr(maxEpRegeneration); str += " (" + lang.getString("Regeneration",(translatedValue == true ? "" : "english")) + ": +" + intToStr(maxEpRegeneration);
// if(getMaxEpRegenerationFromBoosts() != 0) { // if(getMaxEpRegenerationFromBoosts() != 0) {
// str += " +" + intToStr(getMaxEpRegenerationFromBoosts()); // str += " +" + intToStr(getMaxEpRegenerationFromBoosts());
// } // }
str += "]"; str += ")";
} }
} }

View File

@ -6,6 +6,10 @@ SET(TARGET_NAME_MANPAGE "${TARGET_NAME}.6")
IF(BUILD_MEGAGLEST_MAP_EDITOR) IF(BUILD_MEGAGLEST_MAP_EDITOR)
MESSAGE(STATUS "Will try to build MegaGlest map editor") MESSAGE(STATUS "Will try to build MegaGlest map editor")
IF(UNIX AND APPLE AND NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
ADD_DEFINITIONS("-std=c++11")
ENDIF()
FIND_PACKAGE(SDL REQUIRED) FIND_PACKAGE(SDL REQUIRED)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
@ -112,13 +116,15 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR)
ENDFOREACH(DIR) ENDFOREACH(DIR)
OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF) OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF)
IF(WANT_DEV_OUTPATH) IF(WANT_DEV_OUTPATH)
IF(UNIX AND NOT APPLE) IF(UNIX AND NOT APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/)
ELSE() ELSEIF(UNIX AND APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/macosx/)
ENDIF() ELSE()
ENDIF() SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/)
ENDIF()
ENDIF()
SET(HELP2MAN_OUT_PATH ${EXECUTABLE_OUTPUT_PATH}) SET(HELP2MAN_OUT_PATH ${EXECUTABLE_OUTPUT_PATH})
IF("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "") IF("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "")
@ -156,7 +162,7 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR)
IF(EXISTS ${HELP2MAN}) IF(EXISTS ${HELP2MAN})
MESSAGE("***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]") MESSAGE("***-- Found help2man: ${HELP2MAN} about to build manpage in [${HELP2MAN_OUT_PATH}${TARGET_NAME_MANPAGE}]")
SET(MG_MANPAGE_DESCRIPTION "Map editor for the popular 3D realtime stragegy game") SET(MG_MANPAGE_DESCRIPTION "Map editor for the popular 3D realtime strategy game")
IF(EXISTS ${XVFB_EXEC}) IF(EXISTS ${XVFB_EXEC})
MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} about to build manpage with it.") MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} about to build manpage with it.")
@ -193,12 +199,20 @@ IF(BUILD_MEGAGLEST_MAP_EDITOR)
"${PROJECT_SOURCE_DIR}/mk/shared/editor.ico" "${PROJECT_SOURCE_DIR}/mk/shared/editor.ico"
DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH}) DESTINATION ${MEGAGLEST_DATA_INSTALL_PATH})
# Installation of the program desktop file IF(UNIX AND NOT APPLE)
SET(MG_DESKTOP_FILE ${PROJECT_SOURCE_DIR}/mk/linux/megaglest_editor.desktop) # Installation of the program desktop file
SET(MG_DESKTOP_FILE ${PROJECT_SOURCE_DIR}/mk/linux/megaglest_editor.desktop)
INSTALL(FILES INSTALL(FILES
"${MG_DESKTOP_FILE}" "${MG_DESKTOP_FILE}"
DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH}) DESTINATION ${MEGAGLEST_DESKTOP_INSTALL_PATH})
IF(NOT BUILD_MEGAGLEST)
INSTALL(FILES
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.png"
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.xpm"
DESTINATION ${MEGAGLEST_ICON_INSTALL_PATH})
ENDIF()
ENDIF()
ENDIF() ENDIF()
ENDIF() ENDIF()

View File

@ -46,7 +46,7 @@ string getGameReadWritePath(string lookupKey) {
namespace MapEditor { namespace MapEditor {
const string mapeditorVersionString = "v1.6.1"; const string mapeditorVersionString = "v3.12-dev";
const string MainWindow::winHeader = "MegaGlest Map Editor " + mapeditorVersionString; const string MainWindow::winHeader = "MegaGlest Map Editor " + mapeditorVersionString;
// =============================================== // ===============================================
@ -103,6 +103,13 @@ MainWindow::MainWindow(string appPath)
resourceUnderMouse=0; resourceUnderMouse=0;
objectUnderMouse=0; objectUnderMouse=0;
// default values for random height calculation that turned out to be quite useful
randomWithReset=true;
randomMinimumHeight=-300;
randomMaximumHeight=400;
randomChanceDevider=30;
randomRecursions=3;
this->appPath = appPath; this->appPath = appPath;
Properties::setApplicationPath(executable_path(appPath)); Properties::setApplicationPath(executable_path(appPath));
@ -143,7 +150,7 @@ void MainWindow::init(string fname) {
#elif wxCHECK_VERSION(2, 9, 1) #elif wxCHECK_VERSION(2, 9, 1)
#else #else
//glCanvas->SetCurrent(); glCanvas->SetCurrent();
//printf("setcurrent #2\n"); //printf("setcurrent #2\n");
#endif #endif
@ -187,7 +194,7 @@ void MainWindow::init(string fname) {
// --------------------------------------------------------- // ---------------------------------------------------------
menuEdit->Append(miEditRandomizeHeights, wxT("Randomize &Heights")); menuEdit->Append(miEditRandomizeHeights, wxT("Randomize &Heights"));
menuEdit->Append(miEditRandomize, wxT("Randomi&ze Heights/Players")); menuEdit->Append(miEditRandomize, wxT("Randomi&ze Players"));
menuEdit->Append(miEditSwitchSurfaces, wxT("Switch Sur&faces...")); menuEdit->Append(miEditSwitchSurfaces, wxT("Switch Sur&faces..."));
menuEdit->Append(miEditInfo, wxT("&Info...")); menuEdit->Append(miEditInfo, wxT("&Info..."));
menuEdit->Append(miEditAdvanced, wxT("&Advanced...")); menuEdit->Append(miEditAdvanced, wxT("&Advanced..."));
@ -314,7 +321,7 @@ void MainWindow::init(string fname) {
GetStatusBar()->SetStatusWidths(siCOUNT, status_widths); GetStatusBar()->SetStatusWidths(siCOUNT, status_widths);
SetStatusText(wxT("File: ") + ToUnicode(fileName), siFILE_NAME); SetStatusText(wxT("File: ") + ToUnicode(fileName), siFILE_NAME);
SetStatusText(wxT(".gbm"), siFILE_TYPE); SetStatusText(wxT(".mgm"), siFILE_TYPE);
SetStatusText(wxT("Object: None (Erase)"), siCURR_OBJECT); SetStatusText(wxT("Object: None (Erase)"), siCURR_OBJECT);
SetStatusText(wxT("Brush: Height"), siBRUSH_TYPE); SetStatusText(wxT("Brush: Height"), siBRUSH_TYPE);
SetStatusText(wxT("Value: 0"), siBRUSH_VALUE); SetStatusText(wxT("Value: 0"), siBRUSH_VALUE);
@ -480,8 +487,8 @@ void MainWindow::onClose(wxCloseEvent &event) {
} }
void MainWindow::setupStartupSettings() { void MainWindow::setupStartupSettings() {
program = new Program(glCanvas->GetClientSize().x, glCanvas->GetClientSize().y); string playerName = Config::getInstance().getString("NetPlayerName","");
program = new Program(glCanvas->GetClientSize().x, glCanvas->GetClientSize().y, playerName);
fileName = "New (unsaved) Map"; fileName = "New (unsaved) Map";
//printf("#0 file load [%s]\n",currentFile.c_str()); //printf("#0 file load [%s]\n",currentFile.c_str());
@ -536,14 +543,8 @@ void MainWindow::setExtension() {
if (extnsn == "gbm" || extnsn == "mgm") { if (extnsn == "gbm" || extnsn == "mgm") {
currentFile = cutLastExt(currentFile); currentFile = cutLastExt(currentFile);
} }
if (Program::getMap()->getMaxFactions() <= 4 || Program::getMap()->getCliffLevel() == 0) { SetStatusText(wxT(".mgm"), siFILE_TYPE);
SetStatusText(wxT(".gbm"), siFILE_TYPE); currentFile += ".mgm";
currentFile += ".gbm";
}
else {
SetStatusText(wxT(".mgm"), siFILE_TYPE);
currentFile += ".mgm";
}
} }
void MainWindow::onMouseDown(wxMouseEvent &event, int x, int y) { void MainWindow::onMouseDown(wxMouseEvent &event, int x, int y) {
@ -740,9 +741,9 @@ void MainWindow::onMenuFileSaveAs(wxCommandEvent &event) {
} }
#if wxCHECK_VERSION(2, 9, 1) #if wxCHECK_VERSION(2, 9, 1)
wxFileDialog fd(this, wxT("Select file"), wxT(""), wxT(""), wxT("*.gbm|*.mgm"), wxFD_SAVE); wxFileDialog fd(this, wxT("Select file"), wxT(""), wxT(""), wxT("*.mgm|*.gbm"), wxFD_SAVE);
#else #else
wxFileDialog fd(this, wxT("Select file"), wxT(""), wxT(""), wxT("*.gbm|*.mgm"), wxSAVE); wxFileDialog fd(this, wxT("Select file"), wxT(""), wxT(""), wxT("*.mgm|*.gbm"), wxSAVE);
#endif #endif
if(fileDialog->GetPath() != ToUnicode("")) { if(fileDialog->GetPath() != ToUnicode("")) {
@ -758,7 +759,7 @@ void MainWindow::onMenuFileSaveAs(wxCommandEvent &event) {
fd.SetDirectory(ToUnicode(defaultPath)); fd.SetDirectory(ToUnicode(defaultPath));
} }
fd.SetWildcard(wxT("Glest Map (*.gbm)|*.gbm|MegaGlest Map (*.mgm)|*.mgm")); fd.SetWildcard(wxT("MegaGlest Map (*.mgm)|*.mgm|Glest Map (*.gbm)|*.gbm"));
if (fd.ShowModal() == wxID_OK) { if (fd.ShowModal() == wxID_OK) {
#ifdef WIN32 #ifdef WIN32
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(fd.GetPath())); const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(fd.GetPath()));
@ -991,10 +992,40 @@ void MainWindow::onMenuEditRandomizeHeights(wxCommandEvent &event) {
if(program == NULL) { if(program == NULL) {
return; return;
} }
while(true){
program->setUndoPoint(ctAll);//randomizeHeights(-300,400,30,3);
program->setUndoPoint(ctAll); SimpleDialog simpleDialog;
program->randomizeMapHeights(); simpleDialog.addValue("Initial Reset", boolToStr(randomWithReset),"If set to '0' no height reset is done before calculating");
setDirty(); simpleDialog.addValue("Min Height", intToStr(randomMinimumHeight),"Lowest random height. example: -300 or below if you want water , 0 if you don't want water.");
simpleDialog.addValue("Max Height", intToStr(randomMaximumHeight),"Max random height. A good value is 400");
simpleDialog.addValue("Chance Devider", intToStr(randomChanceDevider),"Defines how often you get a hill or hole default is 30. Bigger number, less hills/holes.");
simpleDialog.addValue("Smooth Recursions", intToStr(randomRecursions),"Number of recursions cycles to smooth the hills and holes. 0<x<50 default is 3.");
if (!simpleDialog.show("Randomize Height")) return;
try {
randomWithReset=strToBool(simpleDialog.getValue("Initial Reset"));
randomMinimumHeight=strToInt(simpleDialog.getValue("Min Height"));
randomMaximumHeight=strToInt(simpleDialog.getValue("Max Height"));
randomChanceDevider=strToInt(simpleDialog.getValue("Chance Devider"));
randomRecursions=strToInt(simpleDialog.getValue("Smooth Recursions"));
// set insane inputs to something that does not crash
if(randomMinimumHeight>=randomMaximumHeight) randomMinimumHeight=randomMaximumHeight-1;
if(randomChanceDevider<1) randomChanceDevider=1;
// set randomRecursions to something useful
if(randomRecursions<0) randomRecursions=0;
if(randomRecursions>50) randomRecursions=50;
program->randomizeMapHeights(randomWithReset, randomMinimumHeight, randomMaximumHeight,
randomChanceDevider, randomRecursions);
}
catch (const exception &e) {
MsgDialog(this, ToUnicode(e.what()), wxT("Exception"), wxOK | wxICON_ERROR).ShowModal();
}
setDirty();
}
} }
void MainWindow::onMenuEditRandomize(wxCommandEvent &event) { void MainWindow::onMenuEditRandomize(wxCommandEvent &event) {
@ -1003,7 +1034,7 @@ void MainWindow::onMenuEditRandomize(wxCommandEvent &event) {
} }
program->setUndoPoint(ctAll); program->setUndoPoint(ctAll);
program->randomizeMap(); program->randomizeFactions();
setDirty(); setDirty();
} }
@ -1585,25 +1616,20 @@ bool App::OnInit() {
SystemFlags::VERBOSE_MODE_ENABLED = false; SystemFlags::VERBOSE_MODE_ENABLED = false;
SystemFlags::ENABLE_THREADED_LOGGING = false; SystemFlags::ENABLE_THREADED_LOGGING = false;
#if defined(wxMAJOR_VERSION) && defined(wxMINOR_VERSION) && defined(wxRELEASE_NUMBER) && defined(wxSUBRELEASE_NUMBER)
printf("Using wxWidgets version [%d.%d.%d.%d]\n",wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxSUBRELEASE_NUMBER);
#endif
string fileparam; string fileparam;
if(argc==2){ if(argc==2){
if(argv[1][0]=='-') { // any flag gives help and exits program. if(argv[1][0]=='-') { // any flag gives help and exits program.
std::cout << "MegaGlest map editor " << mapeditorVersionString << " [Using " << (const char *)wxConvCurrent->cWX2MB(wxVERSION_STRING) << "]" << std::endl << std::endl; std::cout << "MegaGlest map editor " << mapeditorVersionString << " [Using " << (const char *)wxConvCurrent->cWX2MB(wxVERSION_STRING) << "]" << std::endl << std::endl;
std::cout << "glest_map_editor [GBM OR MGM FILE]" << std::endl << std::endl; std::cout << "glest_map_editor [MGM FILE]" << std::endl << std::endl;
std::cout << "Creates or edits glest/megaglest maps." << std::endl; std::cout << "Creates or edits glest/megaglest maps." << std::endl;
std::cout << "Draw with left mouse button (select what and how large area in menu or toolbar)" << std::endl; std::cout << "Draw with left mouse button" << std::endl;
std::cout << "Pan trough the map with right mouse button" << std::endl; std::cout << "Move map with right mouse button" << std::endl;
std::cout << "Zoom with middle mouse button or mousewheel" << std::endl; std::cout << "Zoom with middle mouse button or mousewheel" << std::endl;
// std::cout << " ~ more helps should be written here ~" << std::endl; // std::cout << " ~ more helps should be written here ~" << std::endl;
std::cout << std::endl; std::cout << std::endl;
exit (0); exit (0);
} }
//#if defined(__MINGW32__) //#if defined(__MINGW32__)
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(argv[1]); const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(argv[1]);
fileparam = tmp_buf; fileparam = tmp_buf;
@ -1618,6 +1644,10 @@ bool App::OnInit() {
//#endif //#endif
} }
#if defined(wxMAJOR_VERSION) && defined(wxMINOR_VERSION) && defined(wxRELEASE_NUMBER) && defined(wxSUBRELEASE_NUMBER)
printf("Using wxWidgets version [%d.%d.%d.%d]\n",wxMAJOR_VERSION,wxMINOR_VERSION,wxRELEASE_NUMBER,wxSUBRELEASE_NUMBER);
#endif
wxString exe_path = wxStandardPaths::Get().GetExecutablePath(); wxString exe_path = wxStandardPaths::Get().GetExecutablePath();
//wxString path_separator = wxFileName::GetPathSeparator(); //wxString path_separator = wxFileName::GetPathSeparator();
//exe_path = exe_path.BeforeLast(path_separator[0]); //exe_path = exe_path.BeforeLast(path_separator[0]);

View File

@ -197,6 +197,12 @@ private:
int resourceUnderMouse; int resourceUnderMouse;
int objectUnderMouse; int objectUnderMouse;
bool randomWithReset;
int randomMinimumHeight;
int randomMaximumHeight;
int randomChanceDevider;
int randomRecursions;
ChangeType enabledGroup; ChangeType enabledGroup;
string fileName; string fileName;

View File

@ -144,21 +144,24 @@ void UndoPoint::revert() {
MapPreview *Program::map = NULL; MapPreview *Program::map = NULL;
Program::Program(int w, int h) { Program::Program(int w, int h, string playerName) {
cellSize = 6; cellSize = 5;
grid=false; grid=false;
heightmap=false; heightmap=false;
hideWater=false; hideWater=false;
ofsetX = 0; ofsetX = 0;
ofsetY = 0; ofsetY = 0;
map = new MapPreview(); map = new MapPreview();
resetFactions(8);
renderer.initMapSurface(w, h); renderer.initMapSurface(w, h);
map->setAuthor(playerName);
} }
void Program::init() { void Program::init() {
undoStack = ChangeStack(); undoStack = ChangeStack();
redoStack = ChangeStack(); redoStack = ChangeStack();
cellSize = 6; cellSize = 5;
grid=false; grid=false;
heightmap=false; heightmap=false;
hideWater=false; hideWater=false;
@ -557,12 +560,12 @@ void Program::shiftDown() {
} }
void Program::randomizeMapHeights() { void Program::randomizeMapHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions) {
if(map) map->randomizeHeights(); if(map) map->randomizeHeights(withReset, minimumHeight, maximumHeight, chanceDevider, smoothRecursions);
} }
void Program::randomizeMap() { void Program::randomizeFactions() {
if(map) map->randomize(); if(map) map->randomizeFactions();
} }
void Program::switchMapSurfaces(int surf1, int surf2) { void Program::switchMapSurfaces(int surf1, int surf2) {
@ -581,6 +584,7 @@ void Program::resize(int w, int h, int alt, int surf) {
void Program::resetFactions(int maxFactions) { void Program::resetFactions(int maxFactions) {
if(map) map->resetFactions(maxFactions); if(map) map->resetFactions(maxFactions);
randomizeFactions();
} }
bool Program::setMapTitle(const string &title) { bool Program::setMapTitle(const string &title) {
@ -634,7 +638,7 @@ void Program::incCellSize(int i) {
void Program::resetOfset() { void Program::resetOfset() {
ofsetX = 0; ofsetX = 0;
ofsetY = 0; ofsetY = 0;
cellSize = 6; cellSize = 5;
} }
bool Program::setGridOnOff() { bool Program::setGridOnOff() {

View File

@ -103,12 +103,11 @@ private:
//static Map *map; //static Map *map;
static MapPreview *map; static MapPreview *map;
friend class UndoPoint; friend class UndoPoint;
ChangeStack undoStack, redoStack; ChangeStack undoStack, redoStack;
void init(); void init();
public: public:
Program(int w, int h); Program(int w, int h, string playerName);
~Program(); ~Program();
Program(const Program& obj) { Program(const Program& obj) {
@ -152,8 +151,8 @@ public:
void shiftUp(); void shiftUp();
void shiftDown(); void shiftDown();
void randomizeMapHeights(); void randomizeMapHeights(bool withReset, int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions);;
void randomizeMap(); void randomizeFactions();
void switchMapSurfaces(int surf1, int surf2); void switchMapSurfaces(int surf1, int surf2);
void loadMap(const string &path); void loadMap(const string &path);
void saveMap(const string &path); void saveMap(const string &path);

View File

@ -17,10 +17,11 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER OR BUILD_MEGAGLEST_MAP_EDITOR OR BUILD_MEGAGLEST
INCLUDE (CheckIncludeFiles) INCLUDE (CheckIncludeFiles)
#Game options #Game options
option(ENABLE_FRIBIDI "Enable FriBIDi support" ON) option(WANT_STATIC_LIBS "builds as many static libs as possible" OFF)
option(FORCE_LUA_5_1 "Force looking for LUA 5.1" OFF) option(ENABLE_FRIBIDI "Enable FriBIDi support" ON)
option(FORCE_LUA_5_2 "Force looking for LUA 5.2" OFF) option(FORCE_LUA_5_1 "Force looking for LUA 5.1" OFF)
option(FORCE_LUA_5_2 "Force looking for LUA 5.2" OFF)
IF(WIN32) IF(WIN32)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
@ -115,10 +116,14 @@ option(FORCE_LUA_5_2 "Force looking for LUA 5.2" OFF)
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS}) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${LUA_LIBRARIES} ${CMAKE_DL_LIBS})
ENDIF() ENDIF()
OPTION(WANT_STATIC_LIBS "builds as many static libs as possible" OFF)
IF(WANT_STATIC_LIBS) IF(WANT_STATIC_LIBS)
SET(JPEG_NAMES libjpeg.a ${JPEG_NAMES}) OPTION(JPEG_STATIC "Set to ON to link your project with static library (instead of DLL)." ON)
OPTION(PNG_STATIC "Set to ON to link your project with static library (instead of DLL)." ON)
ENDIF()
IF(JPEG_STATIC)
SET(JPEG_NAMES libjpeg.a ${JPEG_NAMES})
ELSE()
SET(JPEG_NAMES libjpeg ${JPEG_NAMES})
ENDIF() ENDIF()
FIND_PACKAGE(JPEG REQUIRED) FIND_PACKAGE(JPEG REQUIRED)
@ -127,8 +132,10 @@ option(FORCE_LUA_5_2 "Force looking for LUA 5.2" OFF)
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${JPEG_LIBRARY}) SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${JPEG_LIBRARY})
ENDIF() ENDIF()
IF(WANT_STATIC_LIBS) IF(PNG_STATIC)
SET(PNG_NAMES libpng.a ${PNG_NAMES}) SET(PNG_NAMES libpng.a ${PNG_NAMES})
ELSE()
SET(PNG_NAMES libpng ${PNG_NAMES})
ENDIF() ENDIF()
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
@ -455,7 +462,7 @@ option(FORCE_LUA_5_2 "Force looking for LUA 5.2" OFF)
IF(NOT WIN32) IF(NOT WIN32)
ADD_LIBRARY(${TARGET_NAME} STATIC ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES}) ADD_LIBRARY(${TARGET_NAME} STATIC ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES})
MESSAGE(STATUS "Building shared game library as a STATIC library and saving to [${LIBRARY_OUTPUT_PATH}]") #MESSAGE(STATUS "Building shared game library as a STATIC library and saving to [${LIBRARY_OUTPUT_PATH}]")
ELSE() ELSE()
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game) SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game)
ADD_LIBRARY(${TARGET_NAME} STATIC ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES}) ADD_LIBRARY(${TARGET_NAME} STATIC ${MG_SOURCE_FILES} ${MG_INCLUDE_FILES})

View File

@ -207,16 +207,16 @@ public:
void reset(int w, int h, float alt, MapSurfaceType surf); void reset(int w, int h, float alt, MapSurfaceType surf);
void resize(int w, int h, float alt, MapSurfaceType surf); void resize(int w, int h, float alt, MapSurfaceType surf);
void resetFactions(int maxFactions); void resetFactions(int maxFactions);
void randomizeHeights(); void randomizeHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions);
void randomize(); void randomizeFactions();
void smoothSurface(bool limitHeights);
void switchSurfaces(MapSurfaceType surf1, MapSurfaceType surf2); void switchSurfaces(MapSurfaceType surf1, MapSurfaceType surf2);
void loadFromFile(const string &path); void loadFromFile(const string &path);
void saveToFile(const string &path); void saveToFile(const string &path);
void resetHeights(int height); void resetHeights(int height);
void sinRandomize(int strenght); void realRandomize(int minimumHeight, int maximumHeight, int chanceDivider, int smoothRecursions);
void decalRandomize(int strenght);
void applyNewHeight(float newHeight, int x, int y, int strenght); void applyNewHeight(float newHeight, int x, int y, int strenght);
bool hasFileLoaded() const {return fileLoaded;} bool hasFileLoaded() const {return fileLoaded;}

View File

@ -704,17 +704,13 @@ void MapPreview::setAdvanced(int heightFactor, int waterLevel, int cliffLevel, i
hasChanged = true; hasChanged = true;
} }
void MapPreview::randomizeHeights() { void MapPreview::randomizeHeights(bool withReset,int minimumHeight, int maximumHeight, int chanceDevider, int smoothRecursions) {
resetHeights(random.randRange(8, 10)); if(withReset) resetHeights(random.randRange(8, 10));
sinRandomize(0); realRandomize(minimumHeight,maximumHeight,chanceDevider,smoothRecursions);
decalRandomize(4);
sinRandomize(1);
hasChanged = true; hasChanged = true;
} }
void MapPreview::randomize() { void MapPreview::randomizeFactions() {
randomizeHeights();
int slPlaceFactorX = random.randRange(0, 1); int slPlaceFactorX = random.randRange(0, 1);
int slPlaceFactorY = random.randRange(0, 1) * 2; int slPlaceFactorY = random.randRange(0, 1) * 2;
@ -729,6 +725,40 @@ void MapPreview::randomize() {
hasChanged = true; hasChanged = true;
} }
void MapPreview::smoothSurface(bool limitHeight) {
float *oldHeights = new float[w*h];
for (int i = 0; i < w; ++i) {
for (int j = 0; j < h; ++j) {
oldHeights[i*w+j] = cells[i][j].height;
//printf("count=%d height=%f h=%f\n",i*w+h,oldHeights[i*w+h],cells[i][j].height);
}
}
for (int i = 1; i < w - 1; ++i) {
for (int j = 1; j < h - 1; ++j) {
float height = 0.f;
float numUsedToSmooth = 0.f;
for (int k = -1; k <= 1; ++k) {
for (int l = -1; l <= 1; ++l) {
int tmpHeight=oldHeights[(j + k) * w + (i + l)];
if(limitHeight && tmpHeight>20){
tmpHeight=20;
}
if(limitHeight && tmpHeight<0){
tmpHeight=0;
}
height += tmpHeight;
numUsedToSmooth++;
}
}
height /= numUsedToSmooth;
cells[i][j].height=height;
}
}
delete[] oldHeights;
}
void MapPreview::switchSurfaces(MapSurfaceType surf1, MapSurfaceType surf2) { void MapPreview::switchSurfaces(MapSurfaceType surf1, MapSurfaceType surf2) {
if (surf1 >= st_Grass && surf1 <= st_Ground && surf2 >= st_Grass && surf2 <= st_Ground) { if (surf1 >= st_Grass && surf1 <= st_Ground && surf2 >= st_Grass && surf2 <= st_Ground) {
for (int i = 0; i < w; ++i) { for (int i = 0; i < w; ++i) {
@ -986,52 +1016,32 @@ void MapPreview::resetHeights(int height) {
} }
} }
void MapPreview::sinRandomize(int strenght) { void MapPreview::realRandomize(int minimumHeight, int maximumHeight, int _chanceDevider, int _smoothRecursions) {
float sinH1 = random.randRange(5.f, 40.f); int moduloParam=abs(maximumHeight-minimumHeight);
float sinH2 = random.randRange(5.f, 40.f); int chanceDevider=_chanceDevider;
float sinV1 = random.randRange(5.f, 40.f); int smoothRecursions=_smoothRecursions;
float sinV2 = random.randRange(5.f, 40.f); if(moduloParam<2) moduloParam=2;
float ah = static_cast<float>(10 + random.randRange(-2, 2)); //printf("moduloParam=%d minimumHeight=%d maximumHeight=%d\n",moduloParam,minimumHeight,maximumHeight);
float bh = static_cast<float>((maxHeight - minHeight)) / static_cast<float>(random.randRange(2, 3));
float av = static_cast<float>(10 + random.randRange(-2, 2));
float bv = static_cast<float>((maxHeight - minHeight)) / static_cast<float>(random.randRange(2, 3));
for (int i = 0; i < w; ++i) { // set chanceDevider to something possible
for (int j = 0; j < h; ++j) { if(chanceDevider<2) chanceDevider=2;
float normH = static_cast<float>(i) / w;
float normV = static_cast<float>(j) / h;
#ifdef USE_STREFLOP // set smoothRecursions to something useful
float sh = (streflop::sinf(static_cast<streflop::Simple>(normH * sinH1)) + streflop::sin(static_cast<streflop::Simple>(normH * sinH2))) / 2.f; if(smoothRecursions<0) smoothRecursions=0;
float sv = (streflop::sinf(static_cast<streflop::Simple>(normV * sinV1)) + streflop::sin(static_cast<streflop::Simple>(normV * sinV2))) / 2.f; if(smoothRecursions>1000) smoothRecursions=1000;
#else
float sh = (sinf(normH * sinH1) + sin(normH * sinH2)) / 2.f; for (int i = 1; i < w-1; ++i) {
float sv = (sinf(normV * sinV1) + sin(normV * sinV2)) / 2.f; for (int j = 1; j < h-1; ++j) {
#endif if(rand()%chanceDevider==1){
float newHeight = (ah + bh * sh + av + bv * sv) / 2.f; cells[i][j].height=(rand() % moduloParam)+minimumHeight;
applyNewHeight(newHeight, i, j, strenght); }
} }
} }
} for( int i = 0; i<smoothRecursions;++i){
if(i+1==smoothRecursions)
void MapPreview::decalRandomize(int strenght) { smoothSurface(true);
//first row else
int lastHeight = DEFAULT_MAP_CELL_HEIGHT; smoothSurface(false);
for (int i = 0; i < w; ++i) {
lastHeight += random.randRange(-1, 1);
lastHeight = clamp(lastHeight, minHeight, maxHeight);
applyNewHeight(static_cast<float>(lastHeight), i, 0, strenght);
}
//other rows
for (int j = 1; j < h; ++j) {
int height = static_cast<int>(cells[0][j-1].height + random.randRange(-1, 1));
applyNewHeight(static_cast<float>(clamp(height, minHeight, maxHeight)), 0, j, strenght);
for (int i = 1; i < w; ++i) {
height = static_cast<int>((cells[i][j-1].height + cells[i-1][j].height) / 2.f + random.randRange(-1, 1));
float newHeight = static_cast<float>(clamp(height, minHeight, maxHeight));
applyNewHeight(newHeight, i, j, strenght);
}
} }
} }

View File

@ -140,13 +140,15 @@ IF(BUILD_MEGAGLEST_TESTS)
SET_SOURCE_FILES_PROPERTIES(${MG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1) SET_SOURCE_FILES_PROPERTIES(${MG_INCLUDE_FILES} PROPERTIES HEADER_FILE_ONLY 1)
OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF) OPTION(WANT_DEV_OUTPATH "use developer friendly output paths" OFF)
IF(WANT_DEV_OUTPATH) IF(WANT_DEV_OUTPATH)
IF(UNIX AND NOT APPLE) IF(UNIX AND NOT APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/linux/)
ELSE() ELSEIF(UNIX AND APPLE)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/mk/macosx/)
ENDIF() ELSE()
ENDIF() SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/data/glest_game/)
ENDIF()
ENDIF()
MESSAGE(STATUS "EXTERNAL_LIBS = [${EXTERNAL_LIBS}]") MESSAGE(STATUS "EXTERNAL_LIBS = [${EXTERNAL_LIBS}]")
@ -164,19 +166,19 @@ IF(BUILD_MEGAGLEST_TESTS)
ENDIF() ENDIF()
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS}) TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
IF(NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
# Run the unit tests after build
IF(EXISTS ${XVFB_EXEC})
MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} will run tests with it.")
# Run the unit tests after build add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
IF(EXISTS ${XVFB_EXEC}) COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${EXECUTABLE_OUTPUT_PATH}${TARGET_NAME}
MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} will run tests with it.") COMMENT "***-- Found megaglest test runner: ${TARGET_NAME} about to run unit tests via xvfb...")
ELSE()
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${EXECUTABLE_OUTPUT_PATH}${TARGET_NAME} COMMAND ${EXECUTABLE_OUTPUT_PATH}${TARGET_NAME}
COMMENT "***-- Found megaglest test runner: ${TARGET_NAME} about to run unit tests via xvfb...") COMMENT "***-- Found megaglest test runner: ${TARGET_NAME} about to run unit tests...")
ENDIF()
ELSE()
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${EXECUTABLE_OUTPUT_PATH}${TARGET_NAME}
COMMENT "***-- Found megaglest test runner: ${TARGET_NAME} about to run unit tests...")
ENDIF() ENDIF()
ENDIF() ENDIF()

13
source/version.txt Normal file
View File

@ -0,0 +1,13 @@
# How it currently works?
# Set version here (only here) and just start mk/linux/mg-version-synch.sh script.
# Versions will be updated everywhere automatically.
# Then you should commit changed files and that's all.
CurrentGameVersion = "3.12-dev";
# ^ typical version numbers look like this: "3.11-beta1.0", "3.12-dev", "3.12.0"
OldReleaseGameVersion = "3.11.0";
LastCompatibleSaveGameVersion = "3.9.0";
GitCommitForRelease = "5060.7451e49";
# ^ will be automatically generated