… | |
… | |
75 | } |
75 | } |
76 | |
76 | |
77 | faceidx |
77 | faceidx |
78 | face_find (const char *name, faceidx defidx) |
78 | face_find (const char *name, faceidx defidx) |
79 | { |
79 | { |
|
|
80 | if (!name) |
|
|
81 | return defidx; |
|
|
82 | |
80 | facehash_t::iterator i = facehash.find (name); |
83 | facehash_t::iterator i = facehash.find (name); |
81 | |
84 | |
82 | return i == facehash.end () |
85 | return i == facehash.end () |
83 | ? defidx : i->second; |
86 | ? defidx : i->second; |
84 | } |
87 | } |
85 | |
88 | |
86 | faceinfo * |
89 | faceinfo * |
87 | face_info (faceidx idx) |
90 | face_info (faceidx idx) |
88 | { |
91 | { |
|
|
92 | assert (0 < (faceidx)-1); // faceidx must be unsigned |
|
|
93 | |
89 | if (idx >= faces.size ()) |
94 | if (idx >= faces.size ()) |
90 | return 0; |
95 | return 0; |
91 | |
96 | |
92 | return &faces [idx]; |
97 | return &faces [idx]; |
93 | } |
98 | } |