mirror of https://github.com/axmolengine/axmol.git
Merge branch 'develop' into develop_nutty_modify_framework_fixedupdatebugs
This commit is contained in:
commit
4d665bc96a
3
AUTHORS
3
AUTHORS
|
@ -715,6 +715,9 @@ Developers:
|
||||||
akof1314
|
akof1314
|
||||||
TestCpp works by using CMake and mingw on Windows.
|
TestCpp works by using CMake and mingw on Windows.
|
||||||
|
|
||||||
|
Pisces000221
|
||||||
|
Corrected a few mistakes in the README file of project-creator.
|
||||||
|
|
||||||
Retired Core Developers:
|
Retired Core Developers:
|
||||||
WenSheng Yang
|
WenSheng Yang
|
||||||
Author of windows port, CCTextField,
|
Author of windows port, CCTextField,
|
||||||
|
|
|
@ -148,5 +148,8 @@ inline errno_t strcpy_s(char *strDestination, size_t numberOfElements,
|
||||||
#undef DELETE
|
#undef DELETE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
#undef max
|
||||||
|
|
||||||
#endif // __CC_STD_C_H__
|
#endif // __CC_STD_C_H__
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ Frustum::~Frustum()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, float width, float height, float near, float far)
|
void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, float width, float height, float nearPlane, float farPlane)
|
||||||
{
|
{
|
||||||
kmVec3 cc = view.getPosition();
|
kmVec3 cc = view.getPosition();
|
||||||
kmVec3 cDir = view.getDirection();
|
kmVec3 cDir = view.getDirection();
|
||||||
|
@ -189,7 +189,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa
|
||||||
kmVec3 point;
|
kmVec3 point;
|
||||||
kmVec3 normal;
|
kmVec3 normal;
|
||||||
normal = cDir;
|
normal = cDir;
|
||||||
kmVec3Scale(&point, &cDir, near);
|
kmVec3Scale(&point, &cDir, nearPlane);
|
||||||
kmVec3Add(&point, &point, &cc);
|
kmVec3Add(&point, &point, &cc);
|
||||||
kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_NEAR], &point, &normal);
|
kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_NEAR], &point, &normal);
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa
|
||||||
kmVec3 point;
|
kmVec3 point;
|
||||||
kmVec3 normal;
|
kmVec3 normal;
|
||||||
kmVec3Scale(&normal, &cDir, -1);
|
kmVec3Scale(&normal, &cDir, -1);
|
||||||
kmVec3Scale(&point, &cDir, far);
|
kmVec3Scale(&point, &cDir, farPlane);
|
||||||
kmVec3Add(&point, &point, &cc);
|
kmVec3Add(&point, &point, &cc);
|
||||||
kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_FAR], &point, &normal);
|
kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_FAR], &point, &normal);
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Frustum::setupProjectionPerspective(const ViewTransform& view, float left, float right, float top, float bottom, float near, float far)
|
void Frustum::setupProjectionPerspective(const ViewTransform& view, float left, float right, float top, float bottom, float nearPlane, float farPlane)
|
||||||
{
|
{
|
||||||
kmVec3 cc = view.getPosition();
|
kmVec3 cc = view.getPosition();
|
||||||
kmVec3 cDir = view.getDirection();
|
kmVec3 cDir = view.getDirection();
|
||||||
|
@ -259,10 +259,10 @@ void Frustum::setupProjectionPerspective(const ViewTransform& view, float left,
|
||||||
kmVec3 nearCenter;
|
kmVec3 nearCenter;
|
||||||
kmVec3 farCenter;
|
kmVec3 farCenter;
|
||||||
|
|
||||||
kmVec3Scale(&nearCenter, &cDir, near);
|
kmVec3Scale(&nearCenter, &cDir, nearPlane);
|
||||||
kmVec3Add(&nearCenter, &nearCenter, &cc);
|
kmVec3Add(&nearCenter, &nearCenter, &cc);
|
||||||
|
|
||||||
kmVec3Scale(&farCenter, &cDir, far);
|
kmVec3Scale(&farCenter, &cDir, farPlane);
|
||||||
kmVec3Add(&farCenter, &farCenter, &cc);
|
kmVec3Add(&farCenter, &farCenter, &cc);
|
||||||
|
|
||||||
//near
|
//near
|
||||||
|
@ -335,11 +335,11 @@ void Frustum::setupProjectionPerspective(const ViewTransform& view, float left,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Frustum::setupProjectionPerspectiveFov(const ViewTransform& view, float fov, float ratio, float near, float far)
|
void Frustum::setupProjectionPerspectiveFov(const ViewTransform& view, float fov, float ratio, float nearPlane, float farPlane)
|
||||||
{
|
{
|
||||||
float width = 2 * near * tan(fov * 0.5);
|
float width = 2 * nearPlane * tan(fov * 0.5);
|
||||||
float height = width/ratio;
|
float height = width/ratio;
|
||||||
setupProjectionPerspective(view, -width/2, width/2, height/2, -height/2, near, far);
|
setupProjectionPerspective(view, -width/2, width/2, height/2, -height/2, nearPlane, farPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Frustum::setupFromMatrix(const kmMat4 &view, const kmMat4 &projection)
|
void Frustum::setupFromMatrix(const kmMat4 &view, const kmMat4 &projection)
|
||||||
|
|
|
@ -143,12 +143,12 @@ void log(const char *format, va_list args)
|
||||||
|
|
||||||
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
|
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
|
||||||
WCHAR wszBuf[MAX_LOG_LENGTH] = {0};
|
WCHAR wszBuf[MAX_LOG_LENGTH] = {0};
|
||||||
MultiByteToWideChar(CP_UTF8, 0, szBuf, -1, wszBuf, sizeof(wszBuf));
|
MultiByteToWideChar(CP_UTF8, 0, buf, -1, wszBuf, sizeof(wszBuf));
|
||||||
OutputDebugStringW(wszBuf);
|
OutputDebugStringW(wszBuf);
|
||||||
OutputDebugStringA("\n");
|
OutputDebugStringA("\n");
|
||||||
|
|
||||||
WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), szBuf, sizeof(szBuf), NULL, FALSE);
|
WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE);
|
||||||
printf("%s\n", szBuf);
|
printf("%s\n", buf);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// Linux, Mac, iOS, etc
|
// Linux, Mac, iOS, etc
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
#create_project
|
#Creating A Project
|
||||||
|
|
||||||
First you need install python environment.
|
First you need to install the Python environment.
|
||||||
|
|
||||||
There have double ways create new cocos project.
|
There are two ways to create a new cocos project.
|
||||||
Notice:The best of generate path is english path.
|
Notice: The best project path is an English path without spaces.
|
||||||
##1.UI
|
##1.UI
|
||||||
* Windows: double click "create_project.py" file
|
* Windows: double click the "create_project.py" file
|
||||||
* Mac: ./create_project.py
|
* Mac: use `./create_project.py`
|
||||||
* Linux: The tkinter was not installed in the linux's default python,therefore, in order to use the gui operate, you have to install the tkinter libaray manually. There is another way to create project by command line. see below for details
|
* Linux: The Tkinter library was not installed automatically in Linux, therefore, in order to use the GUI to operate, you have to install Tkinter manually (see http://tkinter.unpythonic.net/wiki/How_to_install_Tkinter). There is another way to create projects by command line. See below for details.
|
||||||
|
|
||||||
##2.console
|
##2.console
|
||||||
|
To use this, open the terminal and type:
|
||||||
|
```
|
||||||
$ cd cocos2d-x/tools/project-creator
|
$ cd cocos2d-x/tools/project-creator
|
||||||
$ ./project-creator.py --help
|
$ ./project-creator.py --help
|
||||||
$ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
|
$ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
|
||||||
$ cd /home/mygame
|
$ cd /home/mygame
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue