#include "../config.h"
#include "./bitio.h"
#include "./drawer.h"
+#include "./mem.h"
#define DEBUG_RFXSWF
#ifdef RFXSWF_DISABLESOUND
#define REVERSESWAP32(s) (REVERSESWAP16(((s)>>16)&0x0000ffff)|((REVERSESWAP16(s)<<16)&0xffff0000))
#endif
-#define ALLOC_ARRAY(type, num) (((type)*)rfxalloc(sizeof(type)*(num)))
-void* rfx_alloc(int size);
-void* rfx_calloc(int size);
-void* rfx_realloc(void*data, int size);
-void rfx_free(void*data);
-#ifdef MEMORY_INFO
-long rfx_memory_used();
-char* rfx_memory_used_str();
-#endif
-
// SWF Types
typedef unsigned long U32;
RGBA* swf_JPEG2TagToImage(TAG*tag, int*width, int*height);
void swf_RemoveJPEGTables(SWF*swf);
+void swf_SaveJPEG(char*filename, RGBA*pixels, int width, int height, int quality);
+
#define BYTES_PER_SCANLINE(width) ((width+3)&0xfffffffc)
#define BMF_8BIT 3 // Bitmap formats
void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples);
void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int seek, char first); /* expects 2304 samples */
void swf_SetSoundDefine(TAG*tag, S16*samples, int num);
+void swf_SetSoundDefineMP3(TAG*tag, U8* data, unsigned length,
+ unsigned SampRate,
+ unsigned Channels,
+ unsigned NumFrames);
void swf_SetSoundInfo(TAG*tag, SOUNDINFO*info);
// swftools.c
U8 swf_isAllowedSpriteTag(TAG * t);
U8 swf_isImageTag(TAG*tag);
U8 swf_isShapeTag(TAG*tag);
+U8 swf_isTextTag(TAG*tag);
+U8 swf_isFontTag(TAG*tag);
U8 swf_isPlaceTag(TAG*tag);
U16 swf_GetDefineID(TAG * t);
struct _ActionTAG * prev;
struct _ActionTAG * parent;
- U8 tmp[4]; // store small operands here.
+ U8 tmp[8]; // store small operands here.
} ActionTAG;
typedef struct _ActionMarker
void*internal;
} RENDERBUF;
-void swf_Render_Init(RENDERBUF*buf, int posx, int posy, int width, int height, char antialize, int scale);
+void swf_Render_Init(RENDERBUF*buf, int posx, int posy, int width, int height, int antialize, int multiply);
void swf_Render_SetBackground(RENDERBUF*buf, RGBA*img, int width, int height);
void swf_Render_SetBackgroundColor(RENDERBUF*buf, RGBA color);
RGBA* swf_Render(RENDERBUF*dest);