瀏覽代碼

support new PTA::empty_array syntax

David Rose 24 年之前
父節點
當前提交
0d4bf16deb
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      pandaapp/src/stitchviewer/triangleMesh.cxx

+ 6 - 3
pandaapp/src/stitchviewer/triangleMesh.cxx

@@ -22,7 +22,10 @@
 
 TriangleMesh::
 TriangleMesh(int x_verts, int y_verts) :
-  _coords(0), _norms(0), _colors(0), _texcoords(0),
+  _coords(PTA_Vertexf::empty_array(0)),
+  _norms(PTA_Normalf::empty_array(0)),
+  _colors(PTA_Colorf::empty_array(0)),
+  _texcoords(PTA_TexCoordf::empty_array(0)),
   _x_verts(x_verts),
   _y_verts(y_verts)
 {
@@ -49,8 +52,8 @@ build_mesh() const {
   int num_tstrips = (_y_verts-1);
   int tstrip_length = 2*(_x_verts-1)+2;
 
-  PTA(int) lengths(num_tstrips);
-  PTA(ushort) vindex(num_tstrips * tstrip_length);
+  PTA_int lengths = PTA_int::empty_array(num_tstrips);
+  PTA_ushort vindex = PTA_ushort::empty_array(num_tstrips * tstrip_length);
 
   // Set the lengths array.  We are creating num_tstrips T-strips,
   // each of which has t_strip length vertices.