Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openframeworks/openFrameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
arturoc committed Oct 10, 2011
2 parents 04f44b0 + 666c869 commit fa65aff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 0 additions & 10 deletions libs/openFrameworks/app/ofAppRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ void ofRunApp(ofBaseApp * OFSA){
OFSAptr->mouseY = 0;
}

#ifdef TARGET_OSX
//this internally checks the executable path for osx
ofSetDataPathRoot("../../../data/");
#endif

atexit(ofExitCallback);

#ifdef WIN32_HIGH_RES_TIMING
Expand Down Expand Up @@ -161,11 +156,6 @@ void ofRunApp(ofPtr<ofBaseApp> OFSA){
OFSAptr->mouseY = 0;
}

#ifdef TARGET_OSX
//this internally checks the executable path for osx
ofSetDataPathRoot("../../../data/");
#endif

atexit(ofExitCallback);

#ifdef WIN32_HIGH_RES_TIMING
Expand Down
8 changes: 8 additions & 0 deletions libs/openFrameworks/utils/ofUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ void ofDisableDataPath(){
static string dataPathRoot = "data/";
#endif

static bool isDataPathSet = false;

//--------------------------------------------------
void ofSetDataPathRoot(string newRoot){
string newPath = "";
Expand Down Expand Up @@ -248,11 +250,17 @@ void ofSetDataPathRoot(string newRoot){
}
#endif
#endif

dataPathRoot = newRoot;
isDataPathSet = true;
}

//--------------------------------------------------
string ofToDataPath(string path, bool makeAbsolute){

if (!isDataPathSet)
ofSetDataPathRoot(dataPathRoot);

if( enableDataPath ){

//check if absolute path has been passed or if data path has already been applied
Expand Down

0 comments on commit fa65aff

Please sign in to comment.