commit b4ff14737a95f99ee86c50e5001a57f1090e4c46
parent 1ef7ea3711d9d17da918d77132744bb56ff9d038
Author: ByteProject <stefan.vogt@byteproject.net>
Date: Mon, 20 Feb 2012 21:24:51 +0100
wiped old stuff
Diffstat:
M | ansilove/ansilove.c | | | 418 | ++----------------------------------------------------------------------------- |
1 file changed, 6 insertions(+), 412 deletions(-)
diff --git a/ansilove/ansilove.c b/ansilove/ansilove.c
@@ -1761,11 +1761,8 @@ void alIcedrawLoader(char *input, char output[], char bits[], bool fileHasSAUCE)
loop = 12;
int32_t idf_sequence_length, idf_sequence_loop, i = 0;
- // dynamic IDF buffer
- unsigned char *idf_buffer;
-
-// idf_buffer = (unsigned char *) malloc(sizeof(unsigned char)*input_file_size);
- idf_buffer = (unsigned char *) malloc(16640);
+ // static IDF buffer (for now)
+ unsigned char *idf_buffer = (unsigned char *) malloc(16640);
int16_t idf_data, idf_data_length;
@@ -1773,7 +1770,8 @@ void alIcedrawLoader(char *input, char output[], char bits[], bool fileHasSAUCE)
{
memcpy(&idf_data,input_file_buffer+loop,2);
- if (idf_data==1) // RLE compressed data
+ // RLE compressed data
+ if (idf_data==1)
{
memcpy(&idf_data_length,input_file_buffer+loop+2,2);
@@ -1788,7 +1786,8 @@ void alIcedrawLoader(char *input, char output[], char bits[], bool fileHasSAUCE)
loop += 4;
}
- else { // Normal character
+ else {
+ // normal character
idf_buffer[i] = input_file_buffer[loop];
idf_buffer[i+1] = input_file_buffer[loop + 1];
i+=2;
@@ -1841,117 +1840,6 @@ void alIcedrawLoader(char *input, char output[], char bits[], bool fileHasSAUCE)
gdImageDestroy(im_InvertFont);
}
-// $loop=12;
-//
-// while ($loop<$input_file_size-4096-48)
-// {
-// $idf_data=unpack('vdata',substr($input_file_buffer,$loop,2));
-// if ($idf_data['data']==1)
-// {
-// $idf_data=unpack('vlength',substr($input_file_buffer,$loop+2,2));
-//
-// $idf_sequence_length=$idf_data['length'] & 255;
-// $idf_data=unpack('Ccharacter/Cattribute',substr($input_file_buffer,$loop+4,2));
-//
-// for ($idf_sequence_loop=0;$idf_sequence_loop<$idf_sequence_length;$idf_sequence_loop++)
-// {
-// $idf_buffer[]=$idf_data['character'];
-// $idf_buffer[]=$idf_data['attribute'];
-// }
-//
-// $loop+=4;
-// }
-// else
-// {
-// $idf_data=unpack('Ccharacter/Cattribute',substr($input_file_buffer,$loop,2));
-//
-// $idf_buffer[]=$idf_data['character'];
-// $idf_buffer[]=$idf_data['attribute'];
-// }
-//
-// $loop+=2;
-// }
-//
-//
-//
-// /*****************************************************************************/
-// /* ALLOCATE IMAGE BUFFER MEMORY */
-// /*****************************************************************************/
-//
-// if (!$idf = imagecreate(($idf_header['x2']+1)*8,(sizeof($idf_buffer)/2/80)*16))
-// {
-// error("Can't allocate buffer image memory");
-// }
-//
-// imagecolorallocate($idf,0,0,0);
-//
-//
-//
-// /*****************************************************************************/
-// /* RENDER IDF */
-// /*****************************************************************************/
-//
-// for ($loop=0;$loop<sizeof($idf_buffer);$loop+=2)
-// {
-// if ($position_x==$idf_header['x2']+1)
-// {
-// $position_x=0;
-// $position_y++;
-// }
-//
-// $character=$idf_buffer[$loop];
-// $attribute=$idf_buffer[$loop+1];
-//
-// $color_background=($attribute & 240)>>4;
-// $color_foreground=$attribute & 15;
-//
-// imagecopy($idf,$background,$position_x*8,$position_y*16,$color_background*8,0,8,16);
-// imagecopy($idf,$font,$position_x*8,$position_y*16,$character*8,$color_foreground*16,8,16);
-//
-// $position_x++;
-// }
-//
-//
-//
-// /*****************************************************************************/
-// /* CREATE OUTPUT FILE */
-// /*****************************************************************************/
-//
-// if ($thumbnail)
-// {
-// $position_y_max=$position_y;
-// $columns=80;
-// font_size_y = 16;
-//
-// thumbnail($idf,$output,$columns,font_size_y,$position_y_max);
-// }
-// else
-// {
-// if ($output=='online')
-// {
-// Header("Content-type: image/png");
-// ImagePNG($idf);
-// }
-// else
-// {
-// ImagePNG($idf,$output);
-// }
-// }
-//
-//
-//
-///*****************************************************************************/
-///* FREE MEMORY */
-///*****************************************************************************/
-//
-// imagedestroy($idf);
-// imagedestroy($background);
-// imagedestroy($font);
-// imagedestroy($font_inverted);
-//}
-//
-//
-
// TUNDRA
void alTundraLoader(char *input, char output[], char font[], char bits[])
{
@@ -2168,300 +2056,6 @@ void alTundraLoader(char *input, char output[], char font[], char bits[])
gdImageDestroy(im_Tundra);
}
-///*****************************************************************************/
-///* LOAD TUNDRA */
-///*****************************************************************************/
-//
-//function load_tundra($input,$output,$font,$bits)
-//{
-// check_libraries();
-//
-///*****************************************************************************/
-///* CHECK PARAMETERS AND FORCE DEFAULT VALUES IF INVALID INPUT IS DETECTED */
-///*****************************************************************************/
-//
-// $columns=80;
-//
-// if ($bits=='thumbnail')
-// {
-// $thumbnail=TRUE;
-// }
-// if ($bits!=8 && $bits!=9)
-// {
-// $bits=8;
-// }
-//
-// switch($font)
-// {
-// case '80x25':
-// font_file = "ansilove_font_pc_80x25.png';
-// font_size_x = 9;
-// font_size_y = 16;
-// break;
-//
-// case '80x50':
-// font_file = "ansilove_font_pc_80x50.png';
-// font_size_x = 9;
-// font_size_y = 8;
-// break;
-//
-// default:
-// font_file = "ansilove_font_pc_80x25.png';
-// font_size_x = 9;
-// font_size_y = 16;
-// }
-//
-//
-//
-///*****************************************************************************/
-///* LOAD INPUT FILE */
-///*****************************************************************************/
-//
-// if (!$input_file = fopen($input,'r'))
-// {
-// error("Can't open file $input");
-// }
-//
-// $input_file_sauce=load_sauce($input);
-//
-// if ($input_file_sauce!=NULL)
-// {
-// $input_file_size=$input_file_sauce['FileSize'];
-// }
-// else
-// {
-// $input_file_size=filesize($input);
-// }
-//
-// if (!$input_file_buffer = fread($input_file,$input_file_size))
-// {
-// error("Can't read file $input");
-// }
-//
-// fclose($input_file);
-//
-//
-//
-///*****************************************************************************/
-///* EXTRACT TUNDRA HEADER */
-///*****************************************************************************/
-//
-// $tundra_header['value']=$input_file_buffer[0];
-// $tundra_header['string']=substr($input_file_buffer,1,8);
-//
-// if (ord($tundra_header['value'])!=24 || $tundra_header['string']!='TUNDRA24')
-// {
-// error("$input is not a TUNDRA file");
-// }
-//
-//
-//
-///*****************************************************************************/
-///* LOAD BACKGROUND/FONT AND ALLOCATE IMAGE BUFFER MEMORY */
-///*****************************************************************************/
-//
-// if (!$background = imagecreatefrompng(dirname(__FILE__).'/fonts/ansilove_background.png'))
-// {
-// error("Can't open file ansilove_background.png");
-// }
-//
-// if (!$font = imagecreatefrompng(dirname(__FILE__).'/fonts/'.font_file))
-// {
-// error("Can't open file font_file");
-// }
-//
-// imagecolorset($font,20,0,0,0);
-//
-//
-//
-///*****************************************************************************/
-///* READ TUNDRA FILE A FIRST TIME TO FIND THE IMAGE SIZE */
-///*****************************************************************************/
-//
-// $loop=9;
-//
-// while ($loop<$input_file_size)
-// {
-// if ($position_x==80)
-// {
-// $position_x=0;
-// $position_y++;
-// }
-//
-// $character=ord($input_file_buffer[$loop]);
-//
-// if ($character==1)
-// {
-// $tundra_position_array=unpack('Nposition_y/Nposition_x',substr($input_file_buffer,$loop+1,8));
-// $position_y=$tundra_position_array['position_y'];
-// $position_x=$tundra_position_array['position_x'];
-//
-// $loop+=8;
-// }
-//
-// if ($character==2)
-// {
-// $loop+=5;
-// }
-//
-// if ($character==4)
-// {
-// $loop+=5;
-// }
-//
-// if ($character==6)
-// {
-// $loop+=9;
-// }
-//
-// if ($character!=1 && $character!=2 && $character!=4 && $character!=6)
-// {
-// $position_x++;
-// }
-//
-// $loop++;
-// }
-//
-// $position_y++;
-//
-//
-//
-///*****************************************************************************/
-///* ALLOCATE IMAGE BUFFER MEMORY */
-///*****************************************************************************/
-//
-// if (!$tundra = imagecreate($columns*$bits,($position_y)*font_size_y))
-// {
-// error("Can't allocate buffer image memory");
-// }
-//
-// imagecolorallocate($tundra,0,0,0);
-//
-//
-//
-///*****************************************************************************/
-///* PROCESS TUNDRA FILE */
-///*****************************************************************************/
-//
-// $position_x=0;
-// $position_y=0;
-//
-// $loop=9;
-//
-// while ($loop<$input_file_size)
-// {
-// if ($position_x==$columns)
-// {
-// $position_x=0;
-// $position_y++;
-// }
-//
-// $character=ord($input_file_buffer[$loop]);
-//
-// if ($character==1)
-// {
-// $tundra_position_array=unpack('Nposition_y/Nposition_x',substr($input_file_buffer,$loop+1,8));
-// $position_y=$tundra_position_array['position_y'];
-// $position_x=$tundra_position_array['position_x'];
-//
-// $loop+=8;
-// }
-//
-// if ($character==2)
-// {
-// $tundra_color_array=unpack('Ncolor_foreground',substr($input_file_buffer,$loop+2,4));
-// $color_foreground=$tundra_color_array['color_foreground'];
-// $red=($color_foreground>>16) & 0x000000FF;
-// $green=($color_foreground>>8) & 0x000000FF;
-// $blue=$color_foreground & 0x000000FF;
-// imagecolorset($font,0,$red,$green,$blue);
-//
-// $character=ord($input_file_buffer[$loop+1]);
-//
-// $loop+=5;
-// }
-//
-//
-// if ($character==4)
-// {
-// $tundra_color_array=unpack('Ncolor_background',substr($input_file_buffer,$loop+2,4));
-// $color_background=$tundra_color_array['color_background'];
-// $red=($color_background>>16) & 0x000000FF;
-// $green=($color_background>>8) & 0x000000FF;
-// $blue=$color_background & 0x000000FF;
-// imagecolorset($font,20,$red,$green,$blue);
-//
-// $character=ord($input_file_buffer[$loop+1]);
-//
-// $loop+=5;
-// }
-//
-// if ($character==6)
-// {
-// $tundra_color_array=unpack('Ncolor_foreground/Ncolor_background',substr($input_file_buffer,$loop+2,8));
-// $color_foreground=$tundra_color_array['color_foreground'];
-// $red=($color_foreground>>16) & 0x000000FF;
-// $green=($color_foreground>>8) & 0x000000FF;
-// $blue=$color_foreground & 0x000000FF;
-// imagecolorset($font,0,$red,$green,$blue);
-//
-// $color_background=$tundra_color_array['color_background'];
-// $red=($color_background>>16) & 0x000000FF;
-// $green=($color_background>>8) & 0x000000FF;
-// $blue=$color_background & 0x000000FF;
-// imagecolorset($font,20,$red,$green,$blue);
-//
-// $character=ord($input_file_buffer[$loop+1]);
-//
-// $loop+=9;
-// }
-//
-// if ($character!=1 && $character!=2 && $character!=4 && $character!=6)
-// {
-// imagecopy($tundra,$font,$position_x*$bits,$position_y*font_size_y,$character*font_size_x,0,$bits,font_size_y);
-//
-// $position_x++;
-// }
-//
-// $loop++;
-// }
-//
-//
-//
-///*****************************************************************************/
-///* CREATE OUTPUT FILE */
-///*****************************************************************************/
-//
-// if ($thumbnail)
-// {
-// $position_y_max=$position_y;
-//
-// thumbnail($tundra,$output,$columns,font_size_y,$position_y_max);
-// }
-// else
-// {
-// if ($output=='online')
-// {
-// Header("Content-type: image/png");
-// ImagePNG($tundra);
-// }
-// else
-// {
-// ImagePNG($tundra,$output);
-// }
-// }
-//
-//
-//
-///*****************************************************************************/
-///* FREE MEMORY */
-///*****************************************************************************/
-//
-// imagedestroy($tundra);
-// imagedestroy($background);
-// imagedestroy($font);
-//}
-
// XBin
void alXbinLoader(char *input, char output[], char bits[])
{