Commit fd604b42 authored by Tobias Frost's avatar Tobias Frost

New upstream version 2.4.0

parent d85dbfa3
......@@ -57,3 +57,5 @@ Makefile.in
/install/*.zip
/tools/msvc/.vs
/tools/msvc/DarkRadiant.VC.db
/tools/innosetup/*.zip
/tools/lwo_analyse/.vs
This diff is collapsed.
LICENSE ( last update: Wed Feb 8 17:16:40 CST 2006 )
-----------------------------------------------------
There are 3 license types used throughout GtkRadiant source code.
BSD - modified Berkeley Software Distribution license
( each BSD licensed source file starts with the appropriate header )
LGPL - GNU Lesser General Public License v2.1
( see LGPL at the root of the tree )
GPL - GNU General Public License
( see GPL at the root of the tree )
How do I check which license applies to a given part of the source code?
Each source file in the tree comes with a license header which explains what
license applies. To sum up shortly:
GPL: ( except some files contributed by Loki Software under BSD license )
GtkRadiant Core
GtkRadiant Modules
GtkRadiant Libraries
Quake III Tools
Quake II Tools
Background2D Plugin
HydraToolz Plugin
BSD:
JPEG Library
MD5 Library
DDS Library
PicoModel Library
PrtView Plugin
LGPL
BobToolz Plugin
GenSurf Plugin
DarkRadiant License (last update: 2017-09-12)
----------------------------------------------------------------------------------------------
DarkRadiant is free software originally based on GtkRadiant, which has been licensed under
the GNU General Public License (GPLv2) http://www.gnu.org/licenses/gpl-2.0.html
Therefore all of the DarkRadiant source code (save a few exceptions noted below) is published
under the same GPLv2 license. Unless stated otherwise in the source file header, the following
applies to the DarkRadiant source code:
DarkRadiant - Open Source Level Editor for Doom 3 and The Dark Mod
Copyright (C) 2017 Matthias Baumann (on behalf of the DarkRadiant Team, see AUTHORS file)
==========================================================================================
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program;
if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110, USA
==========================================================================================
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
# Maintainer: codereader <greebo[AT]angua[DOT]at>
pkgname=darkradiant
pkgver=2.3.0
pkgver=2.4.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.3.0")
source=("$pkgname::git+https://github.com/codereader/DarkRadiant.git#tag=2.4.0")
md5sums=("SKIP")
build() {
......
......@@ -45,11 +45,10 @@ To compile DarkRadiant, a number of libraries (with development headers) and a s
* libftgl-dev
* libglew-dev
* libboost-dev
* libboost-filesystem-dev
* libboost-python-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
......@@ -99,7 +98,7 @@ similar to this:
The `DarkRadiant.app` package in that folder can be launched right away or
copied to some location of your preference.
# More Information
# More Build Information
A more detailed compilation guide can be found on The Dark Mod's wiki:
......@@ -114,3 +113,8 @@ and discuss changes or issues. If you happen to run into a bug, you're encourage
application crashes (see also [How to record a crashdump](http://wiki.thedarkmod.com/index.php?title=Save_a_Memory_Dump_for_debugging_Crashes)).
The issue tracker for DarkRadiant is also run by the Dark Mod folks: [DarkRadiant Bugtracker](http://bugs.thedarkmod.com/view_all_bug_page.php?project_id=1).
# License
The DarkRadiant source code is published under the [GNU General Public License 2.0 (GPLv2)](http://www.gnu.org/licenses/gpl-2.0.html
), except for a few libraries which are using the BSD license, see the [LICENSE](https://raw.githubusercontent.com/codereader/DarkRadiant/master/LICENSE) file for further notes.
\ No newline at end of file
#!/bin/bash
#!/usr/bin/env bash
aclocal -I m4
# Use the glibtoolize command in OSX
case "$OSTYPE" in
......
AC_INIT([darkradiant], [2.3.0])
AC_INIT([darkradiant], [2.4.0])
AM_INIT_AUTOMAKE([subdir-objects])
AM_SILENT_RULES([yes])
......@@ -48,6 +48,9 @@ AC_PROG_LIBTOOL
# We require a C++11-compliant compiler, without nonstandard extensions
AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
# We require the cstdint header to be present
AC_CHECK_HEADER([cstdint], [], [AC_MSG_ERROR([Could not find the <cstdint> header.])])
# Optional features
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
......@@ -65,6 +68,10 @@ AC_ARG_ENABLE([python],
[python_scripting=$enableval],
[python_scripting='yes'])
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)
......@@ -149,21 +156,51 @@ if test "$build_linux" != "no"; then
AC_SUBST([GLU_LIBS])
fi
# By default, we rely on boost.filesystem, unless we have the C++17 libs
use_boost_filesystem=yes
# Check for the regular C++17 <filesystem> header
AC_CHECK_HEADER([filesystem], [found_std_filesystem=yes], [found_std_filesystem=no])
# if no <filesystem> is present, check for the pre-C++17 header <experimental/filesystem>
if test "$found_std_filesystem" = "yes"
then
AC_DEFINE([HAVE_STD_FILESYSTEM], [1], [Define this to indicate that the <filesystem> header is available for inclusion.])
use_boost_filesystem=no
else
AC_CHECK_HEADER([experimental/filesystem], [found_experimental_filesystem=yes], [found_experimental_filesystem=no])
if test "$found_experimental_filesystem" = "yes"
then
AC_DEFINE([HAVE_EXPERIMENTAL_FILESYSTEM], [1], [Define this to indicate that the <experimental/filesystem>
header is available for inclusion.])
use_boost_filesystem=no
fi
fi
# Boost
BOOST_REQUIRE([1.46.1])
# Check a load of common headers we use
BOOST_BIND
BOOST_FOREACH
# Check some boost headers we use
BOOST_FORMAT
BOOST_FUNCTION
BOOST_SMART_PTR
BOOST_TOKENIZER
# These ones require libraries too
# BOOST_REGEX # no longer needed, using std::regex now
BOOST_FILESYSTEM
BOOST_SYSTEM
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])
BOOST_FILESYSTEM
BOOST_SYSTEM
FILESYSTEM_LIBS="$(BOOST_FILESYSTEM_LIBS) $(BOOST_SYSTEM_LIBS)"
else
AC_MSG_NOTICE([Will use std::filesystem instead of boost.filesystem])
FILESYSTEM_LIBS="-lstdc++fs"
fi
AC_SUBST([FILESYSTEM_LIBS])
BOOST_TEST
# Boost.Python if required
......@@ -173,12 +210,42 @@ then
if test ! -z "$PYTHON_CONFIG"
then
PYTHON_LIBS=`$PYTHON_CONFIG --libs`
BOOST_PYTHON
PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes`
PYBIND11_CPPFLAGS=``
# Add the path to the pybind11 library if we got one from the arguments
if test "x$pybind11_include_path" != x ; then
PYBIND11_CPPFLAGS="-I$pybind11_include_path"
fi
# pybind11.h is including Python.h, need to help it find the Python.h header
CPPFLAGS="$USER_CPPFLAGS $PYTHON_CPPFLAGS $PYBIND11_CPPFLAGS"
AC_MSG_NOTICE([Checking for pybind11 headers...])
found_local_pybind11=no
# 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'])
script_module='script'
AC_SUBST([script_module])
AC_SUBST([PYTHON_CPPFLAGS])
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYBIND11_CPPFLAGS])
AC_SUBST([SYSTEM_HAS_PYBIND11]) # Used by Makefile.am in plugins/script/
fi
else
AM_CONDITIONAL([SYSTEM_HAS_PYBIND11], [false])
fi
# dynamic link library
......@@ -301,22 +368,31 @@ Configuration options:"
echo " Installation prefix: $prefix"
if test -n "$sound_module"
then
echo " Sound: yes"
echo " Sound: yes"
else
echo " Sound: no"
echo " Sound: no"
fi
if test "$darkmod_plugins" != 'no'
then
echo " Darkmod plugins: yes"
echo " Darkmod plugins: yes"
else
echo " Darkmod plugins: no"
echo " Darkmod plugins: no"
fi
if test -z "$script_module"
then
echo " Python scripting: no"
echo " Python scripting: no"
else
echo " Python scripting: yes"
echo " Python scripting: yes"
if test "$found_local_pybind11" = "yes"
then
echo " Use system pybind11: yes"
else
echo " Use system pybind11: no"
fi
fi
echo " Use boost.filesystem: $use_boost_filesystem"
......@@ -8,9 +8,16 @@
#endif
#include <wx/intl.h>
#include <string>
// Custom translation macros
#define _(s) (wxGetTranslation((s)).ToStdString())
inline std::string _(const char* s)
{
return wxGetTranslation((s)).ToStdString();
}
//#define _(s) (wxGetTranslation((s)).ToStdString())
#define N_(str) str
#ifndef C_
......
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined(INCLUDED_IARCHIVE_H)
#define INCLUDED_IARCHIVE_H
#pragma once
/**
* \file iarchive.h
......@@ -79,29 +57,29 @@ public:
};
typedef std::shared_ptr<ArchiveTextFile> ArchiveTextFilePtr;
class CustomArchiveVisitor;
/**
* Representation of a ZIP archive.
* Representation of an archive in the virtual filesystem.
* This might be a PK4/ZIP file or a regular mod directory.
*
* \ingroup vfs
*/
class Archive
{
public:
/**
* Visitor class for traversing files within an Archive.
*/
class Visitor
{
public:
virtual ~Visitor() {}
virtual void visit(const std::string& name) = 0;
};
virtual ~Visitor() {}
// Invoked for each file in an Archive
virtual void visitFile(const std::string& name) = 0;
typedef CustomArchiveVisitor VisitorFunc;
// Invoked for each directory in an Archive. Return true to skip the directory.
virtual bool visitDirectory(const std::string& name, std::size_t depth) = 0;
};
enum EMode {
enum EMode
{
eFiles = 0x01,
eDirectories = 0x02,
eFilesAndDirectories = 0x03,
......@@ -122,44 +100,17 @@ public:
/// Name comparisons are case-insensitive.
virtual bool containsFile(const std::string& name) = 0;
/// \brief Performs a depth-first traversal of the archive tree starting at \p root.
/// Traverses the entire tree if \p root is "".
/// When a file is encountered, calls \c visitor.file passing the file name.
/// When a directory is encountered, calls \c visitor.directory passing the directory name.
/// Skips the directory if \c visitor.directory returned true.
/// Root comparisons are case-insensitive.
/// Names are mixed-case.
virtual void forEachFile(VisitorFunc visitor, const std::string& root) = 0;
/// \brief Performs a depth-first traversal of the archive tree starting at \p root.
/// Traverses the entire tree if \p root is "".
/// When a file is encountered, calls \c visitor.file passing the file name.
/// When a directory is encountered, calls \c visitor.directory passing the directory name.
/// Skips the directory if \c visitor.directory returned true.
/// Root comparisons are case-insensitive.
/// Names are mixed-case.
virtual void traverse(Visitor& visitor, const std::string& root) = 0;
};
typedef std::shared_ptr<Archive> ArchivePtr;
class CustomArchiveVisitor
{
Archive::Visitor* m_visitor;
Archive::EMode m_mode;
std::size_t m_depth;
public:
CustomArchiveVisitor(Archive::Visitor& visitor, Archive::EMode mode, std::size_t depth)
: m_visitor(&visitor), m_mode(mode), m_depth(depth)
{
}
void file(const std::string& name)
{
if((m_mode & Archive::eFiles) != 0)
m_visitor->visit(name);
}
bool directory(const std::string& name, std::size_t depth)
{
if ((m_mode & Archive::eDirectories) != 0) {
m_visitor->visit(name);
}
if (depth == m_depth) {
return true;
}
return false;
}
};
const std::string MODULE_ARCHIVE("Archive");
/**
......@@ -183,7 +134,8 @@ public:
*
* \ingroup vfs
*/
inline ArchiveLoader& GlobalArchive(const std::string& fileType) {
inline ArchiveLoader& GlobalArchive(const std::string& fileType)
{
// Cache the reference locally
static ArchiveLoader& _archive(
*std::static_pointer_cast<ArchiveLoader>(
......@@ -192,5 +144,3 @@ inline ArchiveLoader& GlobalArchive(const std::string& fileType) {
);
return _archive;
}
#endif
#ifndef ICLIPPER_H_
#define ICLIPPER_H_
#pragma once
#include "imodule.h"
#include "iorthoview.h"
#include "math/Vector3.h"
/** Abstract base class for the clipper module
*/
// The possible split modes
enum EBrushSplit {
eFront,
......@@ -39,7 +35,8 @@ struct BrushSplitType {
class ClipPoint;
const std::string MODULE_CLIPPER("Clipper");
const char* const MODULE_CLIPPER("Clipper");
const char* const RKEY_CLIPPER_CAULK_SHADER("user/ui/clipper/caulkTexture");
/* greebo: This is the interface the clipper module has to provide.
*/
......@@ -89,8 +86,9 @@ public:
virtual void update() = 0;
};
// This is the accessor for the registry
inline IClipper& GlobalClipper() {
// The accessor for the clipper module
inline IClipper& GlobalClipper()
{
// Cache the reference locally
static IClipper& _clipper(
*std::static_pointer_cast<IClipper>(
......@@ -99,5 +97,3 @@ inline IClipper& GlobalClipper() {
);
return _clipper;
}
#endif /*ICLIPPER_H_*/
#ifndef _ICOMMANDSYSTEM_H_
#define _ICOMMANDSYSTEM_H_
#pragma once
#include <memory>
#include <functional>
......@@ -10,7 +9,8 @@
#include "string/convert.h"
namespace cmd {
namespace cmd
{
// Use these to define argument types
enum ArgumentTypeFlags
......@@ -114,32 +114,39 @@ public:
_type(other._type)
{}
std::size_t getType() const {
std::size_t getType() const
{
return _type;
}
std::string getString() const {
std::string getString() const
{
return _strValue;
}
int getInt() const {
int getInt() const
{
return _intValue;
}
double getDouble() const {
double getDouble() const
{
return _doubleValue;
}
Vector3 getVector3() const {
Vector3 getVector3() const
{
return _vector3Value;
}
Vector2 getVector2() const {
Vector2 getVector2() const
{
return _vector2Value;
}
private:
void tryNumberConversion() {
void tryNumberConversion()
{
// Try to cast the string value to numbers
try {
_intValue = boost::lexical_cast<int>(_strValue);
......@@ -156,7 +163,8 @@ private:
catch (boost::bad_lexical_cast) {}
}
void tryVectorConversion() {
void tryVectorConversion()
{
// Use a stringstream to parse the string
std::stringstream strm(_strValue);
strm << std::skipws;
......@@ -202,26 +210,39 @@ public:
{}
// Additional convenience constructors
Signature(std::size_t type1) {
Signature(std::size_t type1)
{
push_back(type1);
}
Signature(std::size_t type1, std::size_t type2)
{
push_back(type1);
push_back(type2);
}
Signature(std::size_t type1, std::size_t type2) {
Signature(std::size_t type1, std::size_t type2, std::size_t type3)
{
push_back(type1);
push_back(type2);
push_back(type3);
}
Signature(std::size_t type1, std::size_t type2, std::size_t type3) {
Signature(std::size_t type1, std::size_t type2, std::size_t type3, std::size_t type4)
{
push_back(type1);
push_back(type2);
push_back(type3);
push_back(type4);
}
Signature(std::size_t type1, std::size_t type2, std::size_t type3, std::size_t type4) {
Signature(std::size_t type1, std::size_t type2, std::size_t type3, std::size_t type4, std::size_t type5)
{
push_back(type1);
push_back(type2);
push_back(type3);
push_back(type4);
push_back(type5);
}
};
......@@ -326,10 +347,11 @@ typedef std::shared_ptr<ICommandSystem> ICommandSystemPtr;
} // namespace cmd
const std::string MODULE_COMMANDSYSTEM("CommandSystem");
const char* const MODULE_COMMANDSYSTEM("CommandSystem");
// This is the accessor for the commandsystem
inline cmd::ICommandSystem& GlobalCommandSystem() {
inline cmd::ICommandSystem& GlobalCommandSystem()
{
// Cache the reference locally
static cmd::ICommandSystem& _cmdSystem(
*std::static_pointer_cast<cmd::ICommandSystem>(
......@@ -338,5 +360,3 @@ inline cmd::ICommandSystem& GlobalCommandSystem() {
);
return _cmdSystem;
}
#endif /* _ICOMMANDSYSTEM_H_ */
......@@ -101,15 +101,6 @@ public:
/// This is a variant of openTextFile taking an absolute path as argument.
virtual ArchiveTextFilePtr openTextFileInAbsolutePath(const std::string& filename) = 0;
/// \brief Opens the file identified by \p filename and reads it into \p buffer, or sets *\p buffer to 0 if not found.
/// Returns the size of the buffer allocated, or undefined value if *\p buffer is 0;
/// The caller must free the allocated buffer by calling \c freeFile
/// \deprecated Deprecated - use \c openFile.
virtual std::size_t loadFile(const std::string& filename, void **buffer) = 0;
/// \brief Frees the buffer returned by \c loadFile.
/// \deprecated Deprecated.
virtual void freeFile(void *p) = 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,