Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions src/SB/Core/gc/iModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

#include <types.h>


RpLight* sEmptyDirectionalLight;
RpLight* sEmptyAmbientLight;
Comment on lines +6 to +7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need to be made static per objdiff.



RwFrame* GetChildFrameHierarchy(RwFrame* frame, void* data)
{
RpHAnimHierarchy* hierarchy = RpHAnimFrameGetHierarchy(frame);
Expand All @@ -25,6 +30,28 @@ void* GetHierarchy(RpAtomic* frame)
return unk_0[0];
}


void iModelInit()
{
RwFrame* frame;
RwRGBAReal black;
void* tempVoid = 0;

for (S32 i = 0; i < 4; i++)
{
frame = (RwFrame*)RpLightCreate(i);
//black = frame;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to take out commented code - it adds unnecessary noise when trying to debug functions to increase the match.

RpLightSetColor(sEmptyDirectionalLight, &black);
frame = RwFrameCreate();
_rwObjectHasFrameSetFrame(sEmptyDirectionalLight, frame);

sEmptyAmbientLight = RpLightCreate(2);

RpLightSetColor(sEmptyAmbientLight, &black);
}
}


RpAtomic* iModelFileNew(void* buffer, U32 size)
{
RwStream* rwmem;
Expand All @@ -49,15 +76,65 @@ void iModelUnload(RpAtomic* userdata)
if ((RpClump*)userdata != 0)
{
RwFrameGetRoot((RwFrame*)userdata);

userdata = 0;
}
else
{
RwFrameDestroyHierarchy(frame);

RwFrameDestroyHierarchy(frame);
userdata = 0;

}
if (clump != 0)
{
RpClumpDestroy(clump);
}
}


RpAtomic* NextAtomicCallback(RpAtomic* atomic, void* data)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should be static as per objdiff.

{
// What?

Comment on lines +99 to +100
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify this comment? Is there something here that you felt might be particularly confusing for future contributors?

RpAtomic** nextModel;

if (data != atomic)
{
atomic = 0;
return atomic;
}
if (data != 0)
{
return atomic;
}

atomic = (RpAtomic*)data;

return atomic;
}

RpAtomic* iModelFile_RWMultiAtomic(RpAtomic* model)
{
RpClump* clump;
RpAtomic* nextModel = 0;
RpAtomic* modelArray[2];

if (model == 0)
{
modelArray[0] = 0;
}
else
{
//modelArray[0] = (S32)model;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to take out commented code - it adds unnecessary noise when trying to debug functions to increase the match.

modelArray[0] = nextModel;
RpClumpForAllAtomics(model->clump, (RpAtomicCallBack)NextAtomicCallback(nextModel, NULL),
modelArray);
}
return model;
}

void iModelCacheAtomic(RpAtomic*)
{
}