Skip to content

Commit

Permalink
partial-feat: system work
Browse files Browse the repository at this point in the history
  • Loading branch information
intns committed Dec 15, 2024
1 parent aef3a22 commit 8259432
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 540 deletions.
7 changes: 1 addition & 6 deletions include/Collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ struct CndBombable : public CndCollPart {
// TODO: members
};

struct ShpobjInfo : public GfxobjInfo {
Shape* mTarget; // _20
};

/**
* @brief TODO
*
Expand Down Expand Up @@ -233,8 +229,7 @@ struct CollInfo {
/**
* @brief TODO
*/
struct CollGroup {
};
struct CollGroup { };

/**
* @brief TODO
Expand Down
17 changes: 17 additions & 0 deletions include/GfxObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ struct GfxobjInfo {
mAttached = 0;
}

void insertAfter(GfxobjInfo* other)
{
other->mNext = mNext;
other->mPrev = this;
mNext->mPrev = other;
mNext = other;
}

// _1C = VTBL
GfxobjInfo* mPrev; // _04
GfxobjInfo* mNext; // _08
Expand All @@ -41,4 +49,13 @@ struct GfxObject {
// TODO: members
};

struct ShpobjInfo : public GfxobjInfo {
ShpobjInfo()
: mTarget(nullptr)
{
}

struct Shape* mTarget; // _20
};

#endif
26 changes: 13 additions & 13 deletions include/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct StdSystem {
GfxobjInfo* findGfxObject(char*, u32);
Texture* loadTexture(char*, bool);
Shape* loadShape(char*, bool);
void findAnimation(char*);
AnimData* findAnimation(char*);
int findAnyIndex(char*, char*);
AnimData* loadAnimation(Shape*, char*, bool);
void addAnimation(AnimData*, char*);
Expand All @@ -117,7 +117,7 @@ struct StdSystem {
void detachObjs();
void invalidateObjs(u32, u32);
void addTexture(Texture*, char*);
void getShape(char*, char*, char*, bool);
Shape* getShape(char*, char*, char*, bool);
void initLFlares(int);
void resetLFlares();
LFInfo* getLFlareInfo();
Expand Down Expand Up @@ -183,7 +183,7 @@ struct StdSystem {
// the vtable has to be at 0x1A0, so it's in the middle, yes.
// OR everything above this is a separate struct with some inheritance (doubt)
virtual void initSoftReset(); // _08
virtual BufferedInputStream* openFile(char*, bool, bool); // _0C
virtual RandomAccessStream* openFile(char*, bool, bool); // _0C
virtual u32 copyRamToCache(u32, u32, u32) { return 0; } // _10
virtual void copyCacheToRam(u32, u32, u32) { } // _14
virtual void copyWaitUntilDone() { } // _18
Expand Down Expand Up @@ -229,16 +229,16 @@ struct StdSystem {
struct System : public StdSystem {
System();

virtual void initSoftReset(); // _08
virtual BufferedInputStream* openFile(char*, bool, bool); // _0C
virtual u32 copyRamToCache(u32, u32, u32); // _10
virtual void copyCacheToRam(u32, u32, u32); // _14
virtual void copyWaitUntilDone(); // _18
virtual void copyCacheToTexture(CacheTexture*); // _1C
virtual void parseArchiveDirectory(char*, char*); // _24
virtual void sndPlaySe(u32); // _28
virtual void startLoading(LoadIdler*, bool, u32); // _2C
virtual void endLoading(); // _30
virtual void initSoftReset(); // _08
virtual RandomAccessStream* openFile(char*, bool, bool); // _0C
virtual u32 copyRamToCache(u32, u32, u32); // _10
virtual void copyCacheToRam(u32, u32, u32); // _14
virtual void copyWaitUntilDone(); // _18
virtual void copyCacheToTexture(CacheTexture*); // _1C
virtual void parseArchiveDirectory(char*, char*); // _24
virtual void sndPlaySe(u32); // _28
virtual void startLoading(LoadIdler*, bool, u32); // _2C
virtual void endLoading(); // _30

~System();

Expand Down
2 changes: 1 addition & 1 deletion src/plugPikiColin/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void FlowController::setStage(char*)
void FlowController::readMapList(char* fileName)
{
mRootInfo.initCore("stages");
BufferedInputStream* file = gsys->openFile(fileName, true, true);
RandomAccessStream* file = gsys->openFile(fileName, true, true);
if (!file) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sysCommon/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void CoreNode::load(char* p1, char* p2, u32 p3)
{
char buf[256];
sprintf(buf, "%s%s", p1, p2);
BufferedInputStream* stream = gsys->openFile(buf, true, true);
RandomAccessStream* stream = gsys->openFile(buf, true, true);
if (stream) {
read(*stream);
stream->close();
Expand Down
Loading

0 comments on commit 8259432

Please sign in to comment.