Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ static const char *gApplication("");
#endif
static const char *gMimeContent("text/content");
static const char *gMimeObject("text/object");
static const char *gMimeComponent("text/component");

#endif // CONFIG_H

1 change: 1 addition & 0 deletions engine/includes/adapters/handlers/fileloghandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define FILELOGHANDLER_H

#include <mutex>
#include <cstring>

#include <log.h>
#include <engine.h>
Expand Down
1 change: 1 addition & 0 deletions engine/includes/adapters/handlers/physfsfilehandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PhysfsFileHandler : public FileHandler {

protected:
StringList list(const char *path, bool root = false) override {
A_UNUSED(root);
char **rc = PHYSFS_enumerateFiles(path);
char **i;

Expand Down
2 changes: 1 addition & 1 deletion engine/includes/gizmos.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CommandBuffer;
class ENGINE_EXPORT Gizmos {
public:
static void drawBox(const Vector3 &center, const Vector3 &size, const Vector4 &color, const Matrix4 &transform = Matrix4());
static void drawIcon(const Vector3 &center, const Vector2 &size, const std::string &name, const Vector4 &color, const Matrix4 &transform = Matrix4());
static void drawIcon(const Vector3 &center, const Vector2 &size, const std::string &name, const Vector4 &color);
static void drawMesh(Mesh &mesh, const Vector4 &color, const Matrix4 &transform = Matrix4());
static void drawSphere(const Vector3 &center, float radius, const Vector4 &color, const Matrix4 &transform = Matrix4());
static void drawSolidArc(const Vector3 &center, float radius, float start, float angle, const Vector4 &color, const Matrix4 &transform = Matrix4());
Expand Down
2 changes: 1 addition & 1 deletion engine/includes/pipelinecontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ENGINE_EXPORT PipelineContext : public Object {

std::list<std::pair<const PostProcessSettings *, float> > &culledPostEffectSettings();

void frustumCulling(const Frustum &frustum, const RenderList &in, RenderList &out, AABBox *box = nullptr);
void frustumCulling(const Frustum &frustum, const RenderList &in, RenderList &out);

void setPipeline(Pipeline *pipeline);
void insertRenderTask(PipelineTask *task, PipelineTask *before = nullptr);
Expand Down
14 changes: 7 additions & 7 deletions engine/includes/resources/material.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,16 +286,16 @@ class ENGINE_EXPORT MaterialInstance {

void setSkinSize(uint32_t size);

void setBool(const TString &name, const bool *value, int32_t count = 1);
void setBool(const TString &name, const bool *value);

void setInteger(const TString &name, const int32_t *value, int32_t count = 1);
void setInteger(const TString &name, const int32_t *value);

void setFloat(const TString &name, const float *value, int32_t count = 1);
void setVector2(const TString &name, const Vector2 *value, int32_t count = 1);
void setVector3(const TString &name, const Vector3 *value, int32_t count = 1);
void setVector4(const TString &name, const Vector4 *value, int32_t count = 1);
void setFloat(const TString &name, const float *value);
void setVector2(const TString &name, const Vector2 *value);
void setVector3(const TString &name, const Vector3 *value);
void setVector4(const TString &name, const Vector4 *value);

void setMatrix4(const TString &name, const Matrix4 *value, int32_t count = 1);
void setMatrix4(const TString &name, const Matrix4 *value);

void setTexture(const TString &name, Texture *texture);

Expand Down
2 changes: 2 additions & 0 deletions engine/src/commandbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ void CommandBuffer::flipResult() {
Parameters \a width and \a height viewport dimensions.
*/
void CommandBuffer::setViewport(int32_t x, int32_t y, int32_t width, int32_t height) {
A_UNUSED(x);
A_UNUSED(y);
m_global.cameraParams.z = 1.0f / (float)width;
m_global.cameraParams.w = 1.0f / (float)height;
}
Expand Down
2 changes: 1 addition & 1 deletion engine/src/components/armature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void Armature::addInstance(MaterialInstance *instance) {
m_instances.push_back(instance);

// make cache dirty
for(auto it : m_bones) {
for(auto &it : m_bones) {
it.second = 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion engine/src/components/baselight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void BaseLight::cleanDirty() {
if(m_materialInstance) {
Vector4 bias;
m_materialInstance->setVector4(uniBias, &bias);
m_materialInstance->setMatrix4(uniMatrix, matrix, SIDES);
m_materialInstance->setMatrix4(uniMatrix, matrix);
}

m_dirty = false;
Expand Down
2 changes: 1 addition & 1 deletion engine/src/components/directlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void DirectLight::cleanDirty() {
// bias[lod] *= 1.0f / (planeDistance[lod] * biasModifier);
//}

m_materialInstance->setMatrix4(uniMatrix, matrix, MAX_LODS);
m_materialInstance->setMatrix4(uniMatrix, matrix);
m_materialInstance->setVector4(uniBias, &bias);
m_materialInstance->setVector4(uniPlaneDistance, &planeDistance);
}
Expand Down
2 changes: 1 addition & 1 deletion engine/src/components/nativebehaviour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ bool NativeBehaviour::isStarted() const {
\internal
*/
void NativeBehaviour::setStarted(bool started) {
m_started = true;
m_started = started;
}
13 changes: 8 additions & 5 deletions engine/src/editor/converters/prefabconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ Variant PrefabConverter::readJson(const TString &data, AssetConverterSettings *s

bool update = false;
switch(settings->currentVersion()) {
case 0: update |= toVersion1(result);
case 1: update |= toVersion2(result);
case 2: update |= toVersion3(result);
case 3: update |= toVersion4(result);
case 4: update |= toVersion5(result);
case 0: update |= toVersion1(result); [[fallthrough]];
case 1: update |= toVersion2(result); [[fallthrough]];
case 2: update |= toVersion3(result); [[fallthrough]];
case 3: update |= toVersion4(result); [[fallthrough]];
case 4: update |= toVersion5(result); [[fallthrough]];
default: break;
}

Expand Down Expand Up @@ -190,14 +190,17 @@ bool PrefabConverter::toVersion1(Variant &variant) {
}

bool PrefabConverter::toVersion2(Variant &variant) {
A_UNUSED(variant);
return false;
}

bool PrefabConverter::toVersion3(Variant &variant) {
A_UNUSED(variant);
return false;
}

bool PrefabConverter::toVersion4(Variant &variant) {
A_UNUSED(variant);
return false;
}

Expand Down
1 change: 0 additions & 1 deletion engine/src/editor/projectsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ void ProjectSettings::saveSettings() {
TString name = property.name();
Variant value = property.read(this);

MetaType type = MetaType::table(value.userType());
if(value.type() == QMetaType::QVariantList) {
// Just skip the list type for now
} else {
Expand Down
5 changes: 3 additions & 2 deletions engine/src/gizmos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ void Gizmos::drawBox(const Vector3 &center, const Vector3 &size, const Vector4 &
s_solid->batchMesh(mesh, &transform);
}
/*!
Draws an billboard icon at the specified \a center with the given \a size, \a color, and \a transform.
Draws an billboard icon at the specified \a center with the given \a size, \a color.
Parameter \a name will be used to set a texture to render.
*/
void Gizmos::drawIcon(const Vector3 &center, const Vector2 &size, const std::string &name, const Vector4 &color, const Matrix4 &transform) {
void Gizmos::drawIcon(const Vector3 &center, const Vector2 &size, const std::string &name, const Vector4 &color) {
Matrix4 model(center, Quaternion(), Vector3(size, size.x));
Matrix4 q = model * Matrix4(Camera::current()->transform()->quaternion().toMatrix());

Expand Down Expand Up @@ -395,6 +395,7 @@ void Gizmos::drawWireSphere(const Vector3 &center, float radius, const Vector4 &
Parameter \a transform can be used to move, rotate and scale this capsule.
*/
void Gizmos::drawWireCapsule(const Vector3 &center, float radius, float height, const Vector4 &color, const Matrix4 &transform) {
A_UNUSED(center);
float half = height * 0.5f - radius;
{
Vector3 cap(0, half, 0);
Expand Down
4 changes: 2 additions & 2 deletions engine/src/pipelinecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ Camera *PipelineContext::currentCamera() const {
}
/*!
Filters \a out an incoming \a in list which are not in the \a frustum.
Returns filtered list. The output parameter returns a bounding \a box for filtered objects.
Returns filtered list.
*/
void PipelineContext::frustumCulling(const Frustum &frustum, const RenderList &in, RenderList &out, AABBox *box) {
void PipelineContext::frustumCulling(const Frustum &frustum, const RenderList &in, RenderList &out) {
out.clear();
for(auto it : in) {
AABBox bb = it->bound();
Expand Down
6 changes: 3 additions & 3 deletions engine/src/pipelinetask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void PipelineTask::setContext(PipelineContext *context) {
This method can be used to analyze a scene graphs for the provided \a world.
*/
void PipelineTask::analyze(World *world) {

A_UNUSED(world);
}
/*!
Executes the rendering commands associated with this pipeline task.
Expand Down Expand Up @@ -66,7 +66,7 @@ int PipelineTask::inputCount() const {
Returns by \a index a name of input.
*/
TString PipelineTask::inputName(int index) const {
if(index < m_inputs.size()) {
if(index < static_cast<int>(m_inputs.size())) {
return m_inputs[index];
}
return TString();
Expand Down Expand Up @@ -97,7 +97,7 @@ TString PipelineTask::outputName(int index) const {
Returns by \a index a result of task as a render texture.
*/
Texture *PipelineTask::output(int index) {
if(index < m_outputs.size()) {
if(index < static_cast<int>(m_outputs.size())) {
return m_outputs[index].second;
}
return nullptr;
Expand Down
3 changes: 2 additions & 1 deletion engine/src/pipelinetasks/ambientocclusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ AmbientOcclusion::AmbientOcclusion() :
scale = MIX(0.1f, 1.0f, scale * scale);
samplesKernel[i] *= scale;
}
m_occlusion->setVector3("samplesKernel", samplesKernel, KERNEL_SIZE);
m_occlusion->setVector3("samplesKernel", samplesKernel);
m_occlusion->setTexture("noiseMap", m_noiseTexture);

m_occlusion->setFloat("radius", &m_radius);
Expand Down Expand Up @@ -115,6 +115,7 @@ AmbientOcclusion::~AmbientOcclusion() {
}

void AmbientOcclusion::analyze(World *world) {
A_UNUSED(world);
float radius = PostProcessSettings::defaultValue(gAmbientRadius).toFloat();
float bias = PostProcessSettings::defaultValue(gAmbientBias).toFloat();
float power = PostProcessSettings::defaultValue(gAmbientPower).toFloat();
Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/antialiasing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void AntiAliasing::exec() {
}

void AntiAliasing::setInput(int index, Texture *texture) {
A_UNUSED(index);
if(m_enabled) {
if(m_resultMaterial) {
m_resultMaterial->setTexture("rgbMap", texture);
Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/bloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Bloom::~Bloom() {
}

void Bloom::analyze(World *world) {
A_UNUSED(world);
float threshold = PostProcessSettings::defaultValue(gBloomThreshold).toFloat();
float intensity = PostProcessSettings::defaultValue(gBloomIntensity).toFloat();
float dirtIntensity = PostProcessSettings::defaultValue(gBloomDirtIntensity).toFloat();
Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/deferredlighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ void DeferredLighting::exec() {
}

void DeferredLighting::setInput(int index, Texture *texture) {
A_UNUSED(index);
m_lightPass->setColorAttachment(0, texture);

m_outputs.front().second = texture;
Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/depthoffield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ DepthOfField::~DepthOfField() {
}

void DepthOfField::analyze(World *world) {
A_UNUSED(world);
// Focus Distance
Camera *camera = Camera::current();
float focal = camera->focalDistance();
Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/gbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void GBuffer::exec() {
}

void GBuffer::analyze(World *world) {
A_UNUSED(world);
Renderable::GroupList list;
Renderable::filterByLayer(m_context->culledRenderables(), list, Material::Opaque);

Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/indirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ DeferredIndirect::DeferredIndirect() :
}

void DeferredIndirect::analyze(World *world) {
A_UNUSED(world);
Camera *camera = Camera::current();
if(camera) {
Vector4 color(camera->color());
Expand Down
2 changes: 1 addition & 1 deletion engine/src/pipelinetasks/shadowmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void ShadowMap::lightUpdate(BaseLight *light, int count) {

auto instance = light->material();
if(instance) {
instance->setVector4(uniTiles, tiles.data(), count);
instance->setVector4(uniTiles, tiles.data());
instance->setTexture(shadowMap, shadowTarget->depthAttachment());
}
shadowTarget->setTileIndex(-1);
Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/tonemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void Tonemap::exec() {
}

void Tonemap::setInput(int index, Texture *texture) {
A_UNUSED(index);
if(m_enabled) {
if(m_resultMaterial) {
m_resultMaterial->setTexture("rgbMap", texture);
Expand Down
1 change: 1 addition & 0 deletions engine/src/pipelinetasks/translucent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void Translucent::setInput(int index, Texture *texture) {
}

void Translucent::analyze(World *world) {
A_UNUSED(world);
Renderable::GroupList list;
Renderable::filterByLayer(m_context->culledRenderables(), list, Material::Translucent);

Expand Down
5 changes: 4 additions & 1 deletion engine/src/resources/animationclip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ int Motion::duration() const {
}

Vector4 Motion::valueVector4(float time) const {
A_UNUSED(time);
return Vector4();
}

Quaternion Motion::valueQuaternion(float time) const {
A_UNUSED(time);
return Quaternion();
}

TString Motion::valueString(float time) const {
A_UNUSED(time);
return TString();
}
/*!
Expand Down Expand Up @@ -179,7 +182,7 @@ Variant AnimationTrack::AnimationTrack::toVariant() const {
key.push_back(it.m_position);
key.push_back(it.m_type);

for(int32_t i = 0; i < it.m_value.size(); i++) {
for(size_t i = 0; i < it.m_value.size(); i++) {
key.push_back(it.m_value[i]);
if(it.m_type == AnimationCurve::KeyFrame::Cubic) {
key.push_back(it.m_leftTangent[i]);
Expand Down
21 changes: 7 additions & 14 deletions engine/src/resources/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,63 +121,56 @@ void MaterialInstance::setSkinSize(uint32_t size) {
Sets a boolean parameter with optional array support.
Parameter \a name specifies a name of the boolean parameter.
Parameter \a value pointer to the boolean value or array of boolean values.
Parameter \a count a number of elements in the array.
*/
void MaterialInstance::setBool(const TString &name, const bool *value, int32_t count) {
void MaterialInstance::setBool(const TString &name, const bool *value) {
setBufferValue(name, value);
}
/*!
Sets a integer parameter with optional array support.
Parameter \a name specifies a name of the integer parameter.
Parameter \a value pointer to the integer value or array of integer values.
Parameter \a count a number of elements in the array.
*/
void MaterialInstance::setInteger(const TString &name, const int32_t *value, int32_t count) {
void MaterialInstance::setInteger(const TString &name, const int32_t *value) {
setBufferValue(name, value);
}
/*!
Sets a float parameter with optional array support.
Parameter \a name specifies a name of the float parameter.
Parameter \a value pointer to the float value or array of float values.
Parameter \a count a number of elements in the array.
*/
void MaterialInstance::setFloat(const TString &name, const float *value, int32_t count) {
void MaterialInstance::setFloat(const TString &name, const float *value) {
setBufferValue(name, value);
}
/*!
Sets a Vector2 parameter with optional array support.
Parameter \a name specifies a name of the Vector2 parameter.
Parameter \a value pointer to the Vector2 value or array of Vector2 values.
Parameter \a count a number of elements in the array.
*/
void MaterialInstance::setVector2(const TString &name, const Vector2 *value, int32_t count) {
void MaterialInstance::setVector2(const TString &name, const Vector2 *value) {
setBufferValue(name, value);
}
/*!
Sets a Vector3 parameter with optional array support.
Parameter \a name specifies a name of the Vector3 parameter.
Parameter \a value pointer to the Vector3 value or array of Vector3 values.
Parameter \a count a number of elements in the array.
*/
void MaterialInstance::setVector3(const TString &name, const Vector3 *value, int32_t count) {
void MaterialInstance::setVector3(const TString &name, const Vector3 *value) {
setBufferValue(name, value);
}
/*!
Sets a Vector4 parameter with optional array support.
Parameter \a name specifies a name of the Vector4 parameter.
Parameter \a value pointer to the Vector4 value or array of Vector4 values.
Parameter \a count a number of elements in the array.
*/
void MaterialInstance::setVector4(const TString &name, const Vector4 *value, int32_t count) {
void MaterialInstance::setVector4(const TString &name, const Vector4 *value) {
setBufferValue(name, value);
}
/*!
Sets a Matrix4 parameter with optional array support.
Parameter \a name specifies a name of the Matrix4 parameter.
Parameter \a value pointer to the Matrix4 value or array of Matrix4 values.
Parameter \a count a number of elements in the array.
*/
void MaterialInstance::setMatrix4(const TString &name, const Matrix4 *value, int32_t count) {
void MaterialInstance::setMatrix4(const TString &name, const Matrix4 *value) {
setBufferValue(name, value);
}
/*!
Expand Down
Loading
Loading