mirror of https://github.com/axmolengine/axmol.git
fix comments
This commit is contained in:
parent
2ebc854335
commit
54472497a4
|
@ -1,25 +1,25 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Copyright (c) 2014 Chukong Technologies Inc.
|
Copyright (c) 2014 Chukong Technologies Inc.
|
||||||
|
|
||||||
http://www.cocos2d-x.org
|
http://www.cocos2d-x.org
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCSkybox.h"
|
#include "CCSkybox.h"
|
||||||
|
@ -88,13 +88,13 @@ void Skybox::initBuffers()
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vexBuf), vexBuf, GL_STATIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(vexBuf), vexBuf, GL_STATIC_DRAW);
|
||||||
|
|
||||||
// init index buffer object
|
// init index buffer object
|
||||||
unsigned char idxBuf[] = { 2, 1, 0, 3, 2, 0, // font
|
const unsigned char idxBuf[] = { 2, 1, 0, 3, 2, 0, // font
|
||||||
1, 5, 4, 1, 4, 0, // right
|
1, 5, 4, 1, 4, 0, // right
|
||||||
4, 5, 6, 4, 6, 7, // back
|
4, 5, 6, 4, 6, 7, // back
|
||||||
7, 6, 2, 7, 2, 3, // left
|
7, 6, 2, 7, 2, 3, // left
|
||||||
2, 6, 5, 2, 5, 1, // up
|
2, 6, 5, 2, 5, 1, // up
|
||||||
3, 0, 4, 3, 4, 7 // down
|
3, 0, 4, 3, 4, 7 // down
|
||||||
};
|
};
|
||||||
|
|
||||||
glGenBuffers(1, &_indexBuffer);
|
glGenBuffers(1, &_indexBuffer);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _indexBuffer);
|
||||||
|
|
|
@ -1,27 +1,26 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Copyright (c) 2012 cocos2d-x.org
|
Copyright (c) 2014 Chukong Technologies Inc.
|
||||||
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
|
||||||
|
http://www.cocos2d-x.org
|
||||||
http://www.cocos2d-x.org
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
in the Software without restriction, including without limitation the rights
|
||||||
in the Software without restriction, including without limitation the rights
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
furnished to do so, subject to the following conditions:
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
The above copyright notice and this permission notice shall be included in
|
all copies or substantial portions of the Software.
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
THE SOFTWARE.
|
||||||
THE SOFTWARE.
|
****************************************************************************/
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "Sprite3DTest.h"
|
#include "Sprite3DTest.h"
|
||||||
#include "base/CCAsyncTaskPool.h"
|
#include "base/CCAsyncTaskPool.h"
|
||||||
|
@ -1630,11 +1629,11 @@ Sprite3DReskinTest::Sprite3DReskinTest()
|
||||||
auto label1 = Label::createWithTTF(ttfConfig,"Hair");
|
auto label1 = Label::createWithTTF(ttfConfig,"Hair");
|
||||||
auto item1 = MenuItemLabel::create(label1,CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
auto item1 = MenuItemLabel::create(label1,CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
||||||
auto label2 = Label::createWithTTF(ttfConfig,"Glasses");
|
auto label2 = Label::createWithTTF(ttfConfig,"Glasses");
|
||||||
auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
||||||
auto label3 = Label::createWithTTF(ttfConfig,"Coat");
|
auto label3 = Label::createWithTTF(ttfConfig,"Coat");
|
||||||
auto item3 = MenuItemLabel::create(label3,CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
auto item3 = MenuItemLabel::create(label3,CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
||||||
auto label4 = Label::createWithTTF(ttfConfig,"Pants");
|
auto label4 = Label::createWithTTF(ttfConfig,"Pants");
|
||||||
auto item4 = MenuItemLabel::create(label4, CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
auto item4 = MenuItemLabel::create(label4, CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
||||||
auto label5 = Label::createWithTTF(ttfConfig,"Shoes");
|
auto label5 = Label::createWithTTF(ttfConfig,"Shoes");
|
||||||
auto item5 = MenuItemLabel::create(label5,CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
auto item5 = MenuItemLabel::create(label5,CC_CALLBACK_1(Sprite3DReskinTest::menuCallback_reSkin,this) );
|
||||||
item1->setPosition( Vec2(VisibleRect::left().x+50, VisibleRect::bottom().y+item1->getContentSize().height*4 ) );
|
item1->setPosition( Vec2(VisibleRect::left().x+50, VisibleRect::bottom().y+item1->getContentSize().height*4 ) );
|
||||||
|
@ -2234,7 +2233,7 @@ void UseCaseSprite3D::switchCase()
|
||||||
auto label1 = Label::createWithTTF(ttfConfig,"Message");
|
auto label1 = Label::createWithTTF(ttfConfig,"Message");
|
||||||
auto item1 = MenuItemLabel::create(label1,CC_CALLBACK_1(UseCaseSprite3D::menuCallback_Message,this) );
|
auto item1 = MenuItemLabel::create(label1,CC_CALLBACK_1(UseCaseSprite3D::menuCallback_Message,this) );
|
||||||
auto label2 = Label::createWithTTF(ttfConfig,"Message");
|
auto label2 = Label::createWithTTF(ttfConfig,"Message");
|
||||||
auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(UseCaseSprite3D::menuCallback_Message,this) );
|
auto item2 = MenuItemLabel::create(label2, CC_CALLBACK_1(UseCaseSprite3D::menuCallback_Message,this) );
|
||||||
|
|
||||||
item1->setPosition( Vec2(s.width * 0.5f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height ) );
|
item1->setPosition( Vec2(s.width * 0.5f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height ) );
|
||||||
item2->setPosition( Vec2(s.width * 0.5f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height * 2.f ) );
|
item2->setPosition( Vec2(s.width * 0.5f - item1->getContentSize().width * 0.5f, s.height * 0.5f - item1->getContentSize().height * 2.f ) );
|
||||||
|
@ -2336,8 +2335,8 @@ void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
|
||||||
|
|
||||||
// create the second texture for cylinder
|
// create the second texture for cylinder
|
||||||
_textureCube = TextureCube::create("Sprite3DTest/skybox/left.jpg", "Sprite3DTest/skybox/right.jpg",
|
_textureCube = TextureCube::create("Sprite3DTest/skybox/left.jpg", "Sprite3DTest/skybox/right.jpg",
|
||||||
"Sprite3DTest/skybox/top.jpg", "Sprite3DTest/skybox/bottom.jpg",
|
"Sprite3DTest/skybox/top.jpg", "Sprite3DTest/skybox/bottom.jpg",
|
||||||
"Sprite3DTest/skybox/front.jpg", "Sprite3DTest/skybox/back.jpg");
|
"Sprite3DTest/skybox/front.jpg", "Sprite3DTest/skybox/back.jpg");
|
||||||
|
|
||||||
_textureCube->retain();
|
_textureCube->retain();
|
||||||
|
|
||||||
|
@ -2366,11 +2365,12 @@ void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
|
||||||
{
|
{
|
||||||
auto meshattribute = _teapot->getMesh()->getMeshVertexAttribute(i);
|
auto meshattribute = _teapot->getMesh()->getMeshVertexAttribute(i);
|
||||||
state->setVertexAttribPointer(s_attributeNames[meshattribute.vertexAttrib],
|
state->setVertexAttribPointer(s_attributeNames[meshattribute.vertexAttrib],
|
||||||
meshattribute.size,
|
meshattribute.size,
|
||||||
meshattribute.type,
|
meshattribute.type,
|
||||||
GL_FALSE,
|
GL_FALSE,
|
||||||
_teapot->getMesh()->getVertexSizeInBytes(),
|
_teapot->getMesh()->getVertexSizeInBytes(),
|
||||||
(GLvoid*)offset);
|
(GLvoid*)offset);
|
||||||
|
|
||||||
offset += meshattribute.attribSizeBytes;
|
offset += meshattribute.attribSizeBytes;
|
||||||
}
|
}
|
||||||
addChild(_teapot);
|
addChild(_teapot);
|
||||||
|
|
Loading…
Reference in New Issue