mirror of
https://github.com/glest/glest-source.git
synced 2025-08-22 16:02:50 +02:00
- 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:
@@ -1196,9 +1196,12 @@ void Game::keyDown(char key) {
|
|||||||
else if(key == configKeys.getCharKey("Screenshot")) {
|
else if(key == configKeys.getCharKey("Screenshot")) {
|
||||||
string path = GameConstants::folder_path_screenshots;
|
string path = GameConstants::folder_path_screenshots;
|
||||||
if(isdir(path.c_str()) == true) {
|
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 = GameConstants::folder_path_screenshots;
|
||||||
path += "screen" + intToStr(i) + ".tga";
|
path += "screen" + intToStr(i) + "." + fileFormat;
|
||||||
FILE *f= fopen(path.c_str(), "rb");
|
FILE *f= fopen(path.c_str(), "rb");
|
||||||
if(f==NULL) {
|
if(f==NULL) {
|
||||||
Renderer::getInstance().saveScreen(path);
|
Renderer::getInstance().saveScreen(path);
|
||||||
|
@@ -2969,7 +2969,7 @@ void Renderer::saveScreen(const string &path){
|
|||||||
GL_RGB, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
|
GL_RGB, GL_UNSIGNED_BYTE, pixmapScreenShot->getPixels());
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
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__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
@@ -506,10 +506,10 @@ void Pixmap2D::load(const string &path) {
|
|||||||
|
|
||||||
void Pixmap2D::save(const string &path) {
|
void Pixmap2D::save(const string &path) {
|
||||||
string extension= path.substr(path.find_last_of('.')+1);
|
string extension= path.substr(path.find_last_of('.')+1);
|
||||||
if(extension == "bmp") {
|
if(toLower(extension) == "bmp") {
|
||||||
saveBmp(path);
|
saveBmp(path);
|
||||||
}
|
}
|
||||||
else if(extension == "tga") {
|
else if(toLower(extension) == "tga") {
|
||||||
saveTga(path);
|
saveTga(path);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user