Skip to content

Commit 024883f

Browse files
author
nitrocaster
committed
Delete duplicated header.
1 parent f4127ad commit 024883f

File tree

7 files changed

+105
-229
lines changed

7 files changed

+105
-229
lines changed

src/editors/ECore/Editor/EditMesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "EditMesh.h"
55
#include "EditObject.h"
66
#include "xrCore/Animation/Bone.hpp"
7-
#include "common/itterate_adjacents.h"
7+
#include "utils/xrLC_Light/itterate_adjacents.h"
88
#include "itterate_adjacents_dynamic.h"
99
#ifdef _EDITOR
1010
#include "ETools.h"

src/utils/xrLC/itterate_adjacents_static.h

Lines changed: 0 additions & 127 deletions
This file was deleted.

src/utils/xrLC/xrLC.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@
226226
</ItemDefinitionGroup>
227227
<ItemGroup>
228228
<ClInclude Include="..\..\common\face_smoth_flags.h" />
229-
<ClInclude Include="..\..\common\itterate_adjacents.h" />
230229
<ClInclude Include="..\..\common\NvMender2003\convert.h" />
231230
<ClInclude Include="..\..\common\NvMender2003\mender_input_output.h" />
232231
<ClInclude Include="..\..\common\NvMender2003\NVMeshMender.h" />
233232
<ClInclude Include="..\..\common\NvMender2003\remove_isolated_verts.h" />
234233
<ClInclude Include="..\Shader_xrLC.h" />
234+
<ClInclude Include="..\xrLC_Light\itterate_adjacents.h" />
235235
<ClInclude Include="ArbitraryList.h" />
236236
<ClInclude Include="Build.h" />
237237
<ClInclude Include="b_globals.h" />

src/utils/xrLC/xrLC.vcxproj.filters

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@
114114
<ClInclude Include="..\..\common\face_smoth_flags.h">
115115
<Filter>%2a%2a%2a COMPILER %2a%2a%2a</Filter>
116116
</ClInclude>
117-
<ClInclude Include="..\..\common\itterate_adjacents.h">
118-
<Filter>%2a%2a%2a COMPILER %2a%2a%2a</Filter>
119-
</ClInclude>
120117
<ClInclude Include="Sector.h">
121118
<Filter>%2a%2a%2a COMPILER %2a%2a%2a</Filter>
122119
</ClInclude>
@@ -139,6 +136,9 @@
139136
<Filter>%2a%2a%2a COMPILER %2a%2a%2a\net</Filter>
140137
</ClInclude>
141138
<ClInclude Include="xrGameMaterials.h" />
139+
<ClInclude Include="..\xrLC_Light\itterate_adjacents.h">
140+
<Filter>%2a%2a%2a COMPILER %2a%2a%2a</Filter>
141+
</ClInclude>
142142
</ItemGroup>
143143
<ItemGroup>
144144
<ClCompile Include="StdAfx.cpp">

src/utils/xrLC_Light/calculate_normals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define __CALCULATE_NORMALS_H__
33

44
#include "itterate_adjacents_static.h"
5-
#include "common/itterate_adjacents.h"
5+
#include "itterate_adjacents.h"
66

77
template <typename typeVertex>
88
class calculate_normals

src/utils/xrLC_Light/itterate_adjacents_static.h

Lines changed: 99 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,117 +2,120 @@
22
#define _ITTERATE_ADJACENTS_STATIC_H_
33
#include "common/face_smoth_flags.h"
44

