Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
OpenGL
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
C-Fu
OpenGL
Commits
24d26cfd
Commit
24d26cfd
authored
Jan 02, 2017
by
Anakin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unused things from FileInterface
parent
876c689a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
23 deletions
+25
-23
QtMeshViewer/Header/FileInterface.h
QtMeshViewer/Header/FileInterface.h
+6
-17
QtMeshViewer/Header/MshFile.h
QtMeshViewer/Header/MshFile.h
+11
-0
QtMeshViewer/Source/MshFile.cpp
QtMeshViewer/Source/MshFile.cpp
+8
-6
No files found.
QtMeshViewer/Header/FileInterface.h
View file @
24d26cfd
...
...
@@ -8,27 +8,18 @@
#include <QOpenGLFunctions>
struct
VertexData
{
QVector3D
position
;
QVector2D
texCoord
;
};
enum
ModelTyp
{
null
,
dynamicMesh
,
cloth
,
bone
,
staticMesh
,
shadowMesh
=
6
};
struct
BoundingBox
{
QQuaternion
rotation
;
QVector3D
center
;
QVector3D
extents
;
};
struct
VertexData
{
QVector3D
position
;
QVector2D
texCoord
;
};
struct
Segment
{
std
::
uint32_t
textureIndex
=
0
;
QVector
<
VertexData
>
vertices
;
...
...
@@ -38,8 +29,6 @@ struct Segment {
struct
Model
{
std
::
string
name
=
""
;
std
::
string
parent
=
""
;
ModelTyp
type
=
null
;
//TODO: should be removed
std
::
int32_t
renderFlags
=
-
1
;
//TODO: should be removed
QMatrix4x4
m4x4Translation
;
std
::
vector
<
Segment
*>
segmList
;
};
...
...
QtMeshViewer/Header/MshFile.h
View file @
24d26cfd
...
...
@@ -8,6 +8,14 @@ struct ChunkHeader {
std
::
streampos
position
;
};
enum
ModelTyp
{
null
,
dynamicMesh
,
cloth
,
bone
,
staticMesh
,
shadowMesh
=
6
};
class
MshFile
:
public
FileInterface
{
...
...
@@ -16,6 +24,9 @@ public:
virtual
~
MshFile
();
private:
ModelTyp
m_currentType
=
ModelTyp
::
null
;
std
::
int32_t
m_currentRenderFlag
=
-
1
;
virtual
void
import
()
Q_DECL_OVERRIDE
Q_DECL_FINAL
;
void
loadChunks
(
std
::
list
<
ChunkHeader
*>
&
destination
,
std
::
streampos
start
,
const
std
::
uint32_t
length
);
...
...
QtMeshViewer/Source/MshFile.cpp
View file @
24d26cfd
...
...
@@ -190,6 +190,8 @@ void MshFile::analyseMsh2Chunks(std::list<ChunkHeader*>& chunkList)
else
if
(
!
strcmp
(
"MODL"
,
it
->
name
))
{
Model
*
new_model
=
new
Model
;
m_currentType
=
ModelTyp
::
null
;
m_currentRenderFlag
=
-
1
;
// get all MODL subchunks
std
::
list
<
ChunkHeader
*>
tmp_chunks
;
...
...
@@ -238,7 +240,7 @@ void MshFile::analyseModlChunks(Model * dataDestination, std::list<ChunkHeader*>
m_file
.
seekg
(
it
->
position
);
std
::
uint32_t
tmp_type
;
m_file
.
read
(
F2V
(
tmp_type
),
sizeof
(
tmp_type
));
dataDestination
->
t
ype
=
(
ModelTyp
)
tmp_type
;
m_currentT
ype
=
(
ModelTyp
)
tmp_type
;
}
// parent name
...
...
@@ -267,7 +269,7 @@ void MshFile::analyseModlChunks(Model * dataDestination, std::list<ChunkHeader*>
else
if
(
!
strcmp
(
"FLGS"
,
it
->
name
))
{
m_file
.
seekg
(
it
->
position
);
m_file
.
read
(
F2V
(
dataDestination
->
renderFlags
),
sizeof
(
dataDestination
->
renderFlags
));
m_file
.
read
(
F2V
(
m_currentRenderFlag
),
sizeof
(
m_currentRenderFlag
));
}
// translation
...
...
@@ -403,10 +405,10 @@ void MshFile::analyseSegmChunks(Model * dataDestination, std::list<ChunkHeader*>
else
if
(
!
strcmp
(
"STRP"
,
it
->
name
))
{
// don't get null, bone, shadowMesh and hidden mesh indices
if
(
dataDestination
->
t
ype
==
null
||
dataDestination
->
t
ype
==
bone
||
dataDestination
->
t
ype
==
shadowMesh
||
dataDestination
->
renderFlags
==
1
)
if
(
m_currentT
ype
==
null
||
m_currentT
ype
==
bone
||
m_currentT
ype
==
shadowMesh
||
m_currentRenderFlag
==
1
)
continue
;
// jump to the data section and read the size;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment