From f9faceee5b3cbc827c5128421dd628d194f3394f Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 2 Mar 2012 14:53:36 +0000 Subject: [PATCH] fix CardMaker for y-up --- panda/src/grutil/cardMaker.I | 16 +++++++--------- panda/src/grutil/cardMaker.cxx | 14 ++------------ 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/panda/src/grutil/cardMaker.I b/panda/src/grutil/cardMaker.I index d728cc1fe3..b9768c805c 100644 --- a/panda/src/grutil/cardMaker.I +++ b/panda/src/grutil/cardMaker.I @@ -63,10 +63,10 @@ set_has_3d_uvs(bool flag) { //////////////////////////////////////////////////////////////////// INLINE void CardMaker:: set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) { - _ll_pos.set(left, 0.0f, bottom); - _lr_pos.set(right, 0.0f, bottom); - _ur_pos.set(right, 0.0f, top); - _ul_pos.set(left, 0.0f, top); + _ll_pos = LVector3::rfu(left, 0.0f, bottom); + _lr_pos = LVector3::rfu(right, 0.0f, bottom); + _ur_pos = LVector3::rfu(right, 0.0f, top); + _ul_pos = LVector3::rfu(left, 0.0f, top); } //////////////////////////////////////////////////////////////////// @@ -85,8 +85,7 @@ set_frame(const LVecBase4 &frame) { // Description: Sets the size of the card. //////////////////////////////////////////////////////////////////// INLINE void CardMaker:: -set_frame(const LVertex &ll, const LVertex &lr, const LVertex &ur, const LVertex &ul) -{ +set_frame(const LVertex &ll, const LVertex &lr, const LVertex &ur, const LVertex &ul) { _ll_pos = ll; _lr_pos = lr; _ur_pos = ur; @@ -101,9 +100,8 @@ set_frame(const LVertex &ll, const LVertex &lr, const LVertex &ur, const LVertex // as a fullscreen quad. //////////////////////////////////////////////////////////////////// INLINE void CardMaker:: -set_frame_fullscreen_quad() -{ - set_frame(-1,1,-1,1); +set_frame_fullscreen_quad() { + set_frame(-1.0f, 1.0f, -1.0f, 1.0f); } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/grutil/cardMaker.cxx b/panda/src/grutil/cardMaker.cxx index 65ecfc6c2d..ef759227bc 100644 --- a/panda/src/grutil/cardMaker.cxx +++ b/panda/src/grutil/cardMaker.cxx @@ -29,18 +29,8 @@ //////////////////////////////////////////////////////////////////// void CardMaker:: reset() { - _has_uvs = true; - _has_3d_uvs = false; - - _ll_pos.set(0.0f, 0.0f, 0.0f); - _lr_pos.set(1.0f, 0.0f, 0.0f); - _ur_pos.set(1.0f, 0.0f, 1.0f); - _ul_pos.set(0.0f, 0.0f, 1.0f); - - _ll_tex.set(0.0f, 0.0f, 0.0f); - _lr_tex.set(1.0f, 0.0f, 0.0f); - _ur_tex.set(1.0f, 1.0f, 0.0f); - _ul_tex.set(0.0f, 1.0f, 0.0f); + set_frame(0.0f, 1.0f, 0.0f, 1.0f); + set_uv_range(LTexCoord(0.0f, 0.0f), LTexCoord(1.0f, 1.0f)); _has_color = false; _color.set(1.0f, 1.0f, 1.0f, 1.0f);