From b654761694a84d3714332384cfef1ae387c567b7 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 11 Jun 2020 21:11:40 +0200 Subject: [PATCH] Document colormapPaletteColor and gfx/colormap_palette.pl --- gfx/colormap_palette.pl | 3 +++ qcsrc/lib/color.qh | 6 ++++++ 2 files changed, 9 insertions(+) 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'; -- 2.39.2