2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CIOWINMANAGER
|
|
|
|
#define _CIOWINMANAGER
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-12-01 16:19:53 +00:00
|
|
|
#include "MetroidPrime/CArchitectureQueue.hpp"
|
|
|
|
|
2022-04-10 00:17:06 +00:00
|
|
|
#include "rstl/list.hpp"
|
2022-09-13 04:26:54 +00:00
|
|
|
#include "rstl/rc_ptr.hpp"
|
|
|
|
|
|
|
|
class CIOWin;
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
class CIOWinManager {
|
|
|
|
public:
|
2022-12-01 16:19:53 +00:00
|
|
|
struct IOWinPQNode {
|
|
|
|
rstl::rc_ptr<CIOWin> x0_iowin;
|
|
|
|
int x4_prio;
|
|
|
|
IOWinPQNode* x8_next;
|
|
|
|
|
|
|
|
IOWinPQNode(rstl::ncrc_ptr<CIOWin> iowin, int prio, IOWinPQNode* next);
|
|
|
|
|
|
|
|
rstl::ncrc_ptr<CIOWin> GetIOWin() const;
|
|
|
|
};
|
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
CIOWinManager();
|
2022-10-01 06:19:09 +00:00
|
|
|
~CIOWinManager();
|
2022-09-13 04:26:54 +00:00
|
|
|
|
2022-04-10 00:17:06 +00:00
|
|
|
void Draw() const;
|
2022-09-13 04:26:54 +00:00
|
|
|
void AddIOWin(rstl::ncrc_ptr< CIOWin >, int, int);
|
2022-12-01 16:19:53 +00:00
|
|
|
void RemoveIOWin(rstl::ncrc_ptr<CIOWin> chIow);
|
2022-10-01 06:19:09 +00:00
|
|
|
void RemoveAllIOWins();
|
2022-12-01 16:19:53 +00:00
|
|
|
void ChangeIOWinPriority(rstl::ncrc_ptr<CIOWin> toChange, int pumpPrio, int drawPrio);
|
|
|
|
rstl::ncrc_ptr<CIOWin> FindIOWin(const char* name);
|
|
|
|
|
|
|
|
void PumpMessages(CArchitectureQueue& queue);
|
|
|
|
bool DistributeOneMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
|
|
|
|
bool OnIOWinMessage(const CArchitectureMessage& msg);
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2022-10-01 06:19:09 +00:00
|
|
|
inline bool IsEmpty() const { return x4_pumpRoot == nullptr && x0_drawRoot == nullptr; }
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
private:
|
2022-10-01 06:19:09 +00:00
|
|
|
IOWinPQNode* x0_drawRoot;
|
|
|
|
IOWinPQNode* x4_pumpRoot;
|
|
|
|
CArchitectureQueue x8_localGatherQueue;
|
2022-04-10 00:17:06 +00:00
|
|
|
};
|
2022-09-13 04:26:54 +00:00
|
|
|
CHECK_SIZEOF(CIOWinManager, 0x20)
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CIOWINMANAGER
|