- Implementada polifonia en Chirping

- Arreglats un montó de warnings per lo mon
This commit is contained in:
2023-01-09 17:02:04 +01:00
parent bfcd7e62cf
commit c7dcf8bb8e
8 changed files with 106 additions and 150 deletions

60
gif.c
View File

@@ -295,7 +295,6 @@ unsigned char* process_image_descriptor( unsigned char* buffer,
int resolution_bits )
{
image_descriptor_t image_descriptor;
int disposition;
int compressed_data_length;
unsigned char *compressed_data = NULL;
unsigned char lzw_code_size;
@@ -307,8 +306,6 @@ unsigned char* process_image_descriptor( unsigned char* buffer,
// TODO if LCT = true, read the LCT
disposition = 1;
READ(&lzw_code_size, 1);
compressed_data_length = read_sub_blocks( buffer, &compressed_data );
@@ -330,59 +327,6 @@ unsigned char* process_image_descriptor( unsigned char* buffer,
return uncompressed_data;
}
static int process_extension( unsigned char* buffer )
{
/*extension_t extension;
graphic_control_extension_t gce;
application_extension_t application;
plaintext_extension_t plaintext;
unsigned char *extension_data = NULL;
int extension_data_length;*/
/* switch ( extension.extension_code )
{
case GRAPHIC_CONTROL:
READ(&gce, 4);
break;
case APPLICATION_EXTENSION:
READ(&application, extension.block_size);
break;
case 0xFE:
// comment extension; do nothing - all the data is in the
// sub-blocks that follow.
break;
case 0x01:
READ(&plaintext, 12);
break;
default:
fprintf( stderr, "Unrecognized extension code.\n" );
exit( 0 );
}*/
unsigned char extension, size;
READ(&extension, 1);
READ(&size, 1);
buffer += size;
unsigned char block_size;
do {
READ(&block_size, 1);
buffer += block_size;
} while (block_size != 0);
/*
// All extensions are followed by data sub-blocks; even if it's
// just a single data sub-block of length 0
extension_data_length = read_sub_blocks( buffer, &extension_data );
if ( extension_data != NULL )
free( extension_data );
*/
return 1;
}
/**
* @param gif_file the file descriptor of a file containing a
* GIF-encoded file. This should point to the first byte in
@@ -393,7 +337,7 @@ static int process_extension( unsigned char* buffer )
uint32_t* LoadPalette(unsigned char *buffer) {
unsigned char header[7];
screen_descriptor_t screen_descriptor;
int color_resolution_bits;
//int color_resolution_bits;
int global_color_table_size = 0; // number of entries in global_color_table
uint32_t *global_color_table = NULL;
@@ -401,7 +345,7 @@ uint32_t* LoadPalette(unsigned char *buffer) {
READ(header, 6);
READ(&screen_descriptor, 7);
color_resolution_bits = ((screen_descriptor.fields & 0x70) >> 4) + 1;
//color_resolution_bits = ((screen_descriptor.fields & 0x70) >> 4) + 1;
global_color_table = (uint32_t *)calloc(1, 1024);
if (screen_descriptor.fields & 0x80) {