This commit is contained in:
w1naenator 2026-03-13 16:23:13 +02:00
parent 243c40cf9f
commit 7a3df4da0a
3 changed files with 7 additions and 17 deletions

View File

@ -679,8 +679,7 @@ s32 PS4_SYSV_ABI sceFontCreateRendererWithEdition(const OrbisFontMem* memory,
static_cast<const Libraries::FontFt::OrbisFontRendererSelection*>(
create_params);
const u32 render_size = selection ? selection->size : 0u;
void* renderer_mem =
alloc_fn(memory->mspace_handle, render_size);
void* renderer_mem = alloc_fn(memory->mspace_handle, render_size);
void* workspace = alloc_fn(memory->mspace_handle, 0x4000);
rc = ORBIS_FONT_ERROR_ALLOCATION_FAILED;
@ -2585,8 +2584,7 @@ s32 PS4_SYSV_ABI sceFontOpenFontInstance(OrbisFontHandle fontHandle, OrbisFontHa
LOG_ERROR(Lib_Font, "INVALID_LIBRARY");
return ORBIS_FONT_ERROR_INVALID_FONT_HANDLE;
}
out_handle =
static_cast<OrbisFontHandle>(alloc_fn(lib->alloc_ctx, 0x100));
out_handle = static_cast<OrbisFontHandle>(alloc_fn(lib->alloc_ctx, 0x100));
if (!out_handle) {
release_src_lock();
if (pFontHandle) {
@ -3385,8 +3383,7 @@ s32 PS4_SYSV_ABI sceFontOpenFontSet(OrbisFontLib library, u32 fontSetType, u32 o
}
Internal::RemoveState(handle);
} else {
handle = static_cast<OrbisFontHandle>(
alloc_fn(lib_local->alloc_ctx, 0x100));
handle = static_cast<OrbisFontHandle>(alloc_fn(lib_local->alloc_ctx, 0x100));
if (!handle) {
LOG_ERROR(Lib_Font, "ALLOCATION_FAILED");
return release_library_and_clear_out(ORBIS_FONT_ERROR_ALLOCATION_FAILED);
@ -4851,8 +4848,7 @@ s32 PS4_SYSV_ABI sceFontRendererSetOutlineBufferPolicy(OrbisFontRenderer fontRen
}
if (!renderer->workspace || renderer->workspace_size != desired_size) {
void* new_workspace =
alloc_fn(renderer->alloc_ctx, static_cast<u32>(desired_size));
void* new_workspace = alloc_fn(renderer->alloc_ctx, static_cast<u32>(desired_size));
if (!new_workspace) {
LOG_ERROR(Lib_Font, "ALLOCATION_FAILED");
return ORBIS_FONT_ERROR_ALLOCATION_FAILED;
@ -6385,4 +6381,3 @@ void RegisterlibSceFont(Core::Loader::SymbolsResolver* sym) {
};
} // namespace Libraries::Font

View File

@ -1916,4 +1916,3 @@ void CachedStyleSetScalar(Libraries::Font::OrbisFontStyleFrame& cached_style, fl
std::memcpy(&cached_style.cached_scalar_bits, &value, sizeof(value));
}
} // namespace Libraries::Font::Internal

View File

@ -2560,8 +2560,7 @@ static void* FtAlloc(FT_Memory memory, long size) {
return nullptr;
}
const auto alloc_fn = reinterpret_cast<GuestAllocFn>(ctx->alloc_vtbl[0]);
return alloc_fn ? alloc_fn(ctx->alloc_ctx, static_cast<u32>(size))
: nullptr;
return alloc_fn ? alloc_fn(ctx->alloc_ctx, static_cast<u32>(size)) : nullptr;
}
static void FtFree(FT_Memory memory, void* block) {
@ -2679,8 +2678,7 @@ s32 PS4_SYSV_ABI LibraryInitStub(const void* memory, void* library) {
void** alloc_vtbl =
reinterpret_cast<void**>(const_cast<Libraries::Font::OrbisFontMemInterface*>(mem->iface));
auto* ctx =
static_cast<FtLibraryCtx*>(alloc_fn(alloc_ctx, sizeof(FtLibraryCtx)));
auto* ctx = static_cast<FtLibraryCtx*>(alloc_fn(alloc_ctx, sizeof(FtLibraryCtx)));
if (!ctx) {
return ORBIS_FONT_ERROR_ALLOCATION_FAILED;
}
@ -2688,8 +2686,7 @@ s32 PS4_SYSV_ABI LibraryInitStub(const void* memory, void* library) {
ctx->alloc_ctx = alloc_ctx;
ctx->alloc_vtbl = alloc_vtbl;
FT_Memory ft_mem =
static_cast<FT_Memory>(alloc_fn(alloc_ctx, sizeof(FT_MemoryRec_)));
FT_Memory ft_mem = static_cast<FT_Memory>(alloc_fn(alloc_ctx, sizeof(FT_MemoryRec_)));
if (!ft_mem) {
free_fn(alloc_ctx, ctx);
return ORBIS_FONT_ERROR_ALLOCATION_FAILED;
@ -3604,4 +3601,3 @@ s32 PS4_SYSV_ABI LibraryConfigureGlyphStub(void* fontObj, std::uint32_t* in_para
}
} // namespace Libraries::FontFt::Internal