Mercurial > hg > Game > Cerium
comparison 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 |
comparison
equal
deleted
inserted
replaced
538:5641d121818e | 539:3bc98f6d31ff |
---|---|
1 #ifndef INCUDED_SCENE_GRAPH_ARRAY | |
2 #define INCUDED_SCENE_GRAPH_ARRAY | |
3 | |
4 #include "SceneGraph.h" | |
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 |