------------------------------------------------------------------------------------------------
| 544 | |
| 545 | // ------------------------------------------------------------------------------------------------ |
| 546 | void LWOImporter::LoadLWO2TextureHeader(unsigned int size, LWO::Texture &tex) { |
| 547 | LE_NCONST uint8_t *const end = mFileBuffer + size; |
| 548 | |
| 549 | // get the ordinal string |
| 550 | GetS0(tex.ordinal, size); |
| 551 | |
| 552 | // we could crash later if this is an empty string ... |
| 553 | if (!tex.ordinal.length()) { |
| 554 | ASSIMP_LOG_ERROR("LWO2: Ill-formed SURF.BLOK ordinal string"); |
| 555 | tex.ordinal = "\x00"; |
| 556 | } |
| 557 | while (true) { |
| 558 | if (mFileBuffer + 6 >= end) break; |
| 559 | const IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer); |
| 560 | |
| 561 | if (mFileBuffer + head.length > end) |
| 562 | throw DeadlyImportError("LWO2: Invalid texture header chunk length"); |
| 563 | |
| 564 | uint8_t *const next = mFileBuffer + head.length; |
| 565 | switch (head.type) { |
| 566 | case AI_LWO_CHAN: |
| 567 | tex.type = GetU4(); |
| 568 | break; |
| 569 | case AI_LWO_ENAB: |
| 570 | tex.enabled = GetU2() ? true : false; |
| 571 | break; |
| 572 | case AI_LWO_OPAC: |
| 573 | tex.blendType = (Texture::BlendType)GetU2(); |
| 574 | tex.mStrength = GetF4(); |
| 575 | break; |
| 576 | } |
| 577 | mFileBuffer = next; |
| 578 | } |
| 579 | } |
| 580 | |
| 581 | // ------------------------------------------------------------------------------------------------ |
| 582 | void LWOImporter::LoadLWO2TextureBlock(LE_NCONST IFF::SubChunkHeader *head, unsigned int size) { |
nothing calls this directly
no test coverage detected