- added new screenshot format to be bmp (can be oveeriden by ini setting, and more formats may be added later) ScreenShotFileType=tga to revert to old default tga screenshots

This commit is contained in:
Mark Vejvoda 2010-10-29 22:18:23 +00:00
parent 27212dd962
commit 13c4deb5b6
3 changed files with 8 additions and 5 deletions

View File

@ -1196,9 +1196,12 @@ void Game::keyDown(char key) {
else if(key == configKeys.getCharKey("Screenshot")) {
string path = GameConstants::folder_path_screenshots;
if(isdir(path.c_str()) == true) {
for(int i=0; i<100; ++i){
Config &config= Config::getInstance();
string fileFormat = config.getString("ScreenShotFileType","bmp");
for(int i=0; i<250; ++i){
path = GameConstants::folder_path_screenshots;
path += "screen" + intToStr(i) + ".tga";
path += "screen" + intToStr(i) + "." + fileFormat;
FILE *f= fopen(path.c_str(), "rb");
if(f==NULL) {
Renderer::getInstance().saveScreen(path);

View File

@ -2969,7 +2969,7 @@ void Renderer::saveScreen(const string &path){
GL_RGB, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
pixmapScreenShot->saveTga(path);
pixmapScreenShot->save(path);
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
}

View File

@ -506,10 +506,10 @@ void Pixmap2D::load(const string &path) {
void Pixmap2D::save(const string &path) {
string extension= path.substr(path.find_last_of('.')+1);
if(extension == "bmp") {
if(toLower(extension) == "bmp") {
saveBmp(path);
}
else if(extension == "tga") {
else if(toLower(extension) == "tga") {
saveTga(path);
}
else {