mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-30 10:54:51 +00:00
fixed objmodel reading
This commit is contained in:
parent
306a5b6c0f
commit
091d747ae8
@ -81,11 +81,10 @@ void model::load_obj(model_data& md) {
|
|||||||
emit_material();
|
emit_material();
|
||||||
nextcol = 0xFFFFFFFF;
|
nextcol = 0xFFFFFFFF;
|
||||||
texname = "";
|
texname = "";
|
||||||
fsm.get<char>();
|
mtlname = scanline_noblank(fsm);
|
||||||
scan(fsm, mtlname);
|
|
||||||
}
|
}
|
||||||
if(s == "map_Kd") {
|
if(s == "map_Kd") {
|
||||||
scan(fsm, texname);
|
texname = scanline_noblank(fsm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit_material();
|
emit_material();
|
||||||
@ -94,8 +93,7 @@ void model::load_obj(model_data& md) {
|
|||||||
next_object:
|
next_object:
|
||||||
object *co = nullptr;
|
object *co = nullptr;
|
||||||
bool textured = false;
|
bool textured = false;
|
||||||
fs.get<char>();
|
string oname = scanline_noblank(fs);
|
||||||
string oname = scanline(fs);
|
|
||||||
println(hlog, "reading object: ", oname);
|
println(hlog, "reading object: ", oname);
|
||||||
md.objindex.push_back(isize(md.objs));
|
md.objindex.push_back(isize(md.objs));
|
||||||
hyperpoint ctr = Hypc;
|
hyperpoint ctr = Hypc;
|
||||||
@ -140,10 +138,7 @@ void model::load_obj(model_data& md) {
|
|||||||
else if(s == "usemtl") {
|
else if(s == "usemtl") {
|
||||||
if(co) cgi.finishshape();
|
if(co) cgi.finishshape();
|
||||||
if(co) println(hlog, "vertices = ", co->sh.e-co->sh.s, " tvertices = ", isize(co->tv.tvertices));
|
if(co) println(hlog, "vertices = ", co->sh.e-co->sh.s, " tvertices = ", isize(co->tv.tvertices));
|
||||||
fs.get<char>();
|
string mtlname = scanline_noblank(fs);
|
||||||
string mtlname;
|
|
||||||
scan(fs, mtlname);
|
|
||||||
//string mtlname = scanline(fs);
|
|
||||||
co = nullptr;
|
co = nullptr;
|
||||||
if(mtlname.find("Layer_Layer0") != string::npos) continue;
|
if(mtlname.find("Layer_Layer0") != string::npos) continue;
|
||||||
objects.push_back(make_shared<object>());
|
objects.push_back(make_shared<object>());
|
||||||
|
Loading…
Reference in New Issue
Block a user