diff Renderer/Engine/SceneGraph.cc @ 580:da82a47ece92

add all object in file in dynamic_create
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 24 Oct 2009 16:32:29 +0900
parents 735f76483bb2
children d0b8860c17f8
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraph.cc	Sat Oct 24 16:11:08 2009 +0900
+++ b/Renderer/Engine/SceneGraph.cc	Sat Oct 24 16:32:29 2009 +0900
@@ -403,6 +403,7 @@
  * image を 32bit(RGBA) に変換する
  */
     SDL_Surface *texture_image = IMG_Load(image_name);
+    if (!texture_image) return 0;
     SDL_Surface *tmpImage
         = SDL_CreateRGBSurface(SDL_HWSURFACE, texture_image->w,
                                texture_image->h, 32, redMask,
@@ -477,6 +478,10 @@
     if (!texture_hash.hash_regist(filename, tex_id)) {
 
         SDL_Surface *texture_image = load_decode_image(image_name, cur);
+	if (texture_image==0) {
+	    printf("Can't load image %s\n",filename);
+	    exit(0);
+	}
 
         texture_id = makeTapestries(manager, texture_image, tex_id);