mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Add a new misc.c function needed by Slide's colour setup.
[originally from svn r7552]
This commit is contained in:
11
misc.c
11
misc.c
@ -167,14 +167,12 @@ unsigned char *hex2bin(const char *in, int outlen)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void game_mkhighlight(frontend *fe, float *ret,
|
void game_mkhighlight_specific(frontend *fe, float *ret,
|
||||||
int background, int highlight, int lowlight)
|
int background, int highlight, int lowlight)
|
||||||
{
|
{
|
||||||
float max;
|
float max;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
frontend_default_colour(fe, &ret[background * 3]);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Drop the background colour so that the highlight is
|
* Drop the background colour so that the highlight is
|
||||||
* noticeably brighter than it while still being under 1.
|
* noticeably brighter than it while still being under 1.
|
||||||
@ -194,6 +192,13 @@ void game_mkhighlight(frontend *fe, float *ret,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void game_mkhighlight(frontend *fe, float *ret,
|
||||||
|
int background, int highlight, int lowlight)
|
||||||
|
{
|
||||||
|
frontend_default_colour(fe, &ret[background * 3]);
|
||||||
|
game_mkhighlight_specific(fe, ret, background, highlight, lowlight);
|
||||||
|
}
|
||||||
|
|
||||||
static void memswap(void *av, void *bv, int size)
|
static void memswap(void *av, void *bv, int size)
|
||||||
{
|
{
|
||||||
char tmpbuf[512];
|
char tmpbuf[512];
|
||||||
|
@ -280,6 +280,10 @@ unsigned char *hex2bin(const char *in, int outlen);
|
|||||||
* and auto-generates highlight and lowlight colours too. */
|
* and auto-generates highlight and lowlight colours too. */
|
||||||
void game_mkhighlight(frontend *fe, float *ret,
|
void game_mkhighlight(frontend *fe, float *ret,
|
||||||
int background, int highlight, int lowlight);
|
int background, int highlight, int lowlight);
|
||||||
|
/* As above, but starts from a provided background colour rather
|
||||||
|
* than the frontend default. */
|
||||||
|
void game_mkhighlight_specific(frontend *fe, float *ret,
|
||||||
|
int background, int highlight, int lowlight);
|
||||||
|
|
||||||
/* Randomly shuffles an array of items. */
|
/* Randomly shuffles an array of items. */
|
||||||
void shuffle(void *array, int nelts, int eltsize, random_state *rs);
|
void shuffle(void *array, int nelts, int eltsize, random_state *rs);
|
||||||
|
Reference in New Issue
Block a user