Skip to content

Commit

Permalink
Fixed a couple more clang warnings and reformatted source
Browse files Browse the repository at this point in the history
  • Loading branch information
begla committed Jun 26, 2017
1 parent ac8adc4 commit a3b8540
Show file tree
Hide file tree
Showing 28 changed files with 199 additions and 205 deletions.
3 changes: 2 additions & 1 deletion IntrinsicCore/src/IntrinsicCoreComponentsIrradianceProbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ struct IrradianceProbeManager
return _data.descFalloffExponent[p_Ref._id];
}

_INTR_INLINE static _INTR_ARRAY(Rendering::IBL::SH9) & _descSHs(IrradianceProbeRef p_Ref)
_INTR_INLINE static _INTR_ARRAY(Rendering::IBL::SH9) &
_descSHs(IrradianceProbeRef p_Ref)
{
return _data.descSHs[p_Ref._id];
}
Expand Down
7 changes: 4 additions & 3 deletions IntrinsicCore/src/IntrinsicCoreComponentsMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ struct DrawCallCollectionParallelTaskSet : enki::ITaskSet
(1u << frustIdx)) > 0u)
{
DrawCallManager::updateSortingHash(
drawCallRef, Components::MeshManager::_perInstanceDataVertex(
meshComponentRef)
.data0.y);
drawCallRef,
Components::MeshManager::_perInstanceDataVertex(
meshComponentRef)
.data0.y);

