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