Commit Graph

159 Commits

Author SHA1 Message Date
Ricardo Quesada 058935aa8d Removes Hungarian notation
Removes Hungarian notation from the code.
2013-07-25 15:53:24 -07:00
Ricardo Quesada d683e10808 More constant fixes
Transition::ORIENTATION_XXX -> Transition::Orientation::XXX
Image::FORMAT_XXX -> Image::Format::XXX
Image::_function() -> Image::function() // private methods should not start with '_'
DrawPrimitives::drawColor() -> DrawPrimitives::setDrawColor()

And fixes Premultiplied Alpha in PVR v3 images
And tests are updated with the new functions
2013-07-25 14:49:43 -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
minggo 2293630335 issue #2430:move enum in ccTypes.h class 2013-07-25 18:46:43 +08:00
minggo acdd1cfe9d issue #2430:move GLProgram enum into class 2013-07-25 17:48:22 +08:00
minggo 658bffbb69 issue #2430:use upper letter for enum item in ccGLStateCache.h 2013-07-25 15:04:13 +08:00
James Chen 306587167d Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into iss2404-ext-deprecated
Conflicts:
	AUTHORS
2013-07-25 11:28:48 +08:00
Ricardo Quesada 943b805bc8 Fixes some warnings
... and updates the version to pre-alpha0
2013-07-24 14:02:36 -07:00
James Chen e0f9ac82da issue #2404: Updating ExtensionsTest/CocosBuilderTest. 2013-07-24 18:17:20 +08:00
Ricardo Quesada 1f37d4d00a More best practices fixes and other bug fixes
- Adds `CC_REQUIRES_NULL_TERMINATION` to methods that require a NULL at the end
- Removes more Hungarian notations in samples
- s/sprite/scene: fix from previous commit
- `CCLog` -> `log`
- `getLayerNamed` -> `getLayer`
- `getPropertyNamed` -> `getProperty`
- and other small fixes
2013-07-23 15:20:22 -07:00
Ricardo Quesada c158cd5be6 More best practices fixes
- Removes Hungarian notation from the CPP test (there are still some Hungarian to remove)
- Label and MotionStreak: Uses the CL() entry for the tests (lambda functions)
2013-07-22 17:25:44 -07:00
James Chen b58d18e20a More unsinged int -> int in some places where it could be difficult to find underflow bugs. And some warnings fix. 2013-07-22 14:28:19 +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
yinkaile 0470ce936b 1.Fix release CCTexture2DMutable.cpp crash
2.Change frame tween method
2013-07-19 19:02:26 +08:00
Ricardo Quesada 5d499d351d Some more changes to make the code more c++ friendly:
- nodeToParentTransform -> getNodeToParentTransform() (the same for its friends)
   - Deprecates the old methods
   - adds 'consts' to those methods
- boundingBox() -> getBoundingBox()
   - the new one is const
   - Deprecates the old method.
- Adds overrides keywords in CCNodeRGBA and CCArmature
- AffineMatrix are mutables
2013-07-16 18:16:04 -07:00
James Chen 13e939b55e Merge pull request #3157 from ricardoquesada/override_love
closed 2407: Adds more readability to the class internals.
2013-07-15 22:05:33 -07:00
Ricardo Quesada 9958e0d7f9 Adds more readability to the class internals.
Changes:
  - creator (static) methods, and singleton methods (static) are always at the top of the class
  - Constructors, destructros, and init methods comes next
  - Then the instance methods for the class
  - Then the overriden methods
  - and finally the ivars

Also, overriden methos have the "override" context keyword
2013-07-15 12:43:22 -07:00
pktangyue 6bb2d64f19 add S9CascadeOpacityAndColor test 2013-07-15 20:13:30 +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
yinkaile 680b7f1cb0 Remove vld.h 2013-07-13 22:59:21 +08:00
James Chen 4b2165e648 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into socketio 2013-07-13 19:24:41 +08:00
James Chen b5ca0b4ed5 Fixing warnings in SocketIOTest.cpp. 2013-07-13 19:21:31 +08:00
yinkaile 619a8810fe Change Physics detector 2013-07-13 19:14:30 +08:00
minggo 6abe6fce78 closed #2393: fix conflicts 2013-07-12 18:04:32 +08:00
minggo 58fe3c7563 closed #2393: fixed conflicts 2013-07-12 15:07:44 +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
Chris Hannon 126ebb888c Implements a socket.io client extension, adds a test case and updates the android makefiles.
Contains the following tasks:
-initial socket.io extension commit
-sioclientimpl subclasses websocket:delegate to respond to websocket events
-implement static connect methods and basic client creation
-move SocketIO class files into correct extension folder (network)
-create SocketIO test in TestCpp
-update project references
-add missing static modifier to connect method
-implement basic test methods
-update extensions tests with SocketIO test entry
-implement basic handshake and opensocket methods for SocketIO
-add Delegate class to handle callbacks, implement virtual Delegate methods in test
-implement socket and client registries for lookup when connecting to hosts and endpoints
-connect delegate onOpen method by separating impl creation from connection
-update test to demonstrate onOpen callback
-create send and emit methods, move SIOClient into header file, add send and emit methods to test
-implement basic socket.io message parsing
-improve logging for events and messages
-add logic to pull event name from payload
-schedule heartbeat to keep connection alive, scheduled for 90% of the heartbeat interval from the server for safety
-add onConnect handler to to catch socket.io onconnect vs websocket onopen
-add disconnect and disconnectFromEndpoint methods to properly disconnect and destroy objects
-modify SIOClientImpl to track _uri for easier lookup in registries
-connect handler for onMessage to message event from socket.io, modify onError handler to take a string instead of WebSocket error code
-create SIOEvent callback type, implement event registry in clients, add test for event registration and callback
-update SIOEvent to use std::function and c++11, utilize cocos2d CC_CALLBACK method to bind selectors, this ensures that the *this reference is properly passed
-check for connect before sending or emitting in the client, cleanup some codes
-change connect logic to reuse existing socket connections instead of opening a new one
-implements get and set Tag methods for clients for easy reference
-improve endpoint handling, add endpoint tests to test layer
-additional error handling within socket disconnect error and failure to open connection
-fixes extracting endpoint from socket.io messages (in cases of the connect message, where there is 1 less colon for the connect message to the default namespace). Also fixes connecting to the default namespace "/" in the connectToEndpoint method
-add disconnect and onClose handlers to client so that onClose is called in the delegate
-add disconnect test methods to test layers
-change c-style casts to static_casts when using a CCDICT_FOREACH
-remove some unneeded namespace completion
-add usage documentation
-add handling for disconnect from server, cleanup some codes
-update comments and documentation in the socketiotest
-update includes so the NDK doesn't complain when compiling with c++11
-add socketio.cpp and test.cpp to the android makefiles
-update test URL to my public server, test script can also be found in my repo at https://github.com/hannon235/socket.io-testserver.git

Signed-off-by: Chris Hannon <himynameschris@gmail.com>
2013-07-11 17:41:42 -04:00
James Chen 3c64bc8972 issue #2396: Updating Scale9SpriteTest.cpp. 2013-07-11 17:08:09 +08:00
pktangyue 5e8de73061 add S9FrameNameSpriteSheetRotatedSetCapInsetLater test 2013-07-11 16:09:07 +08:00
James Chen ad95ba4894 closed #2395: Adding Scale9SpriteTest for TestCpp 2013-07-11 14:07:14 +08:00
yinkaile 54e5fca2aa Bone can add a particle display as a CCNode 2013-07-10 10:00:51 +08:00
James Chen 9b9fe67d25 issue #2387: Using static_cast instead of C style cast in iteration of CCArray. 2013-07-09 14:29:51 +08:00
James Chen 85ef6b3b98 closed #2384: Using static_cast instead of C cast in ExtensionsTest.cpp. 2013-07-09 10:18:15 +08:00
Chris Hannon bba9722faa iss3102: make extension test submenu in TestCpp scrollable to access all entries 2013-07-08 16:20:24 -04:00
minggo 87125e4b2a issue #2129:use capital words for static const member variables 2013-07-08 18:11:32 +08:00
minggo 04465622b7 issue #2129:remove prefix of types in ccTypes.h 2013-07-05 16:49:22 +08:00
Ricardo Quesada 4204e8243c TestCpp for iOS uses libcocos2dx, libCocosDenshion, etc...
...as dependencies, and other minor fixes
2013-06-24 16:59:00 -07:00
James Chen dcaa55e622 Warning fixes for TestCpp. Using lambda, CC_CALLBACK_1 and clone pattern. 2013-06-21 14:15:20 +08:00
Sam Clegg 40766006bd [NaCl] Fix NaCl build which had been disabled.
Since switching to C++11 the NaCL build was disabled.
This re-enables the ARM configuration which uses a
more recent version of gcc.  This means that that NaCl
code paths will at least be test until we can find a way
to re-enable the X86 build.
2013-06-20 12:56:12 -07:00
Sam Clegg ab1243e8dd [NaCl] Disable http tests under NaCl 2013-06-20 10:56:26 -07:00
James Chen 1fb9f44d15 issue #2129: Removing CC prefix for samples module. 2013-06-20 14:17:10 +08:00
James Chen e3ed28a8fb issue #2129: no need to write namespace since we are using *using namespace cocos2d::extension::armature;*. 2013-06-20 14:02:14 +08:00
James Chen b55a0dee2b issue #2129: using cocos2d::extension::armature namespace for Armature extension. 2013-06-20 13:48:43 +08:00
Ricardo Quesada 159ef1ec68 clone() doesn't use copy constructor
... and other bug fixes
2013-06-18 15:06:53 -07:00
James Chen 2c0cc603d1 Merge branch 'master' into develop
Conflicts:
	extensions/cocos-ext.h
2013-06-18 10:46:25 +08:00
James Chen ccb67cbcb4 Template fix for iOS Template. 2013-06-17 15:54: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
minggo a221f06592 issue #2284: fix bugs after merging master 2013-06-14 14:34:50 +08:00
Ricardo Quesada 8a6d33a212 Adds CC prefix to CALLBACK()
Now it is called: CC_CALLBACK()
2013-06-13 20:36:43 -07:00
minggo cd5bcb87af issue #2284: merge master and fixed some conflicts 2013-06-13 17:54:05 +08:00
Ricardo Quesada 83b43ab93e Adds CALLBACK_0, CALLBACK_1 and CALLBACK_2
Handy macros for callbacks.
Instead of:
	std::bind(func_ptr, instnace, std::placeholder::_1)
you use:
	CALLBACK_1(func_ptr, instance)

And also removes more warnings from the tests
2013-06-11 16:30:05 -07:00
yinkaile af819c6db5 Merge branch 'master' of https://github.com/2youyouo2/cocos2d-x 2013-06-08 22:09:34 +08:00
yinkaile d29931dc4f 1.add hd resource
2.remove zobie resource
3.support frame event
2013-06-08 22:08:22 +08:00
chengstory 86f4b96f05 Merge branch 'master111'
Conflicts:
	samples/Cpp/TestCpp/proj.ios/TestCpp.xcodeproj/project.pbxproj
	samples/Cpp/TestCpp/proj.mac/TestCpp.xcodeproj/project.pbxproj
2013-06-08 20:01:25 +08:00
chengstory c2e85c1ae4 1. adds support for iOS and Mac.
2.  Modify position of some examples.
2013-06-08 17:11:11 +08:00
James Chen 93ecfbbf7e Merge branch 'master' of https://github.com/2youyouo2/cocos2d-x into nacl-fix 2013-06-08 15:42:41 +08:00
yinkaile 8ff088da53 Standardize code 2013-06-08 12:14:43 +08:00
yinkaile cba46082ce Standardize code 2013-06-08 11:48:45 +08:00
Ricardo Quesada 022dfc0acc CPP Tests migrated to the new C++11 API
Many tests were converted to the C++11 API
and some tests were also simplified by using the "CL" macro
instead of the "CF" macro.
2013-06-07 17:21:11 -07:00
yinkaile 7c924c714f Standardize code 2013-06-07 22:56:54 +08:00
yinkaile 2418afc96d conform declare and initialize order 2013-06-07 16:13:08 +08:00
James Chen 942c797749 Removing unused codes. 2013-06-07 15:39:18 +08:00
yinkaile 10ed7ebdf4 merge newest version 2013-06-06 16:22:58 +08:00
yinkaile 3cfba7bc9a Merge branch 'master' of https://github.com/cocos2d/cocos2d-x
Conflicts:
	extensions/Android.mk
	extensions/proj.win32/libExtensions.vcxproj.filters
	samples/Cpp/TestCpp/Android.mk
	samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp
2013-06-06 12:35:18 +08:00
yinkaile 245b0395b1 1.upload CCArmature 2013-06-06 12:02:54 +08:00
chengstory ca3dc682ea 1. change “bool isEnabled()” to "bool isEnabled() const".
2.  dolete license.
2013-06-05 15:05:49 +08:00
chengstory a5f8e2c27e no message 2013-06-04 17:54:05 +08:00
chengstory cfb424a6c9 1. add Component struct. 2013-06-04 17:38:43 +08:00
James Chen 0ca86db0ff fixed #1647: Renaming enumerations to Cocos2d-x style. ERROR and ERROR_TIMEOUT is defined as macros on Windows, fuck it. 2013-06-03 10:12:55 +08:00
James Chen f2f0f031c7 fixed #1647: Renaming enumerations to Cocos2d-x style. ERROR and ERROR_TIMEOUT is defined as macros on Windows, fuck it. 2013-06-03 09:55:43 +08:00
James Chen 4b8f76c903 WS_ERROR -> ERROR, WS_STATE -> STATE. 2013-06-02 18:56:49 +08:00
James Chen cedb427a6e fixed #1647: Adding WebSocket support for Cpp and JSB.
Conflicts:
	extensions/proj.win32/libExtensions.vcxproj
	extensions/proj.win32/libExtensions.vcxproj.filters
2013-06-02 18:55:57 +08:00
James Chen 8e15cdf5fd WS_ERROR -> ERROR, WS_STATE -> STATE. 2013-06-01 19:51:10 +08:00
James Chen 05a88c89dc fixed #1647: Adding WebSocket support for Cpp and JSB. 2013-05-31 23:13:03 +08:00
Lee, Jae-Hong 47fac0ed98 Implement CCEditBox for Tizen. (develop branch) 2013-05-26 20:40:13 +09:00
samuele3hu 338c7c8d67 issue #2103 add more test lua 2013-05-24 11:42:27 +08:00
James Chen dea45e8e79 fixed #2150: Adding tests for this issue and fix compilation error of CCScale9Sprite. 2013-05-13 17:57:30 +08:00
minggo ee8ec25f6a Merge pull request #2541 from j4m3z0r/emscriptenate
Compile for Emscripten in asm.js mode
2013-05-08 18:53:35 -07:00
James Gregory 25bded7faf Now validates as asm.js: Disable HttpClient, pthread_cond_signal and eglReleaseThread in Emscripten. 2013-05-07 17:25:39 -07:00
James Chen 912905054e fixed #2123: Refactoring network extension, fixing unlikely memory leaks, adding PUT/DELETE methods.
Merge branch 'curl_raii' of https://github.com/sergey-shambir/cocos2d-x into sergey-shambir-curl_raii

Conflicts:
	extensions/network/HttpClient.cpp
	samples/Cpp/TestCpp/Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp
2013-05-07 15:37:25 +08:00
James Chen 140927494a Updating http test url, removing www prefix. 2013-05-07 15:13:55 +08:00
Hojin Choi 8b9644150d Changes samples' function prototypes to apply newly introduced callback type. 2013-04-28 23:42:31 +09:00
Sergey Shambir 8507f7a386 network: Added PUT and DELETE request types 2013-04-21 20:54:52 +04:00
James Chen a5d78830db fixed #1860: onNodeLoaded will be called twice if ccb was added as a CCBFile. 2013-04-15 10:39:44 +08:00
James Chen 6e9fcf8c05 fixed #2048: Adding test case for variable cell sizes in CCTableView. 2013-04-10 16:38:00 +08:00
Sergej Tatarincev 202edc1597 CCEditBox test for separate font name/size setters 2013-04-03 17:20:01 +03:00
James Chen e2e9bc8ce0 Fixing memoryleaks. 2013-03-21 09:00:55 +08:00
James Chen aa5f7ffb6a Updating project setting of testcpp for Marmalade. 2013-03-19 17:46:49 +08:00
James Chen 8b466f12a2 fixed #1838: Adding test for the new feature(Timeline callback & playing effect) of CocosBuilder. 2013-03-19 16:33:23 +08:00
Sam Clegg 863286b0b9 Fix warning in linux build.
Also, define _DEBUG rather then DEBUG in linux and nacl makefiles
by default, and limit the command line definions that are used
when building Box2D.
2013-03-12 16:59:22 -07:00
Asad ur Rehman c1a8059998 Added CCNotificationCenter::removeAllObservers
This is a helper method that removes all observers with a particular
target. It can be used in destuctors to ensure no observers trigger
callbacks on objects that no longer exist.
2013-03-10 19:34:01 +05:00
Sam Clegg 38878b084b Fix all compiler warnings produced by gcc.
This allows the linux and NaCl builds (and perhaps others)
to be compiles with -Wall and -Werror, and it makes the build
output much less noisy.
2013-03-05 17:01:00 -08:00
Sam Clegg 33c422d1d5 Add new port: Native Client 2013-03-02 12:15:24 -08:00
James Chen d572a53a1d Merge pull request #2050 from dumganhar/tableview-touch-fix
fixed #1751: Clicking outside of CCTableViewCell will also get response when container size is smaller than view size.
2013-02-26 06:56:08 -08:00
James Chen 87935ac436 tableview touch area fix. 2013-02-26 19:59:14 +08:00