Mercurial > hg > Game > Cerium
comparison Renderer/Engine/SceneGraphRoot.cc @ 582:4ee1d40823b8 draft
fix realloc
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Oct 2009 18:15:18 +0900 |
parents | ec9dd24c2dc8 |
children | 7e33deb9d3f4 |
comparison
equal
deleted
inserted
replaced
581:c34956de8276 | 582:4ee1d40823b8 |
---|---|
80 sg_src[dup]->name = ""; | 80 sg_src[dup]->name = ""; |
81 // we should remove this. but some one may use it... | 81 // we should remove this. but some one may use it... |
82 } | 82 } |
83 if (sg_src_id+1> sg_src_size) { | 83 if (sg_src_id+1> sg_src_size) { |
84 sg_src_size *= 2; | 84 sg_src_size *= 2; |
85 sg_src = (SceneGraphPtr*)realloc(sg_src, sg_src_size); | 85 sg_src = (SceneGraphPtr*)realloc(sg_src, sg_src_size*sizeof(SceneGraphPtr)); |
86 } | 86 } |
87 sg->sgid = ++sg_src_id; | 87 sg->sgid = ++sg_src_id; |
88 sg_src[sg->sgid] = sg; | 88 sg_src[sg->sgid] = sg; |
89 } | 89 } |
90 | 90 |