Commit Graph

933 Commits

Author SHA1 Message Date
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
mogemimi 5b8919829c Fix typos in local variables (#16712) 2016-10-20 18:17:37 +08:00
Paul Gardiner 6b27f014fc Correct the Skybox fov (#16655)
* 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.
2016-10-17 13:46:26 +08:00
mogemimi 63b3043dc0 Remove extra semicolon after member function definition (#16595) 2016-09-20 14:43:48 +08: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
James Chen b135d512d2 Update copyright to 2016. (#16311) 2016-08-05 09:42:15 +08:00
mogemimi 093ef3a14f Fix typos in variable names 2016-07-26 04:06:01 +09:00
halx99 bf996c5bac Add ETC1 builtin alpha support. (#16118)
* Add ETC1 builtin alpha support.

* Rename setETC1AlphaFileEndix to setETC1AlphaFileSuffix

* Check whether etc1 alpha suffix is empty

* fix Code ident & Add etc1 alpha test case to SpriteTest.

* Remove unused ETC1AA shader programs

* Fix all review issues and endl issues

* Add a new TriangleCommand::init() with Texture2D* instead of GLuint textureID

* #fix issues
2016-07-25 17:31:54 +08:00
mogemimi b9c78ac41c Use std::abs to avoid overhead of casting float to double 2016-07-13 00:55:11 +09:00
mogemimi 7531c5156b Fix documentation when compile with -Wdocumentation and Clang 2016-07-10 17:38:32 +09:00
minggo 4e125d84a4 fix compiling and linking error with ndk r12b 2016-07-08 15:29:35 +08:00
mogemimi 2650fd1afd Add missing float suffix to avoid -Wdouble-promotion 2016-07-04 23:12:45 +09:00
mogemimi 2443e09d29 Fix typos and other mistakes in docs 2016-07-04 00:42:10 +09:00
mogemimi c0f2194961 Fix some minor typos in local variable names 2016-06-29 11:04:11 +09:00
mogemimi cbc0612306 Use nullptr instead of 0 or NULL 2016-06-23 12:39:23 +09:00
mogemimi a348cbda8b Move StringUtils functions from deprecated header file to ccUTF8.h (#15835)
* Move StringUtils functions outside of deprecated header

* Replace deprecated headers with 'base/ccUTF8.h'
2016-06-15 15:01:26 +08:00
mogemimi fc6c612c4c Remove duplicate header includes 2016-05-26 23:25:44 +09:00
Ricardo Quesada 1a7c22bd97 Merge pull request #15594 from yutaka-takeda-drecom/fix/sprite3d_singlesprite_bug
CCSprite::createNode bug fix.
2016-05-26 08:59:46 -03:00
mogemimi 948f64631f Use const references whenever possible 2016-05-17 13:17:56 +09:00
Huabing.Xu e8acf38212 fix animate 3d bug 2016-05-09 15:21:19 +08:00
TAKEDA Yutaka d17fdfe3cc CCSprite::createNode bug fix. 2016-05-09 15:42:39 +09:00
minggo 86df9b535a Merge pull request #15493 from njh0602/somefix
Renamed ignoreAnchorPointForPosition()
2016-04-26 11:41:09 +08:00
mogemimi d2c46167c3 Fix compiler warning C4804 under Visual Studio 2016-04-25 10:46:33 +09:00
NamJunHyone 401f3a84ac Renamed ignoreAnchorPointForPosition() 2016-04-22 21:36:02 +09:00
mogemimi a3ad4cddf8 Fix warnings about signed/unsigned mismatch 2016-04-22 12:20:05 +09:00
tomi-payne fbadcf188a Update CCSprite3D.cpp
Fixed Sprite3DCache::removeSprite3DData error
2016-04-19 10:11:29 +08:00
Steve Tranby 24fd25e143 Iterator erase pattern 2016-04-01 18:29:21 -06:00
Xpol Wan e7864cdb89 Removed unnecessary search paths. 2016-03-22 16:04:12 +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
Wenhai Lin 4992037c5c Avoid creating temporary string objects 2016-02-03 23:12:37 +08:00
James Chen b04e4754d7 Refactor CCBundle3D, remove wrong use of getDataFromFile. _jsonBuffer is std::string, _binaryBuffer is Data instance now. 2016-01-15 00:55:10 +08:00
pandamicro 022bcc24f1 Merge branch 'v3.10' of github.com:cocos2d/cocos2d-x into v3
Conflicts:
	cocos/scripting/js-bindings/manual/chipmunk/js_bindings_chipmunk_manual.cpp
	cocos/scripting/js-bindings/manual/component/CCComponentJS.cpp
	cocos/scripting/js-bindings/manual/js_bindings_opengl.cpp
2015-12-20 22:56:33 +08:00
XiaoYang 593a619dc8 Merge pull request #14715 from liamcindy/v3_textureCache
update for 3D object render, revert old changes
2015-12-18 21:22:31 +08:00
Liam fb312a761c update for 3D object render, revert old changes 2015-12-18 11:23:33 +08:00
Wenhai Lin 4fa58602a8 Adds `std::nothrow` to the `new` statements 2015-12-16 14:02:55 +08:00
XiaoYang d904246aa8 Merge pull request #14613 from super626/v3
fix 3d model bug
2015-12-14 10:04:25 +08:00
mogemimi f280a31323 Fix typo in documentation and comments 2015-12-09 01:48:24 +09:00
yangxiao 6e1f38fdc4 fxi model bug 2015-12-08 16:32:06 +08:00
pandamicro 6ff2586f26 Merge pull request #14574 from super626/v3
Fix Sprite3D::setMaterial when multiple meshes exist
2015-12-04 17:38:56 +08:00
Ricardo Quesada f6c2758801 Merge pull request #14409 from xiaofeng11/v3_combine_opengl
Combine Studio change for openGL related operation
2015-12-03 23:03:40 -08:00
yangxiao 8d546828f4 fix Sprite3D::setMaterial 2015-12-04 10:54:43 +08:00
Shun Lin d0ce2473a1 Merge pull request #14499 from xiaofeng11/v3_combine_safety
Change ASSERT to safety mode
2015-12-04 00:04:36 +08:00
Liam 07bc48c1b8 revert glprogram 2015-12-03 16:29:02 +08:00
yangxiao ebd5c1cca7 resolve conflict and fix checktexture bug 2015-12-02 11:26:05 +08:00
xiaofeng11 18666a9b41 Merge pull request #14393 from xiaofeng11/v3_combine_3d
Combine Studio change for 3d components
2015-12-02 09:47:12 +08:00
yangxiao 54e13c3acd update comment 2015-12-01 17:47:34 +08:00
yangxiao 23f03bc65f update comment 2015-12-01 10:47:25 +08:00
yangxiao 11f1bd6e28 builtin material normal map support 2015-12-01 10:37:53 +08:00
Liam 4d379ed9bd revert ccplane 2015-11-30 14:53:37 +08:00
Liam e0349ae975 update sprite 3d test 2015-11-30 14:48:19 +08:00
XiaoFeng 71871bacf9 Add aabb dirty mark when load from file 2015-11-27 15:53:26 +08:00
XiaoFeng 2d28b78e41 Add 3 missing class export
Change clearShader logic.
2015-11-27 14:58:18 +08:00
XiaoFeng a61fe711e2 Update 2015-11-27 14:01:43 +08:00
XiaoFeng f5f09133e6 Change ASSERT to safety mode 2015-11-26 16:49:01 +08:00
XiaoFeng 09606e96cd Add comment for new function 2015-11-25 11:33:24 +08:00
XiaoFeng d0cd640ac8 Update 2015-11-25 11:15:17 +08:00
songchengjiang 9241797acb support normal mapping material 2015-11-25 10:45:03 +08:00
XiaoFeng 722f20c4b6 Update implement remove condition macro check. 2015-11-24 18:29:58 +08:00
yangxiao 1ac82fa273 fix terrain ray trace bug when there is offset 2015-11-24 15:13:52 +08:00
XiaoFeng eb644ee79f Combine Studio change for 3d components 2015-11-16 15:05:43 +08:00
yangxiao 39a6f1e8f1 char* to string 2015-11-12 18:08:29 +08:00
yangxiao 3016bf696a fix updateVerticesForLOD 2015-11-05 15:18:46 +08:00
yangxiao 16a79ed9df function genMaterial keeps old state block 2015-11-04 11:10:28 +08:00
yangxiao 11f5e6cf96 setGLProgramState should not modify state block 2015-10-29 14:22:13 +08:00
yangxiao a4d67867d7 check light enable or not when switching shader 2015-10-20 15:11:39 +08:00
yangxiao d6eb1b938f correct spot light init value 2015-10-08 11:27:02 +08:00
Martin Taylor 62e36e8006 fix typos and syntax error. A thorough check by tool VSSpellChecker. 2015-09-22 16:08:23 +08:00
yangxiao 36d4f5564d merge cocos 2015-09-18 14:08:33 +08:00
pandamicro 3f5df0ccc3 Merge pull request #13647 from super626/motionstreak3d
Motionstreak3d
2015-09-18 11:59:33 +08:00
yangxiao 6f1b04fd89 merge cocos 2015-09-18 09:37:26 +08:00
yangxiao 256832d000 replace genGLProgramState to genMaterial 2015-09-17 14:45:16 +08:00
yangxiao 572ee3adb2 merge cocos 2015-09-17 14:24:01 +08:00
yangxiao fb7ade6578 reset set material 2015-09-16 18:08:23 +08:00
yangxiao b5e69930cd fix shader light parameter 2015-09-16 18:04:52 +08:00
yangxiao d5fab0bd38 merge cocos 2015-09-10 10:44:09 +08:00
Martin Taylor e592a1a02d fix typos 2015-09-09 11:37:41 +08:00
yangxiao 153bdb7170 add comment 2015-09-09 11:11:17 +08:00
yangxiao f944750627 add material cache 2015-09-08 15:29:54 +08:00
yangxiao c3ac446f35 resolve conflict 2015-09-07 14:45:09 +08:00
yangxiao 97c59c87ac built in material for sprite3d 2015-09-07 13:59:38 +08:00
songchengjiang addce6c565 add CC_DLL 2015-09-02 15:55:58 +08:00
yangxiao c23805889f add motionstreak3d 2015-09-01 11:02:22 +08:00
yangxiao b6c4f4cf50 add comment 2015-09-01 10:39:14 +08:00
yangxiao 030ab8858d enable depth write for transparent object 2015-08-31 18:34:09 +08:00
yangxiao bc07d7954a fix render state 2015-08-28 23:00:45 +08:00
yangxiao bc2e66d03b add motionstreak3d 2015-08-28 11:40:12 +08:00
yangxiao 7884138dcc disable blend when drawing skybox 2015-08-25 14:32:25 +08:00
yangxiao 7dcc3dd982 Move CCTextureCube From 3d to renderer to solve compilation issue 2015-08-24 14:01:50 +08:00
yangxiao 8f81267960 skybox is not transparent 2015-08-19 18:25:34 +08:00
pandamicro dbd0b6dd86 Merge pull request #13272 from yangws/bug_21800
fixed bug #21800 [CppTest]Node: Scene3D when player outof terrain app…
2015-08-12 10:25:30 +08:00
Vincent Yang 354f64ec51 fixed bug #21800 [CppTest]Node: Scene3D when player outof terrain app will no response. 2015-08-07 17:36:35 +08:00
Vladimir Perminov 7cacdaeaf1 Add getFileExtension to FileUtils
Gets filename extension is a suffix (separated from the base filename by
a dot) in lower case.

More code need get filename extension, everyone does it differently.
use check UPPER and lower case, use . and no(example ".csb", ".CSB",
"csb" )

And bag in AudioEngineImpl: find point from left( ext =
strchr(filePath.c_str(), '.'); )
If file path contains point. always unsupported media type
2015-08-05 22:21:16 +03:00
yangxiao fc4c25c51e add comment 2015-08-03 13:30:30 +08:00
yangxiao b6774a5f44 fix warning 2015-08-03 10:27:57 +08:00
yangxiao 929cd4fbfe set default value for _lightDir 2015-08-03 10:12:04 +08:00
yangxiao 8a6c49b5a3 merge cocos 2015-08-03 09:54:29 +08:00
pandamicro 00a3d572d1 Merge pull request #12899 from super626/v3
Animate3D Callback and Bug fix
2015-08-01 18:24:05 +08:00
jianglong0156 dcda083efa rename the initTerrain to initWithTerrainData 2015-07-31 18:35:47 +08:00