Skip to content

prlib: database.cpp#20

Open
EstexNT wants to merge 2 commits intoparappadev:mainfrom
EstexNT:database
Open

prlib: database.cpp#20
EstexNT wants to merge 2 commits intoparappadev:mainfrom
EstexNT:database

Conversation

@EstexNT
Copy link

@EstexNT EstexNT commented Feb 7, 2026

No description provided.

@decomp-dev
Copy link

decomp-dev bot commented Feb 7, 2026

Report for ntscj_july12 (84930a5 - ecb6c21)

No changes

Copy link
Collaborator

@polybiusproxy polybiusproxy left a comment

Choose a reason for hiding this comment

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

Thank you very much for your contribution! I apologize for the long delay.
There are just a few small nits that I'd like addressed.


INCLUDE_ASM("asm/nonmatchings/prlib/database", _$_t11PrObjectSet1Z13PrSceneObject);
void PrObjectDatabase::DeleteScene(PrSceneObject *scene) {
if (scene == NULL) return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

if (scene == NULL) {
    return;
}

Comment on lines 34 to 51
if (scene->m_obj_set != NULL) {
scene->m_obj_set = NULL;
PrSceneObject *next = scene->m_list.next;
PrSceneObject *prev = scene->m_list.prev;
if (next != NULL) {
next->m_list.prev = prev;
scene->m_list.next = NULL;
} else {
m_scene_set.m_tail = prev;
}
if (prev != NULL) {
prev->m_list.next = next;
scene->m_list.prev = NULL;
} else {
m_scene_set.m_head = next;
}
m_scene_set.m_num--;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pretty sure this could all be part of a method in PrObjectSet. Could you try that and check if it still matches?

Comment on lines 52 to 54
if (scene != NULL) {
delete scene;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Redundant check, if we reach this we already know this is not a null pointer. GCC should emit this check if you just replace this with just use of the delete operator.

Comment on lines 41 to 42
PR_EXTERN
void PrCleanupAllSceneModel(PR_SCENEHANDLE scene);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is there an extern here? This is the header meant for the C code.

Copy link
Author

Choose a reason for hiding this comment

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

PrObjectDatabase::DeleteScene calls PrCleanupAllSceneModel without mangling which only matches when the latter is wrapped in extern "C"

Copy link
Collaborator

@polybiusproxy polybiusproxy Feb 23, 2026

Choose a reason for hiding this comment

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

It looks like you're using the wrong header. Calls within prlib itself must use the prpriv header, which is a bit incomplete as of now (I only added things as I needed them). So just add the externed prototype there.

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.

2 participants