From ee50591124a40698f5ce93f8b8e3015a4d2f6053 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 29 May 2003 08:34:18 +0000 Subject: [PATCH] initialize vertices and VColors by default, to avoid sending bogus data to the renderer --- stepmania/src/RageTypes.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageTypes.h b/stepmania/src/RageTypes.h index 5f6d65c748..7ecb14e96c 100644 --- a/stepmania/src/RageTypes.h +++ b/stepmania/src/RageTypes.h @@ -158,7 +158,7 @@ class RageVColor public: unsigned char b,g,r,a; // specific ordering required by Direct3D - RageVColor() { } + RageVColor(): b(0), g(0), r(0), a(0) { } RageVColor(const RageColor &rc) { *this = rc; } RageVColor &operator= (const RageColor &rc) { r = FTOC(rc.r); g = FTOC(rc.g); b = FTOC(rc.b); a = FTOC(rc.a); @@ -188,6 +188,12 @@ typedef Rect RectF; // A structure for our custom vertex type. Note that these data structes have the same layout that D3D expects. struct RageVertex { + /* Zero out by default. */ + RageVertex(): + p(0,0,0), + n(0,0,0), + t(0,0) + { } RageVector3 p; // position RageVector3 n; // normal RageVColor c; // diffuse color