# HG changeset patch # User e065746@localhost.localdomain # Date 1247129984 -32400 # Node ID d6338bb6db87e19458ed4fec2cf5fd6c9ed72504 # Parent ee3db22c03b9b15a6e06148854001bd566a09448 divide func diff -r ee3db22c03b9 -r d6338bb6db87 TaskManager/Test/test_render/SceneGraph.cpp --- a/TaskManager/Test/test_render/SceneGraph.cpp Wed Jul 08 15:04:03 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraph.cpp Thu Jul 09 17:59:44 2009 +0900 @@ -380,20 +380,20 @@ } else if(!xmlStrcmp(cur->name,(xmlChar*)"image")) { - get_image(); + get_image(cur); } } } SDL_Surface* -SceneGraph::load_decode_image(char *image_name) +SceneGraph::load_decode_image(char *image_name, xmlNodePtr cur) { int fd = mkstemp(image_name); FILE *outfile = fdopen(fd, "wb"); if (NULL == outfile) { cout << "error open file\n"; - return; + return 0; } char *cont = (char *)xmlNodeGetContent(cur); @@ -464,7 +464,7 @@ } void -SceneGraph::get_image() +SceneGraph::get_image(xmlNodePtr cur) { char image_name[20] = "/tmp/image_XXXXXX"; char *filename = (char *)xmlGetProp(cur, (xmlChar *)"name"); @@ -479,7 +479,7 @@ int tex_id = texture_hash.hash_regist(filename); if (tex_id < 0) { - SDL_Sureface *texture_image = load_image(); + SDL_Surface *texture_image = load_decode_image(image_name, cur); texture_id = makeTapestries(texture_image); diff -r ee3db22c03b9 -r d6338bb6db87 TaskManager/Test/test_render/SceneGraph.h --- a/TaskManager/Test/test_render/SceneGraph.h Wed Jul 08 15:04:03 2009 +0900 +++ b/TaskManager/Test/test_render/SceneGraph.h Thu Jul 09 17:59:44 2009 +0900 @@ -95,9 +95,9 @@ void get_data(xmlNodePtr cur); void delete_data(void); - SDL_Surface* load_decode_image(char *image_name); + SDL_Surface* load_decode_image(char *image_name, xmlNodePtr cur); int makeTapestries(SDL_Surface *texture_image); - void get_image(); + void get_image(xmlNodePtr cur); }; #endif diff -r ee3db22c03b9 -r d6338bb6db87 TaskManager/Test/test_render/polygon.cpp --- a/TaskManager/Test/test_render/polygon.cpp Wed Jul 08 15:04:03 2009 +0900 +++ b/TaskManager/Test/test_render/polygon.cpp Thu Jul 09 17:59:44 2009 +0900 @@ -18,7 +18,7 @@ extern int decode(char *cont, FILE *outfile); -SDL_Surface* Polygon::texture_image; +//SDL_Surface* Polygon::texture_image; Polygon::Polygon(void) { diff -r ee3db22c03b9 -r d6338bb6db87 TaskManager/Test/test_render/polygon.h --- a/TaskManager/Test/test_render/polygon.h Wed Jul 08 15:04:03 2009 +0900 +++ b/TaskManager/Test/test_render/polygon.h Thu Jul 09 17:59:44 2009 +0900 @@ -37,7 +37,7 @@ int texture_id; //texture id number struct texture_list texture_info; - + SDL_Surface* texture_image; Polygon(void);