Skip to content

Commit

Permalink
Reformat with new clang-format config
Browse files Browse the repository at this point in the history
  • Loading branch information
invokr committed Jan 16, 2017
1 parent 1f4f6ee commit 34ab0fb
Show file tree
Hide file tree
Showing 2,369 changed files with 16,091 additions and 15,993 deletions.
2 changes: 1 addition & 1 deletion src/Common/LevelGameDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ enum EWayType
};

enum ERPpointType
{ // [0..255]
{ // [0..255]
rptActorSpawn = 0,
rptArtefactSpawn,
rptItemSpawn,
Expand Down
32 changes: 16 additions & 16 deletions src/Common/LevelStructure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@

enum fsL_Chunks
{
fsL_HEADER = 1, //*
fsL_SHADERS = 2, //*
fsL_VISUALS = 3, //*
fsL_PORTALS = 4, //* - Portal polygons
fsL_LIGHT_DYNAMIC = 6, //*
fsL_GLOWS = 7, //* - All glows inside level
fsL_SECTORS = 8, //* - All sectors on level
fsL_VB = 9, //* - Static geometry
fsL_IB = 10, //*
fsL_SWIS = 11, //* - collapse info, usually for trees
fsL_HEADER = 1, //*
fsL_SHADERS = 2, //*
fsL_VISUALS = 3, //*
fsL_PORTALS = 4, //* - Portal polygons
fsL_LIGHT_DYNAMIC = 6, //*
fsL_GLOWS = 7, //* - All glows inside level
fsL_SECTORS = 8, //* - All sectors on level
fsL_VB = 9, //* - Static geometry
fsL_IB = 10, //*
fsL_SWIS = 11, //* - collapse info, usually for trees
fsL_forcedword = 0xFFFFFFFF
};

enum fsESectorChunks
{
fsP_Portals = 1, // - portal polygons
fsP_Root = 2, // - geometry root
fsP_Portals = 1, // - portal polygons
fsP_Root = 2, // - geometry root
fsP_forcedword = u32(-1)
};

enum fsSLS_Chunks
{
fsSLS_Description = 1, // Name of level
fsSLS_Description = 1, // Name of level
fsSLS_ServerState = 2,
fsSLS_forcedword = u32(-1)
};
Expand Down Expand Up @@ -247,7 +247,7 @@ struct NodeCompressed6
friend class CLevelGraph;
friend struct CNodeCompressed;
friend class CNodeRenumberer;
}; // 2+5+2+11 = 20b
}; // 2+5+2+11 = 20b
#endif

struct SNodePositionOld
Expand All @@ -264,8 +264,8 @@ typedef SNodePositionOld NodePosition;

const char LEVEL_GRAPH_NAME[] = "level.ai";

