Browse Source

Fix deprecations for oF v0.9.0 in src

master
Krisjanis Rijnieks 10 years ago
parent
commit
ec3a60b742
  1. 4
      src/Sources/FboSource.cpp
  2. 8
      src/Sources/ImageSource.cpp
  3. 8
      src/UserInterface/CircleJoint.cpp

4
src/Sources/FboSource.cpp

@ -84,7 +84,11 @@ void FboSource::allocate(int width, int height){
ofClear(0); ofClear(0);
fbo->end(); fbo->end();
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
texture = &(fbo->getTexture());
#else
texture = &(fbo->getTextureReference()); texture = &(fbo->getTextureReference());
#endif
} }
void FboSource::clear(){ void FboSource::clear(){

8
src/Sources/ImageSource.cpp

@ -18,11 +18,19 @@ void ImageSource::loadImage(std::string & filePath){
setNameFromPath(filePath); setNameFromPath(filePath);
//cout << "path: " << path << endl; //cout << "path: " << path << endl;
image = new ofImage(); image = new ofImage();
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
if(!image->load(filePath)){
#else
if(!image->loadImage(filePath)){ if(!image->loadImage(filePath)){
#endif
ofLogWarning("ImageSource") << "Could not load image"; ofLogWarning("ImageSource") << "Could not load image";
//std::exit(EXIT_FAILURE); //std::exit(EXIT_FAILURE);
} }
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
texture = &image->getTexture();
#else
texture = &image->getTextureReference(); texture = &image->getTextureReference();
#endif
loaded = true; loaded = true;
} }

8
src/UserInterface/CircleJoint.cpp

@ -30,7 +30,11 @@ void CircleJoint::draw(){
ofSetColor(fillColor); ofSetColor(fillColor);
} }
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
ofDrawCircle(position.x, position.y, radius);
#else
ofCircle(position.x, position.y, radius); ofCircle(position.x, position.y, radius);
#endif
ofNoFill(); ofNoFill();
if(selected){ if(selected){
@ -40,7 +44,11 @@ void CircleJoint::draw(){
} }
ofSetLineWidth(strokeWidth); ofSetLineWidth(strokeWidth);
#if (OF_VERSION_MAJOR == 0 && OF_VERSION_MINOR >= 9) || OF_VERSION_MAJOR > 0
ofDrawCircle(position.x, position.y, radius);
#else
ofCircle(position.x, position.y, radius); ofCircle(position.x, position.y, radius);
#endif
ofPopStyle(); ofPopStyle();
} }

Loading…
Cancel
Save