Skip to content

Commit

Permalink
General changes (namespace, deprecated loadFile function) (#7344)
Browse files Browse the repository at this point in the history
#changelog #core
  • Loading branch information
dimitre authored Feb 24, 2023
1 parent f6091a0 commit 61a045c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
1 change: 0 additions & 1 deletion addons/ofxAssimpModelLoader/src/ofxAssimpTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//

#include "ofxAssimpTexture.h"
#include "ofConstants.h"
#include "ofLog.h"

void ofxAssimpTexture::setup(const ofTexture & texture, std::string texturePath, bool bTexRepeat) {
Expand Down
5 changes: 2 additions & 3 deletions addons/ofxGui/src/ofxSliderGroup.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "ofxSliderGroup.h"
using namespace std;

template<class VecType>
ofxVecSlider_<VecType>::ofxVecSlider_(ofParameter<VecType> value, float width, float height){
Expand All @@ -13,7 +12,7 @@ ofxVecSlider_<VecType> * ofxVecSlider_<VecType>::setup(ofParameter<VecType> valu

parameters.clear();
listeners.unsubscribeAll();
const string names[4] = {"x", "y", "z", "w"};
const std::string names[4] = {"x", "y", "z", "w"};

this->value.makeReferenceTo(value);
listeners.push(this->value.newListener(this, & ofxVecSlider_::changeValue));
Expand Down Expand Up @@ -130,7 +129,7 @@ ofxColorSlider_<ColorType> * ofxColorSlider_<ColorType>::setup(ofParameter<ofCol
ofxGuiGroup::setup(value.getName(), "", 0, 0);
parameters.clear();

const string names[4] = {"r", "g", "b", "a"};
const std::string names[4] = {"r", "g", "b", "a"};

ofColor_<ColorType> val = value;
ofColor_<ColorType> min = value.getMin();
Expand Down
4 changes: 2 additions & 2 deletions addons/ofxThreadedImageLoader/src/ofxThreadedImageLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ofxThreadedImageLoader::~ofxThreadedImageLoader(){

// Load an image from disk.
//--------------------------------------------------------------
void ofxThreadedImageLoader::loadFromDisk(ofImage& image, string filename) {
void ofxThreadedImageLoader::loadFromDisk(ofImage& image, std::string filename) {
nextID++;
ofImageLoaderEntry entry(image);
entry.filename = filename;
Expand All @@ -32,7 +32,7 @@ void ofxThreadedImageLoader::loadFromDisk(ofImage& image, string filename) {

// Load an url asynchronously from an url.
//--------------------------------------------------------------
void ofxThreadedImageLoader::loadFromURL(ofImage& image, string url) {
void ofxThreadedImageLoader::loadFromURL(ofImage& image, std::string url) {
nextID++;
ofImageLoaderEntry entry(image);
entry.url = url;
Expand Down
20 changes: 9 additions & 11 deletions addons/ofxThreadedImageLoader/src/ofxThreadedImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
#include "ofThread.h"
#include "ofImage.h"
#include "ofURLFileLoader.h"
#include "ofTypes.h"
#include "ofTypes.h"
#include "ofThreadChannel.h"


using namespace std;

class ofxThreadedImageLoader : public ofThread {
public:
ofxThreadedImageLoader();
~ofxThreadedImageLoader();

void loadFromDisk(ofImage& image, string file);
void loadFromURL(ofImage& image, string url);
void loadFromDisk(ofImage& image, std::string file);
void loadFromURL(ofImage& image, std::string url);



Expand All @@ -26,6 +23,7 @@ class ofxThreadedImageLoader : public ofThread {

// Entry to load.
struct ofImageLoaderEntry {
public:
ofImageLoaderEntry() {
image = NULL;
}
Expand All @@ -34,18 +32,18 @@ class ofxThreadedImageLoader : public ofThread {
image = &pImage;
}
ofImage* image;
string filename;
string url;
string name;
std::string filename;
std::string url;
std::string name;
};


typedef map<string, ofImageLoaderEntry>::iterator entry_iterator;
typedef std::map<std::string, ofImageLoaderEntry>::iterator entry_iterator;

int nextID;
int lastUpdate;

map<string,ofImageLoaderEntry> images_async_loading; // keeps track of images which are loading async
std::map<std::string,ofImageLoaderEntry> images_async_loading; // keeps track of images which are loading async
ofThreadChannel<ofImageLoaderEntry> images_to_load_from_disk;
ofThreadChannel<ofImageLoaderEntry> images_to_update;
};
Expand Down
3 changes: 1 addition & 2 deletions addons/ofxXmlSettings/src/ofxXmlSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static vector<string> tokenize(const string & str, const string & delim)
}
return tokens;
}
//----------------------------------------

//----------------------------------------
ofxXmlSettings::ofxXmlSettings():
Expand All @@ -48,7 +47,7 @@ ofxXmlSettings::ofxXmlSettings(const string& xmlFile):
//we do this so that we have a valid handle
//without the need for loadFile
storedHandle = TiXmlHandle(&doc);
loadFile(xmlFile);
load(xmlFile);
}

//---------------------------------------------------------
Expand Down

0 comments on commit 61a045c

Please sign in to comment.