#ifndef _IMGUTIL_H #define _IMGUTIL_H #include namespace IMG { class _IMGExport Util { public: static Ogre::String getBaseName(Ogre::String fileName) { Ogre::String baseName; size_t pos = fileName.find_last_of("."); baseName = fileName.substr(0, pos); return baseName; } static Ogre::String getExtensionName(Ogre::String fileName) { Ogre::String ext; size_t pos = fileName.find_last_of("."); ext = fileName.substr(pos+1); return ext; } static unsigned int nextPowerOf2(unsigned int nPlanes) { unsigned int depth = 1; while (depth < nPlanes) { depth = depth << 1; } return depth; } }; /* extern "C" _BBCExport double fround(double n, unsigned d) { return floor(n * pow((double)10.,(int) d) + .5) / pow((double)10.,(int) d); } extern "C" _BBCExport int iround(double x) { return (int)floor(x + 0.5); } */ } #endif