Skip to content
Permalink
Browse files

- ported bugfixes to trunk from 3.6.0.3

  • Loading branch information
softcoder committed Jan 24, 2012
2 parents fbf7610 + ebe45d2 commit 12d1885c65cb82d16a87db155dd7f2b8e1b88436
@@ -2,10 +2,11 @@

NUMCORES=`cat /proc/cpuinfo | grep -cE '^processor'`

#PROJECT_SOURCE_DIR="$(dirname $(readlink -f $0))"
mkdir -p build-win32
cd build-win32

cmake -DCMAKE_TOOLCHAIN_FILE=../mk/cmake/Modules/Toolchain-mingw32.cmake -DXERCESC_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/include -DXERCESC_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib -DXERCESC_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib/libxerces-c2_8_0.dll -DOPENAL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854 -DOPENAL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/OpenAL32.dll -DOGG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/libogg-1.2.1/include -DOGG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/libogg.dll -DVORBIS_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/libvorbis.dll -DVORBIS_FILE_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/libvorbisfile.dll -DLUA_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/lua-5.1/src -DLUA_LIBRARIES=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/lua5.1.dll -DJPEG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/jpeg-8b -DJPEG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/libjpeg.dll -DZLIB_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/zlib-1.2.5 -DZLIB_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/libz.a -DPNG_PNG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/lpng141 -DPNG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/libpng.dll -DCURL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/curl-7.21.3/include -DCURL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/libs/libcurl.dll -DSDL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/SDL-1.2.x/include -DCMAKE_INSTALL_PREFIX= -DMINIUPNPC_VERSION_PRE1_6=ON -DWANT_STATIC_LIBS=ON ..
cmake -DCMAKE_TOOLCHAIN_FILE=../mk/cmake/Modules/Toolchain-mingw32.cmake -DXERCESC_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/include -DXERCESC_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib -DXERCESC_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/xerces-c-src_2_8_0/lib/libxerces-c2_8_0.dll -DOPENAL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/openal-soft-1.12.854 -DOPENAL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/OpenAL32.dll -DOGG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/libogg-1.2.1/include -DOGG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libogg.dll -DVORBIS_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libvorbis.dll -DVORBIS_FILE_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libvorbisfile.dll -DLUA_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/lua-5.1/src -DLUA_LIBRARIES=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/lua5.1.dll -DJPEG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/jpeg-8b -DJPEG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libjpeg.dll -DZLIB_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/zlib-1.2.5 -DZLIB_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libz.a -DPNG_PNG_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/lpng141 -DPNG_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libpng.dll -DCURL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/curl-7.21.3/include -DCURL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libcurl.dll -DSDL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/SDL-1.2.x/include -DFREETYPE_INCLUDE_DIR_ft2build=${PROJECT_SOURCE_DIR}/source/win32_deps/freetype-2.4.8/include -DFREETYPE_INCLUDE_DIR_freetype2=${PROJECT_SOURCE_DIR}/source/win32_deps/freetype-2.4.8/include/freetype -DFREETYPE_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libfreetype-6.dll -DFTGL_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/source/win32_deps/ftgl-2.1.3~rc5/src -DFTGL_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/libftgl.a -DGLEW_INCLUDE_PATH=${PROJECT_SOURCE_DIR}/source/win32_deps/glew-1.7.0/include -DGLEW_LIBRARY=${PROJECT_SOURCE_DIR}/source/win32_deps/lib/glew32.dll -DCMAKE_INSTALL_PREFIX= -DWANT_STATIC_LIBS=ON ..

make -j$NUMCORES

@@ -4,10 +4,10 @@
# Written by Mark Vejvoda <mark_vejvoda@hotmail.com>
# Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+

OLD_MG_VERSION=3.6.0.1
OLD_MG_VERSION_BINARY=3.6.0
OLD_MG_VERSION=3.6.0.2
OLD_MG_VERSION_BINARY=3.6.0.2
#MG_VERSION=3.6.1-dev
MG_VERSION=3.6.0.2
MG_VERSION=3.6.0.3

if [ "$1" = "--oldversion" ]; then
echo "$OLD_MG_VERSION"
@@ -2,5 +2,6 @@

rem if not exist ..\..\data\glest_game\dsound.dll copy dsound.dll ..\..\data\glest_game\
if not exist ..\..\data\glest_game\xerces-c_3_0.dll copy ..\..\source\win32_deps\bin\xerces-c_3_0.dll ..\..\data\glest_game\
if not exist ..\..\data\glest_game\openal32.dll copy ..\..\source\win32_deps\bin\openal32.dll ..\..\data\glest_game\

if not "%1" == "nopause" pause
@@ -147,7 +147,7 @@ Config::Config(std::pair<ConfigType,ConfigType> type, std::pair<string,string> f

#if defined(CUSTOM_DATA_INSTALL_PATH)
if(foundPath == false) {
foundPath = tryCustomPath(cfgType, fileName, TOSTRING(CUSTOM_DATA_INSTALL_PATH));
foundPath = tryCustomPath(cfgType, fileName, formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
}
#endif

@@ -2441,7 +2441,7 @@ int glestMain(int argc, char** argv) {


#if defined(CUSTOM_DATA_INSTALL_PATH)
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\n\nCUSTOM_DATA_INSTALL_PATH = [%s]\n\n",TOSTRING(CUSTOM_DATA_INSTALL_PATH));
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("\n\nCUSTOM_DATA_INSTALL_PATH = [%s]\n\n",formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)).c_str());
#endif

const int knownArgCount = sizeof(GAME_ARGS) / sizeof(GAME_ARGS[0]);
@@ -293,6 +293,30 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER OR BUILD_MEGAGLEST_MAP_EDITOR OR BUILD_MEGAGLEST
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${IRCCLIENT_LIBRARY})
endif()

