|
Digimon World 3 decomp
The European version, SLES_039.36
|
The task system and its registry (task/) More...
Go to the source code of this file.
Data Structures | |
| struct | TaskFuncs |
| The task registry's methods (TASK_REGISTRY.funcs) More... | |
| struct | Task |
| Any task, seen through its header. More... | |
| struct | TaskRegistry |
| Tasks created with an id, so that other code can find them. More... | |
Macros | |
| #define | TASK_INIT 0 |
| Tasks: every game object is a task, a heap block that starts with this header and is updated once per frame (createTask). | |
| #define | TASK_RUN 1 |
| #define | TASK_DONE 2 |
| #define | TASK_KILL 3 |
| #define | TASK_HEADER(Type) |
| #define | TASK_REGISTRY_SIZE 100 |
| The tasks the registry holds at most. | |
Functions | |
| void * | createTask (void(*update)(), s32 size, s32 childrenSize) |
| createTaskWithId for a task nothing needs to find | |
| void | taskSetState (Task *task, s32 state) |
Task method: goes to state state, from substate 0. | |
| void | taskSetSubstate (Task *task, s32 substate) |
Task method: goes to substate substate, from step 0. | |
| void | taskSetStep (Task *task, s32 step) |
Task method: goes to step step, with its counter at 0. | |
| void | taskSetCounter (Task *task, s32 counter) |
| Task method: sets the counter. | |
| void | taskNextState (Task *task) |
| Task method: goes to the next state, from substate 0. | |
| void | taskNextSubstate (Task *task) |
| Task method: goes to the next substate, from step 0. | |
| void | taskNextStep (Task *task) |
| Task method: goes to the next step, with its counter at 0. | |
| void | taskTickCounter (Task *task) |
| Task method: counts one more. | |
| void | destroyTask (Task *task) |
| Default destructor: kills the children, then frees the task. | |
| void * | createTaskWithId (void(*update)(), s32 size, s32 childrenSize, s32 id) |
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks. | |
| struct Task * | executeTask (struct Task *task) |
| One frame of a task and its children; returns NULL once the task is gone. | |
| void | runChildTasks (Task *task) |
| Runs a frame of each child of a task, dropping the ones that end. | |
| Task * | runTask (Task *task) |
| Runs a frame of a task and its children; returns it, or NULL once it is gone. | |
| void | killTask (Task *task) |
| Ends a task now: its last update and destroy run at once. | |
| void | clearTaskRegistry (void) |
| Forgets every registered task. | |
| void | registerTask (Task *task) |
| Adds a task to the first free entry of the registry (ignored when it is full) | |
| void | unregisterTask (Task *task) |
| Removes a task from the registry. | |
| void * | findNextTask (void) |
| The next registered task that matches findTask's id and keys (-1 matches anything), or NULL. | |
| void * | findTask (s32 id, s32 key1, s32 key2) |
| The first registered task that matches (-1 matches anything), or NULL. | |
Variables | |
| TaskRegistry | TASK_REGISTRY |
The task system and its registry (task/)
Definition in file task.h.
| #define TASK_INIT 0 |
Tasks: every game object is a task, a heap block that starts with this header and is updated once per frame (createTask).
A task owns an array of child tasks (windows, cursors...), which run right after it, and it gets that array as the second argument of its update. The state machine is driven through the header: TASK_INIT runs once (usually just nextState), TASK_RUN is the normal state, and TASK_KILL frees the task (and kills its children) after its last update.
| #define TASK_HEADER | ( | Type | ) |
| #define TASK_REGISTRY_SIZE 100 |
createTaskWithId for a task nothing needs to find
Definition at line 105 of file task.c.
Referenced by CARDGAME_createBattle(), CARDGAME_createDeckWindow(), CARDGAME_createFader(), CARDGAME_createMarker(), CARDGAME_createScreen(), CARDGAME_start(), CARDGAME_startPreloader(), CNTY_SEL_start(), CNTY_SEL_startBackgroundTask(), CNTY_SEL_startCursorTask(), CNTY_SEL_startLeftPanelTask(), CNTY_SEL_startMenuTask(), CNTY_SEL_startRightPanelTask(), CNTY_SEL_startTopPanelTask(), createBackground(), createClutTileTask(), createCursor(), createDecompressor(), createEffect(), createEffect(), createEffectSet(), createFader(), createFarSprites(), createFieldMenu(), createFloater(), createFlyer(), createInn(), createMessageBox(), createMessageBoxFrame(), createModeTask(), createScreenFade(), createScrollBar(), createSpriteField(), createSpritePair(), createStillTileTask(), createTalkBox(), createTalkBoxFrame(), createTextWindow(), createTileAnims(), createTileAt(), createTileCursors(), createTileDuoTask(), createTileEffect(), createTileEffectTask(), createTileLoop2(), createTilePair16Done(), createTilePairDone(), createTilePairNDone(), createTileSet(), createTileSix(), createTileSixW(), createTileSoloTask(), createTimer(), createWandererTask(), createWanderPairTask(), createZoomBox(), FIELDSTG_createCutsceneAnim(), FIELDSTG_createEffect(), FIELDSTG_createFileLoader(), FIELDSTG_createGauge(), FIELDSTG_createLaunch(), FIELDSTG_createMapObjects(), FIELDSTG_createSpeech(), FIELDSTG_createSpotEffect(), FIELDSTG_createSpotHint(), FIELDSTG_createStoryEvents(), FIELDSTG_createStream(), FIELDSTG_createTalk(), FIELDSTG_createTriggers(), FIELDSTG_start(), FIELDSTG_startEvent(), FIGHTSTG_createBattleScript(), FIGHTSTG_createCamera(), FIGHTSTG_createCommandMenu(), FIGHTSTG_createConfusedMenu(), FIGHTSTG_createCursor(), FIGHTSTG_createDigivolveMenu(), FIGHTSTG_createFace(), FIGHTSTG_createFader(), FIGHTSTG_createHud(), FIGHTSTG_createItemMenu(), FIGHTSTG_createMesh(), FIGHTSTG_createMessage(), FIGHTSTG_createPartnerInfo(), FIGHTSTG_createPartnerView(), FIGHTSTG_createShotCamera(), FIGHTSTG_createSpriteAnim(), FIGHTSTG_createSwitchInMenu(), FIGHTSTG_createSwitchMenu(), FIGHTSTG_createTechMenu(), FIGHTSTG_playBattleSound(), FIGHTSTG_start(), FIGHTSTG_startActionEvents(), FIGHTSTG_startCameraShots(), FIGHTSTG_startCameraTurn(), FIGHTSTG_startCounterattack(), FIGHTSTG_startDigimonChange(), FIGHTSTG_startEffectModel(), FIGHTSTG_startEnemyAttack(), FIGHTSTG_startEnemyTurn(), FIGHTSTG_startEntrance(), FIGHTSTG_startFirstTech(), FIGHTSTG_startHitEffect(), FIGHTSTG_startItem(), FIGHTSTG_startJump(), FIGHTSTG_startMove(), FIGHTSTG_startOneHpTurn(), FIGHTSTG_startSpriteEffect(), FIGHTSTG_startTechAction(), FIGHTSTG_startWhiteFlash(), SHOCKTST_createEditor(), SHOCKTST_createLoader(), SOUNDTST_createSoundTest(), SOUNDTST_start(), STAGSLCT_createStageSelect(), STAGSLCT_start(), start(), startEvent1510(), startEvent1512(), startEvent1514(), startEvent1516(), startEvent1518(), startEvent1520(), startEvent1522(), startEvent1602(), startEvent1604(), startEvent1616(), startEvent1618(), startEvent8(), startEvent9(), startEvents9000To9015(), startStage(), STCRDABM_createAlbum(), STCRDABM_createGrid(), STCRDDEK_createDeckCards(), STCRDDEK_createEditor(), STCRDDEK_createIdle(), STCRDDEK_createNameEntry(), STCRDDEK_createScreen(), STCRDSHP_createBuy(), STCRDSHP_createGrid(), STCRDSHP_createPackOpen(), STCRDSHP_createShop(), STDGNAME_createMenu(), STDGNAME_createNameEntry(), STDGNAME_createScreen(), STDGNAME_start(), STDWTITL_start(), STDWTITL_startBackgroundTask(), STDWTITL_startEdgeFadeTask(), STDWTITL_startGlintAltTask(), STDWTITL_startGlintTask(), STDWTITL_startLogoTask(), STDWTITL_startMenuTask(), STDWTITL_startMoviePlayerTask(), STDWTITL_startMovieTask(), STDWTITL_startSplashLoaderTask(), STDWTITL_startSplashTask(), STDWTITL_startTitle0AltTask(), STDWTITL_startTitle0Task(), STDWTITL_startTitle1AltTask(), STDWTITL_startTitle1Task(), STDWTITL_startTitleLoaderTask(), STDWTITL_startTitleTask(), STFGTREP_createPartner(), STFGTREP_createScreen(), STFGTREP_start(), STGDGLAB_createEntryList(), STGDGLAB_createEntryPanel(), STGDGLAB_createLab(), STGDGLAB_createMenu(), STGDGLAB_createPartyScreen(), STGDGLAB_createRecipeScreen(), STGDGLAB_createScene(), STGDGLAB_createSkillPanel(), STGDGLAB_createSlotScreen(), STGMCARD_createInfo(), STGMCARD_createMenu(), STGMCARD_createPanel(), STGMCARD_createSaves(), STGMCARD_createScreen(), STGTRAIN_createActor(), STGTRAIN_createIdle(), STGTRAIN_createMenu(), STGTRAIN_createResult(), STGTRAIN_createScreen(), STGTRAIN_createSession(), STGTRAIN_createSprite(), STGTRAIN_start(), STITSHOP_createBuy(), STITSHOP_createInfo(), STITSHOP_createItemList(), STITSHOP_createSell(), STITSHOP_createShop(), STPLNMET_createChoice(), STPLNMET_createConfirm(), STPLNMET_createNameEntry(), STPLNMET_createScreen(), STPLNMET_createScroll(), STPLNMET_createShine(), STPLNMET_createSparkles(), STPLNMET_createWelcome(), STPLNMET_start(), STSTATUS_createCardScreen(), STSTATUS_createDemoScreen(), STSTATUS_createDigivolvePanel(), STSTATUS_createEquipPanel(), STSTATUS_createItemList(), STSTATUS_createItemScreen(), STSTATUS_createMapScreen(), STSTATUS_createMenu(), STSTATUS_createSortScreen(), STSTATUS_createStatusScreen(), STSTATUS_createTechScreen(), WFIGHTMN_createLoader(), WFIGHTTS_createCameraList(), WFIGHTTS_createFighterList(), and WFIGHTTS_createStageList().
Task method: goes to state state, from substate 0.
Definition at line 7 of file task.c.
Referenced by createTaskWithId().
Task method: goes to substate substate, from step 0.
Definition at line 15 of file task.c.
Referenced by createTaskWithId().
Task method: goes to step step, with its counter at 0.
Definition at line 22 of file task.c.
Referenced by createTaskWithId().
Task method: sets the counter.
Definition at line 28 of file task.c.
Referenced by createTaskWithId().
| void taskNextState | ( | Task * | task | ) |
Task method: goes to the next state, from substate 0.
Definition at line 33 of file task.c.
Referenced by createTaskWithId().
| void taskNextSubstate | ( | Task * | task | ) |
Task method: goes to the next substate, from step 0.
Definition at line 41 of file task.c.
Referenced by createTaskWithId().
| void taskNextStep | ( | Task * | task | ) |
Task method: goes to the next step, with its counter at 0.
Definition at line 48 of file task.c.
Referenced by createTaskWithId().
| void taskTickCounter | ( | Task * | task | ) |
Task method: counts one more.
Definition at line 54 of file task.c.
Referenced by createTaskWithId().
| void destroyTask | ( | Task * | task | ) |
Default destructor: kills the children, then frees the task.
Definition at line 59 of file task.c.
Referenced by createTaskWithId().
Allocates a zeroed task of size bytes (header included) with room for childrenSize / 4 child tasks.
A nonzero id also registers it (findTask).
< the current mode's: freed by main whenever the mode task ends
< the current mode's: freed by main whenever the mode task ends
Definition at line 80 of file task.c.
Referenced by createClutTile(), createCommand800(), createCommand801(), createCommand802(), createCommand807(), createCommand808(), createCommand809(), createCommand810(), createCommand811(), createCommand814(), createCommand815(), createCommand827(), createCommand828(), createCommand829(), createCommand830(), createCommand831(), createCommand832(), createCommand833(), createCommand834(), createCommand835(), createCommand838(), createCommand839(), createCommand848(), createCommand849(), createCommand852(), createCommand853(), createCommand854(), createCommand855(), createDarkness(), createFaller(), createFloaterChain(), createMover(), createScroller(), createSoundTile(), createStageEffect(), createStageEffectWithId(), createStillTile(), createTask(), createTileDuo(), createTileEffect(), createTileLift(), createTilePair(), createTilePair16(), createTilePairN(), createTileQuad(), createTileSeqs(), createTileSixWithId(), createTileSixWWithId(), createTileSolo(), createTileTask(), createWanderer(), createWanderPair(), FIELDSTG_createActor(), FIELDSTG_createActorIcon(), FIELDSTG_createBalloon(), FIELDSTG_createBanner(), FIELDSTG_createCamera(), FIELDSTG_createField(), FIELDSTG_createHiddenSpots(), FIELDSTG_createLift(), FIELDSTG_createMapStreamer(), FIELDSTG_startCommandTask(), FIGHTSTG_createBattleCamera(), FIGHTSTG_createLights(), FIGHTSTG_createModel(), FIGHTSTG_createModels(), FIGHTSTG_createStage(), FIGHTSTG_startPlayerTurn(), startStage(), WFIGHTMN_start(), WFIGHTTS_createEffectList(), WFIGHTTS_createMotionList(), and WFIGHTTS_start().
One frame of a task and its children; returns NULL once the task is gone.
Definition at line 70 of file registry.c.
Referenced by runChildTasks(), and runTask().
| void runChildTasks | ( | Task * | task | ) |
Runs a frame of each child of a task, dropping the ones that end.
Definition at line 94 of file registry.c.
Runs a frame of a task and its children; returns it, or NULL once it is gone.
Definition at line 107 of file registry.c.
| void killTask | ( | Task * | task | ) |
Ends a task now: its last update and destroy run at once.
Definition at line 115 of file registry.c.
| void clearTaskRegistry | ( | void | ) |
Forgets every registered task.
Definition at line 4 of file registry.c.
| void registerTask | ( | Task * | task | ) |
Adds a task to the first free entry of the registry (ignored when it is full)
Definition at line 13 of file registry.c.
| void unregisterTask | ( | Task * | task | ) |
Removes a task from the registry.
Definition at line 26 of file registry.c.
| void * findNextTask | ( | void | ) |
The next registered task that matches findTask's id and keys (-1 matches anything), or NULL.
Definition at line 39 of file registry.c.
Referenced by findTask().
The first registered task that matches (-1 matches anything), or NULL.
Definition at line 56 of file registry.c.
|
extern |
Definition at line 122 of file registry.c.
Referenced by addModel(), clearTaskRegistry(), createTaskWithId(), destroyTask(), endBattleOnKnockOut(), executeTask(), fadeInStageLights(), FIELDSTG_balloonCommand(), FIELDSTG_closeField(), FIELDSTG_countBattleSteps(), FIELDSTG_drainTrail(), FIELDSTG_findActor(), FIELDSTG_findActorAt(), FIELDSTG_findHiddenSpot(), FIELDSTG_followLeader(), FIELDSTG_followWithCamera(), FIELDSTG_haltPartners(), FIELDSTG_handleFieldCommand(), FIELDSTG_isTileFree(), FIELDSTG_leaveFieldAfter(), FIELDSTG_openInn(), FIELDSTG_pickViewTiles(), FIELDSTG_pointCamera(), FIELDSTG_resumePartners(), FIELDSTG_runEvent(), FIELDSTG_runLaunch(), FIELDSTG_scrollCamera(), FIELDSTG_searchEventSpot(), FIELDSTG_setEventPose(), FIELDSTG_shakeCamera(), FIELDSTG_startActorGauge(), FIELDSTG_startAreaBattle(), FIELDSTG_startEncounter(), FIELDSTG_startEvent(), FIELDSTG_startListedEvent(), FIELDSTG_startWarp(), FIELDSTG_talkToActorAt(), FIELDSTG_updateBalloon(), FIELDSTG_updateCamera(), FIELDSTG_updateLift(), FIELDSTG_updateSpotEffect(), FIELDSTG_updateTriggers(), FIGHTSTG_getEnemyView(), FIGHTSTG_getFighterView(), FIGHTSTG_isPlayerChoosing(), FIGHTSTG_runScriptCamera(), FIGHTSTG_runScriptStage(), FIGHTSTG_setPlayerTurnStep(), FIGHTSTG_updateBattleScript(), FIGHTSTG_updateCameraShots(), FIGHTSTG_updateCameraTurn(), FIGHTSTG_updateDigimonChange(), FIGHTSTG_updateEntrance(), FIGHTSTG_updateHitEffect(), FIGHTSTG_updatePartnerView(), FIGHTSTG_updateShotCamera(), fillEffectLists(), findNextTask(), findTask(), handleCommand807(), handleCommand814(), killTask(), main(), registerTask(), removeModel(), showActorIcon(), startEvent8000(), startEvent8001(), startEvent8002(), unregisterTask(), updateEvent9015(), updateRisers(), updateTileLift(), updateTileTimer(), WFIGHTMN_blast(), WFIGHTMN_setIdleMotion(), and WFIGHTTS_motionList().