Commit Graph

679 Commits

Author SHA1 Message Date
okamura d13d55c23f Fix CameraBackgroundColorBrush cannot use alpha (#18281) 2017-10-20 09:43:45 +08:00
xiaoyur347 617009f1cf fix CCTextureCache addImageAsync race condition (#18366) 2017-10-16 00:58:29 -05:00
minggo 2fbbdef58d do not initialize VBO with big size for performance issue on some Android devices (#18060) 2017-07-13 09:52:07 +08:00
Wilson E. Alvarez 90af809b89 No need to get the Configuration and Director instances more than once in CCRenderer.cpp (#17978) 2017-06-26 13:52:49 +08:00
minggo 61839e7a5b fix warnings (#17970) 2017-06-23 17:46:37 +08:00
minggo 2b3baf4517 fix precision issue (#17908)
* fix precision issue

* fix shader error on mac
2017-06-12 08:57:40 +08:00
minggo 54962ee509 LayerRadialGradient works on mac and iOS (#17826)
* LayerRadialGradient works on mac and iOS

* fix radius

* finish LayerRadialGradient and add test case

* use local coordinate in shader

* adjust function attributes

* implement getCenter()

* add some comments
2017-05-22 13:42:00 +08:00
minggo 1f57542d68 match the logic to unbind vao (#17628) 2017-04-01 15:37:22 +08:00
CocosRobot 8fbf04ee28 Updates license year. (#17363) 2017-02-14 14:59:12 +08:00
CocosRobot d07794052f Update license to 2017 (#17362)
* Typo: CopyRight -> Copyright

* Copyright update: chukong-inc.com -> Chukong Technologies Inc.

* [js files] Copyright update: 2014 -> 2014-2017

* [cpp files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2015 -> 2015-2017

* [js files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2016 -> 2016-2017

* Copyright update: 2013 -> 2013-2017

* Copyright update: 201?-201? -> 201?-2017

* License year fixes.

* Liscene year fix in CCRay.cpp

* Updates license years in CCGLProgramState.h & CCGLProgramStateCache.h
2017-02-14 14:36:57 +08:00
James Chen 27e2012cf1 fixed #16871: Material second shader texture will be lost when removeUnusedTextures is invoked. (#16884)
* fixed #16871: Material second shader texture will be lost when removeUnusedTextures is invoked.

* issue #16871: Adds test case for issue #16871.

* issue #16871: Checks whether current texture is the same as which is passed in. And more comments for release stuffs.

* Removes unused nullptr check of _value.tex.texture

CC_SAFE_RETAIN will check it.
And some indention fixes.
2017-02-10 14:01:26 +08:00
Wilson E. Alvarez b672b94edc Removed unnecessary assignments (#17328) 2017-02-09 10:57:01 +08:00
minggo 828fabdeb3 add uniform for mobile too (#17324) 2017-02-08 16:39:06 +08:00
Dale Stammen c0575311b7 V3 win10 websockets (#17310)
* add openssl to libwebsockets

* updated win10 version to v3.15

* clear any glErrors created by any not found uniforms
2017-02-08 09:44:06 +08:00
mogemimi 75d2e76095 Fix minor typos in comments and docs (#17294) 2017-02-07 09:41:52 +08:00
mogemimi e2ad8946cb Replace unsigned int with size_t to avoid implicit conversion (#17297) 2017-02-07 09:41:19 +08:00
子龙山人 193518ed8b add opacity support to DrawNode (#17248) 2017-02-06 15:34:14 +08:00
minggo d37ac4007b fix memory leak (#17284) 2017-02-06 15:11:42 +08:00
minggo c4712936f3 fix the bug that ect1 texture lost on android (#17278)
the commit do the following things:
- reload ect1 related shaders when comes from background
- reload alpha texture when comes from background
2017-02-04 18:00:21 +08:00
j-jorge c616d6d9ff Compilation fix (#17209)
* Fix various compilation issues.

Mostly errors on field initialization order but also missing files
in CMakeLists and missing include directives.

* Fix compilations issues with GCC 6.2

* Fix gitignore libs/ entry to not ignore the Android external libraries.
2017-02-04 09:46:32 +08:00
j-jorge 6bbf01537d Allow to unbind asynchronous texture loading callback with a custom key. (#17206)
* Allow to unbind asynchronous texture loading callback with a custom key.

In order to unbind the callback passed to
`cocos2d::TextureCache::addImageAsync(path, callback)`, one has to
call `cocos2d::TextureCache::unbindImageAsync(path)`. In the cases
where the loading of the same texture is requested from several sources
simultaneously, then none of the source can unbind its own callback
unambiguously.

This commit adds an overload of the `addImageAsync` function taking an extra
argument identifying the callback, thus allowing to unbind it unambiguously
in cases where the loading of path is requested by several sources
simultaneously.

* Add a test case for TextureCache::addImageAsync with a custom key.
2017-02-04 09:38:54 +08:00
mogemimi 87c29759f8 Fix typos in local variables (#17236) 2017-01-20 09:58:29 +08:00
mogemimi 8b9c89f6a9 Fix typos in comments and strings (#17201) 2017-01-18 15:41:18 +08:00
minggo 3bcf8fc48a use std::stable_sort to keep order (#17156) 2017-01-11 15:47:36 +08:00
James Chen 77cf6de2e5 [label] Fixes shadow is drawn incorrect while also enabling outline. (#17024) 2016-12-16 14:56:36 +08:00
minggo b288821bdd use GLsizei to avoid overflow (#16962) 2016-12-06 23:05:56 -08:00
Wilson E. Alvarez 3056269531 Various small performance tweaks (#16881)
* These variables can be accessed by reference

* Assign values in initialization list

* _range can also be in initialization list

* Prefixed ++ and added 'auto' to loops

Also removed extra whitespace

* Prefixed ++/--, and changed for-loop implementation to use 'auto' on some loops
2016-11-22 09:54:04 +08:00
pyrosphere 663bb4d7ed No CC_UNUSED_PARAM (#16812)
* Added -Wno-unused-parameter and removed all uses of the CC_UNUSED_PARAM macro

* Commented unused parameter names in .cpp files which previously used CC_UNUSED_PARAM

* Reverted -Wno-unused-param flag.
Moved deprecated touch methods definitions to .cpp file.
Commented more unused parameter names.

* Fixed some errors and warnings caused by the previous commit.

* Commented remaining unused parameter names in .cpp files.

* Fixed unused parameter warnings in headers.

* Fixed some more unused parameter warnings.

* Fixed some more unused parameters warnings.

* Fixed mistake in previous commit, missing ComAudioReader:: in method. Other warnings.

* Fixed build errors.

* Added missing file to CMakeLists
2016-11-16 09:48:37 +08:00
Ce Zheng 4b3525f7a8 use STL emplace when possible (#16815)
* replaced some unordered_map::insert(std::make_pair(foo, bar)) with unordered_map::emplace(foo, bar)
* replaced some vector::push_back(std::make_pair(foo, bar)) with vector::emplace_back(foo, bar)

The old way will construct a std::pair first then call move constructor
when putting it into the container, while using emplace will construct
the pair in-place in the container. Also, the emplace way is shorter &
more concise.
2016-11-08 11:50:00 +08:00
James Chen f32effeb96 More: Uses c++11 multi-line string literal (#16803) 2016-11-04 09:36:26 +08:00
Wilson E. Alvarez d5dacd4f0e Use C++11 multiline string literal instead (#16765)
* Undo pull request #16742 while keeping fixed indentation on ccShader_UI_Gray.frag

* Removed unnecessary whitespace

* Switched implementation to C++11 string literal

Thanks to stevetranby for the suggestion
2016-11-02 14:13:34 +08:00
SongChengJiang af8b9cc47c Support MultiView matrix array (#16723)
* Support MultiView matrix array

Support MultiView matrix array and add new interface in GLProgram to
support shader header definitions.

* support getMatrixStackSize

* optimize code

* remove indents

* rename resetMatrixStack(unsigned int stackCount)

* Add document to interfaces

* Supplement document of render interface
2016-10-28 09:33:31 +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
James Chen 58acca108b Removes unused 'return' letter in builtin shaders. (#16742)
* Removes unused 'return' letter in builtin shader.

* Updates indention of ccShader_UI_Gray.frag.
2016-10-26 16:03:08 +08:00
James Chen a5fdc07fca Fixes label wrong blending and improves performance while enabling outline. (#16717) 2016-10-19 10:19:14 +08:00
James Chen b7d6e427e0 issue #16661: Replace c style uthash with std::unordered_map<K, V> in CCFontFNT.cpp (#16662)
* issue #16661: Replace c style uthash with std::unordered_map<K, V> in CCFontFNT.cpp

* issue #16661: Removes unused include "base/uthash.h" in CCGLProgram.cpp.
2016-10-17 13:53:54 +08:00
mogemimi fe52c5fa0a Fix typos in comments and strings (#16708) 2016-10-17 10:12:54 +08:00
子龙山人 c3bbbb6cb2 Refactoring ui related code and fix label atlas and BMFont rendering issue with ETC1 texture format (#16615)
* refactoring ui related code

* fix label bmfont/charmap etc drawing

* make code more robust
2016-09-30 09:42:21 +08:00
James Chen 189ffc4e27 Minor fix for TextureCache::addImage(image, key). (#16613)
* Removes insignificant log: `prevents overloading the autorelease pool`
* Removes unused retain -> autorelease stuff
* Checks the return value of `texture->initWithImage`, if it returns false, texture should be released and set to nullptr.
* More specifc log output in TextureCache::addImage(image, key)
* Checks arguments validation for VolatileTextureMgr::addImage
2016-09-27 15:10:16 +08:00
TankorSmash f93c6edb1f tidy up TextureAtlas::resizeCapacity (#16588)
My intent is to reduce clutter and improve readability, so that going forward it's a little easier to edit this.

No behaviour change.
2016-09-20 20:31:24 -07:00
mogemimi 2b9ac2c950 Remove redundant semicolons (#16558) 2016-09-12 09:45:34 +08:00
mogemimi eca7b2392d Remove unnecessary inline keywords (#16562) 2016-09-12 09:44:21 +08:00
Allen Lee 7c298bdcd7 misspelling check on cocos directory (#16522)
Misspelling fix on some comments,
cocos/editor-support/cocostudio/CSParseBinary_generated.h
fix misspelling postion -> position
2016-09-06 10:14:14 +08:00
minggo 04fd2b16b2 merge v3.13 back to v3 2016-08-29 11:57:13 +08:00
Ricardo Quesada 016e7b0dfc fix: release texture in RenderState (#16396)
memory leak fixed in RenderState

fixes github issue #16155
2016-08-19 00:22:57 -07:00
Ricardo Quesada 3d75750728 resets bindBuffer after using it (#16342)
fixes github issue #14711
2016-08-11 08:32:09 -07:00
Ricardo Quesada f7464f8de5 fix: TriangleCommands with custom uniforms can be batched (#16329)
* fix: TriangleCommands with custom uniforms can be batched

TriangleCommands with custom uniforms can be batched together.

This improves the performance when using custom uniforms without
adding any penalties when not using them

Github issue #16224

* better tests
2016-08-07 14:51:02 -07:00
James Chen b135d512d2 Update copyright to 2016. (#16311) 2016-08-05 09:42:15 +08:00
halx99 73f80f4c73 #Make etc1 alpha support ok for ProgressTimer (#16296)
* #Make etc1 alpha support ok for ProgressTimer

* #fix issues

* Add comment
2016-08-03 14:29:34 +08:00
mogemimi c03dd85c3f Remove redundant includes (#16285) 2016-08-01 10:22:35 +08:00