mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 03:09:49 +02:00
- g3d viewer now respects userdata path for screenshots
This commit is contained in:
@@ -73,6 +73,7 @@ SET(GLEST_LIB_INCLUDE_DIRS
|
|||||||
${GLEST_LIB_INCLUDE_ROOT}sound
|
${GLEST_LIB_INCLUDE_ROOT}sound
|
||||||
${GLEST_LIB_INCLUDE_ROOT}streflop
|
${GLEST_LIB_INCLUDE_ROOT}streflop
|
||||||
${GLEST_LIB_INCLUDE_ROOT}xml
|
${GLEST_LIB_INCLUDE_ROOT}xml
|
||||||
|
${GLEST_MAIN_INCLUDE_ROOT}facilities
|
||||||
${GLEST_MAIN_INCLUDE_ROOT}graphics
|
${GLEST_MAIN_INCLUDE_ROOT}graphics
|
||||||
${GLEST_MAIN_INCLUDE_ROOT}game
|
${GLEST_MAIN_INCLUDE_ROOT}game
|
||||||
${GLEST_MAIN_INCLUDE_ROOT}global
|
${GLEST_MAIN_INCLUDE_ROOT}global
|
||||||
@@ -80,7 +81,7 @@ SET(GLEST_LIB_INCLUDE_DIRS
|
|||||||
)
|
)
|
||||||
INCLUDE_DIRECTORIES( ${GLEST_LIB_INCLUDE_DIRS} )
|
INCLUDE_DIRECTORIES( ${GLEST_LIB_INCLUDE_DIRS} )
|
||||||
|
|
||||||
SET(MG_SOURCE_FILES "../glest_game/graphics/particle_type.cpp" "../glest_game/graphics/unit_particle_type.cpp")
|
SET(MG_SOURCE_FILES "../glest_game/graphics/particle_type.cpp" "../glest_game/graphics/unit_particle_type.cpp" "../glest_game/global/config.cpp")
|
||||||
|
|
||||||
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
FOREACH(DIR IN LISTS DIRS_WITH_SRC)
|
||||||
INCLUDE_DIRECTORIES( ${DIR} )
|
INCLUDE_DIRECTORIES( ${DIR} )
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
#include "xml_parser.h"
|
#include "xml_parser.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <wx/event.h>
|
#include <wx/event.h>
|
||||||
|
#include "config.h"
|
||||||
#include "game_constants.h"
|
#include "game_constants.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@@ -34,11 +35,27 @@ const char *folderDelimiter = "\\";
|
|||||||
const char *folderDelimiter = "/";
|
const char *folderDelimiter = "/";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int GameConstants::updateFps= 40;
|
//int GameConstants::updateFps= 40;
|
||||||
int GameConstants::cameraFps= 100;
|
//int GameConstants::cameraFps= 100;
|
||||||
|
|
||||||
const string g3dviewerVersionString= "v1.3.6";
|
const string g3dviewerVersionString= "v1.3.6";
|
||||||
|
|
||||||
|
namespace Glest { namespace Game {
|
||||||
|
string getGameReadWritePath(string lookupKey) {
|
||||||
|
string path = "";
|
||||||
|
if(path == "" && getenv("GLESTHOME") != NULL) {
|
||||||
|
path = getenv("GLESTHOME");
|
||||||
|
if(path != "" && EndsWith(path, "/") == false && EndsWith(path, "\\") == false) {
|
||||||
|
path += "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] path to be used for read/write files [%s]\n",__FILE__,__FUNCTION__,__LINE__,path.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
|
||||||
namespace Shared{ namespace G3dViewer{
|
namespace Shared{ namespace G3dViewer{
|
||||||
|
|
||||||
// ===============================================
|
// ===============================================
|
||||||
@@ -193,6 +210,8 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
|
|||||||
wxSize(Renderer::windowW, Renderer::windowH)), model(NULL), glCanvas(NULL), renderer(NULL), initTextureManager(true), timer(NULL)
|
wxSize(Renderer::windowW, Renderer::windowH)), model(NULL), glCanvas(NULL), renderer(NULL), initTextureManager(true), timer(NULL)
|
||||||
{
|
{
|
||||||
this->appPath = appPath;
|
this->appPath = appPath;
|
||||||
|
|
||||||
|
Config &config = Config::getInstance();
|
||||||
//getGlPlatformExtensions();
|
//getGlPlatformExtensions();
|
||||||
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 }; // to prevent flicker
|
int args[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_MIN_ALPHA, 8 }; // to prevent flicker
|
||||||
glCanvas = new GlCanvas(this, args);
|
glCanvas = new GlCanvas(this, args);
|
||||||
@@ -716,8 +735,14 @@ void MainWindow::saveScreenshot() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
string screenShotsPath = extractDirectoryPathFromFile(appPath) + string("screens/");
|
//string screenShotsPath = extractDirectoryPathFromFile(appPath) + string("screens/");
|
||||||
|
string userData = Config::getInstance().getString("UserData_Root","");
|
||||||
|
if(userData != "") {
|
||||||
|
if(userData != "" && EndsWith(userData, "/") == false && EndsWith(userData, "\\") == false) {
|
||||||
|
userData += "/";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
string screenShotsPath = userData + string("screens/");
|
||||||
printf("screenShotsPath [%s]\n",screenShotsPath.c_str());
|
printf("screenShotsPath [%s]\n",screenShotsPath.c_str());
|
||||||
|
|
||||||
if(isdir(screenShotsPath.c_str()) == false) {
|
if(isdir(screenShotsPath.c_str()) == false) {
|
||||||
|
Reference in New Issue
Block a user