annotate Renderer/Test/viewer.cc @ 795:abbf28a8ca42 draft

add xmlfile
author game@henri.cr.ie.u-ryukyu.ac.jp
date Wed, 05 May 2010 16:33:41 +0900
parents 66497087393d
children d98371202f1d
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_collision_idle(SceneGraphPtr, void *sgroot_, int w, int h, SceneGraphPtr tree);
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
12 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
13
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
15 char *light_sysswitch = NULL;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
16 int light_num = 4;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
17
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
18 void LightSysSwitch(Viewer *sgroot) {
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
19 if (strcmp(light_sysswitch,"on") == 0) {
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
20 sgroot->OnLightSysSwitch();
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
21 } else if (strcmp(light_sysswitch,"off") == 0) {
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
22 sgroot->OffLightSysSwitch();
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
23 }
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
24 }
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
25
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
27
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
28
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 static void
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
30 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
31 {
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
32 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 Pad *pad = sgroot->getController();
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
34 if (pad->circle.isPush()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
35 node->set_move_collision(object_move_translation, object_collision);
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
36 }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
37 if (pad->left.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 } else if (pad->right.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
40 node->angle[1] -= 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
41 }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
42 if (pad->up.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 } else if (pad->down.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
45 node->angle[0] -= 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
46 }
589
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 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 static void
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
52 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
53 {
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
54 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 Pad *pad = sgroot->getController();
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 if (pad->circle.isPush()) {
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
58 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
59 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
61 if (pad->left.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 } else if (pad->right.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
64 node->xyz[0] += 10;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
65 }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
66 if (pad->up.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 } else if (pad->down.isHold()) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
69 node->xyz[1] += 10;
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
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
72
589
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
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 static void
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
77 object_collision_idle(SceneGraphPtr, void *sgroot_, int w, int h, SceneGraphPtr tree)
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 static void
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
82 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
83 int screen_h, SceneGraphPtr tree)
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 {
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
85 // if (node->xyz[1] > screen_h - object_radius) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
86 // node->xyz[1] = screen_h - object_radius;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
88 // vy *= e;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
89 // if (vy > -g && vy < 0) {
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
90 // vy = 0.0;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
91 // 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
92 // }
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
93 // }
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 char *xmlfile;
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 #define MAX_ROOT 100
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 char *parts[MAX_ROOT ];
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 int parts_cnt;
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 MainLoopPtr
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 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
103 {
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
104
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
105 LightSysSwitch(sgroot);
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
106
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
107 SceneGraphPtr object;
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
109 for (int i = 0; i < light_num; i++) {
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
110 SceneGraphPtr light = sgroot->getLight(i);
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
111 sgroot->OnLightSwitch(i);
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
112 light->xyz[0] = screen_w / 2;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
113 light->xyz[1] = screen_h / 2;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
114 light->xyz[2] = -100;
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
115 }
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
116
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
117
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 // 固定した値で srandom すると、毎回同じ、random() 列が生成される
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 // random な値が欲しいなら、man random に方法が書いてあります。
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 srandom(100);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 sgroot->createFromXMLfile(xmlfile);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
124 object = sgroot->createSceneGraph();
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
125 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
126
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
127 object->xyz[0] = screen_w/2;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
128 object->xyz[1] = screen_h/2;;
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
129 object->xyz[2] = 30.0f;
589
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 for(int i=0;i<parts_cnt; i++) {
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
132 object->addChild(sgroot->createSceneGraph(parts[i]));
589
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 }
795
abbf28a8ca42 add xmlfile
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 793
diff changeset
134 sgroot->setSceneData(object);
589
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 return sgroot;
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 }
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 Application *
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 application() {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 return new viewer();
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
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 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
145
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 extern int init(TaskManager *manager, int argc, char *argv[]);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 extern void task_initialize();
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 static void TMend(TaskManager *manager);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 int
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 TMmain(TaskManager *manager, int argc, char *argv[])
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 task_initialize();
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 manager->set_TMend(TMend);
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
155
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 for(int i=0;i<argc;i++) {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 if (strcmp(argv[i],"-sg") == 0 && i+1<=argc) {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 xmlfile = argv[i+1];
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 } else if (strcmp(argv[i],"-name") == 0 && i+1<=argc) {
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 parts[parts_cnt++] = argv[i+1];
793
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
161 } else if (strcmp(argv[i],"-lightsys") == 0 && i+1<=argc) {
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
162 light_sysswitch = argv[i+1];
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
163 } else if (strcmp(argv[i],"-lightnum") == 0 && i+1<=argc) {
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
164 light_num = atoi(argv[i+1]);
66497087393d add light switch api
yutaka@localhost.localdomain
parents: 735
diff changeset
165 }
589
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 return init(manager, argc, argv);
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 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
170
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 void
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 TMend(TaskManager *manager)
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 printf("test_nogl end\n");
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 }
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
176
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 /* end */
e112f38275d5 add viwer.cc
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
178