X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FEntity.hh;fp=src%2FMoof%2FProfiler.hh;h=738e13785b0f3d77bcb09580ce83288dc1d02ffe;hp=40199df3e27706404b9177bc31c122c5ed30d45c;hb=29e3d45f7bbbf31eadf793c41ff2b3d9c47b7539;hpb=16d1a05b0777e97a45c48e2874aa4e5cc791282e diff --git a/src/Moof/Profiler.hh b/src/Moof/Entity.hh similarity index 73% rename from src/Moof/Profiler.hh rename to src/Moof/Entity.hh index 40199df..738e137 100644 --- a/src/Moof/Profiler.hh +++ b/src/Moof/Entity.hh @@ -26,58 +26,42 @@ *******************************************************************************/ -#ifndef _MOOF_PROFILER_HH_ -#define _MOOF_PROFILER_HH_ +#ifndef _MOOF_ENTITY_HH_ +#define _MOOF_ENTITY_HH_ -/** - * @file Profiler.hh - * Braindead-simple profiler. - */ +#include -#include +#include +#include +#include namespace Mf { -class Profiler -{ + +/** + * Interface for game objects that can be drawn to the screen and half a + * specified size. + */ + +class Entity : public Drawable, public Cullable +{ public: - Profiler(const char* name = "") - { - start(name); - } - ~Profiler() + const Aabb& getAabb() const { - stop(); - } - - void start(const char* name = "") - { - begin = std::clock(); - std::cout << "Profiling " << name << "... "; + return aabb_; } - void stop() - { - if (begin == -1) return; - double elapsed = double(std::clock() - begin) / double(CLOCKS_PER_SEC); - std::cout << elapsed << " sec" << std::endl; - begin = -1; - } +protected: + Aabb aabb_; +}; - void cancel() - { - begin = -1; - } +typedef boost::shared_ptr EntityPtr; -private: - std::clock_t begin; -}; } // namespace Mf - -#endif // _MOOF_PROFILER_HH_ +#endif // _MOOF_ENTITY_HH_ /** vim: set ts=4 sw=4 tw=80: *************************************************/