+if(*r_colormap_palette.string)
+ palfile = (unsigned char *)FS_LoadFile (r_colormap_palette.string, tempmempool, false, &filesize);
+else
+ palfile = NULL;
+
+in = palfile;
+if (palfile && filesize >= 48)
+{
+ out = (unsigned char *) palette_shirtcolormap;
+ for (i = 0;i < 16;i++)
+ {
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = 255;
+ }
+}
+else
+ for(i = 0; i < 16; ++i)
+ palette_shirtcolormap[i] = palette_complete[(i << 4) | ((i >= 8 && i <= 13) ? 0x04 : 0x0C)];
+
+if(palfile && filesize >= 48 + 48)
+{
+ out = (unsigned char *) palette_shirtscoreboard;
+ for (i = 0;i < 16;i++)
+ {
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = 255;
+ }
+}
+else
+ for(i = 0; i < 16; ++i)
+ palette_shirtscoreboard[i] = palette_complete[(i << 4) | 0x08];
+
+if (palfile && filesize >= 48 + 48 + 48)
+{
+ out = (unsigned char *) palette_pantscolormap;
+ for (i = 0;i < 16;i++)
+ {
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = 255;
+ }
+}
+else
+ memcpy(palette_pantscolormap, palette_shirtcolormap, sizeof(palette_pantscolormap));
+
+if (palfile && filesize >= 48 + 48 + 48 + 48)
+{
+ out = (unsigned char *) palette_pantsscoreboard;
+ for (i = 0;i < 16;i++)
+ {
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = texturegammaramp[*in++];
+ *out++ = 255;
+ }
+}
+else
+ memcpy(palette_pantsscoreboard, palette_shirtscoreboard, sizeof(palette_pantsscoreboard));
+
+if(palfile)
+ Mem_Free(palfile);
+