Browse Source

Converted spaces to tabs.

shared-context
Doug Binks 11 years ago
parent
commit
466ab4b19a
2 changed files with 24 additions and 24 deletions
  1. +16
    -16
      src/nanovg.c
  2. +8
    -8
      src/nanovg.h

+ 16
- 16
src/nanovg.c View File

@@ -285,8 +285,8 @@ struct NVGcolor nvgRGB(unsigned char r, unsigned char g, unsigned char b)


struct NVGcolor nvgRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) struct NVGcolor nvgRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
{ {
struct NVGcolor color = {r/255.0f, g/255.0f, b/255.0f, a/255.0f};
return color;
struct NVGcolor color = {r/255.0f, g/255.0f, b/255.0f, a/255.0f};
return color;
} }


struct NVGcolor nvgTransRGBA(struct NVGcolor c, unsigned char a) struct NVGcolor nvgTransRGBA(struct NVGcolor c, unsigned char a)
@@ -297,16 +297,16 @@ struct NVGcolor nvgTransRGBA(struct NVGcolor c, unsigned char a)


struct NVGcolor nvgLerpRGBA(struct NVGcolor c0, struct NVGcolor c1, float u) struct NVGcolor nvgLerpRGBA(struct NVGcolor c0, struct NVGcolor c1, float u)
{ {
int i;
float oneminu;
struct NVGcolor cint;
int i;
float oneminu;
struct NVGcolor cint;


u = nvg__clampf(u, 0.0f, 1.0f); u = nvg__clampf(u, 0.0f, 1.0f);
oneminu = 1.0f - u;
for( i = 0; i <4; ++i )
{
cint.rgba[i] = c0.rgba[i] * oneminu + c1.rgba[i] * u;
}
oneminu = 1.0f - u;
for( i = 0; i <4; ++i )
{
cint.rgba[i] = c0.rgba[i] * oneminu + c1.rgba[i] * u;
}
return cint; return cint;
} }
@@ -342,17 +342,17 @@ struct NVGcolor nvgHSLA(float h, float s, float l, unsigned char a)
col.r = nvg__clampf(nvg__hue(h + 1.0f/3.0f, m1, m2), 0.0f, 1.0f); col.r = nvg__clampf(nvg__hue(h + 1.0f/3.0f, m1, m2), 0.0f, 1.0f);
col.g = nvg__clampf(nvg__hue(h, m1, m2), 0.0f, 1.0f); col.g = nvg__clampf(nvg__hue(h, m1, m2), 0.0f, 1.0f);
col.b = nvg__clampf(nvg__hue(h - 1.0f/3.0f, m1, m2), 0.0f, 1.0f); col.b = nvg__clampf(nvg__hue(h - 1.0f/3.0f, m1, m2), 0.0f, 1.0f);
col.a = a/255.0f;
col.a = a/255.0f;
return col; return col;
} }


int nvgIsBlack( struct NVGcolor col ) int nvgIsBlack( struct NVGcolor col )
{ {
if( col.r == 0.0f && col.g == 0.0f && col.b == 0.0f && col.a == 0.0f )
{
return 1;
}
return 0;
if( col.r == 0.0f && col.g == 0.0f && col.b == 0.0f && col.a == 0.0f )
{
return 1;
}
return 0;
} }


static struct NVGstate* nvg__getState(struct NVGcontext* ctx) static struct NVGstate* nvg__getState(struct NVGcontext* ctx)


+ 8
- 8
src/nanovg.h View File

@@ -29,14 +29,14 @@ struct NVGcontext;


struct NVGcolor struct NVGcolor
{ {
union
{
float rgba[4];
struct
{
float r,g,b,a;
};
};
union
{
float rgba[4];
struct
{
float r,g,b,a;
};
};
}; };


struct NVGpaint struct NVGpaint


Loading…
Cancel
Save