Skip to content

Commit

Permalink
Fix some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mott committed Jun 14, 2022
1 parent 4a0ddc7 commit 527574e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 39 deletions.
17 changes: 15 additions & 2 deletions include/icommandsystem.h
Expand Up @@ -224,8 +224,21 @@ struct AutoCompletionInfo
Candidates candidates;
};

class ICommandSystem :
public RegisterableModule
/**
* @brief Interface for the CommandSystem module.
*
* Commands are self-contained blocks of code (function calls or lambdas) which
* can be invoked from menu items or from typing string commands in the
* DarkRadiant console. They can also be called from Python.
*
* Commands can be invoked programmatically via the executeCommand() method,
* which is sometimes useful if the implementing function isn't exposed via a
* suitable module interface. Note however that neither the name of the command
* (an arbitrary string) or the types of its arguments are checked at
* compile-time, so calling C++ methods directly is generally preferable where
* possible.
*/
class ICommandSystem: public RegisterableModule
{
public:

Expand Down
64 changes: 32 additions & 32 deletions libs/render/RenderableBox.h
Expand Up @@ -16,40 +16,40 @@ inline std::vector<RenderVertex> getFillBoxVertices(const Vector3& min, const Ve
return
{
// Bottom quad
RenderVertex({ min[0], max[1], min[2] }, {0,0,-1}, {0,1}, colour),
RenderVertex({ max[0], max[1], min[2] }, {0,0,-1}, {1,1}, colour),
RenderVertex({ max[0], min[1], min[2] }, {0,0,-1}, {1,0}, colour),
RenderVertex({ min[0], min[1], min[2] }, {0,0,-1}, {0,0}, colour),
RenderVertex(Vector3{ min[0], max[1], min[2] }, {0,0,-1}, {0,1}, colour),
RenderVertex(Vector3{ max[0], max[1], min[2] }, {0,0,-1}, {1,1}, colour),
RenderVertex(Vector3{ max[0], min[1], min[2] }, {0,0,-1}, {1,0}, colour),
RenderVertex(Vector3{ min[0], min[1], min[2] }, {0,0,-1}, {0,0}, colour),

// Top quad
RenderVertex({ min[0], min[1], max[2] }, {0,0,+1}, {0,1}, colour),
RenderVertex({ max[0], min[1], max[2] }, {0,0,+1}, {1,1}, colour),
RenderVertex({ max[0], max[1], max[2] }, {0,0,+1}, {1,0}, colour),
RenderVertex({ min[0], max[1], max[2] }, {0,0,+1}, {0,0}, colour),
RenderVertex(Vector3{ min[0], min[1], max[2] }, {0,0,+1}, {0,1}, colour),
RenderVertex(Vector3{ max[0], min[1], max[2] }, {0,0,+1}, {1,1}, colour),
RenderVertex(Vector3{ max[0], max[1], max[2] }, {0,0,+1}, {1,0}, colour),
RenderVertex(Vector3{ min[0], max[1], max[2] }, {0,0,+1}, {0,0}, colour),

// Front quad
RenderVertex({ min[0], min[1], min[2] }, {0,-1,0}, {0,1}, colour),
RenderVertex({ max[0], min[1], min[2] }, {0,-1,0}, {1,1}, colour),
RenderVertex({ max[0], min[1], max[2] }, {0,-1,0}, {1,0}, colour),
RenderVertex({ min[0], min[1], max[2] }, {0,-1,0}, {0,0}, colour),
RenderVertex(Vector3{ min[0], min[1], min[2] }, {0,-1,0}, {0,1}, colour),
RenderVertex(Vector3{ max[0], min[1], min[2] }, {0,-1,0}, {1,1}, colour),
RenderVertex(Vector3{ max[0], min[1], max[2] }, {0,-1,0}, {1,0}, colour),
RenderVertex(Vector3{ min[0], min[1], max[2] }, {0,-1,0}, {0,0}, colour),

// Back quad
RenderVertex({ min[0], max[1], min[2] }, {0,+1,0}, {1,1}, colour),
RenderVertex({ min[0], max[1], max[2] }, {0,+1,0}, {1,0}, colour),
RenderVertex({ max[0], max[1], max[2] }, {0,+1,0}, {0,0}, colour),
RenderVertex({ max[0], max[1], min[2] }, {0,+1,0}, {0,1}, colour),
RenderVertex(Vector3{ min[0], max[1], min[2] }, {0,+1,0}, {1,1}, colour),
RenderVertex(Vector3{ min[0], max[1], max[2] }, {0,+1,0}, {1,0}, colour),
RenderVertex(Vector3{ max[0], max[1], max[2] }, {0,+1,0}, {0,0}, colour),
RenderVertex(Vector3{ max[0], max[1], min[2] }, {0,+1,0}, {0,1}, colour),

// Right quad
RenderVertex({ max[0], max[1], min[2] }, {+1,0,0}, {1,1}, colour),
RenderVertex({ max[0], max[1], max[2] }, {+1,0,0}, {1,0}, colour),
RenderVertex({ max[0], min[1], max[2] }, {+1,0,0}, {0,0}, colour),
RenderVertex({ max[0], min[1], min[2] }, {+1,0,0}, {0,1}, colour),
RenderVertex(Vector3{ max[0], max[1], min[2] }, {+1,0,0}, {1,1}, colour),
RenderVertex(Vector3{ max[0], max[1], max[2] }, {+1,0,0}, {1,0}, colour),
RenderVertex(Vector3{ max[0], min[1], max[2] }, {+1,0,0}, {0,0}, colour),
RenderVertex(Vector3{ max[0], min[1], min[2] }, {+1,0,0}, {0,1}, colour),

// Left quad
RenderVertex({ min[0], max[1], min[2] }, {-1,0,0}, {0,1}, colour),
RenderVertex({ min[0], min[1], min[2] }, {-1,0,0}, {1,1}, colour),
RenderVertex({ min[0], min[1], max[2] }, {-1,0,0}, {1,0}, colour),
RenderVertex({ min[0], max[1], max[2] }, {-1,0,0}, {0,0}, colour),
RenderVertex(Vector3{ min[0], max[1], min[2] }, {-1,0,0}, {0,1}, colour),
RenderVertex(Vector3{ min[0], min[1], min[2] }, {-1,0,0}, {1,1}, colour),
RenderVertex(Vector3{ min[0], min[1], max[2] }, {-1,0,0}, {1,0}, colour),
RenderVertex(Vector3{ min[0], max[1], max[2] }, {-1,0,0}, {0,0}, colour),
};
}

Expand All @@ -59,16 +59,16 @@ inline std::vector<RenderVertex> getWireframeBoxVertices(const Vector3& min, con
return
{
// Bottom quad
RenderVertex({ min[0], min[1], min[2] }, {0,0,1}, {0,0}, colour),
RenderVertex({ max[0], min[1], min[2] }, {0,0,1}, {0,0}, colour),
RenderVertex({ max[0], max[1], min[2] }, {0,0,1}, {0,0}, colour),
RenderVertex({ min[0], max[1], min[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ min[0], min[1], min[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ max[0], min[1], min[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ max[0], max[1], min[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ min[0], max[1], min[2] }, {0,0,1}, {0,0}, colour),

// Top quad
RenderVertex({ min[0], min[1], max[2] }, {0,0,1}, {0,0}, colour),
RenderVertex({ max[0], min[1], max[2] }, {0,0,1}, {0,0}, colour),
RenderVertex({ max[0], max[1], max[2] }, {0,0,1}, {0,0}, colour),
RenderVertex({ min[0], max[1], max[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ min[0], min[1], max[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ max[0], min[1], max[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ max[0], max[1], max[2] }, {0,0,1}, {0,0}, colour),
RenderVertex(Vector3{ min[0], max[1], max[2] }, {0,0,1}, {0,0}, colour),
};
}

Expand Down
2 changes: 2 additions & 0 deletions radiantcore/entity/light/LightNode.h
Expand Up @@ -7,6 +7,8 @@
#include "ilightnode.h"
#include "registry/CachedKey.h"
#include "scene/TransformedCopy.h"
#include "math/Frustum.h"
#include "editable.h"

#include "dragplanes.h"
#include "../VertexInstance.h"
Expand Down
10 changes: 5 additions & 5 deletions radiantcore/entity/light/Renderables.cpp
Expand Up @@ -31,9 +31,9 @@ void RenderableLightOctagon::updateGeometry()
static Vector3 Extents(8, 8, 8);

// Calculate the light vertices of this bounding box and store them into <points>
Vector3 max(Origin + Extents);
Vector3 min(Origin - Extents);
Vector3 mid(Origin);
Vector3f max(Origin + Extents);
Vector3f min(Origin - Extents);
Vector3f mid(Origin);

auto colour = _light.getEntityColour();

Expand Down Expand Up @@ -90,8 +90,8 @@ void RenderableLightVolume::updatePointLightVolume()
const auto& radius = _light.getLightRadius();

// Calculate the corner vertices of this bounding box, plus the mid-point
Vector3 max(Origin + radius);
Vector3 min(Origin - radius);
Vector3f max(Origin + radius);
Vector3f min(Origin - radius);

auto colour = _light.getEntityColour();

Expand Down

0 comments on commit 527574e

Please sign in to comment.