git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added shape parsing.
[swftools.git]
/
lib
/
python
/
SWF.c
diff --git
a/lib/python/SWF.c
b/lib/python/SWF.c
index
8d40a90
..
3bb744a
100644
(file)
--- a/
lib/python/SWF.c
+++ b/
lib/python/SWF.c
@@
-28,6
+28,7
@@
#include "./tags.h"
#include "./taglist.h"
#include "./primitives.h"
#include "./tags.h"
#include "./taglist.h"
#include "./primitives.h"
+#include "./action.h"
/*
TODO:
/*
TODO:
@@
-70,15
+71,17
@@
static PyObject* f_create(PyObject* self, PyObject* args, PyObject* kwargs)
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|idOs",
kwlist, &version, &framerate,
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|idOs",
kwlist, &version, &framerate,
- &obbox, filename))
+ &obbox, &filename))
return NULL;
return NULL;
- if (!PY_CHECK_TYPE(obbox, &BBoxClass)) {
- obbox = f_BBox(0, obbox, 0);
- if(!obbox)
- return NULL;
+ if(obbox) {
+ if (!PY_CHECK_TYPE(obbox, &BBoxClass)) {
+ obbox = f_BBox(0, obbox, 0);
+ if(!obbox)
+ return NULL;
+ }
+ bbox = bbox_getSRECT(obbox);
}
}
- bbox = bbox_getSRECT(obbox);
memset(&swf->swf, 0, sizeof(SWF));
if(filename)
memset(&swf->swf, 0, sizeof(SWF));
if(filename)
@@
-168,8
+171,9
@@
static PyObject * swf_save(PyObject* self, PyObject* args, PyObject* kwargs)
swf->compressed = 1;
swf->firstTag = taglist_getTAGs(swfo->taglist);
swf->compressed = 1;
swf->firstTag = taglist_getTAGs(swfo->taglist);
- if(!swf->firstTag)
- return NULL;
+
+ /*if(!swf->firstTag)
+ return NULL;*/
// fix the file, in case it is empty or not terminated properly
{
// fix the file, in case it is empty or not terminated properly
{
@@
-279,7
+283,7
@@
static int swf_print(PyObject * self, FILE *fi, int flags) //flags&Py_PRINT_RAW
static PyObject* swf_getattr(PyObject * self, char* a)
{
SWFObject*swf = (SWFObject*)self;
static PyObject* swf_getattr(PyObject * self, char* a)
{
SWFObject*swf = (SWFObject*)self;
- PyObject* ret;
+ PyObject* ret = 0;
if(!strcmp(a, "fps")) {
double fps = swf->swf.frameRate/256.0;
if(!strcmp(a, "fps")) {
double fps = swf->swf.frameRate/256.0;
@@
-401,7
+405,7
@@
static PyObject* module_verbose(PyObject* self, PyObject* args, PyObject* kwargs
{
int _verbose = 0;
static char *kwlist[] = {"verbosity", NULL};
{
int _verbose = 0;
static char *kwlist[] = {"verbosity", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist, &verbose))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist, &_verbose))
return NULL;
setVerbosity(_verbose);
return NULL;
setVerbosity(_verbose);