diff --git a/analogue.c b/analogue.c index 06126c4..a498920 100644 --- a/analogue.c +++ b/analogue.c @@ -219,7 +219,7 @@ int main(int argc, char** argv) if (repaint) { // background - SetDrawColour(MKGREY(0x1F, 0xFF)); + SetDrawColour(GREY1); DrawClear(); const int hrw = rendSize.w / 2; @@ -233,7 +233,7 @@ int main(int argc, char** argv) plrpos.x = pfmod(plrpos.x, rendSize.w); plrpos.y = pfmod(plrpos.y, rendSize.h); - SetDrawColour(0xFF0000FF); + SetDrawColour(AVATAR); const int plrSz = 32; DrawRect( (int)plrpos.x - plrSz / 2, diff --git a/stick.c b/stick.c index 5e2fd56..b43e2c4 100644 --- a/stick.c +++ b/stick.c @@ -73,7 +73,7 @@ void DrawAnalogue(const rect* win, StickState* p) double size = (double)(win->w > win->h ? win->h : win->w) * DISPLAY_SCALE; // range rect - SetDrawColour(MKGREY(0x3F, 0xFF)); + SetDrawColour(GREY3); const int rectSz = (int)round(size); DrawRect( win->x + (win->w - rectSz) / 2, @@ -84,7 +84,7 @@ void DrawAnalogue(const rect* win, StickState* p) const int oy = win->y + win->h / 2; // acceleration curve - SetDrawColour(MKGREY(0x4F, 0xFF)); + SetDrawColour(GREY4); const int accelsamp = (int)(sqrt(size) * 4.20); const double step = 1.0 / (double)accelsamp; double y1 = AccelCurve(0.0, p->accelpow); @@ -100,13 +100,13 @@ void DrawAnalogue(const rect* win, StickState* p) } const int tickerx = (int)((p->preaccel - 0.5) * size); const int tickery = (int)((0.5 - p->postacel) * size); - SetDrawColour(0x2F3F1FFF); + SetDrawColour(HILIGHT_PU1); DrawLine( ox + tickerx, win->y + (win->h - (int)round(size)) / 2, ox + tickerx, win->y + (win->h + (int)round(size)) / 2); - SetDrawColour(0x2F5F2FFF); + SetDrawColour(HILIGHT_PU2); DrawLine( win->x + (win->w - (int)round(size)) / 2, oy + tickery, @@ -114,14 +114,14 @@ void DrawAnalogue(const rect* win, StickState* p) oy + tickery); // guide circle - SetDrawColour(MKGREY(0x4F, 0xFF)); + SetDrawColour(GREY4); DrawCircle(ox, oy, (int)round(size) / 2); - SetDrawColour(MKGREY(0x3F, 0xFF)); + SetDrawColour(GREY3); DrawCircle(ox, oy, (int)round(p->deadzone * size) / 2); // 0,0 line axis' - SetDrawColour(MKGREY(0x2F, 0xFF)); + SetDrawColour(GREY2); DrawLine( win->x, oy, win->x + win->w, oy); @@ -130,7 +130,7 @@ void DrawAnalogue(const rect* win, StickState* p) ox, win->y + win->h); // compensated position - SetDrawColour(0x1FFF1FFF); + SetDrawColour(HILIGHT_PU3); DrawCircleSteps( ox + (int)round(p->compos.x * size / 2.0), oy + (int)round(p->compos.y * size / 2.0), @@ -164,7 +164,7 @@ void DrawDigital(const rect* win, StickState* p) const double size = (double)(win->w > win->h ? win->h : win->w) * DISPLAY_SCALE; // range rect - SetDrawColour(MKGREY(0x3F, 0xFF)); + SetDrawColour(GREY3); const int rectSz = (int)round(size); DrawRect( win->x + (win->w - rectSz) / 2, @@ -176,11 +176,11 @@ void DrawDigital(const rect* win, StickState* p) const int oy = win->y + win->h / 2; // guide circle - SetDrawColour(MKGREY(0x4F, 0xFF)); + SetDrawColour(GREY4); DrawCircle(ox, oy, (int)round(size) / 2); // 0,0 line axis' - SetDrawColour(MKGREY(0x2F, 0xFF)); + SetDrawColour(GREY2); DrawLine( win->x, oy, win->x + win->w, oy); @@ -195,7 +195,7 @@ void DrawDigital(const rect* win, StickState* p) const int innh = (int)round(p->digideadzone * size / 2.0); const int innq = (int)round(p->digideadzone * size / 2.0 * p->digiangle); - SetDrawColour(MKGREY(0x3F, 0xFF)); + SetDrawColour(GREY3); // angles preview DrawLine(ox - outq, oy - outh, ox - innq, oy - innh); @@ -219,7 +219,7 @@ void DrawDigital(const rect* win, StickState* p) DrawLine(ox - innh, oy - innq, ox - innq, oy - innh); // compensated position - SetDrawColour(0x1FFF1FFF); + SetDrawColour(HILIGHT_GR3); DrawCircleSteps( ox + (int)round(p->compos.x * size / 2.0), oy + (int)round(p->compos.y * size / 2.0), diff --git a/util.h b/util.h index 8e1f3f3..b3e2d88 100644 --- a/util.h +++ b/util.h @@ -18,5 +18,16 @@ typedef struct { int x, y, w, h; } rect; ((A) & 0x000000FF)) #define WHITE 0xFFFFFFFF +#define GREY1 MKGREY(0x1F, 0xFF) +#define GREY2 MKGREY(0x47, 0xFF) +#define GREY3 MKGREY(0x67, 0xFF) +#define GREY4 MKGREY(0x83, 0xFF) +#define HILIGHT_GR1 0x2F3F1FFF +#define HILIGHT_GR2 0x2F5F2FFF +#define HILIGHT_GR3 0x1FFF1FFF +#define HILIGHT_PU1 0x632E63FF +#define HILIGHT_PU2 0x8A418AFF +#define HILIGHT_PU3 0xFF68FFFF +#define AVATAR 0xFF3333FF #endif//UTIL_H