From 262bde3082eefad93581bdfee098e8fe9197e1fd Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 2 Aug 2023 08:08:25 +0200 Subject: [PATCH] grutil: Add clear_color method to CardMaker --- panda/src/grutil/cardMaker.I | 9 +++++++++ panda/src/grutil/cardMaker.h | 1 + 2 files changed, 10 insertions(+) diff --git a/panda/src/grutil/cardMaker.I b/panda/src/grutil/cardMaker.I index b960808ca0..2f8a17a7dc 100644 --- a/panda/src/grutil/cardMaker.I +++ b/panda/src/grutil/cardMaker.I @@ -101,6 +101,15 @@ set_color(const LVecBase4 &color) { _has_color = true; } +/** + * Unsets the color of the card. + */ +INLINE void CardMaker:: +clear_color() { + _has_color = false; + _color.set(1.0f, 1.0f, 1.0f, 1.0f); +} + /** * Sets the flag indicating whether vertices will be generated with normals or * not. Normals are required if you intend to enable lighting on the card, diff --git a/panda/src/grutil/cardMaker.h b/panda/src/grutil/cardMaker.h index 426fc2d5c5..0ac90f2316 100644 --- a/panda/src/grutil/cardMaker.h +++ b/panda/src/grutil/cardMaker.h @@ -49,6 +49,7 @@ PUBLISHED: INLINE void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a); INLINE void set_color(const LColor &color); + INLINE void clear_color(); INLINE void set_has_normals(bool flag);