EXPORT BOOL WINAPI m_output(void *data, int p2, int p3, int p4) { lstrcpy(funcname, "m_output"); method_size = p2; method_index = 0; return -SWFMovie_output(mhsp_movie, (SWFByteOutputMethod)mhsp_method, data); }
int output_swf_writer(FILE* file, at_string name, int llx, int lly, int urx, int ury, at_output_opts_type * opts, spline_list_array_type shape, at_msg_func msg_func, at_address msg_data, at_address user_data) { int width = urx - llx; int height = ury - lly; SWFMovie m; #ifdef _WINDOWS if(file == stdout) { fprintf(stderr, "This driver couldn't write to stdout!\n"); return -1; } #endif Ming_init(); Ming_setCubicThreshold(20000); m = newSWFMovie(); out_splines(m, shape, height); SWFMovie_setDimension(m, SWFSCALE*(float)width, SWFSCALE*(float)height); SWFMovie_setRate(m, FPS); SWFMovie_nextFrame(m); SWFMovie_output(m, fileOutputMethod, file); return 0; }
/* * Save movie to file * returns the number of bytes written. -1 on error. */ int SWFMovie_save(SWFMovie movie, const char *filename) { FILE *f = fopen(filename, "wb"); int count; if ( f == NULL ) return -1; count = SWFMovie_output(movie, fileOutputMethod, f); fclose(f); return count; }
EXPORT BOOL WINAPI m_output(HSPEXINFO *hei, int p2, int p3, int p4) { char *data; int level, oldval, size; lstrcpy(funcname, "m_output"); data = (char *)hei->HspFunc_prm_getv(); method_size = hei->HspFunc_prm_geti(); level = hei->HspFunc_prm_getdi(-1); if (level < -1 || level > 9) { return -1; } oldval = Ming_setSWFCompression(level); method_index = 0; size = -SWFMovie_output(mhsp_movie, (SWFByteOutputMethod)mhsp_method, data); Ming_setSWFCompression(oldval); return size; }
/* * Output movie to FILE stream * returns the number of bytes written */ int SWFMovie_output_to_stream(SWFMovie movie, FILE *fp) { return SWFMovie_output(movie,fileOutputMethod,fp); }