Advertisement
Mr-A

A-Engine <object> v0.03

Dec 18th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 157.75 KB | None | 0 0
  1. #include "Eval.h"
  2.  
  3.  
  4. using namespace std;
  5.  
  6.  
  7. struct Coord { GLfloat x; GLfloat y; };
  8. struct LVertexData2D { Coord position; Coord texCoord; };
  9.  
  10. struct inputah {int click; int time; };
  11.  
  12.  
  13. class object;
  14. struct objcopy;
  15. struct objcopy{
  16.     int rectdensity[20]={4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321,4321};
  17.     string hit_xNO="0";
  18.     int inputarray[12]={4321, 4321, 4321, 4321, 4321, 4321, 4321, 4321, 4321, 4321, 4321, 4321};
  19.     int hit_xINTERVAL=0;
  20.     int picn=0, gridn=0;
  21.     int id;
  22.     int delayU, nxt, facing, U_loop_length, hitground;
  23.     float currhp, currsp, currrp, currdp, currkp;
  24.     int previousframe=4321;
  25.     bool showshadow=true;
  26.     bool deleted=false;
  27.     bool deleteobj=false;
  28.     float total_fx, total_fy, total_fz=0;
  29.     float GROUNDPOS =0;
  30.     bool jumpforward=false, isdead;
  31.     int doloop[2]={0, 4321};
  32.     int posx ,  posz;
  33.     int posy;
  34.     int team, currframe;
  35.     int lasthitby=4321;
  36.     bool caught=false;
  37.     int curse_id=4321;
  38.     int hitcounter=0;
  39.     bool iscom;
  40.     int movedirx, movedirz=2;
  41.     bool P_UP, P_DOWN, P_LEFT, P_RIGHT, P_ATTACK, P_DEFEND, P_JUMP, P_SPECIAL;
  42.     bool P_ATTACK_C=false, P_DEFEND_C=false, P_JUMP_C=false, P_SPECIAL_C=false, P_UP_C=false, P_DOWN_C=false, P_LEFT_C=false, P_RIGHT_C=false;
  43.         bool Tu=true, Td=true, Tl=true, Tr=true, TA=true, TJ=true, TD=true, TS=true;
  44.     int DshClksIntrvlR, DshClksIntrvlL, DASHL, DASHR=0;
  45.     bool newframe = true;
  46.     int accU=0;
  47.     float FRICTION;
  48.     float GRAVITY;
  49.     void init(object*, int, bool, float, float, int, int);
  50. };
  51. objcopy copy_object(objcopy old_){
  52.     objcopy new_;
  53.     new_.id=old_.id;
  54.     new_.team=old_.team;
  55.     new_.facing=old_.facing;
  56.     new_.iscom=true;
  57.     new_.posx=old_.posx;
  58.     new_.posy=old_.posy;
  59.     new_.posz=old_.posz;
  60.     new_.total_fx=old_.total_fx;
  61.     new_.total_fy=old_.total_fy;
  62.     new_.total_fz=old_.total_fz;
  63.     new_.GRAVITY=old_.GRAVITY;
  64.     new_.FRICTION=old_.FRICTION;
  65.     return new_;
  66. }
  67. SDL_Color translate_color(Uint32 int_color)                          
  68. {
  69.     #if SDL_BYTEORDER == SDL_BIG_ENDIAN
  70.         SDL_Color color={(int_color & 0x00ff0000)/0x10000,(int_color &
  71.          0x0000ff00)/0x100,(int_color & 0x000000ff),0};
  72.     #else
  73.         SDL_Color color={(int_color & 0x000000ff),(int_color &
  74. 0x0000ff00)/0x100,(int_color & 0x00ff0000)/0x10000,0};    
  75.     #endif
  76.     return color;
  77. }
  78.  
  79. class LOAD;
  80. class bdy{
  81.     public:
  82.     string frameline;
  83.     bool exists;
  84.     int startpos;
  85.     int endpos;
  86.    
  87.         string x, y, z, w, h, z_w, block, respond;
  88.         bdy();
  89.         void init(string);
  90. };
  91. bdy::bdy(){
  92.     exists=false;
  93. }
  94.  
  95.  
  96. void bdy::init(string framelinee){
  97.     exists=true;
  98.     int positions[8];
  99.     string tempao;
  100.     string maintag="set_bdy[";
  101.     string tags[] = {"x=", "y=", "z=", "w=", "h=", "d=", "block=", "respond="};
  102.     startpos=framelinee.find(maintag);
  103.     endpos  =framelinee.find("]", startpos);
  104.     string frameline=framelinee.substr(startpos+maintag.length(), endpos-startpos-maintag.length());
  105.    
  106.     bool done=false;
  107.        if (frameline.find(tags[0])!=string::npos){positions[0] = frameline.find(tags[0])+tags[0].length();}else{positions[0]=0;}
  108.        if (frameline.find(tags[1])!=string::npos){positions[1] = frameline.find(tags[1])+tags[1].length();}else{positions[1]=0;}                      
  109.        if (frameline.find(tags[2])!=string::npos){positions[2] = frameline.find(tags[2])+tags[2].length();}else{positions[2]=0;}
  110.        if (frameline.find(tags[3])!=string::npos){positions[3] = frameline.find(tags[3])+tags[3].length();}else{positions[3]=0;}
  111.        if (frameline.find(tags[4])!=string::npos){positions[4] = frameline.find(tags[4])+tags[4].length();}else{positions[4]=0;}
  112.        if (frameline.find(tags[5])!=string::npos){positions[5] = frameline.find(tags[5])+tags[5].length();}else{positions[5]=0;}
  113.        if (frameline.find(tags[6])!=string::npos){positions[6] = frameline.find(tags[6])+tags[6].length();}else{positions[6]=0;}
  114.        if (frameline.find(tags[7])!=string::npos){positions[7] = frameline.find(tags[7])+tags[7].length();}else{positions[7]=0;}
  115. for (int ice=0; ice < 8; ice ++){ //iter on tags positions
  116.                      for (int food = 0; food < frameline.length(); food++){ //iter on characters of the line
  117.                          done=false;
  118.                    
  119.                          while (!done&&(isdigit(frameline[food+positions[ice]]) || frameline.substr(food+positions[ice], 1)==","||frameline.substr(food+positions[ice], 1)=="-"
  120.                          ||frameline.substr(food+positions[ice], 1)=="+"||frameline.substr(food+positions[ice], 1)=="/"
  121.                          ||frameline.substr(food+positions[ice], 1)=="*"||frameline.substr(food+positions[ice], 1)=="("
  122.                          ||frameline.substr(food+positions[ice], 1)==")")){
  123.                                tempao+=frameline.substr(food+positions[ice],1);
  124.                                if (!isdigit(frameline[food+positions[ice]+1])&&!(frameline[food+positions[ice]+1]==',') &&(!(frameline.substr(food+positions[ice]+1, 1)=="-")
  125.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="+")&&!(frameline.substr(food+positions[ice]+1, 1)=="*")&&!(frameline.substr(food+positions[ice]+1, 1)=="/")
  126.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="(")&&!(frameline.substr(food+positions[ice]+1, 1)==")"))){
  127.                                                                switch (ice){
  128.                                                                       case 0: if (frameline.find(tags[0])!=string::npos){x=tempao;}else{x="0";}
  129.                                                                       food=99999;done=true;tempao="";break;
  130.                                                                       case 1: if (frameline.find(tags[1])!=string::npos){y=tempao;}else{y="0";
  131.                                                                       }food=99999;done=true;tempao="";break;
  132.                                                                       case 2: if (frameline.find(tags[2])!=string::npos){z=tempao;}else{z="-9";
  133.                                                                       }food=99999;done=true;tempao="";break;
  134.                                                                       case 3: if (frameline.find(tags[3])!=string::npos){w=tempao;}else{w="1";
  135.                                                                       }food=99999;done=true;tempao="";break;
  136.                                                                       case 4: if (frameline.find(tags[4])!=string::npos){h=tempao;}else{h="1";
  137.                                                                       }food=99999;done=true;tempao="";break;
  138.                                                                       case 5: if (frameline.find(tags[5])!=string::npos){z_w=tempao;}else{z_w="18";
  139.                                                                       }food=99999;done=true;tempao="";break;
  140.                                                                       case 6: if (frameline.find(tags[6])!=string::npos){block=tempao;}else{block="0";
  141.                                                                       }food=99999;done=true;tempao="";break;
  142.                                                                       case 7: if (frameline.find(tags[7])!=string::npos){respond=tempao;}else{respond="4321";
  143.                                                                       }food=99999;done=true;tempao="";break;
  144.                                                    
  145.                                                                       default:;}}
  146.                                else{
  147.                                     food++;}
  148.                          }
  149.                      }
  150.                  }
  151.  
  152.    
  153. }
  154.  
  155. class rect{
  156.     public:
  157.     string frameline;
  158.     bool exists;
  159.     int startpos;
  160.     int endpos;
  161.     bool flags[5]={false, false, false, false, false};
  162.    
  163.         string x, y, z, w, h, z_w, damage, sccss, x_impct, y_impct, z_impct, hitfreq, effect, strength, knock;
  164.         string tfgoto, tbgoto, t_x, t_y, t_z, crsid, rctdnsty;
  165.         rect();
  166.         void init(string);
  167. };
  168. rect::rect(){
  169.     exists=false;
  170. }
  171.  
  172. void rect::init(string framelinee){
  173.     exists=true;
  174.     int positions[22];
  175.     string tempao;
  176.     string maintag="set_rect[";
  177.     string tags[] = {"x=", "y=", "z=", "w=", "h=", "d=", "success=", "damage=", "x_impact=", "y_impact=", "z_impact=", "hit_frequency=", "effect=",
  178.     "strength=", "knock=", "front_target_goto=", "back_target_goto=", "target_x=", "target_y=", "target_z=", "set_curse_id=", "rect_density="};
  179.     string flagslist[]={"|HITFALLING|", "|HITFALLINGX|", "|CATCHING|", "|NOEFFECT|", "|NOSOUND|"};
  180.  
  181.     startpos=framelinee.find(maintag);
  182.     endpos  =framelinee.find("]", startpos);
  183.     string frameline=framelinee.substr(startpos+maintag.length(), endpos-startpos-maintag.length());
  184.     for (int a=0; a<5; a++){
  185.                     if (frameline.find(flagslist[a])!=string::npos) flags[a]=true;
  186.     }
  187.     bool done=false;
  188.        if (frameline.find(tags[0])!=string::npos){positions[0] = frameline.find(tags[0])+tags[0].length();}else{positions[0]=0;}
  189.        if (frameline.find(tags[1])!=string::npos){positions[1] = frameline.find(tags[1])+tags[1].length();}else{positions[1]=0;}                      
  190.        if (frameline.find(tags[2])!=string::npos){positions[2] = frameline.find(tags[2])+tags[2].length();}else{positions[2]=0;}
  191.        if (frameline.find(tags[3])!=string::npos){positions[3] = frameline.find(tags[3])+tags[3].length();}else{positions[3]=0;}
  192.        if (frameline.find(tags[4])!=string::npos){positions[4] = frameline.find(tags[4])+tags[4].length();}else{positions[4]=0;}
  193.        if (frameline.find(tags[5])!=string::npos){positions[5] = frameline.find(tags[5])+tags[5].length();}else{positions[5]=0;}
  194.        if (frameline.find(tags[6])!=string::npos){positions[6] = frameline.find(tags[6])+tags[6].length();}else{positions[6]=0;}
  195.        if (frameline.find(tags[7])!=string::npos){positions[7] = frameline.find(tags[7])+tags[7].length();}else{positions[7]=0;}
  196.        if (frameline.find(tags[8])!=string::npos){positions[8] = frameline.find(tags[8])+tags[8].length();}else{positions[8]=0;}
  197.        if (frameline.find(tags[9])!=string::npos){positions[9] = frameline.find(tags[9])+tags[9].length();}else{positions[9]=0;}
  198.        if (frameline.find(tags[10])!=string::npos){positions[10] = frameline.find(tags[10])+tags[10].length();}else{positions[10]=0;}
  199.        if (frameline.find(tags[11])!=string::npos){positions[11] = frameline.find(tags[11])+tags[11].length();}else{positions[11]=0;}
  200.        if (frameline.find(tags[12])!=string::npos){positions[12] = frameline.find(tags[12])+tags[12].length();}else{positions[12]=0;}
  201.        if (frameline.find(tags[13])!=string::npos){positions[13] = frameline.find(tags[13])+tags[13].length();}else{positions[13]=0;}
  202.        if (frameline.find(tags[14])!=string::npos){positions[14] = frameline.find(tags[14])+tags[14].length();}else{positions[14]=0;}
  203.        if (frameline.find(tags[15])!=string::npos){positions[15] = frameline.find(tags[15])+tags[15].length();}else{positions[15]=0;}
  204.        if (frameline.find(tags[16])!=string::npos){positions[16] = frameline.find(tags[16])+tags[16].length();}else{positions[16]=0;}
  205.        if (frameline.find(tags[17])!=string::npos){positions[17] = frameline.find(tags[17])+tags[17].length();}else{positions[17]=0;}
  206.        if (frameline.find(tags[18])!=string::npos){positions[18] = frameline.find(tags[18])+tags[18].length();}else{positions[18]=0;}
  207.        if (frameline.find(tags[19])!=string::npos){positions[19] = frameline.find(tags[19])+tags[19].length();}else{positions[19]=0;}
  208.        if (frameline.find(tags[20])!=string::npos){positions[20] = frameline.find(tags[20])+tags[20].length();}else{positions[20]=0;}
  209.        if (frameline.find(tags[21])!=string::npos){positions[21] = frameline.find(tags[21])+tags[21].length();}else{positions[21]=0;}
  210. for (int ice=0; ice < 22; ice ++){ //iter on tags positions
  211.                      for (int food = 0; food < frameline.length(); food++){ //iter on characters of the line
  212.                          done=false;
  213.                    
  214.                          while (!done&&(isdigit(frameline[food+positions[ice]]) || frameline.substr(food+positions[ice], 1)==","||frameline.substr(food+positions[ice], 1)=="-"
  215.                          ||frameline.substr(food+positions[ice], 1)=="+"||frameline.substr(food+positions[ice], 1)=="/"
  216.                          ||frameline.substr(food+positions[ice], 1)=="*"||frameline.substr(food+positions[ice], 1)=="("
  217.                          ||frameline.substr(food+positions[ice], 1)==")")){
  218.                                tempao+=frameline.substr(food+positions[ice],1);
  219.                                if (!isdigit(frameline[food+positions[ice]+1])&&!(frameline[food+positions[ice]+1]==',') &&(!(frameline.substr(food+positions[ice]+1, 1)=="-")
  220.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="+")&&!(frameline.substr(food+positions[ice]+1, 1)=="*")&&!(frameline.substr(food+positions[ice]+1, 1)=="/")
  221.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="(")&&!(frameline.substr(food+positions[ice]+1, 1)==")"))){
  222.                                                                switch (ice){
  223.                                                                       case 0: if (frameline.find(tags[0])!=string::npos){x=tempao;}else{x="0";}
  224.                                                                       food=99999;done=true;tempao="";break;
  225.                                                                       case 1: if (frameline.find(tags[1])!=string::npos){y=tempao;}else{y="0";
  226.                                                                       }food=99999;done=true;tempao="";break;
  227.                                                                       case 2: if (frameline.find(tags[2])!=string::npos){z=tempao;}else{z="-9";
  228.                                                                       }food=99999;done=true;tempao="";break;
  229.                                                                       case 3: if (frameline.find(tags[3])!=string::npos){w=tempao;}else{w="1";
  230.                                                                       }food=99999;done=true;tempao="";break;
  231.                                                                       case 4: if (frameline.find(tags[4])!=string::npos){h=tempao;}else{h="1";
  232.                                                                       }food=99999;done=true;tempao="";break;
  233.                                                                       case 5: if (frameline.find(tags[5])!=string::npos){z_w=tempao;}else{z_w="18";
  234.                                                                       }food=99999;done=true;tempao="";break;
  235.                                                                       case 6: if (frameline.find(tags[6])!=string::npos){sccss=tempao;}else{sccss="4321";
  236.                                                                       }food=99999;done=true;tempao="";break;
  237.                                                                       case 7: if (frameline.find(tags[7])!=string::npos){damage=tempao;}else{damage="0";
  238.                                                                       }food=99999;done=true;tempao="";break;
  239.                                                                       case 8: if (frameline.find(tags[8])!=string::npos){x_impct=tempao;}else{x_impct="0";
  240.                                                                       }food=99999;done=true;tempao="";break;
  241.                                                                       case 9: if (frameline.find(tags[9])!=string::npos){y_impct=tempao;}else{y_impct="0";
  242.                                                                       }food=99999;done=true;tempao="";break;
  243.                                                                       case 10: if (frameline.find(tags[10])!=string::npos){z_impct=tempao;}else{z_impct="0";
  244.                                                                       }food=99999;done=true;tempao="";break;  
  245.                                                                       case 11: if (frameline.find(tags[11])!=string::npos){hitfreq=tempao;}else{hitfreq="6";
  246.                                                                       }food=99999;done=true;tempao="";break;              
  247.                                                                       case 12: if (frameline.find(tags[12])!=string::npos){effect=tempao;}else{effect="0";
  248.                                                                       }food=99999;done=true;tempao="";break;        
  249.                                                                       case 13: if (frameline.find(tags[13])!=string::npos){strength=tempao;}else{strength="0";
  250.                                                                       }food=99999;done=true;tempao="";break;              
  251.                                                                       case 14: if (frameline.find(tags[14])!=string::npos){knock=tempao;}else{knock="0";
  252.                                                                       }food=99999;done=true;tempao="";break;    
  253.                                                                       case 15: if (frameline.find(tags[15])!=string::npos){tfgoto=tempao;}else{tfgoto="4321";
  254.                                                                       }food=99999;done=true;tempao="";break;    
  255.                                                                       case 16: if (frameline.find(tags[16])!=string::npos){tbgoto=tempao;}else{tbgoto="4321";
  256.                                                                       }food=99999;done=true;tempao="";break;    
  257.                                                                       case 17: if (frameline.find(tags[17])!=string::npos){t_x=tempao;}else{t_x="4321";
  258.                                                                       }food=99999;done=true;tempao="";break;    
  259.                                                                       case 18: if (frameline.find(tags[18])!=string::npos){t_y=tempao;}else{t_y="4321";
  260.                                                                       }food=99999;done=true;tempao="";break;    
  261.                                                                       case 19: if (frameline.find(tags[19])!=string::npos){t_z=tempao;}else{t_z="4321";
  262.                                                                       }food=99999;done=true;tempao="";break;    
  263.                                                                       case 20: if (frameline.find(tags[20])!=string::npos){crsid=tempao;}else{crsid="4321";
  264.                                                                       }food=99999;done=true;tempao="";break;    
  265.                                                                       case 21: if (frameline.find(tags[21])!=string::npos){rctdnsty=tempao;}else{rctdnsty="4321";
  266.                                                                       }food=99999;done=true;tempao="";break;                                  
  267.                                                                       default:;}}
  268.                                else{
  269.                                     food++;}
  270.                          }
  271.                      }
  272.                  }
  273. }
  274.  
  275.  
  276. class combination{
  277.     public:
  278.     bool exists;
  279.    
  280.         string input,time_interval, delay, nxt;
  281.         int inputseq[6]={4321, 4321, 4321, 4321, 4321, 4321};//0-0:ca, 1:cd, 2:cj, 3:cs, 4:cf, 5:cb, 6:cu_a, 7:cd_a, 8:cl_a, 9:cr_a
  282.                                                              //1-0:ha, 1:hd, 2:hj, 3:hs, 4:hf, 5:hb, 6:hu_a, 7:hd_a, 8:hl_a, 9:hr_a
  283.         int depth=0;    int startpos;
  284.     int endpos;
  285.         combination();
  286.         void init(string);
  287. };
  288. combination::combination(){
  289.     exists=false;
  290. }
  291.  
  292. void combination::init(string framelinee){
  293.  
  294.     exists=true;
  295.     int positions[4];
  296.     string tempao;
  297.     string maintag="set_combination[";
  298.     string tags[] = {"sequence=", "time_interval=", "delay_=", "goto_="};
  299.     startpos=framelinee.find(maintag);
  300.     endpos  =framelinee.find("]", startpos);
  301.     string frameline=framelinee.substr(startpos+maintag.length(), endpos-startpos-maintag.length());
  302.     string inputparas[]={"c<a>", "c<d>", "c<j>", "c<s>", "c<f>", "c<b>", "c<u_a>", "c<d_a>", "c<l_a>", "c<r_a>",
  303.                          "h<a>", "h<d>", "h<j>", "h<s>", "h<f>", "h<b>", "h<u_a>", "h<d_a>", "h<l_a>", "h<r_a>"};
  304.     bool done=false;
  305.        if (frameline.find(tags[0])!=string::npos){positions[0] = frameline.find(tags[0])+tags[0].length();}else{positions[0]=0;}
  306.        if (frameline.find(tags[1])!=string::npos){positions[1] = frameline.find(tags[1])+tags[1].length();}else{positions[1]=0;}                      
  307.        if (frameline.find(tags[2])!=string::npos){positions[2] = frameline.find(tags[2])+tags[2].length();}else{positions[2]=0;}
  308.        if (frameline.find(tags[3])!=string::npos){positions[3] = frameline.find(tags[3])+tags[3].length();}else{positions[3]=0;}
  309.  
  310. for (int ice=1; ice < 4; ice ++){ //iter on tags positions
  311.                      for (int food = 0; food < frameline.length(); food++){ //iter on characters of the line
  312.                          done=false;
  313.                    
  314.                          while (!done&&(isdigit(frameline[food+positions[ice]]) || frameline.substr(food+positions[ice], 1)==","||frameline.substr(food+positions[ice], 1)=="-"
  315.                          ||frameline.substr(food+positions[ice], 1)=="+"||frameline.substr(food+positions[ice], 1)=="/"
  316.                          ||frameline.substr(food+positions[ice], 1)=="*"||frameline.substr(food+positions[ice], 1)=="("
  317.                          ||frameline.substr(food+positions[ice], 1)==")")){
  318.                                tempao+=frameline.substr(food+positions[ice],1);
  319.                                if (!isdigit(frameline[food+positions[ice]+1])&&!(frameline[food+positions[ice]+1]==',') &&(!(frameline.substr(food+positions[ice]+1, 1)=="-")
  320.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="+")&&!(frameline.substr(food+positions[ice]+1, 1)=="*")&&!(frameline.substr(food+positions[ice]+1, 1)=="/")
  321.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="(")&&!(frameline.substr(food+positions[ice]+1, 1)==")"))){
  322.                                                                switch (ice){
  323.                                                                       case 1: if (frameline.find(tags[1])!=string::npos){time_interval=tempao;}else{time_interval="4321";
  324.                                                                       }food=99999;done=true;tempao="";break;
  325.                                                                       case 2: if (frameline.find(tags[2])!=string::npos){delay=tempao;}else{delay="0";
  326.                                                                       }food=99999;done=true;tempao="";break;    
  327.                                                                       case 3: if (frameline.find(tags[3])!=string::npos){nxt=tempao;}else{nxt="0";
  328.                                                                       }food=99999;done=true;tempao="";break;                                  
  329.                                                                       default:;}}                              
  330.                                                                      
  331.                                else{
  332.                                     food++;}
  333.                          }
  334.                      }
  335.                  }
  336.  
  337.                  input=frameline.substr(frameline.find("(", positions[0]), frameline.find(")", positions[0])+1-frameline.find("(", positions[0]));
  338.                  int temp0=input.find(" ");
  339.                  while(temp0!=string::npos){input.erase (temp0, 1); //clear spaces
  340.                     temp0=input.find(" ", temp0);}
  341.                  for (int b=0; b<20; b++){
  342.                     while(input.find(inputparas[b])!=string::npos)input.replace(input.find(inputparas[b]), inputparas[b].length(), stringify(b));
  343.                  }
  344.                  int tempinputseq[6];
  345.                  for (int b=0; b<6 && input.length()>2; b++){
  346.                      if (input.find(",")!=string::npos){
  347.                         inputseq[b]=Evaluate(input.substr(input.find("(")+1, input.find(",")-input.find("(")));
  348.                         tempinputseq[b]=Evaluate(input.substr(input.find("(")+1, input.find(",")-input.find("(")));
  349.                         input.erase(input.find("(")+1, input.find(",")-input.find("("));
  350.                         depth++;
  351.                      }else{
  352.                         inputseq[b]=Evaluate(input.substr(input.find("(")+1, input.find(")")-input.find("(")));
  353.                         tempinputseq[b]=Evaluate(input.substr(input.find("(")+1, input.find(")")-input.find("(")));
  354.                         input.erase(input.find("(")+1, input.find(")")-input.find("("));
  355.                         depth++;
  356.                      }
  357.                  }
  358.                  
  359.                  for (int c=0; c<depth; c++){
  360.                     inputseq[c]=tempinputseq[(depth-1)-c];
  361.                  }
  362.  
  363.  
  364. }
  365.  
  366.  
  367. int e (std::string s){return Evaluate(s);}
  368. bool collide(bdy b, rect r, int bposx, std::string bcx_, int bposy, std::string bcy_, int bposz, int rposx,
  369.              std::string rcx_, int rposy, std::string rcy_, int rposz, int bfc, int rfc, int * effx, int * effy,
  370.              SDL_Rect bsize[], SDL_Rect rsize[]){
  371.  
  372.     int rx=e(r.x); int bx=e(b.x); int ry=e(r.y);int by=e(b.y); int rz=e(r.z); int bz=e(b.z);
  373.     int rw=e(r.w); int bw=e(b.w); int rh=e(r.h); int bh=e(b.h); int rz_w=e(r.z_w); int bz_w=e(b.z_w);
  374.     int bcx=e(bcx_); int bcy=e(bcy_); int rcx=e(rcx_); int rcy=e(rcy_);
  375.        
  376.     bx= bfc==1?(bsize[0].w-(bx))-bw:bx;
  377.     rx = rfc==1?(rsize[0].w-(rx))-rw:rx;
  378.    
  379.     bx+= bfc==0 ? (bposx-bcx):(bposx-(bsize[0].w-bcx));
  380.     by+=(bposy-bcy);
  381.     bz+=(bposz);
  382.     rx+= rfc==0 ? (rposx-rcx):(rposx-(rsize[0].w-rcx));
  383.     ry+=(rposy-rcy);
  384.     rz+=(rposz);
  385.    
  386.     *effx= rfc==0? bx:bx+bw;
  387.     *effy=ry+(rh/2);
  388.     /*if ((rx >= bx && ry >= by && rz >= bz && rx <= bx+bw && ry <= by+bh && rz <= bz+bz_w) || //(0, 0, 0)
  389.         (rx >= bx && ry+rh >= by && rz >= bz && rx <= bx+bw && ry+rh <= by+bh && rz <= bz+bz_w) || //(0, 1, 0)
  390.         (rx >= bx && ry >= by && rz+rz_w >= bz && rx <= bx+bw && ry <= by+bh && rz+rz_w <= bz+bz_w) || //(0, 0, 1)
  391.         (rx+rw >= bx && ry >= by && rz >= bz && rx+rw <= bx+bw && ry <= by+bh && rz <= bz+bz_w) || //(1, 0, 0)
  392.         (rx+rw >= bx && ry+rh >= by && rz >= bz && rx+rw <= bx+bw && ry+rh <= by+bh && rz <= bz+bz_w) || //(1, 1, 0)
  393.         (rx+rw >= bx && ry >= by && rz+rz_w >= bz && rx+rw <= bx+bw && ry <= by+bh && rz+rz_w <= bz+bz_w) || //(1, 0, 1)
  394.         (rx >= bx && ry+rh >= by && rz+rz_w >= bz && rx <= bx+bw && ry+rh <= by+bh && rz+rz_w <= bz+bz_w) || //(0, 1, 1)
  395.         (rx+rw >= bx && ry+rh >= by && rz+rz_w >= bz && rx+rw <= bx+bw && ry+rh <= by+bh && rz+rz_w <= bz+bz_w))*/ //(1, 1, 1)
  396.     if ((max(rx, bx) < min(rx+rw, bx+bw) && max(ry, by) < min(ry+rh, by+bh) && max(rz, bz) < min(rz+rz_w, bz+bz_w))||
  397.         (max(rx, bx) < max(rx+rw, bx+bw) && max(rx, bx) < min(rx+rw, bx+bw) && max(ry, by) < min(ry+rh, by+bh) && max(rz, bz) < min(rz+rz_w, bz+bz_w))||
  398.         (max(rx, bx) < min(rx+rw, bx+bw) && max(ry, by) < max(ry+rh, by+bh) && max(ry, by) < min(ry+rh, by+bh) && max(rz, bz) < min(rz+rz_w, bz+bz_w))||
  399.         (max(rx, bx) < min(rx+rw, bx+bw) && max(ry, by) < min(ry+rh, by+bh) && max(rz, bz) < max(rz+rz_w, bz+bz_w)&& max(rz, bz) < min(rz+rz_w, bz+bz_w))||
  400.         (rx < bx && rx+rw > bx+bw && ry<by && ry+rh > by+bh && rz<bz && rz+rz_w > bz+bz_w)||(bx < rx && bx+bw > rx+rw && by<ry && by+bh > ry+rh && bz<rz && bz+bz_w > rz+rz_w))
  401.         {
  402.         return true;
  403.         }else{return false;}
  404.     }
  405.  
  406. class frame{
  407.      
  408.       string frameline;
  409.       public:
  410.         bool exists=false;
  411.         bool flags[13]={false, false, false, false, false, false, false, false, false, false, false, false, false};
  412.                          int rectindx=0;
  413.                  int bdyindx=0;
  414.                  int combinationindx=0;
  415.              vector<bdy> BDYS;
  416.              vector<rect> RECTS;
  417.              vector<combination> COMBINATIONS;
  418.              string f, img, delay, nxt, state, center_X, center_Y, f_x, f_y, f_z, loop_length, loop_goto, loop_condition, acc;
  419.              string zhlddstnc, xhlddstnc, zhldacc, xhldacc, mxlmtvx, mxlmtvy, mxlmtvz, counter, addhp, addsp, addrp, hitground;
  420.              string c_a, c_j, c_d, c_s, c_b, c_f, c_ua, c_da, h_a, h_j, h_d, h_s, h_b, h_f, h_ua, h_da, c_ra, c_la, h_ra, h_la;
  421.              string trans[3];
  422.              int no;
  423.              void init(string, int);
  424. };
  425.  
  426. void frame::init(string frameline, int no_){
  427.     exists=true;
  428.                  no=no_;
  429.                  bool validchar;
  430.                  int positions[39];
  431.                  string tempao;
  432.                  string tags[] = {"img=", "delay=", "goto=", "state=", "center=", "f_x=", "f_y=", "f_z=", "loop=", "acc=",
  433.                                     "z_hold_distance=","x_hold_distance=", "acc_x_hold=", "acc_z_hold=", "max_vx_limit=",
  434.                                      "max_vy_limit=", "max_vz_limit=", "counter=", "add_hp=", "add_sp=", "add_rp=",
  435.                                       "c<a>=", "c<j>=", "c<d>=", "c<s>=", "h<a>=", "h<j>=", "h<d>=", "h<s>=", "c<b>=", "h<b>=",
  436.                                       "hit_ground=", "c<f>=", "c<u_a>=", "c<d_a>=", "h<f>=", "h<u_a>=", "h<d_a>=", "c<r_a>=", "c<l_a>=",
  437.                                       "h<r_a>=", "h<l_a>=", "translate_x_y_z="};
  438.                 string flagslist[]={"|STANDING|","|WALKING|", "|DEFENDING|", "|ALLOWTURN|", "|REGENDPMAX|", "|REGENKPMAX|", "|REGENSP|",
  439.                  "|REGENRP|", "|NOSHADOW|", "|NOBARS|", "|NOHPBAR|",  "|NOSPBAR|", "|NORPBAR|"};
  440.                 for (int a=0; a<13; a++){
  441.                     if (frameline.find(flagslist[a])!=string::npos) flags[a]=true;
  442.                 }
  443.                  bool done=false;
  444.                        if (frameline.find(tags[0])!=string::npos){positions[0] = frameline.find(tags[0])+tags[0].length();}else{positions[0]=0;}
  445.                        if (frameline.find(tags[1])!=string::npos){positions[1] = frameline.find(tags[1])+tags[1].length();}else{positions[1]=0;}                      
  446.                        if (frameline.find(tags[2])!=string::npos){positions[2] = frameline.find(tags[2])+tags[2].length();}else{positions[2]=0;}
  447.                        if (frameline.find(tags[3])!=string::npos){positions[3] = frameline.find(tags[3])+tags[3].length();}else{positions[3]=0;}
  448.                        if (frameline.find(tags[4])!=string::npos){positions[4] = frameline.find(tags[4])+tags[4].length();}else{positions[4]=0;}
  449.                        if (frameline.find(tags[5])!=string::npos){positions[5] = frameline.find(tags[5])+tags[5].length();}else{positions[5]=0;}
  450.                        if (frameline.find(tags[6])!=string::npos){positions[6] = frameline.find(tags[6])+tags[6].length();}else{positions[6]=0;}
  451.                        if (frameline.find(tags[7])!=string::npos){positions[7] = frameline.find(tags[7])+tags[7].length();}else{positions[7]=0;}
  452.                        if (frameline.find(tags[8])!=string::npos){positions[8] = frameline.find(tags[8])+tags[8].length();}else{positions[8]=0;}
  453.                        if (frameline.find(tags[9])!=string::npos){positions[9] = frameline.find(tags[9])+tags[9].length();}else{positions[9]=0;}
  454.                        if (frameline.find(tags[10])!=string::npos){positions[10] = frameline.find(tags[10])+tags[10].length();}else{positions[10]=0;}
  455.                        if (frameline.find(tags[11])!=string::npos){positions[11] = frameline.find(tags[11])+tags[11].length();}else{positions[11]=0;}
  456.                        if (frameline.find(tags[12])!=string::npos){positions[12] = frameline.find(tags[12])+tags[12].length();}else{positions[12]=0;}
  457.                        if (frameline.find(tags[13])!=string::npos){positions[13] = frameline.find(tags[13])+tags[13].length();}else{positions[13]=0;}
  458.                        if (frameline.find(tags[14])!=string::npos){positions[14] = frameline.find(tags[14])+tags[14].length();}else{positions[14]=0;}
  459.                        if (frameline.find(tags[15])!=string::npos){positions[15] = frameline.find(tags[15])+tags[15].length();}else{positions[15]=0;}
  460.                        if (frameline.find(tags[16])!=string::npos){positions[16] = frameline.find(tags[16])+tags[16].length();}else{positions[16]=0;}
  461.                        if (frameline.find(tags[17])!=string::npos){positions[17] = frameline.find(tags[17])+tags[17].length();}else{positions[17]=0;}
  462.                        if (frameline.find(tags[18])!=string::npos){positions[18] = frameline.find(tags[18])+tags[18].length();}else{positions[18]=0;}
  463.                        if (frameline.find(tags[19])!=string::npos){positions[19] = frameline.find(tags[19])+tags[19].length();}else{positions[19]=0;}
  464.                        if (frameline.find(tags[20])!=string::npos){positions[20] = frameline.find(tags[20])+tags[20].length();}else{positions[20]=0;}
  465.                        if (frameline.find(tags[21])!=string::npos){positions[21] = frameline.find(tags[21])+tags[21].length();}else{positions[21]=0;}
  466.                        if (frameline.find(tags[22])!=string::npos){positions[22] = frameline.find(tags[22])+tags[22].length();}else{positions[22]=0;}
  467.                        if (frameline.find(tags[23])!=string::npos){positions[23] = frameline.find(tags[23])+tags[23].length();}else{positions[23]=0;}
  468.                        if (frameline.find(tags[24])!=string::npos){positions[24] = frameline.find(tags[24])+tags[24].length();}else{positions[24]=0;}
  469.                        if (frameline.find(tags[25])!=string::npos){positions[25] = frameline.find(tags[25])+tags[25].length();}else{positions[25]=0;}
  470.                        if (frameline.find(tags[26])!=string::npos){positions[26] = frameline.find(tags[26])+tags[26].length();}else{positions[26]=0;}
  471.                        if (frameline.find(tags[27])!=string::npos){positions[27] = frameline.find(tags[27])+tags[27].length();}else{positions[27]=0;}
  472.                        if (frameline.find(tags[28])!=string::npos){positions[28] = frameline.find(tags[28])+tags[28].length();}else{positions[28]=0;}
  473.                        if (frameline.find(tags[29])!=string::npos){positions[29] = frameline.find(tags[29])+tags[29].length();}else{positions[29]=0;}
  474.                        if (frameline.find(tags[30])!=string::npos){positions[30] = frameline.find(tags[30])+tags[30].length();}else{positions[30]=0;}
  475.                        if (frameline.find(tags[31])!=string::npos){positions[31] = frameline.find(tags[31])+tags[31].length();}else{positions[31]=0;}
  476.                        if (frameline.find(tags[32])!=string::npos){positions[32] = frameline.find(tags[32])+tags[32].length();}else{positions[32]=0;}
  477.                        if (frameline.find(tags[33])!=string::npos){positions[33] = frameline.find(tags[33])+tags[33].length();}else{positions[33]=0;}
  478.                        if (frameline.find(tags[34])!=string::npos){positions[34] = frameline.find(tags[34])+tags[34].length();}else{positions[34]=0;}
  479.                        if (frameline.find(tags[35])!=string::npos){positions[35] = frameline.find(tags[35])+tags[35].length();}else{positions[35]=0;}
  480.                        if (frameline.find(tags[36])!=string::npos){positions[36] = frameline.find(tags[36])+tags[36].length();}else{positions[36]=0;}
  481.                        if (frameline.find(tags[37])!=string::npos){positions[37] = frameline.find(tags[37])+tags[37].length();}else{positions[37]=0;}
  482.                        if (frameline.find(tags[38])!=string::npos){positions[38] = frameline.find(tags[38])+tags[38].length();}else{positions[38]=0;}
  483.                        
  484.  
  485.                        
  486.  
  487.                  for (int ice=0; ice < 39; ice ++){ //iter on tags positions
  488.                      for (int food = 0; food < frameline.length(); food++){ //iter on characters of the line
  489.                          done=false;
  490.                    
  491.                          while (!done&&(isdigit(frameline[food+positions[ice]]) || frameline.substr(food+positions[ice], 1)==","||frameline.substr(food+positions[ice], 1)=="-"
  492.                          ||frameline.substr(food+positions[ice], 1)=="+"||frameline.substr(food+positions[ice], 1)=="/"
  493.                          ||frameline.substr(food+positions[ice], 1)=="*"||frameline.substr(food+positions[ice], 1)=="("
  494.                          ||frameline.substr(food+positions[ice], 1)==")")){
  495.                                tempao+=frameline.substr(food+positions[ice],1);
  496.                                if (!isdigit(frameline[food+positions[ice]+1])&&!(frameline[food+positions[ice]+1]==',') &&(!(frameline.substr(food+positions[ice]+1, 1)=="-")
  497.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="+")&&!(frameline.substr(food+positions[ice]+1, 1)=="*")&&!(frameline.substr(food+positions[ice]+1, 1)=="/")
  498.                                &&!(frameline.substr(food+positions[ice]+1, 1)=="(")&&!(frameline.substr(food+positions[ice]+1, 1)==")"))){
  499.                                                                switch (ice){
  500.                                                                       case 0: if (frameline.find(tags[0])!=string::npos){img=tempao;}else{img="0";}
  501.                                                                       food=99999;done=true;tempao="";break;
  502.                                                                       case 1: if (frameline.find(tags[1])!=string::npos){delay=tempao;}else{delay="0";
  503.                                                                       }food=99999;done=true;tempao="";break;
  504.                                                                       case 2: if (frameline.find(tags[2])!=string::npos){nxt=tempao;}else{nxt=stringify(no+1);
  505.                                                                       }food=99999;done=true;tempao="";break;
  506.                                                                       case 3: if (frameline.find(tags[3])!=string::npos){state=tempao;}else{state="2";
  507.                                                                       }food=99999;done=true;tempao="";break;
  508.                                                                       case 4: if (frameline.find(tags[4])!=string::npos){center_X=tempao.substr(0, tempao.find(","));
  509.                                                                            center_Y=tempao.substr(tempao.find(",")+1, tempao.size()-tempao.find(","));}else{center_X="0";center_Y="0";
  510.                                                                            }
  511.                                                                            food=99999;done=true;tempao="";break;
  512.                                                                       case 5: if (frameline.find(tags[5])!=string::npos){f_x=tempao;}else{f_x="0";
  513.                                                                       }food=99999;done=true;tempao="";break;
  514.                                                                       case 6: if (frameline.find(tags[6])!=string::npos){f_y=tempao;}else{f_y="0";
  515.                                                                       }food=99999;done=true;tempao="";break;
  516.                                                                       case 7: if (frameline.find(tags[7])!=string::npos){f_z=tempao;}else{f_z="0";
  517.                                                                       }food=99999;done=true;tempao="";break;
  518.                                                                       case 8: if (frameline.find(tags[8])!=string::npos){loop_length=tempao.substr(0, tempao.find(","));
  519.                                                                            loop_condition=tempao.substr(tempao.find(",")+1, tempao.rfind(",")-tempao.find(","));
  520.                                                                            loop_goto=tempao.substr(tempao.rfind(",")+1);}else{loop_condition="4321"; loop_length="4321"; loop_goto="4321";
  521.                                                                            }food=99999;done=true;tempao="";break;
  522.                                                                       case 9: if (frameline.find(tags[9])!=string::npos){acc=tempao;}else{acc="0";
  523.                                                                       }food=99999;done=true;tempao="";break;
  524.                                                                       case 10: if (frameline.find(tags[10])!=string::npos){zhlddstnc=tempao;}else{zhlddstnc="0";
  525.                                                                       }food=99999;done=true;tempao="";break;
  526.                                                                       case 11: if (frameline.find(tags[11])!=string::npos){xhlddstnc=tempao;}else{xhlddstnc="0";
  527.                                                                       }food=99999;done=true;tempao="";break;
  528.                                                                       case 12: if (frameline.find(tags[12])!=string::npos){xhldacc=tempao;}else{xhldacc="0";
  529.                                                                       }food=99999;done=true;tempao="";break;
  530.                                                                       case 13: if (frameline.find(tags[13])!=string::npos){zhldacc=tempao;}else{zhldacc="0";
  531.                                                                       }food=99999;done=true;tempao="";break;
  532.                                                                       case 14: if (frameline.find(tags[14])!=string::npos){mxlmtvx=tempao;}else{mxlmtvx="4321";
  533.                                                                       }food=99999;done=true;tempao="";break;
  534.                                                                       case 15: if (frameline.find(tags[15])!=string::npos){mxlmtvy=tempao;}else{mxlmtvy="4321";
  535.                                                                       }food=99999;done=true;tempao="";break;
  536.                                                                       case 16: if (frameline.find(tags[16])!=string::npos){mxlmtvz=tempao;}else{mxlmtvz="4321";
  537.                                                                       }food=99999;done=true;tempao="";break;  
  538.                                                                       case 17: if (frameline.find(tags[17])!=string::npos){counter=tempao;}else{counter="4321";
  539.                                                                       }food=99999;done=true;tempao="";break;  
  540.                                                                       case 18: if (frameline.find(tags[18])!=string::npos){addhp=tempao;}else{addhp="4321";
  541.                                                                       }food=99999;done=true;tempao="";break;
  542.                                                                       case 19: if (frameline.find(tags[19])!=string::npos){addsp=tempao;}else{addsp="4321";
  543.                                                                       }food=99999;done=true;tempao="";break;  
  544.                                                                       case 20: if (frameline.find(tags[20])!=string::npos){addrp=tempao;}else{addrp="4321";
  545.                                                                       }food=99999;done=true;tempao="";break;    
  546.                                                                       case 21: if (frameline.find(tags[21])!=string::npos){c_a=tempao;}else{c_a="4321";
  547.                                                                       }food=99999;done=true;tempao="";break;
  548.                                                                       case 22: if (frameline.find(tags[22])!=string::npos){c_j=tempao;}else{c_j="4321";
  549.                                                                       }food=99999;done=true;tempao="";break;
  550.                                                                       case 23: if (frameline.find(tags[23])!=string::npos){c_d=tempao;}else{c_d="4321";
  551.                                                                       }food=99999;done=true;tempao="";break;
  552.                                                                       case 24: if (frameline.find(tags[24])!=string::npos){c_s=tempao;}else{c_s="4321";
  553.                                                                       }food=99999;done=true;tempao="";break;  
  554.                                                                       case 25: if (frameline.find(tags[25])!=string::npos){h_a=tempao;}else{h_a="4321";
  555.                                                                       }food=99999;done=true;tempao="";break;  
  556.                                                                       case 26: if (frameline.find(tags[26])!=string::npos){h_j=tempao;}else{h_j="4321";
  557.                                                                       }food=99999;done=true;tempao="";break;
  558.                                                                       case 27: if (frameline.find(tags[27])!=string::npos){h_d=tempao;}else{h_d="4321";
  559.                                                                       }food=99999;done=true;tempao="";break;  
  560.                                                                       case 28: if (frameline.find(tags[28])!=string::npos){h_s=tempao;}else{h_s="4321";
  561.                                                                       }food=99999;done=true;tempao="";break;    
  562.                                                                       case 29: if (frameline.find(tags[29])!=string::npos){h_b=tempao;}else{c_b="4321";
  563.                                                                       }food=99999;done=true;tempao="";break;  
  564.                                                                       case 30: if (frameline.find(tags[30])!=string::npos){h_b=tempao;}else{h_b="4321";
  565.                                                                       }food=99999;done=true;tempao="";break;  
  566.                                                                       case 31: if (frameline.find(tags[31])!=string::npos){hitground=tempao;}else{hitground="4321";
  567.                                                                       }food=99999;done=true;tempao="";break;          
  568.                                                                       case 32: if (frameline.find(tags[32])!=string::npos){c_f=tempao;}else{c_f="4321";
  569.                                                                       }food=99999;done=true;tempao="";break;          
  570.                                                                       case 33: if (frameline.find(tags[33])!=string::npos){c_ua=tempao;}else{c_ua="4321";
  571.                                                                       }food=99999;done=true;tempao="";break;          
  572.                                                                       case 34: if (frameline.find(tags[34])!=string::npos){c_da=tempao;}else{c_da="4321";
  573.                                                                       }food=99999;done=true;tempao="";break;          
  574.                                                                       case 35: if (frameline.find(tags[35])!=string::npos){h_f=tempao;}else{h_f="4321";
  575.                                                                       }food=99999;done=true;tempao="";break;          
  576.                                                                       case 36: if (frameline.find(tags[36])!=string::npos){h_ua=tempao;}else{h_ua="4321";
  577.                                                                       }food=99999;done=true;tempao="";break;          
  578.                                                                       case 37: if (frameline.find(tags[37])!=string::npos){h_da=tempao;}else{h_da="4321";
  579.                                                                       }food=99999;done=true;tempao="";break;    
  580.                                                                       case 38: if (frameline.find(tags[38])!=string::npos){trans[0]=tempao.substr(0, tempao.find(","));
  581.                                                                            trans[1]=tempao.substr(tempao.find(",")+1, tempao.rfind(",")-tempao.find(","));
  582.                                                                            trans[2]=tempao.substr(tempao.rfind(",")+1);}else{trans[0]="4321"; trans[1]="4321"; trans[2]="4321";
  583.                                                                            }food=99999;done=true;tempao="";break;        
  584.                                                                       default:;}}
  585.                                else{
  586.                                     food++;}
  587.                          }
  588.                      }
  589.                  }
  590.                  BDYS.resize(20);
  591.                  RECTS.resize(20);
  592.                  COMBINATIONS.resize(20);
  593.  
  594.                  while (frameline.find("set_bdy[")!=string::npos){
  595.                     BDYS[bdyindx].init(frameline);
  596.                     frameline.erase(BDYS[bdyindx].startpos, BDYS[bdyindx].endpos - BDYS[bdyindx].startpos);
  597.                     bdyindx++;
  598.                  }
  599.                  while (frameline.find("set_rect[")!=string::npos){
  600.                     RECTS[rectindx].init(frameline);
  601.                     frameline.erase(RECTS[rectindx].startpos, RECTS[rectindx].endpos - RECTS[rectindx].startpos);
  602.                     rectindx++;
  603.                  }
  604.                  while (frameline.find("set_combination[")!=string::npos){
  605.                     COMBINATIONS[combinationindx].init(frameline);
  606.                     frameline.erase(COMBINATIONS[combinationindx].startpos, COMBINATIONS[combinationindx].endpos - COMBINATIONS[combinationindx].startpos);
  607.                     combinationindx++;
  608.                  }
  609.                  
  610.                  
  611. }
  612.  
  613.  
  614.  
  615. class spritegrid{
  616.      
  617.      
  618.       public:
  619.         int w, h, col, row, frameno;
  620.         int gw, gh;
  621.       string colk;
  622.       //SDL_Surface *grid, *grid_;
  623.       //SDL_Texture *grid, *grid_;
  624.       GLuint grid;
  625.       GLuint shad;
  626.       vector<SDL_Rect> clip;
  627.       vector<SDL_Rect> clip_;
  628.  
  629.       void ini(string dir_, int w_, int h_, int col_, int row_, string colk_, int * number);
  630. };
  631.  
  632.  
  633. void spritegrid::ini(string dir_, int w_, int h_, int col_, int row_, string colk_, int * number){
  634.     SDL_Surface *_grid, *_grid_;
  635.     GLenum tex_format;
  636.                              colk = colk_;
  637.                              unsigned int col1, col2, col3;
  638.                              if (colk_!=",-"){
  639.                              
  640.                              
  641.                              col1=  strtol(("0x"+colk_.substr (3,2)).c_str(), NULL, 16);
  642.                              col2=  strtol(("0x"+ colk_.substr (5,2)).c_str(),NULL, 16);
  643.                              col3=  strtol(("0x"+ colk_.substr (7,2)).c_str(),NULL, 16);
  644. }
  645.                              *number+=row_*col_;
  646.                              col=col_;
  647.                              row=row_;
  648.                              frameno = row*col;
  649.                              
  650.                              clip.resize(frameno);
  651.                              clip_.resize(frameno);
  652.               //               clip, clip_ = new SDL_Rect[frameno];
  653.                              _grid = IMG_Load((dir_).c_str());
  654.                              _grid_ = IMG_Load((dir_).c_str());
  655.                              w=w_==4321?_grid->w:w_;
  656.                              h=h_==4321?_grid->h:h_;
  657.                              //_grid_= SDL_LoadBMP((dir_.substr(0, dir_.rfind("\\")+1 ) +"mirror_" + dir_.substr( dir_.rfind("\\")+1 , dir_.rfind(".BMP")-dir_.rfind("\\")+1 )).c_str());
  658.                              gw=_grid->w;
  659.                              gh=_grid->h;
  660.                              int grid_h = (_grid->h)/row;
  661.                              int grid_w = (_grid->w)/col;
  662.                              for (int j=0;j<row;j++){
  663.                                  for (int i=0;i<col;i++){
  664.                                      SDL_Rect recto =  {i*grid_w, j*grid_h, w, h};
  665.                                      clip[(i+(col*j))] = recto;
  666.                                      SDL_Rect recto2 =  {((col-i)*grid_w)-grid_w+(grid_w-w), j*grid_h, w, h};
  667.                                      clip_[i+(col*j)] = recto2;
  668.                                      }}
  669.                            
  670.                              
  671.  
  672.                             SDL_Color color;
  673. if (colk_!=",-"){
  674.  
  675.   for (int x = 0; x < _grid->w; x++)
  676.   {
  677.    for (int y = 0; y < _grid->h; y++)
  678.    {
  679.      unsigned int pix = ((unsigned int*)_grid->pixels)[y*(_grid->pitch/sizeof(unsigned int)) + x];
  680.     color =  translate_color(pix);
  681.     if (color.r == col1 && color.g == col2 && color.b == col3)    
  682.     {((unsigned int*)_grid->pixels)[y*(_grid->pitch/sizeof(unsigned int)) + x] = SDL_MapRGBA(_grid->format, 0, 0, 0, 0);
  683.     ((unsigned int*)_grid_->pixels)[y*(_grid_->pitch/sizeof(unsigned int)) + x] = SDL_MapRGBA(_grid_->format, 0, 0, 0, 0);
  684.     }
  685.    }
  686.   }
  687. }
  688.   for (int x = 0; x < _grid_->w; x++)
  689.   {
  690.    for (int y = 0; y < _grid_->h; y++)
  691.    {
  692.      unsigned int pix = ((unsigned int*)_grid_->pixels)[y*(_grid_->pitch/sizeof(unsigned int)) + x];
  693.     color =  translate_color(pix);
  694.     int alph=color.a;
  695.     if (!(int(color.a)==0 && int(color.r)==0 && int(color.g)==0 && int(color.b)==0))    
  696.     {((unsigned int*)_grid_->pixels)[y*(_grid_->pitch/sizeof(unsigned int)) + x] = SDL_MapRGBA(_grid_->format, 0, 0, 0, 125);
  697.     }
  698.    }
  699.   }
  700.                              if (_grid->format->BytesPerPixel==4){
  701.                             if (_grid->format->Rmask == 0x000000ff)tex_format=GL_RGBA;
  702.                             else tex_format=GL_BGRA;
  703.                            }else if (_grid->format->BytesPerPixel==3){
  704.                             if (_grid->format->Rmask == 0x000000ff)tex_format=GL_RGB;
  705.                             else tex_format=GL_BGR;
  706.                            }
  707.                            glGenTextures(1, &grid);
  708.                            glBindTexture(GL_TEXTURE_2D, grid);
  709.                            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  710.                            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  711.                            
  712.                            glTexImage2D(GL_TEXTURE_2D, 0, _grid->format->BytesPerPixel, _grid->w, _grid->h,
  713.                            0, tex_format, GL_UNSIGNED_BYTE, _grid->pixels);
  714.                            
  715.                             glGenTextures(1, &shad);
  716.                            glBindTexture(GL_TEXTURE_2D, shad);
  717.                            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  718.                            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  719.                            
  720.                            glTexImage2D(GL_TEXTURE_2D, 0, _grid_->format->BytesPerPixel, _grid_->w, _grid_->h,
  721.                            0, tex_format, GL_UNSIGNED_BYTE, _grid_->pixels);
  722.                            
  723.  
  724.                              //grid=SDL_CreateTextureFromSurface(MainRend, _grid);
  725.                              //grid_=SDL_CreateTextureFromSurface(MainRend, _grid_);
  726.                              SDL_FreeSurface(_grid);SDL_FreeSurface(_grid_);
  727.                              }
  728. /*-------------------------------------------------------------------------------------------------------------*/
  729. class background{
  730.       string name, bitmapfiledir;
  731.      
  732.       public:
  733.                            LVertexData2D V_DATA [4];
  734.                            GLuint I_DATA[4]={0, 1, 2, 3};
  735.                            GLuint VBO_ID, IBO_ID;
  736.              //SDL_Texture *backgroundTex;
  737.              //SDL_Texture *shadow;
  738.              GLuint backgroundTex;
  739.              GLuint shadow;
  740.              SDL_Rect position;
  741.              SDL_Rect shadowpos;
  742.              int zbound, zboundwidth, xbound, xboundwidth;
  743.              float shadangx, shadangy;
  744.              background(int, int, int, int, string, string);
  745.              void Blit (){
  746.  
  747.                
  748.                
  749.              //SDL_UpdateTexture(d, NULL,backgroundSurf->pixels, 960*sizeof (Uint32));
  750.              //SDL_RenderCopy(MainRend, backgroundTex, NULL, &position); //SDL 2.0
  751.              glBindTexture( GL_TEXTURE_2D, backgroundTex );
  752.              
  753.              glBegin(GL_QUADS);
  754.              
  755.              glTexCoord2i(0, 0);
  756.              glVertex3f(float(position.x) +CAM[0], float(position.y) +CAM[1] +CAM[2], 0);
  757.              glTexCoord2i(1, 0);
  758.              glVertex3f(float(position.x+position.w) +CAM[0], float(position.y)  +CAM[1] +CAM[2], 0);
  759.              glTexCoord2i(1, 1);
  760.              glVertex3f(float(position.x+position.w) +CAM[0], float(position.y+position.h) +CAM[1] +CAM[2], 0);
  761.              glTexCoord2i(0, 1);
  762.              glVertex3f(float(position.x) +CAM[0], float(position.y+position.h)  +CAM[1]  +CAM[2], 0);
  763.              glEnd();            
  764.              //SDL_BlitSurface (backgroundSurf, NULL, d, &position); //SDL 1.2
  765.              }
  766.        };
  767. background::background(int a, int  b, int c, int d, string e, string f){
  768.                  shadangx=0*(M_PI/180.0);
  769.                  shadangy=35*(M_PI/180.0);
  770.                  SDL_Surface *backgroundSurf;
  771.                  SDL_Surface *shadow_;
  772.                  GLenum tex_format;
  773.                            
  774.                            
  775.                            zbound = a;
  776.                            zboundwidth = b;
  777.                            xbound = c;
  778.                            xboundwidth = d;
  779.                            bitmapfiledir = e;
  780.                            backgroundSurf =  SDL_LoadBMP(("sys\\"+bitmapfiledir).c_str());
  781.                            //shadow_ =  SDL_LoadBMP(("sys\\"+f).c_str());
  782.                            //shadowpos={(shadow_->w)/2, (shadow_->h)/2, shadow_->w, shadow_->h};
  783.                            //Uint32 colorkey = SDL_MapRGB( shadow_->format, 0x0, 0x0, 0x0 );
  784.                            //SDL_SetColorKey( shadow_, SDL_TRUE, colorkey );
  785.                            position={0, 0, backgroundSurf->w, backgroundSurf->h};
  786.                            //backgroundTex=SDL_CreateTextureFromSurface(MainRend, backgroundSurf);
  787.                            //shadow=SDL_CreateTextureFromSurface(MainRend, shadow_);
  788.                            if (backgroundSurf->format->BytesPerPixel==4){
  789.                             if (backgroundSurf->format->Rmask == 0x000000ff)tex_format=GL_RGBA;
  790.                             else tex_format=GL_BGRA;
  791.                            }else if (backgroundSurf->format->BytesPerPixel==3){
  792.                             if (backgroundSurf->format->Rmask == 0x000000ff)tex_format=GL_RGB;
  793.                             else tex_format=GL_BGR;
  794.                            }
  795.                            glGenTextures(1, &backgroundTex);
  796.                            glBindTexture(GL_TEXTURE_2D, backgroundTex);
  797.                            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  798.                            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  799.                            
  800.                            glTexImage2D(GL_TEXTURE_2D, 0, backgroundSurf->format->BytesPerPixel, backgroundSurf->w, backgroundSurf->h,
  801.                            0, tex_format, GL_UNSIGNED_BYTE, backgroundSurf->pixels);
  802.                            
  803.  
  804.                            
  805. /*                         V_DATA [0].texCoord.x= 0;V_DATA [0].texCoord.y= 0;
  806.                            V_DATA [1].texCoord.x= 1;V_DATA [1].texCoord.y= 0;
  807.                            V_DATA [2].texCoord.x= 1;V_DATA [2].texCoord.y= 1;
  808.                            V_DATA [3].texCoord.x= 0;V_DATA [3].texCoord.y= 1;
  809.                            
  810.                            V_DATA [0].position.x= 0;V_DATA [0].position.y= 0;
  811.                            V_DATA [1].position.x= position.w;V_DATA [1].position.y= 0;
  812.                            V_DATA [2].position.x= position.w;V_DATA [2].position.y= position.h;
  813.                            V_DATA [3].position.x= 0;V_DATA [3].position.y= position.h;                        
  814.  
  815.                            
  816.                            glGenBuffers(1, &VBO_ID);
  817.                            glBindBuffer(GL_ARRAY_BUFFER, VBO_ID);
  818.                            glBufferData(GL_ARRAY_BUFFER, 4*sizeof(GLuint), V_DATA, GL_DYNAMIC_DRAW );
  819.                            
  820.                            glGenBuffers(1, &IBO_ID);
  821.                            glBindBuffer(GL_ARRAY_BUFFER, IBO_ID);
  822.                            glBufferData(GL_ARRAY_BUFFER, 4*sizeof(GLuint), I_DATA, GL_DYNAMIC_DRAW );
  823.                            
  824.                            glBindBuffer( GL_ARRAY_BUFFER, NULL );
  825.                            glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, NULL );
  826.                          
  827.                            
  828. */
  829.                            SDL_FreeSurface(backgroundSurf);
  830. }
  831. /*-------------------------------------------------------------------------------------------------------------*/
  832. class object{
  833.      
  834.       public:
  835.         int wkspdx, wkspdz, frameno, w, h, facing=0, id, maxhp, maxsp, maxrp, inihp, inisp, inirp, delayU, nxt, currhp, currsp, currrp;
  836.       int rphit, rpsec, rpdam, sphit, spsec, spdam, armor, armorrate, walking, standing, dashing, previousframe, U_loop_length, accU, falling, knockrate;
  837.       int jumping, jmpspdx, jmpspdz, hitground, whenhit, whenhitb, type, knocked, maxdp, defendrate, maxkp, lying, hittxtwidth, hitnowidth, fatigue, inair;
  838.       vector<frame> Frames;
  839.       vector<spritegrid> IMGS;
  840.       int spritecount=0, imgindx=0;
  841.      
  842.       string sprtfl, name, dpndncs, afildir;
  843.  
  844.              void init (int id, string dpndncs, string afildir);
  845.              void Blit   (background BG, objcopy * objcop, LOAD * LOADED);
  846.              void Walk (background BG, objcopy *objcop){
  847.                   if (objcop->movedirx < 2 || objcop->movedirz < 2){
  848.                   if (objcop->facing == 0){
  849.                              if (objcop->movedirx == 0 && (objcop->posx+wkspdx < BG.xbound+BG.xboundwidth)) objcop->posx += wkspdx;
  850.                              if (objcop->movedirx == 1) objcop->facing = 1;
  851.                              if (objcop->movedirz == 0 && (objcop->posz-wkspdz > BG.zbound)) objcop->posz -= wkspdz;
  852.                              if (objcop->movedirz == 1 && (objcop->posz+wkspdz < BG.zbound+BG.zboundwidth)) objcop->posz += wkspdz;}
  853.                   if (objcop->facing == 1){
  854.                              if (objcop->movedirx == 0) objcop->facing = 0;
  855.                              if (objcop->movedirx == 1 && (objcop->posx-wkspdx > BG.xbound)) objcop->posx -= wkspdx;
  856.                              if (objcop->movedirz == 0 && (objcop->posz-wkspdz > BG.zbound)) objcop->posz -= wkspdz;
  857.                              if (objcop->movedirz == 1 && (objcop->posz+wkspdz < BG.zbound+BG.zboundwidth)) objcop->posz += wkspdz;}
  858.  
  859.                   }}
  860.                  
  861.              void Move (int value, char axis, background BG, objcopy * objcop){
  862.                 if (axis=='x'&&value > 0){
  863.                     if (objcop->posx+value > (BG.xbound+BG.xboundwidth)){
  864.                         objcop->posx=BG.xbound+BG.xboundwidth;
  865.                     }else{
  866.                         objcop->posx+=value;
  867.                     }
  868.                 }
  869.                 else if (axis=='x'&&value < 0){
  870.                     if (objcop->posx+value < BG.xbound){
  871.                         objcop->posx=BG.xbound;
  872.                     }else{
  873.                         objcop->posx+=value;
  874.                     }
  875.                 }
  876.  
  877.                 if (axis=='z'&&value >= 0){
  878.                     if (objcop->posz+value > (BG.zbound+BG.zboundwidth)){
  879.                         objcop->posz=BG.zbound+BG.zboundwidth;
  880.                     }else{
  881.                         objcop->posz+=value;
  882.                     }
  883.                 }
  884.                 else if (axis=='z'&&value < 0){
  885.                     if (objcop->posz+value < BG.zbound){
  886.                         objcop->posz=BG.zbound;
  887.                     }else{
  888.                         objcop->posz+=value;
  889.                     }
  890.                 }
  891.  
  892.                 if (axis=='y'){
  893.                     if (objcop->posy+value > objcop->GROUNDPOS){
  894.                         objcop->posy=objcop->GROUNDPOS;
  895.                     }else{
  896.                         objcop->posy+=value;
  897.                     }
  898.                 }
  899.  
  900.              }
  901.              
  902.  
  903.              
  904.              void Update_Frame_If_Time(objcopy * objcop, LOAD * LOADED);
  905.              
  906.  
  907.              void Apply_loop(objcopy * objcop){
  908.  
  909.                      if (objcop->previousframe!=4321 && Evaluate(Frames[objcop->currframe].loop_condition)==objcop->previousframe && !bool(objcop->doloop[0]) && Evaluate(Frames[objcop->currframe].loop_length)!=0&&objcop->newframe){ //loop tag
  910.                         objcop->U_loop_length= Evaluate(Frames[objcop->currframe].loop_length);
  911.                         objcop->doloop[0]=1;
  912.                         objcop->doloop[1]=objcop->currframe;
  913.                      }
  914.                      if (Evaluate(Frames[objcop->currframe].loop_condition)==objcop->previousframe && (bool)objcop->doloop[0]&&objcop->newframe){
  915.                         if (objcop->U_loop_length == 0){
  916.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].loop_goto);
  917.                             objcop->doloop[0]=0;objcop->newframe=true;
  918.                         }else{
  919.                         objcop->U_loop_length--;}
  920.                      }
  921.              }
  922.              
  923.              void Apply_f_x(background A_Field, objcopy * objcop){
  924.                      if (Evaluate(Frames[objcop->currframe].f_x)!=0){           //f_x tag
  925.                         if (Evaluate(Frames[objcop->currframe].f_x)!=4321){
  926.                             if (objcop->facing==0){
  927.                              objcop->total_fx=Evaluate(Frames[objcop->currframe].f_x);
  928.                             }
  929.                             else{
  930.                              objcop->total_fx=(Evaluate(Frames[objcop->currframe].f_x)*-1);
  931.                             }
  932.                         }else{objcop->total_fx=0;}
  933.                      }
  934.                      
  935.                      
  936.  
  937.              }
  938.              
  939.              void Apply_f_y(background A_Field, objcopy * objcop){
  940.                 if (Evaluate(Frames[objcop->currframe].f_y)!=0){           //f_y tag
  941.                 if (Evaluate(Frames[objcop->currframe].f_y)!=4321){
  942.                     objcop->total_fy=Evaluate(Frames[objcop->currframe].f_y);
  943.                 }else{objcop->total_fy=0;}
  944.              }
  945.              
  946.              }
  947.        
  948.              
  949.              void Apply_FRICTION(objcopy * objcop){
  950.                 if (type==0 && !objcop->caught){
  951.                      if(objcop->total_fx!=0&&objcop->posy==objcop->GROUNDPOS){ //apply friction
  952.                         if (objcop->total_fx>0){
  953.                             objcop->total_fx-=objcop->FRICTION;
  954.                             if (objcop->total_fx<0) objcop->total_fx=0;
  955.                         }else if (objcop->total_fx<0){
  956.                             objcop->total_fx+=objcop->FRICTION;
  957.                             if (objcop->total_fx>0) objcop->total_fx=0;
  958.                         }
  959.                      }
  960.              }}
  961.              
  962.              void Apply_GRAVITY(objcopy * objcop){
  963.                 if (type==0 && !objcop->caught){
  964.                      if(objcop->posy<objcop->GROUNDPOS&&Evaluate(Frames[objcop->currframe].f_y)!=4321){ //apply graviry
  965.                             objcop->total_fy+=objcop->GRAVITY;
  966.                             if (objcop->posy+objcop->total_fy>=objcop->GROUNDPOS){
  967.                              objcop->total_fy=0.0; objcop->posy=0.0;objcop->previousframe=objcop->currframe;objcop->newframe=true;
  968.                              if(Evaluate(Frames[objcop->currframe].hitground)!=4321){
  969.                                  objcop->currframe=Evaluate(Frames[objcop->currframe].hitground);
  970.                              }else{
  971.                                 objcop->currframe=hitground;
  972.                                }}
  973.                      }
  974.              }}
  975.              
  976.  
  977.              
  978.              void Apply_acc(objcopy * objcop){
  979.                 if (objcop->facing ==0) objcop->total_fx+=Evaluate(Frames[objcop->currframe].acc);   //acc tag
  980.                 if (objcop->facing ==1)  objcop->total_fx-=Evaluate(Frames[objcop->currframe].acc);
  981.              }
  982.              
  983.              void Apply_x_z_hold_distance(background A_Field, objcopy * objcop){
  984.                 if (type==0){
  985.                  if (objcop->P_UP==true){Move(-Evaluate(Frames[objcop->currframe].zhlddstnc), 'z', A_Field, objcop);}  //z_hold_distance tag
  986.                  if (objcop->P_DOWN==true){Move(Evaluate(Frames[objcop->currframe].zhlddstnc), 'z', A_Field, objcop);}
  987.                  
  988.                  if (objcop->P_RIGHT==true){objcop->total_fx+= Evaluate(Frames[objcop->currframe].xhlddstnc);}  //x_hold_distance tag
  989.                  if (objcop->P_LEFT==true){objcop->total_fx-= Evaluate(Frames[objcop->currframe].xhlddstnc);}
  990.              }}
  991.              
  992.              void Apply_x_hold_distance(objcopy * objcop){
  993.                      if (objcop->P_RIGHT==true && objcop->facing == 0){
  994.                         objcop->total_fx+=Evaluate(Frames[objcop->currframe].xhldacc);
  995.                      }
  996.                      if (objcop->P_LEFT==true && objcop->facing == 1){
  997.                         objcop->total_fx-=Evaluate(Frames[objcop->currframe].xhldacc);
  998.                      }
  999.              }
  1000.              
  1001.              void Basic_Stand_Walk_Dash(background A_Field, objcopy * objcop){
  1002.                 if (type==0){
  1003.                
  1004.                      if ((objcop->P_UP==true||objcop->P_DOWN==true||objcop->P_LEFT==true||objcop->P_RIGHT==true)&&Frames[objcop->currframe].flags[0]){
  1005.                         if (objcop->DASHR==1&&objcop->P_RIGHT==true&&objcop->facing==0){
  1006.                             objcop->previousframe=objcop->currframe;objcop->currframe=dashing;objcop->newframe=true;objcop->DASHR=0;objcop->DASHL=0;objcop->DshClksIntrvlL,objcop->DshClksIntrvlR=0;
  1007.                         }else if(objcop->DASHL==1&&objcop->P_LEFT==true&&objcop->facing==1){
  1008.                             objcop->previousframe=objcop->currframe;objcop->currframe=dashing;objcop->newframe=true;objcop->DASHL=0;objcop->DASHR=0;objcop->DshClksIntrvlL,objcop->DshClksIntrvlR=0;
  1009.                         }else{
  1010.                          objcop->previousframe=objcop->currframe;objcop->currframe=walking;objcop->newframe=true;}}
  1011.                         if(Frames[objcop->currframe].flags[1] && !(objcop->P_UP==true||objcop->P_DOWN==true||objcop->P_LEFT==true||objcop->P_RIGHT==true)){
  1012.                         objcop->currframe=standing;objcop->newframe=true;objcop->previousframe=objcop->currframe;
  1013.                      }
  1014.                           if (Frames[objcop->currframe].flags[1]){
  1015.                                 if (objcop->P_UP==true){objcop->movedirz = 0;}
  1016.                                 else if (objcop->P_DOWN==true){objcop->movedirz =1;}else objcop->movedirz = 2;
  1017.                                 if (objcop->P_LEFT==true){objcop->movedirx = 1;}
  1018.                                 else if (objcop->P_RIGHT==true){objcop->movedirx= 0;}else objcop->movedirx = 2;
  1019.                                 Walk(A_Field, objcop);}
  1020.              }}
  1021.              
  1022.              void Apply_max_limit_vx(objcopy * objcop){
  1023.                 if (Evaluate(Frames[objcop->currframe].mxlmtvx) != 4321){
  1024.                 if (objcop->facing ==0){
  1025.                     if (objcop->total_fx > Evaluate(Frames[objcop->currframe].mxlmtvx)) objcop->total_fx = Evaluate(Frames[objcop->currframe].mxlmtvx);
  1026.                     if (objcop->total_fx < Evaluate(Frames[objcop->currframe].mxlmtvx)*-1) objcop->total_fx = Evaluate(Frames[objcop->currframe].mxlmtvx)*-1;
  1027.                 }else{
  1028.                     if (objcop->total_fx < Evaluate(Frames[objcop->currframe].mxlmtvx)*-1) objcop->total_fx = Evaluate(Frames[objcop->currframe].mxlmtvx)*-1;
  1029.                     if (objcop->total_fx > Evaluate(Frames[objcop->currframe].mxlmtvx)) objcop->total_fx = Evaluate(Frames[objcop->currframe].mxlmtvx);
  1030.                 }
  1031.              }
  1032.              }
  1033.              void Apply_max_limit_vy(objcopy * objcop){
  1034.                 if (Evaluate(Frames[objcop->currframe].mxlmtvy) != 4321){
  1035.                 if (objcop->total_fy>0){
  1036.                     if (objcop->total_fy > Evaluate(Frames[objcop->currframe].mxlmtvy)) objcop->total_fy = Evaluate(Frames[objcop->currframe].mxlmtvy);
  1037.                 }else{
  1038.                     if (objcop->total_fy < Evaluate(Frames[objcop->currframe].mxlmtvy)*-1) objcop->total_fy = Evaluate(Frames[objcop->currframe].mxlmtvy)*-1;
  1039.                 }
  1040.              }
  1041.              }
  1042.              
  1043.              void Basic_Jump(objcopy * objcop){
  1044.                      if (Frames[objcop->currframe].flags[3]&&(objcop->P_LEFT==true || objcop->P_RIGHT==true)){
  1045.                         if (objcop->P_LEFT==true) objcop->facing=1;
  1046.                         if (objcop->P_RIGHT==true) objcop->facing=0;
  1047.                        
  1048.                      }
  1049.                      if (objcop->P_JUMP==true && objcop->posy==objcop->GROUNDPOS && (Frames[objcop->currframe].flags[0]||Frames[objcop->currframe].flags[1])){
  1050.                         objcop->previousframe=objcop->currframe;objcop->currframe=jumping;objcop->newframe=true;
  1051.                      }
  1052.              }
  1053.              void BlitShadow(background BG, objcopy * objcop){
  1054.                 if (objcop->showshadow && objcop->picn!=999){
  1055.                
  1056.                                float cx=float(IMGS[objcop->gridn].clip[objcop->picn].x);
  1057.                                float cy=float(IMGS[objcop->gridn].clip[objcop->picn].y);
  1058.                                float cw=float(IMGS[objcop->gridn].clip[objcop->picn].w);
  1059.                                float ch=float(IMGS[objcop->gridn].clip[objcop->picn].h);
  1060.                 if (objcop->facing==0 && objcop->picn!=999){float pos[] = {objcop->posx-Evaluate(Frames[objcop->currframe].center_X)  , objcop->posz-Evaluate(Frames[objcop->currframe].center_Y)-objcop->posy, IMGS[objcop->gridn].clip[objcop->picn].w, IMGS[objcop->gridn].clip[objcop->picn].h};
  1061.                              
  1062.                              glBindTexture( GL_TEXTURE_2D, IMGS[objcop->gridn].shad ); 
  1063.                                glBegin(GL_QUADS);  
  1064.                              glTexCoord2f(cx/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1065.                              glVertex2f(pos[0]+pos[2]*tan(BG.shadangx) +CAM[0], pos[1]+pos[3]+(pos[3])*tan(BG.shadangy));
  1066.                              glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1067.                              glVertex2f(pos[0]+pos[2]+pos[2]*tan(BG.shadangx) +CAM[0], pos[1]+pos[3]+(pos[3]*tan(BG.shadangy)));
  1068.                              glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1069.                              glVertex2f(pos[0]+pos[2] +CAM[0], pos[1]+pos[3]);
  1070.                              glTexCoord2f(cx/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1071.                              glVertex2f(pos[0] +CAM[0], pos[1]+pos[3]);
  1072.                              glEnd();  
  1073.                  }
  1074.                 if (objcop->facing==1 && objcop->picn!=999){int tempaval=(objcop->posx+Evaluate(Frames[objcop->currframe].center_X)+objcop->posx);
  1075.                     float pos[] = {objcop->posx-((IMGS[objcop->gridn].clip_[objcop->picn].w)-Evaluate(Frames[objcop->currframe].center_X)) , objcop->posz-Evaluate(Frames[objcop->currframe].center_Y)-objcop->posy, IMGS[objcop->gridn].clip[objcop->picn].w, IMGS[objcop->gridn].clip[objcop->picn].h};
  1076.                              glBindTexture( GL_TEXTURE_2D, IMGS[objcop->gridn].shad );
  1077.              
  1078.                              glBegin(GL_QUADS);
  1079.                              
  1080.                              glTexCoord2f(cx/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1081.                              glVertex2f(pos[0]+pos[2]+pos[2]*tan(BG.shadangx) +CAM[0], pos[1]+pos[3]+pos[3]*tan(BG.shadangy));
  1082.                              //glColor3f(0.0f, 0.0/f, 0.2f);
  1083.                              glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1084.                              glVertex2f(pos[0]+pos[2]*tan(BG.shadangx) +CAM[0], pos[1]+pos[3]+pos[3]*tan(BG.shadangy));
  1085.                              glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1086.                              glVertex2f(pos[0] +CAM[0], pos[1]+pos[3]);
  1087.                              glTexCoord2f(cx/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1088.                              glVertex2f(pos[0]+pos[2] +CAM[0], pos[1]+pos[3]);
  1089.                              glEnd();   } }
  1090.              }
  1091.              
  1092.              void Respond_ToInput(objcopy * objcop){
  1093.                 if (objcop->currsp >= 0){
  1094.                     bool smthisclicked=false;
  1095.                      if (objcop->P_ATTACK_C) {
  1096.                         for (int abc=5;abc>=0;abc--){
  1097.                             objcop->inputarray[abc]=abc==0?4321:objcop->inputarray[abc-1];
  1098.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1099.                         }
  1100.                         objcop->inputarray[0]=0;objcop->inputarray[0+6]=SDL_GetTicks();
  1101.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1102.                     }
  1103.                    
  1104.                      if (objcop->P_DEFEND_C) {
  1105.                         for (int abc=5;abc>=0;abc--){
  1106.                             objcop->inputarray[abc]=abc==0?4321:int(objcop->inputarray[abc-1]);
  1107.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1108.                         }
  1109.                         objcop->inputarray[0]=1;objcop->inputarray[6]=SDL_GetTicks();
  1110.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1111.                     }
  1112.                      if (objcop->P_JUMP_C) {
  1113.                          for (int abc=5;abc>=0;abc--){
  1114.                             objcop->inputarray[abc]=abc==0?4321:objcop->inputarray[abc-1];
  1115.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1116.                         }
  1117.                         objcop->inputarray[0]=2;objcop->inputarray[6]=SDL_GetTicks();
  1118.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1119.                     }
  1120.                      if (objcop->P_SPECIAL_C ) {
  1121.                          for (int abc=5;abc>=0;abc--){
  1122.                             objcop->inputarray[abc]=abc==0?4321:objcop->inputarray[abc-1];
  1123.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1124.                         }
  1125.                         objcop->inputarray[0]=3;objcop->inputarray[6]=SDL_GetTicks();
  1126.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1127.                     }
  1128.                      if (objcop->P_UP_C) {
  1129.                          for (int abc=5;abc>=0;abc--){
  1130.                             objcop->inputarray[abc]=abc==0?4321:objcop->inputarray[abc-1];
  1131.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1132.                         }
  1133.                         objcop->inputarray[0]=6;objcop->inputarray[6]=SDL_GetTicks();
  1134.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1135.                     }
  1136.                      if (objcop->P_DOWN_C) {
  1137.                          for (int abc=5;abc>=0;abc--){
  1138.                             objcop->inputarray[abc]=abc==0?4321:objcop->inputarray[abc-1];
  1139.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1140.                         }
  1141.                         objcop->inputarray[0]=7;objcop->inputarray[6]=SDL_GetTicks();
  1142.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1143.                     }
  1144.                      //if (objcop->P_LEFT_C && Evaluate(Frames[objcop->currframe].c_la)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_la);objcop->newframe=true; }
  1145.                      //if (objcop->P_RIGHT_C && Evaluate(Frames[objcop->currframe].c_ra)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_ra);objcop->newframe=true; }
  1146.                      if ((objcop->P_RIGHT_C && objcop->facing == 0)||(objcop->P_LEFT_C && objcop->facing == 1)) {
  1147.                          for (int abc=5;abc>=0;abc--){
  1148.                             objcop->inputarray[abc]=abc==0?4321:objcop->inputarray[abc-1];
  1149.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1150.                         }
  1151.                         objcop->inputarray[0]=4;objcop->inputarray[6]=SDL_GetTicks();
  1152.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1153.                     }
  1154.                      if ((objcop->P_RIGHT_C && objcop->facing == 1)||(objcop->P_LEFT_C && objcop->facing == 0)) {
  1155.                          for (int abc=5;abc>=0;abc--){
  1156.                             objcop->inputarray[abc]=abc==0?4321:objcop->inputarray[abc-1];
  1157.                             objcop->inputarray[abc+6]=abc==0?4321:objcop->inputarray[abc+6-1];
  1158.                         }
  1159.                         objcop->inputarray[0]=5;objcop->inputarray[6]=SDL_GetTicks();
  1160.                         for (int asdf=0; asdf<12; asdf++) std::cout<<","<<objcop->inputarray[asdf]; std::cout<<"\n";
  1161.                     }
  1162.                        
  1163.                      if (objcop->P_UP && Evaluate(Frames[objcop->currframe].h_ua)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_ua);objcop->newframe=true; }
  1164.                      if (objcop->P_DOWN && Evaluate(Frames[objcop->currframe].h_da)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_da);objcop->newframe=true; }
  1165.                      //if (objcop->P_LEFT && Evaluate(Frames[objcop->currframe].h_la)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_la);objcop->newframe=true; }
  1166.                      //if (objcop->P_RIGHT && Evaluate(Frames[objcop->currframe].h_ra)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_ra);objcop->newframe=true; }
  1167.    
  1168.                      if (objcop->P_ATTACK && Evaluate(Frames[objcop->currframe].h_a)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_a);objcop->newframe=true; }
  1169.                      if (objcop->P_JUMP && Evaluate(Frames[objcop->currframe].h_j)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_j);objcop->newframe=true; }
  1170.                      if (objcop->P_DEFEND && Evaluate(Frames[objcop->currframe].h_d)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_d);objcop->newframe=true; }
  1171.                      if (objcop->P_SPECIAL && Evaluate(Frames[objcop->currframe].h_s)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_s);objcop->newframe=true; }
  1172.                      
  1173.                      if (((objcop->P_RIGHT && objcop->facing == 0)||(objcop->P_LEFT && objcop->facing == 1)) && Evaluate(Frames[objcop->currframe].h_f)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_f);objcop->newframe=true; }
  1174.                      if (((objcop->P_RIGHT && objcop->facing == 1)||(objcop->P_LEFT && objcop->facing == 0)) && Evaluate(Frames[objcop->currframe].h_b)!=4321) {objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].h_b);objcop->newframe=true; }
  1175.  
  1176.                 if (!objcop->caught){
  1177.                 int tempameh=0;
  1178.                 for (int y=0; y < Frames[objcop->currframe].combinationindx; y++){
  1179.                     bool correctinput=true;
  1180.                     for (int z=0; z < Frames[objcop->currframe].COMBINATIONS[y].depth; z++){
  1181.  
  1182.                        
  1183.                         if (Frames[objcop->currframe].COMBINATIONS[y].inputseq[z] > 9){
  1184.                             //correctinput= correctinput && Frames[objcop->currframe].COMBINATIONS[y].inputseq[z]-10==objcop->inputarray[z];
  1185.                             switch (Frames[objcop->currframe].COMBINATIONS[y].inputseq[z]){
  1186.                                 case 10: correctinput= correctinput&&objcop->P_ATTACK;break;
  1187.                                 case 11: correctinput= correctinput&&objcop->P_DEFEND;break;
  1188.                                 case 12: correctinput= correctinput&&objcop->P_JUMP;break;
  1189.                                 case 13: correctinput= correctinput&&objcop->P_SPECIAL;break;
  1190.                                 case 14: correctinput= correctinput&&((objcop->P_RIGHT&&objcop->facing==0)||(objcop->P_LEFT&&objcop->facing==1));break;
  1191.                                 case 15: correctinput= correctinput&&((objcop->P_RIGHT&&objcop->facing==1)||(objcop->P_LEFT&&objcop->facing==0));break;
  1192.                                 case 16: correctinput= correctinput&&objcop->P_UP;break;
  1193.                                 case 17: correctinput= correctinput&&objcop->P_DOWN;break;
  1194.                                 case 18: correctinput= correctinput&&objcop->P_LEFT;break;
  1195.                                 case 19: correctinput= correctinput&&objcop->P_RIGHT;break;
  1196.                                 default:correctinput=false;
  1197.                             }
  1198.                            
  1199.                         }else{
  1200.                             correctinput= correctinput && Frames[objcop->currframe].COMBINATIONS[y].inputseq[z]==objcop->inputarray[z];
  1201.                            
  1202.                         }
  1203.                         tempameh++;
  1204.                        
  1205.                     }
  1206.                     if (Frames[objcop->currframe].COMBINATIONS[y].depth>0 &&correctinput && (Evaluate(Frames[objcop->currframe].COMBINATIONS[y].time_interval)>=(objcop->inputarray[6]-objcop->inputarray[6+Frames[objcop->currframe].COMBINATIONS[y].depth-1])||Evaluate(Frames[objcop->currframe].COMBINATIONS[y].time_interval)==4321)){
  1207.                         objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].COMBINATIONS[y].nxt);objcop->newframe=true;
  1208.                         smthisclicked=true;
  1209.                         for (int xyz=0; xyz<tempameh; xyz++) objcop->inputarray[xyz]=4321;
  1210.                        
  1211.                     }
  1212.                 }
  1213.  
  1214.                
  1215.  
  1216.                      if (Evaluate(Frames[objcop->currframe].c_a)!=4321 && objcop->P_ATTACK_C && !smthisclicked){
  1217.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_a);objcop->newframe=true;
  1218.                             smthisclicked=true;
  1219.                      }
  1220.                      if (Evaluate(Frames[objcop->currframe].c_d)!=4321 && objcop->P_DEFEND_C && !smthisclicked){
  1221.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_d);objcop->newframe=true;smthisclicked=true;
  1222.                      }
  1223.                      if (Evaluate(Frames[objcop->currframe].c_j)!=4321 && objcop->P_JUMP_C && !smthisclicked){
  1224.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_j);objcop->newframe=true;smthisclicked=true;
  1225.                      }
  1226.                      if (Evaluate(Frames[objcop->currframe].c_s)!=4321 && objcop->P_SPECIAL_C && !smthisclicked){
  1227.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_s);objcop->newframe=true; smthisclicked=true;
  1228.                      }
  1229.                      if (Evaluate(Frames[objcop->currframe].c_ua)!=4321 && objcop->P_UP_C && !smthisclicked){
  1230.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_ua);objcop->newframe=true;smthisclicked=true;
  1231.                      }
  1232.                      if (Evaluate(Frames[objcop->currframe].c_da)!=4321 && objcop->P_DOWN_C  && !smthisclicked){
  1233.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_da);objcop->newframe=true; smthisclicked=true;
  1234.                      }
  1235.                      if (Evaluate(Frames[objcop->currframe].c_f)!=4321 && ((objcop->P_RIGHT_C && objcop->facing == 0)||(objcop->P_LEFT_C && objcop->facing == 1))  && !smthisclicked){
  1236.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_f);objcop->newframe=true; smthisclicked=true;
  1237.                      }
  1238.                      if (Evaluate(Frames[objcop->currframe].c_b)!=4321 && ((objcop->P_RIGHT_C && objcop->facing == 1)||(objcop->P_LEFT_C && objcop->facing == 0))  && !smthisclicked){
  1239.                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].c_b);objcop->newframe=true;smthisclicked=true;
  1240.                      }
  1241.                    
  1242.                      if (objcop->facing == 0){
  1243.                         if(objcop->P_RIGHT)objcop->total_fx+=Evaluate(Frames[objcop->currframe].xhldacc);
  1244.                         if(objcop->P_LEFT)objcop->total_fx-=Evaluate(Frames[objcop->currframe].xhldacc);
  1245.                      }
  1246.                      if (objcop->facing == 1){
  1247.                         if(objcop->P_LEFT)objcop->total_fx-=Evaluate(Frames[objcop->currframe].xhldacc);
  1248.                         if(objcop->P_RIGHT)objcop->total_fx+=Evaluate(Frames[objcop->currframe].xhldacc);
  1249.                      }}
  1250.                                     objcop->gridn=0;
  1251.                                 objcop->picn=Evaluate(Frames[objcop->currframe].img);
  1252.                                 if (objcop->picn!=999){
  1253.                                
  1254.                                 for (int gridno=0; gridno<imgindx; gridno++){
  1255.                                     if (objcop->picn > IMGS[gridno].frameno-1){
  1256.                                         objcop->gridn+=1;
  1257.                                         objcop->picn-=IMGS[gridno].row*IMGS[gridno].col;
  1258.                                     }
  1259.                                     else{
  1260.                                         break;
  1261.                                     }
  1262.                              }}
  1263.                 }
  1264.  
  1265.              }
  1266.              
  1267.              /*void When_Player_Is_Hit(objcopy * objcop, LOAD * LOADED){
  1268.                 for (int x=0;x < LOADED->ON_SCREEN_OBJCOUNT;x++){
  1269.                     if (LOADED->ON_SCREEN_OBJS[x]->currframe!=4321){
  1270.                    
  1271.                      if(LOADED->ON_SCREEN_OBJS[x]->team!=objcop->team){
  1272.                         for (int y=0; y < Frames[objcop->currframe].bdyindx; y++){
  1273.                             int effx, effy;
  1274.                             for (int z=0; z < LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].rectindx; z++){
  1275.                                 if (collide(Frames[objcop->currframe].BDYS[y], LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z],
  1276.                                          objcop->posx, Frames[objcop->currframe].center_X, objcop->posy, Frames[objcop->currframe].center_Y, objcop->posz,
  1277.                                          LOADED->ON_SCREEN_OBJS[x]->posx, LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_X,
  1278.                                          LOADED->ON_SCREEN_OBJS[x]->posy, LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_Y,
  1279.                                          LOADED->ON_SCREEN_OBJS[x]->posz, objcop->facing, LOADED->ON_SCREEN_OBJS[x]->facing, &effx, &effy,
  1280.                                          &IMGS[objcop->gridn].clip[0], &LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].IMGS[LOADED->ON_SCREEN_OBJS[x]->gridn].clip[0])){
  1281.                                     if (!(objcop->lasthitby==x && objcop->hitcounter!=0)){
  1282.                                         objcop->currdp= objcop->currdp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].strength)>=0?objcop->currdp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].strength):0;
  1283.                                         objcop->currkp= objcop->currkp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].knock   )>=0?objcop->currkp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].knock   ):0;
  1284.                                         objcop->currhp= objcop->currhp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].damage  )>=0?objcop->currhp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].damage  ):0;
  1285.                                         objcop->lasthitby=x;
  1286.                                         objcop->hitcounter=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].hitfreq);
  1287.                                         if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].x_impct)!=0){
  1288.                                             if (LOADED->ON_SCREEN_OBJS[x]->facing ==0){objcop->total_fx=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].x_impct);}
  1289.                                             else{objcop->total_fx=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].x_impct)*-1;}
  1290.                                         }
  1291.                                         if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].y_impct)!=0){
  1292.                                             objcop->total_fy=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].y_impct);
  1293.                                         }
  1294.                                                                    
  1295.                                                                      
  1296.                                         if (Evaluate(Frames[objcop->currframe].BDYS[y].respond)!=4321){
  1297.                                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].BDYS[y].respond);objcop->newframe=true;
  1298.                                         }else if(objcop->currkp<=0){
  1299.                                             objcop->previousframe=objcop->currframe;objcop->currframe=knocked; objcop->currkp=maxkp; objcop->newframe=true;
  1300.                                             objcop->total_fx= objcop->total_fy==0 && objcop->total_fx==0?15:objcop->total_fx; objcop->total_fy=objcop->total_fy>=0?-7:objcop->total_fy;
  1301.                                         }else if((maxkp-objcop->currkp)>70){
  1302.                                             objcop->previousframe=objcop->currframe;objcop->currframe=falling; objcop->newframe=true;
  1303.                                             objcop->total_fx= objcop->total_fy==0 && objcop->total_fx==0?15:objcop->total_fx; objcop->total_fy=objcop->total_fy>=0?-7:objcop->total_fy;
  1304.                                         }else{
  1305.                                             objcop->previousframe=objcop->currframe;objcop->currframe= objcop->facing+LOADED->ON_SCREEN_OBJS[x]->facing%2==1?whenhit:whenhitb;objcop->newframe=true;
  1306.                                            
  1307.                                         }
  1308.                                        
  1309.                                         LOADED->ON_SCREEN_OBJS[x]->hit_xNO= stringify(Evaluate(LOADED->ON_SCREEN_OBJS[x]->hit_xNO)+1);
  1310.                                        
  1311.                                         if(LOADED->HITSYS){
  1312.                                             CallObj(1010, 10, effx-(LOADED->OBJECTS[1010].hittxtwidth), effy-50, objcop->posz, 0, LOADED);//"HITX text
  1313.                                             for (int digit=0; digit<LOADED->ON_SCREEN_OBJS[x]->hit_xNO.length(); digit++){
  1314.                                                 CallObj(1010, Evaluate(LOADED->ON_SCREEN_OBJS[x]->hit_xNO.substr(digit, 1)), effx+(LOADED->OBJECTS[1010].hitnowidth*digit), effy-50, objcop->posz, 0, LOADED);
  1315.                                             }
  1316.                                            
  1317.                                             /*if (hit_xNO>999) {CallObj(1010, (hit_xNO-hit_xNO%1000)/1000, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO-=hit_xNO-hit_xNO%1000;}
  1318.                                             if (hit_xNO>99) {CallObj(1010, (hit_xNO-hit_xNO%100)/100, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO-=hit_xNO-hit_xNO%100;}
  1319.                                             if (hit_xNO>9) {CallObj(1010, (hit_xNO-hit_xNO%10)/10, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO-=hit_xNO-hit_xNO%10;}
  1320.                                             if (hit_xNO>=0) {CallObj(1010, hit_xNO, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO=0;}*-/
  1321.                                         }
  1322.                                         CallObj(1000, 0, effx, effy, objcop->posz, objcop->facing, LOADED);
  1323.                                     }
  1324.                                 }
  1325.                             }
  1326.                         }
  1327.                      }
  1328.                  }  }
  1329.              }*/
  1330.  
  1331.              void Regenerate_Deplete_Stuff(objcopy * objcop){
  1332.                
  1333.                 if (Frames[objcop->currframe].flags[5]) objcop->currkp = maxkp;
  1334.                
  1335.                 objcop->currsp=objcop->currsp+float(spsec/60)>=maxsp?maxsp:objcop->currsp+float(spsec/60); //Regen SP
  1336.                 objcop->currkp=objcop->currkp+float(knockrate/60)>=maxkp?maxkp:objcop->currkp+float(knockrate/60); //Regen Knock Points
  1337.                 objcop->currrp=objcop->currrp+float(rpsec/60)>=maxrp?maxrp:objcop->currrp+float(rpsec/60); //Regen RP
  1338.                 objcop->hitcounter-=objcop->hitcounter!=0?1:0; //Regen Hit Counter
  1339.                      //objcop->tempcount= objcop->tempcount==60?0:++objcop->tempcount;
  1340.              }
  1341.              
  1342.              void Set_IMG_No_On_Current_Grid(objcopy * objcop){
  1343.                     objcop->gridn=0;
  1344.                     objcop->picn=Evaluate(Frames[objcop->currframe].img);
  1345.                     if (objcop->picn!=999){
  1346.                    
  1347.                     for (int gridno=0; gridno<imgindx; gridno++){
  1348.                         if (objcop->picn > IMGS[gridno].frameno-1){
  1349.                             objcop->gridn+=1;
  1350.                             objcop->picn-=IMGS[gridno].row*IMGS[gridno].col;
  1351.                         }
  1352.                         else{
  1353.                             break;
  1354.                         }
  1355.                     }}
  1356.              }
  1357.              
  1358.  
  1359.              void Update(background, LOAD*,  objcopy * objcop);
  1360.              void Extract_bdys();
  1361.              void CallObj(int, int, int, int, int, int , LOAD* );
  1362.       };
  1363.  
  1364. void objcopy::init(object* obj, int tm, bool iscom_, float gravity, float friction, int posx_,int posz_){
  1365.     id=obj->id;
  1366.     facing=obj->facing;
  1367.     iscom=iscom_;
  1368.     isdead=false;
  1369.     team=tm;
  1370.     posx=posx_;
  1371.     posy=GROUNDPOS;
  1372.     posz=posz_;
  1373.     currhp=obj->inihp;
  1374.     currsp=obj->inisp;
  1375.     currrp=obj->inirp;
  1376.     currdp=obj->maxdp;
  1377.     currkp=obj->maxkp;
  1378.     currframe=obj->standing;
  1379.     GRAVITY=gravity;
  1380.     FRICTION=friction;
  1381.     P_UP=false;P_DOWN=false;P_LEFT=false;P_RIGHT=false;P_ATTACK=false;P_DEFEND=false;P_JUMP=false;P_SPECIAL=false;
  1382. }
  1383.  
  1384.  
  1385. void object::init(int id_, string dpndncs, string afildir){
  1386.     id=id_;
  1387.     name="AAAA4321";
  1388.                           IMGS.resize(20);
  1389.                           Frames.resize(650);  
  1390.                           previousframe=4321;
  1391.                           string tags[] = {"NAME=","MAXPTS_HP_SP_RP=","INITPTS_HP_SP_RP=","WALKSPD_X_Z=","RPRATEPER_HIT_SEC_DAMAGE=",
  1392.                           "ARMORPTS_MAX_RATE=","STANDING=","WALKING=", "DASHING=", "JUMPING=", "JUMPSPD_X_Z=","HIT_GROUND=","WHEN_HIT_FRONT=",
  1393.                            "WHEN_HIT_BACK=", "KNOCKPTS_MAX_RATEPERSEC=", "KNOCKED=", "DEFENDPTS_MAX_RATEPERSEC=", "FALLING=", "LYING=",
  1394.                            "TEXTWIDTH=", "NUMBERSWIDTH=", "SPRATEPER_HIT_SEC_DAMAGE=", "FATIGUE=", "IN_AIR=", "[img]"};
  1395.                           fstream A_FILE(afildir.c_str());
  1396.                           string tempariro, frameline, tempariro2;
  1397.                           int trigger, triggahcomma=0;
  1398.                           int positions[26];
  1399.                           size_t starto, endo, temp0;
  1400.                          
  1401.                           bool extraction = false;
  1402.          
  1403.                           if (A_FILE.is_open()){
  1404.                           while (A_FILE.good()){
  1405.                                          
  1406.                                 getline(A_FILE, frameline);
  1407.                                 extraction = false;
  1408.                                 temp0=frameline.find(" ");
  1409.                                 while(temp0!=string::npos){frameline.erase (temp0, 1);
  1410.                                 temp0=frameline.find(" ", temp0);}
  1411.                                 if (frameline.find("{info}")!= string::npos) trigger = 1;
  1412.                                 while (trigger==1){
  1413.                                    getline(A_FILE, frameline);
  1414.                                    if (frameline.rfind(tags[0])!=string::npos)positions[0] = frameline.rfind(tags[0])+tags[0].length();
  1415.                                    if (frameline.rfind(tags[1])!=string::npos)positions[1] = frameline.rfind(tags[1])+tags[1].length();
  1416.                                    if (frameline.rfind(tags[2])!=string::npos)positions[2] = frameline.rfind(tags[2])+tags[2].length();
  1417.                                    if (frameline.rfind(tags[3])!=string::npos)positions[3] = frameline.rfind(tags[3])+tags[3].length();
  1418.                                    if (frameline.rfind(tags[4])!=string::npos)positions[4] = frameline.rfind(tags[4])+tags[4].length();
  1419.                                    if (frameline.rfind(tags[5])!=string::npos)positions[5] = frameline.rfind(tags[5])+tags[5].length();
  1420.                                    if (frameline.rfind(tags[6])!=string::npos)positions[6] = frameline.rfind(tags[6])+tags[6].length();
  1421.                                    if (frameline.rfind(tags[7])!=string::npos)positions[7] = frameline.rfind(tags[7])+tags[7].length();
  1422.                                    if (frameline.rfind(tags[8])!=string::npos)positions[8] = frameline.rfind(tags[8])+tags[8].length();
  1423.                                    if (frameline.rfind(tags[9])!=string::npos)positions[9] = frameline.rfind(tags[9])+tags[9].length();
  1424.                                    if (frameline.rfind(tags[10])!=string::npos)positions[10] = frameline.rfind(tags[10])+tags[10].length();
  1425.                                    if (frameline.rfind(tags[11])!=string::npos)positions[11] = frameline.rfind(tags[11])+tags[11].length();
  1426.                                    if (frameline.rfind(tags[12])!=string::npos)positions[12] = frameline.rfind(tags[12])+tags[12].length();
  1427.                                    if (frameline.rfind(tags[13])!=string::npos)positions[13] = frameline.rfind(tags[13])+tags[13].length();
  1428.                                    if (frameline.rfind(tags[14])!=string::npos)positions[14] = frameline.rfind(tags[14])+tags[14].length();
  1429.                                    if (frameline.rfind(tags[15])!=string::npos)positions[15] = frameline.rfind(tags[15])+tags[15].length();
  1430.                                    if (frameline.rfind(tags[16])!=string::npos)positions[16] = frameline.rfind(tags[16])+tags[16].length();
  1431.                                    if (frameline.rfind(tags[17])!=string::npos)positions[17] = frameline.rfind(tags[17])+tags[17].length();
  1432.                                    if (frameline.rfind(tags[18])!=string::npos)positions[18] = frameline.rfind(tags[18])+tags[18].length();
  1433.                                    if (frameline.rfind(tags[19])!=string::npos)positions[19] = frameline.rfind(tags[19])+tags[19].length();
  1434.                                    if (frameline.rfind(tags[20])!=string::npos)positions[20] = frameline.rfind(tags[20])+tags[20].length();
  1435.                                    if (frameline.rfind(tags[21])!=string::npos)positions[21] = frameline.rfind(tags[21])+tags[21].length();
  1436.                                    if (frameline.rfind(tags[22])!=string::npos)positions[22] = frameline.rfind(tags[22])+tags[22].length();
  1437.                                    if (frameline.rfind(tags[23])!=string::npos)positions[23] = frameline.rfind(tags[23])+tags[23].length();
  1438.                                    if (frameline.rfind(tags[24])!=string::npos){positions[24] = frameline.rfind(tags[24])+tags[24].length();trigger=0; A_FILE.seekp(ios::beg);getline(A_FILE, frameline);getline(A_FILE, frameline);}
  1439.                                    }
  1440.                
  1441.                                    
  1442.                           if (trigger != 1){
  1443.                                      
  1444.                                for (int ice=0; ice < 25; ice ++){ //iter on tags positions
  1445.  
  1446.                                    for (int food = 0; food < frameline.length(); food++){ //iter on characters of the line
  1447.                                    
  1448.                                    while (trigger==11){
  1449.                                                 if (frameline.rfind("[/img]")!=string::npos) {trigger =0; break;}
  1450.                                                 string spgdarg0 = string(frameline.substr(0, frameline.find(",")));
  1451.                                                 int    spgdarg1 = atoi(frameline.substr(frameline.find(",")+1,frameline.find(",", frameline.find(",")+1)).c_str());
  1452.                                                 int    spgdarg2 = atoi(frameline.substr(frameline.find(",", frameline.find(",")+1)+1,  frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)).c_str());
  1453.                                                 int    spgdarg3 = atoi(frameline.substr( frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1, frameline.find(",", frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1)).c_str());
  1454.                                                 int    spgdarg4 = atoi(frameline.substr(frameline.find(",", frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1)+1, frameline.find(",", (frameline.find(",", frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1)+1))).c_str());
  1455.                                                 string spgdarg5 = frameline.substr(frameline.rfind(','));  
  1456.                                                 sprtfl =  spgdarg0;
  1457.                                                 //*1*/string(frameline.substr(0, frameline.find(","))),
  1458.                                                 //*2*/int(frameline.substr(frameline.find(",")+1,frameline.find(",", frameline.find(",")+1)).c_str()),
  1459.                                                 //*3*/int(frameline.substr(frameline.find(",", frameline.find(",")+1)+1,  frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)).c_str()),
  1460.                                                 //*4*/int(frameline.substr( frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1, frameline.find(",", frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1)).c_str()),
  1461.                                                 //*5*/int(frameline.substr(frameline.find(",", frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1)+1, frameline.find(",", (frameline.find(",", frameline.find(",", frameline.find(",", frameline.find(",")+1)+1)+1)+1)).c_str()),
  1462.                                                 //frameline.substr(frameline.rfind(',')));  
  1463.                                                 spritegrid a;
  1464.                                                 a.ini(spgdarg0, spgdarg1, spgdarg2, spgdarg3, spgdarg4, spgdarg5, &spritecount);
  1465.                                                 IMGS[imgindx]= a; imgindx ++;  
  1466.                                                 food = 10000;ice=100000;
  1467.                                                 getline(A_FILE, frameline);                                  
  1468.                                           }                                                                                                                                                                                                                                                                                                                                
  1469.                                           if (ice == 24 && (frameline.rfind(tags[ice])!=string::npos)){
  1470.                                                 trigger =11;food=10000;ice=1000;
  1471.                                           }
  1472.                                          
  1473.                                          
  1474.                                        if (ice<=23){
  1475.                                           while (ice==21 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){
  1476.                                        
  1477.                                                 if (triggahcomma==0){  //RPRATEPEhjR_HIT
  1478.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1479.                                                     if (triggahcomma==1){ sphit=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1480.                                                
  1481.                                                 if (triggahcomma==1){  //RPRATEPER_SEC_DAMAGE
  1482.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =2;}else{tempariro+=(frameline.substr(positions[ice]+food, 1).c_str());food++;}
  1483.                                                     if (triggahcomma==2){ spsec=atoi(tempariro.c_str()); tempariro = "";spdam=atoi(frameline.substr(frameline.rfind(",")+1).c_str());triggahcomma=0;extraction = true;food=1000;  }}
  1484.                                                 else{
  1485.                                                      food++;}}
  1486.                                           while (ice==16 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){  
  1487.                                                    
  1488.                                                 if (triggahcomma==0){  //defendpts
  1489.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1490.                                                     if (triggahcomma==1){maxdp=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1491.                                                
  1492.                                                 if (triggahcomma==1){ //defendrate
  1493.                                                     defendrate=atoi(frameline.substr(positions[ice]+food).c_str()); tempariro = "";triggahcomma=0;extraction=true;food=1000;}
  1494.                                                 else{
  1495.                                                      food++;}}
  1496.                                           while (ice==14 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){  
  1497.                                                    
  1498.                                                 if (triggahcomma==0){  //fallpts
  1499.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1500.                                                     if (triggahcomma==1){maxkp=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1501.                                                
  1502.                                                 if (triggahcomma==1){ //fallrate
  1503.                                                     knockrate=atoi(frameline.substr(positions[ice]+food).c_str()); tempariro = "";triggahcomma=0;extraction=true;food=1000;}
  1504.                                                 else{
  1505.                                                      food++;}}                                                      
  1506.                                           while (ice==10 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){  
  1507.                                                    
  1508.                                                 if (triggahcomma==0){  //JUMPSPDX
  1509.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1510.                                                     if (triggahcomma==1){jmpspdx=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1511.                                                
  1512.                                                 if (triggahcomma==1){ //JUMPSPDZ
  1513.                                                     jmpspdz=atoi(frameline.substr(positions[ice]+food).c_str()); tempariro = "";triggahcomma=0;extraction=true;food=1000;}
  1514.                                                 else{
  1515.                                                      food++;}}
  1516.                                           while (ice==5 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){  
  1517.                                                    
  1518.                                                 if (triggahcomma==0){  //JUMPSPDX
  1519.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1520.                                                     if (triggahcomma==1){armor=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1521.                                                
  1522.                                                 if (triggahcomma==1){ //JUMPSPDZ
  1523.                                                     armorrate=atoi(frameline.substr(positions[ice]+food).c_str()); tempariro = "";triggahcomma=0;extraction=true;food=1000;}
  1524.                                                 else{
  1525.                                                      food++;}}
  1526.                                           while (ice==4 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){
  1527.                                        
  1528.                                                 if (triggahcomma==0){  //RPRATEPEhjR_HIT
  1529.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1530.                                                     if (triggahcomma==1){ rphit=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1531.                                                
  1532.                                                 if (triggahcomma==1){  //RPRATEPER_SEC_DAMAGE
  1533.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =2;}else{tempariro+=(frameline.substr(positions[ice]+food, 1).c_str());food++;}
  1534.                                                     if (triggahcomma==2){ rpsec=atoi(tempariro.c_str()); tempariro = "";rpdam=atoi(frameline.substr(frameline.rfind(",")+1).c_str());triggahcomma=0;extraction = true;food=1000;  }}
  1535.                                                 else{
  1536.                                                      food++;}}
  1537.                                           while (ice==3 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){  
  1538.                                                    
  1539.                                                 if (triggahcomma==0){  //WALKSPDX
  1540.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1541.                                                     if (triggahcomma==1){wkspdx=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1542.                                                
  1543.                                                 if (triggahcomma==1){ //WALKSPDZ
  1544.                                                     wkspdz=atoi(frameline.substr(positions[ice]+food).c_str()); tempariro = "";triggahcomma=0;extraction=true;food=1000;}
  1545.                                                 else{
  1546.                                                      food++;}}
  1547.                                                      
  1548.                                           while (ice==2 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){
  1549.                                                
  1550.                                            
  1551.                                                 if (triggahcomma==0){  //INIT_HP
  1552.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1553.                                                     if (triggahcomma==1){ inihp=atoi(tempariro.c_str()); tempariro = ""; food++;}}
  1554.                                                
  1555.                                                 if (triggahcomma==1){  //INIT_MP &INIT_RP
  1556.                                                    if(frameline.substr(food+positions[ice],1).find(",")!=string::npos) {triggahcomma =2;}else{tempariro+=(frameline.substr(positions[ice]+food, 1).c_str());food++;}
  1557.                                                     if (triggahcomma==2){ inisp=atoi(tempariro.c_str()); tempariro = "";inirp=atoi(frameline.substr(frameline.rfind(",")+1).c_str());triggahcomma=0;extraction=true;food=1000; }}
  1558.                                                 else{
  1559.                                                      food++;}}
  1560.                                                      
  1561.                                           while (ice == 1 && (frameline.rfind(tags[ice])!=string::npos) && !extraction){
  1562.                                                
  1563.                                                 if (triggahcomma==0){  //MAX_HP
  1564.                                                    if(frameline.substr(food+positions[ice],1).find(",")!=string::npos){triggahcomma =1;}else if (isdigit(frameline[food+positions[ice]])){tempariro+=(frameline.substr(food+positions[ice], 1).c_str());}
  1565.                                                    if (triggahcomma==1){ maxhp=atoi(tempariro.c_str()); tempariro = "";food++;}}
  1566.                                                
  1567.                                                 if (triggahcomma==1){  //MAX_MP &MAX_RP
  1568.                                                     if(frameline.substr(food+positions[ice],1).find(",")!=string::npos) {triggahcomma =2;}else{tempariro+=(frameline.substr(positions[ice]+food, 1).c_str());food++;}
  1569.                                                     if (triggahcomma==2){ maxsp=atoi(tempariro.c_str()); tempariro = "";maxrp=atoi(frameline.substr(frameline.rfind(",")+1).c_str());triggahcomma=0;extraction =true;food=1000; }}
  1570.                                                 else{
  1571.                                                      food++;}}
  1572.                                                      
  1573.                                         switch (ice){
  1574.                                                case 23: if (frameline.rfind(tags[ice])!=string::npos)inair=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1575.                                                case 22: if (frameline.rfind(tags[ice])!=string::npos)fatigue=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1576.                                                case 20: if (frameline.rfind(tags[ice])!=string::npos)hitnowidth=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1577.                                                case 19: if (frameline.rfind(tags[ice])!=string::npos)hittxtwidth=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1578.                                                case 18: if (frameline.rfind(tags[ice])!=string::npos)lying=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1579.                                                case 17: if (frameline.rfind(tags[ice])!=string::npos)falling=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1580.                                                case 15: if (frameline.rfind(tags[ice])!=string::npos)knocked=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1581.                                                case 13: if (frameline.rfind(tags[ice])!=string::npos)whenhitb=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1582.                                                case 12: if (frameline.rfind(tags[ice])!=string::npos)whenhit=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1583.                                                case 11: if (frameline.rfind(tags[ice])!=string::npos)hitground=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1584.                                                case 9: if (frameline.rfind(tags[ice])!=string::npos) jumping=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1585.                                                case 8: if (frameline.rfind(tags[ice])!=string::npos) dashing=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1586.                                                case 7: if (frameline.rfind(tags[ice])!=string::npos) walking=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1587.                                                case 6: if (frameline.rfind(tags[ice])!=string::npos) standing=atoi(frameline.substr(positions[ice]).c_str());food=1000; break;
  1588.                                                case 0: if (frameline.rfind(tags[ice])!=string::npos) name=frameline.substr(positions[ice]);food=1000;break;
  1589.                                                default:;}
  1590.                                        
  1591.                                        
  1592.                                           }
  1593.                                          
  1594.                                          
  1595.                                          
  1596.                                       //cout<< "name: " << name << endl <<"WALKSPD_X_Z: "<<maxsp<<endl;    
  1597.                                 if (frameline.find("{/info}")!= string::npos){
  1598.                                     tempariro2="";
  1599.                                     while(A_FILE.good()){
  1600.                                         getline(A_FILE, frameline);
  1601.                                         if(frameline.find("#")!=string::npos)frameline.erase(frameline.find("#"), frameline.length()-frameline.find("#"));
  1602.                                         tempariro2 +=frameline;
  1603.                                     }
  1604.                                 A_FILE.seekp(0, A_FILE.end);A_FILE.close();
  1605.                                 }}}}}}
  1606.                           if (name == "AAAA4321"){
  1607.                             type =1;
  1608.                           }else{
  1609.                             type =0;
  1610.                           }
  1611.                          
  1612.  
  1613.  
  1614.                          
  1615.                           //loadframes:
  1616.                           //A_FILE.seekp(0, A_FILE.beg);
  1617.                           //A_FILE.seekg(0, A_FILE.beg);
  1618.                           //getline(A_FILE, tempariro2);
  1619.                           temp0=tempariro2.find(" ");
  1620.                           while(temp0!=string::npos){tempariro2.erase (temp0, 1); //clear spaces
  1621.                                 temp0=tempariro2.find(" ", temp0);}
  1622.                           temp0=tempariro2.find("\n");
  1623.                           while(temp0!=string::npos){tempariro2.erase (temp0, 1); //clear newline chars
  1624.                                 temp0=tempariro2.find("\n", temp0);}
  1625.                                
  1626.                           tempariro2=tempariro2.substr(tempariro2.find("[f="));
  1627.                           int ideh;
  1628.                           while(tempariro2.find("[f=") != string::npos && tempariro2.find("[/f]")!= string::npos){
  1629.                                                        frame framah;
  1630.                                                        ideh = atoi(tempariro2.substr(3, tempariro2.find("]")-3).c_str());
  1631.                                                        framah.init(tempariro2.substr(tempariro2.find("]")+1,tempariro2.find("[/f]")), atoi(tempariro2.substr(3, tempariro2.find("]")-3).c_str())  );
  1632.                                                        Frames[framah.no]=framah;
  1633.                                                        if (tempariro2.find("[f=", 4) != string::npos){
  1634.                                                        
  1635.                                                        tempariro2=tempariro2.substr(tempariro2.find("[f=", 4));}else{break;
  1636.                                                        }
  1637.                                                        }
  1638.                                                      
  1639.    
  1640.  
  1641.                           accU=0;
  1642.  
  1643.  
  1644.                          
  1645. }
  1646.  
  1647.      
  1648.  
  1649. /*-------------------------------------------------------------------------------------------------------------*/
  1650.  
  1651.  
  1652.  
  1653.  
  1654. class LOAD{
  1655.       const char* LOAD_DIR;
  1656.       const char* LOAD_TOKEN;
  1657.       ifstream LOAD_TXT;
  1658.       string line;
  1659.       public:
  1660.         bool HITSYS=false;
  1661.         int CATCHINGIDS[100][5]; //0:framefront 1:frameback 2:x-pos 3:y-pos 4:z-pos
  1662.         int DELETED_OBJS[1000];
  1663.         int D_O_INDEX=0;
  1664.         int IDS[600];
  1665.             string settings[12]; //0-9 effects 10-gravity 11-friction
  1666.             string BARS[15]={"None", "None", "None", "", "", "", "", "", "", "", "", "", "None", "", ""};
  1667.             std::vector<spritegrid> BARSG;
  1668.              LOAD(string, string);
  1669.              std::vector<objcopy*>  ON_SCREEN_OBJS;
  1670.              std::vector<objcopy>  ON_SCREEN_REAL_OBJS;
  1671.              std::vector<objcopy> OBJS_STRUCTS;
  1672.              std::vector<object>  OBJECTS;
  1673.              int OBJID_INDEX;
  1674.              float FRICTION, GRAVITY;
  1675.              int ON_SCREEN_OBJCOUNT=0;
  1676.              void LoadOBJ(void);};
  1677.  
  1678. void LOAD::LoadOBJ(){
  1679.     BARSG.resize(4);
  1680.     for (int ID=0; ID<100; ID++){
  1681.         for (int data=0; data<5; data++){
  1682.             CATCHINGIDS[ID][data]=4321;
  1683.         }
  1684.     }
  1685.     fstream SYS_FILE("obj\\system.a");
  1686.     string tempasdf;
  1687.     string systemd;
  1688.     int tempadodi;
  1689.     while (SYS_FILE.good()){
  1690.                     getline(SYS_FILE, tempasdf);
  1691.                     systemd += tempasdf;
  1692.                             }
  1693.     if (systemd.find("{main}")!=string::npos){
  1694.     tempasdf=systemd.substr(systemd.find("{main}")+6, systemd.find("{/main}")-6-systemd.find("{main}"));
  1695.     for (int x=0; x<10; x++){
  1696.         if (tempasdf.find("effect["+stringify(x)+"]=")!=string::npos) {
  1697.         settings[x]=tempasdf.substr(tempasdf.find("effect["+stringify(x)+"]=")+10, tempasdf.find(";")-tempasdf.find("effect["+stringify(x)+"]=")-10);
  1698.         object effect;
  1699.         effect.init(1000+x, "None", settings[x]);
  1700.         OBJECTS[effect.id]= effect;
  1701.        
  1702.         objcopy z;
  1703.         z.init(&effect,5, true, GRAVITY, FRICTION, 0, 0);
  1704.         OBJS_STRUCTS[1000+x]=z;
  1705.         }
  1706.         else{settings[x]="None";}
  1707.         }  
  1708.     }
  1709.     if (tempasdf.find("showHitNo_Dir_Interval=")!=string::npos){
  1710.         HITSYS=true;
  1711.         object nums;
  1712.         tempadodi=tempasdf.find("showHitNo_Dir_Interval=");
  1713.         string asdsdf=tempasdf.substr(tempadodi+23, tempasdf.find(";", tempasdf.find("showHitNo_Dir_Interval="))-tempadodi-23);
  1714.         nums.init(1010, "None", tempasdf.substr(tempadodi+23, tempasdf.find(";", tempasdf.find("showHitNo_Dir_Interval="))-tempadodi-23));
  1715.         OBJECTS[nums.id]=nums;
  1716.         objcopy z;
  1717.         z.init(&nums,999, true, GRAVITY, FRICTION, 0, 0);
  1718.         OBJS_STRUCTS[1010]=z;
  1719.     }
  1720.     objcopy z;
  1721.    
  1722.     if (systemd.find("{bar_frame}")){
  1723.         tempasdf=systemd.substr(systemd.find("{bar_frame}")+11, systemd.find("{/bar_frame}")-11-systemd.find("{bar_frame}"));
  1724.         tempadodi=tempasdf.find("img=");
  1725.         BARS[12]=tempasdf.substr(tempadodi+4, tempasdf.find(";", tempasdf.find("img="))-tempadodi-4);
  1726.         tempadodi=tempasdf.find("trans_x=");
  1727.         BARS[13]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_x="))-tempadodi-8);
  1728.         tempadodi=tempasdf.find("trans_y=");
  1729.         BARS[14]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_y="))-tempadodi-8);
  1730.     }
  1731.    
  1732.     if (systemd.find("{hp_bar}")){
  1733.         tempasdf=systemd.substr(systemd.find("{hp_bar}")+8, systemd.find("{/hp_bar}")-8-systemd.find("{hp_bar}"));
  1734.         tempadodi=tempasdf.find("img=");
  1735.         BARS[0]=tempasdf.substr(tempadodi+4, tempasdf.find(";", tempasdf.find("img="))-tempadodi-4);
  1736.         tempadodi=tempasdf.find("deplete_direction=");
  1737.         BARS[3]=tempasdf.substr(tempadodi+18, tempasdf.find(";", tempasdf.find("deplete_direction="))-tempadodi-18);
  1738.         tempadodi=tempasdf.find("trans_x=");
  1739.         BARS[6]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_x="))-tempadodi-8);
  1740.         tempadodi=tempasdf.find("trans_y=");
  1741.         BARS[7]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_y="))-tempadodi-8);
  1742.     }
  1743.     if (systemd.find("{sp_bar}")){
  1744.         tempasdf=systemd.substr(systemd.find("{sp_bar}")+8, systemd.find("{/sp_bar}")-8-systemd.find("{sp_bar}"));
  1745.         tempadodi=tempasdf.find("img=");
  1746.         BARS[1]=tempasdf.substr(tempadodi+4, tempasdf.find(";", tempasdf.find("img="))-tempadodi-4);
  1747.         tempadodi=tempasdf.find("deplete_direction=");
  1748.         BARS[4]=tempasdf.substr(tempadodi+18, tempasdf.find(";", tempasdf.find("deplete_direction="))-tempadodi-18);
  1749.         tempadodi=tempasdf.find("trans_x=");
  1750.         BARS[8]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_x="))-tempadodi-8);
  1751.         tempadodi=tempasdf.find("trans_y=");
  1752.         BARS[9]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_y="))-tempadodi-8);
  1753.     }
  1754.     if (systemd.find("{rp_bar}")){
  1755.         tempasdf=systemd.substr(systemd.find("{rp_bar}")+8, systemd.find("{/rp_bar}")-8-systemd.find("{rp_bar}"));
  1756.         tempadodi=tempasdf.find("img=");
  1757.         BARS[2]=tempasdf.substr(tempadodi+4, tempasdf.find(";", tempasdf.find("img="))-tempadodi-4);
  1758.         tempadodi=tempasdf.find("deplete_direction=");
  1759.         BARS[5]=tempasdf.substr(tempadodi+18, tempasdf.find(";", tempasdf.find("deplete_direction="))-tempadodi-18);
  1760.         tempadodi=tempasdf.find("trans_x=");
  1761.         BARS[10]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_x="))-tempadodi-8);
  1762.         tempadodi=tempasdf.find("trans_y=");
  1763.         BARS[11]=tempasdf.substr(tempadodi+8, tempasdf.find(";", tempasdf.find("trans_y="))-tempadodi-8);
  1764.     }
  1765.    
  1766.     for (int abcd=0; abcd<3; abcd++) {
  1767.         spritegrid a;
  1768.         int watever;
  1769.         a.ini(BARS[abcd], 4321, 4321, 1, 1, ",0xFFFFFF", &watever);
  1770.         BARSG[abcd]=a;
  1771.     }
  1772.     for (int asdfasdfasdf=0;asdfasdfasdf==0;asdfasdfasdf++){
  1773.    
  1774.     int momo;
  1775.     spritegrid a;
  1776.     a.ini(BARS[12], 4321, 4321, 1, 1, ",0xFFFFFF", &momo);
  1777.     BARSG[3]=a;}
  1778.     if (systemd.find("{defaults}")!=string::npos){
  1779.         tempasdf=systemd.substr(systemd.find("{defaults}")+10, systemd.find("{/defaults}")-10-systemd.find("{defaults}"));
  1780.         if (tempasdf.find("gravity=")!=string::npos){
  1781.             settings[10]=tempasdf.substr(tempasdf.find("gravity=")+8, tempasdf.find(";")-tempasdf.find("gravity=")-8);
  1782.         }else{
  1783.             settings[10]="0.7";
  1784.         }
  1785.         if (tempasdf.find("friction=")!=string::npos){
  1786.             settings[11]=tempasdf.substr(tempasdf.find("friction=")+9, tempasdf.find(";")-tempasdf.find("friction=")-9);
  1787.         }else{
  1788.             settings[11]="2";
  1789.         }
  1790.     }
  1791.    
  1792.                           FRICTION= ::atof(settings[11].c_str());
  1793.                           GRAVITY =::atof(settings[10].c_str());
  1794.  
  1795.                              string paraid, paraind, paradir;
  1796.                              size_t L_POS, temp0;
  1797.                              
  1798.                              if (LOAD_TXT.is_open()){
  1799.                                 while (LOAD_TXT.good()){
  1800.                                       getline(LOAD_TXT, line);
  1801.                                       temp0=line.find(" ");
  1802.                                       while(temp0!=string::npos){line.erase (temp0, 1);
  1803.                                       temp0=line.find(" ", temp0);}
  1804.                                       L_POS = line.find(LOAD_TOKEN);
  1805.                                       if (L_POS != string::npos){paraid= line.substr(0, L_POS); //the function
  1806.                                          
  1807.                                       temp0 =L_POS;
  1808.                                       L_POS = line.find(LOAD_TOKEN, L_POS+1, 2);}
  1809.                                       if (L_POS != string::npos){ paraind=line.substr(temp0+2, L_POS-temp0-2); //the function2
  1810.                                          
  1811.                                       temp0 =L_POS;
  1812.                                       L_POS = line.find(LOAD_TOKEN, L_POS+1, 2);}
  1813.                                       if (L_POS != string::npos){ paradir=line.substr(temp0+2, L_POS-temp0-2);
  1814.  
  1815.                                       object Stickman;
  1816.                                       Stickman.init(atoi(paraid.c_str()), paraind, paradir);
  1817.  
  1818.                                        //the function3
  1819.                                       OBJECTS[Stickman.id]= Stickman;IDS[OBJID_INDEX++]=Stickman.id;}
  1820.                                      // OBJECT_IDS_[OBJID_INDEX++]= Stickman;} //the function3
  1821.                                      
  1822.                                      
  1823. }}
  1824.  
  1825. ON_SCREEN_OBJCOUNT=OBJID_INDEX;
  1826. srand (time(NULL));
  1827. for (int x=0; x<OBJID_INDEX; x++){
  1828.     objcopy z;
  1829.     int randxpos=rand() % 800 + 50;
  1830.     int randzpos=rand() % 180 + 570;
  1831.     if (IDS[x]<9){
  1832.    
  1833.         z.init(&OBJECTS[IDS[x]],1, false, GRAVITY, FRICTION, randxpos, randzpos);
  1834.     }else{
  1835.         z.init(&OBJECTS[IDS[x]],2, true, GRAVITY, FRICTION, randxpos, randzpos);
  1836.     }
  1837.     OBJS_STRUCTS[IDS[x]]=z;
  1838.     ON_SCREEN_REAL_OBJS[x]=z;
  1839. }
  1840. for (int aa=0; aa<ON_SCREEN_OBJCOUNT; aa++){
  1841.     ON_SCREEN_OBJS[aa]=&ON_SCREEN_REAL_OBJS[aa];
  1842. }
  1843.  
  1844. }
  1845. LOAD::LOAD (string dir, string TOKEN)
  1846. :OBJECTS(1011)
  1847. {
  1848.     OBJID_INDEX = 0;
  1849.     LOAD_DIR = dir.c_str ();
  1850.     LOAD_TOKEN = TOKEN.c_str ();
  1851.     LOAD_TXT.open (dir.c_str ());
  1852.     ON_SCREEN_OBJS.resize(1011);
  1853.     ON_SCREEN_REAL_OBJS.resize(1011);
  1854.     OBJS_STRUCTS.resize(1011);
  1855. }
  1856.  
  1857.  
  1858.  void object::Update_Frame_If_Time(objcopy * objcop, LOAD * LOADED){
  1859.                
  1860.                      if (objcop->newframe){
  1861.                         for (int z=0; z<20; z++){
  1862.                             objcop->rectdensity[z]=0;
  1863.                         }
  1864.                        
  1865.                         if (objcop->newframe &&Evaluate(Frames[objcop->currframe].addsp)!=4321) objcop->currsp=objcop->currsp+Evaluate(Frames[objcop->currframe].addsp)>=maxsp?maxsp:objcop->currsp+Evaluate(Frames[objcop->currframe].addsp);
  1866.                         objcop->delayU=Evaluate(Frames[objcop->currframe].delay);objcop->newframe=false;
  1867.                         if (Evaluate(Frames[objcop->currframe].loop_goto)!=4321 &&objcop->doloop[1]!=objcop->currframe){
  1868.                             objcop->doloop[0]=0;
  1869.                         }
  1870.                      }  
  1871.                 if ((Frames[objcop->currframe].flags[0]||Frames[objcop->currframe].flags[1]) && objcop->currsp < 0){
  1872.                     objcop->previousframe=objcop->currframe;objcop->currframe=fatigue; objcop->newframe=true; objcop->currsp=0; return;
  1873.                 }
  1874.                 if (objcop->delayU==0){objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].nxt);objcop->newframe=true;
  1875.                 if (objcop->currframe==1000){
  1876.                 objcop->currframe=objcop->previousframe;
  1877.                 objcop->deleteobj=true;}}else{  //update frame and loop on the delay
  1878.                 if (!objcop->caught){
  1879.                 objcop->delayU--;}else{if (objcop->curse_id!=4321){
  1880.                
  1881.                     if (LOADED->CATCHINGIDS[objcop->curse_id][0]!=4321){
  1882.                     objcop->currframe=LOADED->CATCHINGIDS[objcop->curse_id][0];objcop->newframe=true;}
  1883.                     objcop->posx=LOADED->CATCHINGIDS[objcop->curse_id][2]==4321?objcop->posx:LOADED->CATCHINGIDS[objcop->curse_id][2];
  1884.                     objcop->posy=LOADED->CATCHINGIDS[objcop->curse_id][3]==4321?objcop->posy:LOADED->CATCHINGIDS[objcop->curse_id][3];
  1885.                     objcop->posz=LOADED->CATCHINGIDS[objcop->curse_id][4]==4321?objcop->posz:LOADED->CATCHINGIDS[objcop->curse_id][4];
  1886.                 }}}
  1887.                                 if (!Frames[objcop->currframe].exists){
  1888.                     if (objcop->posy>=objcop->GROUNDPOS){
  1889.                         objcop->previousframe=objcop->currframe;objcop->currframe=hitground; objcop->newframe=true; return;
  1890.                     }
  1891.                     else{
  1892.                         objcop->previousframe=objcop->currframe;objcop->currframe=inair; objcop->newframe=true; return;
  1893.                     }
  1894.                 }
  1895.              }
  1896.  
  1897.  
  1898.  void object::Blit   (background BG, objcopy * objcop, LOAD * LOADED){              
  1899.     ///SDL_Rect tempah={posx-BG.shadowpos.x, posz-BG.shadowpos.y, BG.shadowpos.w, BG.shadowpos.h};
  1900.     //SDL_BlitSurface (BG.shadow, NULL, d, &tempah); //SDL 1.2
  1901.     ///SDL_RenderCopy(MainRend, BG.shadow, NULL, &tempah);
  1902.  
  1903.       if (objcop->facing==0 && objcop->picn!=999){float pos[] = {objcop->posx-Evaluate(Frames[objcop->currframe].center_X)  , (objcop->posz)-Evaluate(Frames[objcop->currframe].center_Y)+(objcop->posy), IMGS[objcop->gridn].clip[objcop->picn].w, IMGS[objcop->gridn].clip[objcop->picn].h};
  1904.    
  1905.                    float cx=float(IMGS[objcop->gridn].clip[objcop->picn].x);
  1906.                    float cy=float(IMGS[objcop->gridn].clip[objcop->picn].y);
  1907.                    float cw=float(IMGS[objcop->gridn].clip[objcop->picn].w);
  1908.                    float ch=float(IMGS[objcop->gridn].clip[objcop->picn].h);
  1909.                  glBindTexture( GL_TEXTURE_2D, IMGS[objcop->gridn].grid );
  1910.  
  1911.                  glBegin(GL_QUADS);
  1912.                  
  1913.                  glTexCoord2f(cx/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1914.                  glVertex2f(pos[0], pos[1]);
  1915.                  glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1916.                  glVertex2f(pos[0]+pos[2], pos[1]);
  1917.                  glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1918.                  glVertex2f(pos[0]+pos[2], pos[1]+pos[3]);
  1919.                  glTexCoord2f(cx/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1920.                  glVertex2f(pos[0], pos[1]+pos[3]);
  1921.                  glEnd();  
  1922.                  
  1923.                  
  1924.                    
  1925.       //SDL_RenderCopy(MainRend, IMGS[0].grid,  &IMGS[0].clip[Evaluate(Frames[currframe].img)], &pos);
  1926.       //SDL_BlitSurface (IMGS[0].grid, &IMGS[0].clip[Evaluate(Frames[currframe].img)], d, &pos); SDL 1.2
  1927.       }
  1928.         if (objcop->facing==1 && objcop->picn!=999){int tempaval=(objcop->posx+Evaluate(Frames[objcop->currframe].center_X)+objcop->posx);
  1929.         float pos[] = {objcop->posx-((IMGS[objcop->gridn].clip_[objcop->picn].w)-Evaluate(Frames[objcop->currframe].center_X)) , objcop->posz-Evaluate(Frames[objcop->currframe].center_Y)+objcop->posy, IMGS[objcop->gridn].clip[objcop->picn].w, IMGS[objcop->gridn].clip[objcop->picn].h};
  1930.    
  1931.                    float cx=float(IMGS[objcop->gridn].clip[objcop->picn].x);
  1932.                    float cy=float(IMGS[objcop->gridn].clip[objcop->picn].y);
  1933.                    float cw=float(IMGS[objcop->gridn].clip[objcop->picn].w);
  1934.                    float ch=float(IMGS[objcop->gridn].clip[objcop->picn].h);
  1935.                  glBindTexture( GL_TEXTURE_2D, IMGS[objcop->gridn].grid );
  1936.  
  1937.                  glBegin(GL_QUADS);
  1938.                  
  1939.                  glTexCoord2f(cx/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1940.                  glVertex2f(pos[0]+pos[2], pos[1]);
  1941.                  //glColor3f(0.0f, 0.0/f, 0.2f);
  1942.                  glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, cy/IMGS[objcop->gridn].gh);
  1943.                  glVertex2f(pos[0], pos[1]);
  1944.                  glTexCoord2f((cx+cw)/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1945.                  glVertex2f(pos[0], pos[1]+pos[3]);
  1946.                  glTexCoord2f(cx/IMGS[objcop->gridn].gw, (cy+ch)/IMGS[objcop->gridn].gh);
  1947.                  glVertex2f(pos[0]+pos[2], pos[1]+pos[3]);
  1948.                  glEnd();   }
  1949.             //glClear( GL_COLOR_BUFFER_BIT );
  1950.         if (type!=1){
  1951.         if (LOADED->BARS[12]!="None"){
  1952.             glBindTexture( GL_TEXTURE_2D, LOADED->BARSG[3].grid );
  1953.             glBegin(GL_QUADS);
  1954.                      glTexCoord2f(0 , 0);
  1955.                      glVertex2f(Evaluate(LOADED->BARS[13])+objcop->posx-(LOADED->BARSG[3].gw/2.0), Evaluate(LOADED->BARS[14])+objcop->posz+10);
  1956.                      glTexCoord2f(1 , 0);
  1957.                      glVertex2f(Evaluate(LOADED->BARS[13])+objcop->posx-(LOADED->BARSG[3].gw/2.0)+LOADED->BARSG[3].gw, Evaluate(LOADED->BARS[14])+objcop->posz+10);
  1958.                      glTexCoord2f(1 , 1);
  1959.                      glVertex2f(Evaluate(LOADED->BARS[13])+objcop->posx-(LOADED->BARSG[3].gw/2.0)+LOADED->BARSG[3].gw, Evaluate(LOADED->BARS[14])+objcop->posz+10+LOADED->BARSG[3].gh);
  1960.                      glTexCoord2f(0 , 1);
  1961.                      glVertex2f(Evaluate(LOADED->BARS[13])+objcop->posx-(LOADED->BARSG[3].gw/2.0), Evaluate(LOADED->BARS[14])+objcop->posz+10+LOADED->BARSG[3].gh);
  1962.                      glEnd();
  1963.         }
  1964.         if (LOADED->BARS[0]=="None"){
  1965.             glBindTexture( GL_TEXTURE_2D, NULL );
  1966.             switch (objcop->team){
  1967.                 case 0: glColor4f(1.0f, 0.f, 0.f, 0.5f);break;
  1968.                 case 1: glColor4f(0.0f, 0.f, 1.f, 0.5f);break;
  1969.                 case 2: glColor4f(0.0f, 1.f, 0.f, 0.5f);break;
  1970.                 case 3: glColor4f(1.0f, 1.f, 0.f, 0.5f);break;
  1971.                 default:;
  1972.             }
  1973.         }else{
  1974.             glBindTexture( GL_TEXTURE_2D, LOADED->BARSG[0].grid );
  1975.         }
  1976.         if (objcop->currhp >= 0){
  1977.         glBegin(GL_QUADS);
  1978.                    
  1979.                  if (LOADED->BARS[0]=="None") {
  1980.                      glVertex2f(objcop->posx-20, objcop->posz+10);
  1981.                      glVertex2f(objcop->posx-20+(40*float(float(objcop->currhp)/float(maxhp))), objcop->posz+10);
  1982.                      glVertex2f(objcop->posx-20+(40*float(float(objcop->currhp)/float(maxhp))), objcop->posz+10+5);
  1983.                      glVertex2f(objcop->posx-20, objcop->posz+10+5);
  1984.                 }else{
  1985.                     switch(Evaluate(LOADED->BARS[3])){
  1986.                      case 1:
  1987.                      glTexCoord2f(1-float(float(objcop->currhp)/float(maxhp)) , 0);
  1988.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx+(LOADED->BARSG[0].gw/2.0)-((LOADED->BARSG[0].gw)*float(float(objcop->currhp)/float(maxhp))), Evaluate(LOADED->BARS[7])+objcop->posz+10);
  1989.                      glTexCoord2f(1 , 0);
  1990.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0)+LOADED->BARSG[0].gw, Evaluate(LOADED->BARS[7])+objcop->posz+10);
  1991.                      glTexCoord2f(1 , 1);
  1992.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0)+LOADED->BARSG[0].gw, Evaluate(LOADED->BARS[7])+objcop->posz+10+LOADED->BARSG[0].gh);
  1993.                      glTexCoord2f(1-float(float(objcop->currhp)/float(maxhp)) , 1);
  1994.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx+(LOADED->BARSG[0].gw/2.0)-((LOADED->BARSG[0].gw)*float(float(objcop->currhp)/float(maxhp))), Evaluate(LOADED->BARS[7])+objcop->posz+10+LOADED->BARSG[0].gh);break;
  1995.                      
  1996.                      case 2:
  1997.                      glTexCoord2f(0 , 0);
  1998.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10);
  1999.                      glTexCoord2f(1 , 0);
  2000.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx+(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10);
  2001.                      glTexCoord2f(1 , float(float(objcop->currhp)/float(maxhp)));
  2002.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx+(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10+(LOADED->BARSG[0].gh*float(float(objcop->currhp)/float(maxhp))));
  2003.                      glTexCoord2f(0 , float(float(objcop->currhp)/float(maxhp)));
  2004.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10+(LOADED->BARSG[0].gh*float(float(objcop->currhp)/float(maxhp))));break;
  2005.                        
  2006.                      case 3:
  2007.                      glTexCoord2f(0 , 1-float(float(objcop->currhp)/float(maxhp)));
  2008.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10+(1-LOADED->BARSG[0].gh*float(float(objcop->currhp)/float(maxhp))));
  2009.                      glTexCoord2f(1 , 1-float(float(objcop->currhp)/float(maxhp)));
  2010.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx+(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10+(1-LOADED->BARSG[0].gh*float(float(objcop->currhp)/float(maxhp))));
  2011.                      glTexCoord2f(1 , 1);
  2012.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx+(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10);
  2013.                      glTexCoord2f(0 , 1);
  2014.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10);break;
  2015.                    
  2016.                      default:
  2017.                      glTexCoord2f(0 , 0);
  2018.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10);
  2019.                      glTexCoord2f(1*float(float(objcop->currhp)/float(maxhp)) , 0);
  2020.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0)+LOADED->BARSG[0].gw*float(float(objcop->currhp)/float(maxhp)), Evaluate(LOADED->BARS[7])+objcop->posz+10);
  2021.                      glTexCoord2f(1*float(float(objcop->currhp)/float(maxhp)) , 1);
  2022.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0)+LOADED->BARSG[0].gw*float(float(objcop->currhp)/float(maxhp)), Evaluate(LOADED->BARS[7])+objcop->posz+10+LOADED->BARSG[0].gh);
  2023.                      glTexCoord2f(0 , 1);
  2024.                      glVertex2f(Evaluate(LOADED->BARS[6])+objcop->posx-(LOADED->BARSG[0].gw/2.0), Evaluate(LOADED->BARS[7])+objcop->posz+10+LOADED->BARSG[0].gh);
  2025.                     }
  2026.                 }
  2027.         glEnd();
  2028.  
  2029.         }
  2030.         if (LOADED->BARS[1]=="None") { glBindTexture( GL_TEXTURE_2D, NULL);
  2031.         glColor4f(1.0f, 1.f, 1.f, 0.5f);}else{
  2032.             glBindTexture( GL_TEXTURE_2D, LOADED->BARSG[1].grid);
  2033.         }
  2034.         if (objcop->currsp >= 0){
  2035.             glBegin(GL_QUADS);
  2036.             if (LOADED->BARS[1]=="None"){
  2037.                  glVertex2f(objcop->posx-20, objcop->posz+17);
  2038.                  glVertex2f(objcop->posx-20+(40*float(float(objcop->currsp)/float(maxsp))), objcop->posz+17);
  2039.                  glVertex2f(objcop->posx-20+(40*float(float(objcop->currsp)/float(maxsp))), objcop->posz+20);
  2040.                  glVertex2f(objcop->posx-20, objcop->posz+20);
  2041.             }else{
  2042.                     switch(Evaluate(LOADED->BARS[4])){
  2043.                      case 1:
  2044.                      glTexCoord2f(1-float(float(objcop->currsp)/float(maxsp)) , 0);
  2045.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx+(LOADED->BARSG[1].gw/2.0)-((LOADED->BARSG[1].gw)*float(float(objcop->currsp)/float(maxsp))), Evaluate(LOADED->BARS[9])+objcop->posz+10);
  2046.                      glTexCoord2f(1 , 0);
  2047.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0)+LOADED->BARSG[1].gw, Evaluate(LOADED->BARS[9])+objcop->posz+10);
  2048.                      glTexCoord2f(1 , 1);
  2049.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0)+LOADED->BARSG[1].gw, Evaluate(LOADED->BARS[9])+objcop->posz+10+LOADED->BARSG[1].gh);
  2050.                      glTexCoord2f(1-float(float(objcop->currsp)/float(maxsp)) , 1);
  2051.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx+(LOADED->BARSG[1].gw/2.0)-((LOADED->BARSG[1].gw)*float(float(objcop->currsp)/float(maxsp))), Evaluate(LOADED->BARS[9])+objcop->posz+10+LOADED->BARSG[1].gh);break;
  2052.                      
  2053.                      case 2:
  2054.                      glTexCoord2f(0 , 0);
  2055.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10);
  2056.                      glTexCoord2f(1 , 0);
  2057.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx+(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10);
  2058.                      glTexCoord2f(1 , float(float(objcop->currsp)/float(maxsp)));
  2059.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx+(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10+(LOADED->BARSG[1].gh*float(float(objcop->currsp)/float(maxsp))));
  2060.                      glTexCoord2f(0 , float(float(objcop->currsp)/float(maxsp)));
  2061.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10+(LOADED->BARSG[1].gh*float(float(objcop->currsp)/float(maxsp))));break;
  2062.                        
  2063.                      case 3:
  2064.                      glTexCoord2f(0 , 1-float(float(objcop->currsp)/float(maxsp)));
  2065.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10+(1-LOADED->BARSG[1].gh*float(float(objcop->currsp)/float(maxsp))));
  2066.                      glTexCoord2f(1 , 1-float(float(objcop->currsp)/float(maxsp)));
  2067.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx+(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10+(1-LOADED->BARSG[1].gh*float(float(objcop->currsp)/float(maxsp))));
  2068.                      glTexCoord2f(1 , 1);
  2069.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx+(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10);
  2070.                      glTexCoord2f(0 , 1);
  2071.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10);break;
  2072.                    
  2073.                      default:
  2074.                      glTexCoord2f(0 , 0);
  2075.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10);
  2076.                      glTexCoord2f(1*float(float(objcop->currsp)/float(maxsp)) , 0);
  2077.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0)+LOADED->BARSG[1].gw*float(float(objcop->currsp)/float(maxsp)), Evaluate(LOADED->BARS[9])+objcop->posz+10);
  2078.                      glTexCoord2f(1*float(float(objcop->currsp)/float(maxsp)) , 1);
  2079.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0)+LOADED->BARSG[1].gw*float(float(objcop->currsp)/float(maxsp)), Evaluate(LOADED->BARS[9])+objcop->posz+10+LOADED->BARSG[1].gh);
  2080.                      glTexCoord2f(0 , 1);
  2081.                      glVertex2f(Evaluate(LOADED->BARS[8])+objcop->posx-(LOADED->BARSG[1].gw/2.0), Evaluate(LOADED->BARS[9])+objcop->posz+10+LOADED->BARSG[1].gh);
  2082.                     }
  2083.                 }
  2084.             glEnd();
  2085.                  
  2086.         }
  2087.         if (LOADED->BARS[2]=="None") { glBindTexture( GL_TEXTURE_2D, NULL);
  2088.         glColor4f(0.6f, 0.1f,0.1f, 0.5f);}else{
  2089.             glBindTexture( GL_TEXTURE_2D, LOADED->BARSG[2].grid);
  2090.         }
  2091.        
  2092.         if (objcop->currrp >= 0){
  2093.             glBegin(GL_QUADS);
  2094.             if (LOADED->BARS[1]=="None"){
  2095.                  glVertex2f(objcop->posx-20, objcop->posz+17);
  2096.                  glVertex2f(objcop->posx-20+(40*float(float(objcop->currrp)/float(maxrp))), objcop->posz+17);
  2097.                  glVertex2f(objcop->posx-20+(40*float(float(objcop->currrp)/float(maxrp))), objcop->posz+20);
  2098.                  glVertex2f(objcop->posx-20, objcop->posz+20);
  2099.             }else{
  2100.                     switch(Evaluate(LOADED->BARS[5])){
  2101.                      case 1:
  2102.                      glTexCoord2f(1-float(float(objcop->currrp)/float(maxrp)) , 0);
  2103.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx+(LOADED->BARSG[2].gw/2.0)-((LOADED->BARSG[2].gw)*float(float(objcop->currrp)/float(maxrp))), Evaluate(LOADED->BARS[11])+objcop->posz+10);
  2104.                      glTexCoord2f(1 , 0);
  2105.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0)+LOADED->BARSG[2].gw, Evaluate(LOADED->BARS[11])+objcop->posz+10);
  2106.                      glTexCoord2f(1 , 1);
  2107.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0)+LOADED->BARSG[2].gw, Evaluate(LOADED->BARS[11])+objcop->posz+10+LOADED->BARSG[2].gh);
  2108.                      glTexCoord2f(1-float(float(objcop->currrp)/float(maxrp)) , 1);
  2109.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx+(LOADED->BARSG[2].gw/2.0)-((LOADED->BARSG[2].gw)*float(float(objcop->currrp)/float(maxrp))), Evaluate(LOADED->BARS[11])+objcop->posz+10+LOADED->BARSG[2].gh);break;
  2110.                      
  2111.                      case 2:
  2112.                      glTexCoord2f(0 , 0);
  2113.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10);
  2114.                      glTexCoord2f(1 , 0);
  2115.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx+(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10);
  2116.                      glTexCoord2f(1 , float(float(objcop->currrp)/float(maxrp)));
  2117.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx+(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10+(LOADED->BARSG[2].gh*float(float(objcop->currrp)/float(maxrp))));
  2118.                      glTexCoord2f(0 , float(float(objcop->currrp)/float(maxrp)));
  2119.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10+(LOADED->BARSG[2].gh*float(float(objcop->currrp)/float(maxrp))));break;
  2120.                        
  2121.                      case 3:
  2122.                      glTexCoord2f(0 , 1-float(float(objcop->currrp)/float(maxrp)));
  2123.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10+(1-LOADED->BARSG[2].gh*float(float(objcop->currrp)/float(maxrp))));
  2124.                      glTexCoord2f(1 , 1-float(float(objcop->currrp)/float(maxrp)));
  2125.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx+(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10+(1-LOADED->BARSG[2].gh*float(float(objcop->currrp)/float(maxrp))));
  2126.                      glTexCoord2f(1 , 1);
  2127.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx+(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10);
  2128.                      glTexCoord2f(0 , 1);
  2129.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10);break;
  2130.                    
  2131.                      default:
  2132.                      glTexCoord2f(0 , 0);
  2133.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10);
  2134.                      glTexCoord2f(1*float(float(objcop->currrp)/float(maxrp)) , 0);
  2135.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0)+LOADED->BARSG[2].gw*float(float(objcop->currrp)/float(maxrp)), Evaluate(LOADED->BARS[11])+objcop->posz+10);
  2136.                      glTexCoord2f(1*float(float(objcop->currrp)/float(maxrp)) , 1);
  2137.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0)+LOADED->BARSG[2].gw*float(float(objcop->currrp)/float(maxrp)), Evaluate(LOADED->BARS[11])+objcop->posz+10+LOADED->BARSG[2].gh);
  2138.                      glTexCoord2f(0 , 1);
  2139.                      glVertex2f(Evaluate(LOADED->BARS[10])+objcop->posx-(LOADED->BARSG[2].gw/2.0), Evaluate(LOADED->BARS[11])+objcop->posz+10+LOADED->BARSG[2].gh);
  2140.                     }
  2141.                 }
  2142.             glEnd();
  2143.         }
  2144.       glColor4f(1.0f, 1.f, 1.f, 1.0f);
  2145.      
  2146.       ///if (facing==1){SDL_Rect pos = {posx-((IMGS[objcop->gridn].clip_[Evaluate(Frames[currframe].img)].w)-Evaluate(Frames[currframe].center_X)), posz-Evaluate(Frames[currframe].center_Y)+posy,  IMGS[objcop->gridn].clip_[Evaluate(Frames[currframe].img)].w, IMGS[objcop->gridn].clip_[Evaluate(Frames[currframe].img)].h};
  2147.       //SDL_BlitSurface (IMGS[objcop->gridn].grid_, &IMGS[objcop->gridn].clip_[Evaluate(Frames[currframe].img)], d, &pos); //SDL 1.2
  2148.       ///SDL_RenderCopy(MainRend, IMGS[objcop->gridn].grid_,  &IMGS[0].clip_[Evaluate(Frames[currframe].img)], &pos);
  2149.       ///}
  2150.  }}
  2151.  
  2152. /*-------------------------------------------------------------------------------------------------------------*/
  2153.  
  2154. void object::CallObj(int ID, int currframe, int posx, int posy, int posz, int facing, LOAD* LOADED){
  2155.                         objcopy hiteff;
  2156.                         hiteff=copy_object(LOADED->OBJS_STRUCTS[ID]);
  2157.                         hiteff.posx=posx;
  2158.                         hiteff.posy=posy;
  2159.                         hiteff.posz=posz;
  2160.                         hiteff.facing=facing;
  2161.                         hiteff.currframe=currframe;
  2162.                         hiteff.showshadow=false;
  2163.                         hiteff.FRICTION= LOADED->FRICTION;
  2164.                         hiteff.GRAVITY = LOADED->GRAVITY;
  2165.                         if (LOADED->D_O_INDEX==0){
  2166.                                 LOADED->ON_SCREEN_REAL_OBJS[LOADED->ON_SCREEN_OBJCOUNT]=hiteff;
  2167.                                 LOADED->ON_SCREEN_OBJS[LOADED->ON_SCREEN_OBJCOUNT]=&LOADED->ON_SCREEN_REAL_OBJS[LOADED->ON_SCREEN_OBJCOUNT++];
  2168.                                 return;
  2169.                         }
  2170.                         for (int a=LOADED->D_O_INDEX-1; a >= 0; a--){
  2171.                             if (LOADED->DELETED_OBJS[a] >= LOADED->ON_SCREEN_OBJCOUNT ){
  2172.                                 LOADED->ON_SCREEN_REAL_OBJS[LOADED->ON_SCREEN_OBJCOUNT]=hiteff;
  2173.                                 LOADED->ON_SCREEN_OBJS[LOADED->ON_SCREEN_OBJCOUNT]=&LOADED->ON_SCREEN_REAL_OBJS[LOADED->ON_SCREEN_OBJCOUNT++];
  2174.                            
  2175.                                 return;
  2176.                             }
  2177.                             else{
  2178.                                 LOADED->ON_SCREEN_REAL_OBJS[LOADED->DELETED_OBJS[a]]=hiteff;
  2179.                                 LOADED->ON_SCREEN_OBJS[LOADED->DELETED_OBJS[a]]=&LOADED->ON_SCREEN_REAL_OBJS[LOADED->DELETED_OBJS[a]];
  2180.                                 LOADED->D_O_INDEX--;
  2181.                                 return;
  2182.                             }
  2183.                         }
  2184.  
  2185.              }
  2186. void object::Update(background A_Field, LOAD * LOADED, objcopy *objcop){
  2187.    
  2188.      Update_Frame_If_Time(objcop, LOADED);
  2189.      Regenerate_Deplete_Stuff(objcop);
  2190.      Set_IMG_No_On_Current_Grid(objcop);
  2191.      //When_Player_Is_Hit(objcop, LOADED);
  2192.      for (int x=0;x < LOADED->ON_SCREEN_OBJCOUNT;x++){
  2193.                     if (LOADED->ON_SCREEN_OBJS[x]->currframe!=4321){
  2194.                    
  2195.                      if(LOADED->ON_SCREEN_OBJS[x]->team!=objcop->team){
  2196.                         for (int y=0; y < Frames[objcop->currframe].bdyindx; y++){
  2197.                             int effx, effy;
  2198.                             for (int z=0; z < LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].rectindx; z++){
  2199.                                 if ((Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].rctdnsty)==4321 || LOADED->ON_SCREEN_OBJS[x]->rectdensity[z] < Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].rctdnsty)) &&
  2200.                                  collide(Frames[objcop->currframe].BDYS[y], LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z],
  2201.                                          objcop->posx, Frames[objcop->currframe].center_X, objcop->posy, Frames[objcop->currframe].center_Y, objcop->posz,
  2202.                                          LOADED->ON_SCREEN_OBJS[x]->posx, LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_X,
  2203.                                          LOADED->ON_SCREEN_OBJS[x]->posy, LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_Y,
  2204.                                          LOADED->ON_SCREEN_OBJS[x]->posz, objcop->facing, LOADED->ON_SCREEN_OBJS[x]->facing, &effx, &effy,
  2205.                                          &IMGS[objcop->gridn].clip[0], &LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].IMGS[LOADED->ON_SCREEN_OBJS[x]->gridn].clip[0])){
  2206.                                            
  2207.                                             objcop->caught=LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].flags[2];
  2208.                                            
  2209.                                             LOADED->ON_SCREEN_OBJS[x]->rectdensity[z]=LOADED->ON_SCREEN_OBJS[x]->rectdensity[z]==4321?4321:LOADED->ON_SCREEN_OBJS[x]->rectdensity[z]+1;
  2210.                                            
  2211.                                     if (!(objcop->lasthitby==x && objcop->hitcounter!=0)){
  2212.                                         objcop->currdp= objcop->currdp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].strength)>=0?objcop->currdp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].strength):0;
  2213.                                         objcop->currkp= objcop->currkp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].knock   )>=0?objcop->currkp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].knock   ):0;
  2214.                                         objcop->currhp= objcop->currhp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].damage  )>=0?objcop->currhp-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].damage  ):0;
  2215.                                         objcop->lasthitby=x;
  2216.                                         objcop->hitcounter=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].hitfreq);
  2217.                                         if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].x_impct)!=0){  //X IMPACT
  2218.                                             if (LOADED->ON_SCREEN_OBJS[x]->facing ==0){objcop->total_fx=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].x_impct);}
  2219.                                             else{objcop->total_fx=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].x_impct)*-1;}
  2220.                                         }
  2221.                                         if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].y_impct)!=0){  //Y IMPACT
  2222.                                             objcop->total_fy=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].y_impct);
  2223.                                         }
  2224.                                                                    
  2225.  
  2226.                                         if (Evaluate(Frames[objcop->currframe].BDYS[y].respond)!=4321){  //BODY HOLDER SHOUDL GO TO IF RESPOND IS THERE:
  2227.                                             objcop->previousframe=objcop->currframe;objcop->currframe=Evaluate(Frames[objcop->currframe].BDYS[y].respond);objcop->newframe=true;
  2228.                                         }else if(objcop->currkp<=0){
  2229.                                             objcop->previousframe=objcop->currframe;objcop->currframe=knocked; objcop->currkp=maxkp; objcop->newframe=true;
  2230.                                             objcop->total_fx= objcop->total_fy==0 && objcop->total_fx==0?15:objcop->total_fx; objcop->total_fy=objcop->total_fy>=0?-7:objcop->total_fy;
  2231.                                         }else if((maxkp-objcop->currkp)>70){
  2232.                                             objcop->previousframe=objcop->currframe;objcop->currframe=falling; objcop->newframe=true;
  2233.                                             objcop->total_fx= objcop->total_fy==0 && objcop->total_fx==0?15:objcop->total_fx; objcop->total_fy=objcop->total_fy>=0?-7:objcop->total_fy;
  2234.                                         }else{
  2235.                                             objcop->previousframe=objcop->currframe;objcop->currframe= objcop->facing+LOADED->ON_SCREEN_OBJS[x]->facing%2==1?whenhit:whenhitb;objcop->newframe=true;
  2236.                                            
  2237.                                         }
  2238.                                        
  2239.                                         if (objcop->facing == LOADED->ON_SCREEN_OBJS[x]->facing){ //if there  is target back goto
  2240.                                             if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].tbgoto)!=4321){
  2241.                                                 objcop->previousframe=objcop->currframe;
  2242.                                                 objcop->currframe=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].tbgoto);
  2243.                                                 objcop->newframe=true;
  2244.                                                 LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][1]=
  2245.                                                 objcop->currframe;
  2246.                                             }
  2247.                                         }else{                                                    //if there  is target front goto
  2248.                                             if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].tfgoto)!=4321){
  2249.                                                 objcop->previousframe=objcop->currframe;
  2250.                                                 objcop->currframe=Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].tfgoto);
  2251.                                                 objcop->newframe=true;
  2252.                                                 LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][0]=
  2253.                                                 objcop->currframe;
  2254.                                             }
  2255.                                         }
  2256.                                        
  2257.                                         if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_x)!=4321){
  2258.                                             if (LOADED->ON_SCREEN_OBJS[x]->facing==0){
  2259.                                                 if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)!=4321){
  2260.                                                     LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][2]=
  2261.                                                     LOADED->ON_SCREEN_OBJS[x]->posx+Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_x)-
  2262.                                                     Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_X);
  2263.                                                 }
  2264.                                                 objcop->posx=LOADED->ON_SCREEN_OBJS[x]->posx+Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_x)-
  2265.                                                 Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_X);
  2266.                                             }else{
  2267.                                                 if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)!=4321){
  2268.                                                     LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][2]=
  2269.                                                     LOADED->ON_SCREEN_OBJS[x]->posx-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_x)+
  2270.                                                     Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_X);
  2271.                                                 }
  2272.                                                 objcop->posx=LOADED->ON_SCREEN_OBJS[x]->posx-Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_x)+
  2273.                                                 Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_X);
  2274.                                             }
  2275.                                             LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][2]=objcop->posx;
  2276.                                         }
  2277.                                         if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_y)!=4321){
  2278.                                             if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)!=4321){
  2279.                                                     LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][3]=
  2280.                                                     LOADED->ON_SCREEN_OBJS[x]->posy+Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_y)-
  2281.                                                     Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_Y);
  2282.                                             }
  2283.                                             objcop->posy=LOADED->ON_SCREEN_OBJS[x]->posy+Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_y)-
  2284.                                             Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].center_Y);
  2285.                                             LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][3]=objcop->posy;
  2286.                                         }
  2287.                                         if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_z)!=4321){
  2288.                                             if (Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)!=4321){
  2289.                                                     LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][4]=
  2290.                                                     LOADED->ON_SCREEN_OBJS[x]->posz+Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_z);
  2291.                                             }
  2292.                                             objcop->posz=LOADED->ON_SCREEN_OBJS[x]->posz+Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].t_z);
  2293.                                             LOADED->CATCHINGIDS[Evaluate(LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].crsid)][4]=objcop->posz;
  2294.                                         }
  2295.                                         bool asfasdfasd=LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].flags[3];
  2296.                                         if (!LOADED->OBJECTS[LOADED->ON_SCREEN_OBJS[x]->id].Frames[LOADED->ON_SCREEN_OBJS[x]->currframe].RECTS[z].flags[3]){ // if flag NOEFFECT is off:
  2297.                                        
  2298.                                         LOADED->ON_SCREEN_OBJS[x]->hit_xNO= stringify(Evaluate(LOADED->ON_SCREEN_OBJS[x]->hit_xNO)+1);
  2299.                                        
  2300.                                         if(LOADED->HITSYS){
  2301.                                             CallObj(1010, 10, effx-(LOADED->OBJECTS[1010].hittxtwidth), effy-50, objcop->posz, 0, LOADED);//"HITX text
  2302.                                             for (int digit=0; digit<LOADED->ON_SCREEN_OBJS[x]->hit_xNO.length(); digit++){
  2303.                                                 CallObj(1010, Evaluate(LOADED->ON_SCREEN_OBJS[x]->hit_xNO.substr(digit, 1)), effx+(LOADED->OBJECTS[1010].hitnowidth*digit), effy-50, objcop->posz, 0, LOADED);
  2304.                                             }
  2305.                                            
  2306.                                             /*if (hit_xNO>999) {CallObj(1010, (hit_xNO-hit_xNO%1000)/1000, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO-=hit_xNO-hit_xNO%1000;}
  2307.                                             if (hit_xNO>99) {CallObj(1010, (hit_xNO-hit_xNO%100)/100, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO-=hit_xNO-hit_xNO%100;}
  2308.                                             if (hit_xNO>9) {CallObj(1010, (hit_xNO-hit_xNO%10)/10, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO-=hit_xNO-hit_xNO%10;}
  2309.                                             if (hit_xNO>=0) {CallObj(1010, hit_xNO, 10+effx+(15*xposition++), effy-50, objcop->posz, 0, LOADED);hit_xNO=0;}*/
  2310.                                         }
  2311.                                         CallObj(1000, 0, effx, effy, objcop->posz, objcop->facing, LOADED);
  2312.                                     }}
  2313.                                 }
  2314.                             }
  2315.                         }
  2316.                      }
  2317.                  }  }
  2318.      Apply_loop(objcop);
  2319.      Apply_max_limit_vx(objcop);
  2320.      Apply_max_limit_vy(objcop);
  2321.      Apply_f_x(A_Field, objcop);
  2322.      Apply_f_y(A_Field, objcop);
  2323.      Apply_x_z_hold_distance(A_Field, objcop);
  2324.      Apply_acc(objcop);
  2325.      Basic_Stand_Walk_Dash(A_Field, objcop);
  2326.      Basic_Jump(objcop);
  2327.      Apply_max_limit_vx(objcop);
  2328.      Move(objcop->total_fx, 'x',A_Field, objcop);
  2329.      Move(objcop->total_fy, 'y',A_Field, objcop);
  2330.      Apply_FRICTION(objcop);
  2331.      Apply_GRAVITY(objcop);
  2332.      Respond_ToInput(objcop);
  2333.  
  2334.  
  2335.      }
  2336. /*-------------------------------------------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement