Skip to content

Commit

Permalink
HelloWorldをSplashSceneに変更 Classes内ディレクトリ構成変更
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhiro-matsuda committed Oct 5, 2013
1 parent 5deb8dc commit 1c223a8
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 112 deletions.
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "HelloWorldScene.h"
#include "SplashScene.h"

USING_NS_CC;

Expand Down Expand Up @@ -43,7 +43,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
fileUtils->addSearchPath("ccbi/ccbResources/");

// create a scene. it's an autorelease object
auto scene = HelloWorld::createScene();
auto scene = SplashScene::createScene();

// run
director->runWithScene(scene);
Expand Down

This file was deleted.

This file was deleted.

@@ -0,0 +1,39 @@
#include "SplashScene.h"
#include "CCBReader/CCBReader.h"
#include "CCBReader/CCNodeLoaderLibrary.h"

USING_NS_CC;
USING_NS_CC_EXT;

Scene* SplashScene::createScene()
{
auto scene = Scene::create();
auto layer = SplashScene::create();

scene->addChild(layer);

return scene;
}


bool SplashScene::init()
{
if ( !Layer::init() )
{
return false;
}

// スプラッシュのccbiファイルを読み込む
auto nodeLoaderLibrary = NodeLoaderLibrary::getInstance();
CCBReader* reader = new CCBReader(nodeLoaderLibrary);
auto splashNode = reader->readNodeGraphFromFile("ccbi/SplashScene.ccbi");

// 追加
this->addChild(splashNode, 0);

// 開放
reader->release();

return true;
}

@@ -0,0 +1,16 @@
#ifndef __SPLASH_SCENE_H__
#define __SPLASH_SCENE_H__

#include "cocos2d.h"

class SplashScene : public cocos2d::Layer
{
public:
static cocos2d::Scene* createScene();

virtual bool init();

CREATE_FUNC(SplashScene);
};

#endif // __SPLASH_SCENE_H__
Expand Up @@ -6,11 +6,14 @@ LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
#C++ファイル抽出
CPP_FILES := $(shell find $(LOCAL_PATH)/../../Classes -name *.cpp)

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_SRC_FILES := hellocpp/main.cpp
LOCAL_SRC_FILES += $(CPP_FILES:$(LOCAL_PATH)/%=%)

#ClassとClass以下のディレクトリ全部
LOCAL_C_INCLUDES := $(shell find $(LOCAL_PATH)/../../Classes -type d)

LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
Expand Down
Expand Up @@ -14,14 +14,14 @@
1AF4C2F717865DCB00122817 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2DF17865D9500122817 /* libcocos2dx-extensions iOS.a */; };
1AF4C2F817865DCB00122817 /* libCocosDenshion iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C2E517865D9500122817 /* libCocosDenshion iOS.a */; };
1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; };
1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; };
1AFAF8BC16D35E4900DB1158 /* CloseNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B916D35E4900DB1158 /* CloseNormal.png */; };
1AFAF8BD16D35E4900DB1158 /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; };
1AFAF8BE16D35E4900DB1158 /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BB16D35E4900DB1158 /* HelloWorld.png */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
2ECA923217F9DED6009D4DE6 /* ccbi in Resources */ = {isa = PBXBuildFile; fileRef = 2ECA923117F9DED6009D4DE6 /* ccbi */; };
2ECA924718002294009D4DE6 /* SplashScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ECA924518002294009D4DE6 /* SplashScene.cpp */; };
503AE0F817EB97AB00D1A890 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 503AE0F617EB97AB00D1A890 /* Icon.icns */; };
503AE10017EB989F00D1A890 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 503AE0FB17EB989F00D1A890 /* AppController.mm */; };
503AE10117EB989F00D1A890 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 503AE0FC17EB989F00D1A890 /* main.m */; };
Expand All @@ -38,7 +38,6 @@
5087E75417EB910900C73F5D /* CloseSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */; };
5087E75517EB910900C73F5D /* HelloWorld.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AFAF8BB16D35E4900DB1158 /* HelloWorld.png */; };
5087E75717EB910900C73F5D /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */; };
5087E75817EB910900C73F5D /* HelloWorldScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */; };
5087E76317EB910900C73F5D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
5087E76517EB910900C73F5D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; };
5087E76717EB910900C73F5D /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB412928DE900B8313A /* libz.dylib */; };
Expand Down Expand Up @@ -248,8 +247,6 @@
1AF4C2BB17865D9500122817 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../cocos2d_libs.xcodeproj; sourceTree = "<group>"; };
1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AppDelegate.cpp; path = ../Classes/AppDelegate.cpp; sourceTree = "<group>"; };
1AFAF8B416D35DE700DB1158 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ../Classes/AppDelegate.h; sourceTree = "<group>"; };
1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HelloWorldScene.cpp; path = ../Classes/HelloWorldScene.cpp; sourceTree = "<group>"; };
1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HelloWorldScene.h; path = ../Classes/HelloWorldScene.h; sourceTree = "<group>"; };
1AFAF8B916D35E4900DB1158 /* CloseNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseNormal.png; sourceTree = "<group>"; };
1AFAF8BA16D35E4900DB1158 /* CloseSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CloseSelected.png; sourceTree = "<group>"; };
1AFAF8BB16D35E4900DB1158 /* HelloWorld.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = HelloWorld.png; sourceTree = "<group>"; };
Expand All @@ -258,6 +255,8 @@
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
2ECA923117F9DED6009D4DE6 /* ccbi */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ccbi; sourceTree = "<group>"; };
2ECA924518002294009D4DE6 /* SplashScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SplashScene.cpp; sourceTree = "<group>"; };
2ECA924618002294009D4DE6 /* SplashScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplashScene.h; sourceTree = "<group>"; };
503AE0F617EB97AB00D1A890 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Icon.icns; sourceTree = "<group>"; };
503AE0F717EB97AB00D1A890 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
503AE0FA17EB989F00D1A890 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = ios/AppController.h; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -365,10 +364,9 @@
15AA9C4015B7EC450033D6C2 /* Classes */ = {
isa = PBXGroup;
children = (
2ECA923B1800209D009D4DE6 /* Opening */,
1AFAF8B316D35DE700DB1158 /* AppDelegate.cpp */,
1AFAF8B416D35DE700DB1158 /* AppDelegate.h */,
1AFAF8B516D35DE700DB1158 /* HelloWorldScene.cpp */,
1AFAF8B616D35DE700DB1158 /* HelloWorldScene.h */,
);
name = Classes;
path = ../classes;
Expand Down Expand Up @@ -439,6 +437,16 @@
name = Frameworks;
sourceTree = "<group>";
};
2ECA923B1800209D009D4DE6 /* Opening */ = {
isa = PBXGroup;
children = (
2ECA924518002294009D4DE6 /* SplashScene.cpp */,
2ECA924618002294009D4DE6 /* SplashScene.h */,
);
name = Opening;
path = ../Classes/Opening;
sourceTree = "<group>";
};
503AE0F517EB97AB00D1A890 /* Icons */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -730,10 +738,10 @@
buildActionMask = 2147483647;
files = (
503AE10017EB989F00D1A890 /* AppController.mm in Sources */,
2ECA924718002294009D4DE6 /* SplashScene.cpp in Sources */,
503AE10217EB989F00D1A890 /* RootViewController.mm in Sources */,
1AFAF8B716D35DE700DB1158 /* AppDelegate.cpp in Sources */,
503AE10117EB989F00D1A890 /* main.m in Sources */,
1AFAF8B816D35DE700DB1158 /* HelloWorldScene.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -742,7 +750,6 @@
buildActionMask = 2147483647;
files = (
5087E75717EB910900C73F5D /* AppDelegate.cpp in Sources */,
5087E75817EB910900C73F5D /* HelloWorldScene.cpp in Sources */,
503AE10517EB98FF00D1A890 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down

0 comments on commit 1c223a8

Please sign in to comment.