Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/orbweaver/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Dec 3, 2020
2 parents b903b57 + 4738dd0 commit f812d4a
Show file tree
Hide file tree
Showing 51 changed files with 956 additions and 1,501 deletions.
13 changes: 7 additions & 6 deletions compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.

scriptversion=2012-10-14.11; # UTC
scriptversion=2018-03-07.03; # UTC

# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
Expand All @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# 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, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.

# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
Expand Down Expand Up @@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
Expand Down Expand Up @@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
3 changes: 2 additions & 1 deletion configure.ac
@@ -1,4 +1,4 @@
AC_INIT([darkradiant], [2.9.0])
AC_INIT([darkradiant], [2.9.1])
AM_INIT_AUTOMAKE([subdir-objects])
AM_SILENT_RULES([yes])

Expand Down Expand Up @@ -392,6 +392,7 @@ fi
if test "$reloc_build" != 'no'
then
CPPFLAGS="-DENABLE_RELOCATION $CPPFLAGS"
LDFLAGS="$LDFLAGS '-Wl,-rpath,\$\$ORIGIN/../lib/darkradiant'"
fi

AC_SUBST([CPPFLAGS])
Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
@@ -1,3 +1,11 @@
darkradiant (2.9.1~focal1) focal; urgency=medium

* 2.9.1 release for Focal.
* Includes the new GameConnection functionality for The Dark Mod, as well as
numerous bug fixes and improvements.

-- Matthew Mott <orbweaver3d@gmail.com> Tue, 24 Nov 2020 19:36:02 +0000

darkradiant (2.7.0) bionic; urgency=medium

* 2.7.0 release for Bionic.
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -2,7 +2,7 @@ Source: darkradiant
Section: editors
Priority: extra
Maintainer: Matthew Mott <orbweaver3d@gmail.com>
Build-Depends: debhelper (>= 5), autotools-dev, libgtkmm-2.4-dev, libgtkglextmm-x11-1.2-dev, libxml2-dev, libglew-dev, libboost-regex-dev, libboost-filesystem-dev, libboost-serialization-dev, libboost-test-dev, libboost-python-dev, python-dev, libvorbis-dev, libopenal-dev, libalut-dev, libjpeg-dev, libftgl-dev, libwxbase3.0-dev, libwxgtk3.0-dev
Build-Depends: debhelper (>= 5), autotools-dev, libgtkmm-2.4-dev, libgtkglextmm-x11-1.2-dev, libxml2-dev, libglew-dev, libboost-regex-dev, libboost-filesystem-dev, libboost-serialization-dev, libboost-test-dev, libboost-python-dev, python-dev, libvorbis-dev, libopenal-dev, libalut-dev, libjpeg-dev, libftgl-dev, libwxbase3.0-dev, libwxgtk3.0-gtk3-dev
Standards-Version: 3.9.1

Package: darkradiant
Expand Down
162 changes: 4 additions & 158 deletions include/irender.h
Expand Up @@ -4,6 +4,7 @@
#include <functional>

#include "math/Vector3.h"
#include "math/AABB.h"

#include "ShaderLayer.h"
#include <sigc++/signal.h>
Expand Down Expand Up @@ -231,24 +232,16 @@ typedef std::shared_ptr<RendererLight> RendererLightPtr;
/// Debug stream insertion for RendererLight
inline std::ostream& operator<< (std::ostream& os, const RendererLight& l)
{
return os << "RendererLight(origin=" << l.worldOrigin() << ")";
return os << "RendererLight(origin=" << l.worldOrigin().pp()
<< ", lightAABB=" << l.lightAABB() << ")";
}

/**
* \brief
* Interface for an object which can test its intersection with a RendererLight.
*
* Objects which implement this interface define a intersectsLight() function
* which determines whether the given light intersects the object. They also
* provide methods to allow the renderer to provide the list of lights which
* will be illuminating the object, subsequent to the intersection test.
*
* \todo
* This interface seems to exist because of the design decision that lit objects
* should maintain a list of lights which illuminate them. This is a poor
* design because this should be the responsibility of the renderer. When the
* renderer is refactored to process the scene light-by-light this class will
* not be necessary.
* which determines whether the given light intersects the object.
*/
class LitObject
{
Expand All @@ -257,12 +250,6 @@ class LitObject

/// Test if the given light intersects the LitObject
virtual bool intersectsLight(const RendererLight& light) const = 0;

/// Add a light to the set of lights which do intersect this object
virtual void insertLight(const RendererLight& light) {}

/// Clear out all lights in the set of lights intersecting this object
virtual void clearLights() {}
};
typedef std::shared_ptr<LitObject> LitObjectPtr;

