-
Notifications
You must be signed in to change notification settings - Fork 40
iModel work #579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iModel work #579
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,11 @@ | |
|
|
||
| #include <types.h> | ||
|
|
||
|
|
||
| RpLight* sEmptyDirectionalLight; | ||
| RpLight* sEmptyAmbientLight; | ||
|
|
||
|
|
||
| RwFrame* GetChildFrameHierarchy(RwFrame* frame, void* data) | ||
| { | ||
| RpHAnimHierarchy* hierarchy = RpHAnimFrameGetHierarchy(frame); | ||
|
|
@@ -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; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
|
@@ -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) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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*) | ||
| { | ||
| } | ||
There was a problem hiding this comment.
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.