Mercurial > hg > Game > Cerium
changeset 1218:d95b10b711ad draft
view_2 accepts -name again
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 23 Jul 2011 03:18:08 +0900 |
parents | 195e21a1b63c |
children | 5d62049098bc |
files | Renderer/Test/viewer_2.cc |
diffstat | 1 files changed, 16 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Test/viewer_2.cc Fri Jul 22 23:08:16 2011 +0900 +++ b/Renderer/Test/viewer_2.cc Sat Jul 23 03:18:08 2011 +0900 @@ -141,18 +141,25 @@ sgroot->createFromXMLfile(fn); - int num = getStrFromFile( getStrDate, fn, sStr, eStr ); + if (parts_cnt>0) { + for( int i = 0; i < parts_cnt; i ++ ){ + object->addChild( sgroot->createSceneGraph( parts[i] ) ); + } + sgroot->setSceneData(object); + } else { + int num = getStrFromFile( getStrDate, fn, sStr, eStr ); - for( int i = 0; i < num; i ++ ){ - object->addChild( sgroot->createSceneGraph( getStrDate[i] ) ); + for( int i = 0; i < num; i ++ ){ + object->addChild( sgroot->createSceneGraph( getStrDate[i] ) ); + } + sgroot->setSceneData(object); + + for( int i = 0; i < num; i ++ ){ + free( getStrDate[i] ); + } + } - sgroot->setSceneData(object); - - for( int i = 0; i < num; i ++ ){ - free( getStrDate[i] ); - } - return sgroot; } @@ -179,11 +186,9 @@ if (strcmp(argv[i],"-sg") == 0 && i+1<=argc) { xmlfile = argv[i+1]; } - /* // もう引数で取らなくてもいいぜヒィヤッハー!! else if (strcmp(argv[i],"-name") == 0 && i+1<=argc) { parts[parts_cnt++] = argv[i+1]; } - */ else if (strcmp(argv[i],"-lightsys") == 0 && i+1<=argc) { if (strcmp(argv[i],"on") == 0) { light_sysswitch = 1;