# HG changeset patch # User unc0rr # Date 1353874194 -14400 # Node ID 5bfa1b2025d6b133fcf3c895ace0fe9a395b8905 # Parent 861d145b270e63b1cecaa2804b16ebee80d454d8# Parent 499151efdd72a3b87bf3f3a4a2f1ec2f8d03aad2 Merge from default to have recent fixes diff -r 861d145b270e -r 5bfa1b2025d6 .hgignore --- a/.hgignore Mon Nov 26 00:06:42 2012 +0400 +++ b/.hgignore Mon Nov 26 00:09:54 2012 +0400 @@ -30,6 +30,7 @@ glob:misc/liblua/Xcode/build/ glob:misc/libfreetype/Xcode/build/ glob:misc/libfreetype/Xcode-iOS/build/ +glob:misc/physfs/Xcode/build/ glob:moc_*.cxx_parameters relre:^release\/ glob:*.log diff -r 861d145b270e -r 5bfa1b2025d6 CMakeLists.txt --- a/CMakeLists.txt Mon Nov 26 00:06:42 2012 +0400 +++ b/CMakeLists.txt Mon Nov 26 00:09:54 2012 +0400 @@ -1,8 +1,7 @@ project(hedgewars) #initialise cmake environment -cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) -cmake_policy(VERSION 2.6) +cmake_minimum_required(VERSION 2.6.0) FOREACH(hwpolicy CMP0003 CMP0012 CMP0017) IF(POLICY ${hwpolicy}) CMAKE_POLICY(SET ${hwpolicy} NEW) @@ -11,9 +10,11 @@ #use available modules, fallback to ours if not present (CMP0017 helps) set(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") -#set some default values -option(NOREVISION "Build Hedgewars without revision information" OFF) +#usually this is set at release time +option(NOREVISION "Build Hedgewars without revision information [default: off]" OFF) + +#set other default values option(NOSERVER "Disable gameServer build [default: auto]" OFF) option(NOPNG "Disable screenshoot compression [default: auto]" OFF) option(NOVIDEOREC "Disable video recording [default: auto]" OFF) @@ -24,6 +25,7 @@ option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF) option(MINIMAL_FLAGS "Respect system flags as much as possible [default: off]" OFF) + #detect Mercurial revision (if present) IF(NOT NOREVISION) set(default_build_type "DEBUG") @@ -44,7 +46,7 @@ MESSAGE(STATUS "Building revision ${revision_number} from hash ${revision_hash} ${HGCHANGED}") IF(HGCHANGED) - MESSAGE(WARNING "You have uncommitted changes") + MESSAGE(WARNING "Notice: you have uncommitted changes in your repository") ENDIF() set(version_suffix "-${revision_number}${HGCHANGED}") ENDIF() @@ -71,7 +73,6 @@ set(CMAKE_INSTALL_PREFIX ${bundle_name}/Contents/MacOS/) set(DATA_INSTALL_DIR "../Resources/") set(target_dir ".") - set(minimum_macosx_version "10.6") else() set(target_dir "bin") endif() @@ -85,12 +86,15 @@ #detect on which system we are: if sw_vers cannot be found for any reason (re)use minimum_macosx_version find_program(sw_vers sw_vers) if(sw_vers) - execute_process(COMMAND ${sw_vers} "-productVersion" OUTPUT_VARIABLE current_macosx_version) + execute_process(COMMAND ${sw_vers} "-productVersion" + OUTPUT_VARIABLE current_macosx_version + OUTPUT_STRIP_TRAILING_WHITESPACE) string(REGEX REPLACE "([0-9]+.[0-9]+).[0-9]+" "\\1" current_macosx_version ${current_macosx_version}) - else() + else() if(NOT minimum_macosx_version) message(FATAL_ERROR "sw_vers not found! Need explicit MACOSX_DEPLOYMENT_TARGET variable set") else() + message(WARNING "sw_vers not found! Fallback to MACOSX_DEPLOYMENT_TARGET variable") set(current_macosx_version ${minimum_macosx_version}) endif() endif() @@ -100,7 +104,7 @@ set(minimum_macosx_version ${current_macosx_version}) endif() - #lower systems don't have enough processing power anyways + #lower systems don't have enough processing power anyway if (minimum_macosx_version LESS "10.4") message(FATAL_ERROR "Hedgewars is not supported on Mac OS X pre-10.4") endif() @@ -145,8 +149,8 @@ #set deployment target set(pascal_flags "-k-macosx_version_min" "-k${minimum_macosx_version}" "-XR${CMAKE_OSX_SYSROOT}" ${pascal_flags}) - message(STATUS "Build system: Mac OS X ${current_macosx_version} with GCC:${CMAKE_C_COMPILER}") - message(STATUS "Target system: Mac OS X ${minimum_macosx_version} for architecture(s):${CMAKE_OSX_ARCHITECTURES}") + message(STATUS "Build system: Mac OS X ${current_macosx_version} with C compiler: ${CMAKE_C_COMPILER}") + message(STATUS "Target system: Mac OS X ${minimum_macosx_version} for architecture(s): ${CMAKE_OSX_ARCHITECTURES}") endif(APPLE) @@ -230,7 +234,7 @@ add_subdirectory(gameServer) message(STATUS "Found GHC: ${ghc_executable}") else() - message(STATUS "Could NOT find GHC, server will not be built") + message(WARNING "Could NOT find GHC, server will not be built") set(HAVE_NETSERVER false) endif() else() @@ -246,7 +250,7 @@ else() message(STATUS "LUA will be provided by the bundled sources") add_subdirectory(misc/liblua) - #linking with liblua.a requires system readline -- this works everywhere, right? + #linking with liblua.a requires system readline set(pascal_flags "-k${EXECUTABLE_OUTPUT_PATH}/lib${LUA_LIBRARY}.a" "-k-lreadline" ${pascal_flags}) endif() @@ -254,10 +258,10 @@ #main engine add_subdirectory(hedgewars) -# physfs library +#physfs library add_subdirectory(misc/physfs) -# frontend library +#frontend library add_subdirectory(project_files/frontlib) #Android related build scripts diff -r 861d145b270e -r 5bfa1b2025d6 INSTALL --- a/INSTALL Mon Nov 26 00:06:42 2012 +0400 +++ b/INSTALL Mon Nov 26 00:09:54 2012 +0400 @@ -1,13 +1,14 @@ To compile and install you need: - - Qt >= 4.5 - - FreePascal >= 2.2.4 + - CMake >= 2.6.0 + - FreePascal >= 2.2.0 + - Qt >= 4.5.0 - SDL >= 1.2.5 - SDL_net >= 1.2.5 - SDL_mixer >= 1.2 - SDL_image >= 1.2 - SDL_ttf >= 2.0 - - CMake >= 2.6.0 - Lua >= 5.1.0 + - Physfs >= 2.0 For server: - Glasgow Haskell Compiler >= 6.10 - bytestring-show package @@ -16,6 +17,11 @@ For videorecording: - FFmpeg or LibAV - GLUT (when SDL < 2) +For compressed screenshots: + - libpng + +Lua and Physfs will be automatically built if not found. + 1. Configure: $ cmake . @@ -23,8 +29,12 @@ $ cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="install_prefix" \ -DDATA_INSTALL_DIR="data_dir" -DNOSERVER=1 . -add -DNOSERVER=0 to compile net server; if you have Qt installed but it is -not found you can set it up with -DQT_QMAKE_EXECUTABLE="path_to_qmake" +Add -DNOSERVER=0 to compile net server (remember to check out the additional +dependencies with the hedgewars-server.cabal configuration file. If you have +Qt installed but it is not found, you can set it up with +-DQT_QMAKE_EXECUTABLE="path_to_qmake". +To get a glimpse of the main configuration options, you may use this command +`cat CMakeLists.txt | grep option` 2. Compile: $ make @@ -34,3 +44,4 @@ That's all! Enjoy! + diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/CMakeLists.txt Mon Nov 26 00:09:54 2012 +0400 @@ -164,8 +164,13 @@ link_directories(${EXECUTABLE_OUTPUT_PATH}) endif() +#when debugging, always prompt a console to see fronted messages +#TODO: check it doesn't interfere on UNIX +if(CMAKE_BUILD_TYPE MATCHES "RELEASE") + set(console_access "WIN32") +endif(CMAKE_BUILD_TYPE MATCHES "RELEASE") -add_executable(hedgewars WIN32 +add_executable(hedgewars ${console_access} ${hwfr_src} ${hwfr_moc_srcs} ${hwfr_hdrs} diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/gameuiconfig.cpp --- a/QTfrontend/gameuiconfig.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/gameuiconfig.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -44,10 +44,12 @@ GameUIConfig::GameUIConfig(HWForm * FormWidgets, const QString & fileName) - : QSettings(fileName, QSettings::IniFormat) + : QSettings(fileName, QSettings::IniFormat, FormWidgets) { Form = FormWidgets; + setIniCodec("UTF-8"); + connect(Form->ui.pageOptions->CBEnableFrontendMusic, SIGNAL(toggled(bool)), Form, SLOT(Music(bool))); //Form->resize(value("frontend/width", 640).toUInt(), value("frontend/height", 450).toUInt()); @@ -77,7 +79,7 @@ Form->ui.pageOptions->SLQuality->setValue(value("video/quality", 5).toUInt()); Form->ui.pageOptions->CBStereoMode->setCurrentIndex(value("video/stereo", 0).toUInt()); - Form->ui.pageOptions->CBEnableFrontendSound->setChecked(value("frontend/effects", true).toBool()); + Form->ui.pageOptions->CBFrontendEffects->setChecked(value("frontend/effects", true).toBool()); Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool()); Form->ui.pageOptions->CBEnableFrontendSound->setChecked(value("frontend/sound", true).toBool()); Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool()); @@ -96,7 +98,7 @@ if (savePwd == false) { Form->ui.pageOptions->editNetPassword->setEnabled(savePwd); Form->ui.pageOptions->editNetPassword->setText(""); - setNetPasswordLength(0); + setNetPasswordLength(0); } delete netHost; diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/hwform.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -127,7 +127,7 @@ #ifdef USE_XFIRE xfire_init(); #endif - gameSettings = new QSettings(cfgdir->absolutePath() + "/hedgewars.ini", QSettings::IniFormat); + gameSettings = new QSettings("physfs://hedgewars.ini", QSettings::IniFormat); frontendEffects = gameSettings->value("frontend/effects", true).toBool(); playerHash = QString(QCryptographicHash::hash(gameSettings->value("net/nick","").toString().toUtf8(), QCryptographicHash::Md5).toHex()); @@ -139,7 +139,7 @@ ui.pageOptions->CBResolution->addItems(SDLInteraction::instance().getResolutions()); - config = new GameUIConfig(this, cfgdir->absolutePath() + "/hedgewars.ini"); + config = new GameUIConfig(this, "physfs://hedgewars.ini"); ui.pageVideos->init(config); @@ -636,8 +636,8 @@ /* if (id == ID_PAGE_DRAWMAP || id == ID_PAGE_GAMESTATS) stopAnim = true; - This were disabled due to broken flake animations. I believe the more general problems w/ opacity that forced its disable makes blocking these - unnecessary. + This were disabled due to broken flake animations. I believe the more general problems w/ opacity that forced its disable makes blocking these + unnecessary. */ #if (QT_VERSION >= 0x040600) @@ -695,8 +695,8 @@ animationOldSlide->start(QAbstractAnimation::DeleteWhenStopped); animationNewSlide->start(QAbstractAnimation::DeleteWhenStopped); - /* this is for the situation when the animation below is interrupted by a new animation. For some reason, finished is not being fired */ - for(int i=0;iwidget(i)->hide(); + /* this is for the situation when the animation below is interrupted by a new animation. For some reason, finished is not being fired */ + for(int i=0;iwidget(i)->hide(); } #endif } diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/main.cpp --- a/QTfrontend/main.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/main.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -228,13 +228,13 @@ // setup PhysFS engine.mount(datadir->absolutePath()); engine.mount(cfgdir->absolutePath() + "/Data"); - engine.mount(cfgdir->absolutePath(), "/config"); + engine.mount(cfgdir->absolutePath()); engine.setWriteDir(cfgdir->absolutePath()); engine.mountPacks(); QTranslator Translator; { - QSettings settings("physfs://config/hedgewars.ini", QSettings::IniFormat); + QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat); QString cc = settings.value("misc/locale", QString()).toString(); if(cc.isEmpty()) cc = QLocale::system().name(); diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/team.cpp --- a/QTfrontend/team.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/team.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -162,14 +162,14 @@ if(m_team) flib_team_destroy(m_team); - m_team = flib_team_from_ini(QString("/config/Teams/%1.hwt").arg(name).toUtf8().data()); + m_team = flib_team_from_ini(QString("/Teams/%1.hwt").arg(name).toUtf8().data()); return m_team != NULL; } bool HWTeam::fileExists() { - QFile f(QString("physfs://config/Teams/%1.hwt").arg(name())); + QFile f(QString("physfs://Teams/%1.hwt").arg(name())); return f.exists(); } @@ -178,7 +178,7 @@ if(m_team->remoteDriven) return false; - QFile cfgfile(QString("physfs://config/Teams/%1.hwt").arg(name())); + QFile cfgfile(QString("physfs://Teams/%1.hwt").arg(name())); cfgfile.remove(); return true; } @@ -187,12 +187,12 @@ { if (m_oldTeamName != name()) { - QFile cfgfile(QString("physfs://config/Teams/%1.hwt").arg(m_oldTeamName)); + QFile cfgfile(QString("physfs://Teams/%1.hwt").arg(m_oldTeamName)); cfgfile.remove(); m_oldTeamName = name(); } - return flib_team_to_ini(QString("physfs://config/Teams/%1.hwt").arg(name()).toUtf8(), m_team) == 0; + return flib_team_to_ini(QString("physfs://Teams/%1.hwt").arg(name()).toUtf8(), m_team) == 0; } diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/ui/page/pageoptions.cpp --- a/QTfrontend/ui/page/pageoptions.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/ui/page/pageoptions.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -191,11 +191,7 @@ // List of installed languages CBLanguage = new QComboBox(groupMisc); - QDir tmpdir; - tmpdir.cd(cfgdir->absolutePath()); - tmpdir.cd("Data/Locale"); - tmpdir.setFilter(QDir::Files); - QStringList locs = tmpdir.entryList(QStringList("hedgewars_*.qm")); + QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm")); CBLanguage->addItem(QComboBox::tr("(System default)"), QString("")); for(int i = 0; i < locs.count(); i++) { @@ -203,17 +199,6 @@ CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name()); } - tmpdir.cd(datadir->absolutePath()); - tmpdir.cd("Locale"); - tmpdir.setFilter(QDir::Files); - QStringList tmplist = tmpdir.entryList(QStringList("hedgewars_*.qm")); - for(int i = 0; i < tmplist.count(); i++) - { - if (locs.contains(tmplist[i])) continue; - QLocale loc(tmplist[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1")); - CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name()); - } - MiscLayout->addWidget(CBLanguage, 0, 1); // Label and field for net nick diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/ui/page/pagetraining.cpp --- a/QTfrontend/ui/page/pagetraining.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/ui/page/pagetraining.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -118,7 +118,7 @@ DataManager & dataMgr = DataManager::instance(); // get locale - QSettings settings(cfgdir->absolutePath() + "/hedgewars.ini", + QSettings settings("physfs://hedgewars.ini", QSettings::IniFormat); QString loc = settings.value("misc/locale", "").toString(); diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/util/FileEngine.cpp --- a/QTfrontend/util/FileEngine.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/util/FileEngine.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -9,8 +9,9 @@ const QString FileEngineHandler::scheme = "physfs:/"; FileEngine::FileEngine(const QString& filename) -: _handler(NULL) -, _flags(0) + : m_handle(NULL) + , m_flags(0) + , m_bufferSet(false) { setFileName(filename); } @@ -25,24 +26,24 @@ close(); if (openMode & QIODevice::WriteOnly) { - _handler = PHYSFS_openWrite(_filename.toUtf8().constData()); - _flags = QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::FileType; + m_handle = PHYSFS_openWrite(m_fileName.toUtf8().constData()); + m_flags = QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::FileType; } else if (openMode & QIODevice::ReadOnly) { - _handler = PHYSFS_openRead(_filename.toUtf8().constData()); + m_handle = PHYSFS_openRead(m_fileName.toUtf8().constData()); } else if (openMode & QIODevice::Append) { - _handler = PHYSFS_openAppend(_filename.toUtf8().constData()); + m_handle = PHYSFS_openAppend(m_fileName.toUtf8().constData()); } else { - qWarning("Bad file open mode: %d", (int)openMode); + qWarning("[PHYSFS] Bad file open mode: %d", (int)openMode); } - if (!_handler) { - qWarning("Failed to open %s, reason: %s", _filename.toUtf8().constData(), PHYSFS_getLastError()); + if (!m_handle) { + qWarning("[PHYSFS] Failed to open %s, reason: %s", m_fileName.toUtf8().constData(), PHYSFS_getLastError()); return false; } @@ -52,8 +53,8 @@ bool FileEngine::close() { if (isOpened()) { - int result = PHYSFS_close(_handler); - _handler = NULL; + int result = PHYSFS_close(m_handle); + m_handle = NULL; return result != 0; } @@ -62,22 +63,22 @@ bool FileEngine::flush() { - return PHYSFS_flush(_handler) != 0; + return PHYSFS_flush(m_handle) != 0; } qint64 FileEngine::size() const { - return _size; + return m_size; } qint64 FileEngine::pos() const { - return PHYSFS_tell(_handler); + return PHYSFS_tell(m_handle); } bool FileEngine::seek(qint64 pos) { - return PHYSFS_seek(_handler, pos) != 0; + return PHYSFS_seek(m_handle, pos) != 0; } bool FileEngine::isSequential() const @@ -87,7 +88,7 @@ bool FileEngine::remove() { - return PHYSFS_delete(_filename.toUtf8().constData()) != 0; + return PHYSFS_delete(m_fileName.toUtf8().constData()) != 0; } bool FileEngine::mkdir(const QString &dirName, bool createParentDirectories) const @@ -123,7 +124,7 @@ QString file; QStringList result; - char **files = PHYSFS_enumerateFiles(_filename.toUtf8().constData()); + char **files = PHYSFS_enumerateFiles(m_fileName.toUtf8().constData()); for (char **i = files; *i != NULL; i++) { file = QString::fromUtf8(*i); @@ -140,7 +141,7 @@ QAbstractFileEngine::FileFlags FileEngine::fileFlags(FileFlags type) const { - return type & _flags; + return type & m_flags; } QString FileEngine::fileName(FileName file) const @@ -154,15 +155,15 @@ } case QAbstractFileEngine::BaseName: { - int l = _filename.lastIndexOf('/'); - QString s = _filename.mid(l + 1); + int l = m_fileName.lastIndexOf('/'); + QString s = m_fileName.mid(l + 1); return s; } case QAbstractFileEngine::DefaultName: case QAbstractFileEngine::AbsoluteName: default: { - QString s = "physfs:/" + _filename; + QString s = "physfs:/" + m_fileName; return s; } } @@ -175,7 +176,7 @@ { case QAbstractFileEngine::ModificationTime: default: - return _datetime; + return m_date; break; }; } @@ -183,29 +184,29 @@ void FileEngine::setFileName(const QString &file) { if(file.startsWith(FileEngineHandler::scheme)) - _filename = file.mid(FileEngineHandler::scheme.size()); + m_fileName = file.mid(FileEngineHandler::scheme.size()); else - _filename = file; + m_fileName = file; PHYSFS_Stat stat; - if (PHYSFS_stat(_filename.toUtf8().constData(), &stat) != 0) { - _size = stat.filesize; - _datetime = QDateTime::fromTime_t(stat.modtime); + if (PHYSFS_stat(m_fileName.toUtf8().constData(), &stat) != 0) { + m_size = stat.filesize; + m_date = QDateTime::fromTime_t(stat.modtime); // _flags |= QAbstractFileEngine::WriteUserPerm; - _flags |= QAbstractFileEngine::ReadUserPerm; - _flags |= QAbstractFileEngine::ExistsFlag; + m_flags |= QAbstractFileEngine::ReadUserPerm; + m_flags |= QAbstractFileEngine::ExistsFlag; switch (stat.filetype) { case PHYSFS_FILETYPE_REGULAR: - _flags |= QAbstractFileEngine::FileType; + m_flags |= QAbstractFileEngine::FileType; break; case PHYSFS_FILETYPE_DIRECTORY: - _flags |= QAbstractFileEngine::DirectoryType; + m_flags |= QAbstractFileEngine::DirectoryType; break; case PHYSFS_FILETYPE_SYMLINK: - _flags |= QAbstractFileEngine::LinkType; + m_flags |= QAbstractFileEngine::LinkType; break; default: ; } @@ -214,22 +215,43 @@ bool FileEngine::atEnd() const { - return PHYSFS_eof(_handler) != 0; + return PHYSFS_eof(m_handle) != 0; } qint64 FileEngine::read(char *data, qint64 maxlen) { - return PHYSFS_readBytes(_handler, data, maxlen); + return PHYSFS_readBytes(m_handle, data, maxlen); +} + +qint64 FileEngine::readLine(char *data, qint64 maxlen) +{ + if(!m_bufferSet) + { + PHYSFS_setBuffer(m_handle, 4096); + m_bufferSet = true; + } + + qint64 bytesRead = 0; + while(PHYSFS_readBytes(m_handle, data, 1) + && maxlen + && (*data == '\n')) + { + ++data; + --maxlen; + ++bytesRead; + } + + return bytesRead; } qint64 FileEngine::write(const char *data, qint64 len) { - return PHYSFS_writeBytes(_handler, data, len); + return PHYSFS_writeBytes(m_handle, data, len); } bool FileEngine::isOpened() const { - return _handler != NULL; + return m_handle != NULL; } QFile::FileError FileEngine::error() const @@ -244,11 +266,13 @@ bool FileEngine::supportsExtension(Extension extension) const { - return extension == QAbstractFileEngine::AtEndExtension; + return + (extension == QAbstractFileEngine::AtEndExtension) + || (extension == QAbstractFileEngine::FastReadLineExtension) + ; } - FileEngineHandler::FileEngineHandler(char *argv0) { PHYSFS_init(argv0); diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/util/FileEngine.h --- a/QTfrontend/util/FileEngine.h Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/util/FileEngine.h Mon Nov 26 00:09:54 2012 +0400 @@ -38,6 +38,7 @@ bool atEnd() const; virtual qint64 read(char *data, qint64 maxlen); + virtual qint64 readLine(char *data, qint64 maxlen); virtual qint64 write(const char *data, qint64 len); bool isOpened() const; @@ -48,11 +49,12 @@ virtual bool supportsExtension(Extension extension) const; private: - PHYSFS_file *_handler; - qint64 _size; - FileFlags _flags; - QString _filename; - QDateTime _datetime; + PHYSFS_file *m_handle; + qint64 m_size; + FileFlags m_flags; + QString m_fileName; + QDateTime m_date; + bool m_bufferSet; }; class FileEngineHandler : public QAbstractFileEngineHandler diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/util/SDLInteraction.cpp --- a/QTfrontend/util/SDLInteraction.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/util/SDLInteraction.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -28,6 +28,8 @@ #include "SDLInteraction.h" +#include "physfsrwops.h" + extern char sdlkeys[1024][2][128]; extern char xb360buttons[][128]; extern char xb360dpad[128]; @@ -193,7 +195,7 @@ { SDLAudioInit(); if (!m_soundMap->contains(soundFile)) - m_soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData())); + m_soundMap->insert(soundFile, Mix_LoadWAV_RW(PHYSFSRWOPS_openRead(soundFile.toLocal8Bit().constData()), 1)); //FIXME: this is a hack, but works as long as we have few concurrent playing sounds if (Mix_Playing(lastchannel) == false) @@ -232,7 +234,7 @@ SDLAudioInit(); if (m_music == NULL) - m_music = Mix_LoadMUS(m_musicTrack.toLocal8Bit().constData()); + m_music = Mix_LoadMUS_RW(PHYSFSRWOPS_openRead(m_musicTrack.toLocal8Bit().constData())); Mix_VolumeMusic(MIX_MAX_VOLUME - 28); Mix_FadeInMusic(m_music, -1, 1750); diff -r 861d145b270e -r 5bfa1b2025d6 QTfrontend/util/namegen.cpp --- a/QTfrontend/util/namegen.cpp Mon Nov 26 00:06:42 2012 +0400 +++ b/QTfrontend/util/namegen.cpp Mon Nov 26 00:09:54 2012 +0400 @@ -117,22 +117,21 @@ QStringList list; // find .txt to load the names from - QFile * file = new QFile(QString("physfs://Names/%1.txt").arg(filename)); + QFile file(QString("physfs://Names/%1.txt").arg(filename)); - if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text)) + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QTextStream in(file); - while (!in.atEnd()) + QTextStream in(&file); + QString line; + do { - QString line = in.readLine(); + line = in.readLine(); + if(!line.isEmpty()) list.append(line); - } + } while (!line.isNull()); } - // this QFile isn't needed any further - delete file; - if (list.size() == 0) list.append(filename); @@ -145,22 +144,21 @@ QStringList list; // find .cfg to load the dicts from - QFile * file = new QFile(QString("physfs://Names/%1.cfg").arg(hatname)); + QFile file(QString("physfs://Names/%1.cfg").arg(hatname)); - if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text)) + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { - QTextStream in(file); - while (!in.atEnd()) + QTextStream in(&file); + QString line; + do { - QString line = in.readLine(); + line = in.readLine(); + if(!line.isEmpty()) list.append(line); - } + } while (!line.isNull()); } - // this QFile isn't needed any further - delete file; - if (list.size() == 0) list.append(QString("generic")); diff -r 861d145b270e -r 5bfa1b2025d6 README --- a/README Mon Nov 26 00:06:42 2012 +0400 +++ b/README Mon Nov 26 00:09:54 2012 +0400 @@ -5,3 +5,10 @@ Source: Copyright 2004-2011 Andrey Korotaev Portions copyright 2006-2008 Igor Ulyanov aka Displacer + +Instructions: +depending on your system, consult our wiki at: +- http://code.google.com/p/hedgewars/wiki/BuildingOnLinux +- http://code.google.com/p/hedgewars/wiki/BuildingOnWindows +- http://code.google.com/p/hedgewars/wiki/BuildingOnMac + diff -r 861d145b270e -r 5bfa1b2025d6 README_WINDOWS --- a/README_WINDOWS Mon Nov 26 00:06:42 2012 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -For instructions, please visit: http://code.google.com/p/hedgewars/wiki/BuildingOnWindows diff -r 861d145b270e -r 5bfa1b2025d6 hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Mon Nov 26 00:06:42 2012 +0400 +++ b/hedgewars/CMakeLists.txt Mon Nov 26 00:09:54 2012 +0400 @@ -108,9 +108,13 @@ find_program(fpc_executable fpc) ENDIF() -if(fpc_executable) - execute_process(COMMAND ${fpc_executable} -iV OUTPUT_VARIABLE fpc_output) -endif(fpc_executable) +message(STATUS "Check for working FPC compiler: ${fpc_executable}") +execute_process(COMMAND ${fpc_executable} -iV OUTPUT_VARIABLE fpc_output ERROR_VARIABLE fpc_error) +if(fpc_error) + message(STATUS "Check for working FPC compiler: ${fpc_executable} -- broken") +else(fpc_error) + message(STATUS "Check for working FPC compiler: ${fpc_executable} -- works") +endif(fpc_error) string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}") if(fpc_version) @@ -129,17 +133,21 @@ message(FATAL_ERROR "No FreePascal compiler found!") endif() +message(STATUS "Checking whether linker supports noexecstack flag") set(noexecstack_flags "-k-z" "-knoexecstack") file(WRITE ${EXECUTABLE_OUTPUT_PATH}/checkstack.pas "begin end.") execute_process(COMMAND ${fpc_executable} ${noexecstack_flags} checkstack.pas WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} RESULT_VARIABLE testnoexecstack - OUTPUT_QUIET + OUTPUT_QUIET ERROR_QUIET ) if(${testnoexecstack}) set (noexecstack_flags "") + message(STATUS "Checking whether linker supports noexecstack flag -- no") +else(${testnoexecstack}) + message(STATUS "Checking whether linker supports noexecstack flag -- yes") endif(${testnoexecstack}) #DEPENDECIES AND EXECUTABLES SECTION @@ -182,14 +190,13 @@ set(pascal_flags "-k${PNG_LIBRARY}" ${pascal_flags}) endif() else() - message(STATUS "Screenshots will be in BMP format because libpng was not found") + message(WARNING "Screenshots will be in BMP format because libpng was not found") endif() else() message(STATUS "Screenshots will be in BMP format per user request") endif() - #this command is a workaround to some inlining issues present in older FreePascal versions and fixed in 2.6 if(fpc_version LESS "020600") #under some configurations CMAKE_BUILD_TOOL fails to pass on the jobserver, breaking parallel compilation @@ -224,7 +231,7 @@ set(pascal_flags "-k${FFMPEG_LIBAVCODEC}" "-k${FFMPEG_LIBAVFORMAT}" "-k${FFMPEG_LIBAVUTIL}" ${pascal_flags}) ENDIF() else() - message(STATUS "Could NOT find FFMPEG/LibAV, video recording will be disabled") + message(WARNING "Could NOT find FFMPEG/LibAV, video recording will be disabled") endif() else() message(STATUS "Video recording disabled by user") diff -r 861d145b270e -r 5bfa1b2025d6 hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Mon Nov 26 00:06:42 2012 +0400 +++ b/hedgewars/uLocale.pas Mon Nov 26 00:09:54 2012 +0400 @@ -40,7 +40,7 @@ trevt_n: array[TEventId] of integer; procedure LoadLocale(FileName: shortstring); -var s: shortstring; +var s: ansistring; f: pfsFile; a, b, c: LongInt; first: array[TEventId] of boolean; @@ -58,7 +58,7 @@ begin while not pfsEof(f) do begin - pfsReadLn(f, s); + pfsReadLnA(f, s); if Length(s) = 0 then continue; if (s[1] < '0') or (s[1] > '9') then diff -r 861d145b270e -r 5bfa1b2025d6 hedgewars/uPhysFSLayer.pas --- a/hedgewars/uPhysFSLayer.pas Mon Nov 26 00:06:42 2012 +0400 +++ b/hedgewars/uPhysFSLayer.pas Mon Nov 26 00:09:54 2012 +0400 @@ -30,6 +30,7 @@ function pfsClose(f: PFSFile): boolean; procedure pfsReadLn(f: PFSFile; var s: shortstring); +procedure pfsReadLnA(f: PFSFile; var s: ansistring); function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; function pfsEOF(f: PFSFile): boolean; @@ -99,6 +100,28 @@ end end; +procedure pfsReadLnA(f: PFSFile; var s: ansistring); +var c: char; + b: shortstring; +begin +s:= ''; +b[0]:= #0; + +while (PHYSFS_readBytes(f, @c, 1) = 1) and (c <> #10) do + if (c <> #13) then + begin + inc(b[0]); + b[byte(b[0])]:= c; + if b[0] = #255 then + begin + s:= s + b; + b[0]:= #0 + end + end; + +s:= s + b +end; + function pfsBlockRead(f: PFSFile; buf: pointer; size: Int64): Int64; var r: Int64; begin diff -r 861d145b270e -r 5bfa1b2025d6 hedgewars/uUtils.pas --- a/hedgewars/uUtils.pas Mon Nov 26 00:06:42 2012 +0400 +++ b/hedgewars/uUtils.pas Mon Nov 26 00:09:54 2012 +0400 @@ -404,7 +404,7 @@ procedure initModule(isNotPreview: boolean); {$IFDEF DEBUGFILE} var logfileBase: shortstring; -{$IFNDEF MOBILE}var i: LongInt;{$ENDIF} + i: LongInt; {$ENDIF} begin {$IFDEF DEBUGFILE} @@ -423,26 +423,25 @@ {$I-} {$IFDEF MOBILE} {$IFDEF IPHONEOS} Assign(f, UserPathPrefix + '/hw-' + logfileBase + '.log'); {$ENDIF} - {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + logfileBase + '.log'); {$ENDIF} - Rewrite(f); + {$IFDEF ANDROID} Assign(f, pathPrefix + '/' + logfileBase + '.log'); {$ENDIF} + i:= i; // avoid hint {$ELSE} + f:= stdout; // if everything fails, write to stderr if (UserPathPrefix <> '') then begin - i:= 0; - while(i < 7) do + if not FileExists(UserPathPrefix + '/Logs/') then + CreateDir(UserPathPrefix + '/Logs/'); + i:= 0; + while(i < 7) do begin - assign(f, UserPathPrefix + '/Logs/' + logfileBase + inttostr(i) + '.log'); - rewrite(f); - if IOResult = 0 then - break; - inc(i) + assign(f, UserPathPrefix + '/Logs/' + logfileBase + inttostr(i) + '.log'); + if IOResult = 0 then + break; + inc(i) end; - if i = 7 then - f:= stderr; // if everything fails, write to stderr - end - else - f:= stderr; + end; {$ENDIF} + Rewrite(f); {$I+} {$ENDIF} diff -r 861d145b270e -r 5bfa1b2025d6 misc/physfs/CMakeLists.txt --- a/misc/physfs/CMakeLists.txt Mon Nov 26 00:06:42 2012 +0400 +++ b/misc/physfs/CMakeLists.txt Mon Nov 26 00:09:54 2012 +0400 @@ -47,7 +47,7 @@ # Need these everywhere... ADD_DEFINITIONS(-fno-common) - SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework Carbon -framework IOKit") + SET(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework IOKit") ENDIF(MACOSX) # Add some gcc-specific command lines. @@ -286,6 +286,8 @@ TARGET_LINK_LIBRARIES(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS}) SET(PHYSFS_LIB_TARGET physfs) SET(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") + INSTALL(TARGETS ${PHYSFS_INSTALL_TARGETS} + RUNTIME DESTINATION bin) ENDIF(PHYSFS_BUILD_SHARED) IF(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC) diff -r 861d145b270e -r 5bfa1b2025d6 misc/physfs/Xcode/Physfs.xcodeproj/project.pbxproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/physfs/Xcode/Physfs.xcodeproj/project.pbxproj Mon Nov 26 00:09:54 2012 +0400 @@ -0,0 +1,354 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 610FB79016613776002FB2A7 /* archiver_dir.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB77916613776002FB2A7 /* archiver_dir.c */; }; + 610FB79116613776002FB2A7 /* archiver_grp.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB77A16613776002FB2A7 /* archiver_grp.c */; }; + 610FB79216613776002FB2A7 /* archiver_hog.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB77B16613776002FB2A7 /* archiver_hog.c */; }; + 610FB79316613776002FB2A7 /* archiver_iso9660.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB77C16613776002FB2A7 /* archiver_iso9660.c */; }; + 610FB79416613776002FB2A7 /* archiver_lzma.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB77D16613776002FB2A7 /* archiver_lzma.c */; }; + 610FB79516613776002FB2A7 /* archiver_mvl.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB77E16613776002FB2A7 /* archiver_mvl.c */; }; + 610FB79616613776002FB2A7 /* archiver_qpak.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB77F16613776002FB2A7 /* archiver_qpak.c */; }; + 610FB79716613776002FB2A7 /* archiver_unpacked.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78016613776002FB2A7 /* archiver_unpacked.c */; }; + 610FB79816613776002FB2A7 /* archiver_wad.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78116613776002FB2A7 /* archiver_wad.c */; }; + 610FB79916613776002FB2A7 /* archiver_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78216613776002FB2A7 /* archiver_zip.c */; }; + 610FB79A16613776002FB2A7 /* physfs_byteorder.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78316613776002FB2A7 /* physfs_byteorder.c */; }; + 610FB79B16613776002FB2A7 /* physfs_casefolding.h in Headers */ = {isa = PBXBuildFile; fileRef = 610FB78416613776002FB2A7 /* physfs_casefolding.h */; }; + 610FB79C16613776002FB2A7 /* physfs_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 610FB78516613776002FB2A7 /* physfs_internal.h */; }; + 610FB79D16613776002FB2A7 /* physfs_miniz.h in Headers */ = {isa = PBXBuildFile; fileRef = 610FB78616613776002FB2A7 /* physfs_miniz.h */; }; + 610FB79E16613776002FB2A7 /* physfs_platforms.h in Headers */ = {isa = PBXBuildFile; fileRef = 610FB78716613776002FB2A7 /* physfs_platforms.h */; }; + 610FB79F16613776002FB2A7 /* physfs_unicode.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78816613776002FB2A7 /* physfs_unicode.c */; }; + 610FB7A016613776002FB2A7 /* physfs.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78916613776002FB2A7 /* physfs.c */; }; + 610FB7A116613776002FB2A7 /* physfs.h in Headers */ = {isa = PBXBuildFile; fileRef = 610FB78A16613776002FB2A7 /* physfs.h */; }; + 610FB7A216613776002FB2A7 /* platform_beos.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78B16613776002FB2A7 /* platform_beos.cpp */; }; + 610FB7A316613776002FB2A7 /* platform_macosx.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78C16613776002FB2A7 /* platform_macosx.c */; }; + 610FB7A416613776002FB2A7 /* platform_posix.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78D16613776002FB2A7 /* platform_posix.c */; }; + 610FB7A516613776002FB2A7 /* platform_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78E16613776002FB2A7 /* platform_unix.c */; }; + 610FB7A616613776002FB2A7 /* platform_windows.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB78F16613776002FB2A7 /* platform_windows.c */; }; + 610FB7AE16613813002FB2A7 /* hwpacksmounter.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB7A916613813002FB2A7 /* hwpacksmounter.c */; }; + 610FB7AF16613813002FB2A7 /* hwpacksmounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 610FB7AA16613813002FB2A7 /* hwpacksmounter.h */; }; + 610FB7B016613813002FB2A7 /* physfslualoader.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB7AB16613813002FB2A7 /* physfslualoader.c */; }; + 610FB7B116613813002FB2A7 /* physfsrwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 610FB7AC16613813002FB2A7 /* physfsrwops.c */; }; + 610FB7B216613813002FB2A7 /* physfsrwops.h in Headers */ = {isa = PBXBuildFile; fileRef = 610FB7AD16613813002FB2A7 /* physfsrwops.h */; }; + AA747D9F0F9514B9006C5449 /* Physfs_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* Physfs_Prefix.pch */; }; + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 610FB77916613776002FB2A7 /* archiver_dir.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_dir.c; path = ../src/archiver_dir.c; sourceTree = SOURCE_ROOT; }; + 610FB77A16613776002FB2A7 /* archiver_grp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_grp.c; path = ../src/archiver_grp.c; sourceTree = SOURCE_ROOT; }; + 610FB77B16613776002FB2A7 /* archiver_hog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_hog.c; path = ../src/archiver_hog.c; sourceTree = SOURCE_ROOT; }; + 610FB77C16613776002FB2A7 /* archiver_iso9660.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_iso9660.c; path = ../src/archiver_iso9660.c; sourceTree = SOURCE_ROOT; }; + 610FB77D16613776002FB2A7 /* archiver_lzma.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_lzma.c; path = ../src/archiver_lzma.c; sourceTree = SOURCE_ROOT; }; + 610FB77E16613776002FB2A7 /* archiver_mvl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_mvl.c; path = ../src/archiver_mvl.c; sourceTree = SOURCE_ROOT; }; + 610FB77F16613776002FB2A7 /* archiver_qpak.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_qpak.c; path = ../src/archiver_qpak.c; sourceTree = SOURCE_ROOT; }; + 610FB78016613776002FB2A7 /* archiver_unpacked.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_unpacked.c; path = ../src/archiver_unpacked.c; sourceTree = SOURCE_ROOT; }; + 610FB78116613776002FB2A7 /* archiver_wad.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_wad.c; path = ../src/archiver_wad.c; sourceTree = SOURCE_ROOT; }; + 610FB78216613776002FB2A7 /* archiver_zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = archiver_zip.c; path = ../src/archiver_zip.c; sourceTree = SOURCE_ROOT; }; + 610FB78316613776002FB2A7 /* physfs_byteorder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = physfs_byteorder.c; path = ../src/physfs_byteorder.c; sourceTree = SOURCE_ROOT; }; + 610FB78416613776002FB2A7 /* physfs_casefolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs_casefolding.h; path = ../src/physfs_casefolding.h; sourceTree = SOURCE_ROOT; }; + 610FB78516613776002FB2A7 /* physfs_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs_internal.h; path = ../src/physfs_internal.h; sourceTree = SOURCE_ROOT; }; + 610FB78616613776002FB2A7 /* physfs_miniz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs_miniz.h; path = ../src/physfs_miniz.h; sourceTree = SOURCE_ROOT; }; + 610FB78716613776002FB2A7 /* physfs_platforms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs_platforms.h; path = ../src/physfs_platforms.h; sourceTree = SOURCE_ROOT; }; + 610FB78816613776002FB2A7 /* physfs_unicode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = physfs_unicode.c; path = ../src/physfs_unicode.c; sourceTree = SOURCE_ROOT; }; + 610FB78916613776002FB2A7 /* physfs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = physfs.c; path = ../src/physfs.c; sourceTree = SOURCE_ROOT; }; + 610FB78A16613776002FB2A7 /* physfs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfs.h; path = ../src/physfs.h; sourceTree = SOURCE_ROOT; }; + 610FB78B16613776002FB2A7 /* platform_beos.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = platform_beos.cpp; path = ../src/platform_beos.cpp; sourceTree = SOURCE_ROOT; }; + 610FB78C16613776002FB2A7 /* platform_macosx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = platform_macosx.c; path = ../src/platform_macosx.c; sourceTree = SOURCE_ROOT; }; + 610FB78D16613776002FB2A7 /* platform_posix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = platform_posix.c; path = ../src/platform_posix.c; sourceTree = SOURCE_ROOT; }; + 610FB78E16613776002FB2A7 /* platform_unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = platform_unix.c; path = ../src/platform_unix.c; sourceTree = SOURCE_ROOT; }; + 610FB78F16613776002FB2A7 /* platform_windows.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = platform_windows.c; path = ../src/platform_windows.c; sourceTree = SOURCE_ROOT; }; + 610FB7A916613813002FB2A7 /* hwpacksmounter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hwpacksmounter.c; path = ../extras/hwpacksmounter.c; sourceTree = SOURCE_ROOT; }; + 610FB7AA16613813002FB2A7 /* hwpacksmounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hwpacksmounter.h; path = ../extras/hwpacksmounter.h; sourceTree = SOURCE_ROOT; }; + 610FB7AB16613813002FB2A7 /* physfslualoader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = physfslualoader.c; path = ../extras/physfslualoader.c; sourceTree = SOURCE_ROOT; }; + 610FB7AC16613813002FB2A7 /* physfsrwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = physfsrwops.c; path = ../extras/physfsrwops.c; sourceTree = SOURCE_ROOT; }; + 610FB7AD16613813002FB2A7 /* physfsrwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = physfsrwops.h; path = ../extras/physfsrwops.h; sourceTree = SOURCE_ROOT; }; + AA747D9E0F9514B9006C5449 /* Physfs_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Physfs_Prefix.pch; sourceTree = SOURCE_ROOT; }; + AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + D2AAC07E0554694100DB518D /* libPhysfs.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPhysfs.a; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D2AAC07C0554694100DB518D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DFFF38A50411DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC07E0554694100DB518D /* libPhysfs.a */, + ); + name = Products; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* Physfs */ = { + isa = PBXGroup; + children = ( + 08FB77AEFE84172EC02AAC07 /* Sources */, + 610FB77116613730002FB2A7 /* Extras */, + 32C88DFF0371C24200C91783 /* Other Sources */, + 0867D69AFE84028FC02AAC07 /* Frameworks */, + 034768DFFF38A50411DB9C8B /* Products */, + ); + name = Physfs; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + AACBBE490F95108600F1A2B1 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 08FB77AEFE84172EC02AAC07 /* Sources */ = { + isa = PBXGroup; + children = ( + 610FB77916613776002FB2A7 /* archiver_dir.c */, + 610FB77A16613776002FB2A7 /* archiver_grp.c */, + 610FB77B16613776002FB2A7 /* archiver_hog.c */, + 610FB77C16613776002FB2A7 /* archiver_iso9660.c */, + 610FB77D16613776002FB2A7 /* archiver_lzma.c */, + 610FB77E16613776002FB2A7 /* archiver_mvl.c */, + 610FB77F16613776002FB2A7 /* archiver_qpak.c */, + 610FB78016613776002FB2A7 /* archiver_unpacked.c */, + 610FB78116613776002FB2A7 /* archiver_wad.c */, + 610FB78216613776002FB2A7 /* archiver_zip.c */, + 610FB78316613776002FB2A7 /* physfs_byteorder.c */, + 610FB78416613776002FB2A7 /* physfs_casefolding.h */, + 610FB78516613776002FB2A7 /* physfs_internal.h */, + 610FB78616613776002FB2A7 /* physfs_miniz.h */, + 610FB78716613776002FB2A7 /* physfs_platforms.h */, + 610FB78816613776002FB2A7 /* physfs_unicode.c */, + 610FB78916613776002FB2A7 /* physfs.c */, + 610FB78A16613776002FB2A7 /* physfs.h */, + 610FB78B16613776002FB2A7 /* platform_beos.cpp */, + 610FB78C16613776002FB2A7 /* platform_macosx.c */, + 610FB78D16613776002FB2A7 /* platform_posix.c */, + 610FB78E16613776002FB2A7 /* platform_unix.c */, + 610FB78F16613776002FB2A7 /* platform_windows.c */, + ); + name = Sources; + sourceTree = ""; + }; + 32C88DFF0371C24200C91783 /* Other Sources */ = { + isa = PBXGroup; + children = ( + AA747D9E0F9514B9006C5449 /* Physfs_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 610FB77116613730002FB2A7 /* Extras */ = { + isa = PBXGroup; + children = ( + 610FB7A916613813002FB2A7 /* hwpacksmounter.c */, + 610FB7AA16613813002FB2A7 /* hwpacksmounter.h */, + 610FB7AB16613813002FB2A7 /* physfslualoader.c */, + 610FB7AC16613813002FB2A7 /* physfsrwops.c */, + 610FB7AD16613813002FB2A7 /* physfsrwops.h */, + ); + name = Extras; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC07A0554694100DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + AA747D9F0F9514B9006C5449 /* Physfs_Prefix.pch in Headers */, + 610FB79B16613776002FB2A7 /* physfs_casefolding.h in Headers */, + 610FB79C16613776002FB2A7 /* physfs_internal.h in Headers */, + 610FB79D16613776002FB2A7 /* physfs_miniz.h in Headers */, + 610FB79E16613776002FB2A7 /* physfs_platforms.h in Headers */, + 610FB7A116613776002FB2A7 /* physfs.h in Headers */, + 610FB7AF16613813002FB2A7 /* hwpacksmounter.h in Headers */, + 610FB7B216613813002FB2A7 /* physfsrwops.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D2AAC07D0554694100DB518D /* Physfs */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "Physfs" */; + buildPhases = ( + D2AAC07A0554694100DB518D /* Headers */, + D2AAC07B0554694100DB518D /* Sources */, + D2AAC07C0554694100DB518D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Physfs; + productName = Physfs; + productReference = D2AAC07E0554694100DB518D /* libPhysfs.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Physfs" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 0867D691FE84028FC02AAC07 /* Physfs */; + productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D2AAC07D0554694100DB518D /* Physfs */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + D2AAC07B0554694100DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 610FB79016613776002FB2A7 /* archiver_dir.c in Sources */, + 610FB79116613776002FB2A7 /* archiver_grp.c in Sources */, + 610FB79216613776002FB2A7 /* archiver_hog.c in Sources */, + 610FB79316613776002FB2A7 /* archiver_iso9660.c in Sources */, + 610FB79416613776002FB2A7 /* archiver_lzma.c in Sources */, + 610FB79516613776002FB2A7 /* archiver_mvl.c in Sources */, + 610FB79616613776002FB2A7 /* archiver_qpak.c in Sources */, + 610FB79716613776002FB2A7 /* archiver_unpacked.c in Sources */, + 610FB79816613776002FB2A7 /* archiver_wad.c in Sources */, + 610FB79916613776002FB2A7 /* archiver_zip.c in Sources */, + 610FB79A16613776002FB2A7 /* physfs_byteorder.c in Sources */, + 610FB79F16613776002FB2A7 /* physfs_unicode.c in Sources */, + 610FB7A016613776002FB2A7 /* physfs.c in Sources */, + 610FB7A216613776002FB2A7 /* platform_beos.cpp in Sources */, + 610FB7A316613776002FB2A7 /* platform_macosx.c in Sources */, + 610FB7A416613776002FB2A7 /* platform_posix.c in Sources */, + 610FB7A516613776002FB2A7 /* platform_unix.c in Sources */, + 610FB7A616613776002FB2A7 /* platform_windows.c in Sources */, + 610FB7AE16613813002FB2A7 /* hwpacksmounter.c in Sources */, + 610FB7B016613813002FB2A7 /* physfslualoader.c in Sources */, + 610FB7B116613813002FB2A7 /* physfsrwops.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1DEB921F08733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + DSTROOT = /tmp/Physfs.dst; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Physfs_Prefix.pch; + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = Physfs; + }; + name = Debug; + }; + 1DEB922008733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + DSTROOT = /tmp/Physfs.dst; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Physfs_Prefix.pch; + INSTALL_PATH = /usr/local/lib; + PRODUCT_NAME = Physfs; + }; + name = Release; + }; + 1DEB922308733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../liblua\"", + "\"$(SRCROOT)/../../../../Library/SDL/include\"", + ); + OTHER_LDFLAGS = "-ObjC"; + PREBINDING = NO; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 1DEB922408733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "\"$(SRCROOT)/../../liblua\"", + "\"$(SRCROOT)/../../../../Library/SDL/include\"", + ); + OTHER_LDFLAGS = "-ObjC"; + PREBINDING = NO; + SDKROOT = iphoneos; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "Physfs" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB921F08733DC00010E9CD /* Debug */, + 1DEB922008733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Physfs" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB922308733DC00010E9CD /* Debug */, + 1DEB922408733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0867D690FE84028FC02AAC07 /* Project object */; +} diff -r 861d145b270e -r 5bfa1b2025d6 misc/physfs/Xcode/Physfs_Prefix.pch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/physfs/Xcode/Physfs_Prefix.pch Mon Nov 26 00:09:54 2012 +0400 @@ -0,0 +1,7 @@ +// +// Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project. +// + +#ifdef __OBJC__ + #import +#endif diff -r 861d145b270e -r 5bfa1b2025d6 misc/physfs/extras/hwpacksmounter.c --- a/misc/physfs/extras/hwpacksmounter.c Mon Nov 26 00:06:42 2012 +0400 +++ b/misc/physfs/extras/hwpacksmounter.c Mon Nov 26 00:09:54 2012 +0400 @@ -1,11 +1,10 @@ #include #include #include -#include "physfs.h" #include "hwpacksmounter.h" -void hedgewarsMountPackages() +PHYSFS_DECL void hedgewarsMountPackages() { char ** filesList = PHYSFS_enumerateFiles("/"); char **i; diff -r 861d145b270e -r 5bfa1b2025d6 misc/physfs/extras/hwpacksmounter.h --- a/misc/physfs/extras/hwpacksmounter.h Mon Nov 26 00:06:42 2012 +0400 +++ b/misc/physfs/extras/hwpacksmounter.h Mon Nov 26 00:09:54 2012 +0400 @@ -1,11 +1,13 @@ #ifndef HEDGEWARS_PACKAGES_MOUNTER_H #define HEDGEWARS_PACKAGES_MOUNTER_H +#include "physfs.h" + #ifdef __cplusplus extern "C" { #endif -void hedgewarsMountPackages(); +PHYSFS_DECL void hedgewarsMountPackages(); #ifdef __cplusplus diff -r 861d145b270e -r 5bfa1b2025d6 misc/physfs/extras/physfslualoader.c --- a/misc/physfs/extras/physfslualoader.c Mon Nov 26 00:06:42 2012 +0400 +++ b/misc/physfs/extras/physfslualoader.c Mon Nov 26 00:09:54 2012 +0400 @@ -5,7 +5,7 @@ void *physfsReaderBuffer; -const char * physfsReader(lua_State *L, PHYSFS_File *f, size_t *size) +PHYSFS_DECL const char * physfsReader(lua_State *L, PHYSFS_File *f, size_t *size) { if(PHYSFS_eof(f)) @@ -23,7 +23,7 @@ } } -void physfsReaderSetBuffer(void *buffer) +PHYSFS_DECL void physfsReaderSetBuffer(void *buffer) { physfsReaderBuffer = buffer; } diff -r 861d145b270e -r 5bfa1b2025d6 project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj --- a/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Mon Nov 26 00:06:42 2012 +0400 +++ b/project_files/HedgewarsMobile/Hedgewars.xcodeproj/project.pbxproj Mon Nov 26 00:09:54 2012 +0400 @@ -34,6 +34,8 @@ 610C8E3714E018D200CF5C4C /* MNEValueTrackingSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 610C8E3614E018D200CF5C4C /* MNEValueTrackingSlider.m */; }; 610D5FB21270E2660033333A /* Icon-Small@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43411E290650040BA66 /* Icon-Small@2x.png */; }; 610D5FB31270E26C0033333A /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 61F7A43611E290650040BA66 /* Icon@2x.png */; }; + 610FB7C81661390E002FB2A7 /* uPhysFSLayer.pas in Sources */ = {isa = PBXBuildFile; fileRef = 610FB7C71661390E002FB2A7 /* uPhysFSLayer.pas */; }; + 610FB81A166139DF002FB2A7 /* libPhysfs.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 610FB7F8166139A4002FB2A7 /* libPhysfs.a */; }; 61156521147F48B6006729A9 /* About.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61156520147F48B6006729A9 /* About.strings */; }; 61156523147F48B7006729A9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61156522147F48B7006729A9 /* Localizable.strings */; }; 61156525147F48B8006729A9 /* Scheme.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61156524147F48B8006729A9 /* Scheme.strings */; }; @@ -255,6 +257,76 @@ /* End PBXBuildRule section */ /* Begin PBXContainerItemProxy section */ + 610FB7E116613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 619599BA1364E65900B429B6 /* Freetype.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D /* libFreetype */; + remoteInfo = libFreetype; + }; + 610FB7E316613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 61A19BF414D20D83004B1E6D /* SDL_net.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BE48FF6507AFA9A800BB41DA /* Static Library */; + remoteInfo = "Static Library"; + }; + 610FB7E516613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6195993F1364C82B00B429B6 /* Lua.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D /* libLua */; + remoteInfo = libLua; + }; + 610FB7E716613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 61A19AE314D2010A004B1E6D /* SDL.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = FD6526620DE8FCCB002AD96B /* libSDL */; + remoteInfo = libSDL; + }; + 610FB7E916613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 61A19C1E14D20F51004B1E6D /* SDL_mixer.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BE1FA90707AF96B2004B6283 /* Static Library */; + remoteInfo = "Static Library"; + }; + 610FB7EB16613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 61A19BC114D20CDA004B1E6D /* SDL_ttf.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BE48FD6807AFA17000BB41DA /* Static Library */; + remoteInfo = "Static Library"; + }; + 610FB7ED16613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 619598181364BCD200B429B6 /* Tremor.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D /* libTremor */; + remoteInfo = libTremor; + }; + 610FB7EF16613980002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 61A19B6114D20B6C004B1E6D /* SDL_image.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = BE1FA72F07AF4C45004B6283 /* libSDL_image */; + remoteInfo = libSDL_image; + }; + 610FB7F7166139A4002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 610FB7F3166139A4002FB2A7 /* Physfs.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D2AAC07E0554694100DB518D /* libPhysfs.a */; + remoteInfo = Physfs; + }; + 610FB81B166139EC002FB2A7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 610FB7F3166139A4002FB2A7 /* Physfs.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D /* Physfs */; + remoteInfo = Physfs; + }; 6162456614E6159C00CC97FB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 619599BA1364E65900B429B6 /* Freetype.xcodeproj */; @@ -346,6 +418,8 @@ 610782951440EE5C00645B29 /* gameMods.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = gameMods.plist; path = Resources/gameMods.plist; sourceTree = ""; }; 610C8E3514E018D200CF5C4C /* MNEValueTrackingSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MNEValueTrackingSlider.h; path = Classes/MNEValueTrackingSlider.h; sourceTree = ""; }; 610C8E3614E018D200CF5C4C /* MNEValueTrackingSlider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MNEValueTrackingSlider.m; path = Classes/MNEValueTrackingSlider.m; sourceTree = ""; }; + 610FB7C71661390E002FB2A7 /* uPhysFSLayer.pas */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = uPhysFSLayer.pas; path = ../../hedgewars/uPhysFSLayer.pas; sourceTree = SOURCE_ROOT; }; + 610FB7F3166139A4002FB2A7 /* Physfs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Physfs.xcodeproj; path = ../../misc/physfs/Xcode/Physfs.xcodeproj; sourceTree = SOURCE_ROOT; }; 6115651A147F48AE006729A9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Locale/English.lproj/About.strings; sourceTree = ""; }; 6115651B147F48AE006729A9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Locale/English.lproj/Localizable.strings; sourceTree = ""; }; 6115651C147F48AE006729A9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = Locale/English.lproj/Scheme.strings; sourceTree = ""; }; @@ -649,6 +723,7 @@ 616245D114E6160200CC97FB /* libFreetype.a in Frameworks */, 619599451364C83D00B429B6 /* libLua.a in Frameworks */, 6195981F1364BCEF00B429B6 /* libTremor.a in Frameworks */, + 610FB81A166139DF002FB2A7 /* libPhysfs.a in Frameworks */, 61A19AFC14D20170004B1E6D /* libSDL2.a in Frameworks */, 61A19B7714D20B7A004B1E6D /* libSDL2_image.a in Frameworks */, 61A19C2414D20F5A004B1E6D /* libSDL2_mixer.a in Frameworks */, @@ -757,6 +832,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 610FB7F3166139A4002FB2A7 /* Physfs.xcodeproj */, 619599BA1364E65900B429B6 /* Freetype.xcodeproj */, 6195993F1364C82B00B429B6 /* Lua.xcodeproj */, 619598181364BCD200B429B6 /* Tremor.xcodeproj */, @@ -780,6 +856,14 @@ name = Frameworks; sourceTree = ""; }; + 610FB7F4166139A4002FB2A7 /* Products */ = { + isa = PBXGroup; + children = ( + 610FB7F8166139A4002FB2A7 /* libPhysfs.a */, + ); + name = Products; + sourceTree = ""; + }; 61156510147F481B006729A9 /* Locale */ = { isa = PBXGroup; children = ( @@ -1133,6 +1217,7 @@ 9283015C0F10E48900CC5A3C /* Pascal Sources */ = { isa = PBXGroup; children = ( + 610FB7C71661390E002FB2A7 /* uPhysFSLayer.pas */, 619349C5160BAF3E00A08518 /* uAILandMarks.pas */, 619349C6160BAF3E00A08518 /* uGearsHandlers.pas */, 619349C7160BAF3E00A08518 /* uGearsHandlersRope.pas */, @@ -1213,6 +1298,15 @@ ); dependencies = ( 9283015A0F10E41300CC5A3C /* PBXTargetDependency */, + 610FB7E216613980002FB2A7 /* PBXTargetDependency */, + 610FB7E416613980002FB2A7 /* PBXTargetDependency */, + 610FB7E616613980002FB2A7 /* PBXTargetDependency */, + 610FB7E816613980002FB2A7 /* PBXTargetDependency */, + 610FB7EA16613980002FB2A7 /* PBXTargetDependency */, + 610FB7EC16613980002FB2A7 /* PBXTargetDependency */, + 610FB7EE16613980002FB2A7 /* PBXTargetDependency */, + 610FB7F016613980002FB2A7 /* PBXTargetDependency */, + 610FB81C166139EC002FB2A7 /* PBXTargetDependency */, ); name = Hedgewars; productName = HedgewarsMobile; @@ -1273,6 +1367,10 @@ ProjectRef = 6195993F1364C82B00B429B6 /* Lua.xcodeproj */; }, { + ProductGroup = 610FB7F4166139A4002FB2A7 /* Products */; + ProjectRef = 610FB7F3166139A4002FB2A7 /* Physfs.xcodeproj */; + }, + { ProductGroup = 61A19AE414D2010A004B1E6D /* Products */; ProjectRef = 61A19AE314D2010A004B1E6D /* SDL.xcodeproj */; }, @@ -1307,6 +1405,13 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ + 610FB7F8166139A4002FB2A7 /* libPhysfs.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libPhysfs.a; + remoteRef = 610FB7F7166139A4002FB2A7 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 6162456714E6159C00CC97FB /* libFreetype.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1647,12 +1752,58 @@ 619349C8160BAF3E00A08518 /* uAILandMarks.pas in Sources */, 619349C9160BAF3E00A08518 /* uGearsHandlers.pas in Sources */, 619349CA160BAF3E00A08518 /* uGearsHandlersRope.pas in Sources */, + 610FB7C81661390E002FB2A7 /* uPhysFSLayer.pas in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 610FB7E216613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libFreetype; + targetProxy = 610FB7E116613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB7E416613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Static Library"; + targetProxy = 610FB7E316613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB7E616613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libLua; + targetProxy = 610FB7E516613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB7E816613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL; + targetProxy = 610FB7E716613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB7EA16613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Static Library"; + targetProxy = 610FB7E916613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB7EC16613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Static Library"; + targetProxy = 610FB7EB16613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB7EE16613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libTremor; + targetProxy = 610FB7ED16613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB7F016613980002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libSDL_image; + targetProxy = 610FB7EF16613980002FB2A7 /* PBXContainerItemProxy */; + }; + 610FB81C166139EC002FB2A7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Physfs; + targetProxy = 610FB81B166139EC002FB2A7 /* PBXContainerItemProxy */; + }; 9283015A0F10E41300CC5A3C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 928301160F10CAFC00CC5A3C /* fpc */; diff -r 861d145b270e -r 5bfa1b2025d6 share/CMakeLists.txt --- a/share/CMakeLists.txt Mon Nov 26 00:06:42 2012 +0400 +++ b/share/CMakeLists.txt Mon Nov 26 00:09:54 2012 +0400 @@ -1,28 +1,23 @@ add_subdirectory(hedgewars) IF(APPLE OR CROSSAPPLE) - #needed for CFBundleVersion and CFBundleShortVersionString - FIND_PROGRAM(HGCOMMAND hg) - IF (HGCOMMAND AND (EXISTS ${hedgewars_SOURCE_DIR}/.hg)) - execute_process(COMMAND ${HGCOMMAND} identify -in - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE internal_version - ERROR_QUIET - ) - STRING(REGEX REPLACE "([0-9]+)(.*)" "\\1" revision_number ${internal_version}) - set (HEDGEWARS_REVISION ${revision_number}) - ELSE () - set (HEDGEWARS_REVISION ${HEDGEWARS_VERSION}) - ENDIF () + #needed for CFBundleVersion and CFBundleShortVersionString + #should reuse the variables set in main CMakeLists.txt + IF(HGCOMMAND AND (EXISTS ${CMAKE_SOURCE_DIR}/.hg)) + set(HEDGEWARS_REVISION ${revision_number}) + ELSE() + set(HEDGEWARS_REVISION ${HEDGEWARS_VERSION}) + ENDIF() - configure_file(${hedgewars_SOURCE_DIR}/share/Info.plist.in - ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) - install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/Info.plist" - DESTINATION ../) - install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/Icon.icns" - DESTINATION ../Resources/) - install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/hwico.icns" - DESTINATION ../Resources/) - install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/dsa_pub.pem" - DESTINATION ../Resources/) + configure_file(${hedgewars_SOURCE_DIR}/share/Info.plist.in + ${CMAKE_CURRENT_BINARY_DIR}/Info.plist) + #path here should be Hedgewars.app/Contents/MacOS + install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/Info.plist" + DESTINATION ../) + install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/Icon.icns" + DESTINATION ../Resources/) + install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/hwico.icns" + DESTINATION ../Resources/) + install(PROGRAMS "${hedgewars_SOURCE_DIR}/share/dsa_pub.pem" + DESTINATION ../Resources/) ENDIF(APPLE OR CROSSAPPLE)