summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-06-10 18:16:13 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-06-10 19:30:17 +0300
commit4b52dd754b41948efca0087ccac6d813f1fcce3f (patch)
tree71f229639cd15bc3a6ed6ba8fdd15cc1b8b48835
parentd9ae73ca9ab0546cb7c260a4e7180a952f14c20d (diff)
Fix incorrect use of VX/VY/VZ/VW indices when color components are accessed
-rw-r--r--indra/llappearance/llavatarappearance.cpp12
-rw-r--r--indra/llappearance/lltexlayer.cpp8
-rw-r--r--indra/llappearance/lltexlayerparams.cpp8
-rw-r--r--indra/llcommon/lldefs.h154
-rw-r--r--indra/llmath/tests/v4color_test.cpp60
-rw-r--r--indra/llmath/tests/v4coloru_test.cpp70
-rw-r--r--indra/llmath/v3color.cpp2
-rw-r--r--indra/llmath/v3color.h18
-rw-r--r--indra/llmath/v4color.cpp112
-rw-r--r--indra/llmath/v4color.h274
-rw-r--r--indra/llmath/v4coloru.cpp18
-rw-r--r--indra/llmath/v4coloru.h218
-rw-r--r--indra/llplugin/llpluginclassmedia.cpp8
-rw-r--r--indra/llprimitive/lltextureentry.cpp4
-rw-r--r--indra/llrender/llfontgl.cpp2
-rw-r--r--indra/llui/llkeywords.cpp6
-rw-r--r--indra/llui/lltextbase.cpp6
-rw-r--r--indra/newview/lldrawpoolwater.cpp2
-rw-r--r--indra/newview/llmaniptranslate.cpp18
19 files changed, 500 insertions, 500 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 743c1745d0..de18fce0f8 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -1422,9 +1422,9 @@ void LLAvatarAppearance::setClothesColor( ETextureIndex te, const LLColor4& new_
U32 param_name[3];
if( teToColorParams( te, param_name ) )
{
- setVisualParamWeight( param_name[0], new_color.mV[VX]);
- setVisualParamWeight( param_name[1], new_color.mV[VY]);
- setVisualParamWeight( param_name[2], new_color.mV[VZ]);
+ setVisualParamWeight( param_name[0], new_color.mV[VRED]);
+ setVisualParamWeight( param_name[1], new_color.mV[VGREEN]);
+ setVisualParamWeight( param_name[2], new_color.mV[VBLUE]);
}
}
@@ -1434,9 +1434,9 @@ LLColor4 LLAvatarAppearance::getClothesColor( ETextureIndex te )
U32 param_name[3];
if( teToColorParams( te, param_name ) )
{
- color.mV[VX] = getVisualParamWeight( param_name[0] );
- color.mV[VY] = getVisualParamWeight( param_name[1] );
- color.mV[VZ] = getVisualParamWeight( param_name[2] );
+ color.mV[VRED] = getVisualParamWeight( param_name[0] );
+ color.mV[VGREEN] = getVisualParamWeight( param_name[1] );
+ color.mV[VBLUE] = getVisualParamWeight( param_name[2] );
}
return color;
}
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index 60ff19f952..d376c68c7f 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -1038,7 +1038,7 @@ bool LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou
bool success = true;
// If you can't see the layer, don't render it.
- if( is_approx_zero( net_color.mV[VW] ) )
+ if( is_approx_zero( net_color.mV[VALPHA] ) )
{
return success;
}
@@ -1213,7 +1213,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const
{
net_color->setVec( mTexLayerSet->getAvatarAppearance()->getGlobalColor( getInfo()->mGlobalColor ) );
}
- else if (getInfo()->mFixedColor.mV[VW])
+ else if (getInfo()->mFixedColor.mV[VALPHA])
{
net_color->setVec( getInfo()->mFixedColor );
}
@@ -1232,7 +1232,7 @@ bool LLTexLayer::findNetColor(LLColor4* net_color) const
return true;
}
- if( getInfo()->mFixedColor.mV[VW] )
+ if( getInfo()->mFixedColor.mV[VALPHA] )
{
net_color->setVec( getInfo()->mFixedColor );
return true;
@@ -1373,7 +1373,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
// Draw a rectangle with the layer color to multiply the alpha by that color's alpha.
// Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO );
- if ( !is_approx_equal(layer_color.mV[VW], 1.f) )
+ if ( !is_approx_equal(layer_color.mV[VALPHA], 1.f) )
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.color4fv(layer_color.mV);
diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp
index 7beffbcd19..30551c115d 100644
--- a/indra/llappearance/lltexlayerparams.cpp
+++ b/indra/llappearance/lltexlayerparams.cpp
@@ -464,10 +464,10 @@ LLColor4 LLTexLayerParamColor::getNetColor() const
F32 weight = scaled_weight - index_start;
const LLColor4 *start = &info->mColors[ index_start ];
const LLColor4 *end = &info->mColors[ index_end ];
- return LLColor4((1.f - weight) * start->mV[VX] + weight * end->mV[VX],
- (1.f - weight) * start->mV[VY] + weight * end->mV[VY],
- (1.f - weight) * start->mV[VZ] + weight * end->mV[VZ],
- (1.f - weight) * start->mV[VW] + weight * end->mV[VW]);
+ return LLColor4((1.f - weight) * start->mV[VRED] + weight * end->mV[VRED],
+ (1.f - weight) * start->mV[VGREEN] + weight * end->mV[VGREEN],
+ (1.f - weight) * start->mV[VBLUE] + weight * end->mV[VBLUE],
+ (1.f - weight) * start->mV[VALPHA] + weight * end->mV[VALPHA]);
}
}
diff --git a/indra/llcommon/lldefs.h b/indra/llcommon/lldefs.h
index 0ba756d472..2fbb26dc1a 100644
--- a/indra/llcommon/lldefs.h
+++ b/indra/llcommon/lldefs.h
@@ -31,64 +31,64 @@
#include <type_traits>
// Often used array indices
-const U32 VX = 0;
-const U32 VY = 1;
-const U32 VZ = 2;
-const U32 VW = 3;
-const U32 VS = 3;
-
-const U32 VRED = 0;
-const U32 VGREEN = 1;
-const U32 VBLUE = 2;
-const U32 VALPHA = 3;
-
-const U32 INVALID_DIRECTION = 0xFFFFFFFF;
-const U32 EAST = 0;
-const U32 NORTH = 1;
-const U32 WEST = 2;
-const U32 SOUTH = 3;
-
-const U32 NORTHEAST = 4;
-const U32 NORTHWEST = 5;
-const U32 SOUTHWEST = 6;
-const U32 SOUTHEAST = 7;
-const U32 MIDDLE = 8;
-
-const U8 EAST_MASK = 0x1<<EAST;
-const U8 NORTH_MASK = 0x1<<NORTH;
-const U8 WEST_MASK = 0x1<<WEST;
-const U8 SOUTH_MASK = 0x1<<SOUTH;
-
-const U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
-const U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
-const U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
-const U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
-
-const U32 gDirOpposite[8] = {2, 3, 0, 1, 6, 7, 4, 5};
-const U32 gDirAdjacent[8][2] = {
- {4, 7},
- {4, 5},
- {5, 6},
- {6, 7},
- {0, 1},
- {1, 2},
- {2, 3},
- {0, 3}
- };
+constexpr U32 VX = 0;
+constexpr U32 VY = 1;
+constexpr U32 VZ = 2;
+constexpr U32 VW = 3;
+constexpr U32 VS = 3;
+
+constexpr U32 VRED = 0;
+constexpr U32 VGREEN = 1;
+constexpr U32 VBLUE = 2;
+constexpr U32 VALPHA = 3;
+
+constexpr U32 INVALID_DIRECTION = 0xFFFFFFFF;
+constexpr U32 EAST = 0;
+constexpr U32 NORTH = 1;
+constexpr U32 WEST = 2;
+constexpr U32 SOUTH = 3;
+
+constexpr U32 NORTHEAST = 4;
+constexpr U32 NORTHWEST = 5;
+constexpr U32 SOUTHWEST = 6;
+constexpr U32 SOUTHEAST = 7;
+constexpr U32 MIDDLE = 8;
+
+constexpr U8 EAST_MASK = 0x1<<EAST;
+constexpr U8 NORTH_MASK = 0x1<<NORTH;
+constexpr U8 WEST_MASK = 0x1<<WEST;
+constexpr U8 SOUTH_MASK = 0x1<<SOUTH;
+
+constexpr U8 NORTHEAST_MASK = NORTH_MASK | EAST_MASK;
+constexpr U8 NORTHWEST_MASK = NORTH_MASK | WEST_MASK;
+constexpr U8 SOUTHWEST_MASK = SOUTH_MASK | WEST_MASK;
+constexpr U8 SOUTHEAST_MASK = SOUTH_MASK | EAST_MASK;
+
+constexpr U32 gDirOpposite[8] = {2, 3, 0, 1, 6, 7, 4, 5};
+constexpr U32 gDirAdjacent[8][2] = {
+ {4, 7},
+ {4, 5},
+ {5, 6},
+ {6, 7},
+ {0, 1},
+ {1, 2},
+ {2, 3},
+ {0, 3}
+ };
// Magnitude along the x and y axis
-const S32 gDirAxes[8][2] = {
- { 1, 0}, // east
- { 0, 1}, // north
- {-1, 0}, // west
- { 0,-1}, // south
- { 1, 1}, // ne
- {-1, 1}, // nw
- {-1,-1}, // sw
- { 1,-1}, // se
- };
-
-const S32 gDirMasks[8] = {
+constexpr S32 gDirAxes[8][2] = {
+ { 1, 0}, // east
+ { 0, 1}, // north
+ {-1, 0}, // west
+ { 0,-1}, // south
+ { 1, 1}, // ne
+ {-1, 1}, // nw
+ {-1,-1}, // sw
+ { 1,-1}, // se
+ };
+
+constexpr S32 gDirMasks[8] = {
EAST_MASK,
NORTH_MASK,
WEST_MASK,
@@ -117,22 +117,22 @@ const S32 gDirMasks[8] = {
// | / -6- | /
// |/ / |/
// +------------------+
-const U32 NO_SIDE = 0;
-const U32 FRONT_SIDE = 1;
-const U32 BACK_SIDE = 2;
-const U32 LEFT_SIDE = 3;
-const U32 RIGHT_SIDE = 4;
-const U32 TOP_SIDE = 5;
-const U32 BOTTOM_SIDE = 6;
-
-const U8 LL_SOUND_FLAG_NONE = 0x0;
-const U8 LL_SOUND_FLAG_LOOP = 1<<0;
-const U8 LL_SOUND_FLAG_SYNC_MASTER = 1<<1;
-const U8 LL_SOUND_FLAG_SYNC_SLAVE = 1<<2;
-const U8 LL_SOUND_FLAG_SYNC_PENDING = 1<<3;
-const U8 LL_SOUND_FLAG_QUEUE = 1<<4;
-const U8 LL_SOUND_FLAG_STOP = 1<<5;
-const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
+constexpr U32 NO_SIDE = 0;
+constexpr U32 FRONT_SIDE = 1;
+constexpr U32 BACK_SIDE = 2;
+constexpr U32 LEFT_SIDE = 3;
+constexpr U32 RIGHT_SIDE = 4;
+constexpr U32 TOP_SIDE = 5;
+constexpr U32 BOTTOM_SIDE = 6;
+
+constexpr U8 LL_SOUND_FLAG_NONE = 0x0;
+constexpr U8 LL_SOUND_FLAG_LOOP = 1<<0;
+constexpr U8 LL_SOUND_FLAG_SYNC_MASTER = 1<<1;
+constexpr U8 LL_SOUND_FLAG_SYNC_SLAVE = 1<<2;
+constexpr U8 LL_SOUND_FLAG_SYNC_PENDING = 1<<3;
+constexpr U8 LL_SOUND_FLAG_QUEUE = 1<<4;
+constexpr U8 LL_SOUND_FLAG_STOP = 1<<5;
+constexpr U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYNC_SLAVE | LL_SOUND_FLAG_SYNC_PENDING;
//
// *NOTE: These values may be used as hard-coded numbers in scanf() variants.
@@ -141,17 +141,17 @@ const U8 LL_SOUND_FLAG_SYNC_MASK = LL_SOUND_FLAG_SYNC_MASTER | LL_SOUND_FLAG_SYN
// DO NOT CHANGE.
// --------------
//
-const U32 LL_MAX_PATH = 1024; // buffer size of maximum path + filename string length
+constexpr U32 LL_MAX_PATH = 1024; // buffer size of maximum path + filename string length
// For strings we send in messages
-const U32 STD_STRING_BUF_SIZE = 255; // Buffer size
-const U32 STD_STRING_STR_LEN = 254; // Length of the string (not including \0)
+constexpr U32 STD_STRING_BUF_SIZE = 255; // Buffer size
+constexpr U32 STD_STRING_STR_LEN = 254; // Length of the string (not including \0)
// *NOTE: This value is used as hard-coded numbers in scanf() variants.
// DO NOT CHANGE.
-const U32 MAX_STRING = STD_STRING_BUF_SIZE; // Buffer size
+constexpr U32 MAX_STRING = STD_STRING_BUF_SIZE; // Buffer size
-const U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + 1 for good luck
+constexpr U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 + 1 for good luck
// C++ is our friend. . . use template functions to make life easier!
diff --git a/indra/llmath/tests/v4color_test.cpp b/indra/llmath/tests/v4color_test.cpp
index 3b3adbda0d..e5d914a065 100644
--- a/indra/llmath/tests/v4color_test.cpp
+++ b/indra/llmath/tests/v4color_test.cpp
@@ -49,23 +49,23 @@ namespace tut
void v4color_object::test<1>()
{
LLColor4 llcolor4;
- ensure("1:LLColor4:Fail to initialize ", ((0 == llcolor4.mV[VX]) && (0 == llcolor4.mV[VY]) && (0 == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
+ ensure("1:LLColor4:Fail to initialize ", ((0 == llcolor4.mV[VRED]) && (0 == llcolor4.mV[VGREEN]) && (0 == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
F32 r = 0x20, g = 0xFFFF, b = 0xFF, a = 0xAF;
LLColor4 llcolor4a(r,g,b);
- ensure("2:LLColor4:Fail to initialize ", ((r == llcolor4a.mV[VX]) && (g == llcolor4a.mV[VY]) && (b == llcolor4a.mV[VZ])&& (1.0f == llcolor4a.mV[VW])));
+ ensure("2:LLColor4:Fail to initialize ", ((r == llcolor4a.mV[VRED]) && (g == llcolor4a.mV[VGREEN]) && (b == llcolor4a.mV[VBLUE])&& (1.0f == llcolor4a.mV[VALPHA])));
LLColor4 llcolor4b(r,g,b,a);
- ensure("3:LLColor4:Fail to initialize ", ((r == llcolor4b.mV[VX]) && (g == llcolor4b.mV[VY]) && (b == llcolor4b.mV[VZ])&& (a == llcolor4b.mV[VW])));
+ ensure("3:LLColor4:Fail to initialize ", ((r == llcolor4b.mV[VRED]) && (g == llcolor4b.mV[VGREEN]) && (b == llcolor4b.mV[VBLUE])&& (a == llcolor4b.mV[VALPHA])));
const F32 vec[4] = {.112f ,23.2f, -4.2f, -.0001f};
LLColor4 llcolor4c(vec);
- ensure("4:LLColor4:Fail to initialize ", ((vec[0] == llcolor4c.mV[VX]) && (vec[1] == llcolor4c.mV[VY]) && (vec[2] == llcolor4c.mV[VZ])&& (vec[3] == llcolor4c.mV[VW])));
+ ensure("4:LLColor4:Fail to initialize ", ((vec[0] == llcolor4c.mV[VRED]) && (vec[1] == llcolor4c.mV[VGREEN]) && (vec[2] == llcolor4c.mV[VBLUE])&& (vec[3] == llcolor4c.mV[VALPHA])));
LLColor3 llcolor3(-2.23f,1.01f,42.3f);
F32 val = -.1f;
LLColor4 llcolor4d(llcolor3,val);
- ensure("5:LLColor4:Fail to initialize ", ((llcolor3.mV[VX] == llcolor4d.mV[VX]) && (llcolor3.mV[VY] == llcolor4d.mV[VY]) && (llcolor3.mV[VZ] == llcolor4d.mV[VZ])&& (val == llcolor4d.mV[VW])));
+ ensure("5:LLColor4:Fail to initialize ", ((llcolor3.mV[VRED] == llcolor4d.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4d.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4d.mV[VBLUE])&& (val == llcolor4d.mV[VALPHA])));
LLSD sd = llcolor4d.getValue();
LLColor4 llcolor4e(sd);
@@ -76,7 +76,7 @@ namespace tut
LLColor4 llcolor4g(color4u);
const F32 SCALE = 1.f/255.f;
F32 r2 = r1*SCALE, g2 = g1* SCALE, b2 = b1* SCALE;
- ensure("7:LLColor4:Fail to initialize ", ((r2 == llcolor4g.mV[VX]) && (g2 == llcolor4g.mV[VY]) && (b2 == llcolor4g.mV[VZ])));
+ ensure("7:LLColor4:Fail to initialize ", ((r2 == llcolor4g.mV[VRED]) && (g2 == llcolor4g.mV[VGREEN]) && (b2 == llcolor4g.mV[VBLUE])));
}
template<> template<>
@@ -98,10 +98,10 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF,a = 0xAF;
LLColor4 llcolor4(r,g,b,a);
llcolor4.setToBlack();
- ensure("setToBlack:Fail to set the black ", ((0 == llcolor4.mV[VX]) && (0 == llcolor4.mV[VY]) && (0 == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
+ ensure("setToBlack:Fail to set the black ", ((0 == llcolor4.mV[VRED]) && (0 == llcolor4.mV[VGREEN]) && (0 == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
llcolor4.setToWhite();
- ensure("setToWhite:Fail to set the white ", ((1.f == llcolor4.mV[VX]) && (1.f == llcolor4.mV[VY]) && (1.f == llcolor4.mV[VZ])&& (1.0f == llcolor4.mV[VW])));
+ ensure("setToWhite:Fail to set the white ", ((1.f == llcolor4.mV[VRED]) && (1.f == llcolor4.mV[VGREEN]) && (1.f == llcolor4.mV[VBLUE])&& (1.0f == llcolor4.mV[VALPHA])));
}
template<> template<>
@@ -110,10 +110,10 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF, a = 0xAF;
LLColor4 llcolor4;
llcolor4.setVec(r,g,b);
- ensure("1:setVec:Fail to set the values ", ((r == llcolor4.mV[VX]) && (g == llcolor4.mV[VY]) && (b == llcolor4.mV[VZ])&& (1.f == llcolor4.mV[VW])));
+ ensure("1:setVec:Fail to set the values ", ((r == llcolor4.mV[VRED]) && (g == llcolor4.mV[VGREEN]) && (b == llcolor4.mV[VBLUE])&& (1.f == llcolor4.mV[VALPHA])));
llcolor4.setVec(r,g,b,a);
- ensure("2:setVec:Fail to set the values ", ((r == llcolor4.mV[VX]) && (g == llcolor4.mV[VY]) && (b == llcolor4.mV[VZ])&& (a == llcolor4.mV[VW])));
+ ensure("2:setVec:Fail to set the values ", ((r == llcolor4.mV[VRED]) && (g == llcolor4.mV[VGREEN]) && (b == llcolor4.mV[VBLUE])&& (a == llcolor4.mV[VALPHA])));
LLColor4 llcolor4a;
llcolor4a.setVec(llcolor4);
@@ -121,23 +121,23 @@ namespace tut
LLColor3 llcolor3(-2.23f,1.01f,42.3f);
llcolor4a.setVec(llcolor3);
- ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VX] == llcolor4a.mV[VX]) && (llcolor3.mV[VY] == llcolor4a.mV[VY]) && (llcolor3.mV[VZ] == llcolor4a.mV[VZ])));
+ ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VRED] == llcolor4a.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4a.mV[VBLUE])));
F32 val = -.33f;
llcolor4a.setVec(llcolor3,val);
- ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VX] == llcolor4a.mV[VX]) && (llcolor3.mV[VY] == llcolor4a.mV[VY]) && (llcolor3.mV[VZ] == llcolor4a.mV[VZ]) && (val == llcolor4a.mV[VW])));
+ ensure("4:setVec:Fail to set the values ", ((llcolor3.mV[VRED] == llcolor4a.mV[VRED]) && (llcolor3.mV[VGREEN] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[VBLUE] == llcolor4a.mV[VBLUE]) && (val == llcolor4a.mV[VALPHA])));
const F32 vec[4] = {.112f ,23.2f, -4.2f, -.0001f};
LLColor4 llcolor4c;
llcolor4c.setVec(vec);
- ensure("5:setVec:Fail to initialize ", ((vec[0] == llcolor4c.mV[VX]) && (vec[1] == llcolor4c.mV[VY]) && (vec[2] == llcolor4c.mV[VZ])&& (vec[3] == llcolor4c.mV[VW])));
+ ensure("5:setVec:Fail to initialize ", ((vec[0] == llcolor4c.mV[VRED]) && (vec[1] == llcolor4c.mV[VGREEN]) && (vec[2] == llcolor4c.mV[VBLUE])&& (vec[3] == llcolor4c.mV[VALPHA])));
U8 r1 = 0xF2, g1 = 0xFA, b1= 0xBF;
LLColor4U color4u(r1,g1,b1);
llcolor4.setVec(color4u);
const F32 SCALE = 1.f/255.f;
F32 r2 = r1*SCALE, g2 = g1* SCALE, b2 = b1* SCALE;
- ensure("6:setVec:Fail to initialize ", ((r2 == llcolor4.mV[VX]) && (g2 == llcolor4.mV[VY]) && (b2 == llcolor4.mV[VZ])));
+ ensure("6:setVec:Fail to initialize ", ((r2 == llcolor4.mV[VRED]) && (g2 == llcolor4.mV[VGREEN]) && (b2 == llcolor4.mV[VBLUE])));
}
template<> template<>
@@ -146,7 +146,7 @@ namespace tut
F32 alpha = 0xAF;
LLColor4 llcolor4;
llcolor4.setAlpha(alpha);
- ensure("setAlpha:Fail to initialize ", (alpha == llcolor4.mV[VW]));
+ ensure("setAlpha:Fail to initialize ", (alpha == llcolor4.mV[VALPHA]));
}
template<> template<>
@@ -209,7 +209,7 @@ namespace tut
LLColor3 llcolor3(r,g,b);
LLColor4 llcolor4a,llcolor4b;
llcolor4a = llcolor3;
- ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VX]) && (llcolor3.mV[1] == llcolor4a.mV[VY]) && (llcolor3.mV[2] == llcolor4a.mV[VZ])));
+ ensure("Operator=:Fail to initialize ", ((llcolor3.mV[0] == llcolor4a.mV[VRED]) && (llcolor3.mV[1] == llcolor4a.mV[VGREEN]) && (llcolor3.mV[2] == llcolor4a.mV[VBLUE])));
LLSD sd = llcolor4a.getValue();
llcolor4b = LLColor4(sd);
ensure_equals("Operator= LLSD:Fail ", llcolor4a, llcolor4b);
@@ -234,10 +234,10 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4b + llcolor4a;
- ensure("operator+:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4c.mV[VX]) && is_approx_equal(g1+g2,llcolor4c.mV[VY]) && is_approx_equal(b1+b2,llcolor4c.mV[VZ])));
+ ensure("operator+:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4c.mV[VRED]) && is_approx_equal(g1+g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1+b2,llcolor4c.mV[VBLUE])));
llcolor4b += llcolor4a;
- ensure("operator+=:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4b.mV[VX]) && is_approx_equal(g1+g2,llcolor4b.mV[VY]) && is_approx_equal(b1+b2,llcolor4b.mV[VZ])));
+ ensure("operator+=:Fail to Add the values ", (is_approx_equal(r1+r2,llcolor4b.mV[VRED]) && is_approx_equal(g1+g2,llcolor4b.mV[VGREEN]) && is_approx_equal(b1+b2,llcolor4b.mV[VBLUE])));
}
template<> template<>
@@ -247,10 +247,10 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4a - llcolor4b;
- ensure("operator-:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4c.mV[VX]) && is_approx_equal(g1-g2,llcolor4c.mV[VY]) && is_approx_equal(b1-b2,llcolor4c.mV[VZ])));
+ ensure("operator-:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4c.mV[VRED]) && is_approx_equal(g1-g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1-b2,llcolor4c.mV[VBLUE])));
llcolor4a -= llcolor4b;
- ensure("operator-=:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4a.mV[VX]) && is_approx_equal(g1-g2,llcolor4a.mV[VY]) && is_approx_equal(b1-b2,llcolor4a.mV[VZ])));
+ ensure("operator-=:Fail to subtract the values ", (is_approx_equal(r1-r2,llcolor4a.mV[VRED]) && is_approx_equal(g1-g2,llcolor4a.mV[VGREEN]) && is_approx_equal(b1-b2,llcolor4a.mV[VBLUE])));
}
template<> template<>
@@ -260,20 +260,20 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = llcolor4a * llcolor4b;
- ensure("1:operator*:Fail to multiply the values", (is_approx_equal(r1*r2,llcolor4c.mV[VX]) && is_approx_equal(g1*g2,llcolor4c.mV[VY]) && is_approx_equal(b1*b2,llcolor4c.mV[VZ])));
+ ensure("1:operator*:Fail to multiply the values", (is_approx_equal(r1*r2,llcolor4c.mV[VRED]) && is_approx_equal(g1*g2,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*b2,llcolor4c.mV[VBLUE])));
F32 mulVal = 3.33f;
llcolor4c = llcolor4a * mulVal;
- ensure("2:operator*:Fail ", (is_approx_equal(r1*mulVal,llcolor4c.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VZ])));
+ ensure("2:operator*:Fail ", (is_approx_equal(r1*mulVal,llcolor4c.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VBLUE])));
llcolor4c = mulVal * llcolor4a;
- ensure("3:operator*:Fail to multiply the values", (is_approx_equal(r1*mulVal,llcolor4c.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VZ])));
+ ensure("3:operator*:Fail to multiply the values", (is_approx_equal(r1*mulVal,llcolor4c.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4c.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4c.mV[VBLUE])));
llcolor4a *= mulVal;
- ensure("4:operator*=:Fail to multiply the values ", (is_approx_equal(r1*mulVal,llcolor4a.mV[VX]) && is_approx_equal(g1*mulVal,llcolor4a.mV[VY]) && is_approx_equal(b1*mulVal,llcolor4a.mV[VZ])));
+ ensure("4:operator*=:Fail to multiply the values ", (is_approx_equal(r1*mulVal,llcolor4a.mV[VRED]) && is_approx_equal(g1*mulVal,llcolor4a.mV[VGREEN]) && is_approx_equal(b1*mulVal,llcolor4a.mV[VBLUE])));
LLColor4 llcolor4d(r1,g1,b1),llcolor4e(r2,g2,b2);
llcolor4e *= llcolor4d;
- ensure("5:operator*=:Fail to multiply the values ", (is_approx_equal(r1*r2,llcolor4e.mV[VX]) && is_approx_equal(g1*g2,llcolor4e.mV[VY]) && is_approx_equal(b1*b2,llcolor4e.mV[VZ])));
+ ensure("5:operator*=:Fail to multiply the values ", (is_approx_equal(r1*r2,llcolor4e.mV[VRED]) && is_approx_equal(g1*g2,llcolor4e.mV[VGREEN]) && is_approx_equal(b1*b2,llcolor4e.mV[VBLUE])));
}
template<> template<>
@@ -283,13 +283,13 @@ namespace tut
F32 div = 12.345f;
LLColor4 llcolor4a(r,g,b,a),llcolor4b;
llcolor4b = llcolor4a % div;//chnage only alpha value nor r,g,b;
- ensure("1operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VX]) && is_approx_equal(g,llcolor4b.mV[VY]) && is_approx_equal(b,llcolor4b.mV[VZ])&& is_approx_equal(div*a,llcolor4b.mV[VW])));
+ ensure("1operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VRED]) && is_approx_equal(g,llcolor4b.mV[VGREEN]) && is_approx_equal(b,llcolor4b.mV[VBLUE])&& is_approx_equal(div*a,llcolor4b.mV[VALPHA])));
llcolor4b = div % llcolor4a;
- ensure("2operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VX]) && is_approx_equal(g,llcolor4b.mV[VY]) && is_approx_equal(b,llcolor4b.mV[VZ])&& is_approx_equal(div*a,llcolor4b.mV[VW])));
+ ensure("2operator%:Fail ", (is_approx_equal(r,llcolor4b.mV[VRED]) && is_approx_equal(g,llcolor4b.mV[VGREEN]) && is_approx_equal(b,llcolor4b.mV[VBLUE])&& is_approx_equal(div*a,llcolor4b.mV[VALPHA])));
llcolor4a %= div;
- ensure("operator%=:Fail ", (is_approx_equal(a*div,llcolor4a.mV[VW])));
+ ensure("operator%=:Fail ", (is_approx_equal(a*div,llcolor4a.mV[VALPHA])));
}
template<> template<>
@@ -312,7 +312,7 @@ namespace tut
F32 r = 0x20, g = 0xFFFF, b = 0xFF;
LLColor4 llcolor4a(r,g,b),llcolor4b;
LLColor3 llcolor3 = vec4to3(llcolor4a);
- ensure("vec4to3:Fail to convert vec4 to vec3 ", (is_approx_equal(llcolor3.mV[VX],llcolor4a.mV[VX]) && is_approx_equal(llcolor3.mV[VY],llcolor4a.mV[VY]) && is_approx_equal(llcolor3.mV[VZ],llcolor4a.mV[VZ])));
+ ensure("vec4to3:Fail to convert vec4 to vec3 ", (is_approx_equal(llcolor3.mV[VRED],llcolor4a.mV[VRED]) && is_approx_equal(llcolor3.mV[VGREEN],llcolor4a.mV[VGREEN]) && is_approx_equal(llcolor3.mV[VBLUE],llcolor4a.mV[VBLUE])));
llcolor4b = vec3to4(llcolor3);
ensure_equals("vec3to4:Fail to convert vec3 to vec4 ", llcolor4b, llcolor4a);
}
@@ -324,7 +324,7 @@ namespace tut
F32 r2 = 0xABF, g2 = 0xFB, b2 = 0xFFF;
LLColor4 llcolor4a(r1,g1,b1),llcolor4b(r2,g2,b2),llcolor4c;
llcolor4c = lerp(llcolor4a,llcolor4b,val);
- ensure("lerp:Fail ", (is_approx_equal(r1 + (r2 - r1)* val,llcolor4c.mV[VX]) && is_approx_equal(g1 + (g2 - g1)* val,llcolor4c.mV[VY]) && is_approx_equal(b1 + (b2 - b1)* val,llcolor4c.mV[VZ])));
+ ensure("lerp:Fail ", (is_approx_equal(r1 + (r2 - r1)* val,llcolor4c.mV[VRED]) && is_approx_equal(g1 + (g2 - g1)* val,llcolor4c.mV[VGREEN]) && is_approx_equal(b1 + (b2 - b1)* val,llcolor4c.mV[VBLUE])));
}
template<> template<>
diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp
index 55cef0fea1..9d707d18c5 100644
--- a/indra/llmath/tests/v4coloru_test.cpp
+++ b/indra/llmath/tests/v4coloru_test.cpp
@@ -48,18 +48,18 @@ namespace tut
void v4coloru_object::test<1>()
{
LLColor4U llcolor4u;
- ensure("1:LLColor4u:Fail to initialize ", ((0 == llcolor4u.mV[VX]) && (0 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("1:LLColor4u:Fail to initialize ", ((0 == llcolor4u.mV[VRED]) && (0 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u1(r,g,b);
- ensure("2:LLColor4u:Fail to initialize ", ((r == llcolor4u1.mV[VX]) && (g == llcolor4u1.mV[VY]) && (b == llcolor4u1.mV[VZ])&& (255 == llcolor4u1.mV[VW])));
+ ensure("2:LLColor4u:Fail to initialize ", ((r == llcolor4u1.mV[VRED]) && (g == llcolor4u1.mV[VGREEN]) && (b == llcolor4u1.mV[VBLUE])&& (255 == llcolor4u1.mV[VALPHA])));
LLColor4U llcolor4u2(r,g,b,a);
- ensure("3:LLColor4u:Fail to initialize ", ((r == llcolor4u2.mV[VX]) && (g == llcolor4u2.mV[VY]) && (b == llcolor4u2.mV[VZ])&& (a == llcolor4u2.mV[VW])));
+ ensure("3:LLColor4u:Fail to initialize ", ((r == llcolor4u2.mV[VRED]) && (g == llcolor4u2.mV[VGREEN]) && (b == llcolor4u2.mV[VBLUE])&& (a == llcolor4u2.mV[VALPHA])));
const U8 vec[4] = {0x12,0xFF,0xAF,0x23};
LLColor4U llcolor4u3(vec);
- ensure("4:LLColor4u:Fail to initialize ", ((vec[0] == llcolor4u3.mV[VX]) && (vec[1] == llcolor4u3.mV[VY]) && (vec[2] == llcolor4u3.mV[VZ])&& (vec[3] == llcolor4u3.mV[VW])));
+ ensure("4:LLColor4u:Fail to initialize ", ((vec[0] == llcolor4u3.mV[VRED]) && (vec[1] == llcolor4u3.mV[VGREEN]) && (vec[2] == llcolor4u3.mV[VBLUE])&& (vec[3] == llcolor4u3.mV[VALPHA])));
LLSD sd = llcolor4u3.getValue();
LLColor4U llcolor4u4(sd);
@@ -82,10 +82,10 @@ namespace tut
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u(r,g,b,a);
llcolor4u.setToBlack();
- ensure("setToBlack:Fail to set black ", ((0 == llcolor4u.mV[VX]) && (0 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("setToBlack:Fail to set black ", ((0 == llcolor4u.mV[VRED]) && (0 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
llcolor4u.setToWhite();
- ensure("setToWhite:Fail to white ", ((255 == llcolor4u.mV[VX]) && (255 == llcolor4u.mV[VY]) && (255 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("setToWhite:Fail to white ", ((255 == llcolor4u.mV[VRED]) && (255 == llcolor4u.mV[VGREEN]) && (255 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
}
template<> template<>
@@ -104,11 +104,11 @@ namespace tut
U8 r = 0x12, g = 0xFF, b = 0xAF, a = 0x23;
LLColor4U llcolor4u;
llcolor4u.setVec(r,g,b,a);
- ensure("1:setVec:Fail to set the values ", ((r == llcolor4u.mV[VX]) && (g == llcolor4u.mV[VY]) && (b == llcolor4u.mV[VZ])&& (a == llcolor4u.mV[VW])));
+ ensure("1:setVec:Fail to set the values ", ((r == llcolor4u.mV[VRED]) && (g == llcolor4u.mV[VGREEN]) && (b == llcolor4u.mV[VBLUE])&& (a == llcolor4u.mV[VALPHA])));
llcolor4u.setToBlack();
llcolor4u.setVec(r,g,b);
- ensure("2:setVec:Fail to set the values ", ((r == llcolor4u.mV[VX]) && (g == llcolor4u.mV[VY]) && (b == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("2:setVec:Fail to set the values ", ((r == llcolor4u.mV[VRED]) && (g == llcolor4u.mV[VGREEN]) && (b == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
LLColor4U llcolor4u1;
llcolor4u1.setVec(llcolor4u);
@@ -117,7 +117,7 @@ namespace tut
const U8 vec[4] = {0x12,0xFF,0xAF,0x23};
LLColor4U llcolor4u2;
llcolor4u2.setVec(vec);
- ensure("4:setVec:Fail to set the values ", ((vec[0] == llcolor4u2.mV[VX]) && (vec[1] == llcolor4u2.mV[VY]) && (vec[2] == llcolor4u2.mV[VZ])&& (vec[3] == llcolor4u2.mV[VW])));
+ ensure("4:setVec:Fail to set the values ", ((vec[0] == llcolor4u2.mV[VRED]) && (vec[1] == llcolor4u2.mV[VGREEN]) && (vec[2] == llcolor4u2.mV[VBLUE])&& (vec[3] == llcolor4u2.mV[VALPHA])));
}
template<> template<>
@@ -126,7 +126,7 @@ namespace tut
U8 alpha = 0x12;
LLColor4U llcolor4u;
llcolor4u.setAlpha(alpha);
- ensure("setAlpha:Fail to set alpha value ", (alpha == llcolor4u.mV[VW]));
+ ensure("setAlpha:Fail to set alpha value ", (alpha == llcolor4u.mV[VALPHA]));
}
template<> template<>
@@ -159,29 +159,29 @@ namespace tut
llcolor4u3 = llcolor4u1 + llcolor4u2;
ensure_equals(
"1a.operator+:Fail to Add the values ",
- llcolor4u3.mV[VX],
+ llcolor4u3.mV[VRED],
(U8)(r1+r2));
ensure_equals(
"1b.operator+:Fail to Add the values ",
- llcolor4u3.mV[VY],
+ llcolor4u3.mV[VGREEN],
(U8)(g1+g2));
ensure_equals(
"1c.operator+:Fail to Add the values ",
- llcolor4u3.mV[VZ],
+ llcolor4u3.mV[VBLUE],
(U8)(b1+b2));
llcolor4u2 += llcolor4u1;
ensure_equals(
"2a.operator+=:Fail to Add the values ",
- llcolor4u2.mV[VX],
+ llcolor4u2.mV[VRED],
(U8)(r1+r2));
ensure_equals(
"2b.operator+=:Fail to Add the values ",
- llcolor4u2.mV[VY],
+ llcolor4u2.mV[VGREEN],
(U8)(g1+g2));
ensure_equals(
"2c.operator+=:Fail to Add the values ",
- llcolor4u2.mV[VZ],
+ llcolor4u2.mV[VBLUE],
(U8)(b1+b2));
}
@@ -194,29 +194,29 @@ namespace tut
llcolor4u3 = llcolor4u1 - llcolor4u2;
ensure_equals(
"1a. operator-:Fail to Add the values ",
- llcolor4u3.mV[VX],
+ llcolor4u3.mV[VRED],
(U8)(r1-r2));
ensure_equals(
"1b. operator-:Fail to Add the values ",
- llcolor4u3.mV[VY],
+ llcolor4u3.mV[VGREEN],
(U8)(g1-g2));
ensure_equals(
"1c. operator-:Fail to Add the values ",
- llcolor4u3.mV[VZ],
+ llcolor4u3.mV[VBLUE],
(U8)(b1-b2));
llcolor4u1 -= llcolor4u2;
ensure_equals(
"2a. operator-=:Fail to Add the values ",
- llcolor4u1.mV[VX],
+ llcolor4u1.mV[VRED],
(U8)(r1-r2));
ensure_equals(
"2b. operator-=:Fail to Add the values ",
- llcolor4u1.mV[VY],
+ llcolor4u1.mV[VGREEN],
(U8)(g1-g2));
ensure_equals(
"2c. operator-=:Fail to Add the values ",
- llcolor4u1.mV[VZ],
+ llcolor4u1.mV[VBLUE],
(U8)(b1-b2));
}
@@ -229,30 +229,30 @@ namespace tut
llcolor4u3 = llcolor4u1 * llcolor4u2;
ensure_equals(
"1a. operator*:Fail to multiply the values",
- llcolor4u3.mV[VX],
+ llcolor4u3.mV[VRED],
(U8)(r1*r2));
ensure_equals(
"1b. operator*:Fail to multiply the values",
- llcolor4u3.mV[VY],
+ llcolor4u3.mV[VGREEN],
(U8)(g1*g2));
ensure_equals(
"1c. operator*:Fail to multiply the values",
- llcolor4u3.mV[VZ],
+ llcolor4u3.mV[VBLUE],
(U8)(b1*b2));
U8 mulVal = 123;
llcolor4u1 *= mulVal;
ensure_equals(
"2a. operator*=:Fail to multiply the values",
- llcolor4u1.mV[VX],
+ llcolor4u1.mV[VRED],
(U8)(r1*mulVal));
ensure_equals(
"2b. operator*=:Fail to multiply the values",
- llcolor4u1.mV[VY],
+ llcolor4u1.mV[VGREEN],
(U8)(g1*mulVal));
ensure_equals(
"2c. operator*=:Fail to multiply the values",
- llcolor4u1.mV[VZ],
+ llcolor4u1.mV[VBLUE],
(U8)(b1*mulVal));
}
@@ -274,7 +274,7 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a);
U8 modVal = 45;
llcolor4u %= modVal;
- ensure_equals("operator%=:Fail ", llcolor4u.mV[VW], (U8)(a * modVal));
+ ensure_equals("operator%=:Fail ", llcolor4u.mV[VALPHA], (U8)(a * modVal));
}
template<> template<>
@@ -284,7 +284,7 @@ namespace tut
LLColor4U llcolor4u1(r,g,b,a);
std::string color("12, 23, 132, 50");
LLColor4U::parseColor4U(color, &llcolor4u1);
- ensure("parseColor4U() failed to parse the color value ", ((12 == llcolor4u1.mV[VX]) && (23 == llcolor4u1.mV[VY]) && (132 == llcolor4u1.mV[VZ])&& (50 == llcolor4u1.mV[VW])));
+ ensure("parseColor4U() failed to parse the color value ", ((12 == llcolor4u1.mV[VRED]) && (23 == llcolor4u1.mV[VGREEN]) && (132 == llcolor4u1.mV[VBLUE])&& (50 == llcolor4u1.mV[VALPHA])));
color = "12, 23, 132";
ensure("2:parseColor4U() failed to parse the color value ", (false == LLColor4U::parseColor4U(color, &llcolor4u1)));
@@ -300,8 +300,8 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a),llcolor4u1;
const F32 fVal = 3.f;
llcolor4u1 = llcolor4u.multAll(fVal);
- ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VX]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VY]
- && ((U8)ll_round(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VW])));
+ ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VRED]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VGREEN]
+ && ((U8)ll_round(b * fVal) == llcolor4u1.mV[VBLUE])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VALPHA])));
}
template<> template<>
@@ -311,13 +311,13 @@ namespace tut
U8 r2 = 23, g2 = 230, b2 = 124, a2 = 255;
LLColor4U llcolor4u(r1,g1,b1,a1),llcolor4u1(r2,g2,b2,a2);
llcolor4u1 = llcolor4u1.addClampMax(llcolor4u);
- ensure("1:addClampMax():Fail to add the value ", ((r1+r2 == llcolor4u1.mV[VX]) && (255 == llcolor4u1.mV[VY]) && (b1+b2 == llcolor4u1.mV[VZ])&& (255 == llcolor4u1.mV[VW])));
+ ensure("1:addClampMax():Fail to add the value ", ((r1+r2 == llcolor4u1.mV[VRED]) && (255 == llcolor4u1.mV[VGREEN]) && (b1+b2 == llcolor4u1.mV[VBLUE])&& (255 == llcolor4u1.mV[VALPHA])));
r1 = 132, g1 = 3, b1 = 3, a1 = 2;
r2 = 123, g2 = 230, b2 = 154, a2 = 25;
LLColor4U llcolor4u2(r1,g1,b1,a1),llcolor4u3(r2,g2,b2,a2);
llcolor4u3 = llcolor4u3.addClampMax(llcolor4u2);
- ensure("2:addClampMax():Fail to add the value ", ((255 == llcolor4u3.mV[VX]) && (g1+g2 == llcolor4u3.mV[VY]) && (b1+b2 == llcolor4u3.mV[VZ])&& (a1+a2 == llcolor4u3.mV[VW])));
+ ensure("2:addClampMax():Fail to add the value ", ((255 == llcolor4u3.mV[VRED]) && (g1+g2 == llcolor4u3.mV[VGREEN]) && (b1+b2 == llcolor4u3.mV[VBLUE])&& (a1+a2 == llcolor4u3.mV[VALPHA])));
}
template<> template<>
@@ -331,6 +331,6 @@ namespace tut
F32 color_scale_factor = MAX_COLOR/r;
S32 r2 = ll_round(r * color_scale_factor);
S32 g2 = ll_round(g * color_scale_factor);
- ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VX]) && (g2 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
+ ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VRED]) && (g2 == llcolor4u.mV[VGREEN]) && (0 == llcolor4u.mV[VBLUE])&& (255 == llcolor4u.mV[VALPHA])));
}
}
diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp
index 9fe9c8d5e5..4367b993f8 100644
--- a/indra/llmath/v3color.cpp
+++ b/indra/llmath/v3color.cpp
@@ -63,7 +63,7 @@ const LLColor3& LLColor3::operator=(const LLColor4 &a)
std::ostream& operator<<(std::ostream& s, const LLColor3 &a)
{
- s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << " }";
+ s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << " }";
return s;
}
diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h
index ea26e9eb76..7b92f85a0c 100644
--- a/indra/llmath/v3color.h
+++ b/indra/llmath/v3color.h
@@ -196,17 +196,17 @@ inline LLColor3::LLColor3(void)
inline LLColor3::LLColor3(F32 r, F32 g, F32 b)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
}
inline LLColor3::LLColor3(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
}
#if LL_WINDOWS
@@ -226,11 +226,11 @@ inline LLColor3::LLColor3(const char* color_string) // takes a string of format
char tempstr[7];
strncpy(tempstr,color_string,6); /* Flawfinder: ignore */
tempstr[6] = '\0';
- mV[VZ] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
+ mV[VBLUE] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
tempstr[4] = '\0';
- mV[VY] = (F32)strtol(&tempstr[2],NULL,16)/255.f;
+ mV[VGREEN] = (F32)strtol(&tempstr[2],NULL,16)/255.f;
tempstr[2] = '\0';
- mV[VX] = (F32)strtol(&tempstr[0],NULL,16)/255.f;
+ mV[VRED] = (F32)strtol(&tempstr[0],NULL,16)/255.f;
}
inline const LLColor3& LLColor3::setToBlack(void)
diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp
index fd3548bc48..ad13656bbd 100644
--- a/indra/llmath/v4color.cpp
+++ b/indra/llmath/v4color.cpp
@@ -133,57 +133,57 @@ LLColor4::operator LLColor4U() const
LLColor4::LLColor4(const LLColor3 &vec, F32 a)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = a;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = a;
}
LLColor4::LLColor4(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
- mV[VX] = color4u.mV[VX] * SCALE;
- mV[VY] = color4u.mV[VY] * SCALE;
- mV[VZ] = color4u.mV[VZ] * SCALE;
- mV[VW] = color4u.mV[VW] * SCALE;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
}
LLColor4::LLColor4(const LLVector4& vector4)
{
- mV[VX] = vector4.mV[VX];
- mV[VY] = vector4.mV[VY];
- mV[VZ] = vector4.mV[VZ];
- mV[VW] = vector4.mV[VW];
+ mV[VRED] = vector4.mV[VRED];
+ mV[VGREEN] = vector4.mV[VGREEN];
+ mV[VBLUE] = vector4.mV[VBLUE];
+ mV[VALPHA] = vector4.mV[VALPHA];
}
const LLColor4& LLColor4::set(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
- mV[VX] = color4u.mV[VX] * SCALE;
- mV[VY] = color4u.mV[VY] * SCALE;
- mV[VZ] = color4u.mV[VZ] * SCALE;
- mV[VW] = color4u.mV[VW] * SCALE;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
const LLColor4& LLColor4::set(const LLColor3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = a;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = a;
return (*this);
}
@@ -191,22 +191,22 @@ const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
const LLColor4& LLColor4::setVec(const LLColor4U& color4u)
{
const F32 SCALE = 1.f/255.f;
- mV[VX] = color4u.mV[VX] * SCALE;
- mV[VY] = color4u.mV[VY] * SCALE;
- mV[VZ] = color4u.mV[VZ] * SCALE;
- mV[VW] = color4u.mV[VW] * SCALE;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
// deprecated -- use set()
const LLColor4& LLColor4::setVec(const LLColor3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
@@ -214,10 +214,10 @@ const LLColor4& LLColor4::setVec(const LLColor3 &vec)
// deprecated -- use set()
const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = a;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = a;
return (*this);
}
@@ -257,45 +257,45 @@ void LLColor4::setValue(const LLSD& sd)
const LLColor4& LLColor4::operator=(const LLColor3 &a)
{
- mV[VX] = a.mV[VX];
- mV[VY] = a.mV[VY];
- mV[VZ] = a.mV[VZ];
+ mV[VRED] = a.mV[VRED];
+ mV[VGREEN] = a.mV[VGREEN];
+ mV[VBLUE] = a.mV[VBLUE];
// converting from an rgb sets a=1 (opaque)
- mV[VW] = 1.f;
+ mV[VALPHA] = 1.f;
return (*this);
}
std::ostream& operator<<(std::ostream& s, const LLColor4 &a)
{
- s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << ", " << a.mV[VW] << " }";
+ s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << ", " << a.mV[VALPHA] << " }";
return s;
}
bool operator==(const LLColor4 &a, const LLColor3 &b)
{
- return ( (a.mV[VX] == b.mV[VX])
- &&(a.mV[VY] == b.mV[VY])
- &&(a.mV[VZ] == b.mV[VZ]));
+ return ( (a.mV[VRED] == b.mV[VRED])
+ &&(a.mV[VGREEN] == b.mV[VGREEN])
+ &&(a.mV[VBLUE] == b.mV[VBLUE]));
}
bool operator!=(const LLColor4 &a, const LLColor3 &b)
{
- return ( (a.mV[VX] != b.mV[VX])
- ||(a.mV[VY] != b.mV[VY])
- ||(a.mV[VZ] != b.mV[VZ]));
+ return ( (a.mV[VRED] != b.mV[VRED])
+ ||(a.mV[VGREEN] != b.mV[VGREEN])
+ ||(a.mV[VBLUE] != b.mV[VBLUE]));
}
LLColor3 vec4to3(const LLColor4 &vec)
{
- LLColor3 temp(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
+ LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
LLColor4 vec3to4(const LLColor3 &vec)
{
- LLColor3 temp(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
+ LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
@@ -408,10 +408,10 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
{
// There are more tokens to read. This must be a vector.
LLColor4 v;
- LLStringUtil::convertToF32( color_name, v.mV[VX] );
- LLStringUtil::convertToF32( *token_iter, v.mV[VY] );
- v.mV[VZ] = 0.0f;
- v.mV[VW] = 1.0f;
+ LLStringUtil::convertToF32( color_name, v.mV[VRED] );
+ LLStringUtil::convertToF32( *token_iter, v.mV[VGREEN] );
+ v.mV[VBLUE] = 0.0f;
+ v.mV[VALPHA] = 1.0f;
++token_iter;
if (token_iter == tokens.end())
@@ -422,18 +422,18 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
else
{
// There is a z-component.
- LLStringUtil::convertToF32( *token_iter, v.mV[VZ] );
+ LLStringUtil::convertToF32( *token_iter, v.mV[VBLUE] );
++token_iter;
if (token_iter != tokens.end())
{
// There is an alpha component.
- LLStringUtil::convertToF32( *token_iter, v.mV[VW] );
+ LLStringUtil::convertToF32( *token_iter, v.mV[VALPHA] );
}
}
// Make sure all values are between 0 and 1.
- if (v.mV[VX] > 1.f || v.mV[VY] > 1.f || v.mV[VZ] > 1.f || v.mV[VW] > 1.f)
+ if (v.mV[VRED] > 1.f || v.mV[VGREEN] > 1.f || v.mV[VBLUE] > 1.f || v.mV[VALPHA] > 1.f)
{
v = v * (1.f / 255.f);
}
diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h
index 1e20ab977a..e9bb6a07ba 100644
--- a/indra/llmath/v4color.h
+++ b/indra/llmath/v4color.h
@@ -242,10 +242,10 @@ LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u);
inline LLColor4::LLColor4(void)
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 1.f;
+ mV[VRED] = 0.f;
+ mV[VGREEN] = 0.f;
+ mV[VBLUE] = 0.f;
+ mV[VALPHA] = 1.f;
}
inline LLColor4::LLColor4(const LLSD& sd)
@@ -255,113 +255,113 @@ inline LLColor4::LLColor4(const LLSD& sd)
inline LLColor4::LLColor4(F32 r, F32 g, F32 b)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = 1.f;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = 1.f;
}
inline LLColor4::LLColor4(F32 r, F32 g, F32 b, F32 a)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = a;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = a;
}
inline LLColor4::LLColor4(U32 clr)
{
- mV[VX] = (clr&0xff) * (1.0f/255.0f);
- mV[VY] = ((clr>>8)&0xff) * (1.0f/255.0f);
- mV[VZ] = ((clr>>16)&0xff) * (1.0f/255.0f);
- mV[VW] = (clr>>24) * (1.0f/255.0f);
+ mV[VRED] = (clr&0xff) * (1.0f/255.0f);
+ mV[VGREEN] = ((clr>>8)&0xff) * (1.0f/255.0f);
+ mV[VBLUE] = ((clr>>16)&0xff) * (1.0f/255.0f);
+ mV[VALPHA] = (clr>>24) * (1.0f/255.0f);
}
inline LLColor4::LLColor4(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
}
inline const LLColor4& LLColor4::setToBlack(void)
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 1.f;
+ mV[VRED] = 0.f;
+ mV[VGREEN] = 0.f;
+ mV[VBLUE] = 0.f;
+ mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::setToWhite(void)
{
- mV[VX] = 1.f;
- mV[VY] = 1.f;
- mV[VZ] = 1.f;
- mV[VW] = 1.f;
+ mV[VRED] = 1.f;
+ mV[VGREEN] = 1.f;
+ mV[VBLUE] = 1.f;
+ mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = a;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
+ mV[VALPHA] = a;
return (*this);
}
inline const LLColor4& LLColor4::set(const LLColor4 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::set(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::set(const F64 *vec)
{
- mV[VX] = static_cast<F32>(vec[VX]);
- mV[VY] = static_cast<F32>(vec[VY]);
- mV[VZ] = static_cast<F32>(vec[VZ]);
- mV[VW] = static_cast<F32>(vec[VW]);
+ mV[VRED] = static_cast<F32>(vec[VRED]);
+ mV[VGREEN] = static_cast<F32>(vec[VGREEN]);
+ mV[VBLUE] = static_cast<F32>(vec[VBLUE]);
+ mV[VALPHA] = static_cast<F32>(vec[VALPHA]);
return (*this);
}
// deprecated
inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 1.f;
+// mV[VALPHA] = 1.f;
return (*this);
}
@@ -369,20 +369,20 @@ inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
// deprecated
inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = a;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
+ mV[VALPHA] = a;
return (*this);
}
// deprecated
inline const LLColor4& LLColor4::setVec(const LLColor4 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
@@ -390,16 +390,16 @@ inline const LLColor4& LLColor4::setVec(const LLColor4 &vec)
// deprecated
inline const LLColor4& LLColor4::setVec(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4& LLColor4::setAlpha(F32 a)
{
- mV[VW] = a;
+ mV[VALPHA] = a;
return (*this);
}
@@ -407,25 +407,25 @@ inline const LLColor4& LLColor4::setAlpha(F32 a)
inline F32 LLColor4::length(void) const
{
- return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
}
inline F32 LLColor4::lengthSquared(void) const
{
- return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
+ return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
}
inline F32 LLColor4::normalize(void)
{
- F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
F32 oomag;
if (mag)
{
oomag = 1.f/mag;
- mV[VX] *= oomag;
- mV[VY] *= oomag;
- mV[VZ] *= oomag;
+ mV[VRED] *= oomag;
+ mV[VGREEN] *= oomag;
+ mV[VBLUE] *= oomag;
}
return (mag);
}
@@ -433,27 +433,27 @@ inline F32 LLColor4::normalize(void)
// deprecated
inline F32 LLColor4::magVec(void) const
{
- return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
}
// deprecated
inline F32 LLColor4::magVecSquared(void) const
{
- return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
+ return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
}
// deprecated
inline F32 LLColor4::normVec(void)
{
- F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
F32 oomag;
if (mag)
{
oomag = 1.f/mag;
- mV[VX] *= oomag;
- mV[VY] *= oomag;
- mV[VZ] *= oomag;
+ mV[VRED] *= oomag;
+ mV[VGREEN] *= oomag;
+ mV[VBLUE] *= oomag;
}
return (mag);
}
@@ -464,135 +464,135 @@ inline F32 LLColor4::normVec(void)
inline LLColor4 operator+(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
- a.mV[VX] + b.mV[VX],
- a.mV[VY] + b.mV[VY],
- a.mV[VZ] + b.mV[VZ],
- a.mV[VW] + b.mV[VW]);
+ a.mV[VRED] + b.mV[VRED],
+ a.mV[VGREEN] + b.mV[VGREEN],
+ a.mV[VBLUE] + b.mV[VBLUE],
+ a.mV[VALPHA] + b.mV[VALPHA]);
}
inline LLColor4 operator-(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
- a.mV[VX] - b.mV[VX],
- a.mV[VY] - b.mV[VY],
- a.mV[VZ] - b.mV[VZ],
- a.mV[VW] - b.mV[VW]);
+ a.mV[VRED] - b.mV[VRED],
+ a.mV[VGREEN] - b.mV[VGREEN],
+ a.mV[VBLUE] - b.mV[VBLUE],
+ a.mV[VALPHA] - b.mV[VALPHA]);
}
inline LLColor4 operator*(const LLColor4 &a, const LLColor4 &b)
{
return LLColor4(
- a.mV[VX] * b.mV[VX],
- a.mV[VY] * b.mV[VY],
- a.mV[VZ] * b.mV[VZ],
- a.mV[VW] * b.mV[VW]);
+ a.mV[VRED] * b.mV[VRED],
+ a.mV[VGREEN] * b.mV[VGREEN],
+ a.mV[VBLUE] * b.mV[VBLUE],
+ a.mV[VALPHA] * b.mV[VALPHA]);
}
inline LLColor4 operator*(const LLColor4 &a, F32 k)
{
// only affects rgb (not a!)
return LLColor4(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4 operator/(const LLColor4 &a, F32 k)
{
return LLColor4(
- a.mV[VX] / k,
- a.mV[VY] / k,
- a.mV[VZ] / k,
- a.mV[VW]);
+ a.mV[VRED] / k,
+ a.mV[VGREEN] / k,
+ a.mV[VBLUE] / k,
+ a.mV[VALPHA]);
}
inline LLColor4 operator*(F32 k, const LLColor4 &a)
{
// only affects rgb (not a!)
return LLColor4(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4 operator%(F32 k, const LLColor4 &a)
{
// only affects alpha (not rgb!)
return LLColor4(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k);
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k);
}
inline LLColor4 operator%(const LLColor4 &a, F32 k)
{
// only affects alpha (not rgb!)
return LLColor4(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k);
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k);
}
inline bool operator==(const LLColor4 &a, const LLColor4 &b)
{
- return ( (a.mV[VX] == b.mV[VX])
- &&(a.mV[VY] == b.mV[VY])
- &&(a.mV[VZ] == b.mV[VZ])
- &&(a.mV[VW] == b.mV[VW]));
+ return ( (a.mV[VRED] == b.mV[VRED])
+ &&(a.mV[VGREEN] == b.mV[VGREEN])
+ &&(a.mV[VBLUE] == b.mV[VBLUE])
+ &&(a.mV[VALPHA] == b.mV[VALPHA]));
}
inline bool operator!=(const LLColor4 &a, const LLColor4 &b)
{
- return ( (a.mV[VX] != b.mV[VX])
- ||(a.mV[VY] != b.mV[VY])
- ||(a.mV[VZ] != b.mV[VZ])
- ||(a.mV[VW] != b.mV[VW]));
+ return ( (a.mV[VRED] != b.mV[VRED])
+ ||(a.mV[VGREEN] != b.mV[VGREEN])
+ ||(a.mV[VBLUE] != b.mV[VBLUE])
+ ||(a.mV[VALPHA] != b.mV[VALPHA]));
}
inline const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b)
{
- a.mV[VX] += b.mV[VX];
- a.mV[VY] += b.mV[VY];
- a.mV[VZ] += b.mV[VZ];
- a.mV[VW] += b.mV[VW];
+ a.mV[VRED] += b.mV[VRED];
+ a.mV[VGREEN] += b.mV[VGREEN];
+ a.mV[VBLUE] += b.mV[VBLUE];
+ a.mV[VALPHA] += b.mV[VALPHA];
return a;
}
inline const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b)
{
- a.mV[VX] -= b.mV[VX];
- a.mV[VY] -= b.mV[VY];
- a.mV[VZ] -= b.mV[VZ];
- a.mV[VW] -= b.mV[VW];
+ a.mV[VRED] -= b.mV[VRED];
+ a.mV[VGREEN] -= b.mV[VGREEN];
+ a.mV[VBLUE] -= b.mV[VBLUE];
+ a.mV[VALPHA] -= b.mV[VALPHA];
return a;
}
inline const LLColor4& operator*=(LLColor4 &a, F32 k)
{
// only affects rgb (not a!)
- a.mV[VX] *= k;
- a.mV[VY] *= k;
- a.mV[VZ] *= k;
+ a.mV[VRED] *= k;
+ a.mV[VGREEN] *= k;
+ a.mV[VBLUE] *= k;
return a;
}
inline const LLColor4& operator *=(LLColor4 &a, const LLColor4 &b)
{
- a.mV[VX] *= b.mV[VX];
- a.mV[VY] *= b.mV[VY];
- a.mV[VZ] *= b.mV[VZ];
-// a.mV[VW] *= b.mV[VW];
+ a.mV[VRED] *= b.mV[VRED];
+ a.mV[VGREEN] *= b.mV[VGREEN];
+ a.mV[VBLUE] *= b.mV[VBLUE];
+// a.mV[VALPHA] *= b.mV[VALPHA];
return a;
}
inline const LLColor4& operator%=(LLColor4 &a, F32 k)
{
// only affects alpha (not rgb!)
- a.mV[VW] *= k;
+ a.mV[VALPHA] *= k;
return a;
}
@@ -614,10 +614,10 @@ inline F32 distVec_squared(const LLColor4 &a, const LLColor4 &b)
inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u)
{
return LLColor4(
- a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u,
- a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u,
- a.mV[VZ] + (b.mV[VZ] - a.mV[VZ]) * u,
- a.mV[VW] + (b.mV[VW] - a.mV[VW]) * u);
+ a.mV[VRED] + (b.mV[VRED] - a.mV[VRED]) * u,
+ a.mV[VGREEN] + (b.mV[VGREEN] - a.mV[VGREEN]) * u,
+ a.mV[VBLUE] + (b.mV[VBLUE] - a.mV[VBLUE]) * u,
+ a.mV[VALPHA] + (b.mV[VALPHA] - a.mV[VALPHA]) * u);
}
inline bool LLColor4::operator<(const LLColor4& rhs) const
diff --git a/indra/llmath/v4coloru.cpp b/indra/llmath/v4coloru.cpp
index 45d310856a..acf349245a 100644
--- a/indra/llmath/v4coloru.cpp
+++ b/indra/llmath/v4coloru.cpp
@@ -53,10 +53,10 @@ LLColor4U::operator LLColor4()
/*
LLColor4U::LLColor4U(const LLColor3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = 255;
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = 255;
}
*/
@@ -70,12 +70,12 @@ LLColor4U::LLColor4U(const LLColor3 &vec)
/*
LLColor4U LLColor4U::operator=(const LLColor3 &a)
{
- mV[VX] = a.mV[VX];
- mV[VY] = a.mV[VY];
- mV[VZ] = a.mV[VZ];
+ mV[VRED] = a.mV[VRED];
+ mV[VGREEN] = a.mV[VGREEN];
+ mV[VBLUE] = a.mV[VBLUE];
// converting from an rgb sets a=1 (opaque)
- mV[VW] = 255;
+ mV[VALPHA] = 255;
return (*this);
}
*/
@@ -83,7 +83,7 @@ LLColor4U LLColor4U::operator=(const LLColor3 &a)
std::ostream& operator<<(std::ostream& s, const LLColor4U &a)
{
- s << "{ " << (S32)a.mV[VX] << ", " << (S32)a.mV[VY] << ", " << (S32)a.mV[VZ] << ", " << (S32)a.mV[VW] << " }";
+ s << "{ " << (S32)a.mV[VRED] << ", " << (S32)a.mV[VGREEN] << ", " << (S32)a.mV[VBLUE] << ", " << (S32)a.mV[VALPHA] << " }";
return s;
}
diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h
index 6d921d12fa..29128a08a7 100644
--- a/indra/llmath/v4coloru.h
+++ b/indra/llmath/v4coloru.h
@@ -142,34 +142,34 @@ F32 distVec_squared(const LLColor4U &a, const LLColor4U &b); // Returns d
inline LLColor4U::LLColor4U()
{
- mV[VX] = 0;
- mV[VY] = 0;
- mV[VZ] = 0;
- mV[VW] = 255;
+ mV[VRED] = 0;
+ mV[VGREEN] = 0;
+ mV[VBLUE] = 0;
+ mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = 255;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b, U8 a)
{
- mV[VX] = r;
- mV[VY] = g;
- mV[VZ] = b;
- mV[VW] = a;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = a;
}
inline LLColor4U::LLColor4U(const U8 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
}
/*
@@ -181,30 +181,30 @@ inline LLColor4U::operator LLColor4()
inline const LLColor4U& LLColor4U::setToBlack(void)
{
- mV[VX] = 0;
- mV[VY] = 0;
- mV[VZ] = 0;
- mV[VW] = 255;
+ mV[VRED] = 0;
+ mV[VGREEN] = 0;
+ mV[VBLUE] = 0;
+ mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::setToWhite(void)
{
- mV[VX] = 255;
- mV[VY] = 255;
- mV[VZ] = 255;
- mV[VW] = 255;
+ mV[VRED] = 255;
+ mV[VGREEN] = 255;
+ mV[VBLUE] = 255;
+ mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 x, const U8 y, const U8 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 255;
+// mV[VALPHA] = 255;
return (*this);
}
@@ -220,31 +220,31 @@ inline const LLColor4U& LLColor4U::set(const U8 r, const U8 g, const U8 b, U8 a)
inline const LLColor4U& LLColor4U::set(const LLColor4U &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ mV[VRED] = x;
+ mV[VGREEN] = y;
+ mV[VBLUE] = z;
// no change to alpha!
-// mV[VW] = 255;
+// mV[VALPHA] = 255;
return (*this);
}
@@ -262,26 +262,26 @@ inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8
// deprecated
inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
+ mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
+ mV[VALPHA] = vec[VALPHA];
return (*this);
}
inline const LLColor4U& LLColor4U::setAlpha(U8 a)
{
- mV[VW] = a;
+ mV[VALPHA] = a;
return (*this);
}
@@ -289,159 +289,159 @@ inline const LLColor4U& LLColor4U::setAlpha(U8 a)
inline F32 LLColor4U::length(void) const
{
- return (F32) sqrt( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] );
+ return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
}
inline F32 LLColor4U::lengthSquared(void) const
{
- return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ];
+ return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
// deprecated
inline F32 LLColor4U::magVec(void) const
{
- return (F32) sqrt( ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ] );
+ return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
}
// deprecated
inline F32 LLColor4U::magVecSquared(void) const
{
- return ((F32)mV[VX]) * mV[VX] + ((F32)mV[VY]) * mV[VY] + ((F32)mV[VZ]) * mV[VZ];
+ return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
inline LLColor4U operator+(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
- a.mV[VX] + b.mV[VX],
- a.mV[VY] + b.mV[VY],
- a.mV[VZ] + b.mV[VZ],
- a.mV[VW] + b.mV[VW]);
+ a.mV[VRED] + b.mV[VRED],
+ a.mV[VGREEN] + b.mV[VGREEN],
+ a.mV[VBLUE] + b.mV[VBLUE],
+ a.mV[VALPHA] + b.mV[VALPHA]);
}
inline LLColor4U operator-(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
- a.mV[VX] - b.mV[VX],
- a.mV[VY] - b.mV[VY],
- a.mV[VZ] - b.mV[VZ],
- a.mV[VW] - b.mV[VW]);
+ a.mV[VRED] - b.mV[VRED],
+ a.mV[VGREEN] - b.mV[VGREEN],
+ a.mV[VBLUE] - b.mV[VBLUE],
+ a.mV[VALPHA] - b.mV[VALPHA]);
}
inline LLColor4U operator*(const LLColor4U &a, const LLColor4U &b)
{
return LLColor4U(
- a.mV[VX] * b.mV[VX],
- a.mV[VY] * b.mV[VY],
- a.mV[VZ] * b.mV[VZ],
- a.mV[VW] * b.mV[VW]);
+ a.mV[VRED] * b.mV[VRED],
+ a.mV[VGREEN] * b.mV[VGREEN],
+ a.mV[VBLUE] * b.mV[VBLUE],
+ a.mV[VALPHA] * b.mV[VALPHA]);
}
inline LLColor4U LLColor4U::addClampMax(const LLColor4U &color)
{
- return LLColor4U(llmin((S32)mV[VX] + color.mV[VX], 255),
- llmin((S32)mV[VY] + color.mV[VY], 255),
- llmin((S32)mV[VZ] + color.mV[VZ], 255),
- llmin((S32)mV[VW] + color.mV[VW], 255));
+ return LLColor4U(llmin((S32)mV[VRED] + color.mV[VRED], 255),
+ llmin((S32)mV[VGREEN] + color.mV[VGREEN], 255),
+ llmin((S32)mV[VBLUE] + color.mV[VBLUE], 255),
+ llmin((S32)mV[VALPHA] + color.mV[VALPHA], 255));
}
inline LLColor4U LLColor4U::multAll(const F32 k)
{
// Round to nearest
return LLColor4U(
- (U8)ll_round(mV[VX] * k),
- (U8)ll_round(mV[VY] * k),
- (U8)ll_round(mV[VZ] * k),
- (U8)ll_round(mV[VW] * k));
+ (U8)ll_round(mV[VRED] * k),
+ (U8)ll_round(mV[VGREEN] * k),
+ (U8)ll_round(mV[VBLUE] * k),
+ (U8)ll_round(mV[VALPHA] * k));
}
/*
inline LLColor4U operator*(const LLColor4U &a, U8 k)
{
// only affects rgb (not a!)
return LLColor4U(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4U operator*(U8 k, const LLColor4U &a)
{
// only affects rgb (not a!)
return LLColor4U(
- a.mV[VX] * k,
- a.mV[VY] * k,
- a.mV[VZ] * k,
- a.mV[VW]);
+ a.mV[VRED] * k,
+ a.mV[VGREEN] * k,
+ a.mV[VBLUE] * k,
+ a.mV[VALPHA]);
}
inline LLColor4U operator%(U8 k, const LLColor4U &a)
{
// only affects alpha (not rgb!)
return LLColor4U(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k );
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k );
}
inline LLColor4U operator%(const LLColor4U &a, U8 k)
{
// only affects alpha (not rgb!)
return LLColor4U(
- a.mV[VX],
- a.mV[VY],
- a.mV[VZ],
- a.mV[VW] * k );
+ a.mV[VRED],
+ a.mV[VGREEN],
+ a.mV[VBLUE],
+ a.mV[VALPHA] * k );
}
*/
inline bool operator==(const LLColor4U &a, const LLColor4U &b)
{
- return ( (a.mV[VX] == b.mV[VX])
- &&(a.mV[VY] == b.mV[VY])
- &&(a.mV[VZ] == b.mV[VZ])
- &&(a.mV[VW] == b.mV[VW]));
+ return ( (a.mV[VRED] == b.mV[VRED])
+ &&(a.mV[VGREEN] == b.mV[VGREEN])
+ &&(a.mV[VBLUE] == b.mV[VBLUE])
+ &&(a.mV[VALPHA] == b.mV[VALPHA]));
}
inline bool operator!=(const LLColor4U &a, const LLColor4U &b)
{
- return ( (a.mV[VX] != b.mV[VX])
- ||(a.mV[VY] != b.mV[VY])
- ||(a.mV[VZ] != b.mV[VZ])
- ||(a.mV[VW] != b.mV[VW]));
+ return ( (a.mV[VRED] != b.mV[VRED])
+ ||(a.mV[VGREEN] != b.mV[VGREEN])
+ ||(a.mV[VBLUE] != b.mV[VBLUE])
+ ||(a.mV[VALPHA] != b.mV[VALPHA]));
}
inline const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b)
{
- a.mV[VX] += b.mV[VX];
- a.mV[VY] += b.mV[VY];
- a.mV[VZ] += b.mV[VZ];
- a.mV[VW] += b.mV[VW];
+ a.mV[VRED] += b.mV[VRED];
+ a.mV[VGREEN] += b.mV[VGREEN];
+ a.mV[VBLUE] += b.mV[VBLUE];
+ a.mV[VALPHA] += b.mV[VALPHA];
return a;
}
inline const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b)
{
- a.mV[VX] -= b.mV[VX];
- a.mV[VY] -= b.mV[VY];
- a.mV[VZ] -= b.mV[VZ];
- a.mV[VW] -= b.mV[VW];
+ a.mV[VRED] -= b.mV[VRED];
+ a.mV[VGREEN] -= b.mV[VGREEN];
+ a.mV[VBLUE] -= b.mV[VBLUE];
+ a.mV[VALPHA] -= b.mV[VALPHA];
return a;
}
inline const LLColor4U& operator*=(LLColor4U &a, U8 k)
{
// only affects rgb (not a!)
- a.mV[VX] *= k;
- a.mV[VY] *= k;
- a.mV[VZ] *= k;
+ a.mV[VRED] *= k;
+ a.mV[VGREEN] *= k;
+ a.mV[VBLUE] *= k;
return a;
}
inline const LLColor4U& operator%=(LLColor4U &a, U8 k)
{
// only affects alpha (not rgb!)
- a.mV[VW] *= k;
+ a.mV[VALPHA] *= k;
return a;
}
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index 0ab79c4901..8a356da93a 100644
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -262,10 +262,10 @@ void LLPluginClassMedia::idle(void)
message.setValueS32("height", mRequestedMediaHeight);
message.setValueS32("texture_width", mRequestedTextureWidth);
message.setValueS32("texture_height", mRequestedTextureHeight);
- message.setValueReal("background_r", mBackgroundColor.mV[VX]);
- message.setValueReal("background_g", mBackgroundColor.mV[VY]);
- message.setValueReal("background_b", mBackgroundColor.mV[VZ]);
- message.setValueReal("background_a", mBackgroundColor.mV[VW]);
+ message.setValueReal("background_r", mBackgroundColor.mV[VRED]);
+ message.setValueReal("background_g", mBackgroundColor.mV[VGREEN]);
+ message.setValueReal("background_b", mBackgroundColor.mV[VBLUE]);
+ message.setValueReal("background_a", mBackgroundColor.mV[VALPHA]);
mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue.
LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL;
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp
index 684660e24a..9ebbeac482 100644
--- a/indra/llprimitive/lltextureentry.cpp
+++ b/indra/llprimitive/lltextureentry.cpp
@@ -407,9 +407,9 @@ S32 LLTextureEntry::setColor(const LLColor3 &color)
S32 LLTextureEntry::setAlpha(const F32 alpha)
{
- if (mColor.mV[VW] != alpha)
+ if (mColor.mV[VALPHA] != alpha)
{
- mColor.mV[VW] = alpha;
+ mColor.mV[VALPHA] = alpha;
return TEM_CHANGE_COLOR;
}
return TEM_CHANGE_NONE;
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 7e10a4e159..59ee8ef84f 100644
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -278,7 +278,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
LLColor4U text_color(color);
// Preserve the transparency to render fading emojis in fading text (e.g.
// for the chat console)... HB
- LLColor4U emoji_color(255, 255, 255, text_color.mV[VW]);
+ LLColor4U emoji_color(255, 255, 255, text_color.mV[VALPHA]);
std::pair<EFontGlyphType, S32> bitmap_entry = std::make_pair(EFontGlyphType::Grayscale, -1);
S32 glyph_count = 0;
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index df446a5d70..5e184b5ddb 100644
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -803,9 +803,9 @@ void LLKeywords::dump()
void LLKeywordToken::dump()
{
LL_INFOS() << "[" <<
- mColor.mV[VX] << ", " <<
- mColor.mV[VY] << ", " <<
- mColor.mV[VZ] << "] [" <<
+ mColor.mV[VRED] << ", " <<
+ mColor.mV[VGREEN] << ", " <<
+ mColor.mV[VBLUE] << "] [" <<
wstring_to_utf8str(mToken) << "]" <<
LL_ENDL;
}
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 3a40ea07fb..1d358a0e9d 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -3579,9 +3579,9 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
void LLNormalTextSegment::dump() const
{
LL_INFOS() << "Segment [" <<
-// mColor.mV[VX] << ", " <<
-// mColor.mV[VY] << ", " <<
-// mColor.mV[VZ] << "]\t[" <<
+// mColor.mV[VRED] << ", " <<
+// mColor.mV[VGREEN] << ", " <<
+// mColor.mV[VBLUE] << "]\t[" <<
mStart << ", " <<
getEnd() << "]" <<
LL_ENDL;
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 793d84652b..71b82b77eb 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -256,7 +256,7 @@ void LLDrawPoolWater::renderPostDeferred(S32 pass)
if (mShaderLevel == 1)
{
- fog_color.mV[VW] = log(fog_density) / log(2);
+ fog_color.mV[VALPHA] = log(fog_density) / log(2);
}
F32 water_height = environment.getWaterHeight();
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 21412ca038..f678a3750c 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -1256,24 +1256,24 @@ void LLManipTranslate::renderSnapGuides()
LLVector3 line_end = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) - (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit));
LLVector3 line_mid = (line_start + line_end) * 0.5f;
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA] * 0.2f);
gGL.vertex3fv(line_start.mV);
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA]);
gGL.vertex3fv(line_mid.mV);
gGL.vertex3fv(line_mid.mV);
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA] * 0.2f);
gGL.vertex3fv(line_end.mV);
line_start.setVec(selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) + (translate_axis * guide_size_meters * 0.5f));
line_end.setVec(selection_center + (mSnapOffsetAxis * -mSnapOffsetMeters) - (translate_axis * guide_size_meters * 0.5f));
line_mid = (line_start + line_end) * 0.5f;
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA] * 0.2f);
gGL.vertex3fv(line_start.mV);
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA]);
gGL.vertex3fv(line_mid.mV);
gGL.vertex3fv(line_mid.mV);
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW] * 0.2f);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA] * 0.2f);
gGL.vertex3fv(line_end.mV);
for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++)
@@ -1305,7 +1305,7 @@ void LLManipTranslate::renderSnapGuides()
tick_end = tick_start + (mSnapOffsetAxis * mSnapOffsetMeters * tick_scale);
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA]);
gGL.vertex3fv(tick_start.mV);
gGL.vertex3fv(tick_end.mV);
@@ -1326,7 +1326,7 @@ void LLManipTranslate::renderSnapGuides()
gGL.begin(LLRender::LINES);
{
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA]);
gGL.vertex3fv(line_start.mV);
gGL.vertex3fv(line_end.mV);
@@ -1336,7 +1336,7 @@ void LLManipTranslate::renderSnapGuides()
// draw snap guide arrow
gGL.begin(LLRender::TRIANGLES);
{
- gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]);
+ gGL.color4f(line_color.mV[VRED], line_color.mV[VGREEN], line_color.mV[VBLUE], line_color.mV[VALPHA]);
LLVector3 arrow_dir;
LLVector3 arrow_span = translate_axis;