[Swfed-svn] swfed-svn [373] - replaceMovieClip のガワだけ作成

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 3月 3日 (木) 21:55:52 JST


Revision: 373
          http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=373
Author:   yoya
Date:     2011-03-03 21:55:52 +0900 (Thu, 03 Mar 2011)

Log Message:
-----------
- replaceMovieClip のガワだけ作成
- version を 0.31 から 0.32a に更新

Modified Paths:
--------------
    trunk/src/php_swfed.c
    trunk/src/php_swfed.h
    trunk/src/swf_object.c
    trunk/src/swf_object.h


-------------- next part --------------
Modified: trunk/src/php_swfed.c
===================================================================
--- trunk/src/php_swfed.c	2011-03-01 13:18:09 UTC (rev 372)
+++ trunk/src/php_swfed.c	2011-03-03 12:55:52 UTC (rev 373)
@@ -84,12 +84,13 @@
     PHP_ME(swfed,  getActionData, NULL, 0)
     PHP_ME(swfed,  disasmActionData, NULL, 0)
     PHP_ME(swfed,  setActionVariables, NULL, 0)
+    PHP_ME(swfed,  replaceMovieClip, NULL, 0)
     PHP_ME(swfed,  swfInfo, NULL, 0)
     {NULL, NULL, NULL}	/* Must be the last line in swfed_functions[] */
 };
 /* }}} */
 
-#define SWFED_VERSION "0.31"
+#define SWFED_VERSION "0.32a"
 
 /* {{{ swfed_module_entry
  */
@@ -1107,6 +1108,26 @@
     RETURN_TRUE;
 }
 
+PHP_METHOD(swfed, replaceMovieClip) {
+    char *instance_name = NULL, *swf_data = NULL;
+    int  instance_name_len = 0, swf_data_len = 0;
+    swf_object_t *swf = NULL;
+    int result = 0;
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
+                              &instance_name, &instance_name_len,
+                              &swf_data, &swf_data_len) == FAILURE) {
+        RETURN_FALSE;
+    }
+    swf = get_swf_object(getThis() TSRMLS_CC);    
+    result = swf_object_replace_movieclip(swf, instance_name,
+                                          instance_name_len,
+                                          swf_data, swf_data_len);
+    if (result) {
+        RETURN_FALSE;
+    }
+    RETURN_TRUE;
+}
+
 PHP_METHOD(swfed, swfInfo) {
     swf_object_t *swf = get_swf_object(getThis() TSRMLS_CC);
     swf_object_print(swf);

Modified: trunk/src/php_swfed.h
===================================================================
--- trunk/src/php_swfed.h	2011-03-01 13:18:09 UTC (rev 372)
+++ trunk/src/php_swfed.h	2011-03-03 12:55:52 UTC (rev 373)
@@ -79,6 +79,7 @@
 PHP_METHOD(swfed, getActionData);
 PHP_METHOD(swfed, disasmActionData);
 PHP_METHOD(swfed, setActionVariables);
+PHP_METHOD(swfed, replaceMovieClip);
 PHP_METHOD(swfed, swfInfo);
 
 /* 

Modified: trunk/src/swf_object.c
===================================================================
--- trunk/src/swf_object.c	2011-03-01 13:18:09 UTC (rev 372)
+++ trunk/src/swf_object.c	2011-03-03 12:55:52 UTC (rev 373)
@@ -735,6 +735,7 @@
     }
     return data;
 }
+
 int
 swf_object_replace_editstring(swf_object_t *swf,
                               char *variable_name,
@@ -796,7 +797,7 @@
     for (tag=swf->tag ; tag ; tag=tag->next) {
         switch (tag->tag) {
         case 69: // FileAttributs
-        case  9:  // SetBackgroundColor
+        case  9: // SetBackgroundColor
         case 24: // Protect
             break;
         default:
@@ -827,7 +828,33 @@
     return 0; // SUCCESS
 }
 
+int
+swf_object_replace_movieclip(swf_object_t *swf,
+                             char *instance_name, int instancee_name_len,
+                             char *swf_data, int swf_data_len) {
+    int result = 1;
+    swf_tag_t *tag;
+    if (swf == NULL) {
+        fprintf(stderr, "swf_object_replace_movieclip: swf == NULL\n");
+        return 1;
+    }
+    for (tag=swf->tag ; tag ; tag=tag->next) {
+        ; // searchPlaceTagByInstanceName;
+    }
+    for (tag=swf->tag ; tag ; tag=tag->next) {
+        ; // searchSpriteTagByCID
+    }
 
+/*
+    result = swf_tag_replace_movieclip(tag,
+                                       instance_name, instance_name_len,
+                                       swf_data, swf_data__len,
+                                       swf);
+*/
+
+    return result;
+}
+
 int
 swf_object_apply_shapematrix_factor(swf_object_t *swf, int shape_id,
                                     double scale_x, double scale_y,

Modified: trunk/src/swf_object.h
===================================================================
--- trunk/src/swf_object.h	2011-03-01 13:18:09 UTC (rev 372)
+++ trunk/src/swf_object.h	2011-03-03 12:55:52 UTC (rev 373)
@@ -97,7 +97,12 @@
 extern int swf_object_insert_action_setvariables(swf_object_t *swf,
                                                  y_keyvalue_t *kv);
 
+extern int swf_object_replace_movieclip(swf_object_t *swf,
+                                        char *instance_name,
+                                        int instancee_name_len,
+                                        char *swf_data, int swf_data_len);
 
+
 extern int swf_object_apply_shapematrix_factor(swf_object_t *swf,int shape_id,
                                                double scale_x, double scale_y,
                                                double rotate_rad,



Swfed-svn メーリングリストの案内
Back to archive index