* 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.
* Add new methods to get the number of actions running in a
given node with a specific tag.
This is useful for cases that we want to know how many
animations with a **specific** tag is running in our target.
For example:
auto tag1Count = this->getNumberOfRunningActionsByTag(kMyTag1);
auto tag2Count = this->getNumberOfRunningActionsByTag(kMyTag2);
While this could be achieved (more or less) with callbacks
to increment the tagCount at start of action and decrement
at the end the proposed API is much more concise and less error
prone.
* Replace the old C casts to static_casts.
As discussed in #16789 issue thread @minggo asked
to change the old style of cast to newer, more safer
static_casts.
* Add the required parenthesis and normalize the spaces.
Normalize all the static_cast<Action *> to static_cast<Action*>
some places we have spaces, other places haven't.
Fix the missing parenthesis.
* SENSITIVE doesn't imply password, fixes crash on static cast in
* onTextChanged
* Fix type fontName instead of pFontName
* Set attributes that affect text content before setting initial text
In the case of a simple MTL file such as
newmtl cube
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka cube.png
map_Kd cube.png
The entire istringstream would be consumed by LoadMTL and result in a 'not found' error due to the null check being in the wrong place
* 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
cc.Ray:intersects now returns two results, an indication of hit or
not, plus the distance along the ray. The function can still be called
expecting a single argument and hence is backward compatible.
Also correct the debug error message
* tileGid may overflow when use horizontal flip
kTMXTileHorizontalFlag = 0x80000000
when use horizontal flip, gid will bigger chan 0x7FFFFFFF
* use unsigned int to convert string to gid
* fixed#16735: [native] The behavior of (setRotation + setSkewX) is wrong.
Since I removed some logic, this patch may also improve a little bit performance.
* Adds test case for issue #16735
* fixed#16754: [android] Background music which is playing could not be paused while game enters background.
* Updates a comment of cocos/audio/android/AudioEngine-inl.h
* 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
* Rejuvenate android-build.py
- replace deprecated OptionParser with ArgumentParser
- PEP8
- better shebang
- main() function
* Fix android-build.py
- resurrect '-p' parameter to be able to specify android platform in
cocos console as '--ap' parameter
- correct usage message
- fix some misprints
* android_build.py: stricter error handling and better handling of duplicate targets
- handle duplicates like that './android-build.py cpp cpp'
- don't default to debug if some incorrect build mode passed, raise
* 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
* 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
* 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.
* Remove undrawn quads from the skybox mesh
CCSkybox had been implemented using a combination of two
inconsistent techniques. The rendering was being achieved via use of
the vertex shader's inherent support for cubemaps. That technique requires
only a single screen-covering quad, but the implemtation defined a cube.
Defining a cube mesh would be appropriate if one were simply mapping the
cubemap's 6 textures to faces, but is unnecessary if using the shader's
cubemap feature.
Not only was the use of a cube mesh unnecessary, but the particular way
the cube was defined and used meant that only one face would ever
contribute to the rendering. One of the other faces would always be culled
and the other four would be viewed edge on, mapping the the infinitesimally
thin lines defining the edges of the screen.
This commit simply removes the never-rendered faces, and adds comments
explaining the technique.
* Within test code, remove setScale calls applied to skyboxes.
A Skybox is defined in such a way that it's position, rotation and
scaling has no effect on it's rendering, so setScale has no effect.
The calls are removed from test code to avoid confusing anyone using
it as a template for their own programs.
* Make the Skybox correctly account for the camera's fov
The Skybox does not use the model/view and projection matricies. Instead
a single quad that maps exactly to the screen is rendered and the camera's
world matrix is passed into a shader that renders using cubemap lookups.
The way that works hardwires the fov to 90deg in both the horizontal and
vertical. That shows up particularly badly when the camera is pointed
directly downwards and rotated: the image deforms as it rotates.
This commit corrects the problem by using scaling factors from the
camera's projection matrix to prescale the matrix passed into the shader.