Changeset 1130 for cpp/frams/model/autoname.cpp
- Timestamp:
- 04/16/21 15:55:34 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/autoname.cpp
r973 r1130 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-202 0Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2021 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 5 5 #include "autoname.h" 6 #include "common/nonstd_stl.h"6 #include <algorithm> 7 7 #include <ctype.h> 8 8 … … 100 100 if (model.getPartCount() > 0) 101 101 { 102 cialo = min((int)(sqrt(double(model.getPartCount()) - 1) * NAME_BODYLEN), NAME_MAXLENBODY - 1);102 cialo = std::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 … … 106 106 nextpoz = ((model.getPartCount()) * (i + 1)) / (cialo + 1) - 1; 107 107 w = 1.0; 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)];108 for (; poz <= nextpoz; poz++) w = std::max(w, model.getPart(poz)->mass); 109 tmpc[i] = Sp[std::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 = std::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 … … 123 123 nextpoz = (model.getNeuroCount() * (i + 1)) / (mozg + 1) - 1; 124 124 wint = 0; 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)];125 for (; poz <= nextpoz; poz++) wint = std::max(wint, model.getNeuro(poz)->getInputCount()); 126 tmpm[i] = Sam[std::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.