Skip to content

Commit

Permalink
Merge remote-tracking branch 'greebo/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mott committed Nov 22, 2022
2 parents afbe846 + fd8d6d0 commit 0020a73
Show file tree
Hide file tree
Showing 112 changed files with 6,581 additions and 582 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -51,7 +51,7 @@ jobs:
shell: powershell

- name: Setup VSTest.console.exe
uses: darenm/Setup-VSTest@v1
uses: darenm/Setup-VSTest@v1.2

- name: Run Unit Tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.12)

# Project name and version
project(darkradiant VERSION 3.6.0)
project(darkradiant VERSION 3.7.0)

# C++ standard
set(CMAKE_CXX_STANDARD 17)
Expand Down
4 changes: 2 additions & 2 deletions PKGBUILD
@@ -1,14 +1,14 @@
# Maintainer: codereader <greebo[AT]angua[DOT]at>
pkgname=darkradiant
pkgver=3.6.0
pkgver=3.7.0
pkgrel=1
pkgdesc="Level Editor for Doom 3 (idTech4) and The Dark Mod"
arch=("x86_64")
url="https://www.darkradiant.net/"
license=("GPL")
depends=(wxgtk2 ftgl glew freealut libvorbis python libsigc++ eigen)
makedepends=(cmake git)
source=("$pkgname::git+https://github.com/codereader/DarkRadiant.git#tag=3.6.0")
source=("$pkgname::git+https://github.com/codereader/DarkRadiant.git#tag=3.7.0")
md5sums=("SKIP")

build() {
Expand Down
12 changes: 12 additions & 0 deletions include/ideclmanager.h
Expand Up @@ -183,6 +183,18 @@ class IDeclarationManager :
// Signal emitted when the decls of the given type have been (re-)loaded
// Note that this signal can be fired on an arbitrary thread
virtual sigc::signal<void>& signal_DeclsReloaded(Type type) = 0;

// Signal emitted when a declaration is renamed
// The type, the old name and the new name will be passed as arguments
virtual sigc::signal<void(Type, const std::string&, const std::string&)>& signal_DeclRenamed() = 0;

// Signal emitted when a declaration has been created (e.g. by findOrCreateDeclaration),
// passing the type and name of the created decl as argument
virtual sigc::signal<void(Type, const std::string&)>& signal_DeclCreated() = 0;

// Signal emitted when a declaration has been removed (by removeDeclaration),
// passing the type and name of the removed decl as argument
virtual sigc::signal<void(Type, const std::string&)>& signal_DeclRemoved() = 0;
};

}
Expand Down
21 changes: 10 additions & 11 deletions include/ientity.h
@@ -1,7 +1,6 @@
#pragma once

#include "inode.h"
#include "ipath.h"
#include "imodule.h"
#include "irender.h"
#include "inameobserver.h"
Expand Down Expand Up @@ -369,8 +368,8 @@ class IEntitySelection
// Returns the number of selected entities
virtual std::size_t size() const = 0;

// Iterates over each selected entity, invoking the given functor
virtual void foreachEntity(const std::function<void(Entity*)>& functor) = 0;
// Iterates over each selected entity node, invoking the given functor
virtual void foreachEntity(const std::function<void(const IEntityNodePtr&)>& functor) = 0;

// Returns the key value shared by all entities in this set, or an empty string
// if there is no such value.
Expand Down Expand Up @@ -462,13 +461,13 @@ enum class LightEditVertexType : std::size_t
NumberOfVertexTypes,
};

const char* const RKEY_SHOW_ENTITY_NAMES("user/ui/xyview/showEntityNames");
const char* const RKEY_SHOW_ALL_SPEAKER_RADII = "user/ui/showAllSpeakerRadii";
const char* const RKEY_SHOW_ALL_LIGHT_RADII = "user/ui/showAllLightRadii";
const char* const RKEY_DRAG_RESIZE_SYMMETRICALLY = "user/ui/dragResizeEntitiesSymmetrically";
const char* const RKEY_ALWAYS_SHOW_LIGHT_VERTICES = "user/ui/alwaysShowLightVertices";
const char* const RKEY_FREE_OBJECT_ROTATION = "user/ui/rotateObjectsIndependently";
const char* const RKEY_SHOW_ENTITY_ANGLES = "user/ui/xyview/showEntityAngles";
constexpr const char* const RKEY_SHOW_ENTITY_NAMES("user/ui/xyview/showEntityNames");
constexpr const char* const RKEY_SHOW_ALL_SPEAKER_RADII = "user/ui/showAllSpeakerRadii";
constexpr const char* const RKEY_SHOW_ALL_LIGHT_RADII = "user/ui/showAllLightRadii";
constexpr const char* const RKEY_DRAG_RESIZE_SYMMETRICALLY = "user/ui/dragResizeEntitiesSymmetrically";
constexpr const char* const RKEY_ALWAYS_SHOW_LIGHT_VERTICES = "user/ui/alwaysShowLightVertices";
constexpr const char* const RKEY_FREE_OBJECT_ROTATION = "user/ui/rotateObjectsIndependently";
constexpr const char* const RKEY_SHOW_ENTITY_ANGLES = "user/ui/xyview/showEntityAngles";

