Fix some warnings
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -483,7 +483,7 @@ void KRDevice::createDescriptorSets(const std::vector<VkDescriptorSetLayout>& la
|
||||
VkDescriptorSetAllocateInfo allocInfo{};
|
||||
allocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
|
||||
allocInfo.descriptorPool = m_descriptorPool;
|
||||
allocInfo.descriptorSetCount = descriptorSets.size();
|
||||
allocInfo.descriptorSetCount = (uint32_t)descriptorSets.size();
|
||||
allocInfo.pSetLayouts = layouts.data();
|
||||
if (vkAllocateDescriptorSets(m_logicalDevice, &allocInfo, descriptorSets.data()) != VK_SUCCESS) {
|
||||
// TODO - Vulkan Refactoring - Error Handling
|
||||
|
||||
@@ -53,22 +53,22 @@ KRModelView::~KRModelView()
|
||||
|
||||
bool KRModelView::getShaderValue(ShaderValue value, Vector3* output) const
|
||||
{
|
||||
|
||||
switch (value) {
|
||||
case ShaderValue::camerapos_model_space:
|
||||
{
|
||||
// Transform location of camera to object space for calculation of specular halfVec
|
||||
*output = Matrix4::Dot(m_matModelInverse, m_viewport->getCameraPosition());
|
||||
return true;
|
||||
}
|
||||
case ShaderValue::view_space_model_origin:
|
||||
{
|
||||
// Origin point of model space is the light source position. No perspective, so no w divide required
|
||||
*output = Matrix4::Dot(m_matModelView, Vector3::Zero());
|
||||
return true;
|
||||
}
|
||||
switch (value) {
|
||||
case ShaderValue::camerapos_model_space:
|
||||
{
|
||||
// Transform location of camera to object space for calculation of specular halfVec
|
||||
*output = Matrix4::Dot(m_matModelInverse, m_viewport->getCameraPosition());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case ShaderValue::view_space_model_origin:
|
||||
{
|
||||
// Origin point of model space is the light source position. No perspective, so no w divide required
|
||||
*output = Matrix4::Dot(m_matModelView, Vector3::Zero());
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool KRModelView::getShaderValue(ShaderValue value, Matrix4* output) const
|
||||
{
|
||||
@@ -128,8 +128,8 @@ bool KRModelView::getShaderValue(ShaderValue value, Matrix4* output) const
|
||||
*output = invMVP;
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -845,7 +845,7 @@ void KRPipeline::bindDescriptorSets(VkCommandBuffer& commandBuffer)
|
||||
if (m_descriptorSets.empty()) {
|
||||
return;
|
||||
}
|
||||
int descriptorSetCount = m_descriptorSets.size() / KRENGINE_MAX_FRAMES_IN_FLIGHT;
|
||||
int descriptorSetCount = (int)m_descriptorSets.size() / KRENGINE_MAX_FRAMES_IN_FLIGHT;
|
||||
int startDescriptorSet = (getContext().getCurrentFrame() % KRENGINE_MAX_FRAMES_IN_FLIGHT) * descriptorSetCount;
|
||||
VkDescriptorSet descriptorSet = m_descriptorSets[startDescriptorSet];
|
||||
if (descriptorSet == VK_NULL_HANDLE) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
// or implied, of Kearwood Gilbert.
|
||||
//
|
||||
|
||||
#include "KRREnderGraphBlackFrame.h"
|
||||
#include "KRRenderGraphBlackFrame.h"
|
||||
#include "KRRenderPass.h"
|
||||
#include "KRSurface.h"
|
||||
#include "KRDevice.h"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
// or implied, of Kearwood Gilbert.
|
||||
//
|
||||
|
||||
#include "KRREnderGraphDeferred.h"
|
||||
#include "KRRenderGraphDeferred.h"
|
||||
#include "KRRenderPass.h"
|
||||
#include "KRSurface.h"
|
||||
#include "KRDevice.h"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
// or implied, of Kearwood Gilbert.
|
||||
//
|
||||
|
||||
#include "KRREnderGraphForward.h"
|
||||
#include "KRRenderGraphForward.h"
|
||||
#include "KRRenderPass.h"
|
||||
#include "KRSurface.h"
|
||||
#include "KRDevice.h"
|
||||
|
||||
@@ -246,8 +246,9 @@ bool KRRenderSettings::getShaderValue(ShaderValue value, float* output) const
|
||||
case ShaderValue::density_premultiplied_squared:
|
||||
*output = (float)(-fog_density * fog_density * 1.442695); // -fog_density * fog_density / log(2)
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool KRRenderSettings::getShaderValue(ShaderValue value, Vector3* output) const
|
||||
@@ -256,6 +257,7 @@ bool KRRenderSettings::getShaderValue(ShaderValue value, Vector3* output) const
|
||||
case ShaderValue::fog_color:
|
||||
*output = fog_color;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -64,8 +64,9 @@ bool KRViewport::getShaderValue(ShaderValue value, Matrix4* output) const
|
||||
case ShaderValue::invp:
|
||||
*output = m_matInverseProjection;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool KRViewport::getShaderValue(ShaderValue value, Vector4* output) const
|
||||
@@ -79,9 +80,9 @@ bool KRViewport::getShaderValue(ShaderValue value, Vector4* output) const
|
||||
getSize().y
|
||||
);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
static void InitNodeInfo(KrNodeInfo* nodeInfo);
|
||||
|
||||
KRAmbientZone(KRScene& scene, std::string name);
|
||||
virtual ~KRAmbientZone();
|
||||
virtual std::string getElementName();
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent);
|
||||
virtual void loadXML(tinyxml2::XMLElement* e);
|
||||
virtual ~KRAmbientZone() override;
|
||||
virtual std::string getElementName() override;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent) override;
|
||||
virtual void loadXML(tinyxml2::XMLElement* e) override;
|
||||
|
||||
void render(RenderInfo& ri) override;
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
float getAmbientGain();
|
||||
void setAmbientGain(float ambient_gain);
|
||||
|
||||
virtual hydra::AABB getBounds();
|
||||
virtual hydra::AABB getBounds() override;
|
||||
|
||||
float getContainment(const hydra::Vector3& pos);
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ public:
|
||||
|
||||
KRAudioSource(KRScene& scene, std::string name);
|
||||
virtual ~KRAudioSource();
|
||||
virtual std::string getElementName();
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent);
|
||||
virtual void loadXML(tinyxml2::XMLElement* e);
|
||||
virtual void physicsUpdate(float deltaTime);
|
||||
virtual std::string getElementName() override;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent) override;
|
||||
virtual void loadXML(tinyxml2::XMLElement* e) override;
|
||||
virtual void physicsUpdate(float deltaTime) override;
|
||||
|
||||
void render(RenderInfo& ri) override;
|
||||
|
||||
|
||||
@@ -43,10 +43,10 @@ public:
|
||||
|
||||
KRBone(KRScene& scene, std::string name);
|
||||
virtual ~KRBone();
|
||||
virtual std::string getElementName();
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent);
|
||||
virtual void loadXML(tinyxml2::XMLElement* e);
|
||||
virtual hydra::AABB getBounds();
|
||||
virtual std::string getElementName() override;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent) override;
|
||||
virtual void loadXML(tinyxml2::XMLElement* e) override;
|
||||
virtual hydra::AABB getBounds() override;
|
||||
|
||||
void render(RenderInfo& ri) override;
|
||||
|
||||
|
||||
@@ -854,9 +854,11 @@ bool KRCamera::getShaderValue(ShaderValue value, hydra::Vector4* output) const
|
||||
case ShaderValue::fade_color:
|
||||
*output = m_fade_color;
|
||||
return true;
|
||||
default:
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
|
||||
return KRNode::getShaderValue(value, output);
|
||||
|
||||
}
|
||||
|
||||
bool KRCamera::alwaysStreamResources()
|
||||
|
||||
@@ -56,10 +56,10 @@ public:
|
||||
KRCollider(KRScene& scene, std::string collider_name, std::string model_name, unsigned int layer_mask, float audio_occlusion);
|
||||
virtual ~KRCollider();
|
||||
|
||||
virtual std::string getElementName();
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent);
|
||||
virtual void loadXML(tinyxml2::XMLElement* e);
|
||||
virtual hydra::AABB getBounds();
|
||||
virtual std::string getElementName() override;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent) override;
|
||||
virtual void loadXML(tinyxml2::XMLElement* e) override;
|
||||
virtual hydra::AABB getBounds() override;
|
||||
|
||||
bool lineCast(const hydra::Vector3& v0, const hydra::Vector3& v1, hydra::HitInfo& hitinfo, unsigned int layer_mask);
|
||||
bool rayCast(const hydra::Vector3& v0, const hydra::Vector3& v1, hydra::HitInfo& hitinfo, unsigned int layer_mask);
|
||||
|
||||
@@ -42,16 +42,16 @@ public:
|
||||
KRDirectionalLight(KRScene& scene, std::string name);
|
||||
virtual ~KRDirectionalLight();
|
||||
|
||||
virtual std::string getElementName();
|
||||
virtual std::string getElementName() override;
|
||||
hydra::Vector3 getLocalLightDirection();
|
||||
hydra::Vector3 getWorldLightDirection();
|
||||
|
||||
virtual void render(RenderInfo& ri) override;
|
||||
virtual hydra::AABB getBounds();
|
||||
virtual hydra::AABB getBounds() override;
|
||||
|
||||
protected:
|
||||
|
||||
virtual int configureShadowBufferViewports(const KRViewport& viewport);
|
||||
virtual int configureShadowBufferViewports(const KRViewport& viewport) override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -525,9 +525,9 @@ bool KRLight::getShaderValue(ShaderValue value, float* output) const
|
||||
case ShaderValue::dust_particle_size:
|
||||
*output = m_dust_particle_size;
|
||||
return true;
|
||||
|
||||
default:
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
|
||||
bool KRLight::getShaderValue(ShaderValue value, hydra::Vector3* output) const
|
||||
@@ -539,6 +539,7 @@ bool KRLight::getShaderValue(ShaderValue value, hydra::Vector3* output) const
|
||||
case ShaderValue::light_color:
|
||||
*output = m_color;
|
||||
return true;
|
||||
default:
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ public:
|
||||
static void InitNodeInfo(KrNodeInfo* nodeInfo);
|
||||
|
||||
virtual ~KRLight();
|
||||
virtual std::string getElementName() = 0;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent);
|
||||
virtual void loadXML(tinyxml2::XMLElement* e);
|
||||
virtual std::string getElementName() override = 0;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent) override;
|
||||
virtual void loadXML(tinyxml2::XMLElement* e) override;
|
||||
|
||||
void setIntensity(float intensity);
|
||||
float getIntensity() const;
|
||||
|
||||
@@ -360,8 +360,9 @@ bool KRModel::getShaderValue(ShaderValue value, hydra::Vector3* output) const
|
||||
case ShaderValue::rim_color:
|
||||
*output = m_rim_color;
|
||||
return true;
|
||||
default:
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
|
||||
bool KRModel::getShaderValue(ShaderValue value, float* output) const
|
||||
@@ -370,8 +371,9 @@ bool KRModel::getShaderValue(ShaderValue value, float* output) const
|
||||
case ShaderValue::rim_power:
|
||||
*output = m_rim_power;
|
||||
return true;
|
||||
default:
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -117,6 +117,8 @@ bool KRParticleSystemNewtonian::getShaderValue(ShaderValue value, float* output)
|
||||
case ShaderValue::dust_particle_size:
|
||||
*output = 1.0f;
|
||||
return true;
|
||||
default:
|
||||
return KRParticleSystem::getShaderValue(value, output);
|
||||
}
|
||||
return KRParticleSystem::getShaderValue(value, output);
|
||||
|
||||
}
|
||||
@@ -39,18 +39,18 @@ public:
|
||||
KRParticleSystemNewtonian(KRScene& scene, std::string name);
|
||||
virtual ~KRParticleSystemNewtonian();
|
||||
|
||||
virtual std::string getElementName();
|
||||
virtual void loadXML(tinyxml2::XMLElement* e);
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent);
|
||||
virtual std::string getElementName() override;
|
||||
virtual void loadXML(tinyxml2::XMLElement* e) override;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent) override;
|
||||
|
||||
|
||||
virtual hydra::AABB getBounds();
|
||||
virtual hydra::AABB getBounds() override;
|
||||
|
||||
virtual void render(RenderInfo& ri) override;
|
||||
|
||||
|
||||
virtual void physicsUpdate(float deltaTime);
|
||||
virtual bool hasPhysics();
|
||||
virtual void physicsUpdate(float deltaTime) override;
|
||||
virtual bool hasPhysics() override;
|
||||
protected:
|
||||
bool getShaderValue(ShaderValue value, float* output) const override;
|
||||
private:
|
||||
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
KRPointLight(KRScene& scene, std::string name);
|
||||
virtual ~KRPointLight();
|
||||
|
||||
virtual std::string getElementName();
|
||||
virtual hydra::AABB getBounds();
|
||||
virtual std::string getElementName() override;
|
||||
virtual hydra::AABB getBounds() override;
|
||||
|
||||
virtual void render(RenderInfo& ri) override;
|
||||
|
||||
|
||||
@@ -44,9 +44,9 @@ public:
|
||||
|
||||
KRReverbZone(KRScene& scene, std::string name);
|
||||
virtual ~KRReverbZone();
|
||||
virtual std::string getElementName();
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent);
|
||||
virtual void loadXML(tinyxml2::XMLElement* e);
|
||||
virtual std::string getElementName() override;
|
||||
virtual tinyxml2::XMLElement* saveXML(tinyxml2::XMLNode* parent) override;
|
||||
virtual void loadXML(tinyxml2::XMLElement* e) override;
|
||||
|
||||
void render(RenderInfo& ri) override;
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
float getReverbGain();
|
||||
void setReverbGain(float reverb_gain);
|
||||
|
||||
virtual hydra::AABB getBounds();
|
||||
virtual hydra::AABB getBounds() override;
|
||||
|
||||
float getContainment(const hydra::Vector3& pos);
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ void KRSprite::render(RenderInfo& ri)
|
||||
bool KRSprite::getShaderValue(ShaderValue value, float* output) const
|
||||
{
|
||||
switch (value) {
|
||||
default:
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
return KRNode::getShaderValue(value, output);
|
||||
}
|
||||
|
||||
@@ -207,14 +207,14 @@ KRMesh* KRResource::LoadObj(KRContext& context, const std::string& path)
|
||||
for (int iSymbol = 1; iSymbol < cSymbols; iSymbol++) {
|
||||
char* pChar = szSymbol[iSymbol];
|
||||
if (*pChar == '.' || (*pChar >= '0' && *pChar <= '9')) {
|
||||
*pFace++ = strtol(pChar, &pChar, 10) - 1; // Vertex Index
|
||||
*pFace++ = (int)strtol(pChar, &pChar, 10) - 1; // Vertex Index
|
||||
|
||||
if (*pChar == '/') {
|
||||
pChar++;
|
||||
if (*pChar == '/') {
|
||||
*pFace++ = -1;
|
||||
} else {
|
||||
*pFace++ = strtol(pChar, &pChar, 10) - 1; // Texture Coordinate Index
|
||||
*pFace++ = (int)strtol(pChar, &pChar, 10) - 1; // Texture Coordinate Index
|
||||
}
|
||||
} else {
|
||||
*pFace++ = -1;
|
||||
@@ -225,7 +225,7 @@ KRMesh* KRResource::LoadObj(KRContext& context, const std::string& path)
|
||||
if (*pChar == '/') {
|
||||
*pFace++ = -1;
|
||||
} else {
|
||||
*pFace++ = strtol(pChar, &pChar, 10) - 1; // Normal Index
|
||||
*pFace++ = (int)strtol(pChar, &pChar, 10) - 1; // Normal Index
|
||||
}
|
||||
} else {
|
||||
*pFace++ = -1;
|
||||
|
||||
@@ -124,9 +124,9 @@ public:
|
||||
|
||||
std::string m_lodBaseName;
|
||||
|
||||
virtual std::string getExtension();
|
||||
virtual bool save(const std::string& path);
|
||||
virtual bool save(mimir::Block& data);
|
||||
virtual std::string getExtension() override;
|
||||
virtual bool save(const std::string& path) override;
|
||||
virtual bool save(mimir::Block& data) override;
|
||||
|
||||
void LoadData(const mesh_info& mi, bool calculate_normals, bool calculate_tangents);
|
||||
void loadPack(mimir::Block* data);
|
||||
|
||||
Reference in New Issue
Block a user