visibleDrawCallsPerMaterialPass.push_back(drawCallRef);
}
Expand Down
5 changes: 3 additions & 2 deletions IntrinsicCore/src/IntrinsicCoreComponentsRigidBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,9 @@ void RigidBodyManager::updateActorsFromNodes(
physx::PxRigidDynamic* rigidDynamic = actor->is<physx::PxRigidDynamic>();
physx::PxRigidStatic* rigidStatic = actor->is<physx::PxRigidStatic>();

if (rigidDynamic && rigidDynamic->getRigidBodyFlags().isSet(
physx::PxRigidBodyFlag::eKINEMATIC))
if (rigidDynamic &&
rigidDynamic->getRigidBodyFlags().isSet(
physx::PxRigidBodyFlag::eKINEMATIC))
{
// Update kinematic target
const physx::PxTransform transform =
Expand Down
3 changes: 2 additions & 1 deletion IntrinsicCore/src/IntrinsicCoreDodResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ struct ResourceManagerBase : Dod::ManagerBase<IdCount, DataType>

if (fp == nullptr)
{
_INTR_LOG_WARNING("Failed to save resources to file '%s'...", fileName.c_str());
_INTR_LOG_WARNING("Failed to save resources to file '%s'...",
fileName.c_str());
return;
}

Expand Down
9 changes: 4 additions & 5 deletions IntrinsicCore/src/IntrinsicCoreEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ struct EntityManager : Dod::ManagerBase<_INTR_MAX_ENTITY_COUNT, EntityData>
rapidjson::Value& p_Properties,
rapidjson::Document& p_Document)
{
p_Properties.AddMember("name",
_INTR_CREATE_PROP(p_Document, p_GenerateDesc,
_N(Entity), _N(string),
_name(p_Ref), false, false),
p_Document.GetAllocator());
p_Properties.AddMember(
"name", _INTR_CREATE_PROP(p_Document, p_GenerateDesc, _N(Entity),
_N(string), _name(p_Ref), false, false),
p_Document.GetAllocator());
}

_INTR_INLINE static void initFromDescriptor(EntityRef p_Ref,
Expand Down
21 changes: 9 additions & 12 deletions IntrinsicCore/src/IntrinsicCoreGameStatesEditing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,29 +223,26 @@ _INTR_INLINE void selectGizmoPlane(const glm::vec3& p_EntityWorldPos,
bool iXZ = Math::calcIntersectRayPlane(
p_WorldRay, glm::vec3(0.0f, 1.0f, 0.0f), p_EntityWorldPos, pXZ);
glm::vec3 localXZ = pXZ - p_EntityWorldPos;
iXZ = iXZ &&
glm::all(glm::lessThanEqual(glm::vec2(localXZ.x, localXZ.z),
glm::vec2(planeWidthHeight))) &&
iXZ = iXZ && glm::all(glm::lessThanEqual(glm::vec2(localXZ.x, localXZ.z),
glm::vec2(planeWidthHeight))) &&
glm::all(
greaterThanEqual(glm::vec2(localXZ.x, localXZ.z), glm::vec2(0.0f)));

glm::vec3 pXY;
bool iXY = Math::calcIntersectRayPlane(
p_WorldRay, glm::vec3(0.0f, 0.0f, 1.0f), p_EntityWorldPos, pXY);
glm::vec3 localXY = pXY - p_EntityWorldPos;
iXY = iXY &&
glm::all(glm::lessThanEqual(glm::vec2(localXY.x, localXY.y),
glm::vec2(planeWidthHeight))) &&
iXY = iXY && glm::all(glm::lessThanEqual(glm::vec2(localXY.x, localXY.y),
glm::vec2(planeWidthHeight))) &&
glm::all(
greaterThanEqual(glm::vec2(localXY.x, localXY.y), glm::vec2(0.0f)));

glm::vec3 pYZ;
bool iYZ = Math::calcIntersectRayPlane(
p_WorldRay, glm::vec3(1.0f, 0.0f, 0.0f), p_EntityWorldPos, pYZ);
glm::vec3 localYZ = pYZ - p_EntityWorldPos;
iYZ = iYZ &&
glm::all(glm::lessThanEqual(glm::vec2(localYZ.y, localYZ.z),
glm::vec2(planeWidthHeight))) &&
iYZ = iYZ && glm::all(glm::lessThanEqual(glm::vec2(localYZ.y, localYZ.z),
glm::vec2(planeWidthHeight))) &&
glm::all(
greaterThanEqual(glm::vec2(localYZ.y, localYZ.z), glm::vec2(0.0f)));

Expand Down Expand Up @@ -463,10 +460,10 @@ _INTR_INLINE void updateCameraOrbit(float p_DeltaT)
else if (Input::System::getKeyStates()[Input::Key::kCtrl] ==
Input::KeyState::kPressed)
{
_orbitRadius =
glm::max(_orbitRadius - Editing::_cameraSpeed *
_orbitRadius = glm::max(_orbitRadius -
Editing::_cameraSpeed *
(_camAngVel.x - _camAngVel.y) * p_DeltaT,
0.1f);
0.1f);
}

camRot = glm::quat(_eulerAngles);
Expand Down
6 changes: 3 additions & 3 deletions IntrinsicCore/src/IntrinsicCoreGameStatesMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ void Main::update(float p_DeltaT)
static const float jumpSpeed = 20.0f;

const float actualMovedSpeed =
moveSpeed *
(1.0f + runMultiplier * Input::System::getVirtualKeyState(
Input::VirtualKey::kRun, playerId));
moveSpeed * (1.0f +
runMultiplier * Input::System::getVirtualKeyState(
Input::VirtualKey::kRun, playerId));

glm::vec3 moveVector = glm::vec3(0.0f);
{
Expand Down
7 changes: 6 additions & 1 deletion IntrinsicCore/src/IntrinsicCoreGameStatesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ void Manager::activateGameState(GameState::Enum p_GameState)
case GameState::kBenchmark:
Benchmark::activate();
break;
case GameState::kNone:
break;
}

_activeGameState = p_GameState;
Expand All @@ -64,6 +66,8 @@ void Manager::deactivateGameState()
case GameState::kBenchmark:
Benchmark::deativate();
break;
case GameState::kNone:
break;
}

_activeGameState = GameState::kNone;
Expand All @@ -86,7 +90,8 @@ void Manager::update(float p_DeltaT)
case GameState::kBenchmark:
Benchmark::update(p_DeltaT);
break;
;
case GameState::kNone:
break;
}
}

Expand Down
6 changes: 6 additions & 0 deletions IntrinsicCore/src/IntrinsicCoreInputSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ enum Enum
kJump,
kRun,

