From 0090ebc4657631721cac8d55f5d93bfa7ac5ca54 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 11 Jun 2014 18:44:43 +0000 Subject: [PATCH] more backward compatibility for GeomVertexWriter --- panda/src/gobj/geomVertexWriter.I | 42 +++++++++++++++++++++++++++++++ panda/src/gobj/geomVertexWriter.h | 3 +++ 2 files changed, 45 insertions(+) diff --git a/panda/src/gobj/geomVertexWriter.I b/panda/src/gobj/geomVertexWriter.I index bb5928cfbe..5c63dc46a9 100644 --- a/panda/src/gobj/geomVertexWriter.I +++ b/panda/src/gobj/geomVertexWriter.I @@ -795,6 +795,20 @@ set_data2i(int a, int b) { set_data2i(LVecBase2i(a, b)); } +//////////////////////////////////////////////////////////////////// +// Function: GeomVertexWriter::set_data2i +// Access: Published +// Description: Sets the write row to a particular 2-component +// value, and advances the write row. +// +// It is an error for the write row to advance past +// the end of data. +//////////////////////////////////////////////////////////////////// +INLINE void GeomVertexWriter:: +set_data2i(const int data[2]) { + set_data2i(LVecBase2i(data[0], data[1])); +} + //////////////////////////////////////////////////////////////////// // Function: GeomVertexWriter::set_data2i // Access: Published @@ -824,6 +838,20 @@ set_data3i(int a, int b, int c) { set_data3i(LVecBase3i(a, b, c)); } +//////////////////////////////////////////////////////////////////// +// Function: GeomVertexWriter::set_data3i +// Access: Published +// Description: Sets the write row to a particular 3-component +// value, and advances the write row. +// +// It is an error for the write row to advance past +// the end of data. +//////////////////////////////////////////////////////////////////// +INLINE void GeomVertexWriter:: +set_data3i(const int data[3]) { + set_data3i(LVecBase3i(data[0], data[1], data[2])); +} + //////////////////////////////////////////////////////////////////// // Function: GeomVertexWriter::set_data3i // Access: Published @@ -853,6 +881,20 @@ set_data4i(int a, int b, int c, int d) { set_data4i(LVecBase4i(a, b, c, d)); } +//////////////////////////////////////////////////////////////////// +// Function: GeomVertexWriter::set_data4i +// Access: Published +// Description: Sets the write row to a particular 4-component +// value, and advances the write row. +// +// It is an error for the write row to advance past +// the end of data. +//////////////////////////////////////////////////////////////////// +INLINE void GeomVertexWriter:: +set_data4i(const int data[4]) { + set_data4i(LVecBase4i(data[0], data[1], data[2], data[3])); +} + //////////////////////////////////////////////////////////////////// // Function: GeomVertexWriter::set_data4i // Access: Published diff --git a/panda/src/gobj/geomVertexWriter.h b/panda/src/gobj/geomVertexWriter.h index 23ace2e13e..2109353757 100644 --- a/panda/src/gobj/geomVertexWriter.h +++ b/panda/src/gobj/geomVertexWriter.h @@ -142,10 +142,13 @@ PUBLISHED: INLINE void set_data1i(int data); INLINE void set_data2i(int a, int b); + INLINE void set_data2i(const int data[2]); INLINE void set_data2i(const LVecBase2i &data); INLINE void set_data3i(int a, int b, int c); + INLINE void set_data3i(const int data[3]); INLINE void set_data3i(const LVecBase3i &data); INLINE void set_data4i(int a, int b, int c, int d); + INLINE void set_data4i(const int data[4]); INLINE void set_data4i(const LVecBase4i &data); INLINE void add_data1f(float data);