s_box(name, 0, 0, black, 20, 0);
return;
}
- tag = swf_InsertTag(tag, ST_DEFINEBITSJPEG2);
- swf_SetU16(tag, imageID);
+ if(type=="jpeg") {
+#ifndef HAVE_LIBJPEG
+ warning("no jpeg support compiled in");
+ s_box(name, 0, 0, black, 20, 0);
+ return;
+#else
+ tag = swf_InsertTag(tag, ST_DEFINEBITSJPEG2);
+ swf_SetU16(tag, imageID);
- if(swf_SetJPEGBits(tag, filename, quality) < 0) {
- syntaxerror("Image \"%s\" not found, or contains errors", filename);
- }
+ if(swf_SetJPEGBits(tag, filename, quality) < 0) {
+ syntaxerror("Image \"%s\" not found, or contains errors", filename);
+ }
- swf_GetJPEGSize(filename, &width, &height);
+ swf_GetJPEGSize(filename, &width, &height);
- r.xmin = 0;
- r.ymin = 0;
- r.xmax = width*20;
- r.ymax = height*20;
+ r.xmin = 0;
+ r.ymin = 0;
+ r.xmax = width*20;
+ r.ymax = height*20;
- s_addimage(name, id, tag, r);
- incrementid();
+ s_addimage(name, id, tag, r);
+ incrementid();
+#endif
+ }
/* step 2: the character */
tag = swf_InsertTag(tag, ST_DEFINESHAPE); // todo: should be defineshape2/3 once images can be transparent.(?)
{
ActionTAG* a = 0;
a = swf_ActionCompile(text, stack[0].swf->fileVersion);
+ if(!a) {
+ syntaxerror("Couldn't compile ActionScript");
+ }
tag = swf_InsertTag(tag, ST_DOACTION);
static int c_action(map_t*args)
{
readToken();
- if(type != RAWDATA)
+ if(type != RAWDATA) {
syntaxerror("colon (:) expected");
+ }
s_action(text);
{"stop", c_stop, "sound"},
// object placement tags
- {"put", c_put, "<i> x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= pivot= pin= shear= rotate= above= below="},
- {"startclip", c_startclip, "<i> x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= pivot= pin= shear= rotate= above= below="},
- {"change", c_change, "name x= y= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= above= below="},
- {"arcchange", c_arcchange, "name pivot= angle= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= above= below="},
- {"qchange", c_qchange, "name x= y= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= above= below="},
- {"jump", c_jump, "name x= y= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= above= below="},
+ {"put", c_put, "<i> x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= pivot= pin= shear= rotate= ratio= above= below="},
+ {"startclip", c_startclip, "<i> x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex= scaley= pivot= pin= shear= rotate= ratio= above= below="},
+ {"change", c_change, "name x= y= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= ratio= above= below="},
+ {"arcchange", c_arcchange, "name pivot= angle= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= ratio= above= below="},
+ {"qchange", c_qchange, "name x= y= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= ratio= above= below="},
+ {"jump", c_jump, "name x= y= red= green= blue= alpha= luminance= scale= scalex= scaley= pivot= pin= shear= rotate= ratio= above= below="},
{"del", c_del, "name"},
// virtual object placement
- {"buttonput", c_buttonput, "<i> x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex=100% scaley=100% shear=0 rotate=0 above= below="},
+ {"buttonput", c_buttonput, "<i> x=0 y=0 red=+0 green=+0 blue=+0 alpha=+0 luminance= scale= scalex=100% scaley=100% shear=0 rotate=0 above= below="}, //TODO: ratio???
{"texture", c_texture, "<i> x=0 y=0 scale= scalex=100% scaley=100% shear=0 rotate=0"},
// commands which start a block
map_t args;
int nr = -1;
msg("<verbose> parse Command: %s (line %d)", command, line);
+
for(t=0;t<sizeof(arguments)/sizeof(arguments[0]);t++) {
if(!strcmp(arguments[t].command, command)) {
}
if(nr<0)
syntaxerror("command %s not known", command);
+
+ // catch missing .flash directives at the beginning of a file
+ if(strcmp(command, "flash") && !stackpos)
+ {
+ syntaxerror("No movie defined- use .flash first");
+ }
#ifdef DEBUG
printf(".%s\n", command);fflush(stdout);
return 1;
}
pos=0;
-
t=0;
while(!noMoreTokens()) {