mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-15 09:11:59 +00:00
Merge branch 'apng-oh-shit-fixes' into 'master'
Compiling errors for apng fixed See merge request KartKrew/Kart-Public!69
This commit is contained in:
commit
a6315f895d
2 changed files with 42 additions and 3 deletions
29
src/apng.c
29
src/apng.c
|
@ -25,6 +25,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include "apng.h"
|
#include "apng.h"
|
||||||
|
|
||||||
|
#define APNG_INFO_acTL 0x20000U
|
||||||
|
|
||||||
#define APNG_WROTE_acTL 0x10000U
|
#define APNG_WROTE_acTL 0x10000U
|
||||||
|
|
||||||
struct apng_info_def
|
struct apng_info_def
|
||||||
|
@ -59,6 +61,10 @@ size_t apng_default_tell (png_structp);
|
||||||
#endif/* PNG_STDIO_SUPPORTED */
|
#endif/* PNG_STDIO_SUPPORTED */
|
||||||
void apng_write_IEND (png_structp);
|
void apng_write_IEND (png_structp);
|
||||||
void apng_write_acTL (png_structp, png_uint_32, png_uint_32);
|
void apng_write_acTL (png_structp, png_uint_32, png_uint_32);
|
||||||
|
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||||
|
png_uint_32 apng_set_acTL_dummy (png_structp, png_infop,
|
||||||
|
png_uint_32, png_uint_32);
|
||||||
|
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||||
|
|
||||||
apng_infop
|
apng_infop
|
||||||
apng_create_info_struct (png_structp pngp)
|
apng_create_info_struct (png_structp pngp)
|
||||||
|
@ -145,7 +151,7 @@ apng_default_tell (png_structp pngp)
|
||||||
|
|
||||||
void
|
void
|
||||||
apng_set_write_fn (png_structp pngp, apng_infop ainfop, png_voidp iop,
|
apng_set_write_fn (png_structp pngp, apng_infop ainfop, png_voidp iop,
|
||||||
png_rw_ptr write_f, png_flush_ptr flush_f,
|
png_rw_ptr write_f, png_flush_ptr flush_f,
|
||||||
apng_seek_ptr seek_f, apng_tell_ptr tell_f)
|
apng_seek_ptr seek_f, apng_tell_ptr tell_f)
|
||||||
{
|
{
|
||||||
if (!( pngp && ainfop ))
|
if (!( pngp && ainfop ))
|
||||||
|
@ -204,7 +210,7 @@ apng_set_acTL (png_structp pngp, png_infop infop, apng_infop ainfop,
|
||||||
ainfop->num_frames = frames;
|
ainfop->num_frames = frames;
|
||||||
ainfop->num_plays = plays;
|
ainfop->num_plays = plays;
|
||||||
|
|
||||||
ainfop->valid |= PNG_INFO_acTL;
|
ainfop->valid |= APNG_INFO_acTL;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -218,7 +224,7 @@ apng_write_info_before_PLTE (png_structp pngp, png_infop infop,
|
||||||
|
|
||||||
png_write_info_before_PLTE(pngp, infop);
|
png_write_info_before_PLTE(pngp, infop);
|
||||||
|
|
||||||
if (( ainfop->valid & PNG_INFO_acTL ) &&!( ainfop->mode & APNG_WROTE_acTL ))
|
if (( ainfop->valid & APNG_INFO_acTL )&&!( ainfop->mode & APNG_WROTE_acTL ))
|
||||||
{
|
{
|
||||||
ainfop->start_acTL = apng_tell(pngp, ainfop);
|
ainfop->start_acTL = apng_tell(pngp, ainfop);
|
||||||
|
|
||||||
|
@ -253,6 +259,19 @@ apng_write_end (png_structp pngp, png_infop infop, apng_infop ainfop)
|
||||||
#endif/* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED */
|
#endif/* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||||
|
png_uint_32
|
||||||
|
apng_set_acTL_dummy (png_structp pngp, png_infop infop,
|
||||||
|
png_uint_32 frames, png_uint_32 plays)
|
||||||
|
{
|
||||||
|
(void)pngp;
|
||||||
|
(void)infop;
|
||||||
|
(void)frames;
|
||||||
|
(void)plays;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||||
|
|
||||||
/* Dynamic runtime linking capable! (Hopefully.) */
|
/* Dynamic runtime linking capable! (Hopefully.) */
|
||||||
void
|
void
|
||||||
apng_set_set_acTL_fn (png_structp pngp, apng_infop ainfop,
|
apng_set_set_acTL_fn (png_structp pngp, apng_infop ainfop,
|
||||||
|
@ -260,7 +279,11 @@ apng_set_set_acTL_fn (png_structp pngp, apng_infop ainfop,
|
||||||
{
|
{
|
||||||
(void)pngp;
|
(void)pngp;
|
||||||
if (!ainfop->set_acTL_fn)
|
if (!ainfop->set_acTL_fn)
|
||||||
|
#ifndef PNG_WRITE_APNG_SUPPORTED
|
||||||
|
ainfop->set_acTL_fn = &apng_set_acTL_dummy;
|
||||||
|
#else
|
||||||
ainfop->set_acTL_fn = &png_set_acTL;
|
ainfop->set_acTL_fn = &png_set_acTL;
|
||||||
|
#endif/* PNG_WRITE_APNG_SUPPORTED */
|
||||||
else
|
else
|
||||||
ainfop->set_acTL_fn = set_acTL_f;
|
ainfop->set_acTL_fn = set_acTL_f;
|
||||||
}
|
}
|
||||||
|
|
16
src/apng.h
16
src/apng.h
|
@ -23,6 +23,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef APNG_H
|
#ifndef APNG_H
|
||||||
#define APNG_H
|
#define APNG_H
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
#ifndef _WII
|
||||||
|
#ifndef _LARGEFILE64_SOURCE
|
||||||
|
#define _LARGEFILE64_SOURCE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _LFS64_LARGEFILE
|
||||||
|
#define _LFS64_LARGEFILE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _FILE_OFFSET_BITS
|
||||||
|
#define _FILE_OFFSET_BITS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
|
|
||||||
typedef struct apng_info_def apng_info;
|
typedef struct apng_info_def apng_info;
|
||||||
|
|
Loading…
Reference in a new issue