annotate Renderer/Engine/GTaskArray.cc @ 1127:c4287bf771a0 draft

CreatePolygonFromSceneGraph can work on Mac OSX.
author Yutaka_Kinjyo
date Sun, 13 Feb 2011 23:27:22 +0900
parents 4ca9cbf53ad6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1004
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "GTaskArray.h"
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 GTaskArray::GTaskArray()
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 game_task_array = NULL;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 game_task = NULL;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 task_id = 0;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 task_num = 0;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 param_num = 0;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 inData_num = 0;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 outData_num = 0;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 }
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 GTaskArray::~GTaskArray()
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 if (game_task_array !=NULL) {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 delete game_task_array;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 }
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 if (game_task !=NULL) {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 delete game_task;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 }
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 }
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 void
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 GTaskArray::init(int id, int task, int param, int inData, int outData)
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 game_task = 0;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 task_id = id;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 task_num = task;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 param_num = param;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 inData_num = inData;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 outData_num = outData;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 }
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 void
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 GTaskArray::create_task_array(TaskManager *manager)
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 game_task_array = manager->create_task_array(task_id, task_num, param_num, inData_num, outData_num);
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 game_task = 0;
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 }
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 void
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 GTaskArray::next_task_array(int id)
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 game_task = game_task_array->next_task_array(id, game_task);
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 }
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 void
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 GTaskArray::finish()
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 {
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 game_task_array->spawn_task_array(game_task->next());
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 game_task_array->set_cpu(SPE_ANY);
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 game_task_array->spawn();
4ca9cbf53ad6 add GTaskArray and merge.
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 }