283
|
1 #ifndef INCUDED_SCENE_GRAPH_ARRAY
|
|
2 #define INCUDED_SCENE_GRAPH_ARRAY
|
|
3
|
539
|
4 #include "SceneGraph.h"
|
283
|
5
|
|
6 // 下ですぐ #undef してます
|
|
7 #define MAX_SIZE 32
|
|
8
|
|
9 class SceneGraphArray {
|
|
10 public:
|
|
11 SceneGraph buf[MAX_SIZE];
|
|
12 int size;
|
|
13 int pad[3];
|
|
14
|
|
15 SceneGraphArray(void) : size(0) {}
|
|
16
|
|
17 /**
|
|
18 * array の初期化
|
|
19 */
|
|
20 void init(void) {
|
|
21 size = 0;
|
|
22 }
|
|
23
|
|
24 /**
|
|
25 * buf から SceneGraph buffer を返す
|
|
26 *
|
|
27 * @retval SceneGraph if size < MAX_SIZE
|
|
28 * @retval NULL if size >= MAX_SIZE
|
|
29 */
|
|
30 SceneGraphPtr getNext(void) {
|
|
31 if (size >= MAX_SIZE) {
|
|
32 return NULL;
|
|
33 } else {
|
|
34 return &buf[size++];
|
|
35 }
|
|
36 }
|
|
37 };
|
|
38
|
|
39 typedef SceneGraphArray *SceneGraphArrayPtr;
|
|
40
|
|
41 #undef MAX_SIZE
|
|
42
|
|
43 #endif
|