mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 19:52:25 +01: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:
parent
27212dd962
commit
13c4deb5b6
@ -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);
|
||||
|
@ -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__);
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user