From 383854430bc3b6b812d8e41ff5ab0e4ed77b0d48 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Thu, 19 Sep 2019 15:17:52 -0700 Subject: [PATCH] automatically generate a GIMP-compatible palette file Either `make gimp-palette` or `make doom.gpl` will convert the playpal lump into a file that can be imported into GIMP for paletted image modes. --- .gitignore | 1 + Makefile | 8 +++++++- lumps/playpal/Makefile | 4 ++++ lumps/playpal/README | 3 +++ lumps/playpal/gen-gimp-palette | 14 ++++++++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 lumps/playpal/gen-gimp-palette diff --git a/.gitignore b/.gitignore index cf9c2adb..f6497d32 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ .\#* \#*\# wad*.txt +doom.gpl # Per directory patterns to ignore. These do not apply recursively to # subdirectories. Each line should begin with "[!]/". Please keep the diff --git a/Makefile b/Makefile index 891736c8..aa494e81 100644 --- a/Makefile +++ b/Makefile @@ -102,8 +102,14 @@ else JSON=$(JSON) VERSION=$(VERSION) scripts/makejson endif +doom.gpl: lumps/playpal/playpal-base.lmp + $(MAKE) -C lumps/playpal $@ + mv lumps/playpal/$@ . + +gimp-palette: doom.gpl + clean: wad-image-clean - $(RM) *.html $(OBJS) \ + $(RM) *.html doom.gpl $(OBJS) \ ./COPYING.txt ./CREDITS.txt \ ./wadinfo_phase1.txt \ ./wadinfo_phase2.txt \ diff --git a/lumps/playpal/Makefile b/lumps/playpal/Makefile index b296de4c..14c01d47 100644 --- a/lumps/playpal/Makefile +++ b/lumps/playpal/Makefile @@ -2,7 +2,11 @@ playpal.lmp: playpal-base.lmp playpal ./playpal playpal-base.lmp > playpal.lmp cp playpal.lmp ../ +doom.gpl: playpal-base.lmp + ./gen-gimp-palette + clean: $(RM) playpal.lmp ../playpal.lmp + $(RM) doom.gpl .PHONY: clean diff --git a/lumps/playpal/README b/lumps/playpal/README index c3c12cdd..483c60d0 100644 --- a/lumps/playpal/README +++ b/lumps/playpal/README @@ -13,3 +13,6 @@ The input for the script is playpal-base.lmp which contains the default palette seen during normal gameplay. The script translates this palette into the various other forms which are shown in different situations. +There is additionally a “gen-gimp-palette” script that may be used to +create a “doom.gpl” file suitable for importing into GIMP’s palette +selection. diff --git a/lumps/playpal/gen-gimp-palette b/lumps/playpal/gen-gimp-palette new file mode 100755 index 00000000..4423045a --- /dev/null +++ b/lumps/playpal/gen-gimp-palette @@ -0,0 +1,14 @@ +#!/bin/sh + +# Generates a file suitable for importing into GIMP based on +# playpal-base.lmp, and placed into doom.gpl + +# File header +cat > doom.gpl <> doom.gpl