kInvalid,

kCount
};
}
Expand Down Expand Up @@ -102,6 +104,8 @@ enum Enum
kControllerButtonB,
kControllerButtonX,

kInvalid,

kCount
};
}
Expand All @@ -118,6 +122,8 @@ enum Enum
kTriggerLeft,
kTriggerRight,

kInvalid,

kCount
};
}
Expand Down
26 changes: 14 additions & 12 deletions IntrinsicCore/src/IntrinsicCorePrerequisites.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,22 @@
{ \
const int result = \
MessageBox(NULL, _msg, "Error", MB_ICONERROR | MB_ABORTRETRYIGNORE); \
\
switch(result) \
\
{ \
\
case IDABORT : exit(0); \
\
switch (result) \
\
{ \
\
case IDABORT: \
exit(0); \
break; \
\
case IDRETRY: \
_INTR_DBG_BREAK(); \
break; \
\
case IDRETRY : _INTR_DBG_BREAK(); \
\
case IDCONTINUE: \
break; \
\
case IDCONTINUE : break; \
\
} \
} \
}
#define _INTR_ERROR_DIALOG_SIMPLE(_msg) \
{ \
Expand Down
6 changes: 3 additions & 3 deletions IntrinsicCore/src/IntrinsicCoreRenderingIBL.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ _INTR_INLINE void _preFilterGGX(const gli::texture_cube& p_Input,
gli::fsamplerCube(p_Output, gli::WRAP_CLAMP_TO_EDGE);

glm::uvec2 extent = p_Output.extent(p_MipIdx);
const float roughness = p_MinRoughness + float(p_MipIdx) /
p_Output.max_level() *
(1.0f - p_MinRoughness);
const float roughness =
p_MinRoughness +
float(p_MipIdx) / p_Output.max_level() * (1.0f - p_MinRoughness);
const uint32_t sampleCount = p_SampleCounts[p_MipIdx];

for (uint32_t y = p_RangeY.x; y < p_RangeY.y; ++y)
Expand Down
33 changes: 16 additions & 17 deletions IntrinsicCore/src/IntrinsicCoreRenderingSkyModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,40 @@ namespace
{
#include "ArHosekSkyModelData_RGB.h"
}

namespace Intrinsic
{
namespace Core
{
namespace Rendering
{
// Static members
double* SkyModel::datasetsRGB[] = {datasetRGB1, datasetRGB2,
datasetRGB3};
double* SkyModel::datasetsRGB[] = {datasetRGB1, datasetRGB2, datasetRGB3};

double* SkyModel::datasetsRGBRad[] = {datasetRGBRad1, datasetRGBRad2,
datasetRGBRad3};
datasetRGBRad3};

SkyModel::ArHosekSkyModelState
SkyModel::createSkyModelStateRGB(double p_Turbidity, double p_Albedo,
double p_Elevation)
double p_Elevation)
{
SkyModel::ArHosekSkyModelState state;
SkyModel::ArHosekSkyModelState state;

state.solarRadius = TERRESTRIAL_SOLAR_RADIUS;
state.turbidity = p_Turbidity;
state.albedo = p_Albedo;
state.elevation = p_Elevation;
state.solarRadius = TERRESTRIAL_SOLAR_RADIUS;
state.turbidity = p_Turbidity;
state.albedo = p_Albedo;
state.elevation = p_Elevation;

for (uint32_t channel = 0; channel < 3u; ++channel)
{
cookConfiguration(datasetsRGB[channel], state.configs[channel],
p_Turbidity, p_Albedo, p_Elevation);
for (uint32_t channel = 0; channel < 3u; ++channel)
{
cookConfiguration(datasetsRGB[channel], state.configs[channel], p_Turbidity,
p_Albedo, p_Elevation);

state.radiances[channel] = cookRadianceConfiguration(
datasetsRGBRad[channel], p_Turbidity, p_Albedo, p_Elevation);
}
}

return state;
return state;
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions IntrinsicCore/src/IntrinsicCoreRenderingSkyModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ struct SkyModel
/**
* Creates the sky model state for the given parameters.
*/
static ArHosekSkyModelState
createSkyModelStateRGB(double p_Turbidity, double p_Albedo,
double p_Elevation);
static ArHosekSkyModelState createSkyModelStateRGB(double p_Turbidity,
double p_Albedo,
double p_Elevation);

// <-

Expand All @@ -262,9 +262,10 @@ struct SkyModel
glm::vec3(1.5));
const glm::vec3 zenith = glm::sqrt(glm::cos(p_Theta));

return (glm::vec3(1.0f) + configuration[0] * glm::exp(configuration[1] /
(glm::cos(p_Theta) +
glm::vec3(0.01f)))) *
return (glm::vec3(1.0f) +
configuration[0] *
glm::exp(configuration[1] /
(glm::cos(p_Theta) + glm::vec3(0.01f)))) *
(configuration[2] + configuration[3] * expM +
configuration[5] * rayM + configuration[6] * mieM +
configuration[7] * zenith);
Expand Down
16 changes: 8 additions & 8 deletions IntrinsicCore/src/IntrinsicCoreSystemEventProviderSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void SDL::pumpEvents()
if (sdlEvent.type == SDL_KEYDOWN || sdlEvent.type == SDL_KEYUP)
{
Input::KeyEvent keyEvent;
keyEvent.key = (Input::Key::Enum)((uint32_t)-1);
keyEvent.key = Input::Key::kInvalid;
keyEvent.playerId = 0u;

// Keys
Expand Down Expand Up @@ -142,7 +142,7 @@ void SDL::pumpEvents()
break;
}

if (keyEvent.key != (uint32_t)-1)
if (keyEvent.key != Input::Key::kInvalid)
{
if (sdlEvent.type == SDL_KEYDOWN)
{
Expand All @@ -158,7 +158,7 @@ void SDL::pumpEvents()
sdlEvent.type == SDL_MOUSEBUTTONUP)
{
Input::KeyEvent keyEvent;
keyEvent.key = (Input::Key::Enum)((uint32_t)-1);
keyEvent.key = Input::Key::kInvalid;
keyEvent.playerId = 0u;

switch (sdlEvent.button.button)
Expand All @@ -171,7 +171,7 @@ void SDL::pumpEvents()
break;
}

if (keyEvent.key != (uint32_t)-1)
if (keyEvent.key != Input::Key::kInvalid)
{
if (sdlEvent.type == SDL_MOUSEBUTTONDOWN)
{
Expand Down Expand Up @@ -230,7 +230,7 @@ void SDL::pumpEvents()
sdlEvent.type == SDL_CONTROLLERBUTTONDOWN)
{
Input::KeyEvent keyEvent;
keyEvent.key = (Input::Key::Enum)(uint32_t)-1;
keyEvent.key = Input::Key::kInvalid;
keyEvent.playerId = sdlEvent.cdevice.which;

switch (sdlEvent.cbutton.button)
Expand All @@ -249,7 +249,7 @@ void SDL::pumpEvents()
break;
}

if (keyEvent.key != (uint32_t)-1)
if (keyEvent.key != Input::Key::kInvalid)
{
if (sdlEvent.type == SDL_CONTROLLERBUTTONDOWN)
{
Expand All @@ -264,7 +264,7 @@ void SDL::pumpEvents()
else if (sdlEvent.type == SDL_CONTROLLERAXISMOTION)
{
Input::AxisEvent axisEvent;
axisEvent.axis = (Input::Axis::Enum)(uint32_t)-1;
axisEvent.axis = Input::Axis::kInvalid;
axisEvent.value = (float)sdlEvent.caxis.value / INT16_MAX;
axisEvent.playerId = sdlEvent.cdevice.which;

Expand All @@ -290,7 +290,7 @@ void SDL::pumpEvents()
break;
}

if (axisEvent.axis != (uint32_t)-1)
if (axisEvent.axis != Input::Axis::kInvalid)
{
Input::System::processAxisEvent(axisEvent);
}
Expand Down
Loading

0 comments on commit a3b8540

Please sign in to comment.