Browse Source

image: remove "color" typedef since we already have the "Color" class, and rename a few things.

undefined
Sam Hocevar 10 years ago
parent
commit
40fe753e4f
4 changed files with 19 additions and 25 deletions
  1. +6
    -6
      src/debug/lines.cpp
  2. +11
    -11
      src/image/color/color.cpp
  3. +0
    -7
      src/lol/base/types.h
  4. +2
    -1
      src/lol/image/color.h

+ 6
- 6
src/debug/lines.cpp View File

@@ -140,16 +140,16 @@ void Debug::DrawGrid(vec3 pos, vec3 x, vec3 y, vec3 z, float size, bool draw_3d)
if (i != 0)
{
float iter = seg_sz * ((float)i);
Debug::DrawLine(vec3(-size, 0, iter), vec3(size, 0, iter), Color::gray_dark);
Debug::DrawLine(vec3(iter, 0, -size), vec3(iter, 0, size), Color::gray_dark);
Debug::DrawLine(vec3(-size, 0, iter), vec3(size, 0, iter), Color::dark_gray);
Debug::DrawLine(vec3(iter, 0, -size), vec3(iter, 0, size), Color::dark_gray);

if (draw_3d)
{
Debug::DrawLine(vec3(0, -size, iter), vec3(0, size, iter), Color::gray_dark);
Debug::DrawLine(vec3(0, iter, -size), vec3(0, iter, size), Color::gray_dark);
Debug::DrawLine(vec3(0, -size, iter), vec3(0, size, iter), Color::dark_gray);
Debug::DrawLine(vec3(0, iter, -size), vec3(0, iter, size), Color::dark_gray);

Debug::DrawLine(vec3(-size, iter, 0), vec3(size, iter, 0), Color::gray_dark);
Debug::DrawLine(vec3(iter, -size, 0), vec3(iter, size, 0), Color::gray_dark);
Debug::DrawLine(vec3(-size, iter, 0), vec3(size, iter, 0), Color::dark_gray);
Debug::DrawLine(vec3(iter, -size, 0), vec3(iter, size, 0), Color::dark_gray);
}
}
}


+ 11
- 11
src/image/color/color.cpp View File

@@ -16,17 +16,17 @@ namespace lol
/*
* Hardcoded constants for colours
*/
vec4 const Color::black = vec4(0, 0, 0, 1);
vec4 const Color::red = vec4(1, 0, 0, 1);
vec4 const Color::green = vec4(0, 1, 0, 1);
vec4 const Color::yellow = vec4(1, 1, 0, 1);
vec4 const Color::blue = vec4(0, 0, 1, 1);
vec4 const Color::magenta = vec4(1, 0, 1, 1);
vec4 const Color::cyan = vec4(0, 1, 1, 1);
vec4 const Color::white = vec4(1, 1, 1, 1);
vec4 const Color::gray_dark = vec4(.25f, .25f, .25f, 1);
vec4 const Color::gray = vec4(.5f, .5f, .5f, 1);
vec4 const Color::gray_light= vec4(.75f, .75f, .75f, 1);
vec4 const Color::black = vec4(0, 0, 0, 1);
vec4 const Color::red = vec4(1, 0, 0, 1);
vec4 const Color::green = vec4(0, 1, 0, 1);
vec4 const Color::yellow = vec4(1, 1, 0, 1);
vec4 const Color::blue = vec4(0, 0, 1, 1);
vec4 const Color::magenta = vec4(1, 0, 1, 1);
vec4 const Color::cyan = vec4(0, 1, 1, 1);
vec4 const Color::white = vec4(1, 1, 1, 1);
vec4 const Color::dark_gray = vec4(.25f, .25f, .25f, 1);
vec4 const Color::gray = vec4(.5f, .5f, .5f, 1);
vec4 const Color::light_gray = vec4(.75f, .75f, .75f, 1);

/*
* Conversion from colours to hexadecimal


+ 0
- 7
src/lol/base/types.h View File

@@ -92,13 +92,6 @@ _T(dualquat_t<, >, dualquat)
#undef _C
#undef _T

/*
* Practical useage typedefs
*/
typedef vec4 color;
typedef vec2 spheric2;
typedef vec3 spheric3;

/*
* HLSL/Cg-compliant type names
*/


+ 2
- 1
src/lol/image/color.h View File

@@ -348,7 +348,8 @@ public:
/*
* Some predefined colours
*/
static const vec4 black, red, green, yellow, blue, magenta, cyan, white, gray_dark, gray, gray_light;
static const vec4 black, red, green, yellow, blue, magenta,
cyan, white, dark_gray, gray, light_gray;
};

} /* namespace lol */


Loading…
Cancel
Save