[ --disable-lame don't compile any L.A.M.E. mp3 encoding code in], DISABLE_LAME=true)
PACKAGE=swftools
-VERSION=2007-04-28-2027
+VERSION=2007-12-11-1640
# ------------------------------------------------------------------
exit(1);
}
if(mw->length - w->pos < len) {
- unsigned char*newmem;
int newlength = mw->length;
while(newlength - w->pos < len) {
newlength += mw->grow;
}
#ifdef NO_REALLOC
- newmem = (unsigned char*)malloc(newlength);
+ unsigned char*newmem = (unsigned char*)malloc(newlength);
memcpy(newmem, mw->data, mw->length);
free(mw->data);
mw->data = newmem;
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <memory.h>
#include <string.h>
#include <math.h>
#include "../gfxdevice.h"
#include "../gfxtools.h"
#include "../art/libart.h"
+#include "artsutils.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <memory.h>
+#include <string.h>
#include "../types.h"
#include "../mem.h"
#include "../gfxdevice.h"
#include <stdlib.h>
#include <stdio.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
+#include <string.h>
#include <memory.h>
#include "../gfxdevice.h"
internal_t*i = (internal_t*)dev->internal;
}
-void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, char*action)
+void file_drawlink(struct _gfxdevice*dev, gfxline_t*line, const char*action)
{
internal_t*i = (internal_t*)dev->internal;
fprintf(i->fi, "drawlink %s\n", action);
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <memory.h>
+#include <string.h>
#include "../types.h"
#include "../mem.h"
#include "../gfxdevice.h"
}*/
while(line) {
- int x1,y1,x2,y2,x3,y3;
-
if(line->type == gfx_moveTo) {
} else if(line->type == gfx_lineTo) {
double x1=x*i->zoom,y1=y*i->zoom;
add_solidline(dev, x1, y1, x3, y3, width * i->multiply);
fill_solid(dev, color);
} else if(line->type == gfx_splineTo) {
- int t,parts,qparts;
+ int t,parts;
double xx,yy;
double x1=x*i->zoom,y1=y*i->zoom;
void gfxdevice_render_init(gfxdevice_t*dev)
{
internal_t*i = (internal_t*)rfx_calloc(sizeof(internal_t));
- int y;
memset(dev, 0, sizeof(gfxdevice_t));
dev->name = "render";
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <memory.h>
#include <math.h>
+#include <string.h>
+#include "rescale.h"
#include "../types.h"
#include "../mem.h"
#include "../gfxdevice.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
#ifdef HAVE_ASSERT_H
#include <assert.h>
#else
char left = 0,recurse=0;
int t;
int probes = 15;
- double dx,dy;
/* create simple approximation: a qspline which run's through the
qspline point at 0.5 */
/* convert control point representation to
d*x^3 + c*x^2 + b*x + a */
+ double dx,dy;
dx= s->end.x - s->control2.x*3 + s->control1.x*3 - s->start.x;
dy= s->end.y - s->control2.y*3 + s->control1.y*3 - s->start.y;
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __NT__
-#include "stdafx.h"
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#ifdef WIN32
+//#include "stdafx.h"
#include <malloc.h>
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#else
#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
#include <unistd.h>
#endif
char pool2[26] = {0x01,0x00,0x00,0x00,0x73,0x74,0x6f,0x70,0x5f,0x66,0x6c,0x61,0x2e,0x4d,0x61,0x69
,0x6e,0x54,0x69,0x6d,0x65,0x6c,0x69,0x6e,0x65,0x00};
TAG * classCall = swf_InsertTagBefore(swf, swf->firstTag, 0x04c);
- swf_SetBlock(classCall, pool2, sizeof(pool2));
+ swf_SetBlock(classCall, (U8*)pool2, sizeof(pool2));
//0x52 is the Flash9 equivalent to DoAction
char init_pool[322] = { 0x01,0x00,0x00,0x00, /* Flag Parameter to 0x52 */
TAG *classInit = swf_InsertTagBefore(swf, swf->firstTag, 0x052);
/* Copy the environment Initialization code */
- swf_SetBlock(classInit, init_pool,sizeof(init_pool));
+ swf_SetBlock(classInit, (U8*)init_pool,sizeof(init_pool));
/* Copy Constructor Method header */
- swf_SetBlock(classInit, constructor_header, sizeof(constructor_header));
+ swf_SetBlock(classInit, (U8*)constructor_header, sizeof(constructor_header));
/* Add Code block size (u30) to the method header */
- swf_SetBlock(classInit, code_len, clen_len);
+ swf_SetBlock(classInit, (U8*)code_len, clen_len);
/* Copy Constructor Method body first part */
- swf_SetBlock(classInit, constructor_first, sizeof(constructor_first));
+ swf_SetBlock(classInit, (U8*)constructor_first, sizeof(constructor_first));
/* Register the callback for every frame */
for (i = 0; i < frame_nums; ++i) {
AVM2_uint32toU30(i,constructor_frame_register + 3); // Write current frame number
- swf_SetBlock(classInit, constructor_frame_register, sizeof(constructor_frame_register));
+ swf_SetBlock(classInit, (U8*)constructor_frame_register, sizeof(constructor_frame_register));
}
/* Copy Constructor method body ending, just a return */
- swf_SetBlock(classInit, constructor_return, sizeof(constructor_return));
+ swf_SetBlock(classInit, (U8*)constructor_return, sizeof(constructor_return));
/* Copy the script init code */
- swf_SetBlock(classInit, script_init_pool, sizeof(script_init_pool));
+ swf_SetBlock(classInit, (U8*)script_init_pool, sizeof(script_init_pool));
}
JPEGBITS *jpeg;
int y;
jpeg = swf_SetJPEGBitsStart(tag, width, height, quality);
+ U8 *scanline = (U8*)rfx_alloc(3 * width);
for (y = 0; y < height; y++) {
- U8 scanline[3 * width];
int x, p = 0;
for (x = 0; x < width; x++) {
scanline[p++] = bitmap[width * y + x].r;
}
swf_SetJPEGBitsLine(jpeg, scanline);
}
+ rfx_free(scanline);
swf_SetJPEGBitsFinish(jpeg);
}
pos = tag->len;
swf_SetU32(tag, 0); //placeholder
jpeg = swf_SetJPEGBitsStart(tag, width, height, quality);
+ U8 *scanline = (U8*)rfx_alloc(3 * width);
for (y = 0; y < height; y++) {
- U8 scanline[3 * width];
int x, p = 0;
for (x = 0; x < width; x++) {
//int ia = bitmap[width*y+x].a;
}
swf_SetJPEGBitsLine(jpeg, scanline);
}
+ rfx_free(scanline);
swf_SetJPEGBitsFinish(jpeg);
PUT32(&tag->data[pos], tag->len - pos - 4);
zs.next_out = data;
zs.avail_out = OUTBUFFER_SIZE;
+ scanline = (U8*)rfx_alloc(width);
for (y = 0; y < height; y++) {
- U8 scanline[width];
int x, p = 0;
for (x = 0; x < width; x++) {
scanline[p++] = bitmap[width * y + x].a;
}
}
+ rfx_free(scanline);
+
while (1) {
int ret = deflate(&zs, Z_FINISH);
if (ret != Z_OK && ret != Z_STREAM_END) {
SWFFONT* font;
int t;
int*glyph2glyph;
- FT_Size size;
int max_unicode = 0;
int charmap = -1;
for(t=0; t < face->num_glyphs; t++) {
FT_Glyph glyph;
FT_BBox bbox;
- FT_Matrix matrix;
char name[128];
drawer_t draw;
- int ret;
char hasname = 0;
name[0]=0;
if(FT_HAS_GLYPH_NAMES(face)) {
for(t=fillstylestart;t<shape->numfillstyles;t++)
{
int type;
- U8*pos;
FILLSTYLE*dest = &shape->fillstyles[t];
type = swf_GetU8(tag); //type
shape->fillstyles[t].type = type;
void swf_Shape2ToShape(SHAPE2*shape2, SHAPE*shape)
{
TAG*tag = swf_InsertTag(0,0);
- SHAPELINE*l,*next;
+ SHAPELINE*l;
int newx=0,newy=0,lastx=0,lasty=0,oldls=0,oldfs0=0,oldfs1=0;
memset(shape, 0, sizeof(SHAPE));
{
int num = 0, id;
U16 fill,line;
- SRECT r;
- SRECT r2;
SHAPELINE*l;
if(tag->id == ST_DEFINESHAPE)
num = 1;
int swf_FontExtract_GlyphNames(int id, SWFFONT * f, TAG * tag)
{
U16 fid;
- U16 maxcode;
- U8 flags;
swf_SaveTagPos(tag);
swf_SetTagPos(tag, 0);
void swf_FontSort(SWFFONT * font)
{
- int i, j, k;
+ int i, j;
int *newplace;
int *newpos;
if (!font)
U8 flags = 0;
int t;
int pos;
- int pos2;
swf_SetU16(tag, f->id);
if (f->layout) flags |= 128; // haslayout
for(t=0;t<count;t++)
{
int type;
- U8*pos;
type = swf_GetU8(tag); //type
DEBUG_ENUMERATE printf("fill style %d) %02x (tagpos=%d)\n", t, type, tag->pos);
if(type == 0) {
}
while(1)
{
- U16 charid;
if(!swf_GetU8(tag)) //flags
break;
callback(tag, tag->pos + base, callback_data);
+#include "Object.h"
#include "SplashTypes.h"
#include "SplashOutputDev.h"
#include "SplashPath.h"
#include "lame/lame.h"
#endif
#endif
-#ifdef __cplusplus
-}
-#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+
#include "./bitio.h"
#include "./MD5.h"
void swf_GetGradient(TAG * tag, GRADIENT * gradient, char alpha)
{
- GRADIENT dummy;
int t;
if(!tag) {
memset(gradient, 0, sizeof(GRADIENT));
{
char*md5string1, *md5string2;
char*x;
- char*md5, *salt;
+ char*salt;
int n;
if(t->len >= 5 && t->pos==0 &&
void swf_FoldSprite(TAG * t)
{
TAG*sprtag=t,*tmp;
- U16 id,frames,tmpid;
+ U16 id,frames;
int level;
if(t->id!=ST_DEFINESPRITE)
return;
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <fcntl.h>
#include <ctype.h>
#include "../config.h"
#include "./mem.h"
#include "./types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define DEBUG_RFXSWF
#ifdef RFXSWF_DISABLESOUND
#define NO_MP3
void AVM2_InsertStops(SWF*swf);
+#ifdef __cplusplus
+}
+#endif
+
#endif