- if ((imgidx > 0) && // REMOVEOBJECT2 not needed at frame 1(imgidx==0)
- (global.imagecount > 1))
- {
- // check last frame's disposal method
- if ((disposal = getGifDisposalMethod(gft, imgidx-1)) >= 0)
- {
- switch(disposal) {
- case NONE:
- //fprintf(stdout, " [none]\n");
- swf_SetU16(t, depth-1);
- t = swf_InsertTag(t, ST_REMOVEOBJECT2);
- break;
- case DO_NOT_DISPOSE:
- //fprintf(stdout, " [don't dispose]\n");
- break;
- case RESTORE_TO_BGCOLOR:
- swf_SetU16(t, depth-1);
- t = swf_InsertTag(t, ST_REMOVEOBJECT2);
- //fprintf(stdout, " [restore to bg color]\n");
- break;
- case RESTORE_TO_PREVIOUS:
- swf_SetU16(t, depth-1);
- t = swf_InsertTag(t, ST_REMOVEOBJECT2);
- //fprintf(stdout, " [restore to previous]\n");
- break;
- }
- }
- }
-
+ if ((imgidx > 0) && // REMOVEOBJECT2 not needed at frame 1(imgidx==0)
+ (global.imagecount > 1)) {
+ // check last frame's disposal method
+ if ((disposal = getGifDisposalMethod(gft, imgidx - 1)) >= 0) {
+ switch (disposal) {
+ case NONE:
+ // [Replace one full-size, non-transparent frame with another]
+ t = swf_InsertTag(t, ST_REMOVEOBJECT2);
+ swf_SetU16(t, depth - 1);
+ if (VERBOSE(3))
+ fprintf(stdout, " [none]\n");
+ break;
+ case DO_NOT_DISPOSE:
+ // [Any pixels not covered up by the next frame continue to display]
+ if (VERBOSE(3))
+ fprintf(stdout, " [don't dispose]\n");
+ break;
+ case RESTORE_TO_BGCOLOR:
+ // [The background color or background tile -rather than a previous frame-
+ // shows through transparent pixels]
+ t = swf_InsertTag(t, ST_REMOVEOBJECT2);
+ swf_SetU16(t, depth - 2);
+ if (VERBOSE(3))
+ fprintf(stdout, " [restore to bg color]\n");
+ break;
+ case RESTORE_TO_PREVIOUS:
+ // [Restores to the state of a previous, undisposed frame]
+ // ** NOT IMPLEMENTED YET (same as "restore to bgcolor") **
+ t = swf_InsertTag(t, ST_REMOVEOBJECT2);
+ swf_SetU16(t, depth - 1);
+ if (VERBOSE(3))
+ fprintf(stdout, " [restore to previous]\n");
+ break;
+ default:
+ break;
+ }
+ }
+ }
+