Skip to content

Commit

Permalink
issue cocos2d#375: rename file names and object names
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Mar 7, 2011
1 parent 239a8cf commit 6d51fa0
Show file tree
Hide file tree
Showing 284 changed files with 4,824 additions and 4,467 deletions.
22 changes: 11 additions & 11 deletions HelloWorld/AppDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,33 @@ bool AppDelegate::initInstance()
bool bRet = false;
do
{
#if (CCX_TARGET_PLATFORM == CCX_PLATFORM_WIN32)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)

// Initialize OpenGLView instance, that release by CCDirector when application terminate.
// The HelloWorld is designed as HVGA.
CCXEGLView * pMainWnd = new CCXEGLView();
CCX_BREAK_IF(! pMainWnd
CCEGLView * pMainWnd = new CCEGLView();
CC_BREAK_IF(! pMainWnd
|| ! pMainWnd->Create(TEXT("cocos2d: Hello World"), 320, 480));

#endif // CCX_PLATFORM_WIN32
#endif // CC_PLATFORM_WIN32

#if (CCX_TARGET_PLATFORM == CCX_PLATFORM_IOS)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
// OpenGLView initialized in testsAppDelegate.mm on ios platform, nothing need to do here.
#endif // CCX_PLATFORM_IOS
#endif // CC_PLATFORM_IOS

#if (CCX_TARGET_PLATFORM == CCX_PLATFORM_UPHONE)
#if (CC_TARGET_PLATFORM == CC_PLATFORM_UPHONE)

// Initialize OpenGLView instance, that release by CCDirector when application terminate.
// The HelloWorld is designed as HVGA.
CCXEGLView* pMainWnd = new CCXEGLView(this);
CCX_BREAK_IF(! pMainWnd || ! pMainWnd->Create(320,480));
CCEGLView* pMainWnd = new CCEGLView(this);
CC_BREAK_IF(! pMainWnd || ! pMainWnd->Create(320,480));

#ifndef _TRANZDA_VM_
// on uphone emulator, we copy resources files to Work7/TG3/APP/ folder instead of zip file
cocos2d::CCFileUtils::setResource("HelloWorld.zip");
#endif

#endif // CCX_PLATFORM_UPHONE
#endif // CC_PLATFORM_UPHONE

bRet = true;
} while (0);
Expand All @@ -56,7 +56,7 @@ bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
pDirector->setOpenGLView(&CCXEGLView::sharedOpenGLView());
pDirector->setOpenGLView(&CCEGLView::sharedOpenGLView());

// enable High Resource Mode(2x, such as iphone4) and maintains low resource on other devices.
// pDirector->enableRetinaDisplay(true);
Expand Down
4 changes: 2 additions & 2 deletions HelloWorld/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#ifndef _APP_DELEGATE_H_
#define _APP_DELEGATE_H_

#include "ccxApplication.h"
#include "CCApplication.h"

/**
@brief The cocos2d Application.
The reason for implement as private inheritance is to hide some interface call by CCDirector.
*/
class AppDelegate : private cocos2d::ccxApplication
class AppDelegate : private cocos2d::CCApplication
{
public:
AppDelegate();
Expand Down
6 changes: 3 additions & 3 deletions HelloWorld/HelloWorldScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool HelloWorld::init()

// create menu, it's an autorelease object
CCMenu* pMenu = CCMenu::menuWithItems(pCloseItem, NULL);
pMenu->setPosition( CGPointZero );
pMenu->setPosition( CCPointZero );
this->addChild(pMenu, 1);

/////////////////////////////
Expand All @@ -52,7 +52,7 @@ bool HelloWorld::init()
CCLabelTTF* pLabel = CCLabelTTF::labelWithString("Hello World", "Thonburi", 34);

// ask director the window size
CGSize size = CCDirector::sharedDirector()->getWinSize();
CCSize size = CCDirector::sharedDirector()->getWinSize();

// position the label on the center of the screen
pLabel->setPosition( ccp(size.width / 2, size.height - 20) );
Expand All @@ -72,7 +72,7 @@ bool HelloWorld::init()
return true;
}

void HelloWorld::menuCloseCallback(NSObject* pSender)
void HelloWorld::menuCloseCallback(CCObject* pSender)
{
CCDirector::sharedDirector()->end();
}
2 changes: 1 addition & 1 deletion HelloWorld/HelloWorldScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HelloWorld : public cocos2d::CCLayer
static cocos2d::CCScene* scene();

// a selector callback
virtual void menuCloseCallback(NSObject* pSender);
virtual void menuCloseCallback(CCObject* pSender);

// implement the "static node()" method manually
LAYER_NODE_FUNC(HelloWorld);
Expand Down
2 changes: 1 addition & 1 deletion HelloWorld/win32/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
// create the application instance
AppDelegate app;

return cocos2d::ccxApplication::sharedApplication().run();
return cocos2d::CCApplication::sharedApplication().run();
}
2 changes: 1 addition & 1 deletion HelloWorld/win32/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
#include <tchar.h>

// C RunTime Header Files
#include "ccxStdC.h"
#include "CCStdC.h"

#endif // __MAIN_H__
6 changes: 3 additions & 3 deletions chipmunk/include/chipmunk/chipmunk_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
#endif

//#if TARGET_OS_IPHONE
// CGPoints are structurally the same, and allow
// CCPoints are structurally the same, and allow
// easy interoperability with other iPhone libraries
//#import <CoreGraphics/CGGeometry.h>
//typedef CGPoint cpVect;
//#import <CoreGraphics/CCGeometry.h>
//typedef CCPoint cpVect;
//#else
typedef struct cpVect{cpFloat x,y;} cpVect;
//#endif
Expand Down
4 changes: 2 additions & 2 deletions cocos2dx/CCConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ THE SOFTWARE.
#ifndef __CCCONFIGURATION_H__
#define __CCCONFIGURATION_H__

#include "NSObject.h"
#include "CCObject.h"
#include <string>
#include "CCGL.h"

Expand Down Expand Up @@ -54,7 +54,7 @@ namespace cocos2d {
@brief CCConfiguration contains some openGL variables
@since v0.99.0
*/
class CCConfiguration : public NSObject
class CCConfiguration : public CCObject
{
protected:
GLint m_nMaxTextureSize;
Expand Down
26 changes: 13 additions & 13 deletions cocos2dx/CCDrawingPrimitives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ THE SOFTWARE.

namespace cocos2d {

void ccDrawPoint(CGPoint point)
void ccDrawPoint(CCPoint point)
{
ccVertex2F p = {point.x * CC_CONTENT_SCALE_FACTOR(), point.y * CC_CONTENT_SCALE_FACTOR() };
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
Expand All @@ -56,7 +56,7 @@ void ccDrawPoint(CGPoint point)
glEnable(GL_TEXTURE_2D);
}

void ccDrawPoints(const CGPoint *points, unsigned int numberOfPoints)
void ccDrawPoints(const CCPoint *points, unsigned int numberOfPoints)
{
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_VERTEX_ARRAY,
Expand All @@ -68,7 +68,7 @@ void ccDrawPoints(const CGPoint *points, unsigned int numberOfPoints)
ccVertex2F *newPoints = new ccVertex2F[numberOfPoints];

// iPhone and 32-bit machines optimization
if( sizeof(CGPoint) == sizeof(ccVertex2F) ) {
if( sizeof(CCPoint) == sizeof(ccVertex2F) ) {

// points ?
if( CC_CONTENT_SCALE_FACTOR() != 1 )
Expand Down Expand Up @@ -107,9 +107,9 @@ void ccDrawPoints(const CGPoint *points, unsigned int numberOfPoints)
glEnable(GL_TEXTURE_2D);
}

void ccDrawLine(CGPoint origin, CGPoint destination)
void ccDrawLine(CCPoint origin, CCPoint destination)
{
CGPoint vertices[2];
CCPoint vertices[2];

vertices[0] = origin;
vertices[1] = destination;
Expand All @@ -131,7 +131,7 @@ void ccDrawLine(CGPoint origin, CGPoint destination)
}


void ccDrawPoly(const CGPoint *poli, int points, bool closePolygon)
void ccDrawPoly(const CCPoint *poli, int points, bool closePolygon)
{
// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
// Needed states: GL_VERTEX_ARRAY,
Expand All @@ -156,7 +156,7 @@ void ccDrawPoly(const CGPoint *poli, int points, bool closePolygon)
glEnable(GL_TEXTURE_2D);
}

void ccDrawCircle(CGPoint center, float r, float a, int segs, bool drawLineToCenter)
void ccDrawCircle(CCPoint center, float r, float a, int segs, bool drawLineToCenter)
{
int additionalSegment = 1;
if (drawLineToCenter)
Expand Down Expand Up @@ -204,16 +204,16 @@ void ccDrawCircle(CGPoint center, float r, float a, int segs, bool drawLineToCen
delete[] vertices; // free(vertices);
}

void ccDrawQuadBezier(CGPoint origin, CGPoint control, CGPoint destination, int segments)
void ccDrawQuadBezier(CCPoint origin, CCPoint control, CCPoint destination, int segments)
{
CGPoint *vertices = new CGPoint[segments + 1];
CCPoint *vertices = new CCPoint[segments + 1];

float t = 0.0f;
for(int i = 0; i < segments; i++)
{
float x = powf(1 - t, 2) * origin.x + 2.0f * (1 - t) * t * control.x + t * t * destination.x;
float y = powf(1 - t, 2) * origin.y + 2.0f * (1 - t) * t * control.y + t * t * destination.y;
vertices[i] = CGPointMake(x, y);
vertices[i] = CCPointMake(x, y);
t += 1.0f / segments;
}
vertices[segments] = destination;
Expand All @@ -235,16 +235,16 @@ void ccDrawQuadBezier(CGPoint origin, CGPoint control, CGPoint destination, int
glEnable(GL_TEXTURE_2D);
}

void ccDrawCubicBezier(CGPoint origin, CGPoint control1, CGPoint control2, CGPoint destination, int segments)
void ccDrawCubicBezier(CCPoint origin, CCPoint control1, CCPoint control2, CCPoint destination, int segments)
{
CGPoint *vertices = new CGPoint[segments + 1];
CCPoint *vertices = new CCPoint[segments + 1];

float t = 0;
for(int i = 0; i < segments; ++i)
{
float x = powf(1 - t, 3) * origin.x + 3.0f * powf(1 - t, 2) * t * control1.x + 3.0f * (1 - t) * t * t * control2.x + t * t * t * destination.x;
float y = powf(1 - t, 3) * origin.y + 3.0f * powf(1 - t, 2) * t * control1.y + 3.0f * (1 - t) * t * t * control2.y + t * t * t * destination.y;
vertices[i] = CGPointMake(x, y);
vertices[i] = CCPointMake(x, y);
t += 1.0f / segments;
}
vertices[segments] = destination;
Expand Down
2 changes: 1 addition & 1 deletion cocos2dx/CCScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.
#include "ccMacros.h"
#include "support/data_support/utlist.h"
#include "support/data_support/ccCArray.h"
#include "NSMutableArray.h"
#include "CCMutableArray.h"

#include <assert.h>
namespace cocos2d {
Expand Down
Loading

0 comments on commit 6d51fa0

Please sign in to comment.