Browse Source

core: remove calls to exit() in image loaders since they can now report

on errors.
legacy
Sam Hocevar sam 13 years ago
parent
commit
bcea65d273
4 changed files with 14 additions and 15 deletions
  1. +3
    -3
      src/image/codec/android-image.cpp
  2. +1
    -1
      src/image/codec/ios-image.cpp
  3. +9
    -9
      src/image/codec/ps3-image.cpp
  4. +1
    -2
      src/image/codec/sdl-image.cpp

+ 3
- 3
src/image/codec/android-image.cpp View File

@@ -57,7 +57,7 @@ bool AndroidImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not get JVM environment\n");
#endif
exit(1);
return false;
}
jclass cls = env->GetObjectClass(g_activity);
jmethodID mid;
@@ -72,7 +72,7 @@ bool AndroidImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not load %s\n", path);
#endif
exit(1);
return false;
}
env->NewGlobalRef(bmp);

@@ -109,7 +109,7 @@ bool AndroidImageData::Close()
#if !LOL_RELEASE
Log::Error("could not get JVM environment\n");
#endif
exit(1);
return false;
}
jclass cls = env->GetObjectClass(g_activity);
jmethodID mid;


+ 1
- 1
src/image/codec/ios-image.cpp View File

@@ -59,7 +59,7 @@ bool IosImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not load %s\n", path);
#endif
exit(1);
return false;
}

int w = CGImageGetWidth(image.CGImage);


+ 9
- 9
src/image/codec/ps3-image.cpp View File

@@ -61,7 +61,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not open Fs sysmodule\n");
#endif
exit(1);
return false;
}

err = cellSysmoduleLoadModule(CELL_SYSMODULE_PNGDEC);
@@ -70,7 +70,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not open PngDec sysmodule\n");
#endif
exit(1);
return false;
}

CellPngDecThreadInParam in_param;
@@ -88,7 +88,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not create PngDec library\n");
#endif
exit(1);
return false;
}

/* Create decoder */
@@ -112,7 +112,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not open %s for decoding\n", file);
#endif
exit(1);
return false;
}

CellPngDecInfo info;
@@ -122,7 +122,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not read image header\n");
#endif
exit(1);
return false;
}

CellPngDecInParam in_dec_param;
@@ -140,7 +140,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not configure PngDec decoder\n");
#endif
exit(1);
return false;
}

/* Decode image */
@@ -157,7 +157,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not run PngDec decoder\n");
#endif
exit(1);
return false;
}

/* Close decoder */
@@ -167,7 +167,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not close PngDec decoder\n");
#endif
exit(1);
return false;
}

/* Deinitialise library */
@@ -177,7 +177,7 @@ bool Ps3ImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not destroy PngDec decoder\n");
#endif
exit(1);
return false;
}
err = cellSysmoduleUnloadModule(CELL_SYSMODULE_PNGDEC);
err = cellSysmoduleUnloadModule(CELL_SYSMODULE_FS);


+ 1
- 2
src/image/codec/sdl-image.cpp View File

@@ -58,8 +58,7 @@ bool SdlImageData::Open(char const *path)
#if !LOL_RELEASE
Log::Error("could not load %s\n", path);
#endif
SDL_Quit();
exit(1);
return false;
}

size = ivec2(img->w, img->h);


Loading…
Cancel
Save