openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.89k stars 2.55k forks source link

Group: Deprecated Code #1550

Open kylemcdonald opened 12 years ago

kylemcdonald commented 12 years ago

Deprecated code includes anything that shouldn't exist in a perfect openFrameworks code base.

This is a group of issues identified during Code Review 2012. Add any relevant issues to this group, and when they are all closed we will close this issue. If an issue fits this pattern, but is more significant or not a simple fix, please add it as a separate issue.

damian0815 commented 12 years ago

https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/math/ofVec4f.h#L124 https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/math/ofVec4f.h#L148

ofVec4f has a section that begins with a comment:

// this methods are deprecated in 006 please use:

all methods below up until middled() should be marked as deprecated

damian0815 commented 12 years ago

https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/gl/ofTexture.h#L159 bAllocated() should be deprecated in favour of isAllocated().

damian0815 commented 12 years ago

https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/graphics/ofImage.h#L189 bAllocated() should be deprecated in favour of isAllocated().

ofTheo commented 12 years ago

https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/utils/ofConstants.h#L79

NOMINMAX ?

julapy commented 12 years ago

all these methods are deprecated and need OF_DEPRECATED_MSG

ofVec2f::rescale ofVec2f::rescaled ofVec2f::normalized ofVec2f::perpendiculared ofVec2f::interpolated ofVec2f::limited ofVec2f::middled ofVec2f::mapped ofVec2f::distanceSquared ofVec2f::rotated ofVec2f::align ofVec2f::alignRad

ofVec3f::align ofVec3f::alignRad ofVec3f::rescaled ofVec3f::rescale ofVec3f::rotated ofVec3f::mapped ofVec3f::interpolated ofVec3f::middled ofVec3f::normalized ofVec3f::limited ofVec3f::crossed ofVec3f::perpendiculared

ofVec4f::rescaled ofVec4f::rescale ofVec4f::distanceSquared ofVec4f::interpolated ofVec4f::middled ofVec4f::normalized ofVec4f::limited

can the deprecated message say what OF version it has been deprecated in?

ofTheo commented 12 years ago

https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/utils/ofConstants.h

ofConstants.h should default to LITTLE_ENDIAN - check for cases of possible BIG_ENDIAN

justdayan commented 12 years ago

ofVideoPlayer.cpp

void ofVideoPlayer::closeMovie(){ close(); }

just calls close, should be deprecated and moved into close()..

https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/3d/ofCamera.h#L58-61

also present in

ofQTKitPlayer.mm https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/video/ofQTKitPlayer.mm#L65-67

ofQuickTimePlayer.h https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/video/ofQuickTimePlayer.cpp#L211-213

but not in ofGstVideoPlayer.cpp

damian0815 commented 12 years ago

https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/sound/ofSoundStream.h#L23

global ofSoundStreamSetup/Stop/Start/Close/ListDevices should be deprecated in favour of ofSoundStream:: class based API.

ofTheo commented 12 years ago

remove #ifdef MWERKS - can we drop codewarrior now?

https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/utils/ofConstants.h#L178

damian0815 commented 12 years ago

https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/sound/ofSoundPlayer.h#L9

ofSoundStopAll(), ofSoundSetVolume(), ofSoundUpdate(), ofSoundGetSpectrum(), ofSoundShutdown() should go away. all are FMOD-only except for ofSoundGetSpectrum(), but should be removed and built into proper class-based sound stuff.

julapy commented 12 years ago

~~ofVec2f::lengthSquared ofVec2f::squareLength~~

~~ofVec3f::lengthSquared ofVec3f::squareLength~~

~~ofVec4f::lengthSquared ofVec4f::squareLength~~

~~squareLength should be deprecated. and the code from squareLength should be moved into lengthSquared.~~ (PR #1619)

ofTheo commented 12 years ago

ofDirectory::numFiles() should be deprecated. as size() does the same thing. https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/utils/ofFileUtils.h#L249

ofTheo commented 12 years ago

bool ofDirectory::getShowHidden() can we give this a better name please? https://github.com/openframeworks/openFrameworks/blob/develop/libs/openFrameworks/utils/ofFileUtils.h#L243

ofZach commented 12 years ago

static bool inside in ofPolyline should be deprecated as there's now non static versions:

https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/graphics/ofPolyline.h#L103-104

(and maybe it should be called isInside() for consistency)

danomatika commented 12 years ago

bAllocated in ofTexture should be depreciated, there is an isAllocated method.

bilderbuchi commented 12 years ago

can the deprecated message say what OF version it has been deprecated in?

It could, but I think the better solution would be to mention this in the changelog (I started this already, check it out).

Also, I propose an interval of N (=2?) releases after which deprecated things will be deleted. We can easily track this in issues milestoned to the correct release, see #1428 for one. This workflow meshes nicely with the changelog entries: Deprecate something, make an entry in the upcoming changelog, make an entry in the relevant planning issue, done. That way people get a good overview what has been deprecated in each release, and we won't miss code which rots in the codebase and has been deprecated for years. :-)

bilderbuchi commented 12 years ago

@julapy ofVecNf:SquareLength/LengthSquared: I'm confused, one of those has already been deprecated a while ago (5b89bbd2fb5049f29aa67db2b4e5f57b03859d7f). Which codebase are you looking at? Or are you just saying that we should deprecate the other naming option, and keep the one which is deprecated now?

danomatika commented 12 years ago

The global texture settings functions in ofTexture.h seem to be pretty hacky. They are not state changing settings, but only applied when a texture is allocated/loaded ... this is also not obvious in the comments ...

danomatika commented 12 years ago

Are setCoordHandedness & getCoordHandedness in ofCairoRenderer necessary (and the ofHandednessType)? Seems hacky.

underdoeg commented 12 years ago

@danomatika Are setCoordHandedness & getCoordHandedness in ofCairoRenderer necessary: setCoordHandedness actually does nothing in the cpp file

danomatika commented 12 years ago

The pixels, ofFile, and filename string constructors for ofImage should probably be removed. You can just use the explicit loading functions directly.

danomatika commented 12 years ago

bAllocated() in ofImage is deprecated.

bilderbuchi commented 11 years ago

helper_quadratic_to in ofCairRenderer.cpp can be removed as per Arturo's comment. cf 073ab2e166bd0