mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
New tool: qflmp
Stupid little lump tool, converts from lmp to pcx and back. qflmp -h for help.
This commit is contained in:
parent
68b5db87b2
commit
dfbbda37af
6 changed files with 672 additions and 2 deletions
|
@ -60,6 +60,7 @@
|
|||
tools/qflight/Makefile
|
||||
tools/qflight/include/Makefile
|
||||
tools/qflight/source/Makefile
|
||||
tools/qflmp/Makefile
|
||||
tools/qfmodelgen/Makefile
|
||||
tools/qfmodelgen/include/Makefile
|
||||
tools/qfmodelgen/source/Makefile
|
||||
|
|
|
@ -15,7 +15,7 @@ QF_WITH_TARGETS(
|
|||
QF_WITH_TARGETS(
|
||||
tools,
|
||||
[ --with-tools=<list> compile qf tools:],
|
||||
[bsp2img,carne,gsc,pak,qfbsp,qfcc,qflight,qfmodelgen,qfvis,qwaq,wad,wav],dummy
|
||||
[bsp2img,carne,gsc,pak,qfbsp,qfcc,qflight,qflmp,qfmodelgen,qfvis,qwaq,wad,wav],dummy
|
||||
)
|
||||
|
||||
unset CL_TARGETS
|
||||
|
@ -232,6 +232,9 @@ fi
|
|||
if test "x$ENABLE_tools_qflight" = xyes; then
|
||||
TOOLS_TARGETS="$TOOLS_TARGETS qflight"
|
||||
fi
|
||||
if test "x$ENABLE_tools_qflmp" = xyes; then
|
||||
TOOLS_TARGETS="$TOOLS_TARGETS qflmp"
|
||||
fi
|
||||
if test "x$ENABLE_tools_qfmodelgen" = xyes; then
|
||||
TOOLS_TARGETS="$TOOLS_TARGETS qfmodelgen"
|
||||
fi
|
||||
|
@ -255,6 +258,7 @@ AM_CONDITIONAL(BUILD_PAK, test "$ENABLE_tools_pak" = "yes")
|
|||
AM_CONDITIONAL(BUILD_QFBSP, test "$ENABLE_tools_qfbsp" = "yes")
|
||||
AM_CONDITIONAL(BUILD_QFCC, test "$ENABLE_tools_qfcc" = "yes")
|
||||
AM_CONDITIONAL(BUILD_QFLIGHT, test "$ENABLE_tools_qflight" = "yes")
|
||||
AM_CONDITIONAL(BUILD_QFLMP, test "$ENABLE_tools_qflmp" = "yes")
|
||||
AM_CONDITIONAL(BUILD_QFMODELGEN, test "$ENABLE_tools_qfmodelgen" = "yes")
|
||||
AM_CONDITIONAL(BUILD_QFVIS, test "$ENABLE_tools_qfvis" = "yes")
|
||||
AM_CONDITIONAL(BUILD_QWAQ, test "$ENABLE_tools_qwaq" = "yes" -a "$ENABLE_tools_qfcc" = "yes")
|
||||
|
@ -533,6 +537,11 @@ QF_DEPS(QFLIGHT,
|
|||
[$(top_builddir)/libs/util/libQFutil.la],
|
||||
[$(WIN32_LIBS)],
|
||||
)
|
||||
QF_DEPS(QFLMP,
|
||||
[],
|
||||
[$(top_builddir)/libs/image/libQFimage.la $(top_builddir)/libs/util/libQFutil.la],
|
||||
[$(WIN32_LIBS)],
|
||||
)
|
||||
QF_DEPS(QFMODELGEN,
|
||||
[-I$(top_srcdir)/tools/qfmodelgen/include],
|
||||
[$(top_builddir)/libs/util/libQFutil.la],
|
||||
|
|
|
@ -1 +1 @@
|
|||
SUBDIRS=bsp2img carne pak qfbsp qfcc qflight qfmodelgen qfvis qwaq wad wav
|
||||
SUBDIRS=bsp2img carne pak qfbsp qfcc qflight qflmp qfmodelgen qfvis qwaq wad wav
|
||||
|
|
26
tools/qflmp/Makefile.am
Normal file
26
tools/qflmp/Makefile.am
Normal file
|
@ -0,0 +1,26 @@
|
|||
AUTOMAKE_OPTIONS= foreign
|
||||
|
||||
QFLMP_LIBS=@QFLMP_LIBS@
|
||||
QFLMP_DEPS=@QFLMP_DEPS@
|
||||
QFLMP_INCS=@QFLMP_INCS@
|
||||
|
||||
INCLUDES= -I$(top_srcdir)/include $(QFLMP_INCS)
|
||||
|
||||
if BUILD_QFLMP
|
||||
qflmp=qflmp
|
||||
#mans=qflmp.1
|
||||
else
|
||||
wad=
|
||||
#mans=
|
||||
endif
|
||||
|
||||
bin_PROGRAMS= $(qflmp)
|
||||
EXTRA_PROGRAMS= qflmp
|
||||
|
||||
man_MANS= $(mans)
|
||||
|
||||
qflmp_SOURCES= lmp.c
|
||||
qflmp_LDADD= $(QFLMP_LIBS)
|
||||
qflmp_DEPENDENCIES= $(QFLMP_DEPS)
|
||||
|
||||
EXTRA_DIST= lmp.h #lmp.1
|
437
tools/qflmp/lmp.c
Normal file
437
tools/qflmp/lmp.c
Normal file
|
@ -0,0 +1,437 @@
|
|||
/*
|
||||
lmp.c
|
||||
|
||||
lump file tool
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 2002 Bill Currie <bill@taniwha.org>
|
||||
Copyright (C) 2002,2011 Jeff Teunissen <deek@quakeforge.net>
|
||||
|
||||
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:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
*/
|
||||
/*
|
||||
read 4 bytes -> width
|
||||
read 4 bytes -> height
|
||||
width * height bytes
|
||||
no attached palette
|
||||
*/
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <QF/cmd.h>
|
||||
#include <QF/cvar.h>
|
||||
#include <QF/image.h>
|
||||
#include <QF/pcx.h>
|
||||
#include <QF/qtypes.h>
|
||||
#include <QF/qendian.h>
|
||||
#include <QF/quakeio.h>
|
||||
#include <QF/sys.h>
|
||||
#include <QF/zone.h>
|
||||
|
||||
#include "lmp.h"
|
||||
|
||||
#define MEMSIZE (8 * 1024 * 1024)
|
||||
|
||||
const char *this_program;
|
||||
|
||||
options_t options;
|
||||
Pixel *palette;
|
||||
|
||||
static const struct option long_options[] = {
|
||||
{"export", no_argument, 0, 'e'},
|
||||
{"import", no_argument, 0, 'i'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"version", no_argument, 0, 'V'},
|
||||
{"geometry", required_argument, 0, 'g'},
|
||||
{"geometry", required_argument, 0, 'g'},
|
||||
{"palette", required_argument, 0, 'p'},
|
||||
{"raw", no_argument, 0, 'r'},
|
||||
{"quiet", no_argument, 0, 'q'},
|
||||
{"verbose", no_argument, 0, 'v'},
|
||||
{NULL, 0, NULL, 0},
|
||||
};
|
||||
|
||||
|
||||
char *
|
||||
replaceExtension (const char *oldstr, const char *extension)
|
||||
{
|
||||
char *tmp = strdup (oldstr);
|
||||
char *blank = strrchr (tmp, '.');
|
||||
char *newstr;
|
||||
|
||||
*blank = 0;
|
||||
asprintf (&newstr, "%s.%s", tmp, extension);
|
||||
free (tmp);
|
||||
return newstr;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
usage (int status)
|
||||
{
|
||||
Sys_Printf ("%s - QuakeForge Lump tool\n", this_program);
|
||||
Sys_Printf ("Usage: %s <command> [options] [FILE...]\n", this_program);
|
||||
|
||||
Sys_Printf ("Commands:\n"
|
||||
" -e, --export Export lump to PCX\n"
|
||||
" -i, --import Import lump from PCX\n"
|
||||
" -h, --help Display this help and exit\n"
|
||||
" -V, --version Output version information and exit\n\n");
|
||||
|
||||
Sys_Printf ("Options:\n"
|
||||
" -g, --geometry WIDTHxHEIGHT Ignore geometry for image data\n"
|
||||
" (Warning: does not check validity of input)\n"
|
||||
" -p, --palette FILE Use palette FILE for conversion\n"
|
||||
" -r, --raw File(s) are raw (no lump header)\n"
|
||||
" (must use --geometry to be useful)\n"
|
||||
" -q, --quiet Inhibit usual output\n"
|
||||
" -v, --verbose Display more output than usual\n");
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
||||
qboolean
|
||||
exportFile (const char *inpath)
|
||||
{
|
||||
char *outpath = replaceExtension (inpath, "pcx");
|
||||
QFile *infile = Qopen (inpath, "rb");
|
||||
QFile *outfile = Qopen (outpath, "wb");
|
||||
int fsize = Qfilesize (infile);
|
||||
pcx_t *pcx;
|
||||
int pcx_size;
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
void *data;
|
||||
qboolean ret = false;
|
||||
|
||||
if (options.verbosity > 1)
|
||||
Sys_Printf ("file size: %d\n", fsize);
|
||||
|
||||
if (options.raw) {
|
||||
width = options.width;
|
||||
height = options.height;
|
||||
if (width <= 0 || height <= 0) {
|
||||
Sys_Printf ("%s: cowardly refusing to write a raw image with no geometry\n",
|
||||
this_program);
|
||||
goto die;
|
||||
}
|
||||
} else {
|
||||
Qread (infile, &width, sizeof (width));
|
||||
Qread (infile, &height, sizeof (height));
|
||||
fsize -= 8;
|
||||
if (options.width > 0 && options.height > 0) {
|
||||
width = options.width;
|
||||
height = options.height;
|
||||
} else {
|
||||
width = LittleLong (width);
|
||||
height = LittleLong (height);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.verbosity > 1)
|
||||
Sys_Printf ("dimensions: %dx%d\n", width, height);
|
||||
|
||||
if (options.verbosity > 1)
|
||||
Sys_Printf ("data size: %d\n", fsize);
|
||||
|
||||
if ((width * height) > fsize) {
|
||||
Sys_Printf ("%s: %s: not enough image data for a %dx%d image.\n",
|
||||
this_program, inpath, width, height);
|
||||
goto die;
|
||||
}
|
||||
|
||||
data = malloc (fsize);
|
||||
Qread (infile, data, fsize);
|
||||
|
||||
pcx = EncodePCX (data, width, height, width, (byte *) palette, false, &pcx_size);
|
||||
free (data);
|
||||
|
||||
if (options.verbosity > 1)
|
||||
Sys_Printf ("PCX data size: %d\n", pcx_size);
|
||||
|
||||
if (Qwrite (outfile, pcx, pcx_size) != pcx_size) {
|
||||
Sys_Printf ("%s: Error writing to %s\n", this_program, outpath);
|
||||
goto die;
|
||||
}
|
||||
ret = true;
|
||||
|
||||
die:
|
||||
if (outpath)
|
||||
free (outpath);
|
||||
|
||||
Qclose (infile);
|
||||
Qclose (outfile);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
qboolean
|
||||
importFile (const char *inpath)
|
||||
{
|
||||
char *outpath = replaceExtension (inpath, "lmp");
|
||||
QFile *infile = Qopen (inpath, "rb");
|
||||
QFile *outfile = Qopen (outpath, "wb");
|
||||
int fsize = Qfilesize (infile);
|
||||
tex_t *lmp;
|
||||
qboolean ret = false;
|
||||
|
||||
if (options.verbosity > 1)
|
||||
Sys_Printf ("PCX file size: %d\n", fsize);
|
||||
|
||||
lmp = LoadPCX (infile, false, NULL);
|
||||
|
||||
if (!lmp) {
|
||||
Sys_Printf ("%s: Failed to load %s as texture.\n",
|
||||
this_program, inpath);
|
||||
goto die;
|
||||
}
|
||||
|
||||
if (lmp->format != tex_palette) {
|
||||
Sys_Printf ("%s: %s is not a paletted image.\n", this_program, inpath);
|
||||
goto die;
|
||||
} else { // got a paletted image
|
||||
int32_t width = lmp->width;
|
||||
int32_t height = lmp->height;
|
||||
int lmp_size = width * height;
|
||||
|
||||
if (options.verbosity > 1)
|
||||
Sys_Printf ("geometry: %dx%d\ndata size: %d\n",
|
||||
width, height, lmp_size);
|
||||
|
||||
if (!options.raw) { // write lump header
|
||||
Qwrite (outfile, &width, sizeof (width));
|
||||
Qwrite (outfile, &height, sizeof (height));
|
||||
}
|
||||
|
||||
if (Qwrite (outfile, lmp->data, lmp_size) != lmp_size) {
|
||||
Sys_Printf ("%s: Error writing to %s\n", this_program, outpath);
|
||||
goto die;
|
||||
}
|
||||
ret = true;
|
||||
}
|
||||
|
||||
die:
|
||||
if (outpath)
|
||||
free (outpath);
|
||||
|
||||
Qclose (infile);
|
||||
Qclose (outfile);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
decode_args (int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
|
||||
options.mode = mo_none;
|
||||
options.verbosity = 0;
|
||||
options.raw = false;
|
||||
options.width = options.height = -1;
|
||||
|
||||
while ((c = getopt_long (argc, argv, "e" // export pcx
|
||||
"i" // import pcx
|
||||
"h" // show help
|
||||
"V" // show version
|
||||
"g:" // geometry
|
||||
"p:" // palette
|
||||
"r" // raw
|
||||
"q" // quiet
|
||||
"v" // verbose
|
||||
, long_options, (int *) 0)) != EOF) {
|
||||
switch (c) {
|
||||
case 'h': // help
|
||||
usage (0);
|
||||
break;
|
||||
case 'V': // version
|
||||
printf ("lmp version %s\n", PACKAGE_VERSION);
|
||||
exit (0);
|
||||
break;
|
||||
case 'e': // export
|
||||
options.mode = mo_export;
|
||||
break;
|
||||
case 'i': // import
|
||||
options.mode = mo_import;
|
||||
break;
|
||||
case 'g':
|
||||
{ // set geometry
|
||||
char *tmp = strdup (optarg);
|
||||
char *blank = strrchr (tmp, 'x');
|
||||
if (blank && *blank) {
|
||||
char *first, *second;
|
||||
|
||||
first = tmp;
|
||||
second = blank + 1;
|
||||
|
||||
options.width = atoi (first);
|
||||
options.height = atoi (second);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'p': // palette
|
||||
options.palette = strdup (optarg);
|
||||
break;
|
||||
case 'r': // raw
|
||||
options.raw = 1;
|
||||
break;
|
||||
case 'q': // lower verbosity
|
||||
options.verbosity--;
|
||||
break;
|
||||
case 'v': // increase verbosity
|
||||
options.verbosity++;
|
||||
break;
|
||||
default:
|
||||
usage (1);
|
||||
}
|
||||
}
|
||||
|
||||
return optind;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
QFile *infile;
|
||||
size_t ret;
|
||||
|
||||
this_program = argv[0];
|
||||
|
||||
Cvar_Init_Hash ();
|
||||
Cmd_Init_Hash ();
|
||||
Cvar_Init ();
|
||||
Sys_Init_Cvars ();
|
||||
Cmd_Init ();
|
||||
Memory_Init (malloc (MEMSIZE), MEMSIZE);
|
||||
|
||||
decode_args (argc, argv);
|
||||
|
||||
if (options.palette) {
|
||||
if ((infile = Qopen (options.palette, "rb"))) {
|
||||
// read in the palette
|
||||
palette = malloc (sizeof (quake_palette));
|
||||
if (!(ret = Qread (infile, palette, sizeof (quake_palette)))) {
|
||||
Sys_Printf ("%s: failed to read palette from file \"%s\"\n",
|
||||
this_program, options.palette);
|
||||
Qclose (infile);
|
||||
exit (1);
|
||||
}
|
||||
} else {
|
||||
Sys_Printf ("%s: Couldn't open palette file \"%s\"\n",
|
||||
this_program, options.palette);
|
||||
}
|
||||
Qclose (infile);
|
||||
} else {
|
||||
palette = quake_palette;
|
||||
}
|
||||
|
||||
switch (options.mode) {
|
||||
case mo_export:
|
||||
while (optind < argc) {
|
||||
if (options.verbosity > 0)
|
||||
Sys_Printf ("Exporting %s to PCX...\n", argv[optind]);
|
||||
exportFile (argv[optind]);
|
||||
optind++;
|
||||
}
|
||||
break;
|
||||
|
||||
case mo_import:
|
||||
while (optind < argc) {
|
||||
if (options.verbosity > 0)
|
||||
Sys_Printf ("Converting %s to lump...\n", argv[optind]);
|
||||
importFile (argv[optind]);
|
||||
optind++;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
Sys_Printf ("%s: No command given.\n", this_program);
|
||||
usage (1);
|
||||
}
|
||||
|
||||
#if 0
|
||||
for (i = 1; i < argc; i++) {
|
||||
int32_t width = 0;
|
||||
int32_t height = 0;
|
||||
QFile *outfile;
|
||||
char *in = argv[i];
|
||||
char *out;
|
||||
unsigned char *line;
|
||||
int j;
|
||||
|
||||
Sys_Printf ("%s\n", in);
|
||||
asprintf (&out, "%s.ppm", in);
|
||||
|
||||
infile = Qopen (in, "rb");
|
||||
outfile = Qopen (out, "wb");
|
||||
|
||||
// We use ASCII mode because we can put comments into it.
|
||||
Qprintf (outfile, "P3\n# %s\n", out);
|
||||
if (strcasestr (in, "conchars")) { // don't read w/h from conchars
|
||||
width = height = 128;
|
||||
} else {
|
||||
Qread (infile, &width, sizeof (width));
|
||||
Qread (infile, &height, sizeof (height));
|
||||
}
|
||||
Qprintf (outfile, "%d\n", width);
|
||||
Qprintf (outfile, "%d\n", height);
|
||||
Qprintf (outfile, "255\n");
|
||||
|
||||
for (j = 0; j < height; j++) {
|
||||
int k;
|
||||
|
||||
line = malloc (width); // doing a line at a time
|
||||
ret = Qread (infile, line, width);
|
||||
for (k = 0; k < width; k++) {
|
||||
Sys_Printf ("%u %d %d\n", (unsigned) ret, k, line[k]);
|
||||
if (k > 239)
|
||||
Qprintf (outfile, "# next pixel fullbright\n");
|
||||
|
||||
Qprintf (outfile, "%3d %3d %3d\n",
|
||||
palette[line[k]].color.red,
|
||||
palette[line[k]].color.green,
|
||||
palette[line[k]].color.blue);
|
||||
}
|
||||
Qprintf (outfile, "# next line\n");
|
||||
free (line);
|
||||
}
|
||||
Qclose (infile);
|
||||
Qclose (outfile);
|
||||
free (out);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
197
tools/qflmp/lmp.h
Normal file
197
tools/qflmp/lmp.h
Normal file
|
@ -0,0 +1,197 @@
|
|||
/*
|
||||
lmp.h
|
||||
|
||||
lump file tool (definitions)
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Copyright (C) 2002 Bill Currie <bill@taniwha.org>
|
||||
Copyright (C) 2002,2011 Jeff Teunissen <deek@quakeforge.net>
|
||||
|
||||
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:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifndef __lmp_h
|
||||
#define __lmp_h
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#include <QF/qtypes.h>
|
||||
|
||||
typedef enum {
|
||||
mo_none = 0,
|
||||
mo_export,
|
||||
mo_import
|
||||
} lmpmode_t;
|
||||
|
||||
typedef struct {
|
||||
lmpmode_t mode; // see above
|
||||
int verbosity; // 0=silent
|
||||
char *palette; // palette file to read
|
||||
qboolean raw; // don't read / write header
|
||||
short width; // width of images
|
||||
short height; // height " "
|
||||
} options_t;
|
||||
|
||||
typedef struct _Color {
|
||||
byte red;
|
||||
byte green;
|
||||
byte blue;
|
||||
} __attribute__((__packed__)) Color;
|
||||
|
||||
typedef union _Pixel {
|
||||
Color color;
|
||||
byte rgb[3];
|
||||
} __attribute__((__packed__)) Pixel;
|
||||
|
||||
Pixel quake_palette[] = {
|
||||
{{0x00,0x00,0x00}},{{0x0f,0x0f,0x0f}},{{0x1f,0x1f,0x1f}},{{0x2f,0x2f,0x2f}},
|
||||
{{0x3f,0x3f,0x3f}},{{0x4b,0x4b,0x4b}},{{0x5b,0x5b,0x5b}},{{0x6b,0x6b,0x6b}},
|
||||
{{0x7b,0x7b,0x7b}},{{0x8b,0x8b,0x8b}},{{0x9b,0x9b,0x9b}},{{0xab,0xab,0xab}},
|
||||
{{0xbb,0xbb,0xbb}},{{0xcb,0xcb,0xcb}},{{0xdb,0xdb,0xdb}},{{0xeb,0xeb,0xeb}},
|
||||
{{0x0f,0x0b,0x07}},{{0x17,0x0f,0x0b}},{{0x1f,0x17,0x0b}},{{0x27,0x1b,0x0f}},
|
||||
{{0x2f,0x23,0x13}},{{0x37,0x2b,0x17}},{{0x3f,0x2f,0x17}},{{0x4b,0x37,0x1b}},
|
||||
{{0x53,0x3b,0x1b}},{{0x5b,0x43,0x1f}},{{0x63,0x4b,0x1f}},{{0x6b,0x53,0x1f}},
|
||||
{{0x73,0x57,0x1f}},{{0x7b,0x5f,0x23}},{{0x83,0x67,0x23}},{{0x8f,0x6f,0x23}},
|
||||
{{0x0b,0x0b,0x0f}},{{0x13,0x13,0x1b}},{{0x1b,0x1b,0x27}},{{0x27,0x27,0x33}},
|
||||
{{0x2f,0x2f,0x3f}},{{0x37,0x37,0x4b}},{{0x3f,0x3f,0x57}},{{0x47,0x47,0x67}},
|
||||
{{0x4f,0x4f,0x73}},{{0x5b,0x5b,0x7f}},{{0x63,0x63,0x8b}},{{0x6b,0x6b,0x97}},
|
||||
{{0x73,0x73,0xa3}},{{0x7b,0x7b,0xaf}},{{0x83,0x83,0xbb}},{{0x8b,0x8b,0xcb}},
|
||||
{{0x00,0x00,0x00}},{{0x07,0x07,0x00}},{{0x0b,0x0b,0x00}},{{0x13,0x13,0x00}},
|
||||
{{0x1b,0x1b,0x00}},{{0x23,0x23,0x00}},{{0x2b,0x2b,0x07}},{{0x2f,0x2f,0x07}},
|
||||
{{0x37,0x37,0x07}},{{0x3f,0x3f,0x07}},{{0x47,0x47,0x07}},{{0x4b,0x4b,0x0b}},
|
||||
{{0x53,0x53,0x0b}},{{0x5b,0x5b,0x0b}},{{0x63,0x63,0x0b}},{{0x6b,0x6b,0x0f}},
|
||||
{{0x07,0x00,0x00}},{{0x0f,0x00,0x00}},{{0x17,0x00,0x00}},{{0x1f,0x00,0x00}},
|
||||
{{0x27,0x00,0x00}},{{0x2f,0x00,0x00}},{{0x37,0x00,0x00}},{{0x3f,0x00,0x00}},
|
||||
{{0x47,0x00,0x00}},{{0x4f,0x00,0x00}},{{0x57,0x00,0x00}},{{0x5f,0x00,0x00}},
|
||||
{{0x67,0x00,0x00}},{{0x6f,0x00,0x00}},{{0x77,0x00,0x00}},{{0x7f,0x00,0x00}},
|
||||
{{0x13,0x13,0x00}},{{0x1b,0x1b,0x00}},{{0x23,0x23,0x00}},{{0x2f,0x2b,0x00}},
|
||||
{{0x37,0x2f,0x00}},{{0x43,0x37,0x00}},{{0x4b,0x3b,0x07}},{{0x57,0x43,0x07}},
|
||||
{{0x5f,0x47,0x07}},{{0x6b,0x4b,0x0b}},{{0x77,0x53,0x0f}},{{0x83,0x57,0x13}},
|
||||
{{0x8b,0x5b,0x13}},{{0x97,0x5f,0x1b}},{{0xa3,0x63,0x1f}},{{0xaf,0x67,0x23}},
|
||||
{{0x23,0x13,0x07}},{{0x2f,0x17,0x0b}},{{0x3b,0x1f,0x0f}},{{0x4b,0x23,0x13}},
|
||||
{{0x57,0x2b,0x17}},{{0x63,0x2f,0x1f}},{{0x73,0x37,0x23}},{{0x7f,0x3b,0x2b}},
|
||||
{{0x8f,0x43,0x33}},{{0x9f,0x4f,0x33}},{{0xaf,0x63,0x2f}},{{0xbf,0x77,0x2f}},
|
||||
{{0xcf,0x8f,0x2b}},{{0xdf,0xab,0x27}},{{0xef,0xcb,0x1f}},{{0xff,0xf3,0x1b}},
|
||||
{{0x0b,0x07,0x00}},{{0x1b,0x13,0x00}},{{0x2b,0x23,0x0f}},{{0x37,0x2b,0x13}},
|
||||
{{0x47,0x33,0x1b}},{{0x53,0x37,0x23}},{{0x63,0x3f,0x2b}},{{0x6f,0x47,0x33}},
|
||||
{{0x7f,0x53,0x3f}},{{0x8b,0x5f,0x47}},{{0x9b,0x6b,0x53}},{{0xa7,0x7b,0x5f}},
|
||||
{{0xb7,0x87,0x6b}},{{0xc3,0x93,0x7b}},{{0xd3,0xa3,0x8b}},{{0xe3,0xb3,0x97}},
|
||||
{{0xab,0x8b,0xa3}},{{0x9f,0x7f,0x97}},{{0x93,0x73,0x87}},{{0x8b,0x67,0x7b}},
|
||||
{{0x7f,0x5b,0x6f}},{{0x77,0x53,0x63}},{{0x6b,0x4b,0x57}},{{0x5f,0x3f,0x4b}},
|
||||
{{0x57,0x37,0x43}},{{0x4b,0x2f,0x37}},{{0x43,0x27,0x2f}},{{0x37,0x1f,0x23}},
|
||||
{{0x2b,0x17,0x1b}},{{0x23,0x13,0x13}},{{0x17,0x0b,0x0b}},{{0x0f,0x07,0x07}},
|
||||
{{0xbb,0x73,0x9f}},{{0xaf,0x6b,0x8f}},{{0xa3,0x5f,0x83}},{{0x97,0x57,0x77}},
|
||||
{{0x8b,0x4f,0x6b}},{{0x7f,0x4b,0x5f}},{{0x73,0x43,0x53}},{{0x6b,0x3b,0x4b}},
|
||||
{{0x5f,0x33,0x3f}},{{0x53,0x2b,0x37}},{{0x47,0x23,0x2b}},{{0x3b,0x1f,0x23}},
|
||||
{{0x2f,0x17,0x1b}},{{0x23,0x13,0x13}},{{0x17,0x0b,0x0b}},{{0x0f,0x07,0x07}},
|
||||
{{0xdb,0xc3,0xbb}},{{0xcb,0xb3,0xa7}},{{0xbf,0xa3,0x9b}},{{0xaf,0x97,0x8b}},
|
||||
{{0xa3,0x87,0x7b}},{{0x97,0x7b,0x6f}},{{0x87,0x6f,0x5f}},{{0x7b,0x63,0x53}},
|
||||
{{0x6b,0x57,0x47}},{{0x5f,0x4b,0x3b}},{{0x53,0x3f,0x33}},{{0x43,0x33,0x27}},
|
||||
{{0x37,0x2b,0x1f}},{{0x27,0x1f,0x17}},{{0x1b,0x13,0x0f}},{{0x0f,0x0b,0x07}},
|
||||
{{0x6f,0x83,0x7b}},{{0x67,0x7b,0x6f}},{{0x5f,0x73,0x67}},{{0x57,0x6b,0x5f}},
|
||||
{{0x4f,0x63,0x57}},{{0x47,0x5b,0x4f}},{{0x3f,0x53,0x47}},{{0x37,0x4b,0x3f}},
|
||||
{{0x2f,0x43,0x37}},{{0x2b,0x3b,0x2f}},{{0x23,0x33,0x27}},{{0x1f,0x2b,0x1f}},
|
||||
{{0x17,0x23,0x17}},{{0x0f,0x1b,0x13}},{{0x0b,0x13,0x0b}},{{0x07,0x0b,0x07}},
|
||||
{{0xff,0xf3,0x1b}},{{0xef,0xdf,0x17}},{{0xdb,0xcb,0x13}},{{0xcb,0xb7,0x0f}},
|
||||
{{0xbb,0xa7,0x0f}},{{0xab,0x97,0x0b}},{{0x9b,0x83,0x07}},{{0x8b,0x73,0x07}},
|
||||
{{0x7b,0x63,0x07}},{{0x6b,0x53,0x00}},{{0x5b,0x47,0x00}},{{0x4b,0x37,0x00}},
|
||||
{{0x3b,0x2b,0x00}},{{0x2b,0x1f,0x00}},{{0x1b,0x0f,0x00}},{{0x0b,0x07,0x00}},
|
||||
{{0x00,0x00,0xff}},{{0x0b,0x0b,0xef}},{{0x13,0x13,0xdf}},{{0x1b,0x1b,0xcf}},
|
||||
{{0x23,0x23,0xbf}},{{0x2b,0x2b,0xaf}},{{0x2f,0x2f,0x9f}},{{0x2f,0x2f,0x8f}},
|
||||
{{0x2f,0x2f,0x7f}},{{0x2f,0x2f,0x6f}},{{0x2f,0x2f,0x5f}},{{0x2b,0x2b,0x4f}},
|
||||
{{0x23,0x23,0x3f}},{{0x1b,0x1b,0x2f}},{{0x13,0x13,0x1f}},{{0x0b,0x0b,0x0f}},
|
||||
{{0x2b,0x00,0x00}},{{0x3b,0x00,0x00}},{{0x4b,0x07,0x00}},{{0x5f,0x07,0x00}},
|
||||
{{0x6f,0x0f,0x00}},{{0x7f,0x17,0x07}},{{0x93,0x1f,0x07}},{{0xa3,0x27,0x0b}},
|
||||
{{0xb7,0x33,0x0f}},{{0xc3,0x4b,0x1b}},{{0xcf,0x63,0x2b}},{{0xdb,0x7f,0x3b}},
|
||||
{{0xe3,0x97,0x4f}},{{0xe7,0xab,0x5f}},{{0xef,0xbf,0x77}},{{0xf7,0xd3,0x8b}},
|
||||
{{0xa7,0x7b,0x3b}},{{0xb7,0x9b,0x37}},{{0xc7,0xc3,0x37}},{{0xe7,0xe3,0x57}},
|
||||
{{0x7f,0xbf,0xff}},{{0xab,0xe7,0xff}},{{0xd7,0xff,0xff}},{{0x67,0x00,0x00}},
|
||||
{{0x8b,0x00,0x00}},{{0xb3,0x00,0x00}},{{0xd7,0x00,0x00}},{{0xff,0x00,0x00}},
|
||||
{{0xff,0xf3,0x93}},{{0xff,0xf7,0xc7}},{{0xff,0xff,0xff}},{{0x9f,0x5b,0x53}}
|
||||
};
|
||||
|
||||
byte default_palette[] = {
|
||||
0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x1f, 0x1f, 0x1f, 0x2f, 0x2f, 0x2f,
|
||||
0x3f, 0x3f, 0x3f, 0x4b, 0x4b, 0x4b, 0x5b, 0x5b, 0x5b, 0x6b, 0x6b, 0x6b,
|
||||
0x7b, 0x7b, 0x7b, 0x8b, 0x8b, 0x8b, 0x9b, 0x9b, 0x9b, 0xab, 0xab, 0xab,
|
||||
0xbb, 0xbb, 0xbb, 0xcb, 0xcb, 0xcb, 0xdb, 0xdb, 0xdb, 0xeb, 0xeb, 0xeb,
|
||||
0x0f, 0x0b, 0x07, 0x17, 0x0f, 0x0b, 0x1f, 0x17, 0x0b, 0x27, 0x1b, 0x0f,
|
||||
0x2f, 0x23, 0x13, 0x37, 0x2b, 0x17, 0x3f, 0x2f, 0x17, 0x4b, 0x37, 0x1b,
|
||||
0x53, 0x3b, 0x1b, 0x5b, 0x43, 0x1f, 0x63, 0x4b, 0x1f, 0x6b, 0x53, 0x1f,
|
||||
0x73, 0x57, 0x1f, 0x7b, 0x5f, 0x23, 0x83, 0x67, 0x23, 0x8f, 0x6f, 0x23,
|
||||
0x0b, 0x0b, 0x0f, 0x13, 0x13, 0x1b, 0x1b, 0x1b, 0x27, 0x27, 0x27, 0x33,
|
||||
0x2f, 0x2f, 0x3f, 0x37, 0x37, 0x4b, 0x3f, 0x3f, 0x57, 0x47, 0x47, 0x67,
|
||||
0x4f, 0x4f, 0x73, 0x5b, 0x5b, 0x7f, 0x63, 0x63, 0x8b, 0x6b, 0x6b, 0x97,
|
||||
0x73, 0x73, 0xa3, 0x7b, 0x7b, 0xaf, 0x83, 0x83, 0xbb, 0x8b, 0x8b, 0xcb,
|
||||
0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x0b, 0x0b, 0x00, 0x13, 0x13, 0x00,
|
||||
0x1b, 0x1b, 0x00, 0x23, 0x23, 0x00, 0x2b, 0x2b, 0x07, 0x2f, 0x2f, 0x07,
|
||||
0x37, 0x37, 0x07, 0x3f, 0x3f, 0x07, 0x47, 0x47, 0x07, 0x4b, 0x4b, 0x0b,
|
||||
0x53, 0x53, 0x0b, 0x5b, 0x5b, 0x0b, 0x63, 0x63, 0x0b, 0x6b, 0x6b, 0x0f,
|
||||
0x07, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x17, 0x00, 0x00, 0x1f, 0x00, 0x00,
|
||||
0x27, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x37, 0x00, 0x00, 0x3f, 0x00, 0x00,
|
||||
0x47, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x57, 0x00, 0x00, 0x5f, 0x00, 0x00,
|
||||
0x67, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x77, 0x00, 0x00, 0x7f, 0x00, 0x00,
|
||||
0x13, 0x13, 0x00, 0x1b, 0x1b, 0x00, 0x23, 0x23, 0x00, 0x2f, 0x2b, 0x00,
|
||||
0x37, 0x2f, 0x00, 0x43, 0x37, 0x00, 0x4b, 0x3b, 0x07, 0x57, 0x43, 0x07,
|
||||
0x5f, 0x47, 0x07, 0x6b, 0x4b, 0x0b, 0x77, 0x53, 0x0f, 0x83, 0x57, 0x13,
|
||||
0x8b, 0x5b, 0x13, 0x97, 0x5f, 0x1b, 0xa3, 0x63, 0x1f, 0xaf, 0x67, 0x23,
|
||||
0x23, 0x13, 0x07, 0x2f, 0x17, 0x0b, 0x3b, 0x1f, 0x0f, 0x4b, 0x23, 0x13,
|
||||
0x57, 0x2b, 0x17, 0x63, 0x2f, 0x1f, 0x73, 0x37, 0x23, 0x7f, 0x3b, 0x2b,
|
||||
0x8f, 0x43, 0x33, 0x9f, 0x4f, 0x33, 0xaf, 0x63, 0x2f, 0xbf, 0x77, 0x2f,
|
||||
0xcf, 0x8f, 0x2b, 0xdf, 0xab, 0x27, 0xef, 0xcb, 0x1f, 0xff, 0xf3, 0x1b,
|
||||
0x0b, 0x07, 0x00, 0x1b, 0x13, 0x00, 0x2b, 0x23, 0x0f, 0x37, 0x2b, 0x13,
|
||||
0x47, 0x33, 0x1b, 0x53, 0x37, 0x23, 0x63, 0x3f, 0x2b, 0x6f, 0x47, 0x33,
|
||||
0x7f, 0x53, 0x3f, 0x8b, 0x5f, 0x47, 0x9b, 0x6b, 0x53, 0xa7, 0x7b, 0x5f,
|
||||
0xb7, 0x87, 0x6b, 0xc3, 0x93, 0x7b, 0xd3, 0xa3, 0x8b, 0xe3, 0xb3, 0x97,
|
||||
0xab, 0x8b, 0xa3, 0x9f, 0x7f, 0x97, 0x93, 0x73, 0x87, 0x8b, 0x67, 0x7b,
|
||||
0x7f, 0x5b, 0x6f, 0x77, 0x53, 0x63, 0x6b, 0x4b, 0x57, 0x5f, 0x3f, 0x4b,
|
||||
0x57, 0x37, 0x43, 0x4b, 0x2f, 0x37, 0x43, 0x27, 0x2f, 0x37, 0x1f, 0x23,
|
||||
0x2b, 0x17, 0x1b, 0x23, 0x13, 0x13, 0x17, 0x0b, 0x0b, 0x0f, 0x07, 0x07,
|
||||
0xbb, 0x73, 0x9f, 0xaf, 0x6b, 0x8f, 0xa3, 0x5f, 0x83, 0x97, 0x57, 0x77,
|
||||
0x8b, 0x4f, 0x6b, 0x7f, 0x4b, 0x5f, 0x73, 0x43, 0x53, 0x6b, 0x3b, 0x4b,
|
||||
0x5f, 0x33, 0x3f, 0x53, 0x2b, 0x37, 0x47, 0x23, 0x2b, 0x3b, 0x1f, 0x23,
|
||||
0x2f, 0x17, 0x1b, 0x23, 0x13, 0x13, 0x17, 0x0b, 0x0b, 0x0f, 0x07, 0x07,
|
||||
0xdb, 0xc3, 0xbb, 0xcb, 0xb3, 0xa7, 0xbf, 0xa3, 0x9b, 0xaf, 0x97, 0x8b,
|
||||
0xa3, 0x87, 0x7b, 0x97, 0x7b, 0x6f, 0x87, 0x6f, 0x5f, 0x7b, 0x63, 0x53,
|
||||
0x6b, 0x57, 0x47, 0x5f, 0x4b, 0x3b, 0x53, 0x3f, 0x33, 0x43, 0x33, 0x27,
|
||||
0x37, 0x2b, 0x1f, 0x27, 0x1f, 0x17, 0x1b, 0x13, 0x0f, 0x0f, 0x0b, 0x07,
|
||||
0x6f, 0x83, 0x7b, 0x67, 0x7b, 0x6f, 0x5f, 0x73, 0x67, 0x57, 0x6b, 0x5f,
|
||||
0x4f, 0x63, 0x57, 0x47, 0x5b, 0x4f, 0x3f, 0x53, 0x47, 0x37, 0x4b, 0x3f,
|
||||
0x2f, 0x43, 0x37, 0x2b, 0x3b, 0x2f, 0x23, 0x33, 0x27, 0x1f, 0x2b, 0x1f,
|
||||
0x17, 0x23, 0x17, 0x0f, 0x1b, 0x13, 0x0b, 0x13, 0x0b, 0x07, 0x0b, 0x07,
|
||||
0xff, 0xf3, 0x1b, 0xef, 0xdf, 0x17, 0xdb, 0xcb, 0x13, 0xcb, 0xb7, 0x0f,
|
||||
0xbb, 0xa7, 0x0f, 0xab, 0x97, 0x0b, 0x9b, 0x83, 0x07, 0x8b, 0x73, 0x07,
|
||||
0x7b, 0x63, 0x07, 0x6b, 0x53, 0x00, 0x5b, 0x47, 0x00, 0x4b, 0x37, 0x00,
|
||||
0x3b, 0x2b, 0x00, 0x2b, 0x1f, 0x00, 0x1b, 0x0f, 0x00, 0x0b, 0x07, 0x00,
|
||||
0x00, 0x00, 0xff, 0x0b, 0x0b, 0xef, 0x13, 0x13, 0xdf, 0x1b, 0x1b, 0xcf,
|
||||
0x23, 0x23, 0xbf, 0x2b, 0x2b, 0xaf, 0x2f, 0x2f, 0x9f, 0x2f, 0x2f, 0x8f,
|
||||
0x2f, 0x2f, 0x7f, 0x2f, 0x2f, 0x6f, 0x2f, 0x2f, 0x5f, 0x2b, 0x2b, 0x4f,
|
||||
0x23, 0x23, 0x3f, 0x1b, 0x1b, 0x2f, 0x13, 0x13, 0x1f, 0x0b, 0x0b, 0x0f,
|
||||
0x2b, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x4b, 0x07, 0x00, 0x5f, 0x07, 0x00,
|
||||
0x6f, 0x0f, 0x00, 0x7f, 0x17, 0x07, 0x93, 0x1f, 0x07, 0xa3, 0x27, 0x0b,
|
||||
0xb7, 0x33, 0x0f, 0xc3, 0x4b, 0x1b, 0xcf, 0x63, 0x2b, 0xdb, 0x7f, 0x3b,
|
||||
0xe3, 0x97, 0x4f, 0xe7, 0xab, 0x5f, 0xef, 0xbf, 0x77, 0xf7, 0xd3, 0x8b,
|
||||
0xa7, 0x7b, 0x3b, 0xb7, 0x9b, 0x37, 0xc7, 0xc3, 0x37, 0xe7, 0xe3, 0x57,
|
||||
0x7f, 0xbf, 0xff, 0xab, 0xe7, 0xff, 0xd7, 0xff, 0xff, 0x67, 0x00, 0x00,
|
||||
0x8b, 0x00, 0x00, 0xb3, 0x00, 0x00, 0xd7, 0x00, 0x00, 0xff, 0x00, 0x00,
|
||||
0xff, 0xf3, 0x93, 0xff, 0xf7, 0xc7, 0xff, 0xff, 0xff, 0x9f, 0x5b, 0x53,
|
||||
};
|
||||
|
||||
#endif // __lmp_h
|
Loading…
Reference in a new issue