From 2aa16d0ff38c02c96272c9af050a4d7e1715c3fb Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 16 Dec 2006 00:58:12 +0000 Subject: Add icon for setup tool. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 777 --- Makefile.am | 12 +- data/chocolate-setup.ico | Bin 0 -> 6518 bytes data/chocolate-setup.png | Bin 0 -> 643 bytes data/convert-icon | 74 ++++++++++++ setup/Makefile.am | 19 ++- setup/chocolate-setup-res.rc.in | 22 ++++ setup/chocolate_setup_icon.c | 262 ++++++++++++++++++++++++++++++++++++++++ setup/mainmenu.c | 25 ++++ src/Makefile.am | 3 +- src/convert-icon | 74 ------------ 10 files changed, 411 insertions(+), 80 deletions(-) create mode 100644 data/chocolate-setup.ico create mode 100644 data/chocolate-setup.png create mode 100755 data/convert-icon create mode 100644 setup/chocolate-setup-res.rc.in create mode 100644 setup/chocolate_setup_icon.c delete mode 100755 src/convert-icon diff --git a/Makefile.am b/Makefile.am index 961a776e..f02f55d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,16 +18,22 @@ CODEBLOCKS_FILES= \ codeblocks/chocolate-doom-res.rc \ codeblocks/textscreen.cbp +DATA_FILES= \ + data/chocolate-doom.ico \ + data/chocolate-doom.png \ + data/chocolate-setup.ico \ + data/chocolate-setup.png \ + data/convert-icon + EXTRA_DIST= \ $(AUX_DIST_GEN) \ $(MSVC_FILES) \ $(CODEBLOCKS_FILES) \ + $(DATA_FILES) \ config.h \ HACKING \ TODO \ - BUGS \ - data/chocolate-doom.png \ - data/chocolate-doom.ico + BUGS MAINTAINERCLEANFILES = $(AUX_DIST_GEN) diff --git a/data/chocolate-setup.ico b/data/chocolate-setup.ico new file mode 100644 index 00000000..44985ba6 Binary files /dev/null and b/data/chocolate-setup.ico differ diff --git a/data/chocolate-setup.png b/data/chocolate-setup.png new file mode 100644 index 00000000..2de1bbb0 Binary files /dev/null and b/data/chocolate-setup.png differ diff --git a/data/convert-icon b/data/convert-icon new file mode 100755 index 00000000..16412378 --- /dev/null +++ b/data/convert-icon @@ -0,0 +1,74 @@ +#!/usr/bin/python +# +# $Id: convert-icon 704 2006-10-18 00:51:11Z fraggle $ +# +# Copyright(C) 2005 Simon Howard +# +# 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. +# +# Converts images into C structures to be inserted in programs +# + +import sys +import os +import re + +try: + import Image +except ImportError: + print "WARNING: Could not update %s. Please install the Python Image library." % sys.argv[2] + sys.exit(0) + + +def convert_image(filename, output_filename): + + im = Image.open(filename).convert("RGB") + + outfile = open(output_filename, "w") + + size = im.size + + struct_name = os.path.basename(filename) + struct_name = re.sub(re.compile("\\..*$"), "", struct_name) + struct_name = re.sub(re.compile("\W"), "_", struct_name) + + outfile.write("static int %s_w = %i;\n" % (struct_name, size[0])) + outfile.write("static int %s_h = %i;\n" % (struct_name, size[1])) + + outfile.write("\n") + outfile.write("static unsigned char %s_data[] = {\n" % (struct_name)) + + elements_on_line = 0 + + outfile.write(" ") + + for y in range(size[1]): + for x in range(size[0]): + val = im.getpixel((x, y)) + outfile.write("0x%02x,0x%02x,0x%02x, " % val) + elements_on_line += 1 + + if elements_on_line >= 4: + elements_on_line = 0 + outfile.write("\n") + outfile.write(" ") + + outfile.write("\n") + outfile.write("};\n") + +convert_image(sys.argv[1], sys.argv[2]) + + diff --git a/setup/Makefile.am b/setup/Makefile.am index b0f2a276..f4c37cce 100644 --- a/setup/Makefile.am +++ b/setup/Makefile.am @@ -6,7 +6,7 @@ AM_CFLAGS = @SDL_CFLAGS@ -I../textscreen -I../src -DINSTALL_DIR="\"$(gamesdir)\" games_PROGRAMS = chocolate-setup chocolate_setup_LDADD = @LDFLAGS@ @SDL_LIBS@ ../textscreen/libtextscreen.a -chocolate_setup_SOURCES = \ +SOURCE_FILES = \ compatibility.c compatibility.h \ configfile.c configfile.h \ display.c display.h \ @@ -20,3 +20,20 @@ chocolate_setup_SOURCES = \ txt_keyinput.c txt_keyinput.h \ txt_mouseinput.c txt_mouseinput.h +EXTRA_DIST= \ + chocolate_setup_icon.c + +if HAVE_WINDRES +chocolate_setup_SOURCES=$(SOURCE_FILES) chocolate-setup-res.rc +else +chocolate_setup_SOURCES=$(SOURCE_FILES) +endif + +.rc.o: + $(WINDRES) $^ -o $@ +%.o : %.rc + $(WINDRES) $^ -o $@ + +chocolate_setup_icon.c : ../data/chocolate-setup.png + ../data/convert-icon $^ $@ + diff --git a/setup/chocolate-setup-res.rc.in b/setup/chocolate-setup-res.rc.in new file mode 100644 index 00000000..cb49a1b2 --- /dev/null +++ b/setup/chocolate-setup-res.rc.in @@ -0,0 +1,22 @@ +1 ICON "..\\data\\chocolate-setup.ico" + +1 VERSIONINFO +PRODUCTVERSION @WINDOWS_RC_VERSION@ +FILEVERSION @WINDOWS_RC_VERSION@ +FILETYPE 1 +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "FileVersion", "@PACKAGE_VERSION@" + VALUE "FileDescription", "@PACKAGE_STRING@ Setup" + VALUE "InternalName", "@PACKAGE_TARNAME@" + VALUE "CompanyName", "@PACKAGE_BUGREPORT@" + VALUE "LegalCopyright", "GNU General Public License" + VALUE "ProductName", "@PACKAGE_NAME@ Setup" + VALUE "ProductVersion", "@PACKAGE_VERSION@" + } + } +} + diff --git a/setup/chocolate_setup_icon.c b/setup/chocolate_setup_icon.c new file mode 100644 index 00000000..c81f9f9e --- /dev/null +++ b/setup/chocolate_setup_icon.c @@ -0,0 +1,262 @@ +static int chocolate_setup_w = 32; +static int chocolate_setup_h = 32; + +static unsigned char chocolate_setup_data[] = { + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, + 0x6b,0x31,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x6b,0x31,0x00, + 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x6b,0x31,0x00, 0x94,0x52,0x00, 0xad,0x5a,0x00, + 0x6b,0x31,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x6b,0x31,0x00, + 0x94,0x52,0x00, 0xad,0x5a,0x00, 0x6b,0x31,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, + 0x6b,0x31,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x6b,0x31,0x00, + 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, + 0x6b,0x31,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x6b,0x31,0x00, + 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x6b,0x31,0x00, 0x94,0x52,0x00, 0xad,0x5a,0x00, + 0x6b,0x31,0x00, 0x52,0x29,0x00, 0x52,0x29,0x00, 0x6b,0x31,0x00, + 0x94,0x52,0x00, 0xad,0x5a,0x00, 0x6b,0x31,0x00, 0x52,0x29,0x00, + 0x52,0x29,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xc6,0xc6,0xc6, + 0xb5,0xb5,0xb5, 0xc6,0xc6,0xc6, 0x6b,0x31,0x00, 0xc6,0xc6,0xc6, + 0xb5,0xb5,0xb5, 0x52,0x29,0x00, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, + 0x6b,0x31,0x00, 0x6b,0x31,0x00, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, + 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, + 0xb5,0xb5,0xb5, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0xc6,0xc6,0xc6, + 0xb5,0xb5,0xb5, 0xb5,0xb5,0xb5, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, + 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0xb5,0xb5,0xb5, + 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, + 0xc6,0x00,0x00, 0xc6,0x00,0x00, 0x84,0x00,0x00, 0xc6,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0xc6,0x00,0x00, 0xc6,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x42,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x42,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x42,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x42,0x00,0x00, 0x84,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x42,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x42,0x00,0x00, 0x52,0x29,0x00, 0x42,0x00,0x00, + 0x6b,0x31,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x42,0x00,0x00, 0x42,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x00,0x00,0x00, 0xb5,0xb5,0xb5, 0x42,0x42,0x42, + 0xc6,0xc6,0xc6, 0xff,0xff,0xff, 0xb5,0xb5,0xb5, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x42,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x42,0x00,0x00, 0xc6,0x00,0x00, 0x42,0x00,0x00, + 0xc6,0x00,0x00, 0x42,0x00,0x00, 0x00,0x00,0x00, 0xc6,0xc6,0xc6, + 0x42,0x42,0x42, 0x42,0x42,0x42, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, + 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x42,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x42,0x00,0x00, + 0x84,0x00,0x00, 0x42,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0xff,0xff,0xff, 0xff,0xff,0xff, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0xc6,0xc6,0xc6, 0x42,0x42,0x42, 0xff,0xff,0xff, + 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, + 0x84,0x00,0x00, 0xff,0xff,0xff, 0x00,0x00,0x00, 0xff,0xff,0xff, + 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, + 0x84,0x00,0x00, 0x00,0x00,0x00, 0x42,0x42,0x42, 0xc6,0xc6,0xc6, + 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x84,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x00,0x00,0x00, 0xff,0xff,0xff, + 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, 0xff,0xff,0xff, 0x00,0x00,0x00, + 0x42,0x42,0x42, 0x42,0x42,0x42, 0xff,0xff,0xff, 0xff,0xff,0xff, + 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, 0x84,0x00,0x00, + 0x84,0x00,0x00, 0x84,0x00,0x00, 0x00,0x00,0x00, 0x42,0x42,0x42, + 0xff,0xff,0xff, 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xff,0xff,0xff, + 0xc6,0xc6,0xc6, 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, + 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x42,0x42,0x42, 0xff,0xff,0xff, + 0x42,0x42,0x42, 0x42,0x42,0x42, 0xff,0xff,0xff, 0xff,0xff,0xff, + 0xc6,0xc6,0xc6, 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xff,0xff,0xff, + 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, + 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xc6,0xc6,0xc6, + 0xff,0xff,0xff, 0xff,0xff,0xff, 0x42,0x42,0x42, 0x42,0x42,0x42, + 0x42,0x42,0x42, 0x42,0x42,0x42, 0xb5,0xb5,0xb5, 0xff,0xff,0xff, + 0xff,0xff,0xff, 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, + 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0xc6,0xc6,0xc6, 0xff,0xff,0xff, 0xc6,0xc6,0xc6, + 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0x42,0x42,0x42, 0x42,0x42,0x42, + 0x42,0x42,0x42, 0xff,0xff,0xff, 0xff,0xff,0xff, 0xff,0xff,0xff, + 0xc6,0xc6,0xc6, 0xff,0xff,0xff, 0xff,0xff,0xff, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0xb5,0xb5,0xb5, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, + 0xb5,0xb5,0xb5, 0x42,0x42,0x42, 0x42,0x42,0x42, 0xff,0xff,0xff, + 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xff,0xff,0xff, 0xff,0xff,0xff, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xb5,0xb5,0xb5, 0x42,0x42,0x42, + 0x42,0x42,0x42, 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0xc6,0xc6,0xc6, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0xff,0xff,0xff, 0xc6,0xc6,0xc6, + 0xb5,0xb5,0xb5, 0x42,0x42,0x42, 0x42,0x42,0x42, 0xff,0xff,0xff, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0xff,0xff,0xff, 0xc6,0xc6,0xc6, 0x42,0x42,0x42, 0x42,0x42,0x42, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, + +}; diff --git a/setup/mainmenu.c b/setup/mainmenu.c index 08b7d6d8..cb645463 100644 --- a/setup/mainmenu.c +++ b/setup/mainmenu.c @@ -28,6 +28,8 @@ #include "configfile.h" #include "m_argv.h" +#include "chocolate_setup_icon.c" + #include "compatibility.h" #include "display.h" #include "keyboard.h" @@ -140,6 +142,28 @@ static void InitConfig(void) M_LoadDefaults(); } +// +// Application icon +// + +static void SetIcon(void) +{ + SDL_Surface *surface; + + surface = SDL_CreateRGBSurfaceFrom(chocolate_setup_data, + chocolate_setup_w, + chocolate_setup_h, + 24, + chocolate_setup_w * 3, + 0xff << 0, + 0xff << 8, + 0xff << 16, + 0); + + SDL_WM_SetIcon(surface, NULL); + SDL_FreeSurface(surface); +} + // // Initialise and run the textscreen GUI. // @@ -153,6 +177,7 @@ static void RunGUI(void) } TXT_SetDesktopTitle(PACKAGE_NAME " Setup ver " PACKAGE_VERSION); + SetIcon(); MainMenu(); diff --git a/src/Makefile.am b/src/Makefile.am index c27f2c35..6ffac860 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -140,7 +140,6 @@ endif chocolate_doom_LDADD = ../textscreen/libtextscreen.a @LDFLAGS@ @SDL_LIBS@ @SDLMIXER_LIBS@ @SDLNET_LIBS@ EXTRA_DIST = \ - convert-icon \ chocolate_doom_icon.c \ chocolate-doom-screensaver.desktop @@ -150,5 +149,5 @@ EXTRA_DIST = \ $(WINDRES) $^ -o $@ chocolate_doom_icon.c : ../data/chocolate-doom.png - ./convert-icon $^ $@ + ../data/convert-icon $^ $@ diff --git a/src/convert-icon b/src/convert-icon deleted file mode 100755 index 16412378..00000000 --- a/src/convert-icon +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/python -# -# $Id: convert-icon 704 2006-10-18 00:51:11Z fraggle $ -# -# Copyright(C) 2005 Simon Howard -# -# 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. -# -# Converts images into C structures to be inserted in programs -# - -import sys -import os -import re - -try: - import Image -except ImportError: - print "WARNING: Could not update %s. Please install the Python Image library." % sys.argv[2] - sys.exit(0) - - -def convert_image(filename, output_filename): - - im = Image.open(filename).convert("RGB") - - outfile = open(output_filename, "w") - - size = im.size - - struct_name = os.path.basename(filename) - struct_name = re.sub(re.compile("\\..*$"), "", struct_name) - struct_name = re.sub(re.compile("\W"), "_", struct_name) - - outfile.write("static int %s_w = %i;\n" % (struct_name, size[0])) - outfile.write("static int %s_h = %i;\n" % (struct_name, size[1])) - - outfile.write("\n") - outfile.write("static unsigned char %s_data[] = {\n" % (struct_name)) - - elements_on_line = 0 - - outfile.write(" ") - - for y in range(size[1]): - for x in range(size[0]): - val = im.getpixel((x, y)) - outfile.write("0x%02x,0x%02x,0x%02x, " % val) - elements_on_line += 1 - - if elements_on_line >= 4: - elements_on_line = 0 - outfile.write("\n") - outfile.write(" ") - - outfile.write("\n") - outfile.write("};\n") - -convert_image(sys.argv[1], sys.argv[2]) - - -- cgit v1.2.3