Commit Graph

37 Commits

Author SHA1 Message Date
yahont 0c664ebc99 some warnings fixed: unused variables, signed-unsigned comparison (#16878) 2016-11-21 15:03:41 +08:00
minggo 8460fb53e7 remove duplicate codes (#16860) 2016-11-18 09:27:37 +08:00
Wilson E. Alvarez c0e1e91373 Performance tweak: Use range-based for-loops and allocate std::vector size() and *end() on the stack where favorable. (#16716)
* Use range-based for-loops and allocate std::vector size(), end(), cend(), rend(), crend() on the stack where favorable.

Other minor trivial changes were applied.

* Fixed Android compilation error

* Fixed windows-universal compilation error
2016-10-27 15:10:24 +08:00
Ricardo Quesada 323ea7c0d4 Sprite scale9 (#16702)
* Adds slice9 support for Sprite.

how to use it:

// points coords
sprite->setCenterRect(Rect(x,y,w,h));

// normalized coords
sprite->setCenterRectNormalized(Rect(x,y,w,h));
starts scale9sprite in sprite

more slice 9 changes

sprite 9 slice works?

kind of works

correct anchor point

slice 9 works, at least with non-rotated atlases

streched works ok

better Y invert code.

cleaner, compatible with the previous code

yay, scaling workings...

need a better api now

sets scale correctly

yay! works as expected!

more fixes and tests

better test for box

setContentSize() changes size in non-9-slice mode sprites as well

setCenterRect() -> setCenterRectNormalized()

yet another test

adds setPositionNormalized()

adds setCenterRect() tests

remove devel team from xcode

tests: add one more tests

fun test!

improved test

yet another test for slice 9

* fixes anchorPoint issues

* adds documentation

* fix: using top-left coordinate for setRect

* sprite: fixes related to scale9 and tiled

* Sprite: slice 9 fixes

works Ok with rotated frames
uses `setCapInsets` instead of `setCenterRect` to be more familiar
with `UIScale9Sprite`

* fixes js and lua bindings for Autopolygon
2016-10-26 18:45:40 -07:00
mogemimi dde86b404a Remove unused local variable (#16698) 2016-10-14 17:48:00 +08:00
Wilson E. Alvarez cdee1e11de Performance tweak: use range-based for-loops instead of iterator-based for-loops. (#16642)
* Use ++ prefix instead for non-primitive data types in CCAutoPolygon.cpp

* Use ++ prefix instead for non-primitive data types in SimpleAudioEngine.cpp

* Use ++ prefix instead for non-primitive data types in CCNodeLoaderLibrary.cpp

* Use ++ prefix instead for non-primitive data types in CCActionManagerEx.cpp

* Use ++ prefix instead for non-primitive data types in CCDataReaderHelper.cpp

* Use ++ prefix instead for non-primitive data types in HttpClient-android.cpp

* Use ++ prefix instead for non-primitive data types in CCDevice-linux.cpp

* Use ++ prefix instead for non-primitive data types in ScriptingCore.cpp

* Switched implementation to range-based for loops

* Added readability, fixed loop in CCDataReaderHelper.cpp

Thanks to Dimon4eg for the code review.
2016-10-11 10:59:44 -07:00
James Chen b135d512d2 Update copyright to 2016. (#16311) 2016-08-05 09:42:15 +08:00
mogemimi 2650fd1afd Add missing float suffix to avoid -Wdouble-promotion 2016-07-04 23:12:45 +09:00
mogemimi f0028e5459 Fix unused variable warnings when compiling release mode 2016-06-20 09:23:42 +09:00
Ricardo Quesada 906967c53a fix: make it compile on iOS and Mac 2016-05-25 20:00:48 -03:00
Dale Stammen 26781ee592 fixed array overrun in triangulate() 2016-05-25 10:14:09 -07:00
Ricardo Quesada 9ad3db0635 fix: make PolygonCode cleaner
not sure if this fixes the bug, but it makes the interfaces cleaner.

Github issue #15154
2016-05-24 20:57:40 -03:00
mogemimi 948f64631f Use const references whenever possible 2016-05-17 13:17:56 +09:00
minggo a5602cc732 merge v3.11 back to v3 2016-05-04 16:02:23 +08:00
zilongshanren 482788c933 Add tizen support (#15518)
* add Tizen Support

* fix linter error

* fix tizen audio engine lua bindings config
2016-04-28 09:49:55 +08:00
Xpol Wan 810e855f44 Fixes some integer cast warnings. 2016-04-18 16:01:19 +08:00
Xpol Wan 90456d29ba Fixes 1605 include path in 541 files
using the tools/coding-style/include-linter.py with -f options.
2016-03-20 21:53:44 +08:00
mogemimi 2a8d84e7f9 Remove unnecessary const from return types 2016-02-29 16:48:07 +09:00
mogemimi b0c4adcbd0 Fix method name spelling in AutoPolygon 2015-12-23 19:07:03 +09:00
Wenhai Lin 4fa58602a8 Adds `std::nothrow` to the `new` statements 2015-12-16 14:02:55 +08:00
zilongshanren ccf4cb5a74 improve scale9sprite 2015-10-29 10:41:58 +08:00
Martin Taylor 62e36e8006 fix typos and syntax error. A thorough check by tool VSSpellChecker. 2015-09-22 16:08:23 +08:00
fusijie 223d5a7a5c fix copy construct & assignment operator memory leakage. 2015-08-18 14:48:16 +08:00
fusijie dcef1e9d31 fix polygon sprite setflipped bug. 2015-07-31 15:49:44 +08:00
samuele3hu 17b1dee363 Merge branch 'fix_spritepolygon2' of https://github.com/Wu-Hao/cocos2d-x into v3_update_spritepolygon 2015-06-11 14:39:35 +08:00
samuele3hu 1b20e463d8 Update the Lua binding about the Polygon and update the test case. 2015-06-11 14:38:38 +08:00
Jacky a32fec8471 change clipper version to 6.1.3. 2015-06-11 10:45:37 +08:00
Jacky 4b5bcc06a1 remove draw points and add expand precision. 2015-06-10 18:54:53 +08:00
Jacky 88b3fc3c7e fix memory leakage about operation= 2015-06-09 18:45:55 +08:00
Jacky 74aed5ae85 fix on the android. 2015-06-09 13:47:29 +08:00
Jacky 562d4b9a78 fix on the windows. 2015-06-09 11:23:37 +08:00
WuHao 2650de030c modified tests to show current epsilon 2015-06-08 15:08:16 +08:00
Jacky 3e62dd0473 remove unused file and code. 2015-06-06 13:31:25 +08:00
Jacky afa422d898 fixed copy constructor and operation = bug. 2015-06-04 18:27:58 +08:00
WuHao 0a51c9bd27 Finished AutoPolygon and Sprite 2015-06-04 15:43:31 +08:00
WuHao 3c5326ba1f removed spritePolygon, merge into sprite and draft of AutoPolygon 2015-06-02 10:10:09 +08:00
Jacky 8df4920f6e fixed file name. 2015-05-29 15:03:36 +08:00