Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
G1MS support, version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Joschuka committed Mar 28, 2022
1 parent 0771636 commit c36f903
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Source/Private/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ noesisModel_t* ProcessModel(BYTE* fileBuffer, int bufferLen, int& numMdl, noeRAP
bool bIsSkeletonOrigin = true;
bool bIsG1MSUnordered = false; //On recent games the skeleton is laid out such as the parent is always read before the child. Not the case in very old G1M.
RichMat43 rootCoords;

//Before doing anything, make sure that Noesis is up to date
if (g_nfn->NPAPI_GetAPIVersion() < NOESIS_PLUGINAPI_VERSION) {
g_nfn->NPAPI_MessagePrompt(L"Please update Noesis!");
return nullptr;
}

void* ctx = rapi->rpgCreateContext(); //Create context
int g1mCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion Source/Public/G1M/G1MS.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct G1MS
G1MSHeader<bBigEndian> header = reinterpret_cast<G1MSHeader<bBigEndian>*>(buffer + offset);
skeletonLayer = header.layer;

if (sectionHeader.chunkVersion > 0x30303330) //No global indices before it seems, need to process differently
if (sectionHeader.chunkVersion > 0x30303332) //No global indices before it seems, need to process differently
{
//Global and local indices map
offset += sizeof(G1MSHeader<bBigEndian>);
Expand Down

0 comments on commit c36f903

Please sign in to comment.