/* Copyright (C) 1996-1997 Id Software, Inc. Copyright (C) 1999,2000 contributors of the QuakeForge project Please see the file "AUTHORS" for a list of contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // view.c -- player eye positioning #include "qtypes.h" #include "quakedef.h" #include "r_local.h" #include "glquake.h" #include "view.h" extern int onground; /* ============= V_UpdatePalette ============= */ void V_UpdatePalette (void) { int i, j; qboolean new; byte *basepal, *newpal; byte pal[768]; float r,g,b,a; int ir, ig, ib; qboolean force; V_CalcPowerupCshift (); new = false; for (i=0 ; i 255) ir = 255; if (ig > 255) ig = 255; if (ib > 255) ib = 255; ramps[0][i] = gammatable[ir]; ramps[1][i] = gammatable[ig]; ramps[2][i] = gammatable[ib]; } basepal = host_basepal; newpal = pal; for (i=0 ; i<256 ; i++) { ir = basepal[0]; ig = basepal[1]; ib = basepal[2]; basepal += 3; newpal[0] = ramps[0][ir]; newpal[1] = ramps[1][ig]; newpal[2] = ramps[2][ib]; newpal += 3; } VID_ShiftPalette (pal); }