mirror of
https://github.com/SysRay/psOff_public.git
synced 2024-11-27 16:40:41 +00:00
Merge pull request #71 from igor725/features
Fix libScePngDec implementation
This commit is contained in:
commit
0d2d0b72c7
@ -9,4 +9,4 @@ add_library(${libName} SHARED entry.cpp mspace.cpp)
|
||||
add_dependencies(${libName} core)
|
||||
target_link_libraries(${libName} PRIVATE core.lib)
|
||||
|
||||
setupModule(${libName})
|
||||
setupModule(${libName})
|
||||
|
@ -1,6 +1,7 @@
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#include "common.h"
|
||||
#include "core/imports/imports_runtime.h"
|
||||
#include "core/unwinding/unwind.h"
|
||||
#include "logging.h"
|
||||
#include "types.h"
|
||||
|
||||
@ -99,6 +100,10 @@ EXPORT SYSV_ABI float __NID(expf)(float val) {
|
||||
return std::expf(val);
|
||||
}
|
||||
|
||||
EXPORT SYSV_ABI int __NID(setjmp)(unwinding_jmp_buf* jb) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
EXPORT SYSV_ABI int __NID(__cxa_guard_acquire)(uint64_t* guard_object) {
|
||||
LOG_USE_MODULE(libSceLibcInternal);
|
||||
LOG_ERR(L"todo %S", __FUNCTION__);
|
||||
|
@ -89,6 +89,7 @@ EXPORT SYSV_ABI int32_t scePngDecDecode(ScePngDecHandle handle, const ScePngDecD
|
||||
ii->bitDepth = bi;
|
||||
ii->imageWidth = w;
|
||||
ii->imageHeight = h;
|
||||
ii->imageFlag = 0;
|
||||
ii->colorSpace = map_png_color(ct);
|
||||
if (in == 1) ii->imageFlag |= SCE_PNG_DEC_IMAGE_FLAG_ADAM7_INTERLACE;
|
||||
if (png_get_valid(pngh->png, pngh->info, PNG_INFO_tRNS)) ii->imageFlag |= SCE_PNG_DEC_IMAGE_FLAG_TRNS_CHUNK_EXIST;
|
||||
@ -162,9 +163,11 @@ EXPORT SYSV_ABI int32_t scePngDecParseHeader(const ScePngDecParseParam* param, S
|
||||
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
int bitdepth, color, filter, inter, num_trans;
|
||||
int bitdepth, color, filter, inter;
|
||||
png_get_IHDR(png_ptr, info_ptr, &ii->imageWidth, &ii->imageHeight, &bitdepth, &color, &inter, nullptr, &filter);
|
||||
|
||||
ii->imageFlag = 0;
|
||||
ii->bitDepth = bitdepth;
|
||||
ii->colorSpace = map_png_color(color);
|
||||
if (inter == 1) ii->imageFlag |= SCE_PNG_DEC_IMAGE_FLAG_ADAM7_INTERLACE;
|
||||
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) ii->imageFlag |= SCE_PNG_DEC_IMAGE_FLAG_TRNS_CHUNK_EXIST;
|
||||
|
Loading…
Reference in New Issue
Block a user