Browse Source

Fix deprecations for oF v0.9.0 in src

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

8
src/Sources/FboSource.cpp

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

12
src/Sources/ImageSource.cpp

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

12
src/UserInterface/CircleJoint.cpp

@ -30,7 +30,11 @@ void CircleJoint::draw(){
ofSetColor(fillColor);
}
ofCircle(position.x, position.y, radius);
#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);
#endif
ofNoFill();
if(selected){
@ -40,7 +44,11 @@ void CircleJoint::draw(){
}
ofSetLineWidth(strokeWidth);
ofCircle(position.x, position.y, radius);
#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);
#endif
ofPopStyle();
}

Loading…
Cancel
Save