set(CMAKE_REQUIRED_INCLUDES "${IRCCLIENT_INCLUDE_DIR}")
set(CMAKE_REQUIRED_LIBRARIES "${IRCCLIENT_LIBRARY}")
check_cxx_source_runs("
#include <stdio.h>
#include <stdlib.h>
#include <libircclient.h>
int main()
{
unsigned int high = 0;
unsigned int low = 0;
irc_get_version(&high,&low);
if( (high == 1 && low >= 6) || (high > 1)) {
return 0;
}
throw 1;
}"
HAS_LIBIRCCLIENT_1_6)

IF(HAS_LIBIRCCLIENT_1_6)
message(STATUS "Found HAS_LIBIRCCLIENT_1_6: ${HAS_LIBIRCCLIENT_1_6}")
ELSE()
ADD_DEFINITIONS(-DLIBIRCCLIENT_PRE1_6)
ENDIF()

IF(WIN32)
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/socket.cpp)
SET(MG_SOURCE_FILES ${MG_SOURCE_FILES} ${PROJECT_SOURCE_DIR}/source/shared_lib/sources/platform/posix/ircclient.cpp)
@@ -211,6 +211,7 @@ bool EndsWith(const string &str, const string& key);
void endPathWithSlash(string &path, bool requireOSSlash=false);
void trimPathWithStartingSlash(string &path);
void updatePathClimbingParts(string &path);
string formatPath(string path);

string replaceAll(string& context, const string& from, const string& to);
bool removeFile(string file);
@@ -500,6 +500,13 @@ void endPathWithSlash(string &path,bool requireOSSlash) {
}
}

string formatPath(string path) {
replaceAll(path, "\"", "");
replaceAll(path, "//", "/");

return path;
}

void trimPathWithStartingSlash(string &path) {
if(StartsWith(path, "/") == true || StartsWith(path, "\\") == true) {
path.erase(path.begin(),path.begin()+1);
@@ -15,6 +15,11 @@
#include "platform_common.h"
#include "libircclient.h"

// upstream moved some defines into new headers as of 1.6
#ifndef LIBIRCCLIENT_PRE1_6
#include "libirc_rfcnumeric.h"
#endif

#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@@ -79,11 +79,11 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,
#ifndef WIN32
string mg_icon_file = "";
#if defined(CUSTOM_DATA_INSTALL_PATH_VALUE)
if(fileExists(CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.png")) {
mg_icon_file = CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.png";
if(fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.png")) {
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.png";
}
else if(fileExists(CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.bmp")) {
mg_icon_file = CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.bmp";
else if(fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.bmp")) {
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.bmp";
}

#endif
@@ -215,20 +215,15 @@ std::map<string,string> Properties::getTagReplacementValues(std::map<string,stri
mapTagReplacementValues["{APPLICATIONPATH}"] = Properties::applicationPath;

#if defined(CUSTOM_DATA_INSTALL_PATH)
mapTagReplacementValues["$APPLICATIONDATAPATH"] = TOSTRING(CUSTOM_DATA_INSTALL_PATH);
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = TOSTRING(CUSTOM_DATA_INSTALL_PATH);
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = TOSTRING(CUSTOM_DATA_INSTALL_PATH);

//mapTagReplacementValues["$COMMONDATAPATH", string(CUSTOM_DATA_INSTALL_PATH) + "/commondata/");
//mapTagReplacementValues["%%COMMONDATAPATH%%", string(CUSTOM_DATA_INSTALL_PATH) + "/commondata/");
mapTagReplacementValues["$APPLICATIONDATAPATH"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH));

#else
mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationPath;
mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = Properties::applicationPath;
mapTagReplacementValues["{APPLICATIONDATAPATH}"] = Properties::applicationPath;

//mapTagReplacementValues["$COMMONDATAPATH", Properties::applicationPath + "/commondata/");
//mapTagReplacementValues["%%COMMONDATAPATH%%", Properties::applicationPath + "/commondata/");
#endif

mapTagReplacementValues["$GAMEVERSION"] = Properties::gameVersion;
@@ -308,20 +303,15 @@ bool Properties::applyTagsToValue(string &value, std::map<string,string> *mapTag
replaceAll(value, "{APPLICATIONPATH}", Properties::applicationPath);

#if defined(CUSTOM_DATA_INSTALL_PATH)
replaceAll(value, "$APPLICATIONDATAPATH", TOSTRING(CUSTOM_DATA_INSTALL_PATH));
replaceAll(value, "%%APPLICATIONDATAPATH%%", TOSTRING(CUSTOM_DATA_INSTALL_PATH));
replaceAll(value, "{APPLICATIONDATAPATH}", TOSTRING(CUSTOM_DATA_INSTALL_PATH));

//replaceAll(value, "$COMMONDATAPATH", string(CUSTOM_DATA_INSTALL_PATH) + "/commondata/");
//replaceAll(value, "%%COMMONDATAPATH%%", string(CUSTOM_DATA_INSTALL_PATH) + "/commondata/");
replaceAll(value, "$APPLICATIONDATAPATH", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
replaceAll(value, "%%APPLICATIONDATAPATH%%", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));
replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH)));

#else
replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationPath);
replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationPath);
replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationPath);

//replaceAll(value, "$COMMONDATAPATH", Properties::applicationPath + "/commondata/");
//replaceAll(value, "%%COMMONDATAPATH%%", Properties::applicationPath + "/commondata/");
#endif

replaceAll(value, "$GAMEVERSION", Properties::gameVersion);

0 comments on commit 12d1885

Please sign in to comment.
You can’t perform that action at this time.