Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
acgl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACGL
acgl
Commits
2f7dca91
Commit
2f7dca91
authored
Jun 04, 2014
by
Martin Schultz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* faster obj parsing for tabs
parent
468672ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
src/ACGL/OpenGL/Data/GeometryDataLoadStoreOBJ.cc
src/ACGL/OpenGL/Data/GeometryDataLoadStoreOBJ.cc
+12
-14
No files found.
src/ACGL/OpenGL/Data/GeometryDataLoadStoreOBJ.cc
View file @
2f7dca91
...
...
@@ -73,29 +73,26 @@ namespace
const
char
*
nextObject
(
const
char
*
_position
,
const
char
*
_end
)
{
return
std
::
find_if
(
_position
,
_end
,
[](
char
_value
)
while
(
_position
<
_end
)
{
return
(
_value
==
' '
||
_value
==
'\t'
);
if
(
*
_position
==
' '
||
*
_position
==
'\t'
)
return
_position
;
++
_position
;
}
);
return
_position
;
}
// Parses a string of space-separated numbers into a packed floating-point vector (_data) with a maximum number of _maxDimension elements
void
parseVector
(
const
char
*
_
star
t
,
const
char
*
_end
,
int
_maxDimension
,
int
&
_dimension
,
float
*
_data
)
void
parseVector
(
const
char
*
_
i
t
,
const
char
*
_end
,
int
_maxDimension
,
int
&
_dimension
,
float
*
_data
)
{
const
char
*
it
=
_start
;
const
char
*
end
=
_end
;
const
char
*
found
;
_dimension
=
0
;
while
(
_dimension
<
_maxDimension
&&
it
<
end
)
while
(
_dimension
<
_maxDimension
&&
_it
<
_
end
)
{
trim
(
it
);
found
=
nextObject
(
it
,
end
);
_data
[
_dimension
++
]
=
fastAtof
(
it
,
found
-
1
);
it
=
found
==
end
?
end
:
found
+
1
;
trim
(
_
it
);
found
=
nextObject
(
_it
,
_
end
);
_data
[
_dimension
++
]
=
fastAtof
(
_
it
,
found
-
1
);
_it
=
found
==
_end
?
_
end
:
found
+
1
;
}
}
...
...
@@ -418,6 +415,7 @@ SharedGeometryData loadGeometryDataFromOBJ(const std::string& _filename, bool _c
data
->
setStrideSize
(
strideSize
);
data
->
setSize
(
abDataElements
*
sizeof
(
GLfloat
));
data
->
setData
((
GLubyte
*
)
abData
);
return
data
;
}
...
...
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