]> git.tdb.fi Git - gldbg.git/blobdiff - source/grabber.cpp
Remove dependencies to MSP libraries to make compiling on embedded platforms easier
[gldbg.git] / source / grabber.cpp
index e56622f4d9949f21936358550a278d7a023e7cbd..5b4023142a43f8b35ece195a59b1927e5fb8d1d0 100644 (file)
@@ -6,16 +6,16 @@ Distributed under the GPL
 */
 
 #include <algorithm>
+#include <stdexcept>
 #include <png.h>
-#include <msp/io/print.h>
 #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<Grabber *>(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;