caudio/Headers/cUtils.h
Joshua Jones cd1a2a61d9 Increased buffer size for audio sources from 32k to 64k.
Changed song used by Tutorial1_2DSound.
Added some comments.
Changed cVector3 to use a custom Episilon instead of including float.h (less bloat)
Added debug log entries to cAudio
Allowed cOggDecoder to return error values from decoding.  cAudio now handles those errors a little better.
2009-11-21 00:39:46 +00:00

20 lines
589 B
C++

#ifndef CUTILS_H_INCLUDED
#define CUTILS_H_INCLUDED
#include <string>
//! Grabs the current extention of a given string.
static std::string getExt(const std::string& filename)
{
if(filename.find_last_of(".") == std::string::npos) return filename;
return filename.substr(filename.find_last_of(".") + 1, filename.length()-filename.find_last_of(".")-1);
}
//! Prevents a bug with NULL passed into std::string.
static std::string safeCStr(const char* str)
{
if( str != NULL ) return std::string(str);
else return std::string("");
}
#endif //! CUTILS_H_INCLUDED