MCPcopy Create free account
hub / github.com/assimp/assimp / LoadLWOBFile

Method LoadLWOBFile

code/AssetLib/LWO/LWOBLoader.cpp:55–100  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

53
54// ------------------------------------------------------------------------------------------------
55void LWOImporter::LoadLWOBFile() {
56 LE_NCONST uint8_t* const end = mFileBuffer + fileSize;
57 bool running = true;
58 while (running) {
59 if (mFileBuffer + sizeof(IFF::ChunkHeader) > end)
60 break;
61 const IFF::ChunkHeader head = IFF::LoadChunk(mFileBuffer);
62
63 if (mFileBuffer + head.length > end) {
64 throw DeadlyImportError("LWOB: Invalid chunk length");
65 }
66 uint8_t* const next = mFileBuffer+head.length;
67 switch (head.type) {
68 // vertex list
69 case AI_LWO_PNTS: {
70 if (!mCurLayer->mTempPoints.empty())
71 ASSIMP_LOG_WARN("LWO: PNTS chunk encountered twice");
72 else
73 LoadLWOPoints(head.length);
74 } break;
75 case AI_LWO_POLS: { // face list
76 if (!mCurLayer->mFaces.empty())
77 ASSIMP_LOG_WARN("LWO: POLS chunk encountered twice");
78 else
79 LoadLWOBPolygons(head.length);
80 } break;
81
82 case AI_LWO_SRFS: // list of tags
83 {
84 if (!mTags->empty())
85 ASSIMP_LOG_WARN("LWO: SRFS chunk encountered twice");
86 else
87 LoadLWOTags(head.length);
88 } break;
89
90 case AI_LWO_SURF: // surface chunk
91 {
92 LoadLWOBSurface(head.length);
93 } break;
94
95 default:
96 break;
97 }
98 mFileBuffer = next;
99 }
100}
101
102// ------------------------------------------------------------------------------------------------
103void LWOImporter::LoadLWOBPolygons(unsigned int length) {

Callers

nothing calls this directly

Calls 3

LoadChunkFunction · 0.85
DeadlyImportErrorFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected