annotate Renderer/Engine/SceneGraphArray.h @ 539:3bc98f6d31ff draft

Reorganization..
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 12 Oct 2009 09:39:35 +0900
parents Renderer/test_render/SceneGraphArray.h@15bfacccde99
children 786e800abfb4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
1 #ifndef INCUDED_SCENE_GRAPH_ARRAY
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
2 #define INCUDED_SCENE_GRAPH_ARRAY
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
3
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 283
diff changeset
4 #include "SceneGraph.h"
283
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
5
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
6 // 下ですぐ #undef してます
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
7 #define MAX_SIZE 32
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
8
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
9 class SceneGraphArray {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
10 public:
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
11 SceneGraph buf[MAX_SIZE];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
12 int size;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
13 int pad[3];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
14
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
15 SceneGraphArray(void) : size(0) {}
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
16
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
17 /**
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
18 * array の初期化
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
19 */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
20 void init(void) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
21 size = 0;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
22 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
23
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
24 /**
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
25 * buf から SceneGraph buffer を返す
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
26 *
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
27 * @retval SceneGraph if size < MAX_SIZE
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
28 * @retval NULL if size >= MAX_SIZE
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
29 */
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
30 SceneGraphPtr getNext(void) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
31 if (size >= MAX_SIZE) {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
32 return NULL;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
33 } else {
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
34 return &buf[size++];
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
35 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
36 }
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
37 };
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
38
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
39 typedef SceneGraphArray *SceneGraphArrayPtr;
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
40
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
41 #undef MAX_SIZE
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
42
15bfacccde99 fix test_render
e065746@localhost.localdomain
parents:
diff changeset
43 #endif