X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgrabber.cpp;h=5b4023142a43f8b35ece195a59b1927e5fb8d1d0;hb=81f1ddee977603293d0c5710f2db69130dac6a96;hp=e56622f4d9949f21936358550a278d7a023e7cbd;hpb=a51c2557622ea93944e24f58845609526eb46ec1;p=gldbg.git diff --git a/source/grabber.cpp b/source/grabber.cpp index e56622f..5b40231 100644 --- a/source/grabber.cpp +++ b/source/grabber.cpp @@ -6,16 +6,16 @@ Distributed under the GPL */ #include +#include #include -#include #include "arraysize.h" #include "breakpoint.h" #include "functions.h" #include "gldbg.h" #include "grabber.h" +#include "strformat.h" using namespace std; -using namespace Msp; Grabber::Grabber(GlDbg &g): gldbg(g), @@ -124,7 +124,7 @@ void Grabber::cmd_autograb(const string &args) } } else - throw InvalidParameterValue("Invalid autograb mode"); + throw runtime_error("Invalid autograb mode"); } void Grabber::grab() @@ -220,13 +220,13 @@ void Grabber::glReadPixels(void *user_data, int, int, int width, int height, GLe { Grabber *self = reinterpret_cast(user_data); - string fn = Msp::format("grab-%04d-%04d.png", self->frame_num, self->grab_num); + string fn = strformat("grab-%04d-%04d.png", self->frame_num, self->grab_num); if(format==GL_RGBA && type==GL_UNSIGNED_BYTE) { if(self->write_png(fn, width, height, data)<0) - IO::print("Failed to write png file %s\n", fn); + printf("Failed to write png file %s\n", fn.c_str()); else - IO::print("Grabbed %dx%d png image to %s\n", width, height, fn); + printf("Grabbed %dx%d png image to %s\n", width, height, fn.c_str()); } ++self->grab_num;