Changeset 973 for cpp/frams/model/autoname.cpp
 Timestamp:
 07/03/20 00:37:13 (2 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

cpp/frams/model/autoname.cpp
r534 r973 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 199920 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 19992020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 11 11 SString t; 12 12 t = firstName(model); 13 SString last =lastName(model);14 if (last.len ()>0)15 13 SString last = lastName(model); 14 if (last.length() > 0) 15 { 16 16 t += ' '; 17 17 t += last; 18 18 } 19 19 return t; 20 20 } … … 42 42 unsigned int s1 = 0, s2 = 0, s3 = 0; 43 43 const char *x = g.c_str(); 44 if (*x ==0) return SString();45 for (; *x; x++) { s1 += *x; s2 = s2 **x + *x; s3 = (s3^*x) + *x; }44 if (*x == 0) return SString(); 45 for (; *x; x++) { s1 += *x; s2 = s2 * *x + *x; s3 = (s3 ^ *x) + *x; } 46 46 char* t = buf; 47 47 t = cat_syl(t, s1); … … 71 71 for (i = 0; i <= pp; i++) 72 72 { 73 p = (i*d1) / pp  1; for (; p1 <= p; p1++) *(out++) = *(in1++);74 p = (i*d2) / pp  1; for (; p2 <= p; p2++) *(out++) = *(in2++);73 p = (i * d1) / pp  1; for (; p1 <= p; p1++) *(out++) = *(in1++); 74 p = (i * d2) / pp  1; for (; p2 <= p; p2++) *(out++) = *(in2++); 75 75 } 76 76 *out = 0; … … 100 100 if (model.getPartCount() > 0) 101 101 { 102 cialo = min((int)(sqrt(double(model.getPartCount())  1) *NAME_BODYLEN), NAME_MAXLENBODY  1);102 cialo = min((int)(sqrt(double(model.getPartCount())  1) * NAME_BODYLEN), NAME_MAXLENBODY  1); 103 103 poz = 0; 104 104 for (i = 0; i <= cialo; i++) // budowanie "opisu" ciala 105 105 { 106 nextpoz = ((model.getPartCount()) *(i + 1)) / (cialo + 1)  1;106 nextpoz = ((model.getPartCount()) * (i + 1)) / (cialo + 1)  1; 107 107 w = 1.0; 108 108 for (; poz <= nextpoz; poz++) w = max(w, model.getPart(poz)>mass); 109 tmpc[i] = Sp[min(int((w  1.0) *NAME_BODYMASS), int(sizeof(Sp))  2)];109 tmpc[i] = Sp[min(int((w  1.0) * NAME_BODYMASS), int(sizeof(Sp))  2)]; 110 110 } 111 111 tmpc[i] = 0; … … 117 117 if (model.getNeuroCount() > 0) 118 118 { 119 mozg = min((int)(sqrt((double)model.getNeuroCount()) *NAME_BRAINLEN), NAME_MAXLENBRAIN  1);119 mozg = min((int)(sqrt((double)model.getNeuroCount()) * NAME_BRAINLEN), NAME_MAXLENBRAIN  1); 120 120 poz = 0; 121 121 for (i = 0; i <= mozg; i++) // budowanie "opisu" mozgu 122 122 { 123 nextpoz = (model.getNeuroCount() *(i + 1)) / (mozg + 1)  1;123 nextpoz = (model.getNeuroCount() * (i + 1)) / (mozg + 1)  1; 124 124 wint = 0; 125 125 for (; poz <= nextpoz; poz++) wint = max(wint, model.getNeuro(poz)>getInputCount()); 126 tmpm[i] = Sam[min(int(wint *NAME_BRAININP), int(sizeof(Sam))  2)];126 tmpm[i] = Sam[min(int(wint * NAME_BRAININP), int(sizeof(Sam))  2)]; 127 127 } 128 128 tmpm[i] = 0;
Note: See TracChangeset
for help on using the changeset viewer.