1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
| void C_Case::SetData(string buf, int pos_x, int pos_y)
{
int vram=1;
string resultat;
string Nom_trouve;
string buf_data;
string chemin;
int nombre, pos, longueur, largeur, x, y;
pos = buf.find(",");
resultat = buf.substr(0, 2);
istringstream nbr_x(resultat);
nbr_x >> x;//CHARGEMENT DU NR X DE LA CASE
resultat = buf.substr(pos+1,2);
istringstream nbr_y(resultat);
nbr_y >> y;//CHARGEMENT DU NR Y DE LA CASE
pos = buf.find(":");
resultat = buf.substr(pos+1, 2);
istringstream nbr_texture_sol(resultat);
nbr_texture_sol >> texture_sol;//CHARGEMENT DE LA TEXTURE SOL DE LA CASE
pointeur_texture_sol =
//////////////////////////////////////////////
pos = buf.find("(");//LA LIGNE QUI PLAAAAAAAAAAAAAANTE
///////////////////////////////////////////////
resultat = buf.substr(pos+1, 1);
istringstream nr_texture_sol(resultat);
nr_texture_sol >> Nr_texture;//CHARGEMENT DU NR TEXTURE
pos = buf.find(",", pos+1);
resultat = buf.substr(pos+1, 2);
istringstream nbr_texture_bord(resultat);
nbr_texture_bord >> texture_bord;//CHARGEMENT DU NR TEXTURE BORD DE LA CASE
pos = buf.find(",", pos+1);
//CHARGEMENT DU DECORS
resultat = buf.substr(pos+1, 1);
if (resultat == "*")//SI LA CASE NE CONTIENT PAS DE DECORS
{
pointeur_decors = NULL;
decors = -1;
Decors_x = -1;
Decors_y = -1;
}
else//SI LA CASE CONTIENT UN DECORS
{
resultat = buf.substr(pos+1, 2);
istringstream nbr_decors(resultat);
nbr_decors >> decors;//CHARGEMENT DU NR DECORS DE LA CASE
for (int pos_x = x; pos_x <= x+pointeur_decors->Taille_x && pos_x < longueur; pos_x++)
{
for (int pos_y = y; pos_y <= y+pointeur_decors->Taille_y && pos_y < largeur; pos_y++)
{
Decors_x = x;
Decors_y = y;
}
}
pointeur_decors = &decor[decors];
}
pos = buf.find(",", pos+1);
resultat = buf.substr(pos+1, 1);
istringstream nr_elevation(resultat);
nr_elevation >> elevation;//CHARGEMENT DE L'ELEVATION DE LA CASE
affich_x = (largeur+(x-y-1))*20+Pos_x;
affich_y = (y+x)*12+Pos_y-(7*elevation);
pos = buf.find(",", pos+1);
resultat = buf.substr(pos+1, 1);
if (resultat == "*")//SI LA CASE NE CONTIENT PAS DE COFFRE
{
Coffre = -1;
}
else//SI LA CASE CONTIENT UN COFFRE
{
resultat = buf.substr(pos+1, 2);
istringstream nbr_coffre(resultat);
nbr_coffre >> Coffre;//CHARGEMENT DU COFFRE
pos = buf.find("(", pos+1);
Item = buf.substr(pos+1, buf.find(")", pos+1)-pos-1);
}
pos = buf.find(",", pos+1);
resultat = buf.substr(pos+1, 1);
if (resultat == "*")//SI LA CASE NE CONTIENT PAS DE CHARSET
{
Charset = -1;
}
else//SI LA CASE CONTIENT UN CHARSET
{
resultat = buf.substr(pos+1, 2);
istringstream nbr_charset(resultat);
nbr_charset >> Charset;//CHARGEMENT DU CHARSET
pos = buf.find("(", pos+1);
resultat = buf.substr(pos+1, 1);
istringstream nbr_angle(resultat);
nbr_angle >> Angle_Charset;//CHARGEMENT DU CHARSET
pos = buf.find(",", pos+1);
PNJ = buf.substr(pos+1, buf.find(")", pos+1)-pos-1);
}
pos = buf.find(",", pos+1);
resultat = buf.substr(pos+1, 1);
if (resultat == "*")//SI LA CASE EST UN PORTAIL
{
ID = -1;
}
else//SI LA CASE EST UN PORTAIL
{
resultat = buf.substr(pos+1, 2);
istringstream nbr_id(resultat);
nbr_id >> ID;//CHARGEMENT DU PORTAIL
pos = buf.find("(", pos+1);
Map = buf.substr(pos+1, buf.find(")", pos+1)-pos-1);
}
} |
Partager