From: terencehill Date: Thu, 11 Jun 2020 19:11:40 +0000 (+0200) Subject: Document colormapPaletteColor and gfx/colormap_palette.pl X-Git-Tag: xonotic-v0.8.5~924 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=b654761694a84d3714332384cfef1ae387c567b7 Document colormapPaletteColor and gfx/colormap_palette.pl --- diff --git a/gfx/colormap_palette.pl b/gfx/colormap_palette.pl index 07ad2de114..dc99b64990 100644 --- a/gfx/colormap_palette.pl +++ b/gfx/colormap_palette.pl @@ -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: $_"; diff --git a/qcsrc/lib/color.qh b/qcsrc/lib/color.qh index 6f7a7326de..3a3a61fe33 100644 --- a/qcsrc/lib/color.qh +++ b/qcsrc/lib/color.qh @@ -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';