Yes, smart fpg editor is great. Especially because of it's controlpoint support. It's much more userfriendly then fpg edit 2005/2009.
Right now, I use them both, the only thing missing are some basic export features.
try compiling this program with the latest bennu version (not with fenix!)
/* "map convert".
*
* Copyright (C) 2010 Pieter kuperus/DYKO.
*
* 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
*
*/
/*
This program allows a map or png file to be converted into another format.
*/
//IMPORT "mod_debug";
IMPORT "mod_dir";
IMPORT "mod_file";
//IMPORT "mod_key";
IMPORT "mod_map";
IMPORT "mod_screen";
IMPORT "mod_say";
IMPORT "mod_string";
IMPORT "mod_proc";
IMPORT "mod_video"
IMPORT "mod_sys";
CONST
SHELL=0; WIN=1;
LOCAL
GLOBAL
int extension;
int bits_per_pixel=0;
int info_bpp; info_width; info_height;
int systemmap; systemfile;
int inputfile;
int outputfile;
int filenamelength;
string inputfilename;
string outputfilename;
string inputfileextension;
int filetype_map; filetype_png;
string command_arg;
STRUCT dykoconfig;
int handle;
int command_result;
string input_command;
string compare_command="win";
byte mode;
END
PRIVATE
BEGIN
IF (file_exists("dykotools.cfg"))
dykoconfig.handle=fopen("dykotools.cfg",O_READ);
dykoconfig.input_command=fgets(dykoconfig.handle);
fclose(dykoconfig.handle);
// compare the command strings
dykoconfig.command_result=strcasecmp(dykoconfig.input_command,dykoconfig.compare_command);
IF (dykoconfig.command_result==0)
dykoconfig.mode=WIN;
ELSE
dykoconfig.mode=SHELL;
END
ELSE
dykoconfig.mode=SHELL;
END
// fetch the filename from the first commandline argument
inputfilename=argv[1];
say("");
say("");
say("");
say("");
say("DYKO-Bennutools mapconvert, © 2010 Pieter Kuperus/DYKO.");
say("");
say("");
say("");
say("This PROGRAM is free software; you can redistribute it AND/OR modify");
say("it under the terms of the GNU General Public License as published by");
say("the Free Software Foundation; either version 2 of the License, OR");
say("(at your option) any later version.");
say("");
say("This PROGRAM is distributed in the hope that it will be useful,");
say("but WITHOUT ANY WARRANTY; without even the implied warranty of");
say("MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the");
say("GNU General Public License FOR more details.");
say("");
say("You should have received a copy of the GNU General Public License");
say("along with this PROGRAM; IF NOT, write TO the Free Software");
say("Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA");
say("");
say("");
say("Bear in mind that when you use this tool on 8-bit images, the color palette");
say("extracted from the file should be loaded when you open the converted imagefile");
say("into a Fenix/Bennu compatible fpg/map application.");
say("");
say("");
// check if a filename is entered, or if the filename exists.
// if not, print a error message, otherwise start the conversion.
IF (NOT file_exists(inputfilename))
IF (dykoconfig.mode==SHELL)
say("file does not exist or no argument is given.");
say("");
say("USAGE: mapconvert filename.map OR mapconvert filename.png");
END
IF (dykoconfig.mode==WIN)
SWITCH (os_id)
CASE OS_WIN32:
command_arg="-mc1";
exec(_P_WAIT,"sterrdlg.exe",1,&command_arg);
END
CASE OS_LINUX:
command_arg="-mc1";
exec(_P_WAIT,"sterrdlg",1,&command_arg);
END
DEFAULT:
command_arg="-mc1";
exec(_P_WAIT,"sterrdlg",1,&command_arg);
END
END
END
exit("",0);
ELSE
// obtain the length of the filename.
filenamelength=len(inputfilename);
// remove the ".map or .png" extension of the filename.
outputfilename=substr(inputfilename,0,(filenamelength-4));
// obtain the file extesion.
inputfileextension=substr(inputfilename,(filenamelength-3),3);
// display the name of the inputfile and load it.
say("filename loaded: "+inputfilename);
// compare the filename extensions, and detect the filetype.
filetype_map=strcasecmp(inputfileextension,"map");
filetype_png=strcasecmp(inputfileextension,"png");
IF (filetype_map==0)
extension=1;
END
IF (filetype_png==0)
extension=2;
END
SWITCH (extension)
CASE 1: // convert from MAP to PNG
inputfile=map_load(inputfilename);
info_bpp=graphic_info(0,inputfile,G_DEPTH);
SWITCH (info_bpp)
CASE 1:
bits_per_pixel=1;
set_mode(1024,768,8);
// create the system buffer.
systemmap=map_new(1024,768,8);
END
CASE 8:
bits_per_pixel=8;
set_mode(1024,768,8);
// create the system buffer.
systemmap=map_new(1024,768,8);
END
CASE 16:
bits_per_pixel=16;
set_mode(1024,768,16);
// create the system buffer.
systemmap=map_new(1024,768,16);
END
CASE 32:
bits_per_pixel=32;
set_mode(1024,768,32);
// create the system buffer.
systemmap=map_new(1024,768,32);
END
DEFAULT:
bits_per_pixel=32;
set_mode(1024,768,32);
// create the system buffer.
systemmap=map_new(1024,768,32);
END
END
// display a message that the file conversion is in progess.
say("converting: "+inputfilename+ " to "+outputfilename+".png");
outputfile=png_save(0,inputfile,(outputfilename+".png"));
// create a palette file for the output file (only in 8 bpp mode)
IF (bits_per_pixel==8)
save_pal(outputfilename+"-map.pal");
END
END
CASE 2: // convert from PNG to MAP
inputfile=png_load(inputfilename);
info_bpp=graphic_info(0,inputfile,G_DEPTH);
SWITCH (info_bpp)
CASE 1:
bits_per_pixel=1;
set_mode(1024,768,8);
// create the system buffer.
systemmap=map_new(1024,768,8);
END
CASE 8:
bits_per_pixel=8;
set_mode(1024,768,8);
// create the system buffer.
systemmap=map_new(1024,768,8);
END
CASE 16:
bits_per_pixel=16;
set_mode(1024,768,16);
// create the system buffer.
systemmap=map_new(1024,768,16);
END
CASE 32:
bits_per_pixel=32;
set_mode(1024,768,32);
// create the system buffer.
systemmap=map_new(1024,768,32);
END
DEFAULT:
bits_per_pixel=32;
set_mode(1024,768,32);
// create the system buffer.
systemmap=map_new(1024,768,32);
END
END
put_screen(0,inputfile);
// display a message that the file conversion is in progess.
say("converting: "+inputfilename+ " to "+outputfilename+".map");
outputfile=map_save(0,inputfile,(outputfilename+".map"));
// create a palette file for the output file (only in 8 bpp mode)
IF (bits_per_pixel==8)
save_pal(outputfilename+"-png.pal");
end
END
END
// say that it's completed.
IF (dykoconfig.mode==SHELL)
say("done.");
END
IF (dykoconfig.mode==WIN)
SWITCH (os_id)
CASE OS_WIN32:
command_arg="-mc2";
exec(_P_WAIT,"sterrdlg.exe",1,&command_arg);
END
CASE OS_LINUX:
command_arg="-mc2";
exec(_P_WAIT,"sterrdlg",1,&command_arg);
END
DEFAULT:
command_arg="-mc2";
exec(_P_WAIT,"sterrdlg",1,&command_arg);
END
END
END
END
END
It's a commandline tool I wrote about a year ago for this purpose. Be carefull with 8 bit images though, palettes are not
handled properly.
Usag of the program: bgdi mapconvert.dcb filename.png
will convert png to map.
If you write a batch file you can create a batch conversion proces with this tool.