------------------------------------------------------------------------------------------------
| 491 | |
| 492 | // ------------------------------------------------------------------------------------------------ |
| 493 | void LWOImporter::LoadLWO2ImageMap(unsigned int size, LWO::Texture &tex) { |
| 494 | LE_NCONST uint8_t *const end = mFileBuffer + size; |
| 495 | while (true) { |
| 496 | if (mFileBuffer + 6 >= end) break; |
| 497 | LE_NCONST IFF::SubChunkHeader head = IFF::LoadSubChunk(mFileBuffer); |
| 498 | |
| 499 | if (mFileBuffer + head.length > end) |
| 500 | throw DeadlyImportError("LWO2: Invalid SURF.BLOCK chunk length"); |
| 501 | |
| 502 | uint8_t *const next = mFileBuffer + head.length; |
| 503 | switch (head.type) { |
| 504 | case AI_LWO_PROJ: |
| 505 | tex.mapMode = (Texture::MappingMode)GetU2(); |
| 506 | break; |
| 507 | case AI_LWO_WRAP: |
| 508 | tex.wrapModeWidth = (Texture::Wrap)GetU2(); |
| 509 | tex.wrapModeHeight = (Texture::Wrap)GetU2(); |
| 510 | break; |
| 511 | case AI_LWO_AXIS: |
| 512 | tex.majorAxis = (Texture::Axes)GetU2(); |
| 513 | break; |
| 514 | case AI_LWO_IMAG: |
| 515 | tex.mClipIdx = GetU2(); |
| 516 | break; |
| 517 | case AI_LWO_VMAP: |
| 518 | GetS0(tex.mUVChannelIndex, head.length); |
| 519 | break; |
| 520 | case AI_LWO_WRPH: |
| 521 | tex.wrapAmountH = GetF4(); |
| 522 | break; |
| 523 | case AI_LWO_WRPW: |
| 524 | tex.wrapAmountW = GetF4(); |
| 525 | break; |
| 526 | } |
| 527 | mFileBuffer = next; |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | // ------------------------------------------------------------------------------------------------ |
| 532 | void LWOImporter::LoadLWO2Procedural(unsigned int /*size*/, LWO::Texture &tex) { |
nothing calls this directly
no test coverage detected