Line | |
---|
1 | #ifndef _IMGUTIL_H |
---|
2 | #define _IMGUTIL_H |
---|
3 |
|
---|
4 | #include <IMGPrerequisites.h>
|
---|
5 |
|
---|
6 | namespace IMG {
|
---|
7 |
|
---|
8 | class _IMGExport 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 |
|
---|
39 | /*
|
---|
40 | extern "C" _BBCExport double fround(double n, unsigned d)
|
---|
41 | {
|
---|
42 | return floor(n * pow((double)10.,(int) d) + .5) / pow((double)10.,(int) d);
|
---|
43 | }
|
---|
44 |
|
---|
45 | extern "C" _BBCExport int iround(double x)
|
---|
46 | {
|
---|
47 | return (int)floor(x + 0.5);
|
---|
48 | } |
---|
49 | */ |
---|
50 | } |
---|
51 | |
---|
52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.