OSDN Git Service

index on dev20110528_setting_reduce: 9817594 フィールド名修正
[coroid/inqubus.git] / vhook / main.c
index e5b60ea..22fa905 100644 (file)
@@ -33,12 +33,15 @@ int init(FILE* log){
  */\r
 int initData(DATA* data,FILE* log,const SETTING* setting){\r
        int i;\r
  */\r
 int initData(DATA* data,FILE* log,const SETTING* setting){\r
        int i;\r
-       data->enable_user_comment = setting->enable_user_comment;\r
-       data->enable_owner_comment = setting->enable_owner_comment;\r
+    data->user_comment.common = data;\r
+    data->owner_comment.common = data;\r
+       data->user_comment.enable = setting->enable_user_comment;\r
+       data->owner_comment.enable = setting->enable_owner_comment;\r
+       data->user_comment.opaque_comment = setting->opaque_comment;\r
+    data->owner_comment.opaque_comment = 1; // \83I\81[\83i\83R\83\81\83\93\83g\82Í\8fí\82É\95s\93§\96¾\r
        data->log = log;\r
        data->fontsize_fix = setting->fontsize_fix;\r
        data->show_video = setting->show_video;\r
        data->log = log;\r
        data->fontsize_fix = setting->fontsize_fix;\r
        data->show_video = setting->show_video;\r
-       data->opaque_comment = setting->opaque_comment;\r
        data->shadow_kind = setting->shadow_kind;\r
        data->process_first_called=FALSE;\r
        data->video_length = setting->video_length;\r
        data->shadow_kind = setting->shadow_kind;\r
        data->process_first_called=FALSE;\r
        data->video_length = setting->video_length;\r
@@ -71,17 +74,17 @@ int initData(DATA* data,FILE* log,const SETTING* setting){
        /*\r
         * \83\86\81[\83U\83R\83\81\83\93\83g\r
         */\r
        /*\r
         * \83\86\81[\83U\83R\83\81\83\93\83g\r
         */\r
-       if(data->enable_user_comment){\r
+       if(data->user_comment.enable){\r
                fputs("[main/init]User Comment is enabled.\n",log);\r
                //\83R\83\81\83\93\83g\83f\81[\83^\r
                fputs("[main/init]User Comment is enabled.\n",log);\r
                //\83R\83\81\83\93\83g\83f\81[\83^\r
-               if(initChat(log,&data->chat,setting->data_user_path,&data->slot,data->video_length)){\r
+               if(initChat(log,&data->user_comment.chat,setting->data_user_path,&data->user_comment.slot,data->video_length)){\r
                        fputs("[main/init]initialized comment.\n",log);\r
                }else{\r
                        fputs("[main/init]failed to initialize comment.",log);\r
                        return FALSE;\r
                }\r
                //\83R\83\81\83\93\83g\83X\83\8d\83b\83g\r
                        fputs("[main/init]initialized comment.\n",log);\r
                }else{\r
                        fputs("[main/init]failed to initialize comment.",log);\r
                        return FALSE;\r
                }\r
                //\83R\83\81\83\93\83g\83X\83\8d\83b\83g\r
-               if(initChatSlot(log,&data->slot,setting->user_slot_max,&data->chat)){\r
+               if(initChatSlot(log,&data->user_comment.slot,setting->user_slot_max,&data->user_comment.chat)){\r
                        fputs("[main/init]initialized comment slot.\n",log);\r
                }else{\r
                        fputs("[main/init]failed to initialize comment slot.",log);\r
                        fputs("[main/init]initialized comment slot.\n",log);\r
                }else{\r
                        fputs("[main/init]failed to initialize comment slot.",log);\r
@@ -91,8 +94,23 @@ int initData(DATA* data,FILE* log,const SETTING* setting){
        /*\r
         * \83I\81[\83i\83R\83\81\83\93\83g\r
         */\r
        /*\r
         * \83I\81[\83i\83R\83\81\83\93\83g\r
         */\r
-       if(data->enable_owner_comment){\r
+       if(data->owner_comment.enable){\r
                fputs("[main/init]Owner Comment is enabled.\n",log);\r
                fputs("[main/init]Owner Comment is enabled.\n",log);\r
+               //\83R\83\81\83\93\83g\83f\81[\83^\r
+               if(initChat(log,&data->owner_comment.chat,setting->data_owner_path,&data->owner_comment.slot,data->video_length)){\r
+                       fputs("[main/init]initialized comment.\n",log);\r
+               }else{\r
+                       fputs("[main/init]failed to initialize comment.",log);\r
+                       return FALSE;\r
+               }\r
+               //\83R\83\81\83\93\83g\83X\83\8d\83b\83g\r
+        // TODO \82Æ\82è\82 \82¦\82¸\8dÅ\91å\90\94\82Í1024\82É\82µ\82Ä\82¨\82­\82ª...\r
+               if(initChatSlot(log,&data->owner_comment.slot,1024,&data->owner_comment.chat)){\r
+                       fputs("[main/init]initialized comment slot.\n",log);\r
+               }else{\r
+                       fputs("[main/init]failed to initialize comment slot.",log);\r
+                       return FALSE;\r
+               }\r
        }\r
        \r
        //\8fI\82í\82è\81B\r
        }\r
        \r
        //\8fI\82í\82è\81B\r
@@ -138,12 +156,14 @@ int main_process(DATA* data,SDL_Surface* surf,const int now_vpos){
 int closeData(DATA* data){\r
        int i;\r
        //\83\86\81[\83U\83R\83\81\83\93\83g\82ª\97L\8cø\82È\82ç\8aJ\95ú\r
 int closeData(DATA* data){\r
        int i;\r
        //\83\86\81[\83U\83R\83\81\83\93\83g\82ª\97L\8cø\82È\82ç\8aJ\95ú\r
-       if(data->enable_user_comment){\r
-               closeChat(&data->chat);\r
-               closeChatSlot(&data->slot);\r
+       if(data->user_comment.enable){\r
+               closeChat(&data->user_comment.chat);\r
+               closeChatSlot(&data->user_comment.slot);\r
        }\r
        //\83I\81[\83i\83R\83\81\83\93\83g\82ª\97L\8cø\82È\82ç\8aJ\95ú\r
        }\r
        //\83I\81[\83i\83R\83\81\83\93\83g\82ª\97L\8cø\82È\82ç\8aJ\95ú\r
-       if(data->enable_owner_comment){\r
+       if(data->owner_comment.enable){\r
+               closeChat(&data->owner_comment.chat);\r
+               closeChatSlot(&data->owner_comment.slot);\r
        }\r
     //\83t\83H\83\93\83g\8aJ\95ú\r
        for(i=0;i<CMD_FONT_MAX;i++){\r
        }\r
     //\83t\83H\83\93\83g\8aJ\95ú\r
        for(i=0;i<CMD_FONT_MAX;i++){\r