mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-29 07:48:11 -04:00
f_pc_layer (#16)
* f_op_actor_tag OK * f_pc_layer_tag OK * f_pc_layer_iter * forgot a return * identation and extern var name comments * fix struct member name Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
@@ -1 +1,46 @@
|
||||
// ok
|
||||
#include "f/f_pc/f_pc_layer_iter.h"
|
||||
#include "SComponent/c_tree_iter.h"
|
||||
#include "SComponent/c_tag_iter.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
int fpcLyIt_OnlyHere(layer_class *pLayer, cNdIt_MethodFunc pFunc, void *pUserData) {
|
||||
layer_iter lIter;
|
||||
lIter.mpFunc = pFunc;
|
||||
lIter.mpUserData = pUserData;
|
||||
return cTrIt_Method(&pLayer->mNodeListTree,(cNdIt_MethodFunc) cTgIt_MethodCall, &lIter);
|
||||
}
|
||||
|
||||
int fpcLyIt_OnlyHereLY(layer_class *pLayer, cNdIt_MethodFunc pFunc, void *pUserData) {
|
||||
int result;
|
||||
layer_class* currentLayer = fpcLy_CurrentLayer();
|
||||
fpcLy_SetCurrentLayer(pLayer);
|
||||
result = fpcLyIt_OnlyHere(pLayer, pFunc, pUserData);
|
||||
fpcLy_SetCurrentLayer(currentLayer);
|
||||
return result;
|
||||
}
|
||||
|
||||
void * fpcLyIt_Judge(layer_class *pLayer, cNdIt_MethodFunc pFunc, void *pUserData) {
|
||||
layer_iter lIter;
|
||||
lIter.mpFunc = pFunc;
|
||||
lIter.mpUserData = pUserData;
|
||||
return cTrIt_Judge(&pLayer->mNodeListTree,(cNdIt_JudgeFunc) cTgIt_JudgeFilter, &lIter);
|
||||
}
|
||||
|
||||
void * fpcLyIt_AllJudge(cNdIt_MethodFunc pFunc, void *pUserData) {
|
||||
layer_iter lIter;
|
||||
lIter.mpFunc = pFunc;
|
||||
lIter.mpUserData = pUserData;
|
||||
|
||||
layer_class* current = fpcLy_RootLayer();
|
||||
while (current != NULL) {
|
||||
void* result = cTrIt_Judge(¤t->mNodeListTree,(cNdIt_JudgeFunc) cTgIt_JudgeFilter, &lIter);
|
||||
if (result != NULL) {
|
||||
return result;
|
||||
}
|
||||
current = (layer_class*)current->mNode.mpNextNode;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user