
LostSideDead on Facebook
|
#ifndef CMX_DEBUG_HEADER_H
#define CMX_DEBUG_HEADER_H
#include "cmx_video.h"
#include "cmx_font.h"
#include "cmx_types.h"
#include<string>
namespace cmx {
namespace debug {
class DebugScreen {
public:
DebugScreen() : string_offset(0), off_x(0), off_y(0), width(0), height(0), font_width(0), font_height(0), m_fnt(0), text(""){
}
DebugScreen(int offset_x, int offset_y, int w, int h) : string_offset(0), off_x(offset_x), off_y(offset_y), width(w), height(h), m_fnt(0) {
m_fnt = 0;
}
void initRect(cmx::Rect r) {
off_x = r.x;
off_y = r.y;
width = r.w;
height = r.h;
}
void initFont(cmx::font::Font *fnt, int fnt_w, int fnt_h) {
m_fnt = fnt;
font_width = fnt_w;
font_height = fnt_h;
}
void clear() {
text = "";
}
void shiftLines() {
if(string_offset == 0) return;
text = text.substr(string_offset, text.length()-string_offset);
}
int drawDebugScreen(unsigned int color, unsigned int *buffer, int width);
void printf(const char *src, ...);
int string_offset;
protected:
int off_x, off_y, width, height, font_width, font_height;
cmx::font::Font *m_fnt;
std::string text;
};
}
}
#endif
|