mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-16 04:09:51 +00:00
Lazy font loading (to speed up running unit tests...)
This commit is contained in:
parent
477aeee0ee
commit
43df3c9071
@ -433,6 +433,10 @@ LoadedFont *GetLoadedFont(u32 handle, bool allowClosed) {
|
||||
}
|
||||
|
||||
void __LoadInternalFonts() {
|
||||
if (internalFonts.size()) {
|
||||
// Fonts already loaded.
|
||||
return;
|
||||
}
|
||||
std::string fontPath = "flash0:/font/";
|
||||
if (!pspFileSystem.GetFileInfo(fontPath).exists) {
|
||||
pspFileSystem.MkDir(fontPath);
|
||||
@ -504,7 +508,6 @@ int GetInternalFontIndex(Font *font) {
|
||||
}
|
||||
|
||||
void __FontInit() {
|
||||
__LoadInternalFonts();
|
||||
actionPostAllocCallback = __KernelRegisterActionType(PostAllocCallback::Create);
|
||||
actionPostOpenCallback = __KernelRegisterActionType(PostOpenCallback::Create);
|
||||
}
|
||||
@ -540,6 +543,8 @@ void __FontDoState(PointerWrap &p) {
|
||||
}
|
||||
|
||||
u32 sceFontNewLib(u32 paramPtr, u32 errorCodePtr) {
|
||||
// Lazy load internal fonts, only when font library first inited.
|
||||
__LoadInternalFonts();
|
||||
INFO_LOG(HLE, "sceFontNewLib(%08x, %08x)", paramPtr, errorCodePtr);
|
||||
|
||||
if (Memory::IsValidAddress(paramPtr) && Memory::IsValidAddress(errorCodePtr)) {
|
||||
|
@ -311,7 +311,7 @@ void BlockAllocator::ListBlocks()
|
||||
for (std::list<Block>::const_iterator iter = blocks.begin(); iter != blocks.end(); iter++)
|
||||
{
|
||||
const Block &b = *iter;
|
||||
INFO_LOG(HLE, "Block: %08x - %08x size %08x taken=%i tag=%s", b.start, b.start+b.size, b.size, b.taken ? 1:0, b.tag);
|
||||
INFO_LOG(HLE, "Block: %08x - %08x size %08x taken=%i tag=%s", b.start, b.start+b.size, b.size, b.taken ? 1:0, b.tag);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user