* most of J2DPane

* finish j2dpane

* cleanup

* use J2DBlendInfo
This commit is contained in:
lepelog
2021-12-11 23:39:53 +01:00
committed by GitHub
parent c0957304fa
commit c55fef0eb2
41 changed files with 583 additions and 2667 deletions
+24
View File
@@ -19,6 +19,30 @@ public:
/* vt[4] */ virtual s32 skip(s32);
/* vt[5] */ virtual u32 readData(void*, s32) = 0;
u32 read32b() {
u32 val;
this->read(&val, sizeof(val));
return val;
}
s16 readS16() {
s16 val;
this->read(&val, sizeof(val));
return val;
}
u16 readU16() {
u16 val;
this->read(&val, sizeof(val));
return val;
}
u8 readU8() {
u8 val;
this->read(&val, sizeof(val));
return val;
}
// TODO: return value probably wrong
/* 802DC298 */ s32 read(void*, s32);
}; // Size = 0x8
+12 -46
View File
@@ -157,67 +157,33 @@ private:
// Tree
//
#define JSU_TREE_FROM_LINK(T, LINK) (JSUTree<T>*)(((u8*)(LINK)) - 12)
#define JSU_TREE_LINK_IF_NOT_NULL(TREE) \
if (TREE) { \
TREE = (JSUTree<T>*)(&(TREE)->mLink); \
}
#define _JSU_TREE_AS_LINK(TREE) ((JSULink<T>*)(TREE))
template <typename T>
class JSUTree {
class JSUTree : public JSUList<T>, public JSULink<T> {
public:
JSUTree(T* owner) : mList(), mLink(owner) {}
JSUTree(T* owner) : JSUList<T>(), JSULink<T>(owner) {}
~JSUTree() {}
bool appendChild(JSUTree<T>* child) {
JSU_TREE_LINK_IF_NOT_NULL(child);
return this->mList.append(_JSU_TREE_AS_LINK(child));
}
bool appendChild(JSUTree<T>* child) { return this->append(child); }
bool removeChild(JSUTree<T>* child) {
JSU_TREE_LINK_IF_NOT_NULL(child);
return this->mList.remove(_JSU_TREE_AS_LINK(child));
}
bool removeChild(JSUTree<T>* child) { return this->remove(child); }
bool insertChild(JSUTree<T>* before, JSUTree<T>* child) {
JSU_TREE_LINK_IF_NOT_NULL(before);
JSU_TREE_LINK_IF_NOT_NULL(child);
return this->mList.insert(_JSU_TREE_AS_LINK(before), _JSU_TREE_AS_LINK(child));
}
bool insertChild(JSUTree<T>* before, JSUTree<T>* child) { return this->insert(before, child); }
JSUTree<T>* getEndChild() const { return NULL; }
JSUTree<T>* getFirstChild() const {
JSULink<T>* link = this->mList.getFirst();
return link ? JSU_TREE_FROM_LINK(T, link) : (JSUTree<T>*)link;
}
JSUTree<T>* getFirstChild() const { return (JSUTree<T>*)this->getFirst(); }
JSUTree<T>* getLastChild() const {
JSULink<T>* link = this->mList.getLast();
return link ? JSU_TREE_FROM_LINK(T, link) : (JSUTree<T>*)link;
}
JSUTree<T>* getLastChild() const { return (JSUTree<T>*)this->getLast(); }
JSUTree<T>* getNextChild() const {
JSULink<T>* link = this->mLink.getNext();
return link ? JSU_TREE_FROM_LINK(T, link) : (JSUTree<T>*)link;
}
JSUTree<T>* getNextChild() const { return (JSUTree<T>*)this->getNext(); }
JSUTree<T>* getPrevChild() const {
JSULink<T>* link = this->mLink.getPrev();
return link ? JSU_TREE_FROM_LINK(T, link) : (JSUTree<T>*)link;
}
JSUTree<T>* getPrevChild() const { return (JSUTree<T>*)this->getPrev(); }
u32 getNumChildren() const { return this->mList.getNumLinks(); }
u32 getNumChildren() const { return this->getNumLinks(); }
T* getObject() const { return this->mLink.getObject(); }
T* getObject() const { return (T*)this->getObjectPtr(); }
JSUTree<T>* getParent() const { return (JSUTree<T>*)this->mLink.getList(); }
private:
JSUList<T> mList;
JSULink<T> mLink;
JSUTree<T>* getParent() const { return (JSUTree<T>*)this->getList(); }
};
template <typename T>