mirror of https://github.com/axmolengine/axmol.git
issue #1572: Adding WatermelonWithMe project.
This commit is contained in:
parent
ee97633a4f
commit
e0fd8f6284
|
@ -0,0 +1,85 @@
|
|||
#include "AppDelegate.h"
|
||||
|
||||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/cocos2dx.hpp"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_chipmunk_registration.h"
|
||||
#include "js_bindings_ccbreader.h"
|
||||
|
||||
USING_NS_CC;
|
||||
using namespace CocosDenshion;
|
||||
|
||||
AppDelegate::AppDelegate()
|
||||
{
|
||||
}
|
||||
|
||||
AppDelegate::~AppDelegate()
|
||||
{
|
||||
CCScriptEngineManager::sharedManager()->purgeSharedManager();
|
||||
}
|
||||
|
||||
bool AppDelegate::applicationDidFinishLaunching()
|
||||
{
|
||||
// initialize director
|
||||
CCDirector *pDirector = CCDirector::sharedDirector();
|
||||
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
|
||||
|
||||
// turn on display FPS
|
||||
pDirector->setDisplayStats(true);
|
||||
|
||||
// set FPS. the default value is 1.0/60 if you don't call this
|
||||
pDirector->setAnimationInterval(1.0 / 60);
|
||||
|
||||
ScriptingCore* sc = ScriptingCore::getInstance();
|
||||
sc->addRegisterCallback(register_all_cocos2dx);
|
||||
sc->addRegisterCallback(register_cocos2dx_js_extensions);
|
||||
sc->addRegisterCallback(jsb_register_chipmunk);
|
||||
sc->addRegisterCallback(register_CCBuilderReader);
|
||||
|
||||
sc->start();
|
||||
|
||||
CCScriptEngineProtocol *pEngine = ScriptingCore::getInstance();
|
||||
CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine);
|
||||
//ScriptingCore::getInstance()->runScript("src/tests-boot-jsb.js");
|
||||
ScriptingCore::getInstance()->runScript("watermelon_with_me.js");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void handle_signal(int signal) {
|
||||
static int internal_state = 0;
|
||||
ScriptingCore* sc = ScriptingCore::getInstance();
|
||||
// should start everything back
|
||||
CCDirector* director = CCDirector::sharedDirector();
|
||||
if (director->getRunningScene()) {
|
||||
director->popToRootScene();
|
||||
} else {
|
||||
CCPoolManager::sharedPoolManager()->finalize();
|
||||
if (internal_state == 0) {
|
||||
//sc->dumpRoot(NULL, 0, NULL);
|
||||
sc->start();
|
||||
internal_state = 1;
|
||||
} else {
|
||||
sc->runScript("hello.js");
|
||||
internal_state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
|
||||
void AppDelegate::applicationDidEnterBackground()
|
||||
{
|
||||
CCDirector::sharedDirector()->stopAnimation();
|
||||
SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
|
||||
SimpleAudioEngine::sharedEngine()->pauseAllEffects();
|
||||
}
|
||||
|
||||
// this function will be called when the app is active again
|
||||
void AppDelegate::applicationWillEnterForeground()
|
||||
{
|
||||
CCDirector::sharedDirector()->startAnimation();
|
||||
SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
|
||||
SimpleAudioEngine::sharedEngine()->resumeAllEffects();
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// GCTestAppDelegate.h
|
||||
// GCTest
|
||||
//
|
||||
// Created by Rohan Kuruvilla on 06/08/2012.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef _APP_DELEGATE_H_
|
||||
#define _APP_DELEGATE_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::CCApplication
|
||||
{
|
||||
public:
|
||||
AppDelegate();
|
||||
virtual ~AppDelegate();
|
||||
|
||||
/**
|
||||
@brief Implement CCDirector and CCScene init code here.
|
||||
@return true Initialize success, app continue.
|
||||
@return false Initialize failed, app terminate.
|
||||
*/
|
||||
virtual bool applicationDidFinishLaunching();
|
||||
|
||||
/**
|
||||
@brief The function be called when the application enter background
|
||||
@param the pointer of the application
|
||||
*/
|
||||
virtual void applicationDidEnterBackground();
|
||||
|
||||
/**
|
||||
@brief The function be called when the application enter foreground
|
||||
@param the pointer of the application
|
||||
*/
|
||||
virtual void applicationWillEnterForeground();
|
||||
};
|
||||
|
||||
#endif // _APP_DELEGATE_H_
|
||||
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
f06c047dd32b61f12ad51e981afe518364512be6
|
|
@ -0,0 +1 @@
|
|||
4b7c1e97acefff48ae3652f023e708245992f553
|
|
@ -0,0 +1 @@
|
|||
ae62d7b07ac3e7579ed7d6a2e1f903719e45c6d9
|
|
@ -0,0 +1 @@
|
|||
12db20c3124e1bd864312257eb8cefe95d2ee349
|
|
@ -0,0 +1 @@
|
|||
e71140c1535f16b49980f3ea0cf7d3a29a8a9788
|
|
@ -0,0 +1 @@
|
|||
dc235c169030151e337ecbfa1fc6302fc909e500
|
|
@ -0,0 +1 @@
|
|||
9e95a02e6eb2944fea12a49eb3f2c6fe7505a3ce
|
|
@ -0,0 +1 @@
|
|||
1423c81273926b3da9fb1cb36c9b710d3f14ee0e
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
2b588761f91aeed6061ac672d00fb67b5b65253d
|
|
@ -0,0 +1 @@
|
|||
5783809fbb118e460886314c5da4429ea1f6577d
|
Binary file not shown.
|
@ -0,0 +1,9 @@
|
|||
//
|
||||
// Javascript Bindigns helper file
|
||||
//
|
||||
|
||||
// DO NOT ALTER THE ORDER
|
||||
require('jsb_constants_cocos2d.js');
|
||||
require('jsb_constants_chipmunk.js');
|
||||
require('jsb_constants_gl.js');
|
||||
require('jsb_constants_cocosbuilder.js');
|
|
@ -0,0 +1,253 @@
|
|||
//
|
||||
// Chipmunk defines
|
||||
//
|
||||
|
||||
cp.v = cc.p;
|
||||
cp._v = cc._p;
|
||||
cp.vzero = cp.v(0,0);
|
||||
|
||||
// Vector: Compatibility with Chipmunk-JS
|
||||
cp.v.add = cp.vadd;
|
||||
cp.v.clamp = cp.vclamp;
|
||||
cp.v.cross = cp.vcross;
|
||||
cp.v.dist = cp.vdist;
|
||||
cp.v.distsq = cp.vdistsq;
|
||||
cp.v.dot = cp.vdot;
|
||||
cp.v.eql = cp.veql;
|
||||
cp.v.forangle = cp.vforangle;
|
||||
cp.v.len = cp.vlength;
|
||||
cp.v.lengthsq = cp.vlengthsq;
|
||||
cp.v.lerp = cp.vlerp;
|
||||
cp.v.lerpconst = cp.vlerpconst;
|
||||
cp.v.mult = cp.vmult;
|
||||
cp.v.near = cp.vnear;
|
||||
cp.v.neg = cp.vneg;
|
||||
cp.v.normalize = cp.vnormalize;
|
||||
cp.v.normalize_safe = cp.vnormalize_safe;
|
||||
cp.v.perp = cp.vperp;
|
||||
cp.v.project = cp.vproject;
|
||||
cp.v.rotate = cp.vrotate;
|
||||
cp.v.rperp = cp.vrperp;
|
||||
cp.v.slerp = cp.vslerp;
|
||||
cp.v.slerpconst = cp.vslerpconst;
|
||||
cp.v.sub = cp.vsub;
|
||||
cp.v.toangle = cp.vtoangle;
|
||||
cp.v.unrotate = cp.vunrotate;
|
||||
|
||||
|
||||
|
||||
/// Initialize an offset box shaped polygon shape.
|
||||
cp.BoxShape2 = function(body, box)
|
||||
{
|
||||
var verts = [
|
||||
box.l, box.b,
|
||||
box.l, box.t,
|
||||
box.r, box.t,
|
||||
box.r, box.b
|
||||
];
|
||||
|
||||
return new cp.PolyShape(body, verts, cp.vzero);
|
||||
};
|
||||
|
||||
/// Initialize a box shaped polygon shape.
|
||||
cp.BoxShape = function(body, width, height)
|
||||
{
|
||||
var hw = width/2;
|
||||
var hh = height/2;
|
||||
|
||||
return cp.BoxShape2(body, new cp.BB(-hw, -hh, hw, hh));
|
||||
};
|
||||
|
||||
|
||||
/// Initialize an static body
|
||||
cp.BodyStatic = function()
|
||||
{
|
||||
return new cp.Body(Infinity, Infinity);
|
||||
};
|
||||
|
||||
|
||||
// "Bounding Box" compatibility with Chipmunk-JS
|
||||
cp.BB = function(l, b, r, t)
|
||||
{
|
||||
return {l:l, b:b, r:r, t:t};
|
||||
};
|
||||
|
||||
// helper function to create a BB
|
||||
cp.bb = function(l, b, r, t) {
|
||||
return new cp.BB(l, b, r, t);
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Some properties
|
||||
//
|
||||
// "handle" needed in some cases
|
||||
Object.defineProperties(cp.Base.prototype,
|
||||
{
|
||||
"handle" : {
|
||||
get : function(){
|
||||
return this.getHandle();
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
}
|
||||
});
|
||||
|
||||
// Properties, for Chipmunk-JS compatibility
|
||||
// Space properties
|
||||
Object.defineProperties(cp.Space.prototype,
|
||||
{
|
||||
"gravity" : {
|
||||
get : function(){
|
||||
return this.getGravity();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setGravity(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"iterations" : {
|
||||
get : function(){
|
||||
return this.getIterations();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setIterations(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"damping" : {
|
||||
get : function(){
|
||||
return this.getDamping();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setDamping(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"staticBody" : {
|
||||
get : function(){
|
||||
return this.getStaticBody();
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"idleSpeedThreshold" : {
|
||||
get : function(){
|
||||
return this.getIdleSpeedThreshold();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setIdleSpeedThreshold(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"sleepTimeThreshold": {
|
||||
get : function(){
|
||||
return this.getSleepTimeThreshold();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setSleepTimeThreshold(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"collisionSlop": {
|
||||
get : function(){
|
||||
return this.getCollisionSlop();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setCollisionSlop(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"collisionBias": {
|
||||
get : function(){
|
||||
return this.getCollisionBias();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setCollisionBias(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"collisionPersistence": {
|
||||
get : function(){
|
||||
return this.getCollisionPersistence();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setCollisionPersistence(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"enableContactGraph": {
|
||||
get : function(){
|
||||
return this.getEnableContactGraph();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setEnableContactGraph(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
}
|
||||
});
|
||||
|
||||
// Body properties
|
||||
Object.defineProperties(cp.Body.prototype,
|
||||
{
|
||||
"a" : {
|
||||
get : function(){
|
||||
return this.getAngle();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setAngle(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"w" : {
|
||||
get : function(){
|
||||
return this.getAngVel();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setAngVel(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"p" : {
|
||||
get : function(){
|
||||
return this.getPos();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setPos(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"v" : {
|
||||
get : function(){
|
||||
return this.getVel();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setVel(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
},
|
||||
"i" : {
|
||||
get : function(){
|
||||
return this.getMoment();
|
||||
},
|
||||
set : function(newValue){
|
||||
this.setMoment(newValue);
|
||||
},
|
||||
enumerable : true,
|
||||
configurable : true
|
||||
}
|
||||
|
||||
});
|
|
@ -0,0 +1,505 @@
|
|||
//
|
||||
// cocos2d constants
|
||||
//
|
||||
cc.DIRECTOR_PROJECTION_2D = 0;
|
||||
cc.DIRECTOR_PROJECTION_3D = 1;
|
||||
|
||||
cc.TEXTURE_PIXELFORMAT_RGBA8888 = 0;
|
||||
cc.TEXTURE_PIXELFORMAT_RGB888 = 1;
|
||||
cc.TEXTURE_PIXELFORMAT_RGB565 = 2;
|
||||
cc.TEXTURE_PIXELFORMAT_A8 = 3;
|
||||
cc.TEXTURE_PIXELFORMAT_I8 = 4;
|
||||
cc.TEXTURE_PIXELFORMAT_AI88 = 5;
|
||||
cc.TEXTURE_PIXELFORMAT_RGBA4444 = 6;
|
||||
cc.TEXTURE_PIXELFORMAT_RGB5A1 = 7;
|
||||
cc.TEXTURE_PIXELFORMAT_PVRTC4 = 8;
|
||||
cc.TEXTURE_PIXELFORMAT_PVRTC4 = 9;
|
||||
cc.TEXTURE_PIXELFORMAT_DEFAULT = cc.TEXTURE_PIXELFORMAT_RGBA8888;
|
||||
|
||||
cc.TEXT_ALIGNMENT_LEFT = 0;
|
||||
cc.TEXT_ALIGNMENT_CENTER = 1;
|
||||
cc.TEXT_ALIGNMENT_RIGHT = 2;
|
||||
|
||||
cc.VERTICAL_TEXT_ALIGNMENT_TOP = 0;
|
||||
cc.VERTICAL_TEXT_ALIGNMENT_CENTER = 1;
|
||||
cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM = 2;
|
||||
|
||||
cc.IMAGE_FORMAT_JPEG = 0;
|
||||
cc.IMAGE_FORMAT_PNG = 0;
|
||||
|
||||
cc.PROGRESS_TIMER_TYPE_RADIAL = 0;
|
||||
cc.PROGRESS_TIMER_TYPE_BAR = 1;
|
||||
|
||||
cc.PARTICLE_TYPE_FREE = 0;
|
||||
cc.PARTICLE_TYPE_RELATIVE = 1;
|
||||
cc.PARTICLE_TYPE_GROUPED = 2;
|
||||
cc.PARTICLE_DURATION_INFINITY = -1;
|
||||
cc.PARTICLE_MODE_GRAVITY = 0;
|
||||
cc.PARTICLE_MODE_RADIUS = 1;
|
||||
cc.PARTICLE_START_SIZE_EQUAL_TO_END_SIZE = -1;
|
||||
cc.PARTICLE_START_RADIUS_EQUAL_TO_END_RADIUS = -1;
|
||||
|
||||
cc.TOUCH_ALL_AT_ONCE = 0;
|
||||
cc.TOUCH_ONE_BY_ONE = 1;
|
||||
|
||||
cc.TMX_TILE_HORIZONTAL_FLAG = 0x80000000;
|
||||
cc.TMX_TILE_VERTICAL_FLAG = 0x40000000;
|
||||
cc.TMX_TILE_DIAGONAL_FLAG = 0x20000000;
|
||||
|
||||
cc.TRANSITION_ORIENTATION_LEFT_OVER = 0;
|
||||
cc.TRANSITION_ORIENTATION_RIGHT_OVER = 1;
|
||||
cc.TRANSITION_ORIENTATION_UP_OVER = 0;
|
||||
cc.TRANSITION_ORIENTATION_DOWN_OVER = 1;
|
||||
|
||||
cc.RED = {r:255, g:0, b:0};
|
||||
cc.GREEN = {r:0, g:255, b:0};
|
||||
cc.BLUE = {r:0, g:0, b:255};
|
||||
cc.BLACK = {r:0, g:0, b:0};
|
||||
cc.WHITE = {r:255, g:255, b:255};
|
||||
|
||||
cc.POINT_ZERO = {x:0, y:0};
|
||||
|
||||
// XXX: This definition is different than cocos2d-html5
|
||||
cc.REPEAT_FOREVER = -1;
|
||||
// reusable objects
|
||||
cc._reuse_p = [
|
||||
{x:0, y:0},
|
||||
{x:0, y:0},
|
||||
{x:0, y:0},
|
||||
{x:0, y:0}
|
||||
];
|
||||
|
||||
cc._reuse_p_index = 0;
|
||||
cc._reuse_size = {width:0, height:0};
|
||||
cc._reuse_rect = {x:0, y:0, width:0, height:0};
|
||||
cc._reuse_color3b = {r:255, g:255, b:255 };
|
||||
cc._reuse_color4b = {r:255, g:255, b:255, a:255 };
|
||||
|
||||
//
|
||||
// Point
|
||||
//
|
||||
cc.p = function( x, y )
|
||||
{
|
||||
return {x:x, y:y};
|
||||
};
|
||||
|
||||
cc.g = cc.g || cc.p;
|
||||
cc._reuse_grid = cc.g(0,0);
|
||||
|
||||
cc.log = cc.log || log;
|
||||
|
||||
//
|
||||
// Color 3B
|
||||
//
|
||||
cc.c3b = function (r, g, b) {
|
||||
return {r:r, g:g, b:b };
|
||||
};
|
||||
cc._c3b = function (r, g, b) {
|
||||
cc._reuse_color3b.r = r;
|
||||
cc._reuse_color3b.g = g;
|
||||
cc._reuse_color3b.b = b;
|
||||
return cc._reuse_color3b;
|
||||
};
|
||||
|
||||
//
|
||||
// Color 4B
|
||||
//
|
||||
cc.c4b = function (r, g, b, a) {
|
||||
return {r:r, g:g, b:b, a:a };
|
||||
};
|
||||
cc._c4b = function (r, g, b, a) {
|
||||
cc._reuse_color4b.r = r;
|
||||
cc._reuse_color4b.g = g;
|
||||
cc._reuse_color4b.b = b;
|
||||
cc._reuse_color4b.a = a;
|
||||
return cc._reuse_color4b;
|
||||
};
|
||||
// compatibility
|
||||
cc.c4 = cc.c4b;
|
||||
cc._c4 = cc._c4b;
|
||||
|
||||
//
|
||||
// Color 4F
|
||||
//
|
||||
cc.c4f = function (r, g, b, a) {
|
||||
return {r:r, g:g, b:b, a:a };
|
||||
};
|
||||
|
||||
//
|
||||
// Point
|
||||
//
|
||||
cc.p = function (x, y) {
|
||||
return {x:x, y:y};
|
||||
};
|
||||
cc._p = function (x, y) {
|
||||
if (cc._reuse_p_index == cc._reuse_p.length)
|
||||
cc._reuse_p_index = 0;
|
||||
|
||||
var p = cc._reuse_p[ cc._reuse_p_index];
|
||||
cc._reuse_p_index++;
|
||||
p.x = x;
|
||||
p.y = y;
|
||||
return p;
|
||||
};
|
||||
|
||||
cc.pointEqualToPoint = function (point1, point2) {
|
||||
return ((point1.x == point2.x) && (point1.y == point2.y));
|
||||
};
|
||||
|
||||
//
|
||||
// Grid
|
||||
//
|
||||
cc.g = function (x, y) {
|
||||
return {x:x, y:y};
|
||||
};
|
||||
cc._g = function (x, y) {
|
||||
cc._reuse_grid.x = x;
|
||||
cc._reuse_grid.y = y;
|
||||
return cc._reuse_grid;
|
||||
};
|
||||
|
||||
//
|
||||
// Size
|
||||
//
|
||||
cc.size = function (w, h) {
|
||||
return {width:w, height:h};
|
||||
};
|
||||
cc._size = function (w, h) {
|
||||
cc._reuse_size.width = w;
|
||||
cc._reuse_size.height = h;
|
||||
return cc._reuse_size;
|
||||
};
|
||||
cc.sizeEqualToSize = function (size1, size2) {
|
||||
return ((size1.width == size2.width) && (size1.height == size2.height));
|
||||
};
|
||||
|
||||
//
|
||||
// Rect
|
||||
//
|
||||
cc.rect = function (x, y, w, h) {
|
||||
return {x:x, y:y, width:w, height:h};
|
||||
};
|
||||
cc._rect = function(x,y,w,h)
|
||||
{
|
||||
cc._reuse_rect.x = x;
|
||||
cc._reuse_rect.y = y;
|
||||
cc._reuse_rect.width = w;
|
||||
cc._reuse_rect.height = h;
|
||||
return cc._reuse_rect;
|
||||
};
|
||||
cc.rectEqualToRect = function (rect1, rect2) {
|
||||
return ( rect1.x==rect2.x && rect1.y==rect2.y && rect1.width==rect2.width && rect1.height==rect2.height);
|
||||
};
|
||||
|
||||
cc._rect = function (x, y, w, h) {
|
||||
cc._reuse_rect.x = x;
|
||||
cc._reuse_rect.y = y;
|
||||
cc._reuse_rect.width = w;
|
||||
cc._reuse_rect.height = h;
|
||||
return cc._reuse_rect;
|
||||
};
|
||||
cc.rectEqualToRect = function (rect1, rect2) {
|
||||
return ( rect1.x == rect2.x && rect1.y == rect2.y && rect1.width == rect2.width && rect1.height == rect2.height);
|
||||
};
|
||||
|
||||
cc.rectContainsRect = function (rect1, rect2) {
|
||||
if ((rect1.x >= rect2.x) || (rect1.y >= rect2.y) ||
|
||||
( rect1.x + rect1.width <= rect2.x + rect2.width) ||
|
||||
( rect1.y + rect1.height <= rect2.y + rect2.height))
|
||||
return false;
|
||||
return true;
|
||||
};
|
||||
|
||||
cc.rectGetMaxX = function (rect) {
|
||||
return (rect.x + rect.width);
|
||||
};
|
||||
|
||||
cc.rectGetMidX = function (rect) {
|
||||
return (rect.x + rect.width / 2.0);
|
||||
};
|
||||
|
||||
cc.rectGetMinX = function (rect) {
|
||||
return rect.x;
|
||||
};
|
||||
|
||||
cc.rectGetMaxY = function (rect) {
|
||||
return(rect.y + rect.height);
|
||||
};
|
||||
|
||||
cc.rectGetMidY = function (rect) {
|
||||
return rect.y + rect.height / 2.0;
|
||||
};
|
||||
|
||||
cc.rectGetMinY = function (rect) {
|
||||
return rect.y;
|
||||
};
|
||||
|
||||
cc.rectContainsPoint = function (rect, point) {
|
||||
var ret = false;
|
||||
if (point.x >= rect.x && point.x <= rect.x + rect.width &&
|
||||
point.y >= rect.y && point.y <= rect.y + rect.height) {
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
||||
// XXX Should be done in native
|
||||
cc.rectIntersectsRect = function (rectA, rectB) {
|
||||
var bool = !( rectA.x > rectB.x + rectB.width ||
|
||||
rectA.x + rectA.width < rectB.x ||
|
||||
rectA.y > rectB.y + rectB.height ||
|
||||
rectA.y + rectA.height < rectB.y );
|
||||
|
||||
return bool;
|
||||
};
|
||||
|
||||
cc.rectUnion = function (rectA, rectB) {
|
||||
var rect = cc.rect(0, 0, 0, 0);
|
||||
rect.x = Math.min(rectA.x, rectB.x);
|
||||
rect.y = Math.min(rectA.y, rectB.y);
|
||||
rect.width = Math.max(rectA.x + rectA.width, rectB.x + rectB.width) - rect.x;
|
||||
rect.height = Math.max(rectA.y + rectA.height, rectB.y + rectB.height) - rect.y;
|
||||
return rect;
|
||||
};
|
||||
|
||||
cc.rectIntersection = function (rectA, rectB) {
|
||||
var intersection = cc.rect(
|
||||
Math.max(rectA.x, rectB.x),
|
||||
Math.max(rectA.y, rectB.y),
|
||||
0, 0);
|
||||
|
||||
intersection.width = Math.min(rectA.x + rectA.width, rectB.x + rectB.width) - intersection.x;
|
||||
intersection.height = Math.min(rectA.y + rectA.height, rectB.y + rectB.height) - intersection.y;
|
||||
return intersection;
|
||||
};
|
||||
|
||||
//
|
||||
// Array: for cocos2d-html5 compatibility
|
||||
//
|
||||
cc.ArrayRemoveObject = function (arr, delObj) {
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (arr[i] == delObj) {
|
||||
arr.splice(i, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// Helpers
|
||||
//
|
||||
cc.dump = function (obj) {
|
||||
for (var i in obj)
|
||||
cc.log(i + " = " + obj[i]);
|
||||
};
|
||||
|
||||
// dump config info, but only in debug mode
|
||||
cc.dumpConfig = function () {
|
||||
if (cc.config.debug)
|
||||
cc.dump(cc.config);
|
||||
};
|
||||
|
||||
//
|
||||
// Bindings Overrides
|
||||
//
|
||||
// MenuItemToggle
|
||||
cc.MenuItemToggle.create = function( /* var args */) {
|
||||
|
||||
var n = arguments.length;
|
||||
|
||||
if (typeof arguments[n-2] === 'function' || typeof arguments[n-1] === 'function') {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var obj = null;
|
||||
if( typeof arguments[n-2] === 'function' )
|
||||
obj = args.pop();
|
||||
|
||||
var func = args.pop();
|
||||
|
||||
// create it with arguments,
|
||||
var item = cc.MenuItemToggle._create.apply(this, args);
|
||||
|
||||
// then set the callback
|
||||
if( obj !== null )
|
||||
item.setCallback(func, obj);
|
||||
else
|
||||
item.setCallback(func);
|
||||
return item;
|
||||
} else {
|
||||
return cc.MenuItemToggle._create.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
// LabelAtlas
|
||||
cc.LabelAtlas.create = function( a,b,c,d,e ) {
|
||||
|
||||
var n = arguments.length;
|
||||
|
||||
if ( n == 5) {
|
||||
return cc.LabelAtlas._create(a,b,c,d,e.charCodeAt(0));
|
||||
} else {
|
||||
return cc.LabelAtlas._create.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
// PhysicsDebugNode
|
||||
cc.PhysicsDebugNode.create = function( space ) {
|
||||
var s = space;
|
||||
if( space.handle !== undefined )
|
||||
s = space.handle;
|
||||
return cc.PhysicsDebugNode._create( s );
|
||||
};
|
||||
cc.PhysicsDebugNode.prototype.setSpace = function( space ) {
|
||||
var s = space;
|
||||
if( space.handle !== undefined )
|
||||
s = space.handle;
|
||||
return this._setSpace( s );
|
||||
};
|
||||
|
||||
// PhysicsSprite
|
||||
cc.PhysicsSprite.prototype.setBody = function( body ) {
|
||||
var b = body;
|
||||
if( body.handle !== undefined )
|
||||
b = body.handle;
|
||||
return this._setBody( b );
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Associates a base class with a native superclass
|
||||
* @function
|
||||
* @param {object} jsobj subclass
|
||||
* @param {object} klass superclass
|
||||
*/
|
||||
cc.associateWithNative = function (jsobj, superclass_or_instance) {
|
||||
|
||||
try {
|
||||
// Used when subclassing using the "extend" method
|
||||
var native = new superclass_or_instance();
|
||||
__associateObjWithNative(jsobj, native);
|
||||
} catch (err) {
|
||||
// Used when subclassing using the goog.inherits method
|
||||
__associateObjWithNative(jsobj, superclass_or_instance);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// JSB supports 2 official ways to create subclasses
|
||||
//
|
||||
// 1) Google "subclasses" borrowed from closure library
|
||||
// This is the recommended way to do it
|
||||
//
|
||||
|
||||
cc.inherits = function (childCtor, parentCtor) {
|
||||
/** @constructor */
|
||||
function tempCtor() {};
|
||||
tempCtor.prototype = parentCtor.prototype;
|
||||
childCtor.superClass_ = parentCtor.prototype;
|
||||
childCtor.prototype = new tempCtor();
|
||||
childCtor.prototype.constructor = childCtor;
|
||||
|
||||
// Copy "static" method, but doesn't generate subclasses.
|
||||
// for( var i in parentCtor ) {
|
||||
// childCtor[ i ] = parentCtor[ i ];
|
||||
// }
|
||||
};
|
||||
|
||||
cc.base = function (me, opt_methodName, var_args) {
|
||||
var caller = arguments.callee.caller;
|
||||
if (caller.superClass_) {
|
||||
// This is a constructor. Call the superclass constructor.
|
||||
ret = caller.superClass_.constructor.apply(me, Array.prototype.slice.call(arguments, 1));
|
||||
return ret;
|
||||
}
|
||||
|
||||
var args = Array.prototype.slice.call(arguments, 2);
|
||||
var foundCaller = false;
|
||||
for (var ctor = me.constructor;
|
||||
ctor; ctor = ctor.superClass_ && ctor.superClass_.constructor) {
|
||||
if (ctor.prototype[opt_methodName] === caller) {
|
||||
foundCaller = true;
|
||||
} else if (foundCaller) {
|
||||
return ctor.prototype[opt_methodName].apply(me, args);
|
||||
}
|
||||
}
|
||||
|
||||
// If we did not find the caller in the prototype chain,
|
||||
// then one of two things happened:
|
||||
// 1) The caller is an instance method.
|
||||
// 2) This method was not called by the right caller.
|
||||
if (me[opt_methodName] === caller) {
|
||||
return me.constructor.prototype[opt_methodName].apply(me, args);
|
||||
} else {
|
||||
throw Error(
|
||||
'cc.base called from a method of one name ' +
|
||||
'to a method of a different name');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// 2) Using "extend" subclassing
|
||||
// Simple JavaScript Inheritance By John Resig http://ejohn.org/
|
||||
//
|
||||
cc.Class = function () {};
|
||||
cc.Class.extend = function (prop) {
|
||||
var _super = this.prototype;
|
||||
|
||||
// Instantiate a base class (but only create the instance,
|
||||
// don't run the init constructor)
|
||||
initializing = true;
|
||||
var prototype = new this();
|
||||
initializing = false;
|
||||
fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
|
||||
|
||||
// Copy the properties over onto the new prototype
|
||||
for (var name in prop) {
|
||||
// Check if we're overwriting an existing function
|
||||
prototype[name] = typeof prop[name] == "function" &&
|
||||
typeof _super[name] == "function" && fnTest.test(prop[name]) ?
|
||||
(function (name, fn) {
|
||||
return function () {
|
||||
var tmp = this._super;
|
||||
|
||||
// Add a new ._super() method that is the same method
|
||||
// but on the super-class
|
||||
this._super = _super[name];
|
||||
|
||||
// The method only need to be bound temporarily, so we
|
||||
// remove it when we're done executing
|
||||
var ret = fn.apply(this, arguments);
|
||||
this._super = tmp;
|
||||
|
||||
return ret;
|
||||
};
|
||||
})(name, prop[name]) :
|
||||
prop[name];
|
||||
}
|
||||
|
||||
// The dummy class constructor
|
||||
function Class() {
|
||||
// All construction is actually done in the init method
|
||||
if (!initializing && this.ctor)
|
||||
this.ctor.apply(this, arguments);
|
||||
}
|
||||
|
||||
// Populate our constructed prototype object
|
||||
Class.prototype = prototype;
|
||||
|
||||
// Enforce the constructor to be what we expect
|
||||
Class.prototype.constructor = Class;
|
||||
|
||||
// And make this class extendable
|
||||
Class.extend = arguments.callee;
|
||||
|
||||
return Class;
|
||||
};
|
||||
|
||||
cc.Node.prototype.ctor = function () {};
|
||||
cc.Node.extend = cc.Class.extend;
|
||||
cc.Layer.extend = cc.Class.extend;
|
||||
cc.LayerGradient.extend = cc.Class.extend;
|
||||
cc.LayerColor.extend = cc.Class.extend;
|
||||
cc.Sprite.extend = cc.Class.extend;
|
||||
cc.MenuItemFont.extend = cc.Class.extend;
|
||||
cc.Scene.extend = cc.Class.extend;
|
|
@ -0,0 +1,118 @@
|
|||
//
|
||||
// CocosBuilder definitions
|
||||
//
|
||||
|
||||
cc.Reader = {};
|
||||
|
||||
var _ccbGlobalContext = this;
|
||||
|
||||
cc.Reader.load = function(file, owner, parentSize)
|
||||
{
|
||||
// Load the node graph using the correct function
|
||||
var reader = cc._Reader.create();
|
||||
var node;
|
||||
|
||||
if (owner && parentSize)
|
||||
{
|
||||
node = reader.load(file, owner, parentSize);
|
||||
}
|
||||
else if (owner)
|
||||
{
|
||||
node = reader.load(file,owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
node = reader.load(file);
|
||||
}
|
||||
|
||||
// Assign owner callbacks & member variables
|
||||
if (owner)
|
||||
{
|
||||
// Callbacks
|
||||
var ownerCallbackNames = reader.getOwnerCallbackNames();
|
||||
var ownerCallbackNodes = reader.getOwnerCallbackNodes();
|
||||
|
||||
for (var i = 0; i < ownerCallbackNames.length; i++)
|
||||
{
|
||||
var callbackName = ownerCallbackNames[i];
|
||||
var callbackNode = ownerCallbackNodes[i];
|
||||
|
||||
callbackNode.setCallback(owner[callbackName], owner);
|
||||
}
|
||||
|
||||
// Variables
|
||||
var ownerOutletNames = reader.getOwnerOutletNames();
|
||||
var ownerOutletNodes = reader.getOwnerOutletNodes();
|
||||
|
||||
for (var i = 0; i < ownerOutletNames.length; i++)
|
||||
{
|
||||
var outletName = ownerOutletNames[i];
|
||||
var outletNode = ownerOutletNodes[i];
|
||||
|
||||
owner[outletName] = outletNode;
|
||||
}
|
||||
}
|
||||
|
||||
var nodesWithAnimationManagers = reader.getNodesWithAnimationManagers();
|
||||
var animationManagersForNodes = reader.getAnimationManagersForNodes();
|
||||
|
||||
// Attach animation managers to nodes and assign root node callbacks and member variables
|
||||
for (var i = 0; i < nodesWithAnimationManagers.length; i++)
|
||||
{
|
||||
var innerNode = nodesWithAnimationManagers[i];
|
||||
var animationManager = animationManagersForNodes[i];
|
||||
|
||||
innerNode.animationManager = animationManager;
|
||||
|
||||
var documentControllerName = animationManager.getDocumentControllerName();
|
||||
if (!documentControllerName) continue;
|
||||
|
||||
// Create a document controller
|
||||
var controller = new _ccbGlobalContext[documentControllerName]();
|
||||
controller.controllerName = documentControllerName;
|
||||
|
||||
innerNode.controller = controller;
|
||||
controller.rootNode = innerNode;
|
||||
|
||||
// Callbacks
|
||||
var documentCallbackNames = animationManager.getDocumentCallbackNames();
|
||||
var documentCallbackNodes = animationManager.getDocumentCallbackNodes();
|
||||
|
||||
for (var j = 0; j < documentCallbackNames.length; j++)
|
||||
{
|
||||
var callbackName = documentCallbackNames[j];
|
||||
var callbackNode = documentCallbackNodes[j];
|
||||
|
||||
callbackNode.setCallback(controller[callbackName], controller);
|
||||
}
|
||||
|
||||
|
||||
// Variables
|
||||
var documentOutletNames = animationManager.getDocumentOutletNames();
|
||||
var documentOutletNodes = animationManager.getDocumentOutletNodes();
|
||||
|
||||
for (var j = 0; j < documentOutletNames.length; j++)
|
||||
{
|
||||
var outletName = documentOutletNames[j];
|
||||
var outletNode = documentOutletNodes[j];
|
||||
|
||||
controller[outletName] = outletNode;
|
||||
}
|
||||
|
||||
if (typeof(controller.onDidLoadFromCCB) == "function")
|
||||
{
|
||||
controller.onDidLoadFromCCB();
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
cc.Reader.loadAsScene = function(file, owner, parentSize)
|
||||
{
|
||||
var node = cc.Reader.load(file, owner, parentSize);
|
||||
var scene = cc.Scene.create();
|
||||
scene.addChild( node );
|
||||
|
||||
return scene;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// OpenGL defines
|
||||
//
|
||||
|
||||
var gl = gl || {};
|
||||
gl.NEAREST = 0x2600;
|
||||
gl.LINEAR = 0x2601;
|
||||
gl.REPEAT = 0x2901;
|
||||
gl.CLAMP_TO_EDGE = 0x812F;
|
||||
gl.CLAMP_TO_BORDER = 0x812D;
|
||||
gl.LINEAR_MIPMAP_NEAREST = 0x2701;
|
||||
gl.NEAREST_MIPMAP_NEAREST = 0x2700;
|
||||
gl.ZERO = 0;
|
||||
gl.ONE = 1;
|
||||
gl.SRC_COLOR = 0x0300;
|
||||
gl.ONE_MINUS_SRC_COLOR = 0x0301;
|
||||
gl.SRC_ALPHA = 0x0302;
|
||||
gl.ONE_MINUS_SRC_ALPHA = 0x0303;
|
||||
gl.DST_ALPHA = 0x0304;
|
||||
gl.ONE_MINUS_DST_ALPHA = 0x0305;
|
||||
gl.DST_COLOR = 0x0306;
|
||||
gl.ONE_MINUS_DST_COLOR = 0x0307;
|
||||
gl.SRC_ALPHA_SATURATE = 0x0308;
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>TestJavascript</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.cocos2dx.testjavascript"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0">
|
||||
|
||||
<uses-sdk android:minSdkVersion="8"/>
|
||||
|
||||
<application android:label="@string/app_name"
|
||||
android:debuggable="true"
|
||||
android:icon="@drawable/icon">
|
||||
|
||||
<activity android:name=".TestJavascript"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:configChanges="orientation">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
<supports-screens android:largeScreens="true"
|
||||
android:smallScreens="true"
|
||||
android:anyDensity="true"
|
||||
android:normalScreens="true"/>
|
||||
</manifest>
|
|
@ -0,0 +1 @@
|
|||
aapt.ignore.assets="!*.pvr.gz:!*.gz:!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"
|
|
@ -0,0 +1,92 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="TestJavascript" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
|
@ -0,0 +1,87 @@
|
|||
APPNAME="TestJavascript"
|
||||
|
||||
# options
|
||||
|
||||
buildexternalsfromsource=
|
||||
PARALLEL_BUILD_FLAG=
|
||||
|
||||
usage(){
|
||||
cat << EOF
|
||||
usage: $0 [options]
|
||||
|
||||
Build C/C++ code for $APPNAME using Android NDK
|
||||
|
||||
OPTIONS:
|
||||
-s Build externals from source
|
||||
-p Run make with -j8 option to take advantage of multiple processors
|
||||
-h this help
|
||||
EOF
|
||||
}
|
||||
|
||||
while getopts "sph" OPTION; do
|
||||
case "$OPTION" in
|
||||
s)
|
||||
buildexternalsfromsource=1
|
||||
;;
|
||||
p)
|
||||
PARALLEL_BUILD_FLAG=\-j8
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# exit this script if any commmand fails
|
||||
set -e
|
||||
|
||||
# paths
|
||||
|
||||
if [ -z "${NDK_ROOT+aaa}" ];then
|
||||
echo "please define NDK_ROOT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
# ... use paths relative to current directory
|
||||
COCOS2DX_ROOT="$DIR/../../.."
|
||||
APP_ROOT="$DIR/.."
|
||||
APP_ANDROID_ROOT="$DIR"
|
||||
|
||||
echo
|
||||
echo "Paths"
|
||||
echo " NDK_ROOT = $NDK_ROOT"
|
||||
echo " COCOS2DX_ROOT = $COCOS2DX_ROOT"
|
||||
echo " APP_ROOT = $APP_ROOT"
|
||||
echo " APP_ANDROID_ROOT = $APP_ANDROID_ROOT"
|
||||
echo
|
||||
|
||||
# Debug
|
||||
set -x
|
||||
|
||||
# make sure assets is exist
|
||||
if [ -d "$APP_ANDROID_ROOT"/assets ]; then
|
||||
rm -rf "$APP_ANDROID_ROOT"/assets
|
||||
fi
|
||||
|
||||
mkdir "$APP_ANDROID_ROOT"/assets
|
||||
mkdir "$APP_ANDROID_ROOT"/assets/res
|
||||
|
||||
# copy "cocos2d-js-tests/res" into "assets/res"
|
||||
cp -rf "$APP_ROOT"/cocos2d-js-tests/res "$APP_ANDROID_ROOT"/assets
|
||||
|
||||
# copy src/**/*.js from cocos2d-js-tests into assets' root
|
||||
cp -rf "$APP_ROOT"/cocos2d-js-tests/src "$APP_ANDROID_ROOT"/assets
|
||||
|
||||
# copy bindings/*.js into assets' root
|
||||
cp -f "$APP_ROOT"/bindings/*.js "$APP_ANDROID_ROOT"/assets
|
||||
|
||||
echo "Using prebuilt externals"
|
||||
echo
|
||||
|
||||
set -x
|
||||
|
||||
"$NDK_ROOT"/ndk-build $PARALLEL_BUILD_FLAG -C "$APP_ANDROID_ROOT" $* \
|
||||
"NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" \
|
||||
NDK_LOG=0 V=0
|
|
@ -0,0 +1,28 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := watermelonwithme_shared
|
||||
|
||||
LOCAL_MODULE_FILENAME := libwatermelonwithme
|
||||
|
||||
LOCAL_SRC_FILES := watermelonwithme/main.cpp \
|
||||
../../Classes/AppDelegate.cpp
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += spidermonkey_static
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += scriptingcore-spidermonkey
|
||||
|
||||
LOCAL_EXPORT_CFLAGS := -DCOCOS2D_DEBUG=2 -DCOCOS2D_JAVASCRIPT
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
$(call import-module,cocos2dx)
|
||||
$(call import-module,CocosDenshion/android)
|
||||
$(call import-module,external/chipmunk)
|
||||
$(call import-module,scripting/javascript/spidermonkey-android)
|
||||
$(call import-module,scripting/javascript/bindings)
|
|
@ -0,0 +1,3 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1
|
||||
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
|
@ -0,0 +1,45 @@
|
|||
#include "AppDelegate.h"
|
||||
#include "cocos2d.h"
|
||||
#include "platform/android/jni/JniHelper.h"
|
||||
#include "CCEventType.h"
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
|
||||
#define LOG_TAG "main"
|
||||
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
|
||||
|
||||
using namespace cocos2d;
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||
{
|
||||
JniHelper::setJavaVM(vm);
|
||||
|
||||
return JNI_VERSION_1_4;
|
||||
}
|
||||
|
||||
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h)
|
||||
{
|
||||
if (!CCDirector::sharedDirector()->getOpenGLView())
|
||||
{
|
||||
CCEGLView *view = CCEGLView::sharedOpenGLView();
|
||||
view->setFrameSize(w, h);
|
||||
|
||||
AppDelegate *pAppDelegate = new AppDelegate();
|
||||
CCApplication::sharedApplication()->run();
|
||||
}
|
||||
else
|
||||
{
|
||||
ccDrawInit();
|
||||
ccGLInvalidateStateCache();
|
||||
|
||||
CCShaderCache::sharedShaderCache()->reloadDefaultShaders();
|
||||
CCTextureCache::reloadAllTextures();
|
||||
CCNotificationCenter::sharedNotificationCenter()->postNotification(EVNET_COME_TO_FOREGROUND, NULL);
|
||||
CCDirector::sharedDirector()->setGLDefaultValues();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
APPNAME="TestJavascript"
|
||||
APP_ANDROID_NAME="org.cocos2dx.testjavascript"
|
||||
|
||||
if [ -z "${SDK_ROOT+aaa}" ]; then
|
||||
# ... if SDK_ROOT is not set, use "$HOME/bin/android-sdk"
|
||||
SDK_ROOT="$HOME/bin/android-sdk"
|
||||
fi
|
||||
|
||||
if [ -z "${NDK_ROOT+aaa}" ]; then
|
||||
# ... if NDK_ROOT is not set, use "$HOME/bin/android-ndk"
|
||||
NDK_ROOT="$HOME/bin/android-ndk"
|
||||
fi
|
||||
|
||||
if [ -z "${COCOS2DX_ROOT+aaa}" ]; then
|
||||
# ... if COCOS2DX_ROOT is not set
|
||||
# ... find current working directory
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
# ... use paths relative to current directory
|
||||
COCOS2DX_ROOT="$DIR/../../.."
|
||||
APP_ROOT="$DIR/.."
|
||||
APP_ANDROID_ROOT="$DIR"
|
||||
else
|
||||
APP_ROOT="$COCOS2DX_ROOT/samples/$APPNAME"
|
||||
APP_ANDROID_ROOT="$COCOS2DX_ROOT/samples/$APPNAME/proj.android"
|
||||
fi
|
||||
|
||||
echo "NDK_ROOT = $NDK_ROOT"
|
||||
echo "SDK_ROOT = $SDK_ROOT"
|
||||
echo "COCOS2DX_ROOT = $COCOS2DX_ROOT"
|
||||
echo "APP_ROOT = $APP_ROOT"
|
||||
echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT"
|
||||
echo "APP_ANDROID_NAME = $APP_ANDROID_NAME"
|
||||
|
||||
echo
|
||||
echo "Killing and restarting ${APP_ANDROID_NAME}"
|
||||
echo
|
||||
|
||||
set -x
|
||||
|
||||
"${SDK_ROOT}"/platform-tools/adb shell am force-stop "${APP_ANDROID_NAME}"
|
||||
|
||||
NDK_MODULE_PATH="${COCOS2DX_ROOT}":"${COCOS2DX_ROOT}"/cocos2dx/platform/third_party/android/prebuilt \
|
||||
"${NDK_ROOT}"/ndk-gdb \
|
||||
--adb="${SDK_ROOT}"/platform-tools/adb \
|
||||
--verbose \
|
||||
--start \
|
||||
--force
|
|
@ -0,0 +1,20 @@
|
|||
# To enable ProGuard in your project, edit project.properties
|
||||
# to define the proguard.config property as described in that file.
|
||||
#
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the ProGuard
|
||||
# include property in project.properties.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
|
@ -0,0 +1,13 @@
|
|||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Project target.
|
||||
target=android-8
|
||||
|
||||
android.library.reference.1=../../../cocos2dx/platform/android/java
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">TestJavascript</string>
|
||||
</resources>
|
|
@ -0,0 +1,39 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010-2012 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
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
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
package org.cocos2dx.testjavascript;
|
||||
|
||||
import org.cocos2dx.lib.Cocos2dxActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class TestJavascript extends Cocos2dxActivity{
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState){
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("testjavascript");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// testjsAppController.h
|
||||
// testjs
|
||||
//
|
||||
// Created by Rolando Abarca on 3/19/12.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
|
||||
@class RootViewController;
|
||||
|
||||
@interface AppController : NSObject <UIAccelerometerDelegate, UIAlertViewDelegate, UITextFieldDelegate,UIApplicationDelegate> {
|
||||
UIWindow *window;
|
||||
RootViewController *viewController;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
//
|
||||
// testjsAppController.mm
|
||||
// testjs
|
||||
//
|
||||
// Created by Rolando Abarca on 3/19/12.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "AppController.h"
|
||||
#import "cocos2d.h"
|
||||
#import "EAGLView.h"
|
||||
#import "AppDelegate.h"
|
||||
|
||||
#import "RootViewController.h"
|
||||
|
||||
@implementation AppController
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Application lifecycle
|
||||
|
||||
// cocos2d application instance
|
||||
static AppDelegate s_sharedApplication;
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
// Override point for customization after application launch.
|
||||
|
||||
// Add the view controller's view to the window and display.
|
||||
window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
|
||||
EAGLView *__glView = [EAGLView viewWithFrame: [window bounds]
|
||||
pixelFormat: kEAGLColorFormatRGBA8
|
||||
depthFormat: GL_DEPTH_COMPONENT16 //_OES
|
||||
preserveBackbuffer: NO
|
||||
sharegroup: nil
|
||||
multiSampling: NO
|
||||
numberOfSamples: 0 ];
|
||||
|
||||
// Use RootViewController manage EAGLView
|
||||
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
|
||||
viewController.wantsFullScreenLayout = YES;
|
||||
viewController.view = __glView;
|
||||
|
||||
// Set RootViewController to window
|
||||
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
|
||||
{
|
||||
// warning: addSubView doesn't work on iOS6
|
||||
[window addSubview: viewController.view];
|
||||
}
|
||||
else
|
||||
{
|
||||
// use this method on ios6
|
||||
[window setRootViewController:viewController];
|
||||
}
|
||||
|
||||
[window makeKeyAndVisible];
|
||||
|
||||
[[UIApplication sharedApplication] setStatusBarHidden: YES];
|
||||
|
||||
cocos2d::CCApplication::sharedApplication()->run();
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application {
|
||||
/*
|
||||
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
*/
|
||||
cocos2d::CCDirector::sharedDirector()->pause();
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
/*
|
||||
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
*/
|
||||
cocos2d::CCDirector::sharedDirector()->resume();
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application {
|
||||
/*
|
||||
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
|
||||
*/
|
||||
cocos2d::CCApplication::sharedApplication()->applicationDidEnterBackground();
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application {
|
||||
/*
|
||||
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
|
||||
*/
|
||||
cocos2d::CCApplication::sharedApplication()->applicationWillEnterForeground();
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
/*
|
||||
Called when the application is about to terminate.
|
||||
See also applicationDidEnterBackground:.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Memory management
|
||||
|
||||
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
|
||||
/*
|
||||
Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
|
||||
*/
|
||||
cocos2d::CCDirector::sharedDirector()->purgeCachedData();
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1 @@
|
|||
66c6d1cead373b45218424f6a82f370897e443e4
|
|
@ -0,0 +1 @@
|
|||
84689888a14a2123d2b39f7f2f61be8c15207479
|
|
@ -0,0 +1,8 @@
|
|||
//
|
||||
// Prefix header for all source files of the 'testjs' target in the 'testjs' project
|
||||
//
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
|
@ -0,0 +1,33 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010-2011 cocos2d-x.org
|
||||
Copyright (c) 2010 Ricardo Quesada
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
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
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@interface RootViewController : UIViewController {
|
||||
|
||||
}
|
||||
|
||||
@end
|
|
@ -0,0 +1,73 @@
|
|||
//
|
||||
// testjsAppController.h
|
||||
// testjs
|
||||
//
|
||||
// Created by Rolando Abarca on 3/19/12.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RootViewController.h"
|
||||
|
||||
|
||||
@implementation RootViewController
|
||||
|
||||
/*
|
||||
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement loadView to create a view hierarchy programmatically, without using a nib.
|
||||
- (void)loadView {
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
*/
|
||||
// Override to allow orientations other than the default portrait orientation.
|
||||
// This method is deprecated on ios6
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
|
||||
}
|
||||
|
||||
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
|
||||
- (NSUInteger) supportedInterfaceOrientations{
|
||||
#ifdef __IPHONE_6_0
|
||||
return UIInterfaceOrientationMaskAllButUpsideDown;
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL) shouldAutorotate {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// main.m
|
||||
// testjs
|
||||
//
|
||||
// Created by Rolando Abarca on 3/19/12.
|
||||
// Copyright __MyCompanyName__ 2012. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
|
||||
[pool release];
|
||||
return retVal;
|
||||
}
|
|
@ -0,0 +1,208 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D0F06A44-A245-4D13-A498-0120C203B539}</ProjectGuid>
|
||||
<RootNamespace>WatermelonWithMe</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration).win32\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration).win32\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)testjs.tlb</TypeLibraryName>
|
||||
<HeaderFileName>testjs.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>testjs_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>testjs_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<PreLinkEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\lib\*.*" "$(OutDir)"
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<Link>
|
||||
<AdditionalDependencies>libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PreBuildEvent>
|
||||
<PreBuildEvent>
|
||||
<Message>Copy js and resource files.</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)testjs.tlb</TypeLibraryName>
|
||||
<HeaderFileName>testjs.h</HeaderFileName>
|
||||
<DllDataFileName>
|
||||
</DllDataFileName>
|
||||
<InterfaceIdentifierFileName>testjs_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>testjs_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<PreLinkEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
xcopy /Y /Q "$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\lib\*.*" "$(OutDir)"
|
||||
</Command>
|
||||
</PreLinkEvent>
|
||||
<Link>
|
||||
<AdditionalDependencies>libcocos2d.lib;libExtensions.lib;opengl32.lib;glew32.lib;libCocosDenshion.lib;libchipmunk.lib;mozjs.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
|
||||
if exist "$(OutDir)\WatermelonWithMeRes" rd /s /q "$(OutDir)\WatermelonWithMeRes"
|
||||
mkdir "$(OutDir)\WatermelonWithMeRes"
|
||||
xcopy "$(ProjectDir)..\cocos2d-js-tests\res" "$(OutDir)\WatermelonWithMeRes\res\" /e /Y
|
||||
xcopy "$(ProjectDir)..\bindings\*.js" "$(OutDir)\WatermelonWithMeRes" /e /Y
|
||||
xcopy "$(ProjectDir)..\cocos2d-js-tests\src" "$(OutDir)\WatermelonWithMeRes\src\" /e /Y
|
||||
</Command>
|
||||
<Message>Copy js and resource files.</Message>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_auto_classes.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_manual.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_registration.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_core.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_manual_conversions.cpp" />
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\ScriptingCore.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="..\Classes\AppDelegate.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.hpp" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.hpp" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_auto_classes.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_auto_classes_registration.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_manual.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_registration.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_config.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_core.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_manual_conversions.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\ScriptingCore.h" />
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\spidermonkey_specifics.h" />
|
||||
<ClInclude Include="main.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="..\Classes\AppDelegate.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\testjs.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="testjs.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\cocos2dx\proj.win32\cocos2d.vcxproj">
|
||||
<Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\CocosDenshion\proj.win32\CocosDenshion.vcxproj">
|
||||
<Project>{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="bindings">
|
||||
<UniqueIdentifier>{58ebb5df-595d-4e27-8c01-555be6f1c625}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="resource">
|
||||
<UniqueIdentifier>{ca9c9e15-d942-43a1-aa7a-5f0b74ca1afd}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;png;manifest</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="win32">
|
||||
<UniqueIdentifier>{ccb2323b-1cfa-41ea-bcf4-ba5f07309396}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Classes">
|
||||
<UniqueIdentifier>{e93a77e1-af1e-4400-87d3-504b62ebdbb0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="bindings\generated">
|
||||
<UniqueIdentifier>{146f26cf-13e1-4106-891b-4b0118ceac2b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>win32</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Classes\AppDelegate.cpp">
|
||||
<Filter>Classes</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.cpp">
|
||||
<Filter>bindings\generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_auto_classes.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_manual.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_registration.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_bindings_core.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\js_manual_conversions.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\scripting\javascript\bindings\ScriptingCore.cpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="main.h">
|
||||
<Filter>win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>win32</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Classes\AppDelegate.h">
|
||||
<Filter>Classes</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\generated\cocos2dx.hpp">
|
||||
<Filter>bindings\generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocos2d_specifics.hpp">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\cocosjs_manual_conversions.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_ccbreader.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_auto_classes.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_auto_classes_registration.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_functions.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_manual.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_chipmunk_registration.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_config.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_bindings_core.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\js_manual_conversions.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\ScriptingCore.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\scripting\javascript\bindings\spidermonkey_specifics.h">
|
||||
<Filter>bindings</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\testjs.ico">
|
||||
<Filter>resource</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="testjs.rc">
|
||||
<Filter>resource</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(OutDir)\WatermelonWithMeRes</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LocalDebuggerWorkingDirectory>$(OutDir)\WatermelonWithMeRes</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,37 @@
|
|||
#include "main.h"
|
||||
#include "AppDelegate.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
USING_NS_CC;
|
||||
|
||||
// uncomment below line, open debug console
|
||||
// #define USE_WIN32_CONSOLE
|
||||
|
||||
int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPTSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
#ifdef USE_WIN32_CONSOLE
|
||||
AllocConsole();
|
||||
freopen("CONIN$", "r", stdin);
|
||||
freopen("CONOUT$", "w", stdout);
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
#endif
|
||||
|
||||
// create the application instance
|
||||
AppDelegate app;
|
||||
CCEGLView* eglView = CCEGLView::sharedOpenGLView();
|
||||
eglView->setFrameSize(800, 450);
|
||||
|
||||
int ret = CCApplication::sharedApplication()->run();
|
||||
|
||||
#ifdef USE_WIN32_CONSOLE
|
||||
FreeConsole();
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// C RunTime Header Files
|
||||
#include "CCStdC.h"
|
||||
|
||||
#endif // __WINMAIN_H__
|
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
|
@ -0,0 +1,20 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by testjs.RC
|
||||
//
|
||||
|
||||
#define IDS_PROJNAME 100
|
||||
#define IDR_TESTJS 100
|
||||
|
||||
#define ID_FILE_NEW_WINDOW 32771
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 201
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 32775
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,86 @@
|
|||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON "res\\testjs.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "testjs Module\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "testjs\0"
|
||||
VALUE "LegalCopyright", "Copyright \0"
|
||||
VALUE "OriginalFilename", "testjs.exe\0"
|
||||
VALUE "ProductName", "testjs Module\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x0409, 0x04B0
|
||||
END
|
||||
END
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue