diff viewer.cc @ 3:dca6d5d2ef46

stage 1 add
author tkaito
date Sun, 06 Jun 2010 05:23:51 +0900
parents 5a888b557a41
children
line wrap: on
line diff
--- a/viewer.cc	Sun Jun 06 03:22:11 2010 +0900
+++ b/viewer.cc	Sun Jun 06 05:23:51 2010 +0900
@@ -12,20 +12,17 @@
 static void object_move_translation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h);
 
 
-char *light_sysswitch = "off";
+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();
   }
 }
 
-
-
-
 static void
 object_move_rotation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
 {
@@ -159,7 +156,11 @@
         } 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) {
-	  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]);
 	}