Mercurial > hg > Members > kono > Cerium
changeset 348:d6338bb6db87
divide func
author | e065746@localhost.localdomain |
---|---|
date | Thu, 09 Jul 2009 17:59:44 +0900 |
parents | ee3db22c03b9 |
children | 51ffd144f62c |
files | TaskManager/Test/test_render/SceneGraph.cpp TaskManager/Test/test_render/SceneGraph.h TaskManager/Test/test_render/polygon.cpp TaskManager/Test/test_render/polygon.h |
diffstat | 4 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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
--- 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) {