Expand Down Expand Up @@ -316,92 +303,6 @@ inline std::ostream& operator<< (std::ostream& s, const LightSources* ls)
return s << "[no lightsources]";
}

/**
* \brief
* A list of lights which might (but don't necessarily) intersect a LitObject
*
* A LightList is responsible for calculating which lights intersect a
* particular object. Although there is nothing exposed in the interface, the
* LightList holds a reference to a single lit object, and it is the
* intersection with this object which is calculated.
*
* LightLists are constructed by the RenderSystem and returned to each
* LitObject as the result of calling RenderSystem::attachLitObject(). The
* LitObject is then responsible for storing the LightList and passing it (or a
* more optimised LightSources container based on additional tests) to the
* RenderableCollector at render time.
*
* \internal
* As of 2011-01-09/r6927 the calling sequence seems to be as follows:
*
* 1. Illuminated object (e.g. patch, brush) adds itself to the RenderSystem
* with attachLitObject() at construction.
* 2. attachLitObject() returns a reference to a (newly-created) LightList which
* manages the lights intersecting this lit object. The lit object stores this
* reference internally, while the LightList implementation also stores a
* reference to the LitObject.
* 3. When the lit object's renderSolid() method is invoked to set up a render,
* it invokes LightList::calculateIntersectingLights() on the stored LightList
* reference.
* 4. calculateIntersectingLights() first checks to see if the lights need
* updating, which is true if EITHER this LightList's setDirty() method OR the
* RenderSystem's lightChanged() has been called since the last calculation. If
* no update is needed, it returns.
* 5. If an update IS needed, the LightList iterates over all lights in the
* scene, and tests if each one intersects its associated lit object (which is
* the one that just invoked calculateIntersectingLights(), although nothing
* enforces this). This intersection test is performed by passing the light to
* the LitObject::intersectsLight() method.
* 6. For each light which passes the intersection test, the LightList both adds
* it to its internal list of "active" (i.e. intersecting) lights for its
* object, and passes it to the object's insertLight() method. Some object
* classes then use insertLight() to populate another internal LightList subject
* to additional (internal) intersection tests, but this is not required.
* 7. At this point, calculateIntersectingLights() has finished, and returns
* control to its calling renderSolid() method.
* 8. The renderSolid() method (or another method it calls) passes a LightList
* to the RenderableCollector with setLights(). The light list it passes may be
* the original list returned from attachLitObject(), or the additional internal
* list populated in step 6.
* 9. The RenderableCollector state machine stores the LightList as the
* "current" light list.
* 10. Any subsequent renderables submitted with
* RenderableCollector::addRenderable() are associated with the current
* LightList passed in the previous step, and passed to the current Shader.
* 11. The OpenGLShader accepts the renderable and LightList, and adds them to
* its internal OpenGLShaderPasses: once only if RENDER_BUMP is not active, not
* at all if RENDER_BUMP is active but the LightList is NULL, or once for each
* light in the LightList otherwise.
* 12. The OpenGLShaderPass now contains a list of TransformedRenderable
* structures, each associating a single renderable with a single light.
* Multiple TransformedRenderable will exist for the same renderable if there
* were multiple lights illuminating it.
*/
class LightList
: public LightSources
{
public:
virtual ~LightList() {}

/**
* \brief
* Trigger the LightList to recalculate which lights intersect its object
*
* For each light, this method will call the LitObject::intersectsLight()
* method to test whether the light intersects the contained lit object. If
* the light does intersect, it will be passed to the object's
* insertLight() method for internal storage (and possibly further
* intersection tests). The LightList will also store all the intersecting
* lights internally, and expose them through its own forEachLight()
* method, for objects which do not wish to perform additional tests but
* just return the LightList to the renderer directly.
*/
virtual void calculateIntersectingLights() const = 0;

/// Set the dirty flag, informing the LightList that an update is required
virtual void setDirty() = 0;
};

const int c_attr_TexCoord0 = 1;
const int c_attr_Tangent = 3;
const int c_attr_Binormal = 4;
Expand Down Expand Up @@ -665,61 +566,6 @@ class RenderSystem
/// Set the shader program to use.
virtual void setShaderProgram(ShaderProgram prog) = 0;

/* LIGHT MANAGEMENT */

