Zelda 64: Recompiled
This package has been deprecated and may no longer be maintained. We recommend looking for an alternative.
Install with App

Details

Latest version
0.0.1
Last Updated
First Uploaded
Downloads
25
Likes
1
Size
115KB
Dependants

Categories

Tags

Deprecated

ProxyObjDep

A simple workaround for object dependency on Recomp.

Usage

This is primarily to work around objects needing to be loaded for drawing commands. For instance you cannot simply draw the Deku Mask GI from anywhere, or draw DL's from different objects within the same actor without a bunch of complicated logic. With this library this is made simple:

// Import the functions 
RECOMP_IMPORT("proxy_obj_dep", bool ProxyObjDep_Load(PlayState* play, u8 segment, s16 objectId));
RECOMP_IMPORT("proxy_obj_dep", void ProxyObjDep_Unload(u8 segment, s16 objectId));

void MyActor_Draw(Actor* actor, PlayState* play) {
    if (ProxyObjDep_Load(play, 0x06, OBJECT_GI_NUTSMASK)) {
        Matrix_Scale(30.0f, 30.0f, 30.0f, MTXMODE_APPLY);
        GetItem_Draw(play, GID_MASK_DEKU);

        ProxyObjDep_Unload(0x06, OBJECT_GI_NUTSMASK);
    }

    if (ProxyObjDep_Load(play, 0x06, OBJECT_GI_GOLONMASK)) {
        Matrix_Scale(30.0f, 30.0f, 30.0f, MTXMODE_APPLY);
        GetItem_Draw(play, GID_MASK_GORON);

        ProxyObjDep_Unload(0x06, OBJECT_GI_GOLONMASK);
    }
}

Technical

Currently, this is achieved with a very naive approach, a static location in which all objects can be simultaneously loaded into and never unload. Later on I may improve it to be more dilegent and clean up it's un-used objects as things are "unloaded", but the API will stay the same.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.