00001 /* 00002 * Copyright 2006 by Brian Dominy <brian@oddchange.com> 00003 * 00004 * This file is part of FreeWPC. 00005 * 00006 * FreeWPC is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * FreeWPC is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with FreeWPC; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #define TRUE 1 00022 #define FALSE 0 00023 #include "pgmlib.h" 00024 00025 void 00026 pgm_to_xbmset (const char *name, int invert_flag) 00027 { 00028 char infilename[64]; 00029 char outfilename[64]; 00030 00031 sprintf (infilename, "images/%s.pgm", name); 00032 sprintf (outfilename, "images/%s.xbm", name); 00033 00034 PGM *pgm = pgm_read (infilename); 00035 pgm_change_maxval (pgm, 3); 00036 00037 if (invert_flag) 00038 pgm_invert (pgm); 00039 00040 pgm_write_xbmset (pgm, outfilename, name); 00041 } 00042 00043 00044 /* machgen is the real main function for the xbm generator. 00045 * The actual main() is in the library in pgmlib.c, which 00046 * then calls this function after the library has been 00047 * initialized. 00048 * 00049 * Each gen_xxx() function here creates an XBMSET file with 00050 * .xbm extension, that is capable of being displayed by the 00051 * FreeWPC runtime DMD module. 00052 */ 00053 void 00054 machgen (void) 00055 { 00056 pgm_to_xbmset ("hitcher", TRUE); 00057 pgm_to_xbmset ("coinstack", FALSE); 00058 pgm_to_xbmset ("oldcar", FALSE); 00059 pgm_to_xbmset ("pyramid", TRUE); 00060 pgm_to_xbmset ("robot", TRUE); 00061 pgm_to_xbmset ("brianhead", TRUE); 00062 00063 //gen_mborder (); 00064 gen_multisquare_background (); 00065 gen_dithered_dark_background (); 00066 gen_tile_background (); 00067 gen_ball_border (); 00068 } 00069
1.5.4