Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GovanifY
kh2vif
Commits
0d92361a
Commit
0d92361a
authored
Apr 09, 2018
by
Gauvain Roussel-Tarbouriech
Browse files
Sanity checks + switching to meson
parent
b2a696a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile
deleted
100644 → 0
View file @
b2a696a1
WCXX
=
i686-w64-mingw32-g++
CXX
=
g++
CF
=
clang-format
all
:
format linux
format
:
$(CF)
-i
obj2kh2v.cpp
linux
:
$(CXX)
-g
-std
=
c++11 obj2kh2v.cpp
-o
obj2kh2v
clean
:
rm
-rf
*
.kh2v
*
.o
*
.dsm
*
.exe obj2kh2v
windows
:
$(WCXX)
-std
=
c++11
-static-libgcc
-static-libstdc
++ obj2kh2v.cpp
-o
obj2kh2v.exe
meson.build
0 → 100644
View file @
0d92361a
project('obj2kh2v', 'cpp')
src = ['obj2kh2v.cpp']
executable('obj2kh2v', src)
cleaner = find_program('clang-format')
r = run_command(cleaner, '-i', src)
obj2kh2v.cpp
View file @
0d92361a
...
...
@@ -19,7 +19,6 @@ int max(int x, int y, int z) {
}
int
main
(
int
argc
,
char
*
argv
[])
{
long
ap
,
vp
,
hp
;
// max uv buffer, should be enough for an entire set of obj vertices
int
uvs
[
8192
];
int
uv_count
=
0
;
...
...
@@ -138,7 +137,6 @@ int main(int argc, char *argv[]) {
while
(
getline
(
input
,
line
))
{
if
(
line
.
substr
(
0
,
2
)
==
"f "
)
{
long
cur_pos
=
0
;
std
::
istringstream
s
(
line
.
substr
(
2
));
std
::
string
i
,
n
,
u
;
int
ii
,
inn
,
iu
;
...
...
@@ -208,11 +206,10 @@ int main(int argc, char *argv[]) {
while
(
getline
(
input
,
line
))
{
if
(
line
.
substr
(
0
,
2
)
==
"v "
)
{
std
::
istringstream
s
(
line
.
substr
(
2
));
float
x
,
y
,
z
,
w
;
float
x
,
y
,
z
;
s
>>
x
;
s
>>
y
;
s
>>
z
;
w
=
1.0
f
;
line
=
".float "
+
std
::
to_string
(
x
)
+
", "
+
std
::
to_string
(
y
)
+
", "
+
std
::
to_string
(
z
);
dsm_mem
.
push_back
(
line
);
...
...
@@ -227,14 +224,14 @@ int main(int argc, char *argv[]) {
dsm_mem
.
push_back
(
"unpack[r] V4_32, ,*; Vertex affiliation header"
);
// printf("%lu", bones.size());
vertex_affiliation
=
dsm_mem
.
size
()
-
1
;
for
(
int
i
=
0
;
i
<
ceil
(
float
(
bones
.
size
())
/
4
);
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
ceil
(
float
(
bones
.
size
())
/
4
);
i
++
)
{
line
=
".int "
+
std
::
to_string
(
bones
[(
i
*
4
)]);
int
z
=
1
;
unsigned
int
z
=
1
;
while
((
i
*
4
)
+
z
<
bones
.
size
()
&&
z
<
4
)
{
line
+=
", "
+
std
::
to_string
(
bones
[(
i
*
4
)
+
z
]);
z
++
;
}
for
(
z
;
z
<
4
;
z
++
)
{
for
(;
z
<
4
;
z
++
)
{
line
+=
", 0"
;
}
dsm_mem
.
push_back
(
line
);
...
...
@@ -275,7 +272,7 @@ int main(int argc, char *argv[]) {
" ,*; Vertex affiliation header"
;
dsm_mem
[
vertex_affiliation
]
=
line
;
for
(
int
i
=
0
;
i
<
dsm_mem
.
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
dsm_mem
.
size
();
i
++
)
{
dsm
<<
dsm_mem
[
i
]
<<
std
::
endl
;
}
dsm
.
close
();
...
...
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