Commit 14840077 authored by Tobias Frost's avatar Tobias Frost

New upstream version 2.5.0

parent fd604b42
......@@ -59,3 +59,4 @@ Makefile.in
/tools/msvc/DarkRadiant.VC.db
/tools/innosetup/*.zip
/tools/lwo_analyse/.vs
/radiant/*.aps
......@@ -32,3 +32,4 @@ Exceptions to the above
PicoModel Library - published under the modified Berkeley Software Distribution (BSD) license
DDS Library - published under the modified Berkeley Software Distribution (BSD) license
pybind11 Library - see the LICENSE file in the libs/pybind folder
fmtlib Library - see the LICENSE file in the libs/libfmt folder (BSD 2-clause "Simplified" License)
# Maintainer: codereader <greebo[AT]angua[DOT]at>
pkgname=darkradiant
pkgver=2.4.0
pkgver=2.5.0
pkgrel=1
pkgdesc="Level Editor for Doom 3 (idTech4) and The Dark Mod"
arch=("x86_64")
......@@ -8,7 +8,7 @@ url="http://www.darkradiant.net/"
license=("GPL")
depends=(wxgtk ftgl glew boost-libs freealut libvorbis python libsigc++)
makedepends=(git boost webkitgtk2)
source=("$pkgname::git+https://github.com/codereader/DarkRadiant.git#tag=2.4.0")
source=("$pkgname::git+https://github.com/codereader/DarkRadiant.git#tag=2.5.0")
md5sums=("SKIP")
build() {
......
# DarkRadiant
DarkRadiant is a level (map) editor for the **The Dark Mod**, an open-source Doom 3 modification which is available at http://www.thedarkmod.com
DarkRadiant is a level (map) editor for the **The Dark Mod**, an open-source Doom 3 modification which is available at www.thedarkmod.com
# Getting started
DarkRadiant requires game resources to work with, these resources are not installed by this editor. You'll need to point DarkRadiant to one of these games (The Dark Mod, Doom 3, Quake 4, etc.) before you can start to work on your map. Visit www.thedarkmod.com for download instructions, then proceed with one of the tutorials available on the web.
For The Dark Mod mappers, there's an extensive [Beginner's Guide](http://wiki.thedarkmod.com/index.php?title=A_-_Z_Beginner_Full_Guide_Start_Here!) on the project's wiki, which covers a lot of steps almost from scratch. Moreover, a couple of excellent video tutorials are available, linked from the top of that wiki article above.
# Compiling on Windows
......@@ -14,7 +20,7 @@ The free Community Edition can be obtained here:
Since DarkRadiant uses a couple of open-source libraries that are not available on Windows by default, you will also need to download and install the dependencies. 7-Zip packages of the dependencies are available at the following
URL(s). [Get 7-zip here](http://www.7-zip.org/)
https://github.com/codereader/DarkRadiant/releases/download/2.3.0/windeps.7z
https://github.com/codereader/DarkRadiant/releases/download/2.5.0/windeps.7z
The dependencies packages need to be extracted into the main DarkRadiant
source directory, i.e. alongside the `include/` and `radiant/` directories.
......@@ -34,7 +40,7 @@ placed into the `install/` folder.
## Prerequisites
To compile DarkRadiant, a number of libraries (with development headers) and a standards-compliant C++11 compiler are required. On an Ubuntu system, the requirements may include any or all of the following packages:
To compile DarkRadiant, a number of libraries (with development headers) and a standards-compliant C++11 compiler (GCC 5.3+) are required. On an Ubuntu system, the requirements may include any or all of the following packages:
* zlib1g-dev
* libjpeg62-dev
......@@ -44,15 +50,12 @@ To compile DarkRadiant, a number of libraries (with development headers) and a s
* libpng-dev
* libftgl-dev
* libglew-dev
* libboost-dev
* libboost-test-dev
* libalut-dev
* libvorbis-dev
* pybind11-dev (Ubuntu 17 and later)
This does not include core development tools such as g++ or the git client
to download the sources (use sudo apt-get install git for that). One possible
set of packages might be:
to download the sources (use sudo apt-get install git for that). One possible set of packages might be:
`sudo apt-get install git automake libtool g++ gettext pkg-config`
......
AC_INIT([darkradiant], [2.4.0])
AC_INIT([darkradiant], [2.5.0])
AM_INIT_AUTOMAKE([subdir-objects])
AM_SILENT_RULES([yes])
......@@ -71,7 +71,7 @@ AC_ARG_ENABLE([python],
AC_ARG_WITH(pybind11,
[--with-pybind11=/path/to/pybind11/include pybind11 include path to use (optional)],
pybind11_include_path="$withval")
if [[ "$darkmod_plugins" != 'no' ]]
then
# Enable conditional directories (used by plugins/Makefile.am)
......@@ -178,19 +178,16 @@ else
fi
fi
# Boost
BOOST_REQUIRE([1.46.1])
# Check some boost headers we use
BOOST_FORMAT
BOOST_TOKENIZER
FILESYSTEM_LIBS=''
# Require Boost Filesystem if the C++17-style header is not present
if test "$use_boost_filesystem" = "yes"
then
AC_MSG_NOTICE([Will check for boost.filesystem library since std::filesystem is not available])
AC_MSG_NOTICE([Will check for boost libraries since std::filesystem is not available])
# Boost
BOOST_REQUIRE([1.46.1])
BOOST_FILESYSTEM
BOOST_SYSTEM
FILESYSTEM_LIBS="$(BOOST_FILESYSTEM_LIBS) $(BOOST_SYSTEM_LIBS)"
......@@ -201,11 +198,11 @@ fi
AC_SUBST([FILESYSTEM_LIBS])
BOOST_TEST
# Boost.Python if required
# PyBind11 if required
if test "$python_scripting" = 'yes'
then
AM_CONDITIONAL([SYSTEM_HAS_PYBIND11], [false]) # default to "not found"
AC_CHECK_PROGS([PYTHON_CONFIG], [python-config], [])
if test ! -z "$PYTHON_CONFIG"
then
......@@ -226,16 +223,16 @@ then
# Check for a system-provided pybind11, otherwise fall back on
# the pybind11 headers we ship in the libs/pybind folder
AC_CHECK_HEADER([pybind11/pybind11.h], [found_local_pybind11=yes], [found_local_pybind11=no])
if test "$found_local_pybind11" = 'yes'
then
AC_MSG_NOTICE([Using the system-provided pybind11 headers])
else
AC_MSG_NOTICE([Using the pybind11 headers shipped with the sources])
fi
AM_CONDITIONAL([SYSTEM_HAS_PYBIND11], [test "$found_local_pybind11" = 'yes'])
AC_CHECK_HEADER([pybind11/pybind11.h], [found_local_pybind11=yes], [found_local_pybind11=no])
if test "$found_local_pybind11" = 'yes'
then
AC_MSG_NOTICE([Using the system-provided pybind11 headers])
else
AC_MSG_NOTICE([Using the pybind11 headers shipped with the sources])
fi
AM_CONDITIONAL([SYSTEM_HAS_PYBIND11], [test "$found_local_pybind11" = 'yes'])
script_module='script'
AC_SUBST([script_module])
......@@ -248,16 +245,36 @@ else
AM_CONDITIONAL([SYSTEM_HAS_PYBIND11], [false])
fi
# greebo: Don't check for the system-provided fmtlib, since linking
# against the libfmt.a produces a relocation linker error, complaining about
# a missing -fPIC switch. I won't bother with that right now, let's use the
# headers shipped with the repository.
#AC_MSG_NOTICE([Checking for fmtlib headers...])
found_local_fmtlib=no
# Check for a system-provided fmtlib, otherwise fall back on
# the headers we ship in the libs/libfmt folder
#AC_CHECK_HEADER([fmt/format.h], [found_local_fmtlib=yes], [found_local_fmtlib=no])
if test "$found_local_fmtlib" = 'yes'
then
FMTLIB_CPPFLAGS="" # system got one
FMTLIB_LDFLAGS="-lfmt"
AC_MSG_NOTICE([Using the system-provided fmtlib headers])
else
# Switch to header-only mode when using our own shipped sources
FMTLIB_CPPFLAGS="-I`pwd`/libs/libfmt -DFMT_HEADER_ONLY"
FMTLIB_LDFLAGS=""
AC_MSG_NOTICE([Using the fmtlib headers shipped with the sources (header-only mode)])
fi
# dynamic link library
AC_CHECK_LIB([dl], [main],
[DL_LIBS='-ldl'],
[AC_MSG_ERROR([DL library not found])])
AC_SUBST([DL_LIBS])
# Dependent Boost headers
AC_CHECK_HEADER([boost/serialization/access.hpp], [],
[AC_MSG_ERROR([Boost.Serialization headers not found])])
# OpenAL and vorbis
AC_CHECK_HEADER([AL/alut.h],
[sound_module='sound'],
......@@ -295,8 +312,8 @@ fi
CFLAGS="$USER_CFLAGS $WARNING_FLAGS $WX_CFLAGS"
CXXFLAGS="$USER_CXXFLAGS $WARNING_FLAGS $WX_CXXFLAGS_ONLY"
CPPFLAGS="$USER_CPPFLAGS -DPOSIX $WX_CPPFLAGS $LIBSIGC_CFLAGS -DWXINTL_NO_GETTEXT_MACRO"
LDFLAGS="$USER_LDFLAGS $LIBSIGC_LIBS"
CPPFLAGS="$USER_CPPFLAGS -DPOSIX -fPIC $WX_CPPFLAGS $LIBSIGC_CFLAGS -DWXINTL_NO_GETTEXT_MACRO $FMTLIB_CPPFLAGS"
LDFLAGS="$USER_LDFLAGS $LIBSIGC_LIBS $FMTLIB_LDFLAGS"
# Debug/optimisation
if test "$debug_build" != 'no'
......@@ -394,5 +411,11 @@ else
fi
fi
echo " Use boost.filesystem: $use_boost_filesystem"
#if test "$found_local_fmtlib" = "yes"
#then
# echo " Use system fmtlib: yes"
#else
# echo " Use system fmtlib: no"
#fi
echo " Use boost.filesystem: $use_boost_filesystem"
......@@ -149,18 +149,19 @@ private:
{
// Try to cast the string value to numbers
try {
_intValue = boost::lexical_cast<int>(_strValue);
_intValue = std::stoi(_strValue);
// cast succeeded
_type |= ARGTYPE_INT;
}
catch (boost::bad_lexical_cast) {}
catch (std::logic_error&) {}
try {
_doubleValue = boost::lexical_cast<double>(_strValue);
try
{
_doubleValue = std::stod(_strValue);
// cast succeeded
_type |= ARGTYPE_DOUBLE;
}
catch (boost::bad_lexical_cast) {}
catch (std::invalid_argument&) {}
}
void tryVectorConversion()
......
......@@ -8,7 +8,10 @@
#include <cstddef>
#include <string>
#include <list>
#include <set>
#include <functional>
#include <algorithm>
#include "imodule.h"
......@@ -18,9 +21,25 @@ class ArchiveTextFile;
typedef std::shared_ptr<ArchiveTextFile> ArchiveTextFilePtr;
class Archive;
class ModuleObserver;
namespace vfs
{
const std::string MODULE_VIRTUALFILESYSTEM("VirtualFileSystem");
// Extension of std::list to check for existing paths before inserting new ones
class SearchPaths :
public std::list<std::string>
{
public:
bool insertIfNotExists(const std::string& path)
{
if (std::find(begin(), end(), path) != end())
{
return false;
}
push_back(path);
return true;
}
};
/**
* Main interface for the virtual filesystem.
......@@ -36,10 +55,11 @@ class VirtualFileSystem :
public RegisterableModule
{
public:
virtual ~VirtualFileSystem() {}
// Functor taking the filename as argument. The filename is relative
// to the base path passed to the GlobalFileSystem().foreach*() method.
typedef std::function<void (const std::string& filename)> VisitorFunc;
// to the base path passed to the GlobalFileSystem().foreach*() method.
typedef std::function<void(const std::string& filename)> VisitorFunc;
/**
* Interface for VFS observers.
......@@ -47,9 +67,10 @@ public:
* A VFS observer is automatically notified of events relating to the
* VFS, including startup and shutdown.
*/
class Observer {
class Observer
{
public:
virtual ~Observer() {}
virtual ~Observer() {}
/**
* Notification of VFS initialisation.
......@@ -72,9 +93,10 @@ public:
/// Called before \c initialise.
virtual void initDirectory(const std::string& path) = 0;
/// \brief Initialises the filesystem.
/// Called after all root search paths have been added.
virtual void initialise() = 0;
typedef std::set<std::string> ExtensionSet;
// Initialises the filesystem using the given search order.
virtual void initialise(const SearchPaths& vfsSearchPaths, const ExtensionSet& allowedArchiveExtensions) = 0;
/// \brief Shuts down the filesystem.
virtual void shutdown() = 0;
......@@ -90,31 +112,31 @@ public:
// greebo: Note: expects the filename to be normalised (forward slashes, trailing slash).
virtual ArchiveFilePtr openFile(const std::string& filename) = 0;
/// \brief Returns the file identified by \p filename opened in binary mode, or 0 if not found.
// This is a variant of openFile taking an absolute path as argument.
virtual ArchiveFilePtr openFileInAbsolutePath(const std::string& filename) = 0;
/// \brief Returns the file identified by \p filename opened in binary mode, or 0 if not found.
// This is a variant of openFile taking an absolute path as argument.
virtual ArchiveFilePtr openFileInAbsolutePath(const std::string& filename) = 0;
/// \brief Returns the file identified by \p filename opened in text mode, or 0 if not found.
virtual ArchiveTextFilePtr openTextFile(const std::string& filename) = 0;
/// \brief Returns the file identified by \p filename opened in text mode, or NULL if not found.
/// This is a variant of openTextFile taking an absolute path as argument.
virtual ArchiveTextFilePtr openTextFileInAbsolutePath(const std::string& filename) = 0;
/// \brief Returns the file identified by \p filename opened in text mode, or NULL if not found.
/// This is a variant of openTextFile taking an absolute path as argument.
virtual ArchiveTextFilePtr openTextFileInAbsolutePath(const std::string& filename) = 0;
/// \brief Calls the visitor function for each file under \p basedir matching \p extension.
/// Use "*" as \p extension to match all file extensions.
virtual void forEachFile(const std::string& basedir,
const std::string& extension,
const VisitorFunc& visitorFunc,
std::size_t depth = 1) = 0;
// Similar to forEachFile, this routine traverses an absolute path
// searching for files matching a certain extension and invoking
// the givne visitor functor on each occurrence.
virtual void forEachFileInAbsolutePath(const std::string& path,
const std::string& extension,
const VisitorFunc& visitorFunc,
std::size_t depth = 1) = 0;
virtual void forEachFile(const std::string& basedir,
const std::string& extension,
const VisitorFunc& visitorFunc,
std::size_t depth = 1) = 0;
// Similar to forEachFile, this routine traverses an absolute path
// searching for files matching a certain extension and invoking
// the givne visitor functor on each occurrence.
virtual void forEachFileInAbsolutePath(const std::string& path,
const std::string& extension,
const VisitorFunc& visitorFunc,
std::size_t depth = 1) = 0;
/// \brief Returns the absolute filename for a relative \p name, or "" if not found.
virtual std::string findFile(const std::string& name) = 0;
......@@ -122,13 +144,20 @@ public:
/// \brief Returns the filesystem root for an absolute \p name, or "" if not found.
/// This can be used to convert an absolute name to a relative name.
virtual std::string findRoot(const std::string& name) = 0;
// Returns the list of registered VFS paths, ordered by search priority
virtual const SearchPaths& getVfsSearchPaths() = 0;
};
inline VirtualFileSystem& GlobalFileSystem()
}
const char* const MODULE_VIRTUALFILESYSTEM("VirtualFileSystem");
inline vfs::VirtualFileSystem& GlobalFileSystem()
{
// Cache the reference locally
static VirtualFileSystem& _vfs(
*std::static_pointer_cast<VirtualFileSystem>(
static vfs::VirtualFileSystem& _vfs(
*std::static_pointer_cast<vfs::VirtualFileSystem>(
module::GlobalModuleRegistry().getModule(MODULE_VIRTUALFILESYSTEM)
)
);
......
#ifndef IGAMEMANAGER_H_
#define IGAMEMANAGER_H_
#pragma once
#include "xmlutil/Node.h"
#include "imodule.h"
#include <list>
// String identifier for the game manager module
const std::string MODULE_GAMEMANAGER("GameManager");
const char* const MODULE_GAMEMANAGER("GameManager");
const char* const RKEY_GAME_TYPE = "user/game/type";
const char* const RKEY_FS_GAME = "user/game/fs_game";
const char* const RKEY_FS_GAME_BASE = "user/game/fs_game_base";
const char* const RKEY_ENGINE_PATH = "user/paths/enginePath";
const char* const RKEY_MOD_PATH = "user/paths/modPath";
const char* const RKEY_MOD_BASE_PATH = "user/paths/modBasePath";
namespace game
{
......@@ -61,12 +67,6 @@ public:
// engine path is returned, e.g. /usr/local/doom3 or c:\games\doom3
virtual std::string getUserEnginePath() = 0;
// Returns the setting for fs_game
virtual const std::string& getFSGame() const = 0;
// Returns the setting for fs_game_base (can be empty)
virtual const std::string& getFSGameBase() const = 0;
/**
* greebo: Gets the mod path (e.g. ~/.doom3/gathers/).
* Returns the mod base path if the mod path itself is empty.
......@@ -89,13 +89,17 @@ public:
// Returns the list of ordered engine paths, which should
// be initialised by the Virtual Filesystem (in this exact order)
virtual const PathList& getVFSSearchPaths() const = 0;
typedef std::vector<IGamePtr> GameList;
virtual const GameList& getSortedGameList() = 0;
};
typedef std::shared_ptr<IGameManager> IGameManagerPtr;
} // namespace game
// This is the accessor for the game manager
inline game::IGameManager& GlobalGameManager() {
inline game::IGameManager& GlobalGameManager()
{
// Cache the reference locally
static game::IGameManager& _gameManager(
*std::static_pointer_cast<game::IGameManager>(
......@@ -104,5 +108,3 @@ inline game::IGameManager& GlobalGameManager() {
);
return _gameManager;
}
#endif /*IGAMEMANAGER_H_*/
This diff is collapsed.
......@@ -25,7 +25,6 @@ const char* const RKEY_APP_PATH = "user/paths/appPath";
const char* const RKEY_HOME_PATH = "user/paths/homePath";
const char* const RKEY_SETTINGS_PATH = "user/paths/settingsPath";
const char* const RKEY_BITMAPS_PATH = "user/paths/bitmapsPath";
const char* const RKEY_ENGINE_PATH = "user/paths/enginePath";
const char* const RKEY_MAP_PATH = "user/paths/mapPath";
const char* const RKEY_PREFAB_PATH = "user/paths/prefabPath";
......
......@@ -6,7 +6,6 @@
#include <sigc++/slot.h>
#include <sigc++/signal.h>
#include <boost/lexical_cast.hpp>
namespace {
const std::string RKEY_SKIP_REGISTRY_SAVE = "user/skipRegistrySaveOnShutdown";
......
/**
* greebo: Precompiled header module. This is included by the respective precompiled.h
* files throughout the project. Many of those include boost headers into the
* pre-compilation, and they do so by #include'ing this file.
*/
#pragma once
#include <memory>
#include <functional>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/noncopyable.hpp>
......@@ -5,11 +5,6 @@
*/
#pragma once
#ifdef DR_PRECOMPILED_BOOST
// Include common boost headers that don't have link dependencies
#include "precompiled_boost.h"
#endif
#ifdef DR_PRECOMPILED_WXWIDGETS
#include <wx/wx.h>
#include <wx/artprov.h>
......@@ -24,3 +19,6 @@
// Add DarkRadiant interfaces
#include "precompiled_interfaces.h"
#endif
#include <memory>
#include <functional>
/**
* greebo: Precompiled header module. This is included by the respective precompiled.h
* files throughout the project. Many of those include boost headers into the
* pre-compilation, and they do so by #include'ing this file.
* files throughout the project.
*/
#pragma once
......
......@@ -2,7 +2,7 @@
#include <config.h>
#define RADIANT_VERSION PACKAGE_VERSION
#else
#define RADIANT_VERSION "2.4.0"
#define RADIANT_VERSION "2.5.0"
#endif
#define RADIANT_APPNAME "DarkRadiant"
......
......@@ -8,7 +8,7 @@
enginepath_macos="/usr/local/games/darkmod/"
engine_win32="TheDarkMod.exe"
engine_linux="thedarkmod.x86"
engine_macos="thedarkmod"
engine_macos="thedarkmod.app"
prefix=""
basegame=""
archivetypes="pk4"
......@@ -22,6 +22,12 @@
registryKey="SOFTWARE\id\Doom 3"
registryValue="InstallPath"
>
<!-- Settings used by the Game Setup Dialog -->
<gameSetup>
<dialog type="TDM" /><!-- Indicates the TDM-style setup dialog showing options for engine path and mission -->
<missionFolder value="fms/" />
</gameSetup>
<!-- Types of resource files which are used by this game -->
<filetypes>
<texture>
......
This diff is collapsed.
This diff is collapsed.
......@@ -23,7 +23,7 @@
<menuItem name="reloadDefs" caption="Reload Defs" command="ReloadDefs" />
<menuItem name="reloadParticles" caption="Reload Particles" command="ReloadParticles" icon="particle16.png" />
<menuSeparator />
<menuItem name="gameSelector" caption="Select &amp;Game..." command="ProjectSettings" />
<menuItem name="gameSelector" caption="&amp;Game/Project Setup..." command="ProjectSettings" />
<menuSeparator />
<menuItem name="pointfile" caption="&amp;Pointfile" command="TogglePointfile" icon="pointfile16.png"/>
<menuSeparator />
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
<object class="wxPanel" name="MissionInfoEditDialogMainPanel">
<style>wxTAB_TRAVERSAL</style>
<size>900,546</size>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>12</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxSplitterWindow" name="MissionInfoEditDialogSplitter">
<style>wxSP_3D|wxSP_LIVE_UPDATE</style>
<sashpos>350</sashpos>
<gravity>1</gravity>