changeset 827:df39c170ae1d

viewer lightsysswitch fix
author yutaka@localhost.localdomain
date Tue, 25 May 2010 03:18:03 +0900
parents a6a6cd8d8499
children 4c292ff3558d
files Renderer/Test/viewer.cc
diffstat 1 files changed, 11 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Test/viewer.cc	Tue May 25 03:06:02 2010 +0900
+++ b/Renderer/Test/viewer.cc	Tue May 25 03:18:03 2010 +0900
@@ -8,17 +8,15 @@
 // prototype
 static void object_move_rotation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h);
 static void object_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree);
-static void object_collision_idle(SceneGraphPtr, void *sgroot_, int w, int h, SceneGraphPtr tree);
 static void object_move_translation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h);
 
-
-char *light_sysswitch = on;
+int light_sysswitch = 1;
 int light_num = 4;
 
 void LightSysSwitch(Viewer *sgroot) {
-  if (strcmp(light_sysswitch,"on") == 0) {
+  if (light_sysswitch == 1) {
     sgroot->OnLightSysSwitch();
-  } else if (strcmp(light_sysswitch,"off") == 0) {
+  } else if (light_sysswitch == 0) {
     sgroot->OffLightSysSwitch();
   }
 }
@@ -74,11 +72,6 @@
 
 
 static void
-object_collision_idle(SceneGraphPtr, void *sgroot_, int w, int h, SceneGraphPtr tree)
-{
-}
-
-static void
 object_collision(SceneGraphPtr node, void *sgroot_, int screen_w, 
 	       int screen_h,  SceneGraphPtr tree)
 {
@@ -153,15 +146,20 @@
     task_initialize();
     manager->set_TMend(TMend);
 
+
     for(int i=0;i<argc;i++) {
         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];
+            parts[parts_cnt++] = argv[i+1];
         } else if (strcmp(argv[i],"-lightsys") == 0 && i+1<=argc) {
-	  light_sysswitch = argv[i+1];
+	    if (strcmp(argv[i],"on") == 0) {
+	      light_sysswitch = 1;
+	    } else if (strcmp(argv[i],"off") == 0) {
+	      light_sysswitch = 0;
+	    }
 	} else if (strcmp(argv[i],"-lightnum") == 0 && i+1<=argc) {
-	  light_num = atoi(argv[i+1]);
+	    light_num = atoi(argv[i+1]);
 	}
     }
     return init(manager, argc, argv);