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: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b654761694a84d3714332384cfef1ae387c567b7;p=xonotic%2Fxonotic-data.pk3dir.git Document colormapPaletteColor and gfx/colormap_palette.pl --- diff --git a/gfx/colormap_palette.pl b/gfx/colormap_palette.pl index 07ad2de11..dc99b6499 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 6f7a7326d..3a3a61fe3 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';