Skip to content

Commit

Permalink
GRAPHICS: Add information reading for kotor model emitters
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed Apr 7, 2019
1 parent 19cb4ff commit 9fa0be1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/graphics/aurora/model_kotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,7 @@ void ModelNode_KotOR::load(Model_KotOR::ParserContext &ctx) {
}

if (ctx.flags & kNodeFlagHasEmitter) {
// TODO: Emitter
ctx.mdl->skip(0xD8);
readEmitter(ctx);
}

if (ctx.flags & kNodeFlagHasReference) {
Expand Down Expand Up @@ -1122,6 +1121,24 @@ void ModelNode_KotOR::readSaber(Model_KotOR::ParserContext &ctx) {
std::memcpy(indexData, indices, 96 * sizeof(uint16));
}

void ModelNode_KotOR::readEmitter(Model_KotOR::ParserContext &ctx) {
// TODO: Add values for unknown fields
ctx.mdl->skip(20); // Unknown

uint32 xGrid = ctx.mdl->readUint32LE();
uint32 yGrid = ctx.mdl->readUint32LE();

ctx.mdl->skip(4); // Unknown

// TODO: The padding bytes are not necessarily zero, maybe they are specific parameters for the specified mode?
Common::UString update = Common::readStringFixed(*ctx.mdl, Common::kEncodingASCII, 32);
Common::UString render = Common::readStringFixed(*ctx.mdl, Common::kEncodingASCII, 32);
Common::UString blend = Common::readStringFixed(*ctx.mdl, Common::kEncodingASCII, 32);
Common::UString texture = Common::readStringFixed(*ctx.mdl, Common::kEncodingASCII, 64);

ctx.mdl->skip(24); // Unknown
}

} // End of namespace Aurora

} // End of namespace Graphics
1 change: 1 addition & 0 deletions src/graphics/aurora/model_kotor.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class ModelNode_KotOR : public ModelNode {
void readMesh(Model_KotOR::ParserContext &ctx);
void readSkin(Model_KotOR::ParserContext &ctx);
void readSaber(Model_KotOR::ParserContext &ctx);
void readEmitter(Model_KotOR::ParserContext &ctx);
};

} // End of namespace Aurora
Expand Down

0 comments on commit 9fa0be1

Please sign in to comment.