Commit Graph

247 Commits

Author SHA1 Message Date
minggo 13f83a084e set default projection to 3d 2013-09-16 18:01:16 +08:00
James Chen da1101beeb [Dispatcher] New event dispatcher, first commit. 2013-09-11 22:09:34 +08:00
Ricardo Quesada b78382d5e5 Performance improvements in FileUtils / TextureCache
Added common "apple" platform to avoid duplicate files in FileUtils and other common files
Improves performance in fetching files.
2013-09-06 15:33:28 -07:00
Ricardo Quesada d7590affda Merge branch 'develop' into dictionary_array_fixes
Conflicts:
	cocos2dx/cocoa/CCArray.cpp
	cocos2dx/cocoa/CCArray.h
	cocos2dx/label_nodes/CCLabel.cpp
	extensions/CCArmature/datas/CCDatas.cpp
	extensions/CCArmature/display/CCDisplayManager.cpp
2013-08-21 21:27:44 -07:00
Ricardo Quesada 2e221ee6cc Array & Dictionary fixes
In many places `Dictionary` and `Array` are not being initialized. In fact `Dictionary` doesn't  have the `init()` method creating potential leaks.
Also in objects like `Armature` and the new `LabelTTF`, the `Array` object is not being used a pointer. So it doesn't use the 2 phase initialization, creating potential leaks.

This patch fixes all those issues.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-21 20:12:09 -07:00
Ricardo Quesada 4104cdc20e Better destructors logs
Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-21 20:08:51 -07:00
minggo 2de8963a0a fix warnings caused by deprecating some functions of Array 2013-08-22 10:45:47 +08:00
minggo bf79a0560b issue #2462:use cocos2d-x c++ style 2013-08-08 16:31:44 +08:00
carlo morgantini b2579987e5 Merge remote-tracking branch 'cocos2d/develop' into new_develop_merge
Conflicts:
	cocos2d_libs.xcodeproj/project.pbxproj
	cocos2dx/include/ccTypes.h
	samples/samples.xcodeproj/project.pbxproj
2013-07-31 13:58:25 -07:00
Sergey Shambir d23d486720 Linux: added SDL2 backend as replacement for GLFW.
Initially planned as alternative, made replacement after discussion with
minggo.

Summary:
GLFW v.3 released in June. New version breaks API without real need:
http://cocos2d-x.org/boards/6/topics/31277
Meanwhile SDL2 is very stable. SDL2 used in Steam Runtime and will be
part of Ubuntu SDK, it's supported by other distributions.

Completed:
- OpenGL initialization and window handling with SDL
- Keyboard, IME emulation, mouse and touches support with SDL
- Window title now contains app name on Linux
- Backspace correctly handled with new backend

Note:
- SDL on X11 have no proper multitouch, but backend handles multitouch
events to support future Linux graphics.
2013-07-30 23:08:26 +04:00
carlo morgantini 8416e7cf6d Merge remote-tracking branch 'cocos2d/develop' into developNewLabelMergeDevelop
Conflicts:
	cocos2d_libs.xcodeproj/project.pbxproj
	scripting/javascript/bindings/generated
	tools/bindings-generator
2013-07-26 15:54:50 -07:00
Ricardo Quesada 8bf24f0475 ccGLXXX -> GL::xxx
Adds GL namespace. Deprecates the `ccGLFunctionName` functions. New functions are `GL::functionName`

Also, converts the class `DrawPrimitives` into a namespace
2013-07-25 18:42:53 -07:00
Ricardo Quesada 16d0b43181 Constant fixes
Director::PROJECTION_2D, 3D,... -> Director::Projection::_2D, _3D, ...
Label::TEXT_ALIGNMENT_... -> Label::HAlignment::...
Label::TEXT_VERTICAL_ALIGNMENT_... -> Label::VAlignment::...
Texture2D::PIXEL_FORMAT_... -> Texture2D::PixelFormat::...
BlendFunc::BLEND_FUNC_DISABLE -> BlendFunc::DISABLE

Also adds more constant for BlendFunc
2013-07-25 13:36:19 -07:00
James Chen a1c3631962 issue #2404: DrawPrimitives deprecated. 2013-07-25 22:38:55 +08:00
minggo 8b748e2992 issue #2430:use const member variable instead of macro 2013-07-25 21:04:32 +08:00
minggo 77afae124b issue #2430:move Texture2D enum into class 2013-07-25 19:52:44 +08:00
minggo 8dab462f6f issue #2430:move Director enum into class 2013-07-25 14:39:32 +08:00
Ricardo Quesada e0523b3438 Merge branch 'developNewLabelForRiq' into label_merge
Conflicts:
	cocos2dx/textures/CCTexture2D.h
	samples/Cpp/TestCpp/Classes/LabelTest/LabelTest.cpp
	scripting/javascript/bindings/generated
	tools/bindings-generator
2013-07-24 15:15:08 -07:00
James Chen 50ba072bac issue #2378: Setter/Getter for Director, removing CC_PROPERTY_XXX macros. 2013-07-23 15:19:26 +08:00
minggo f6cfe3007f issue #2412:fix merging conflict 2013-07-23 10:41:11 +08:00
James Chen 2aa1fae266 closed #2418: Unused spriteframes also need to be removed when purgeCachedData. 2013-07-22 18:13:13 +08:00
Ricardo Quesada 89d210bdb3 CCAssert -> CCASSERT
and other best pracitces like:

capacity and "index" are ints and not unsigned int (google's recomendation).
 It is easier to detect underflow bugs like this

plus other minor improvements
2013-07-19 22:01:27 -07:00
Ricardo Quesada 88928fff99 Merge branch 'developNewLabelMerge' into merge_new_label
Conflicts:
	cocos2d_libs.xcodeproj/project.pbxproj
	cocos2dx/textures/CCTexture2D.h
	samples/Javascript/Shared
2013-07-19 16:04:23 -07:00
James Chen 7c7d21dd03 issue #2407: more best practices fixes, more getter and const.. 2013-07-19 14:57:54 +08:00
minggo 7704ab9161 issue #2412:remove platform.cpp/.h 2013-07-19 13:42:45 +08:00
Ricardo Quesada 6e25301b43 more best practices fixes
- Adds more `const` in getters
- Overriden methods have the `override` keyword
- Reorganizes the structure of the class:
  # creators first, then constructor, destructors, init
  # then overridden methods
  # variables at the end
- removes Hungarian notation from parts of the code
2013-07-17 16:56:19 -07:00
minggo 93e75bad9f Merge pull request #3154 from minggo/add-deprecated-header
Add deprecated header
2013-07-15 03:20:32 -07:00
James Chen 759831c1d8 issue #2397: Application::sharedApplication --> Application::getInstance. 2013-07-15 16:24:42 +08:00
minggo eada29ee40 issue #2404:created CCDprecated.h and move all global functions and variables into it 2013-07-15 16:14:26 +08:00
minggo 6abe6fce78 closed #2393: fix conflicts 2013-07-12 18:04:32 +08:00
minggo 5d9fea1416 issue #2393:mark PointZero RectZero and SizeZero as deprecated 2013-07-12 14:47:36 +08:00
minggo 15096b0716 issue #2393:mark CCPointMake CCSizeMake CCRectMake as deprecated 2013-07-12 14:30:26 +08:00
minggo bb758df0d0 issue #2393:mark ccp as deprecated 2013-07-12 14:11:55 +08:00
James Chen 2c1b26acf8 issue #2397: EGLView::sharedOpenGLView() --> EGLView::getInstance() 2013-07-12 13:11:21 +08:00
Ricardo Quesada cf262c28e2 getInstance() / destroyInstance() are used...
... instead of sharedXXX / purgeXXX.
They are more C++ friendly, and also easier to remember.

common files + Mac files + iOS files + tests/samples files were updated.

The old methods are deprecated now.
2013-07-11 15:24:23 -07:00
carlo morgantini 002ae77698 new dynamic TTF label stuff 2013-07-11 14:41:03 -07:00
minggo c37af8fa77 issue #2393:mark functions in CCPointExtensions deprecated 2013-07-11 16:38:58 +08:00
Ricardo Quesada c65b6f1417 Adds const to more getters
adds `const` to more getters.
2013-07-06 22:01:21 -07:00
James Chen 0d040bae76 closed #2347: Macros like CC_KEYBOARD_SUPPORT should not be in header file. 2013-07-01 16:48:42 +08:00
Ricardo Quesada b846a3060e cocos2d-x in Mac:
Works as expected. All the projects defines CC_KEYBOARD_SUPPORT.
Either all of them should define them, or none, otherwise the vtable
will be broken
2013-06-28 19:02:10 -07:00
James Chen 93b6328303 issue #2129: Removing CC prefix for cocos2dx module. 2013-06-20 14:13:12 +08:00
James Chen c0d44cb2e4 fixed #2129: Rename m_iVar to _var, remove CC prefixes. 2013-06-15 14:03:30 +08:00
James Chen 82cd7bb01f Merge branch 'iss2284-merge-master' of https://github.com/minggo/cocos2d-x into minggo-iss2284-merge-master 2013-06-14 15:41:01 +08:00
Ricardo Quesada 98190a21c0 Actions with clone() pattern 1/3
This is the 1st patch of 3.

1)
Removes the copyWithZone() patterns.
Adds the clone() pattern instead (which is more C++ friendly)
Adds also "const" to getters.
2013-06-13 17:25:14 -07:00
minggo cd5bcb87af issue #2284: merge master and fixed some conflicts 2013-06-13 17:54:05 +08:00
James Chen 5da7a7692e Fixing a logic error in CCDirector.cpp. 2013-06-10 21:19:22 +08:00
Ricardo Quesada 428711482e Adds missing config files for CCConfiguration
...and add functionality on the Director to override the default values
from the config file.

Supported values:

 - cocos2d.x.fps
 - cocos2d.x.display_fps
 - cocos2d.x.gl.projection
 - cocos2d.x.texture.pixel_format_for_png
 - cocos2d.x.texture.pvrv2_has_alpha_premultiplied

If the "config.plist" file is not present, or some keys are not present,
the default values are going to be used

IMPORTANT:
 The folder "samples/Cpp/TestCpp/Resources/configs" needs to be added
 in the Android, Linux, Win32 projects.
 Already added in OS X and iOS Xcode projects.
2013-06-06 12:23:44 -07:00
Rene Klacan c8b4291731 keyboard support throught compiler directive 2013-06-02 04:11:43 +02:00
Rene Klacan 50ad3e1c80 KeyboardDispatcher + tests for it on linux 2013-05-31 14:29:32 +02:00
James Chen 131d97a3d6 fixed #2217: Updating the comment for FPS display by using CCLabelAtlas. 2013-05-23 16:55:53 +08:00