moved swf_ResetReadBits from rfxswf.c to rfxswf.h.
[swftools.git] / lib / rfxswf.c
index 441e19d..e7cb0d8 100644 (file)
@@ -65,11 +65,6 @@ U32   swf_GetTagLen(TAG * t) { return t->len; }
 U8*   swf_GetTagLenPtr(TAG * t) { return &(t->data[t->len]); }
 U32   swf_GetTagPos(TAG * t)   { return t->pos; }
 
-// Basic Data Access Functions
-
-#define swf_ResetReadBits(tag)   if (tag->readBit)  { tag->pos++; tag->readBit = 0; }
-#define swf_ResetWriteBits(tag)  if (tag->writeBit) { tag->writeBit = 0; }
-
 // for future purpose: avoid high level lib functions to change tagpos/bitpos
 
 #define swf_SaveTagPos(tag)
@@ -865,7 +860,7 @@ int swf_WriteTag2(struct writer_t*writer, TAG * t)
 
   len = (t->id==ST_DEFINESPRITE)?swf_DefineSprite_GetRealSize(t):t->len;
 
-  short_tag = len<0x3f;
+  short_tag = len<0x3f&&(t->id!=ST_DEFINEBITSLOSSLESS&&t->id!=ST_DEFINEBITSLOSSLESS2);
 
   if (writer)
   { if (short_tag)
@@ -1042,7 +1037,7 @@ void swf_FoldSprite(TAG * t)
 
   do
   { 
-    if(t->len<0x3f) {
+    if(t->len<0x3f&&t->id!=ST_DEFINEBITSLOSSLESS&&t->id!=ST_DEFINEBITSLOSSLESS2) {
        swf_SetU16(sprtag,t->len|(t->id<<6));
     } else {
        swf_SetU16(sprtag,0x3f|(t->id<<6));