]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Document colormapPaletteColor and gfx/colormap_palette.pl
authorterencehill <piuntn@gmail.com>
Thu, 11 Jun 2020 19:11:40 +0000 (21:11 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 11 Jun 2020 19:11:40 +0000 (21:11 +0200)
gfx/colormap_palette.pl
qcsrc/lib/color.qh

index 07ad2de1142c640f30c387b969c2f97d86523c5e..dc99b649904ef88c1ba7e27ff405d114619d01a5 100644 (file)
@@ -42,6 +42,9 @@ my $value_max = 0xFF;
 my $i = 0;
 my $pal_colormap = "";
 my $pal_scoreboard = "";
+print STDERR "\nPaste these cases into the qc colormapPaletteColor function\n\n";
+
+print STDERR "\t\t// generated by gfx/colormap_palette.pl\n";
 for(@colors)
 {
        /^(..)(..)(..)$/ or die "invalid color spec: $_";
index 6f7a7326de41f5cce1953dc26a5ac27aa933296d..3a3a61fe33731b1ad0116acce5ba5ac2982d826c 100644 (file)
@@ -6,8 +6,14 @@
 ERASEABLE
 vector colormapPaletteColor_(int c, bool isPants, float t)
 {
+       // these colors are defined in gfx/colormap_palette.pl
+       // to generate them run: perl gfx/colormap_palette.pl > gfx/colormap_palette.lmp
+       // it will save them to gfx/colormap_palette.lmp (in the lmp format)
+       // and prints the cases of the following switch so they can be copy-pasted here
+
        switch (c)
        {
+               // generated by gfx/colormap_palette.pl
                case  0: return '1.000000 1.000000 1.000000';
                case  1: return '1.000000 0.333333 0.000000';
                case  2: return '0.000000 1.000000 0.501961';