5+
extern XRLC_LIGHT_API bool g_using_smooth_groups;
6+
extern XRLC_LIGHT_API bool g_smooth_groups_by_faces;
7+
58
template<typename typeVertex>
69
struct itterate_adjacents_params_static
710
{
8-
typedef typeVertex type_vertex;
9-
typedef typename typeVertex::type_face type_face;
10-
typedef xr_vector<type_face*> vecFace;
11+
typedef typeVertex type_vertex;
12+
typedef typename typeVertex::type_face type_face;
13+
typedef xr_vector<type_face*> vecFace;
1114

1215
private:
13-
14-
const type_vertex* pTestVertex;
15-
vecFace& new_adj_vec;
16-
const float sm_cos;
16+
17+
const type_vertex* pTestVertex;
18+
vecFace& new_adj_vec;
19+
const float sm_cos;
1720
public:
18-
itterate_adjacents_params_static(
19-
const type_vertex* _pTestVertex,
20-
vecFace& _new_adj_vec,
21-
float _sm_cos
22-
):
23-
pTestVertex (_pTestVertex) ,
24-
new_adj_vec (_new_adj_vec) ,
25-
sm_cos (_sm_cos)
26-
{}
21+
itterate_adjacents_params_static(
22+
const type_vertex* _pTestVertex,
23+
vecFace& _new_adj_vec,
24+
float _sm_cos
25+
):
26+
pTestVertex (_pTestVertex) ,
27+
new_adj_vec (_new_adj_vec) ,
28+
sm_cos (_sm_cos)
29+
{}
2730

2831
private:
29-
IC static bool has_same_edge(const type_face* F1, const type_face* F2, u16 &F1_edge_index, u16 &F2_edge_index )
30-
{
31-
F1_edge_index = u16(-1);
32-
F2_edge_index = u16(-1);
33-
34-
for (int e=0; e<3; e++)
35-
{
36-
type_vertex *v1_a, *v1_b;
37-
F1->EdgeVerts(e,&v1_a,&v1_b);
38-
if (v1_a>v1_b)
39-
swap(v1_a,v1_b);
40-
41-
for (int r=0; r<3; ++r)
42-
{
43-
type_vertex *v2_a, *v2_b;
44-
F2->EdgeVerts(r,&v2_a,&v2_b);
45-
if (v2_a>v2_b)
46-
swap(v2_a,v2_b);
47-
48-
if ((v1_a==v2_a)&&(v1_b==v2_b))
49-
{
50-
F1_edge_index = e;
51-
F2_edge_index = r;
52-
return true;
53-
}
54-
}
55-
}
56-
return false;
57-
}
32+
IC static bool has_same_edge(const type_face* F1, const type_face* F2, u16 &F1_edge_index, u16 &F2_edge_index )
33+
{
34+
F1_edge_index = u16(-1);
35+
F2_edge_index = u16(-1);
36+
37+
for (int e=0; e<3; e++)
38+
{
39+
type_vertex *v1_a, *v1_b;
40+
F1->EdgeVerts(e,&v1_a,&v1_b);
41+
if (v1_a>v1_b)
42+
swap(v1_a,v1_b);
43+
44+
for (int r=0; r<3; ++r)
45+
{
46+
type_vertex *v2_a, *v2_b;
47+
F2->EdgeVerts(r,&v2_a,&v2_b);
48+
if (v2_a>v2_b)
49+
swap(v2_a,v2_b);
50+
51+
if ((v1_a==v2_a)&&(v1_b==v2_b))
52+
{
53+
F1_edge_index = e;
54+
F2_edge_index = r;
55+
return true;
56+
}
57+
}
58+
}
59+
return false;
60+
}
5861

5962

6063
IC static bool do_connect_faces( const type_face &start, const type_face &test, u16 start_common_edge_idx, u16 test_common_edge_idx, float sm_cos )
61-
{
62-
if( g_using_smooth_groups )
63-
{
64-
if( g_smooth_groups_by_faces )
65-
return ( start.sm_group != u32(-1) &&
66-
start.sm_group == test.sm_group );
67-
else
68-
return do_connect_faces_by_faces_edge_flags( start.sm_group, test.sm_group, start_common_edge_idx, test_common_edge_idx );
69-
}
70-
else
71-
{
72-
float cosa = start.N.dotproduct(test.N);
73-
return ( cosa>sm_cos ) ;
74-
}
75-
}
64+
{
65+
if( g_using_smooth_groups )
66+
{
67+
if( g_smooth_groups_by_faces )
68+
return ( start.sm_group != u32(-1) &&
69+
start.sm_group == test.sm_group );
70+
else
71+
return do_connect_faces_by_faces_edge_flags( start.sm_group, test.sm_group, start_common_edge_idx, test_common_edge_idx );
72+
}
73+
else
74+
{
75+
float cosa = start.N.dotproduct(test.N);
76+
return ( cosa>sm_cos ) ;
77+
}
78+
}
7679

7780
public:
7881

7982

80-
IC const u32 current_adjacents_size( ) const
81-
{
82-
VERIFY(pTestVertex);
83-
return u32( pTestVertex->m_adjacents.size() );
84-
}
85-
86-
IC type_face* current_adjacents_face( u32 i ) const
87-
{
88-
VERIFY( pTestVertex );
89-
return pTestVertex->m_adjacents[i];
90-
}
91-
92-
IC bool is_processed( const type_face &f ) const
93-
{
94-
return f.flags.bSplitted;
95-
}
96-
97-
IC bool add_adjacents( u32 start_face_idx, u32 test_face_idx )
98-
{
99-
const type_face *start_face = current_adjacents_face( start_face_idx );
100-
type_face *test_face = current_adjacents_face( test_face_idx );
101-
if(is_processed(*test_face))
102-
return false;
103-
u16 StartFace_common_edge_index = u16(-1);
104-
u16 TestFace_common_edge_index = u16(-1);
105-
if ( has_same_edge( start_face, test_face, StartFace_common_edge_index, TestFace_common_edge_index ) )
106-
{
107-
if ( (start_face==test_face) || do_connect_faces( *start_face, *test_face, StartFace_common_edge_index, TestFace_common_edge_index, sm_cos ) )
108-
{
109-
new_adj_vec.push_back ( test_face );
110-
test_face->flags.bSplitted = true;
111-
return true;
112-
}
113-
}
114-
return false;
115-
}
83+
IC const u32 current_adjacents_size( ) const
84+
{
85+
VERIFY(pTestVertex);
86+
return u32( pTestVertex->m_adjacents.size() );
87+
}
88+
89+
IC type_face* current_adjacents_face( u32 i ) const
90+
{
91+
VERIFY( pTestVertex );
92+
return pTestVertex->m_adjacents[i];
93+
}
94+
95+
IC bool is_processed( const type_face &f ) const
96+
{
97+
return f.flags.bSplitted;
98+
}
99+
100+
IC bool add_adjacents( u32 start_face_idx, u32 test_face_idx )
101+
{
102+
const type_face *start_face = current_adjacents_face( start_face_idx );
103+
type_face *test_face = current_adjacents_face( test_face_idx );
104+
if(is_processed(*test_face))
105+
return false;
106+
u16 StartFace_common_edge_index = u16(-1);
107+
u16 TestFace_common_edge_index = u16(-1);
108+
if ( has_same_edge( start_face, test_face, StartFace_common_edge_index, TestFace_common_edge_index ) )
109+
{
110+
if ( (start_face==test_face) || do_connect_faces( *start_face, *test_face, StartFace_common_edge_index, TestFace_common_edge_index, sm_cos ) )
111+
{
112+
new_adj_vec.push_back ( test_face );
113+
test_face->flags.bSplitted = true;
114+
return true;
115+
}
116+
}
117+
return false;
118+
}
116119

117120
};
118121

0 commit comments

Comments
 (0)