A batch of frame callbacks.
Definition frameevent.h:114
void ExecuteAsync(World *world)
Definition frameevent.cc:344
Util::Array< Processor * > processors
Definition frameevent.h:148
int order
sorting order in frame event
Definition frameevent.h:139
void Execute(World *world)
Definition frameevent.cc:213
bool async
Definition frameevent.h:140
void CacheTable(MemDb::TableId, MemDb::TableSignature const &)
add a table to the cache of any processors that accepts it, that is attached to this frame batch
Definition frameevent.cc:304
void Prefilter(World *world, bool force=false)
prefilter all processors. Should not be done per frame - instead use CacheTable if you need to do inc...
Definition frameevent.cc:286
void ExecuteSequential(World *world)
Definition frameevent.cc:429
bool TryInsert(Processor *processor)
Try to insert a processor into the batch.
Definition frameevent.cc:229
bool TryRemove(Processor *processor)
Tries to remove a processor from the batch, if it exists in the batch.
Definition frameevent.cc:268
Util::Array< Processor const * > GetProcessors() const
Definition frameevent.cc:329
void AddProcessor(Processor *processor)
Adds a processor to the frame event.
Definition frameevent.cc:89
Util::Array< Batch const * > const GetBatches() const
Definition frameevent.cc:187
int order
Definition frameevent.h:87
Util::Array< Batch * > batches
Batches that this event will execute.
Definition frameevent.h:102
FramePipeline * pipeline
Which pipeline is this event attached to.
Definition frameevent.h:99
void CacheTable(MemDb::TableId, MemDb::TableSignature const &)
add a table to the caches of any processors that accepts it, that is attached to this frame event
Definition frameevent.cc:175
void RemoveProcessor(Processor *processor)
Removes a processor for the frame event. Does not free the memory, you need to handle this yourself.
Definition frameevent.cc:146
void Run(World *world)
Runs the frame event.
Definition frameevent.cc:52
Timing::Time fixedStep
0 when the event runs once per app frame, otherwise the fixed step it runs on
Definition frameevent.h:89
Util::Array< Callback > callbacks
Callbacks that this event will execute, sorted by order.
Definition frameevent.h:105
friend FramePipeline
Definition frameevent.h:96
void Prefilter(World *world, bool force=false)
prefilter all processors. Should not be done per frame - instead use CacheTable if you need to do inc...
Definition frameevent.cc:163
void AddCallback(int order, ProcessorPhase phase, std::function< void(World *)> func)
Adds a callback to the frame event, sorted by order among the batches.
Definition frameevent.cc:124
Util::StringAtom name
Definition frameevent.h:86
uint32_t timeSourceHash
time source the fixed steps come from, 0 when the event is not fixed
Definition frameevent.h:91
volatile bool inAsync
Definition frameevent.h:198
Util::Array< FrameEvent const * > const GetFrameEvents() const
Definition frameevent.cc:674
void RunRemaining()
Run until the pipeline ends.
Definition frameevent.cc:627
void Prefilter(bool force=false)
prefilter all processors. Should not be done per frame - instead use CacheTable if you need to do inc...
Definition frameevent.cc:650
FrameEvent * FindFrameEvent(Util::StringAtom name)
Look a frame event up by name without asserting. Null when the pipeline does not have one.
Definition frameevent.cc:530
void Reset()
Reset the pipeline to the start.
Definition frameevent.cc:576
void Begin()
Start running the pipeline.
Definition frameevent.cc:558
FrameEvent * RegisterFrameEvent(FrameEventCreateInfo const &info)
Definition frameevent.cc:483
friend FrameEvent
Definition frameevent.h:191
IndexT currentIndex
Definition frameevent.h:199
bool isRunning
Definition frameevent.h:197
bool IsRunningAsync()
check if the pipeline is currently executing an async frame event batch
Definition frameevent.cc:641
World * world
Definition frameevent.h:196
void RunEvent(FrameEvent *frameEvent)
Runs an event. A fixed event runs once for every step its time source has available.
Definition frameevent.cc:585
Util::Array< FrameEvent * > frameEvents
Definition frameevent.h:200
void CacheTable(MemDb::TableId, MemDb::TableSignature const &)
add a table to the caches of any processors that accepts it, that is attached to this frame event
Definition frameevent.cc:662
FrameEvent * GetFrameEvent(Util::StringAtom name)
Definition frameevent.cc:545
void End()
Stop running the pipeline.
Definition frameevent.cc:569
void RunThru(Util::StringAtom name)
Run and execute until a certain event is executed (inclusive).
Definition frameevent.cc:608
Definition processor.h:31
A container of entities, their components, and processors.
Definition world.h:92
Basically a bitfield with packed ComponentIds.
Definition tablesignature.h:26
Nebula's dynamic array class.
Definition array.h:61
A StringAtom.
Definition stringatom.h:22
Game::EditorState.
Definition graphicsmanager.h:66
ProcessorPhase
which world mode a processor is allowed to run in
Definition processor.h:24
@ PlayPhase
Definition processor.h:26
double Time
the time datatype
Definition time.h:18
This represents a "view" into an entity table.
Definition dataset.h:35
A callback which runs once per event run.
Definition frameevent.h:63
std::function< void(World *)> func
Definition frameevent.h:68
ProcessorPhase phase
which world mode the callback is allowed to run in
Definition frameevent.h:67
int order
sorting order within the frame event
Definition frameevent.h:65
Used to register a frame event in the frame pipeline.
Definition frameevent.h:25
Timing::Time fixedStep
0 means the event runs once per app frame.
Definition frameevent.h:32
uint32_t timeSourceHash
time source the fixed steps come from. Only used when fixedStep is non-zero
Definition frameevent.h:34
Util::StringAtom name
name of the event, processors are attached to it with ProcessorBuilder::On
Definition frameevent.h:29
int order
sorting order of the event in the pipeline
Definition frameevent.h:27
Definition frameevent.h:44
ProcessorJobInput * inputs
Definition frameevent.h:46
Game::World * world
Definition frameevent.h:45
Table identifier.
Definition tableid.h:14
int IndexT
Definition types.h:49