#else
#define assert(a)
#endif
-#define logf logarithmf // logf is also used by ../lib/log.h
#include <math.h>
-#undef logf
#include "swfoutput.h"
#include "spline.h"
extern "C" {
tag->id != ST_DEFINESHAPE2 &&
tag->id != ST_DEFINESHAPE3)
{
- logf("<error> internal error: drawpath needs a shape tag, not %d\n",tag->id);
+ msg("<error> internal error: drawpath needs a shape tag, not %d\n",tag->id);
exit(1);
}
double x=0,y=0;
spline(tag,p0,p1,p2,p3,m);
}
else {
- logf("<error> drawpath: unknown outline type:%d\n", outline->type);
+ msg("<error> drawpath: unknown outline type:%d\n", outline->type);
}
lastx=x;
lasty=y;
tag->id != ST_DEFINESHAPE &&
tag->id != ST_DEFINESHAPE2 &&
tag->id != ST_DEFINESHAPE3) {
- logf("<error> internal error: drawpath needs a shape tag, not %d\n",tag->id);
+ msg("<error> internal error: drawpath needs a shape tag, not %d\n",tag->id);
exit(1);
}
assert(shapeid>=0);
if(tag->id != ST_DEFINETEXT &&
tag->id != ST_DEFINETEXT2) {
- logf("<error> internal error: putcharacters needs an text tag, not %d\n",tag->id);
+ msg("<error> internal error: putcharacters needs an text tag, not %d\n",tag->id);
exit(1);
}
if(!chardatapos) {
- logf("<warning> putcharacters called with zero characters");
+ msg("<warning> putcharacters called with zero characters");
}
for(pass = 0; pass < 2; pass++)
char* charname = character;
if(!outline) {
- logf("<warning> Didn't find %s in current charset (%s)",
+ msg("<warning> Didn't find %s in current charset (%s)",
FIXNULL(character),FIXNULL(font->getName()));
return;
}
if(!charnum)
return;
- logf("<verbose> Font %s(%d): Storing %d outlines.\n", FIXNULL(name), id, charnum);
+ msg("<verbose> Font %s(%d): Storing %d outlines.\n", FIXNULL(name), id, charnum);
this->standardtablesize = 256;
if(this->charnum < this->standardtablesize)
if(usednum && !drawonlyshapes)
{
- logf("<verbose> Font %s has %d used characters",FIXNULL(fontid), usednum);
+ msg("<verbose> Font %s has %d used characters",FIXNULL(fontid), usednum);
TAG*ftag = swf_InsertTag(swf.firstTag,ST_DEFINEFONT);
swf_SetU16(ftag, this->swfid);
int initpos = swf_GetTagLen(ftag);
return getOutline(this->standardtable[charnr], -1);
}
- logf("<warning> Didn't find character '%s' in font '%s'", FIXNULL(name), this->name);
+ msg("<warning> Didn't find character '%s' in font '%s'", FIXNULL(name), this->name);
return 0;
}
if(this->standardtable && charnr>=0 && charnr < this->standardtablesize) {
return getSWFCharID(this->standardtable[charnr], -1);
}
- logf("<warning> Didn't find character '%s' in font '%s'", FIXNULL(name), this->name);
+ msg("<warning> Didn't find character '%s' in font '%s'", FIXNULL(name), this->name);
return 0;
}
}
if(t1id<0) {
- logf("<error> internal error: t1id:%d, fontid:%s\n", t1id,FIXNULL(fontid));
+ msg("<error> internal error: t1id:%d, fontid:%s\n", t1id,FIXNULL(fontid));
}
SWFFont*font = new SWFFont(fontid, t1id, filename);
sizex = _sizex;
sizey = _sizey;
- logf("<verbose> initializing swf output for size %d*%d\n", sizex,sizey);
+ msg("<verbose> initializing swf output for size %d*%d\n", sizex,sizey);
obj->font = 0;
fi = 1; // stdout
if(fi<=0) {
- logf("<fatal> Could not create \"%s\". ", FIXNULL(filename));
+ msg("<fatal> Could not create \"%s\". ", FIXNULL(filename));
exit(1);
}
if(enablezlib) {
if FAILED(swf_WriteSWC(fi,&swf))
- logf("<error> WriteSWC() failed.\n");
+ msg("<error> WriteSWC() failed.\n");
} else {
if FAILED(swf_WriteSWF(fi,&swf))
- logf("<error> WriteSWF() failed.\n");
+ msg("<error> WriteSWF() failed.\n");
}
if(filename)
close(fi);
- logf("<notice> SWF written\n");
+ msg("<notice> SWF written\n");
}
void swfoutput_setdrawmode(swfoutput* obj, int mode)
if(clippos >= 127)
{
- logf("<warning> Too many clip levels.");
+ msg("<warning> Too many clip levels.");
clippos --;
}
endshape();
if(!clippos) {
- logf("<error> Invalid end of clipping region");
+ msg("<error> Invalid end of clipping region");
return;
}
clippos--;