/**
* Global entity settings affecting appearance, render options, etc.
Expand Down Expand Up @@ -505,7 +504,7 @@ class IEntitySettings
virtual sigc::signal<void>& signal_settingsChanged() = 0;
};

const char* const MODULE_ENTITY("EntityModule");
constexpr const char* const MODULE_ENTITY("EntityModule");

/**
* \brief
Expand Down
76 changes: 69 additions & 7 deletions include/modelskin.h
@@ -1,10 +1,14 @@
#pragma once

#include <vector>
#include <set>
#include "imodule.h"
#include <sigc++/signal.h>
#include "ideclmanager.h"

constexpr const char* const SKINS_FOLDER = "skins/";
constexpr const char* const SKIN_FILE_EXTENSION = ".skin";

namespace decl
{

Expand All @@ -14,14 +18,54 @@ class ISkin :
public:
using Ptr = std::shared_ptr<ISkin>;

virtual ~ISkin() {}
~ISkin() override {}

/**
* Get the mapped texture for the given query texture, using the mappings
* in this skin. If there is no mapping for the given texture, return an
* empty string.
*/
virtual std::string getRemap(const std::string& name) = 0;
struct Remapping
{
// The original material name (can also be a wildcard "*")
std::string Original;

// The replacement material name
std::string Replacement;
};

/**
* Get the mapped texture for the given query texture, using the mappings
* in this skin. If there is no mapping for the given texture, return an
* empty string.
*/
virtual std::string getRemap(const std::string& name) = 0;

// Returns the list of models this skin applies to
virtual const std::set<std::string>& getModels() = 0;

// Adds the given model to the set of associated models (does nothing if the model is already present)
virtual void addModel(const std::string& model) = 0;

// Removes the given model from the set of models (does nothing if the model is not listed)
virtual void removeModel(const std::string& model) = 0;

// The list of all remappings defined in this skin
virtual const std::vector<Remapping>& getAllRemappings() = 0;

// Adds the given remapping to this skin (doesn't check for redundancy)
virtual void addRemapping(const Remapping& remapping) = 0;

// Removes the remapping for the given (source) material
virtual void removeRemapping(const std::string& material) = 0;

// Removes all remappings from this skin
virtual void clearRemappings() = 0;

// Returns true if the skin has changed since it has been parsed
virtual bool isModified() = 0;

// Save any modifications, after this call isModified() will return false
virtual void commitModifications() = 0;

// Discard any modifications, reverting this to the state it had after parsing.
// After this call isModified() will return false again.
virtual void revertModifications() = 0;
};

} // namespace
Expand Down Expand Up @@ -61,6 +105,18 @@ class IModelSkinCache :
*/
virtual ISkin::Ptr findSkin(const std::string& name) = 0;

/**
* Copies the existing material and creates a new skin with the suggested name.
* If the suggested name is already present, a non-conflicting name will be generated and used instead.
* Returns the new skin reference - or an empty reference if the original skin is not existing
* or if the suggested name is empty.
*/
virtual ISkin::Ptr copySkin(const std::string& nameOfOriginal, const std::string& nameOfCopy) = 0;

// Renames the skin named oldName to newName, and returns true if the operation was successful.
// If the new name is already in use, this returns false too.
virtual bool renameSkin(const std::string& oldName, const std::string& newName) = 0;

/**
* Return the skins associated with the given model.
*
Expand All @@ -80,6 +136,12 @@ class IModelSkinCache :
*/
virtual const StringList& getAllSkins() = 0;

/**
* A skin can be modified if it has been declared in a physical file,
* i.e. outside a PAK file.
*/
virtual bool skinCanBeModified(const std::string& name) = 0;

/**
* greebo: Reloads all skins from the definition files.
*/
Expand Down
7 changes: 7 additions & 0 deletions include/ui/ientityinspector.h
Expand Up @@ -101,6 +101,13 @@ class IPropertyEditor
* Instructs the editor to update its widgets from the edited entity's key values.
*/
virtual void updateFromEntities() = 0;

/**
* A signal that is emitted when a key value has been applied to one or more selected entities.
* (This is used as a feedback channel for the EntityInspector UI to get notified when
* a value has been set, such that the text entry boxes can follow along.)
*/
virtual sigc::signal<void(const std::string&, const std::string&)>& signal_keyValueApplied() = 0;
};

class IEntityInspectorModule :
Expand Down
2 changes: 1 addition & 1 deletion include/version.h
Expand Up @@ -4,7 +4,7 @@
#include <config.h>
#define RADIANT_VERSION PACKAGE_VERSION
#else
#define RADIANT_VERSION "3.6.0"
#define RADIANT_VERSION "3.7.0"
#endif

#define RADIANT_APPNAME "DarkRadiant"
Expand Down
2 changes: 2 additions & 0 deletions install/menu.xml
Expand Up @@ -193,6 +193,7 @@
<menuItem name="findBrush" caption="Find brush..." command="FindBrush" />
<menuItem name="findReplaceTextures" caption="Find and replace textures..." icon="texwindow_findandreplace.png" command="ToggleFindAndReplaceMaterial" />
<menuItem name="mapinfo" caption="Map info..." command="MapInfo" />
<menuItem name="skinEditor" caption="Skin Editor..." command="SkinEditor" icon="icon_skin.png" />
</subMenu>

<subMenu name="entity" caption="E&amp;ntity">
Expand Down Expand Up @@ -314,6 +315,7 @@
<subMenu name="help" caption="&amp;Help">
<menuItem name="about" caption="&amp;About" command="About" />
<menuItem name="openForumLink" caption="&amp;Community Forum" command="OpenForumUrl" />
<menuItem name="openScriptRef" caption="&amp;Script Reference Wiki Article" command="OpenScriptReference" />
<menuItem name="userGuide" caption="&amp;User Guide (Online)" command="ShowUserGuide" />
<menuItem name="userGuideLocal" caption="&amp;User Guide (Local)" command="ShowOfflineUserGuide" />
</subMenu>
Expand Down

0 comments on commit 0020a73

Please sign in to comment.