Merge pull request #8052 from minggo/update-release-note

[ci skip]update release note
This commit is contained in:
minggo 2014-09-15 15:59:47 +08:00
commit ef76938741
1 changed files with 63 additions and 94 deletions

View File

@ -1,4 +1,4 @@
# cocos2d-x v3.3alpha0 Release Notes #
# cocos2d-x v3.3beta0 Release Notes #
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
@ -117,17 +117,14 @@ Run
Please refer to this document: [ReadMe](../README.md)
# Highlights of v3.3alpha0
# Highlights of v3.3beta0
* 3d: `Camera`, 'Reskin', 'Attachment', 'Better support for FBX', 'New fbx-conv', `AABB`, `OBB` and `Ray`
* ui: added `Scale9Sprite`
* FileUitls: added `isDirectoryExist()`, `createDirectory()`, `removeDirectory()`, `removeFile()`, `renameFile()` and `getFileSize()`
* Device: added `setKeepScreenOn()` on iOS and Android
* Added c++11 random support
* RenderTexture: added a call back function for `saveToFile()`
* 3d: `Camera`, 'Reskin', 'Attachment', 'Better support for FBX', 'New fbx-conv', `AABB`, `OBB`, `Ray` and `BillBoard`
* audio: new audio is added on iOS and Android
* DrawNode: added as many functions as `DrawPrimitive`, and `DrawPrimitive` is deprecated
* Primitive: Support Points, Lines and Triagles for rendering
* SpriteFrameCache: support loading from plist file content data
* Added a consistent way to set GL context attributes for all platforms
* Renderer: added `trianle command`
* UI: added `WebView` on iOS and Android
* Only two libraries in cocos2d-x, one for c++ codes, another one for lua-binding codes
* Many other small features added and many bugs fixed
@ -185,7 +182,7 @@ auto mesh1 = sprite3d->getMeshByName("coat1");
mesh1->setVisible(false);
```
Full test case please refer to 'tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp'
Full test case please refer to `tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp`.
## Attachment
@ -200,7 +197,7 @@ auto attachNode = sprite->getAttachNode("left_hand");
attachNode->addChild(weapon);
```
Full test case please refer to 'tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp'
Full test case please refer to `tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp`.
## Better support for FBX
@ -234,56 +231,11 @@ ray._direction = farP - nearP;
ray.intersects(sprite3d->getAABB( ) );
```
Full test case please refer to 'tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp'
Full test case please refer to `tests/cpp-tests/Classes/Spret3DTest/Sprite3DTest.cpp`.
## ui::Scale9Sprite
## BillBoard
Now we have implemented a new Scale9Sprite class under ui module. Its internal implementation is concise than the previous one plus more features.
The main reason of reimplementing this class is that the Scale9Sprite is heavily used in ui module. Now the ui module is not dependent from extension module.
By applying the new ui::Scale9Sprite, the code inside many widget classes are more cleaner and elegant.
We could manually toggle "slice 9" feature by one function call:
```c++
//ui::Scale9Sprite is slice 9 enabled on default
auto sprite = ui::Scale9Sprite::create("foo.png");
sprite->setScale9Enabled(false);
```
It also supports Flipping now.
```c++
auto sprite = ui::Scale9Sprite::create("bar.png");
sprite->setFlippedX(true);
sprite->setFlippedY(false);
```
Since the ui::Scale9Sprite is a Node rather than a Sprite, so you can't add it to a batch node. If you do want to do some actions on the internal sprite,
you could call `sprite->getSprite()` to access it.
Full test case please refer to `tests/cpp-tests/Classes/UITests/CocostudioGUITest/UIScale9SpriteTest.cpp`.
## c++11 random support
Since `rand()` is not good(refer to [this document](http://c-faq.com/lib/randrange.html)), we use c++11 random library to do generate random number, and provide a function to easily using:
```c++
int randInt = cocos2d::random(1, 10);
float randFloat = cocos2d::random(1.f, 10.f);
```
## RenderTexture save function
`RenderTexture::saveToFile()` will not save rendertexture when the function returns, because it just send render command to renderer. The file will be saved after render command is executed. It is not convenient if you want to use the saved file to do some work. So we added a parameter in `RenderTexture::saveToFile()` to set a call back function when the file is saved.
```c++
renderTexture->begin();
...
renderTexture->end();
renderTexture->saveToFile("myFile.png", true, callback);
```
TBD
## Primitive
@ -293,59 +245,76 @@ Here is a simple example of rendering a quad in `Sprite`.
1. create verexBuffer
```c++
auto vertexBuffer = VerexBuffer::create(sizeof(V3F_C4B_T2F), 4);
vertexBuffer->updateVertices(&_quad, 4, 0);
```
```c++
auto vertexBuffer = VerexBuffer::create(sizeof(V3F_C4B_T2F), 4);
vertexBuffer->updateVertices(&_quad, 4, 0);
```
2. create vertexData
```c++
auto vertexData = VertexData::create();
vertexData->addStream(vertexBuffer, VertexStreamAttribute(0, VERTEX_ATTRIB_POSITION, GL_FLOAT, 3, fasle));
vertexData->addStream(vertexBuffer, VertexStreamAttribute(12, VERTEX_ATTRIB_COLOR, GL_UNSIGNED_BTYE, 4, true));
vertexData->addStream(vertexBuffer, VertexStreamAttribute(16, VERTEX_ATTRIB_TEX_COORD, GL_FLOAT, 2, fasle));
```c++
auto vertexData = VertexData::create();
vertexData->addStream(vertexBuffer, VertexStreamAttribute(0, VERTEX_ATTRIB_POSITION, GL_FLOAT, 3, fasle));
vertexData->addStream(vertexBuffer, VertexStreamAttribute(12, VERTEX_ATTRIB_COLOR, GL_UNSIGNED_BTYE, 4, true));
vertexData->addStream(vertexBuffer, VertexStreamAttribute(16, VERTEX_ATTRIB_TEX_COORD, GL_FLOAT, 2, fasle));
```
3. create IndexBuffer
```c++
auto indexBuffer = IndexBuffer::create(IndexType::INDEX_TYPE_SHORT_16, 6);
short indices[6] = {0,1,2,3,2,1};
indexBuffer->updateIndices(indices,6, 0);
```
```c++
auto indexBuffer = IndexBuffer::create(IndexType::INDEX_TYPE_SHORT_16, 6);
short indices[6] = {0,1,2,3,2,1};
indexBuffer->updateIndices(indices,6, 0);
```
4. create primitive
```c++
auto primitve = Primitive::create(vertexData, indexBuffer, GL_TRIANGLES);
primitive->setStart(0);
primitive->setCount(6);
```
```c++
auto primitve = Primitive::create(vertexData, indexBuffer, GL_TRIANGLES);
primitive->setStart(0);
primitive->setCount(6);
```
5. add command to renderer
```c++
_command->init(globalZorder,textureID, glprogramState, blend, primitve, modelViewMatrix);
renderer->addCommand(&_command);
```
```c++
_command->init(globalZorder,textureID, glprogramState, blend, primitve, modelViewMatrix);
renderer->addCommand(&_command);
```
Primitive supports three typs of primitives (POINTS, LINES, TRIANGLES), vertex and index sharing, multiple streams. It has some constrains:
1. The size of vertex and index Buffer is fixed, which means data must be pre allocated.
2. Batching is not supported.
## Consistent way to set GL context attributes
## Triangle command
Now you can set GL context attributes by override `Application::initGLContextAttrs()`, then set GL context attributes there.
TBD
```c++
void AppDelegate::initGLContextAttrs()
{
// r:8 g:8 a:8 depth:24 stencil:8
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};
GLView::setGLContextAttrs(glContextAttrs);
}
```
## WebView
TBD
## New audio
New audio is more powerful than old one, and it is not compatible with old one. We will deprecated old one when new audio is ready on all supported platforms. Now it only supports iOS and Android. We plan to finish it on v3.4.
What's enhanced in new audio engine:
* can play more than one backgournd music
* can have a call back when an audio(music or effect) finishs
* can get duration of an audio
* can get/set playback position of a playing audio
* can change loop state when playing
The difference compared to old audio engine
* all functions are static, which means you can more easy to invoke function, such as `Audio::play2d()`
* there is only one method `play2d()` to play music or effect
* should use `Audio::getState()` to determine an audio is playing, paused
* its class name is `cocos2d::AudioEngine` in c++, and its module name is `cc.AudioEngine` in lua-binding
* there is not preload function, you can play an audio immediately
Full test case please refer to `tests/cpp-tests/Classes/NewAudioEngineTest/NewAudioEngineTest.cpp`.
Now can only support setting bits of `r`, `g`, `b`, `a`, `depth buffer` and `stencil buffer`. We will support other attributes if needed.
## Only two libraries left