nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3bf8038
)
gamnit: fix parsing .obj models without an explicit object declaration
author
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 22 Dec 2017 00:14:02 +0000
(19:14 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 4 Jan 2018 21:28:27 +0000
(16:28 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/gamnit/model_parsers/obj.nit
patch
|
blob
|
history
diff --git
a/lib/gamnit/model_parsers/obj.nit
b/lib/gamnit/model_parsers/obj.nit
index
069c653
..
62f1488
100644
(file)
--- a/
lib/gamnit/model_parsers/obj.nit
+++ b/
lib/gamnit/model_parsers/obj.nit
@@
-80,7
+80,11
@@
class ObjFileParser
geometry.params.add vec
else if token == "f" then # Faces
var face = read_face
- if obj_obj != null then obj_obj.faces.add face
+ if obj_obj == null then
+ obj_obj = new ObjObj("")
+ geometry.objects.add obj_obj
+ end
+ obj_obj.faces.add face
else if token == "mtllib" then
current_material_lib = read_until_eol_or_comment
else if token == "usemtl" then