Conversation
polybiusproxy
left a comment
There was a problem hiding this comment.
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.
src/prlib/database.cpp
Outdated
|
|
||
| INCLUDE_ASM("asm/nonmatchings/prlib/database", _$_t11PrObjectSet1Z13PrSceneObject); | ||
| void PrObjectDatabase::DeleteScene(PrSceneObject *scene) { | ||
| if (scene == NULL) return; |
There was a problem hiding this comment.
if (scene == NULL) {
return;
}
src/prlib/database.cpp
Outdated
| 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--; | ||
| } |
There was a problem hiding this comment.
Pretty sure this could all be part of a method in PrObjectSet. Could you try that and check if it still matches?
src/prlib/database.cpp
Outdated
| if (scene != NULL) { | ||
| delete scene; | ||
| } |
There was a problem hiding this comment.
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.
include/prlib/prlib.h
Outdated
| PR_EXTERN | ||
| void PrCleanupAllSceneModel(PR_SCENEHANDLE scene); |
There was a problem hiding this comment.
Why is there an extern here? This is the header meant for the C code.
There was a problem hiding this comment.
PrObjectDatabase::DeleteScene calls PrCleanupAllSceneModel without mangling which only matches when the latter is wrapped in extern "C"
There was a problem hiding this comment.
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.
No description provided.