Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 14, 2011, 5:36:36 PM (13 years ago)
Author:
dafrick
Message:

Adding screenshot to KeybindMenu and making "size" of screenhsot generated by printScreenshotHD adjustable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/modules/designtools/ScreenshotManager.h

    r7163 r8076  
    4040        ~ScreenshotManager();
    4141
    42       /* Creates a screenshot with the given camera.
    43         * @param camera Pointer to the camera "looking at" the scene of interest
    44         * @param fileName the filename of the screenshot file.
    45       */
     42        /**
     43         * @briefCreates a screenshot with the given camera.
     44         * @param camera Pointer to the camera "looking at" the scene of interest
     45         * @param fileName the filename of the screenshot file.
     46         */
    4647        void makeScreenshot() const;
    4748
    48         static void makeScreenshot_s()
    49             { getInstance().makeScreenshot(); }
     49        //static void makeScreenshot_s()
     50        //    { getInstance().makeScreenshot(); }
     51        static void makeScreenshot_s(unsigned int size)
     52            { getInstance().setGridSize(size); getInstance().makeScreenshot(); }
     53
     54        void setGridSize(unsigned int size)
     55        {
     56            this->mGridSize_ = size;
     57            uint8_t* data_ = new uint8_t[(this->mWindowWidth_ * this->mGridSize_) * (this->mWindowHeight_ * this->mGridSize_) * 3];
     58            this->mFinalPicturePB_ = Ogre::PixelBox(this->mWindowWidth_ * this->mGridSize_, this->mWindowHeight_ * this->mGridSize_, 1, Ogre::PF_B8G8R8, data_);
     59        }
    5060
    5161    protected:
    5262        static std::string getTimestamp();
    5363
    54         std::string    mFileExtension;
    55         unsigned int   mGridSize, mWindowWidth, mWindowHeight;
    56         bool           mDisableOverlays;
     64        std::string    mFileExtension_;
     65        unsigned int   mGridSize_, mWindowWidth_, mWindowHeight_;
     66        bool           mDisableOverlays_;
    5767        //temp texture with current screensize
    58         Ogre::TexturePtr mTempTex;
    59         Ogre::RenderTexture* mRT;
    60         Ogre::HardwarePixelBufferSharedPtr mBuffer;
     68        Ogre::TexturePtr mTempTex_;
     69        Ogre::RenderTexture* mRT_;
     70        Ogre::HardwarePixelBufferSharedPtr mBuffer_;
    6171        //PixelBox for a large Screenshot, if grid size is > 1
    62         Ogre::PixelBox  mFinalPicturePB;
     72        Ogre::PixelBox  mFinalPicturePB_;
    6373        uint8_t* data_;
    6474
Note: See TracChangeset for help on using the changeset viewer.