Files
tp/include/JSystem/JAudio2/JASResArcLoader.h
T
Luke Street 6a48380461 More GCC compatibility/warning fixes (#3118)
* Wrap >4-char literals in a MULTI_CHAR macro

Modern compilers do not support CW's non-standard behavior with
>4 char literals. We can, however, use a constexpr function to
compute the u64 values directly. This leaves <=4 char literals
unchanged.

* Replace non-pointer usages of NULL with 0

* Define NULL to nullptr on C++11 and above

* Fix more -Wpointer-arith and -Woverflow warnings

* Replace u32/s32 with uintptr_t/intptr_t where appropriate

* JSUOutputStream: Overload all standard int types
2026-02-28 20:19:17 -08:00

48 lines
1.2 KiB
C++

#ifndef JASRESARCLOADER_H
#define JASRESARCLOADER_H
#include "JSystem/JKernel/JKRArchive.h"
#include <dolphin/os.h>
namespace JASResArcLoader {
size_t getResSize(JKRArchive const*, u16);
size_t getResMaxSize(JKRArchive const*);
static void loadResourceCallback(void*);
int loadResourceAsync(JKRArchive*, u16, u8*, u32, void (*)(u32, uintptr_t), uintptr_t);
// from pikmin2
typedef void (*LoadCallback)(u32, uintptr_t);
struct TLoadResInfo {
inline TLoadResInfo(JKRArchive* archive, u16 id, void* buf, u32 size)
: mArchive(archive)
, mID(id)
, mBuffer(buf)
, mBufferSize(size)
, mCallback(0)
, mCallbackArg(0)
, mQueue(0)
{
}
JKRArchive* mArchive; // _00
u16 mID; // _04
void* mBuffer; // _08
u32 mBufferSize; // _0C
LoadCallback mCallback; // _10
uintptr_t mCallbackArg; // _14, arg to pass to mCallback along with readResource result
OSMessageQueue* mQueue; // _18
};
};
class JKRArchive;
enum ResArcMessage {
RESARCMSG_Error = -1,
RESARCMSG_Success = 0,
};
#endif /* JASRESARCLOADER_H */