Merge branch 'develop' into develop_nutty_modify_framework_fixedupdatebugs

This commit is contained in:
CaiWenzhi 2014-01-14 15:01:24 +08:00
commit 4d665bc96a
5 changed files with 30 additions and 20 deletions

View File

@ -714,6 +714,9 @@ Developers:
akof1314
TestCpp works by using CMake and mingw on Windows.
Pisces000221
Corrected a few mistakes in the README file of project-creator.
Retired Core Developers:
WenSheng Yang

View File

@ -148,5 +148,8 @@ inline errno_t strcpy_s(char *strDestination, size_t numberOfElements,
#undef DELETE
#endif
#undef min
#undef max
#endif // __CC_STD_C_H__

View File

@ -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 cDir = view.getDirection();
@ -189,7 +189,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa
kmVec3 point;
kmVec3 normal;
normal = cDir;
kmVec3Scale(&point, &cDir, near);
kmVec3Scale(&point, &cDir, nearPlane);
kmVec3Add(&point, &point, &cc);
kmPlaneFromPointNormal(&_frustumPlanes[FrustumPlane::FRUSTUM_NEAR], &point, &normal);
}
@ -199,7 +199,7 @@ void Frustum::setupProjectionOrthogonal(const cocos2d::ViewTransform &view, floa
kmVec3 point;
kmVec3 normal;
kmVec3Scale(&normal, &cDir, -1);
kmVec3Scale(&point, &cDir, far);
kmVec3Scale(&point, &cDir, farPlane);
kmVec3Add(&point, &point, &cc);
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 cDir = view.getDirection();
@ -259,10 +259,10 @@ void Frustum::setupProjectionPerspective(const ViewTransform& view, float left,
kmVec3 nearCenter;
kmVec3 farCenter;
kmVec3Scale(&nearCenter, &cDir, near);
kmVec3Scale(&nearCenter, &cDir, nearPlane);
kmVec3Add(&nearCenter, &nearCenter, &cc);
kmVec3Scale(&farCenter, &cDir, far);
kmVec3Scale(&farCenter, &cDir, farPlane);
kmVec3Add(&farCenter, &farCenter, &cc);
//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;
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)

View File

@ -143,12 +143,12 @@ void log(const char *format, va_list args)
#elif CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
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);
OutputDebugStringA("\n");
WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), szBuf, sizeof(szBuf), NULL, FALSE);
printf("%s\n", szBuf);
WideCharToMultiByte(CP_ACP, 0, wszBuf, sizeof(wszBuf), buf, sizeof(buf), NULL, FALSE);
printf("%s\n", buf);
#else
// Linux, Mac, iOS, etc

View File

@ -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.
Notice:The best of generate path is english path.
There are two ways to create a new cocos project.
Notice: The best project path is an English path without spaces.
##1.UI
* Windows: double click "create_project.py" file
* Mac: ./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
* Windows: double click the "create_project.py" file
* Mac: use `./create_project.py`
* 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
To use this, open the terminal and type:
```
$ cd cocos2d-x/tools/project-creator
$ ./project-creator.py --help
$ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
$ cd /home/mygame
$ cd /home/mygame
```