Advertisement
Guest User

spritelist_gen.cpp

a guest
Jan 16th, 2014
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. //Counters: d - dress, e - emotion.
  9.     int d_cnt = 3, e_cnt = 7;
  10.     int i,j,k;
  11.  
  12.     char dist[3][7] = {"close","","far"};
  13.     char emo[7][8] = {"cry","evil","grin","sad","serious","smile","surp"};
  14.     char dress[3][7] = {"plat1","plat2","plat3"};
  15.     char dress_scn[4][7] = {"plat1","plat2","plat3","body"};
  16.  
  17.     char time[3][7] = {"day","sunset","night"};
  18.  
  19.     char first[19] = "    image un_old ";
  20.     char second[20] = " = ConditionSwitch(";
  21.  
  22.     char sun[255] = "    \"persistent.sprite_time=='sunset'\",";
  23.     char sun_2[255] = "im.matrix.tint(0.94, 0.82, 1.0) ),";
  24.     char ni[255] = "    \"persistent.sprite_time=='night'\",";
  25.     char ni_2[255] = " im.matrix.tint(0.63, 0.78, 0.82) ),";
  26.  
  27.     char cond_3[255] = ".png\"), ";
  28.     char comp_3[255] = ".png\") )";
  29.  
  30. //Close
  31.     char cl_1[255] = "im.MatrixColor( im.Composite((1050,1080), (0,0), \"images/1080/sprites/close/un_old/un_old.png\",(0,0), \"images/1080/sprites/close/un_old/";
  32.     char cl_2[255] = ".png\",(0,0), \"images/1080/sprites/close/un_old/";
  33.  
  34.     char cl_comp1[255] = "    True,im.Composite((1050,1080), (0,0), \"images/1080/sprites/close/un_old/un_old.png\",(0,0), \"images/1080/sprites/close/un_old/";
  35.     char cl_comp2[255] = ".png\",(0,0), \"images/1080/sprites/close/un_old/";
  36.  
  37. //Normal
  38.     char n_1[255] = "im.MatrixColor( im.Composite((900,1080), (0,0), \"images/1080/sprites/normal/un_old/un_old.png\",(0,0), \"images/1080/sprites/normal/un_old/";
  39.     char n_2[255] = ".png\",(0,0), \"images/1080/sprites/normal/un_old/";
  40.  
  41.     char n_comp1[255] = "    True,im.Composite((900,1080), (0,0), \"images/1080/sprites/normal/un_old/un_old.png\",(0,0), \"images/1080/sprites/normal/un_old/";
  42.     char n_comp2[255] = ".png\",(0,0), \"images/1080/sprites/normal/un_old/";
  43. //Far
  44.     char f_1[255] = "im.MatrixColor( im.Composite((630,1080), (0,0), \"images/1080/sprites/far/un_old/un_old.png\",(0,0), \"images/1080/sprites/far/un_old/";
  45.     char f_2[255] = ".png\",(0,0), \"images/1080/sprites/far/un_old/";
  46.  
  47.     char f_comp1[255] = "    True,im.Composite((630,1080), (0,0), \"images/1080/sprites/far/un_old/un_old.png\",(0,0), \"images/1080/sprites/far/un_old/";
  48.     char f_comp2[255] = ".png\",(0,0), \"images/1080/sprites/far/un_old/";
  49.  
  50. //Body
  51.     //close
  52.     char b_cl1[255] = "im.MatrixColor( im.Composite((1050,1080), (0,0), \"images/1080/sprites/close/un_old/un_old.png\",(0,0), \"images/1080/sprites/close/un_old/";
  53.     char b_cl2[255] = "    True,im.Composite((1050,1080), (0,0), \"images/1080/sprites/close/un_old/un_old.png\",(0,0), \"images/1080/sprites/close/un_old/";
  54.  
  55.     //normal
  56.     char b_n1[255] = "im.MatrixColor( im.Composite((900,1080), (0,0), \"images/1080/sprites/normal/un_old/un_old.png\",(0,0), \"images/1080/sprites/normal/un_old/";
  57.     char b_n2[255] = "    True,im.Composite((900,1080), (0,0), \"images/1080/sprites/normal/un_old/un_old.png\",(0,0), \"images/1080/sprites/normal/un_old/";
  58.  
  59.     //far
  60.     char b_f1[255] = "im.MatrixColor( im.Composite((630,1080), (0,0), \"images/1080/sprites/far/un_old/un_old.png\",(0,0), \"images/1080/sprites/far/un_old/";
  61.     char b_f2[255] = "    True,im.Composite((630,1080), (0,0), \"images/1080/sprites/far/un_old/un_old.png\",(0,0), \"images/1080/sprites/far/un_old/";
  62.  
  63.     //fuken ШNDOШS
  64.     setlocale(LC_ALL,"Russian");
  65.    
  66.     cout<<"Создаём нужные файлы..."<<endl;
  67.  
  68. //Filestream
  69.     ofstream out_txt ("sprite.txt",ios::out);
  70.     ofstream scn_txt ("scenario.txt",ios::out);
  71.     ofstream lst_txt ("list.txt",ios::out);
  72.  
  73.     cout<<"Генерируем простыни..."<<endl;
  74.  
  75. //Генерация простыни для спрайтов
  76.     out_txt<<"init:"<<endl;
  77.     for (i=0;i<e_cnt;i++)
  78.     {
  79.         for (j=0;j<d_cnt;j++)
  80.         {
  81.                 //close
  82.                 out_txt<<first<<emo[i]<<" "<<dress[j]<<" "<<dist[0]<<second<<endl;
  83.                 out_txt<<sun<<cl_1<<emo[i]<<cl_2<<dress[j]<<cond_3<<sun_2<<endl;
  84.                 out_txt<<ni<<cl_1<<emo[i]<<cl_2<<dress[j]<<cond_3<<ni_2<<endl;
  85.                 out_txt<<cl_comp1<<emo[i]<<cl_comp2<<dress[j]<<comp_3<<endl;
  86.                 //normal
  87.                 out_txt<<first<<emo[i]<<" "<<dress[j]<<second<<endl;
  88.                 out_txt<<sun<<n_1<<emo[i]<<n_2<<dress[j]<<cond_3<<sun_2<<endl;
  89.                 out_txt<<ni<<n_1<<emo[i]<<n_2<<dress[j]<<cond_3<<ni_2<<endl;
  90.                 out_txt<<n_comp1<<emo[i]<<n_comp2<<dress[j]<<comp_3<<endl;
  91.                 //far
  92.                 out_txt<<first<<emo[i]<<" "<<dress[j]<<" "<<dist[2]<<second<<endl;
  93.                 out_txt<<sun<<f_1<<emo[i]<<f_2<<dress[j]<<cond_3<<sun_2<<endl;
  94.                 out_txt<<ni<<f_1<<emo[i]<<f_2<<dress[j]<<cond_3<<ni_2<<endl;
  95.                 out_txt<<f_comp1<<emo[i]<<f_comp2<<dress[j]<<comp_3<<endl;
  96.         }
  97.         //body
  98.         //close
  99.         out_txt<<first<<emo[i]<<" body "<<dist[0]<<second<<endl;
  100.         out_txt<<sun<<b_cl1<<emo[i]<<cond_3<<sun_2<<endl;
  101.         out_txt<<ni<<b_cl1<<emo[i]<<cond_3<<ni_2<<endl;
  102.         out_txt<<b_cl2<<emo[i]<<comp_3<<endl;
  103.         //normal
  104.         out_txt<<first<<emo[i]<<" body"<<second<<endl;
  105.         out_txt<<sun<<b_n1<<emo[i]<<cond_3<<sun_2<<endl;
  106.         out_txt<<ni<<b_n1<<emo[i]<<cond_3<<ni_2<<endl;
  107.         out_txt<<b_n2<<emo[i]<<comp_3<<endl;
  108.         //far
  109.         out_txt<<first<<emo[i]<<" body "<<dist[2]<<second<<endl;
  110.         out_txt<<sun<<b_f1<<emo[i]<<cond_3<<sun_2<<endl;
  111.         out_txt<<ni<<b_f1<<emo[i]<<cond_3<<ni_2<<endl;
  112.         out_txt<<b_f2<<emo[i]<<comp_3<<endl;
  113.     }
  114.  
  115.     cout<<"Генерируем тестовый сценарий"<<endl;
  116.  
  117. //Генерация тестового сценария
  118.     //НЕ ЗАБЫТЬ СКОНВЕРТИРОВАТЬ В UTF-8!!!
  119.     scn_txt<<"init:"<<endl;
  120.     scn_txt<<"    $ mods[\"test__un_old\"] = u\"Постаревшая Унылка\""<<endl<<endl;
  121.     scn_txt<<"label test__un_old:"<<endl;
  122.     scn_txt<<"    scene bg semen_room"<<endl;  
  123.     for (k=0;k<3;k++)
  124.     {
  125.         scn_txt<<"    $ "<<time[k]<<"_time ()"<<endl;
  126.         scn_txt<<"    $ persistent.sprite_time = \""<<time[k]<<"\""<<endl;
  127.         for (i=0;i<e_cnt;i++)
  128.             {
  129.                 for (j=0;j<(d_cnt+1);j++)
  130.                 {
  131.                         scn_txt<<"    show un_old "<<emo[i]<<" "<<dress_scn[j]<<" close with dspr"<<endl;
  132.                         scn_txt<<"    un \"Эмоция: "<<emo[i]<<", одежда: "<<dress_scn[j]<<", расстояние: close, время суток: "<<time[k]<<"\""<<endl;
  133.                         scn_txt<<"    show un_old "<<emo[i]<<" "<<dress_scn[j]<<" with dspr"<<endl;
  134.                         scn_txt<<"    un \"Эмоция: "<<emo[i]<<", одежда: "<<dress_scn[j]<<", расстояние: normal, время суток: "<<time[k]<<"\""<<endl;
  135.                         scn_txt<<"    show un_old "<<emo[i]<<" "<<dress_scn[j]<<" far with dspr"<<endl;
  136.                         scn_txt<<"    un \"Эмоция: "<<emo[i]<<", одежда: "<<dress_scn[j]<<", расстояние: far, время суток: "<<time[k]<<"\""<<endl;
  137.                 }
  138.             }
  139.     }
  140.  
  141. //Генерация списка спрайтов
  142.     for (k=0;k<3;k++)
  143.     {
  144.         for (i=0;i<e_cnt;i++)
  145.             {
  146.                 for (j=0;j<(d_cnt+1);j++)
  147.                 {
  148.                         lst_txt<<"un_old "<<emo[i]<<" "<<dress_scn[j]<<" close"<<endl;
  149.                         lst_txt<<"un_old "<<emo[i]<<" "<<dress_scn[j]<<endl;
  150.                         lst_txt<<"un_old "<<emo[i]<<" "<<dress_scn[j]<<" far"<<endl;
  151.                 }
  152.             }
  153.     }
  154.  
  155.     return 0;
  156. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement