Permalink
Browse files

Rename project to Ching Chong Ping Pong (CCPP)

Changed the package from "com.pujoy.swheels" to  "com.pujoy.ccpp".
Upgraded cocos2d-x version
  • Loading branch information...
chen-yumin committed Mar 12, 2015
1 parent 9ba6197 commit b1b744dadfd55a8dbecd7c3175138c173c70dfa6
View
@@ -1,235 +1,137 @@
cmake_minimum_required(VERSION 2.6)
#/****************************************************************************
# Copyright (c) 2013-2014 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.
# ****************************************************************************/
cmake_policy(SET CMP0017 NEW)
cmake_minimum_required(VERSION 2.8)
set(APP_NAME MyGame)
project (${APP_NAME})
include(cocos2d/build/BuildHelpers.CMakeLists.txt)
option(USE_CHIPMUNK "Use chipmunk for physics library" ON)
option(USE_BOX2D "Use box2d for physics library" OFF)
option(DEBUG_MODE "Debug or release?" ON)
if(DEBUG_MODE)
set(CMAKE_BUILD_TYPE DEBUG)
else(DEBUG_MODE)
set(CMAKE_BUILD_TYPE RELEASE)
endif(DEBUG_MODE)
if (MSVC)
set(CMAKE_C_FLAGS_DEBUG "-DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${COCOS2D_ROOT}/cmake/Modules/")
include(CocosBuildHelpers)
elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
# libcocos2d
set(BUILD_CPP_TESTS OFF CACHE BOOL "turn off build cpp-tests")
set(BUILD_LUA_LIBS OFF CACHE BOOL "turn off build lua-tests")
add_subdirectory(${COCOS2D_ROOT})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# Some macro definitions
if(WINDOWS)
if(BUILD_SHARED_LIBS)
ADD_DEFINITIONS (-D_USRDLL -D_EXPORT_DLL_ -D_USEGUIDLL -D_USREXDLL -D_USRSTUDIODLL)
else()
ADD_DEFINITIONS (-DCC_STATIC)
endif()
ADD_DEFINITIONS (-DCOCOS2DXWIN32_EXPORTS -D_WINDOWS -DWIN32 -D_WIN32)
set(PLATFORM_FOLDER win32)
elseif(MACOSX OR APPLE)
ADD_DEFINITIONS (-DCC_TARGET_OS_MAC)
ADD_DEFINITIONS (-DUSE_FILE32API)
set(PLATFORM_FOLDER mac)
elseif(LINUX)
ADD_DEFINITIONS(-DLINUX)
set(PLATFORM_FOLDER linux)
elseif(ANDROID)
ADD_DEFINITIONS (-DUSE_FILE32API)
set(PLATFORM_FOLDER android)
else()
message( FATAL_ERROR "Unsupported platform, CMake will exit" )
endif()
if(USE_CHIPMUNK)
message("Using chipmunk ...")
add_definitions(-DCC_ENABLE_CHIPMUNK_INTEGRATION=1)
if(UNIX) # assuming linux
add_definitions(-DLINUX )
endif()
elseif(USE_BOX2D)
message("Using box2d ...")
add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=1)
if(UNIX) # assuming linux
add_definitions(-DLINUX )
endif()
else(USE_CHIPMUNK)
message(FATAL_ERROR "Must choose a physics library.")
endif(USE_CHIPMUNK)
# architecture
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(ARCH_DIR "64-bit")
# Compiler options
if(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-wd4251 -wd4244 -wd4334 -wd4005 -wd4820 -wd4710
-wd4514 -wd4056 -wd4996 -wd4099)
else()
set(ARCH_DIR "32-bit")
endif()
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -DCOCOS2D_DEBUG=1")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-exceptions -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -std=c++11 -Wno-deprecated-declarations -Wno-reorder")
if(CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
endif(MSVC)
if( UNIX ) #assume linux
set(GAME_SRC
set(PLATFORM_SPECIFIC_SRC)
set(PLATFORM_SPECIFIC_HEADERS)
if(MACOSX OR APPLE)
set(PLATFORM_SPECIFIC_SRC
proj.ios_mac/ios/main.m
proj.ios_mac/ios/RootViewController.mm
proj.ios_mac/ios/AppController.mm
)
set(PLATFORM_SPECIFIC_HEADERS
proj.ios_mac/ios/RootViewController.h
proj.ios_mac/ios/AppController.h
)
elseif(LINUX) #assume linux
set(PLATFORM_SPECIFIC_SRC
proj.linux/main.cpp
Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp
)
elseif ( WIN32 )
set(GAME_SRC
set(PLATFORM_SPECIFIC_SRC
proj.win32/main.cpp
)
set(PLATFORM_SPECIFIC_HEADERS
proj.win32/main.h
proj.win32/resource.h
Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp
)
endif()
set(COCOS2D_ROOT ${CMAKE_SOURCE_DIR}/cocos2d)
if (WIN32)
include_directories(
${COCOS2D_ROOT}
${COCOS2D_ROOT}/cocos
${COCOS2D_ROOT}/cocos/audio/include
${COCOS2D_ROOT}/cocos/2d
${COCOS2D_ROOT}/cocos/2d/renderer
${COCOS2D_ROOT}/cocos/2d/platform
${COCOS2D_ROOT}/cocos/2d/platform/desktop
${COCOS2D_ROOT}/cocos/2d/platform/win32
${COCOS2D_ROOT}/cocos/base
${COCOS2D_ROOT}/cocos/deprecated
${COCOS2D_ROOT}/cocos/physics
${COCOS2D_ROOT}/cocos/editor-support
${COCOS2D_ROOT}/cocos/math
${COCOS2D_ROOT}/extensions
${COCOS2D_ROOT}/external
${COCOS2D_ROOT}/external/edtaa3func
${COCOS2D_ROOT}/external/jpeg/include/win32
${COCOS2D_ROOT}/external/png/include/win32
${COCOS2D_ROOT}/external/tiff/include/win32
${COCOS2D_ROOT}/external/webp/include/win32
${COCOS2D_ROOT}/external/curl/include/win32
${COCOS2D_ROOT}/external/tinyxml2
${COCOS2D_ROOT}/external/unzip
${COCOS2D_ROOT}/external/sqlite3/include
${COCOS2D_ROOT}/external/chipmunk/include/chipmunk
${COCOS2D_ROOT}/external/freetype2/include/win32
${COCOS2D_ROOT}/external/websockets/include/win32
${COCOS2D_ROOT}/external/spidermonkey/include/win32
${COCOS2D_ROOT}/external/glfw3/include/win32
${COCOS2D_ROOT}/external/win32-specific/gles/include/OGLES
${COCOS2D_ROOT}/external/win32-specific/icon/include
${COCOS2D_ROOT}/external/win32-specific/zlib/include
${COCOS2D_ROOT}/external/xxhash
)
link_directories(
/usr/local/lib
${COCOS2D_ROOT}/external/png/prebuilt/win32
${COCOS2D_ROOT}/external/jpeg/prebuilt/win32
${COCOS2D_ROOT}/external/tiff/prebuilt/win32
${COCOS2D_ROOT}/external/glfw3/prebuilt/win32
${COCOS2D_ROOT}/external/webp/prebuilt/win32
${COCOS2D_ROOT}/external/curl/prebuilt/win32
${COCOS2D_ROOT}/external/sqlite3/libraries/win32
${COCOS2D_ROOT}/external/freetype2/prebuilt/win32
${COCOS2D_ROOT}/external/websockets/prebuilt/win32
${COCOS2D_ROOT}/external/spidermonkey/prebuilt/win32
${COCOS2D_ROOT}/external/win32-specific/gles/prebuilt
${COCOS2D_ROOT}/external/win32-specific/icon/prebuilt
${COCOS2D_ROOT}/external/win32-specific/zlib/prebuilt
)
elseif(UNIX) #assumed linux
include_directories(
/usr/local/include/GLFW
/usr/include/GLFW
${COCOS2D_ROOT}
${COCOS2D_ROOT}/cocos
${COCOS2D_ROOT}/cocos/audio/include
${COCOS2D_ROOT}/cocos/platform
${COCOS2D_ROOT}/cocos/platform/desktop
${COCOS2D_ROOT}/cocos/platform/linux
${COCOS2D_ROOT}/cocos/editor-support
${COCOS2D_ROOT}/extensions
${COCOS2D_ROOT}/external
${COCOS2D_ROOT}/external/edtaa3func
${COCOS2D_ROOT}/external/jpeg/include/linux
${COCOS2D_ROOT}/external/tiff/include/linux
${COCOS2D_ROOT}/external/webp/include/linux
${COCOS2D_ROOT}/external/tinyxml2
${COCOS2D_ROOT}/external/unzip
${COCOS2D_ROOT}/external/freetype2/include/linux
${COCOS2D_ROOT}/external/websockets/include/linux
${COCOS2D_ROOT}/external/spidermonkey/include/linux
${COCOS2D_ROOT}/external/linux-specific/fmod/include/${ARCH_DIR}
${COCOS2D_ROOT}/external/xxhash
Classes
)
link_directories(
/usr/local/lib
${COCOS2D_ROOT}/external/jpeg/prebuilt/linux/${ARCH_DIR}
${COCOS2D_ROOT}/external/tiff/prebuilt/linux/${ARCH_DIR}
${COCOS2D_ROOT}/external/webp/prebuilt/linux/${ARCH_DIR}
${COCOS2D_ROOT}/external/freetype2/prebuilt/linux/${ARCH_DIR}
${COCOS2D_ROOT}/external/websockets/prebuilt/linux/${ARCH_DIR}
${COCOS2D_ROOT}/external/spidermonkey/prebuilt/linux/${ARCH_DIR}
${COCOS2D_ROOT}/external/linux-specific/fmod/prebuilt/${ARCH_DIR}
set(GAME_SRC
Classes/AppDelegate.cpp
Classes/HelloWorldScene.cpp
${PLATFORM_SPECIFIC_SRC}
)
endif()
if(USE_CHIPMUNK)
include_directories(${COCOS2D_ROOT}/external/chipmunk/include/chipmunk)
# chipmunk library
add_subdirectory(${COCOS2D_ROOT}/external/chipmunk/src)
endif()
if(USE_BOX2D)
# box2d library
add_subdirectory(${COCOS2D_ROOT}/external/Box2D)
endif()
# unzip library
add_subdirectory(${COCOS2D_ROOT}/external/unzip)
# tinyxml2 library
add_subdirectory(${COCOS2D_ROOT}/external/tinyxml2)
# audio
add_subdirectory(${COCOS2D_ROOT}/cocos/audio)
# xxhash library
add_subdirectory(${COCOS2D_ROOT}/external/xxhash)
# cocos2d
add_subdirectory(${COCOS2D_ROOT}/cocos)
# extensions
add_subdirectory(${COCOS2D_ROOT}/extensions)
## Editor Support
# spine
add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/spine)
# cocosbuilder
add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocosbuilder)
# cocostudio
add_subdirectory(${COCOS2D_ROOT}/cocos/editor-support/cocostudio)
if ( WIN32 )
# add the executable
add_executable(${APP_NAME}
WIN32
${GAME_SRC}
)
else()
# add the executable
add_executable(${APP_NAME}
${GAME_SRC}
)
endif()
set(GAME_HEADERS
Classes/AppDelegate.h
Classes/HelloWorldScene.h
${PLATFORM_SPECIFIC_HEADERS}
)
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(FMOD_LIB "fmodex64")
if(GAME_HEADERS)
add_executable(${APP_NAME} ${GAME_SRC} ${GAME_HEADERS})
else()
set(FMOD_LIB "fmodex")
add_executable(${APP_NAME} ${GAME_SRC})
endif()
target_link_libraries(${APP_NAME}
spine
cocostudio
cocosbuilder
extensions
audio
cocos2d
)
target_link_libraries(${APP_NAME} cocos2d)
set(APP_BIN_DIR "${CMAKE_BINARY_DIR}/bin")
View
@@ -15,16 +15,17 @@ bool AppDelegate::applicationDidFinishLaunching() {
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
//glview = GLView::createWithRect("Slippery Wheels", Rect(0, 0, 320, 640), 1);
glview = GLView::createWithRect("Slippery Wheels", Rect(0, 0, 1280, 640), 1);
//glview = GLView::createWithRect("Slippery Wheel", Rect(0, 0, DESIGNED_WIDTH, DESIGNED_HEIGHT), 1);
//glview = GLViewImpl::createWithRect("Ching Chong Ping Pong", Rect(0, 0, 320, 640), 1);
glview = GLViewImpl::createWithRect("Ching Chong Ping Pong", Rect(0, 0, 800, 640), 1);
//glview = GLViewImpl::createWithRect("Ching Chong Ping Pong", Rect(0, 0, DESIGNED_WIDTH, DESIGNED_HEIGHT), 1);
director->setOpenGLView(glview);
//glview->setDesignResolutionSize(DESIGNED_WIDTH, DESIGNED_HEIGHT, ResolutionPolicy::NO_BORDER);
}
E::calculateScreen();
E::settings.colorAccent = C_CYAN;
E::setColorAccent(E::settings.colorAccent);
E::playBgMusic();
director->setAnimationInterval(1.0 / 60);
@@ -1,24 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pujoy.swheels"
package="com.pujoy.ccpp"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="20" />
<uses-sdk android:minSdkVersion="9"/>
<uses-feature android:glEsVersion="0x00020000" />
<supports-screens android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<application android:label="@string/app_name"
android:allowBackup="true"
android:icon="@drawable/icon">
<!-- Tell Cocos2dxActivity the name of our .so -->
@@ -38,5 +28,11 @@
</activity>
</application>
<supports-screens android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Oops, something went wrong.

0 comments on commit b1b744d

Please sign in to comment.