const u32 XRCL_CURRENT_VERSION = 18; // input
const u32 XRCL_PRODUCTION_VERSION = 14; // output
const u32 XRCL_CURRENT_VERSION = 18; // input
const u32 XRCL_PRODUCTION_VERSION = 14; // output
const u32 CFORM_CURRENT_VERSION = 4;
const u32 MAX_NODE_BIT_COUNT = 23;
const u32 XRAI_CURRENT_VERSION = 10;
36 changes: 18 additions & 18 deletions src/Common/NvMender2003/NVMeshMender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void MeshMender::UpdateIndices(const size_t oldIndex, const size_t newIndex, Tri
void MeshMender::ProcessNormals(TriangleList& possibleNeighbors, xr_vector<Vertex>& theVerts,
xr_vector<unsigned int>& mappingNewToOldVert, D3DXVECTOR3 workingPosition)
{
NeighborGroupList neighborGroups; // a fresh group for each pass
NeighborGroupList neighborGroups; // a fresh group for each pass

// reset each triangle to prepare for smoothing group building
for (u32 i = 0; i < possibleNeighbors.size(); ++i)
Expand Down Expand Up @@ -223,7 +223,7 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors, xr_vector<Verte
D3DXVECTOR3 gnorm(0.0f, 0.0f, 0.0f);

assert(curGroup.size() != 0 && "should not be a zero group here.");
for (size_t t = 0; t < curGroup.size(); ++t) // for each triangle in the group,
for (size_t t = 0; t < curGroup.size(); ++t) // for each triangle in the group,
{
TriID tID = curGroup[t];
gnorm += m_Triangles[tID].normal;
Expand All @@ -240,10 +240,10 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors, xr_vector<Verte
TriangleList& curGroup = neighborGroups[i];
xr_set<size_t> thisGroupIndices;

for (size_t t = 0; t < curGroup.size(); ++t) // for each tri
for (size_t t = 0; t < curGroup.size(); ++t) // for each tri
{
TriID tID = curGroup[t];
for (size_t indx = 0; indx < 3; ++indx) // for each vert in that tri
for (size_t indx = 0; indx < 3; ++indx) // for each vert in that tri
{
// if it is at the positions in question
if (theVerts[m_Triangles[tID].indices[indx]].pos == workingPosition) {
Expand Down Expand Up @@ -281,7 +281,7 @@ void MeshMender::ProcessNormals(TriangleList& possibleNeighbors, xr_vector<Verte
void MeshMender::ProcessTangents(TriangleList& possibleNeighbors, xr_vector<Vertex>& theVerts,
xr_vector<unsigned int>& mappingNewToOldVert, D3DXVECTOR3 workingPosition)
{
NeighborGroupList neighborGroups; // a fresh group for each pass
NeighborGroupList neighborGroups; // a fresh group for each pass

// reset each triangle to prepare for smoothing group building
for (u32 i = 0; i < possibleNeighbors.size(); ++i)
Expand All @@ -306,7 +306,7 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors, xr_vector<Vert
for (u32 i = 0; i < neighborGroups.size(); ++i)
{
D3DXVECTOR3 gtang(0, 0, 0);
for (unsigned int t = 0; t < neighborGroups[i].size(); ++t) // for each triangle in the group,
for (unsigned int t = 0; t < neighborGroups[i].size(); ++t) // for each triangle in the group,
{
TriID tID = neighborGroups[i][t];
gtang += m_Triangles[tID].tangent;
Expand All @@ -323,10 +323,10 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors, xr_vector<Vert
TriangleList& curGroup = neighborGroups[i];
xr_set<size_t> thisGroupIndices;

for (size_t t = 0; t < curGroup.size(); ++t) // for each tri
for (size_t t = 0; t < curGroup.size(); ++t) // for each tri
{
TriID tID = curGroup[t];
for (size_t indx = 0; indx < 3; indx++) // for each vert in that tri
for (size_t indx = 0; indx < 3; indx++) // for each vert in that tri
{
// if it is at the positions in question
if (theVerts[m_Triangles[tID].indices[indx]].pos == workingPosition) {
Expand Down Expand Up @@ -364,7 +364,7 @@ void MeshMender::ProcessTangents(TriangleList& possibleNeighbors, xr_vector<Vert
void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors, xr_vector<Vertex>& theVerts,
xr_vector<unsigned int>& mappingNewToOldVert, D3DXVECTOR3 workingPosition)
{
NeighborGroupList neighborGroups; // a fresh group for each pass
NeighborGroupList neighborGroups; // a fresh group for each pass

// reset each triangle to prepare for smoothing group building
for (u32 i = 0; i < possibleNeighbors.size(); ++i)
Expand All @@ -389,7 +389,7 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors, xr_vector<Ver
for (u32 i = 0; i < neighborGroups.size(); ++i)
{
D3DXVECTOR3 gbinormal(0, 0, 0);
for (unsigned int t = 0; t < neighborGroups[i].size(); ++t) // for each triangle in the group,
for (unsigned int t = 0; t < neighborGroups[i].size(); ++t) // for each triangle in the group,
{
TriID tID = neighborGroups[i][t];
gbinormal += m_Triangles[tID].binormal;
Expand All @@ -406,10 +406,10 @@ void MeshMender::ProcessBinormals(TriangleList& possibleNeighbors, xr_vector<Ver
TriangleList& curGroup = neighborGroups[i];
xr_set<size_t> thisGroupIndices;

for (size_t t = 0; t < curGroup.size(); ++t) // for each tri
for (size_t t = 0; t < curGroup.size(); ++t) // for each tri
{
TriID tID = curGroup[t];
for (size_t indx = 0; indx < 3; ++indx) // for each vert in that tri
for (size_t indx = 0; indx < 3; ++indx) // for each vert in that tri
{
// if it is at the positions in question
if (theVerts[m_Triangles[tID].indices[indx]].pos == workingPosition) {
Expand Down Expand Up @@ -482,9 +482,9 @@ bool MeshMender::Mend(xr_vector<Vertex>& theVerts, xr_vector<unsigned int>& theI
return true;
}

void MeshMender::BuildGroups(Triangle* tri, // the tri of interest
TriangleList& possibleNeighbors, // all tris arround a vertex
NeighborGroupList& neighborGroups, // the neighbor groups to be updated
void MeshMender::BuildGroups(Triangle* tri, // the tri of interest
TriangleList& possibleNeighbors, // all tris arround a vertex
NeighborGroupList& neighborGroups, // the neighbor groups to be updated
xr_vector<Vertex>& theVerts, CanSmoothChecker* smoothChecker, const float& minCreaseAngle)
{
if ((!tri) || (tri->handled)) return;
Expand Down Expand Up @@ -535,7 +535,7 @@ void MeshMender::FindNeighbors(Triangle* tri, TriangleList& possibleNeighbors, T
{
TriID tID = possibleNeighbors[n];
Triangle* possible = &(m_Triangles[tID]);
if (possible != tri) // check for myself
if (possible != tri) // check for myself
{
if (SharesEdge(tri, possible, theVerts)) {
theNeighbors.push_back(possible);
Expand Down Expand Up @@ -661,7 +661,7 @@ void MeshMender::SetUpData(xr_vector<Vertex>& theVerts, const xr_vector<unsigned
// set up bin, norm, and tan
SetUpFaceVectors(t, theVerts, computeNormals);

t.myID = m_Triangles.size(); // set id, to my index into m_Triangles
t.myID = m_Triangles.size(); // set id, to my index into m_Triangles
m_Triangles.push_back(t);
}

Expand Down Expand Up @@ -751,7 +751,7 @@ void MeshMender::OrthogonalizeTangentsAndBinormals(xr_vector<Vertex>& theVerts)
float lenTan = D3DXVec3Length(&(theVerts[i].tangent));
float lenBin = D3DXVec3Length(&(theVerts[i].binormal));

if ((lenTan <= 0.001f) || (lenBin <= 0.001f)) // should be approx 1.0f
if ((lenTan <= 0.001f) || (lenBin <= 0.001f)) // should be approx 1.0f
{
// the tangent space is ill defined at this vertex
// so we can generate a valid one based on the normal vector,
Expand Down
10 changes: 5 additions & 5 deletions src/Common/NvMender2003/NVMeshMender.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class MeshMender
// respectExistingSplits - DONT_RESPECT_SPLITS means that neighboring triangles for smoothing will be determined
// based on position and not on indices.
// RESPECT_SPLITS means that neighboring triangles will be determined based on the indices of
//the
// the
// triangle and not the positions of the vertices.
// you can usually get better smoothing by not respecting existing splits
// only respect them if you know they should be respected.
Expand Down Expand Up @@ -247,7 +247,7 @@ class MeshMender
NeighborhoodID group;
void Reset();

TriID myID; // a global id used to keep track of tris'
TriID myID; // a global id used to keep track of tris'
};

xr_vector<Triangle> m_Triangles;
Expand All @@ -270,9 +270,9 @@ class MeshMender

// function responsible for growing the neighbor hood groups
// arround a vertex
void BuildGroups(Triangle* tri, // the tri of interest
TriangleList& possibleNeighbors, // all tris arround a vertex
NeighborGroupList& neighborGroups, // the neighbor groups to be updated
void BuildGroups(Triangle* tri, // the tri of interest
TriangleList& possibleNeighbors, // all tris arround a vertex
NeighborGroupList& neighborGroups, // the neighbor groups to be updated
xr_vector<Vertex>& theVerts, CanSmoothChecker* smoothChecker, const float& minCreaseAngle);

// given 2 triangles, fill the two neighbor pointers with either
Expand Down
6 changes: 3 additions & 3 deletions src/Common/NvMender2003/mender_input_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ static void fill_mender_input(const xr_vector<type_vertex>& vertices, const xr_v
}

template <typename type_vertex, typename type_face>
static void retrive_data_from_mender_otput(xr_vector<type_vertex>& vertices, // in-out
static void retrive_data_from_mender_otput(xr_vector<type_vertex>& vertices, // in-out
xr_vector<type_face>& faces, const xr_vector<MeshMender::Vertex>& theVerts,
const xr_vector<unsigned int>& theIndices, const xr_vector<unsigned int>& mappingNewToOldVert)
{
xr_vector<type_vertex> old_vertices;
{
old_vertices.clear();
old_vertices = vertices; // save old vertices to retrive through mappingNewToOldVert data that missing in
// MeshMender::Vertex
old_vertices = vertices; // save old vertices to retrive through mappingNewToOldVert data that missing in
// MeshMender::Vertex
// retriving data
const u32 face_count = faces.size();
for (u32 i = 0; i < face_count; ++i)
Expand Down
4 changes: 2 additions & 2 deletions src/Common/face_smoth_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ IC bool do_connect_faces_by_faces_edge_flags(
if (start_edge_back != test_edge_back) return false;

bool start_edge_smooth =
is_soft_edge(start_face_flags, start_common_edge_idx); //!( start.sm_group & (1<<start_common_face) );
is_soft_edge(start_face_flags, start_common_edge_idx); //!( start.sm_group & (1<<start_common_face) );
bool test_edge_smooth =
is_soft_edge(test_face_flags, test_common_edge_idx); //!( test.sm_group & (1<<test_common_face) );
is_soft_edge(test_face_flags, test_common_edge_idx); //!( test.sm_group & (1<<test_common_face) );
return start_edge_smooth && test_edge_smooth;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Common/object_type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ struct is_stl_container
// };
// };
};
#endif // object_type_traits_h_included
#endif // object_type_traits_h_included
6 changes: 3 additions & 3 deletions src/Include/editor/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class engine

virtual char const* weather_current_time() const = 0;
virtual void weather_current_time(char const*) = 0;
}; // class engine
}; // class engine

} // namespace editor
} // namespace editor

#endif // ifndef EDITOR_ENGINE_HPP_INCLUDED
#endif // ifndef EDITOR_ENGINE_HPP_INCLUDED
6 changes: 3 additions & 3 deletions src/Include/editor/ide.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class ide
virtual void weather_editor_setup(weathers_getter_type const& weathers_getter,
weathers_size_getter_type const& weathers_size_getter, frames_getter_type const& frames_getter,
frames_size_getter_type const& frames_size_getter) = 0;
}; // class ide
}; // class ide

} // namespace editor
} // namespace editor

#endif // ifndef EDITOR_IDE_HPP_INCLUDED
#endif // ifndef EDITOR_IDE_HPP_INCLUDED
4 changes: 2 additions & 2 deletions src/Include/editor/interfaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ class engine;
typedef void(__cdecl* initialize_function_ptr)(ide*&, engine*);
typedef void(__cdecl* finalize_function_ptr)(ide*&);

} // namespace editor
} // namespace editor

#endif // ifndef EDITOR_INTERFACES_HPP_INCLUDED
#endif // ifndef EDITOR_INTERFACES_HPP_INCLUDED
Loading

0 comments on commit 34ab0fb

Please sign in to comment.