瀏覽代碼

ps3: use System::GetPathList() to open images.

legacy
Sam Hocevar sam 11 年之前
父節點
當前提交
14447c6061
共有 1 個文件被更改,包括 14 次插入9 次删除
  1. +14
    -9
      src/image/codec/ps3-image.cpp

+ 14
- 9
src/image/codec/ps3-image.cpp 查看文件

@@ -91,24 +91,29 @@ bool Ps3ImageData::Open(char const *path)
}

/* Create decoder */
CellPngDecSubHandle hsub;

String fullpath = String("/app_home/") + String(System::GetDataDir()) + String(path);

CellPngDecSrc dec_src;
dec_src.srcSelect = CELL_PNGDEC_FILE;
dec_src.fileName = &fullpath[0];
dec_src.fileOffset = 0;
dec_src.fileSize = 0;
dec_src.streamPtr = NULL;
dec_src.streamSize = 0;
dec_src.spuThreadEnable = CELL_PNGDEC_SPU_THREAD_ENABLE;
CellPngDecSubHandle hsub;
CellPngDecOpnInfo open_info;
err = cellPngDecOpen(hmain, &hsub, &dec_src, &open_info);

Array<String> pathlist = System::GetPathList(path);
for (int i = 0; i < pathlist.Count(); ++i)
{
dec_src.fileName = (String("/app_home") + pathlist[i]).C();
err = cellPngDecOpen(hmain, &hsub, &dec_src, &open_info);
if (err == CELL_OK)
break;
}

if (err != CELL_OK)
{
#if !LOL_RELEASE
Log::Error("could not open %s for decoding\n", &fullpath[0]);
Log::Error("could not open %s for decoding\n", path);
#endif
return false;
}
@@ -118,7 +123,7 @@ bool Ps3ImageData::Open(char const *path)
if (err != CELL_OK)
{
#if !LOL_RELEASE
Log::Error("could not read image header in %s\n", &fullpath[0]);
Log::Error("could not read image header in %s\n", path);
#endif
return false;
}
@@ -153,7 +158,7 @@ bool Ps3ImageData::Open(char const *path)
if (err != CELL_OK)
{
#if !LOL_RELEASE
Log::Error("could not run PngDec decoder on %s\n", &fullpath[0]);
Log::Error("could not run PngDec decoder on %s\n", path);
#endif
return false;
}


Loading…
取消
儲存