mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
#include "Library/Execute/ExecutorListLayoutDraw.h"
|
|
|
|
#include "Library/Execute/LayoutExecuteInfo.h"
|
|
#include "Library/Layout/LayoutActor.h"
|
|
#include "Library/Layout/LayoutKeeper.h"
|
|
#include "Project/Execute/ExecuteSystemInitInfo.h"
|
|
|
|
namespace al {
|
|
ExecutorListLayoutDrawBase::ExecutorListLayoutDrawBase(const char* name, s32 size,
|
|
const ExecuteSystemInitInfo& initInfo)
|
|
: ExecutorListBase(name), mCapacity(size) {
|
|
mList = new LayoutActor*[mCapacity];
|
|
for (s32 i = 0; i < mCapacity; i++)
|
|
mList[i] = nullptr;
|
|
mContext = initInfo.drawCtx;
|
|
}
|
|
|
|
bool ExecutorListLayoutDrawBase::isActive() const {
|
|
return mSize > 0;
|
|
}
|
|
|
|
void ExecutorListLayoutDrawBase::executeList() const {
|
|
bool isAlive = false;
|
|
for (s32 i = 0; i < mSize; i++)
|
|
if (mList[i]->isAlive())
|
|
isAlive = true;
|
|
|
|
if (!ExecutorListLayoutDrawBase::isActive() || !isAlive)
|
|
return;
|
|
|
|
startDraw();
|
|
for (s32 i = 0; i < mSize; i++)
|
|
if (mList[i]->isAlive())
|
|
mList[i]->getLayoutKeeper()->draw();
|
|
}
|
|
|
|
void ExecutorListLayoutDrawBase::registerLayout(LayoutActor* layout) {
|
|
mList[mSize] = layout;
|
|
mSize++;
|
|
layout->getExecuteInfo()->addDrawer(this);
|
|
}
|
|
|
|
} // namespace al
|