1b42aa4ad985c136aa696dde9a0138298eea8ac5.svn-base (756B)
1 #ifndef DIAGNOSTICDRAW_H 2 #define DIAGNOSTICDRAW_H 3 4 #include "Utils.h" 5 #include "Console.h" 6 #include "Camera.h" 7 //#include "MiscDraw.h" 8 9 10 class DiagnosticDraw 11 { 12 public: 13 14 DiagnosticDraw(SDL_Renderer* ren, Camera& cam) : mRen(ren), mCam(cam) {}; 15 16 void LogDiagRect(SDL_Rect rect) 17 { 18 mRectQueue.push_back(rect); 19 } 20 21 void LogPixel(int x, int y) 22 { 23 SDL_Rect pix; 24 pix.h = 1; 25 pix.w = 1; 26 pix.x = x; 27 pix.y = y; 28 LogDiagRect(pix); 29 } 30 31 bool Update() 32 { 33 for (unsigned int i = 0; i < mRectQueue.size(); i++) 34 { 35 DrawRect(mRectQueue.at(i)); 36 } 37 mRectQueue.clear(); 38 return true; 39 } 40 41 42 protected: 43 44 bool DrawRect(SDL_Rect WrldPos); 45 46 std::vector<SDL_Rect> mRectQueue; 47 Camera& mCam; 48 SDL_Renderer* mRen; 49 }; 50 51 extern DiagnosticDraw* gDiagDraw; 52 53 #endif