mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-12 21:45:19 -04:00
6be51c09c5
* launch.json cwd * bodge to load gci for testing * stub card stat * gameplay bodges * viewport, ub fixes * add release with debug info cmake variant * be fixes, sound stub * viewport h * d_msg_flow BE * be fopAcM_createItemFromEnemyID * update launch configuration to use iso * more audio stubs * Attempt to set viewport and get messages for brightness check * skip opening scene again, fixed JMessage::TResourceContainer::TCResource::Do_destroy * add guards for viewport changes * moar endian swapping to get Link sitting in PROC_OPENING_SCENE and for dialogues * BE d_msg_class i_data * stub bgm start * fix div by 0 error (for now) * TEMP_BROKEN in d_menu_ring * REQUIRES_GX_LINES * properly stub renderingAmap::draw with REQUIRES_GX_LINES * better stubbing outside of stubs * fix event data getting swapped multiple times * evil draw vp fix * Stub log imgui This redirects all spammy logs to an imgui window that is cleared per frame. This fixes the serious performance dip of the logging, and makes the regular log readable. * Oops move those optimization changes I accidentally committed behind a flag DUSK_SELECTED_OPT * gx_line macro in map * fix audio stubbing * switch to CARD API aurora impl * remove kabufuda from link libs * refactor imgui stuff and add input viewer * merge stub log with refactor * accidentally committed a metaforce header shh * basic map loader * ImGuiConsole: Add missing <thread> include * you may now play as luigi (you may now load stages with bridges) * bloom fix * bloom leak fix * cloud shadow fix * add soft reset button to imgui menu * if it broke dont not fix it * i swear i committed this * BE swap indMtx in JPAResource::setPTev * wnark ct fix * frsqrte implementation from kinoko * Fix Clang compile error in JAISeq::prepare_getSeqData_ * Add endian conversions to dMsgFlow_c::getInitNodeIndex This fixes a freeze when Fado tries to stop you from leaving the starting area. * Add RAII GXTexObj wrapper; fix almost all leaks * Update aurora for indirect texturing * Update aurora for CARD fix * Fix Clang build * More d_msg_flow endian fixes Fixes softlock when trying to talk to Fado and possibly other NPCs. * no frame limiter * get pause menu working * proper frame limiting * particle pointer size fix * improve map loader a bit --------- Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net> Co-authored-by: TakaRikka <takarikka@outlook.com> Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com> Co-authored-by: Luke Street <luke@street.dev> Co-authored-by: Lurs <l_werdes@gmx.de> Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com> Co-authored-by: tgsm <doodrabbit@hotmail.com> Co-authored-by: Max Roncace <me@caseif.net> Co-authored-by: Phillip Stephens <antidote.crk@gmail.com>
87 lines
2.5 KiB
C++
87 lines
2.5 KiB
C++
#ifndef JUTRESFONT_H
|
|
#define JUTRESFONT_H
|
|
|
|
#include "JSystem/JUtility/JUTFont.h"
|
|
#include "dusk/gx_helper.h"
|
|
|
|
class JKRHeap;
|
|
|
|
typedef bool (*IsLeadByte_func)(int);
|
|
|
|
/**
|
|
* @ingroup jsystem-jutility
|
|
*
|
|
*/
|
|
struct BlockHeader {
|
|
const BlockHeader* getNext() const { return reinterpret_cast<const BlockHeader*>(reinterpret_cast<const u8*>(this) + size); }
|
|
BE(u32) magic;
|
|
BE(u32) size;
|
|
};
|
|
|
|
/**
|
|
* @ingroup jsystem-jutility
|
|
*
|
|
*/
|
|
class JUTResFont : public JUTFont {
|
|
public:
|
|
virtual ~JUTResFont();
|
|
virtual void setGX();
|
|
virtual void setGX(JUtility::TColor, JUtility::TColor);
|
|
virtual f32 drawChar_scale(f32, f32, f32, f32, int, bool);
|
|
virtual int getLeading() const;
|
|
virtual s32 getAscent() const;
|
|
virtual s32 getDescent() const;
|
|
virtual s32 getHeight() const;
|
|
virtual s32 getWidth() const;
|
|
virtual void getWidthEntry(int, JUTFont::TWidth*) const;
|
|
virtual s32 getCellWidth() const;
|
|
virtual s32 getCellHeight() const;
|
|
virtual int getFontType() const;
|
|
virtual ResFONT* getResFont() const;
|
|
virtual bool isLeadByte(int) const;
|
|
virtual void loadImage(int, GXTexMapID);
|
|
virtual void setBlock();
|
|
|
|
JUTResFont(ResFONT const*, JKRHeap*);
|
|
JUTResFont();
|
|
void deleteMemBlocks_ResFont();
|
|
void initialize_state();
|
|
bool initiate(ResFONT const*, JKRHeap*);
|
|
bool protected_initiate(ResFONT const*, JKRHeap*);
|
|
void countBlock();
|
|
void loadFont(int, GXTexMapID, JUTFont::TWidth*);
|
|
int getFontCode(int) const;
|
|
int convertSjis(int, BE(u16)*) const;
|
|
|
|
inline void delete_and_initialize() {
|
|
deleteMemBlocks_ResFont();
|
|
initialize_state();
|
|
}
|
|
|
|
static const int suAboutEncoding_ = 3;
|
|
static IsLeadByte_func const saoAboutEncoding_[suAboutEncoding_];
|
|
|
|
// some types uncertain, may need to be fixed
|
|
/* 0x1C */ int mWidth;
|
|
/* 0x20 */ int mHeight;
|
|
/* 0x24 */ TGXTexObj mTexObj;
|
|
/* 0x44 */ int mTexPageIdx;
|
|
/* 0x48 */ const ResFONT* mResFont;
|
|
/* 0x4C */ ResFONT::INF1* mInf1Ptr;
|
|
/* 0x50 */ void** mMemBlocks;
|
|
/* 0x54 */ ResFONT::WID1** mpWidthBlocks;
|
|
/* 0x58 */ ResFONT::GLY1** mpGlyphBlocks;
|
|
/* 0x5C */ ResFONT::MAP1** mpMapBlocks;
|
|
/* 0x60 */ u16 mWid1BlockNum;
|
|
/* 0x62 */ u16 mGly1BlockNum;
|
|
/* 0x64 */ u16 mMap1BlockNum;
|
|
/* 0x66 */ u16 field_0x66;
|
|
/* 0x68 */ u16 mMaxCode;
|
|
/* 0x6C */ const IsLeadByte_func* mIsLeadByte;
|
|
};
|
|
|
|
extern u8 const JUTResFONT_Ascfont_fix12[];
|
|
extern u8 const JUTResFONT_Ascfont_fix16[];
|
|
|
|
#endif /* JUTRESFONT_H */
|