Skip to content

Name func_8005B198 in Camera.h#2680

Open
mzxrules wants to merge 2 commits into
zeldaret:mainfrom
mzxrules:OnePoint_CameraActorCategory
Open

Name func_8005B198 in Camera.h#2680
mzxrules wants to merge 2 commits into
zeldaret:mainfrom
mzxrules:OnePoint_CameraActorCategory

Conversation

@mzxrules
Copy link
Copy Markdown
Contributor

Contributions made in this pr are licensed under CC0

Comment thread include/sfx.h
Copy link
Copy Markdown
Collaborator

@Dragorn421 Dragorn421 left a comment

Choose a reason for hiding this comment

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

Some notes

About D_8011D3AC = rwData->curKeyFrame->initField & 0xF; (in Camera_Unique9 aka the implementation for CAM_SET_CS_C):
That code path is only taken when ONEPOINT_CS_INIT_FIELD_IS_TYPE_ACTORCAT(rwData->curKeyFrame->initField)
There are only two occurrences of ONEPOINT_CS_INIT_FIELD_ACTORCAT defining such a field, and they are both in onepointdemo id=3410 (which does set CAM_SET_CS_C)
That onepointdemo is only used by BgJyaBombchuiwa, and that actor doesn't check D_8011D3AC/func_8005B198() (but maybe another actor does during the relevant onepointdemo)

So all in all I would say that this use in Camera_Unique9 is irrelevant in the grand scheme of things

That leaves D_8011D3AC = camera->target->category; (in Camera_Demo5 aka the implementation for CAM_SET_CS_ATTENTION)

Let's look at func_8005B198() in important actor EnBox
In the EnBox_AppearOnSwitchFlag path, and others, func_8005B198() is used every frame (in EnBox_AppearInit) after a frame where OnePointCutscene_Attention(play, &this->dyna.actor); has been called
OnePointCutscene_Attention starts onepointdemo id=5010 which uses CAM_SET_CS_ATTENTION (exactly the setting leading to Camera_Demo5 and D_8011D3AC = camera->target->category;)
At that point the target (camera->target) is the actor that was passed to OnePointCutscene_Attention aka the EnBox instance
And since Demo5 sends control to Unique9 immediately (by setting the camera setting to CAM_SET_CS_C) the value stays until the next attention cutscene

And I don't know in which direction to push the analysis further


Anyway as fig said on discord ( https://discord.com/channels/688807550715560050/688851317593997489/1472297958929338571 ) I agree that the name seems too broad, currently you'd expect it to return GET_ACTIVE_CAM(play)->target->category

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants