--------------------------------------
| 202 | |
| 203 | //-------------------------------------- |
| 204 | bool MaterialList::readText(Stream &stream, U8 firstByte) |
| 205 | { |
| 206 | free(); |
| 207 | |
| 208 | if (!firstByte) |
| 209 | return (stream.getStatus() == Stream::Ok || stream.getStatus() == Stream::EOS); |
| 210 | |
| 211 | char buf[1024]; |
| 212 | buf[0] = firstByte; |
| 213 | U32 offset = 1; |
| 214 | |
| 215 | for(;;) |
| 216 | { |
| 217 | stream.readLine((U8*)(buf+offset), sizeof(buf)-offset); |
| 218 | if(!buf[0]) |
| 219 | break; |
| 220 | offset = 0; |
| 221 | |
| 222 | // Material paths are a legacy of Tribes tools, |
| 223 | // strip them off... |
| 224 | char *name = &buf[dStrlen(buf)]; |
| 225 | while (name != buf && name[-1] != '/' && name[-1] != '\\') |
| 226 | name--; |
| 227 | |
| 228 | // Add it to the list |
| 229 | mMaterialNames.push_back(name); |
| 230 | mMatInstList.push_back(NULL); |
| 231 | } |
| 232 | |
| 233 | return (stream.getStatus() == Stream::Ok || stream.getStatus() == Stream::EOS); |
| 234 | } |
| 235 | |
| 236 | bool MaterialList::readText(Stream &stream) |
| 237 | { |