Mercurial > hg > Members > kono > Cerium
comparison Renderer/test_render/SceneGraphArray.h @ 283:55ea4465b1a2
fix test_render
author | e065746@localhost.localdomain |
---|---|
date | Fri, 05 Jun 2009 16:49:12 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
282:ef061be0baff | 283:55ea4465b1a2 |
---|---|
1 #ifndef INCUDED_SCENE_GRAPH_ARRAY | |
2 #define INCUDED_SCENE_GRAPH_ARRAY | |
3 | |
4 #ifndef INCLUDED_SCENE_GRAPH | |
5 # include "SceneGraph.h" | |
6 #endif | |
7 | |
8 // 下ですぐ #undef してます | |
9 #define MAX_SIZE 32 | |
10 | |
11 class SceneGraphArray { | |
12 public: | |
13 SceneGraph buf[MAX_SIZE]; | |
14 int size; | |
15 int pad[3]; | |
16 | |
17 SceneGraphArray(void) : size(0) {} | |
18 | |
19 /** | |
20 * array の初期化 | |
21 */ | |
22 void init(void) { | |
23 size = 0; | |
24 } | |
25 | |
26 /** | |
27 * buf から SceneGraph buffer を返す | |
28 * | |
29 * @retval SceneGraph if size < MAX_SIZE | |
30 * @retval NULL if size >= MAX_SIZE | |
31 */ | |
32 SceneGraphPtr getNext(void) { | |
33 if (size >= MAX_SIZE) { | |
34 return NULL; | |
35 } else { | |
36 return &buf[size++]; | |
37 } | |
38 } | |
39 }; | |
40 | |
41 typedef SceneGraphArray *SceneGraphArrayPtr; | |
42 | |
43 #undef MAX_SIZE | |
44 | |
45 #endif |