Changeset 1318
- Timestamp:
- 07/11/24 17:59:38 (5 months ago)
- Location:
- cpp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd_math.h
r1302 r1318 25 25 inline double rndDouble(double limit_exclusive) { return rndGetInstance().getDouble() * limit_exclusive; } 26 26 inline unsigned int rndUint(unsigned int limit_exclusive) { return (unsigned int)(rndGetInstance().getDouble() * limit_exclusive); } //returns random from 0..limit_exclusive-1 27 #if ndef __BORLANDC__ //for embarcadero 11u3, unsigned int and size_t are duplicates28 inline unsigned int rndUint(size_t limit_exclusive) {return rndUint((unsigned int)limit_exclusive);} //just an overload with size_t argument 27 #if !defined __BORLANDC__ && !defined __ARM_ARCH_7A__ //for 32-bit compilations (embarcadero 11u3 and clang android), unsigned int and size_t function variants are duplicates. Using templates to define an additional function variant only when size_t is different from unsigned int is such a hassle... especially that some variants are inline, some are not. Another approach would be to create a template for all types (or all integer types?) and potentially getting an overflow for longer int types when casting the result of getDouble()*limit_exclusive to unsigned int. 28 inline unsigned int rndUint(size_t limit_exclusive) {return rndUint((unsigned int)limit_exclusive);} //just an overload with size_t argument to avoid compiler warnings and avoid hundreds of casts. May limit the range if size_t is larger than unsigned int and somebody would intentionally use such a huge limit_exclusive value. 29 29 #endif 30 30 unsigned int rndUint(int limit_exclusive); //just an overload with int argument -
cpp/frams/config/version.h
r1305 r1318 3 3 // See LICENSE.txt for details. 4 4 5 #define MAIN_REL_ID "5.0 rc30"6 #define VERSION_INT 2 25 #define MAIN_REL_ID "5.0" 6 #define VERSION_INT 23 7 7 8 8 9 9 #ifdef IPHONE 10 // make the version displayed in the "About" windowcompatible with Apple's ideas about versioning11 #define IOS_VERSION "5.0. 5" //can't be arbitrary text as in some other platforms, so let's make it "Framsticks version (disregarding rc)" + dot + "number increased on each release"10 // in the "About" window, display both MAIN_REL_ID and the version compatible with Apple's ideas about versioning 11 #define IOS_VERSION "5.0.7" //for Apple, this can't be arbitrary text (like MAIN_REL_ID could be) as in some other platforms, so let's make it "Framsticks version (disregarding "rc", "beta" etc.)" + dot + "number increased on each release" 12 12 #define VERSION_FOR_MOBI_ABOUT IOS_VERSION "<br><small>(Framsticks " MAIN_REL_ID ")</small>" //...but still display the true internal Framsticks version 13 13 #else -
cpp/frams/model/modelparts.h
r1302 r1318 99 99 enum Shape { 100 100 SHAPE_BALL = 0, ///< for "ball and stick" shape type model only. 101 SHAPE_ELLIPSOID = 1, SHAPE_CUBOID = 2 , SHAPE_CYLINDER = 3,101 SHAPE_ELLIPSOID = 1, SHAPE_CUBOID = 2 /* rectangular cuboid */, SHAPE_CYLINDER = 3, 102 102 SHAPE_FIRST = SHAPE_BALL, SHAPE_LAST = SHAPE_CYLINDER // for iteration 103 103 }; 104 104 static const char* getShapeName(Shape sh); 105 static constexpr double DEFAULT_STICK_RADIUS = 0.15; //used in odesim and inSHAPETYPE_BALL_AND_STICK to SHAPETYPE_SOLIDS Model conversion105 static constexpr double DEFAULT_STICK_RADIUS = 0.15; //used in odesim, VisualModel, CreatureObj3D, and SHAPETYPE_BALL_AND_STICK to SHAPETYPE_SOLIDS Model conversion 106 106 107 107 double mass, size, density, friction, ingest, assim, hollow;
Note: See TracChangeset
for help on using the changeset viewer.