Initial checkin of v1.04 - KTX file format support, basic ETC1 compression/decompression, Linux makefile with proper gcc options, lots of high-level improvements to get crnlib into a state where I can more easily add additional formats.
This commit is contained in:
@@ -42,4 +42,22 @@ namespace crnlib
|
||||
bool m_stopped : 1;
|
||||
};
|
||||
|
||||
// Prints object's lifetime to stdout
|
||||
class timed_scope
|
||||
{
|
||||
const char* m_pName;
|
||||
timer m_tm;
|
||||
|
||||
public:
|
||||
inline timed_scope(char* pName = "timed_scope") : m_pName(pName) { m_tm.start(); }
|
||||
|
||||
inline double get_elapsed_secs() const { return m_tm.get_elapsed_secs(); }
|
||||
inline double get_elapsed_ms() const { return m_tm.get_elapsed_ms(); }
|
||||
|
||||
const timer &get_timer() const { return m_tm; }
|
||||
timer &get_timer() { return m_tm; }
|
||||
|
||||
inline ~timed_scope() { double secs = m_tm.get_elapsed_secs(); printf("%s: %f secs, %f ms\n", m_pName, secs, secs * 1000.0f); }
|
||||
};
|
||||
|
||||
} // namespace crnlib
|
||||
|
||||
Reference in New Issue
Block a user