Ignore:
Timestamp:
Aug 15, 2005, 9:28:17 PM (19 years ago)
Author:
darran
Message:

Last release version changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Swollen/swollen/animation.cpp

    r125 r132  
    88
    99#include <iostream>
     10#include <string>
    1011#include <osg/Image>
    1112#include <osgDB/WriteFile>
    12 #include <osgDB/FileNameUtils>
     13#include <osgDB/FileUtils>
     14//#include <osgDB/FileNameUtils>
    1315#include <animation.h>
    1416
     
    1618Animation::Animation()
    1719{
    18    _save = false;
     20   _valid = false;
    1921   _image = new osg::Image;
    2022
     
    4244bool Animation::saveImage( unsigned int playback_index )
    4345{
    44 
    4546   _image->readPixels( _x, _y, _width, _height, GL_RGB, GL_UNSIGNED_BYTE);
    4647
    47    if ( osgDB::writeImageFile(*_image, "image.jpg") )
     48   // restricted to 9999 frames (famous last words but that should be enough ;-)
     49   char nstr[5];
     50   sprintf(nstr, "%04d", playback_index);
     51   
     52   std::string filename = std::string( _dirname + "/frame" + nstr + ".jpg" );
     53   if ( osgDB::writeImageFile(*_image, filename) )
    4854   {
    49       std::cout << "Saved image " << playback_index << std::endl;
     55      std::cout << "Saved " << filename << std::endl;
    5056      return true;
    5157   }
Note: See TracChangeset for help on using the changeset viewer.