- Timestamp:
- 04/19/06 00:27:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCUtil.h
r700 r751 5 5 6 6 namespace BBC { 7 8 class _BBCExport Util 9 { 10 public: 11 static Ogre::String getBaseName(Ogre::String fileName) 12 { 13 Ogre::String baseName; 14 size_t pos = fileName.find_last_of("."); 15 baseName = fileName.substr(0, pos); 16 return baseName; 17 } 18 19 static Ogre::String getExtensionName(Ogre::String fileName) 20 { 21 Ogre::String ext; 22 size_t pos = fileName.find_last_of("."); 23 ext = fileName.substr(pos+1); 24 return ext; 25 } 26 27 static unsigned int nextPowerOf2(unsigned int nPlanes) 28 { 29 unsigned int depth = 1; 30 while (depth < nPlanes) 31 { 32 depth = depth << 1; 33 } 34 return depth; 35 } 36 37 }; 38 7 39 /* 8 40 extern "C" _BBCExport double fround(double n, unsigned d) … … 15 47 return (int)floor(x + 0.5); 16 48 } 17 18 extern "C" _BBCExport unsigned int getUpperPowerOfTwo(unsigned int powerOfTwo)19 {20 unsigned int icount = 0;21 unsigned int depth = 1;22 while (icount < powerOfTwo)23 {24 depth = depth << 1;25 icount++;26 }27 return depth;28 }29 49 */ 30 50 }
Note: See TracChangeset
for help on using the changeset viewer.