Add a new misc.c function needed by Slide's colour setup.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 7 May 2007 17:50:14 +0000 (17:50 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 7 May 2007 17:50:14 +0000 (17:50 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@7552 cda61777-01e9-0310-a592-d414129be87e

misc.c
puzzles.h

diff --git a/misc.c b/misc.c
index 8f5314c..d3ab815 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -167,14 +167,12 @@ unsigned char *hex2bin(const char *in, int outlen)
     return ret;
 }
 
-void game_mkhighlight(frontend *fe, float *ret,
-                      int background, int highlight, int lowlight)
+void game_mkhighlight_specific(frontend *fe, float *ret,
+                              int background, int highlight, int lowlight)
 {
     float max;
     int i;
 
-    frontend_default_colour(fe, &ret[background * 3]);
-
     /*
      * Drop the background colour so that the highlight is
      * 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)
 {
     char tmpbuf[512];
index 3785772..9b69d1b 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -280,6 +280,10 @@ unsigned char *hex2bin(const char *in, int outlen);
  * and auto-generates highlight and lowlight colours too. */
 void game_mkhighlight(frontend *fe, float *ret,
                       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. */
 void shuffle(void *array, int nelts, int eltsize, random_state *rs);