Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-core / trunk / src / modules / mod_ppm / trgt_ppm.cpp
index fe424bc..8fc4810 100644 (file)
@@ -2,8 +2,11 @@
 /*!    \file trgt_ppm.cpp
 **     \brief ppm Target Module
 **
+**     $Id$
+**
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -32,7 +35,6 @@
 #endif
 
 #include "trgt_ppm.h"
-#include <synfig/synfig.h>
 #include <ETL/stringf>
 #include <cstdio>
 #include <algorithm>
@@ -101,18 +103,15 @@ ppm::start_frame(synfig::ProgressCallback *callback)
        }
        else if(multi_image)
        {
-               String
-                       newfilename(filename),
-                       ext(find(filename.begin(),filename.end(),'.'),filename.end());
-               newfilename.erase(find(newfilename.begin(),newfilename.end(),'.'),newfilename.end());
-
-               newfilename+=etl::strprintf("%04d",imagecount)+ext;
-               file=SmartFILE(fopen(newfilename.c_str(),"wb"));
+               String newfilename(filename_sans_extension(filename) +
+                                                  etl::strprintf(".%04d",imagecount) +
+                                                  filename_extension(filename));
+               file=SmartFILE(fopen(newfilename.c_str(),POPEN_BINARY_WRITE_TYPE));
                if(callback)callback->task(newfilename);
        }
        else
        {
-               file=SmartFILE(fopen(filename.c_str(),"wb"));
+               file=SmartFILE(fopen(filename.c_str(),POPEN_BINARY_WRITE_TYPE));
                if(callback)callback->task(filename);
        }
 
@@ -133,7 +132,7 @@ ppm::start_frame(synfig::ProgressCallback *callback)
 }
 
 Color *
-ppm::start_scanline(int scanline)
+ppm::start_scanline(int /*scanline*/)
 {
        return color_buffer;
 }