+int swf_InitSWF(void*data, int length, SWF * swf) /* copy a swf in memory into SWF struct */
+{
+ TAG reader;
+ /*
+ unfinished!
+ */
+ *(int*)0=0xDEAD;
+ if (!swf) return -1;
+ memset(swf,0x00,sizeof(SWF));
+ memset(&reader,0x00,sizeof(TAG));
+ reader.data = data;
+ reader.len = reader.memsize = length;
+
+ { char b[32]; // read Header
+ TAG * t;
+
+ if (swf_GetU8(&reader)!=(U8)'F') return -1;
+ if (swf_GetU8(&reader)!=(U8)'W') return -1;
+ if (swf_GetU8(&reader)!=(U8)'S') return -1;
+
+ swf->fileVersion = swf_GetU8(&reader);
+ swf->fileSize = swf_GetU32(&reader);
+ swf_GetRect(&reader,&swf->movieSize);
+ swf->frameRate = swf_GetU16(&reader);
+ swf->frameCount = swf_GetU16(&reader);
+
+ /*t = &t1;
+ while (t) t = swf_ReadTag(handle,t);
+ swf->firstTag = t1.next;
+ t1.next->prev = NULL;*/
+ }
+}
+