/**
* \brief
* Add a lit object to the renderer.
*
* The renderer will create and return a reference to a LightList associated
* with this particular LitObject. The lit object can use the public
* LightList interface to trigger a recalculation of light intersections, or
* to set the dirty flag indicating to the LightList that a recalculation is
* necessary.
*
* \internal
* When the LightList implementation performs the intersection calculation,
* it will use the LitObject's intersectsLight method to do so, and if the
* intersection is detected, the insertLight method will be invoked on the
* LitObject. This means that (1) the renderer stores a LightList for each
* object, (2) the object itself has a reference to the LightList owned by
* the renderer, and (3) the LitObject interface allows the object to
* maintain ANOTHER list of intersecting lights, added with insertLight().
* This seems like a lot of indirection, but it might have something to do
* with allowing objects with multiple sub-components to submit only a
* subset of lights for each component.
*
* \param object
* The lit object to add.
*
* \return
* A reference to a LightList which manages the lights that intersect the
* submitted object.
*/
virtual LightList& attachLitObject(LitObject& object) = 0;

virtual void detachLitObject(LitObject& cullable) = 0;

virtual void litObjectChanged(LitObject& cullable) = 0;

/**
* \brief
* Attach a light source to the renderer.
*/
virtual void attachLight(RendererLight& light) = 0;

/**
* \brief
* Detach a light source from the renderer.
*/
virtual void detachLight(RendererLight& light) = 0;

/**
* \brief
* Indicate that the scene lights have changed.
*/
virtual void lightChanged() = 0;

virtual void attachRenderable(const Renderable& renderable) = 0;
virtual void detachRenderable(const Renderable& renderable) = 0;
virtual void forEachRenderable(const RenderableCallback& callback) const = 0;
Expand Down
68 changes: 28 additions & 40 deletions include/irenderable.h
Expand Up @@ -32,58 +32,46 @@ class RenderableCollector
public:
virtual ~RenderableCollector() {}

/**
* Submit an OpenGLRenderable object for rendering using the given shader.
*
* \param shader
* The Shader object this Renderable will be attached to.
*
* \param renderable
* The renderable object to submit.
*
* \param world
* The local to world transform that should be applied to this object when
* it is rendered.
*
* \param lights
* Optional LightSources containing lights illuminating this Renderable.
*
* \param entity
* Optional IRenderEntity exposing parameters which affect the rendering of
* this Renderable.
*/
virtual void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& world,
const LightSources* lights = nullptr,
const IRenderEntity* entity = nullptr) = 0;

/**
* \brief
* Submit a renderable object to be illuminated by scene lights.
* Submit a renderable object
*
* This method allows renderable geometry to be submitted under the control
* of a LitObject which will determine whether and how the renderable is
* illuminated by scene lights. Each objected submitted with this method
* will be considered for lighting by the lights which are submitted to the
* same RenderableCollector using addLight().
*
* Most of the parameters have identical meanings to those in
* addRenderable().
* Objects may be submitted without a LitObject if they are not affected by
* scene lights.
*
* \param litObject
* A LitObject determining lighting interactions for this renderable. This
* may or may not be the same actual object as the OpenGLRenderable,
* depending on how the object tree is set up. If a single LitObject
* contains multiple renderables, a separate call to this method must be
* made for each renderable (with the same litObject parameter).
* \param shader
* The Shader object this Renderable will be attached to.
*
* \param renderable
* The renderable object to submit.
*
* \param localToWorld
* The local to world transform that should be applied to this object when
* it is rendered.
*
* \param entity
* Optional IRenderEntity exposing parameters which affect the rendering of
* this Renderable.
*
* \param litObject
* Optional LitObject determining lighting interactions for this
* renderable. This may or may not be the same actual object as the
* OpenGLRenderable, depending on how the object class hierarchy is set up.
* If a single LitObject contains multiple renderables, a separate call to
* this method must be made for each renderable (with the same litObject
* parameter).
*/
virtual void addLitRenderable(Shader& shader,
OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const LitObject& litObject,
const IRenderEntity* entity = nullptr) = 0;
virtual void addRenderable(Shader& shader,
const OpenGLRenderable& renderable,
const Matrix4& localToWorld,
const LitObject* litObject = nullptr,
const IRenderEntity* entity = nullptr) = 0;

/**
* \brief
Expand Down
14 changes: 14 additions & 0 deletions include/version.h
Expand Up @@ -9,11 +9,25 @@
#define RADIANT_BLANK " "

#if defined(_M_X64) || defined(__amd64__) || defined(_WIN64)

// 64 bit architecture names (according to platform convention)
#if defined(__linux__)
#define RADIANT_PLATFORM "amd64"
#else
#define RADIANT_PLATFORM "x64"
#endif

#else

// 32 bit architecture names (according to platform convention)
#if defined(__linux)
#define RADIANT_PLATFORM "i386"
#else
#define RADIANT_PLATFORM "x86"
#endif

#endif

#include <string>

inline std::string RADIANT_APPNAME_FULL()
Expand Down

0 comments on commit f812d4a

Please sign in to comment.