annotate Renderer/Test/viewer.cc @ 827:5ffe41af8d3b draft

viewer lightsysswitch fix
author yutaka@localhost.localdomain
date Tue, 25 May 2010 03:18:03 +0900
parents d98371202f1d
children e92f00ed2fc0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <math.h>
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include <stdlib.h>
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include "SceneGraphRoot.h"
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "MainLoop.h"
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #include "viewer.h"
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 // prototype
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
9 static void object_move_rotation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h);
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
10 static void object_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree);
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
11 static void object_move_translation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h);
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
827
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
13 int light_sysswitch = 1;
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
14 int light_num = 4;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
15
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
16 void LightSysSwitch(Viewer *sgroot) {
827
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
17 if (light_sysswitch == 1) {
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
18 sgroot->OnLightSysSwitch();
827
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
19 } else if (light_sysswitch == 0) {
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
20 sgroot->OffLightSysSwitch();
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
21 }
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
22 }
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
23
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
25
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
26
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 static void
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
28 object_move_rotation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 {
653
7a311860a76e remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 589
diff changeset
30 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 Pad *pad = sgroot->getController();
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
32 if (pad->circle.isPush()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
33 node->set_move_collision(object_move_translation, object_collision);
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
34 }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
35 if (pad->left.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
36 node->angle[1] += 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
37 } else if (pad->right.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
38 node->angle[1] -= 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
39 }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
40 if (pad->up.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
41 node->angle[0] += 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
42 } else if (pad->down.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
43 node->angle[0] -= 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
44 }
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 static void
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
50 object_move_translation(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 {
653
7a311860a76e remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 589
diff changeset
52 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 Pad *pad = sgroot->getController();
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 if (pad->circle.isPush()) {
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
56 node->set_move_collision(object_move_rotation, object_collision);
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
59 if (pad->left.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
60 node->xyz[0] -= 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
61 } else if (pad->right.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
62 node->xyz[0] += 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
63 }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
64 if (pad->up.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
65 node->xyz[1] -= 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
66 } else if (pad->down.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
67 node->xyz[1] += 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
68 }
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
70
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 static void
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
75 object_collision(SceneGraphPtr node, void *sgroot_, int screen_w,
653
7a311860a76e remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents: 589
diff changeset
76 int screen_h, SceneGraphPtr tree)
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 {
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
78 // if (node->xyz[1] > screen_h - object_radius) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
79 // node->xyz[1] = screen_h - object_radius;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
81 // vy *= e;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
82 // if (vy > -g && vy < 0) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
83 // vy = 0.0;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
84 // node->set_move_collision(object_move_idle, object_collision_idle);
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
85 // }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
86 // }
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 char *xmlfile;
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 #define MAX_ROOT 100
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 char *parts[MAX_ROOT ];
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 int parts_cnt;
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 MainLoopPtr
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 viewer::init(Viewer *sgroot, int screen_w, int screen_h)
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 {
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
97
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
98 LightSysSwitch(sgroot);
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
99
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
100 SceneGraphPtr object;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
102 for (int i = 0; i < light_num; i++) {
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
103 SceneGraphPtr light = sgroot->getLight(i);
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
104 sgroot->OnLightSwitch(i);
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
105 light->xyz[0] = screen_w / 2;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
106 light->xyz[1] = screen_h / 2;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
107 light->xyz[2] = -100;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
108 }
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
109
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
110
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 // 固定した値で srandom すると、毎回同じ、random() 列が生成される
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 // random な値が欲しいなら、man random に方法が書いてあります。
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 srandom(100);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 sgroot->createFromXMLfile(xmlfile);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
117 object = sgroot->createSceneGraph();
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
118 object->set_move_collision(object_move_rotation, object_collision);
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
120 object->xyz[0] = screen_w/2;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
121 object->xyz[1] = screen_h/2;;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
122 object->xyz[2] = 30.0f;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 for(int i=0;i<parts_cnt; i++) {
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
125 object->addChild(sgroot->createSceneGraph(parts[i]));
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 }
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
127 sgroot->setSceneData(object);
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 return sgroot;
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 extern Application *
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 application() {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 return new viewer();
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 extern int init(TaskManager *manager, int argc, char *argv[]);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 extern void task_initialize();
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 static void TMend(TaskManager *manager);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 int
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 TMmain(TaskManager *manager, int argc, char *argv[])
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 task_initialize();
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 manager->set_TMend(TMend);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148
827
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
149
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 for(int i=0;i<argc;i++) {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 if (strcmp(argv[i],"-sg") == 0 && i+1<=argc) {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 xmlfile = argv[i+1];
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 } else if (strcmp(argv[i],"-name") == 0 && i+1<=argc) {
827
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
154 parts[parts_cnt++] = argv[i+1];
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
155 } else if (strcmp(argv[i],"-lightsys") == 0 && i+1<=argc) {
827
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
156 if (strcmp(argv[i],"on") == 0) {
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
157 light_sysswitch = 1;
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
158 } else if (strcmp(argv[i],"off") == 0) {
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
159 light_sysswitch = 0;
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
160 }
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
161 } else if (strcmp(argv[i],"-lightnum") == 0 && i+1<=argc) {
827
5ffe41af8d3b viewer lightsysswitch fix
yutaka@localhost.localdomain
parents: 826
diff changeset
162 light_num = atoi(argv[i+1]);
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
163 }
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 return init(manager, argc, argv);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
166
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
168
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 void
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 TMend(TaskManager *manager)
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 printf("test_nogl end\n");
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
174
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 /* end */
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
176