Changeset 2382 for trunk


Ignore:
Timestamp:
Feb 9, 2013, 12:17:24 PM (7 years ago)
Author:
sam
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/image/codec/ps3-image.cpp

    r2306 r2382  
    9292
    9393    /* Create decoder */
    94     CellPngDecSubHandle hsub;
    95 
    96     String fullpath = String("/app_home/") + String(System::GetDataDir()) + String(path);
    97 
    9894    CellPngDecSrc dec_src;
    9995    dec_src.srcSelect = CELL_PNGDEC_FILE;
    100     dec_src.fileName = &fullpath[0];
    10196    dec_src.fileOffset = 0;
    10297    dec_src.fileSize = 0;
     
    10499    dec_src.streamSize = 0;
    105100    dec_src.spuThreadEnable  = CELL_PNGDEC_SPU_THREAD_ENABLE;
     101    CellPngDecSubHandle hsub;
    106102    CellPngDecOpnInfo open_info;
    107     err = cellPngDecOpen(hmain, &hsub, &dec_src, &open_info);
    108     if (err != CELL_OK)
    109     {
    110 #if !LOL_RELEASE
    111         Log::Error("could not open %s for decoding\n", &fullpath[0]);
     103
     104    Array<String> pathlist = System::GetPathList(path);
     105    for (int i = 0; i < pathlist.Count(); ++i)
     106    {
     107        dec_src.fileName = (String("/app_home") + pathlist[i]).C();
     108        err = cellPngDecOpen(hmain, &hsub, &dec_src, &open_info);
     109        if (err == CELL_OK)
     110            break;
     111    }
     112
     113    if (err != CELL_OK)
     114    {
     115#if !LOL_RELEASE
     116        Log::Error("could not open %s for decoding\n", path);
    112117#endif
    113118        return false;
     
    119124    {
    120125#if !LOL_RELEASE
    121         Log::Error("could not read image header in %s\n", &fullpath[0]);
     126        Log::Error("could not read image header in %s\n", path);
    122127#endif
    123128        return false;
     
    154159    {
    155160#if !LOL_RELEASE
    156         Log::Error("could not run PngDec decoder on %s\n", &fullpath[0]);
     161        Log::Error("could not run PngDec decoder on %s\n", path);
    157162#endif
    158163        return false;
Note: See TracChangeset for help on using the changeset viewer.