Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5645


Ignore:
Timestamp:
Aug 13, 2009, 10:50:07 PM (15 years ago)
Author:
rgrieder
Message:

Renamed media to data to restore consistency with game/data/trunk folder name.
Couldn't yet rename the media folder though probably due to some fundamental limitations of SVN (believe me, I tried).

Location:
code/branches/resource2
Files:
15 edited
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/resource2

    • Property svn:externals
      •  

        old new  
        1 media_stripped http://svn.orxonox.net/game/data/branches/media_stripped
         1data_stripped https://svn.orxonox.net/game/data/branches/media_stripped
  • code/branches/resource2/CMakeLists.txt

    r5641 r5645  
    4646INCLUDE(BuildConfig)
    4747
    48 # Configure media directory location and installation
    49 ADD_SUBDIRECTORY(media)
     48# Configure data directory location and installation
     49ADD_SUBDIRECTORY(data)
    5050
    5151# Create the actual project
  • code/branches/resource2/cmake/BuildConfig.cmake

    r5641 r5645  
    2222 #  Description:
    2323 #    Configures the compilers and sets build options.
    24  #    This also includes handling the OGRE plugins and the media directory.
     24 #    This also includes handling the OGRE plugins and the data directory.
    2525 #
    2626
     
    3232SET(DEFAULT_ARCHIVE_PATH lib/static)
    3333SET(DEFAULT_DOC_PATH     doc)
    34 SET(DEFAULT_MEDIA_PATH   media)
     34SET(DEFAULT_DATA_PATH    data)
    3535SET(DEFAULT_CONFIG_PATH  config)
    3636SET(DEFAULT_LOG_PATH     log)
     
    4141SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
    4242SET(CMAKE_DOC_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_DOC_PATH})
    43 # Media directories are only inputs
     43# Data directories are only inputs
    4444SET(CMAKE_CONFIG_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_CONFIG_PATH})
    4545SET(CMAKE_LOG_OUTPUT_DIRECTORY     ${CMAKE_BINARY_DIR}/${DEFAULT_LOG_PATH})
     
    131131SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
    132132SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
    133 SET(MEDIA_INSTALL_DIRECTORY   ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH})
     133SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DATA_PATH})
    134134SET(CONFIG_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_CONFIG_PATH})
    135135SET(LOG_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LOG_PATH})
     
    142142    SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
    143143    SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    144     SET(MEDIA_INSTALL_DIRECTORY   ${CMAKE_INSTALL_PREFIX}/share/orxonox)
     144    SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/orxonox)
    145145  ENDIF()
    146146
  • code/branches/resource2/media/CMakeLists.txt

    r5641 r5645  
    2121 #    Reto Grieder
    2222 #  Description:
    23  #    Finds the external media directory and configures the media installation.
    24  #    Default search paths are: ../../media and ../media_extern
     23 #    Finds the external data directory and configures the data installation.
     24 #    Default search paths are: ../../data and ../data_extern
    2525 #
    2626
    27 # For dev runs we've got two media directory. The one from the other repository root folder
    28 # is called EXTERNAL_MEDIA
    29 SET(MEDIA_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
    30 SET(MEDIA_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
     27# For dev runs we've got two data directory. The one from the other repository root folder
     28# is called EXTERNAL_DATA
     29SET(DATA_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
     30SET(DATA_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
    3131
    32 # Specify media directory
    33 GET_FILENAME_COMPONENT(_search_path_1 ${CMAKE_SOURCE_DIR}/../${DEFAULT_MEDIA_PATH} ABSOLUTE)
    34 FIND_PATH(EXTERNAL_MEDIA_DIRECTORY resources.oxr
     32# Specify data directory
     33GET_FILENAME_COMPONENT(_search_path_1 ${CMAKE_SOURCE_DIR}/../${DEFAULT_DATA_PATH} ABSOLUTE)
     34FIND_PATH(EXTERNAL_DATA_DIRECTORY resources.oxr
    3535  PATHS
    36     ${CMAKE_SOURCE_DIR}/media_extern
     36    ${CMAKE_SOURCE_DIR}/data_extern
    3737    ${_search_path_1}
    3838  NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH
    3939)
    4040
    41 IF(NOT EXTERNAL_MEDIA_DIRECTORY)
    42   MESSAGE(STATUS "Warning: External media directory not found. If you want to compile while downloading the media files, you will have to recompile about four files afterwards and relink everything. \\n You can specify your own folder with the MEDIA_DIRECTORY variable. Default location for the path is orxonox_root/media_extern")
     41IF(NOT EXTERNAL_DATA_DIRECTORY)
     42  MESSAGE(STATUS "Warning: External data directory not found. If you want to compile while downloading the data files, you will have to recompile about four files afterwards and relink everything. \\n You can specify your own folder with the DATA_DIRECTORY variable. Default location for the path is orxonox_root/data_extern")
    4343  # Temporary override to the default location.
    44   SET(EXTERNAL_MEDIA_DIRECTORY ${CMAKE_SOURCE_DIR}/media_extern)
     44  SET(EXTERNAL_DATA_DIRECTORY ${CMAKE_SOURCE_DIR}/data_extern)
    4545ENDIF()
    4646
     
    5050# Internal directory
    5151INSTALL(
    52   DIRECTORY ${MEDIA_DIRECTORY}/
    53   DESTINATION ${MEDIA_INSTALL_DIRECTORY}
     52  DIRECTORY ${DATA_DIRECTORY}/
     53  DESTINATION ${DATA_INSTALL_DIRECTORY}
    5454  REGEX "\\.svn$|_svn$|CMakeLists.txt|InstallScript.cmake" EXCLUDE
    5555)
    5656# External directory
    5757INSTALL(
    58   DIRECTORY ${EXTERNAL_MEDIA_DIRECTORY}/
    59   DESTINATION ${MEDIA_INSTALL_DIRECTORY}
     58  DIRECTORY ${EXTERNAL_DATA_DIRECTORY}/
     59  DESTINATION ${DATA_INSTALL_DIRECTORY}
    6060  REGEX "\\.svn$|_svn$|resources\\.oxr" EXCLUDE
    6161)
    6262# Configure the install scripts (variables not available during installation)
    63 CONFIGURE_FILE(MediaInstallScript.cmake ${CMAKE_CURRENT_BINARY_DIR}/MediaInstallScript.cmake @ONLY)
     63CONFIGURE_FILE(DataInstallScript.cmake ${CMAKE_CURRENT_BINARY_DIR}/DataInstallScript.cmake @ONLY)
    6464# Join both resources.oxr files
    65 INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/MediaInstallScript.cmake)
     65INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/DataInstallScript.cmake)
  • code/branches/resource2/media/DataInstallScript.cmake

    r5644 r5645  
    2929
    3030# Write some comment
    31 FILE(APPEND @MEDIA_INSTALL_DIRECTORY@/resources.oxr "\n\n\n <!-- ----------------------------------------- -->")
    32 FILE(APPEND @MEDIA_INSTALL_DIRECTORY@/resources.oxr     "\n <!-- Content from the external media directory -->")
    33 FILE(APPEND @MEDIA_INSTALL_DIRECTORY@/resources.oxr     "\n <!-- ----------------------------------------- -->\n\n")
     31FILE(APPEND @DATA_INSTALL_DIRECTORY@/resources.oxr "\n\n\n <!-- ---------------------------------------- -->")
     32FILE(APPEND @DATA_INSTALL_DIRECTORY@/resources.oxr     "\n <!-- Content from the external data directory -->")
     33FILE(APPEND @DATA_INSTALL_DIRECTORY@/resources.oxr     "\n <!-- ---------------------------------------- -->\n\n")
    3434
    3535# Append the external file
    36 FILE(READ   @EXTERNAL_MEDIA_DIRECTORY@/resources.oxr _external_file)
    37 FILE(APPEND @MEDIA_INSTALL_DIRECTORY@/resources.oxr ${_external_file})
     36FILE(READ   @EXTERNAL_DATA_DIRECTORY@/resources.oxr _external_file)
     37FILE(APPEND @DATA_INSTALL_DIRECTORY@/resources.oxr ${_external_file})
  • code/branches/resource2/src/SpecialConfig.h.in

    r5641 r5645  
    7777    const char defaultArchivePath[] = "@DEFAULT_ARCHIVE_PATH@";
    7878    const char defaultDocPath[]     = "@DEFAULT_DOC_PATH@";
    79     const char defaultMediaPath[]   = "@DEFAULT_MEDIA_PATH@";
     79    const char defaultDataPath[]    = "@DEFAULT_DATA_PATH@";
    8080    const char defaultConfigPath[]  = "@DEFAULT_CONFIG_PATH@";
    8181    const char defaultLogPath[]     = "@DEFAULT_LOG_PATH@";
    8282
    8383    // INSTALLATION PATHS
    84     const char runtimeInstallDirectory[]    = "@RUNTIME_INSTALL_DIRECTORY@";
    85     const char mediaInstallDirectory[]      = "@MEDIA_INSTALL_DIRECTORY@";
    86     const char configInstallDirectory[]     = "@CONFIG_INSTALL_DIRECTORY@";
    87     const char logInstallDirectory[]        = "@LOG_INSTALL_DIRECTORY@";
     84    const char dataInstallDirectory[]       = "@DATA_INSTALL_DIRECTORY@";
    8885
    8986    // DEVELOPMENT RUN PATHS
    90     const char mediaDevDirectory[]          = "@MEDIA_DIRECTORY@";
    91     const char externalMediaDevDirectory[]  = "@EXTERNAL_MEDIA_DIRECTORY@";
     87    const char dataDevDirectory[]           = "@DATA_DIRECTORY@";
     88    const char externalDataDevDirectory[]   = "@EXTERNAL_DATA_DIRECTORY@";
    9289#ifdef CMAKE_CONFIGURATION_TYPES
    9390    const char configDevDirectory[]         = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
  • code/branches/resource2/src/core/ConfigFileManager.cc

    r3370 r5645  
    229229        if (!boost::filesystem::exists(filepath))
    230230        {
    231             // Try to get default one from the media folder
    232             boost::filesystem::path defaultFilepath(Core::getMediaPath() / "defaultConfig" / this->filename_);
     231            // Try to get default one from the data folder
     232            boost::filesystem::path defaultFilepath(Core::getDataPath() / "defaultConfig" / this->filename_);
    233233            if (boost::filesystem::exists(defaultFilepath))
    234234            {
  • code/branches/resource2/src/core/Core.cc

    r5641 r5645  
    8585    Core* Core::singletonPtr_s  = 0;
    8686
    87     SetCommandLineArgument(externalMediaPath, "").information("Path to the external media files");
     87    SetCommandLineArgument(externalDataPath, "").information("Path to the external data files");
    8888    SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files");
    8989    SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
     
    110110            this->setConfigValues();
    111111
    112             // External media directory only exists for dev runs
     112            // External data directory only exists for dev runs
    113113            if (Core::isDevelopmentRun())
    114114            {
    115                 // Possible media path override by the command line
    116                 if (!CommandLine::getArgument("externalMediaPath")->hasDefaultValue())
    117                     tsetExternalMediaPath(CommandLine::getValue("externalMediaPath"));
     115                // Possible data path override by the command line
     116                if (!CommandLine::getArgument("externalDataPath")->hasDefaultValue())
     117                    tsetExternalDataPath(CommandLine::getValue("externalDataPath"));
    118118            }
    119119        }
     
    188188        /**
    189189        @brief
    190             Temporary sets the media path
     190            Temporary sets the data path
    191191        @param path
    192             The new media path
     192            The new data path
    193193        */
    194         void tsetExternalMediaPath(const std::string& path)
    195         {
    196             mediaPath_ = boost::filesystem::path(path);
     194        void tsetExternalDataPath(const std::string& path)
     195        {
     196            dataPath_ = boost::filesystem::path(path);
    197197        }
    198198
     
    218218        boost::filesystem::path rootPath_;
    219219        boost::filesystem::path executablePath_;        //!< Path to the executable
    220         boost::filesystem::path mediaPath_;             //!< Path to the media file folder
    221         boost::filesystem::path externalMediaPath_;     //!< Path to the media file folder
     220        boost::filesystem::path dataPath_;              //!< Path to the data file folder
     221        boost::filesystem::path externalDataPath_;      //!< Path to the external data file folder
    222222        boost::filesystem::path configPath_;            //!< Path to the config file folder
    223223        boost::filesystem::path logPath_;               //!< Path to the log file folder
     
    283283
    284284        // initialise Tcl
    285         this->tclBind_.reset(new TclBind(Core::getMediaPathString()));
     285        this->tclBind_.reset(new TclBind(Core::getDataPathString()));
    286286        this->tclThreadManager_.reset(new TclThreadManager(tclBind_->getTclInterpreter()));
    287287
     
    401401    }
    402402
    403     /*static*/ void Core::tsetExternalMediaPath(const std::string& path)
    404     {
    405         getInstance().configuration_->tsetExternalMediaPath(path);
    406     }
    407 
    408     /*static*/ const boost::filesystem::path& Core::getMediaPath()
    409     {
    410         return getInstance().configuration_->mediaPath_;
    411     }
    412     /*static*/ std::string Core::getMediaPathString()
    413     {
    414         return getInstance().configuration_->mediaPath_.string() + '/';
    415     }
    416 
    417     /*static*/ const boost::filesystem::path& Core::getExternalMediaPath()
    418     {
    419         return getInstance().configuration_->externalMediaPath_;
    420     }
    421     /*static*/ std::string Core::getExternalMediaPathString()
    422     {
    423         return getInstance().configuration_->externalMediaPath_.string() + '/';
     403    /*static*/ void Core::tsetExternalDataPath(const std::string& path)
     404    {
     405        getInstance().configuration_->tsetExternalDataPath(path);
     406    }
     407
     408    /*static*/ const boost::filesystem::path& Core::getDataPath()
     409    {
     410        return getInstance().configuration_->dataPath_;
     411    }
     412    /*static*/ std::string Core::getDataPathString()
     413    {
     414        return getInstance().configuration_->dataPath_.string() + '/';
     415    }
     416
     417    /*static*/ const boost::filesystem::path& Core::getExternalDataPath()
     418    {
     419        return getInstance().configuration_->externalDataPath_;
     420    }
     421    /*static*/ std::string Core::getExternalDataPathString()
     422    {
     423        return getInstance().configuration_->externalDataPath_.string() + '/';
    424424    }
    425425
     
    561561            COUT(1) << "Running from the build tree." << std::endl;
    562562            Core::bDevRun_ = true;
    563             configuration_->mediaPath_  = specialConfig::mediaDevDirectory;
    564             configuration_->externalMediaPath_ = specialConfig::externalMediaDevDirectory;
     563            configuration_->dataPath_  = specialConfig::dataDevDirectory;
     564            configuration_->externalDataPath_ = specialConfig::externalDataDevDirectory;
    565565            configuration_->configPath_ = specialConfig::configDevDirectory;
    566566            configuration_->logPath_    = specialConfig::logDevDirectory;
     
    579579
    580580            // Using paths relative to the install prefix, complete them
    581             configuration_->mediaPath_  = configuration_->rootPath_ / specialConfig::defaultMediaPath;
     581            configuration_->dataPath_  = configuration_->rootPath_ / specialConfig::defaultDataPath;
    582582            configuration_->configPath_ = configuration_->rootPath_ / specialConfig::defaultConfigPath;
    583583            configuration_->logPath_    = configuration_->rootPath_ / specialConfig::defaultLogPath;
     
    585585            // There is no root path, so don't set it at all
    586586
    587             configuration_->mediaPath_  = specialConfig::mediaInstallDirectory;
     587            configuration_->dataPath_  = specialConfig::dataInstallDirectory;
    588588
    589589            // Get user directory
  • code/branches/resource2/src/core/Core.h

    r5641 r5645  
    5757        The Core class is a singleton used to configure the program basics.
    5858    @details
    59         The class provides information about the media, config and log path.
     59        The class provides information about the data, config and log path.
    6060        It determines those by the use of platform specific functions.
    6161    @remark
     
    9191            static void  resetLanguage();
    9292
    93             static void tsetExternalMediaPath(const std::string& path);
     93            static void tsetExternalDataPath(const std::string& path);
    9494            //! Returns the path to the data files as boost::filesystem::path
    95             static const boost::filesystem::path& getMediaPath();
     95            static const boost::filesystem::path& getDataPath();
    9696            //! Returns the path to the external data files as boost::filesystem::path
    97             static const boost::filesystem::path& getExternalMediaPath();
     97            static const boost::filesystem::path& getExternalDataPath();
    9898            //! Returns the path to the config files as boost::filesystem::path
    9999            static const boost::filesystem::path& getConfigPath();
    100100            //! Returns the path to the log files as boost::filesystem::path
    101101            static const boost::filesystem::path& getLogPath();
    102             //! Returns the path to the data files as std::string
    103102            //! Returns the path to the root folder as boost::filesystem::path
    104103            static const boost::filesystem::path& getRootPath();
    105             static std::string getMediaPathString();
     104            //! Returns the path to the data files as std::string
     105            static std::string getDataPathString();
    106106            //! Returns the path to the external data files as std::string
    107             static std::string getExternalMediaPathString();
     107            static std::string getExternalDataPathString();
    108108            //! Returns the path to the config files as std::string
    109109            static std::string getConfigPathString();
  • code/branches/resource2/src/core/GUIManager.cc

    r3370 r5645  
    171171    {
    172172        // set datapath for GUI data
    173         lua_pushfstring(this->scriptModule_->getLuaState(), Core::getMediaPathString().c_str());
     173        lua_pushfstring(this->scriptModule_->getLuaState(), Core::getDataPathString().c_str());
    174174        lua_setglobal(this->scriptModule_->getLuaState(), "datapath");
    175175        // call main Lua script
  • code/branches/resource2/src/core/LuaBind.cc

    r3370 r5645  
    4747  LuaBind::LuaBind()
    4848  {
    49     this->includePath_ = Core::getMediaPathString();
     49    this->includePath_ = Core::getDataPathString();
    5050
    5151    luaState_ = lua_open();
  • code/branches/resource2/src/orxonox/LevelManager.cc

    r3370 r5645  
    135135        availableLevels_.clear();
    136136
    137         boost::filesystem::directory_iterator file(Core::getMediaPathString() + "levels");
     137        boost::filesystem::directory_iterator file(Core::getDataPathString() + "levels");
    138138        boost::filesystem::directory_iterator end;
    139139
  • code/branches/resource2/src/orxonox/gamestates/GSGraphics.cc

    r3370 r5645  
    9696        // load debug overlay
    9797        COUT(3) << "Loading Debug Overlay..." << std::endl;
    98         this->debugOverlay_ = new XMLFile(Core::getMediaPathString() + "overlay/debug.oxo");
     98        this->debugOverlay_ = new XMLFile(Core::getDataPathString() + "overlay/debug.oxo");
    9999        Loader::open(debugOverlay_);
    100100
  • code/branches/resource2/src/orxonox/gamestates/GSLevel.cc

    r5614 r5645  
    246246        // call the loader
    247247        COUT(0) << "Loading level..." << std::endl;
    248         startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + LevelManager::getInstance().getDefaultLevel());
     248        startFile_s = new XMLFile(Core::getDataPathString() + "levels" + '/' + LevelManager::getInstance().getDefaultLevel());
    249249        Loader::open(startFile_s);
    250250    }
  • code/branches/resource2/src/orxonox/objects/Level.cc

    r3325 r5645  
    5454        this->xmlfilename_ = this->getFilename();
    5555
    56         if (this->xmlfilename_.length() >= Core::getMediaPathString().length())
    57             this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPathString().length());
     56        if (this->xmlfilename_.length() >= Core::getDataPathString().length())
     57            this->xmlfilename_ = this->xmlfilename_.substr(Core::getDataPathString().length());
    5858    }
    5959
     
    101101        mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
    102102
    103         this->xmlfile_ = new XMLFile(Core::getMediaPathString() + this->xmlfilename_, mask);
     103        this->xmlfile_ = new XMLFile(Core::getDataPathString() + this->xmlfilename_, mask);
    104104
    105105        Loader::open(this->xmlfile_);
  • code/branches/resource2/src/orxonox/sound/SoundBase.cc

    r3370 r5645  
    135135
    136136    bool SoundBase::loadFile(std::string filename) {
    137         filename = Core::getMediaPathString() + "/audio/" + filename;
     137        filename = Core::getDataPathString() + "/audio/" + filename;
    138138
    139139        if(!SoundManager::getInstance().isSoundAvailable())
Note: See TracChangeset for help on using the changeset viewer.