• 大小: 45.66M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-17
  • 语言: 其他
  • 标签: 其他  

资源简介

majiang.rar

资源截图

代码片段和文件信息

#include “AppDelegate.h“
#include “AppMacros.h“

#include “cocos2d.h“
#include “SimpleAudioEngine.h“
#include “Scene/LoadingScene.h“
#include “Scene/GameScene.h“
#include “Common/ConstantDef.h“
USING_NS_CC;

int  AppDelegate::cur_scene_flag = cur_scene_valid;
CClayer* AppDelegate::g_player = NULL;

AppDelegate::AppDelegate()
{

}

AppDelegate::~AppDelegate()
{
}

bool AppDelegate::applicationDidFinishLaunching()
{
// initialize director
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(pEGLView);

CCSize frameSize = pEGLView->getframeSize();
CCLOG(“ScreenSize width:%f height:%f“ frameSize.width frameSize.height);

#if (SCREEN_ORIENTATION == SCREEN_ORIENTATION_LANDSCAPE) // 横屏
float frameScale = frameSize.width/frameSize.height;
#elif (SCREEN_ORIENTATION == SCREEN_ORIENTATION_PORTRAIT) // 竖屏
float frameScale = frameSize.height/frameSize.width;
#else
#error unknown target ORIENTATION!
#endif

if( frameScale < 3.0f/2.0f ) // 窄屏,屏幕宽度:高度小于3:2
{
// Set the design resolution
pEGLView->setDesignResolutionSize(designResolutionSize.width designResolutionSize.height kResolutionShowAll);
}
else
{
// Set the design resolution
pEGLView->setDesignResolutionSize(designResolutionSize.width designResolutionSize.height kResolutionNoBorder);
}


//use fixed resource
float fScale = MIN(designResolutionRes.size.width/designResolutionSize.width designResolutionRes.size.height/designResolutionSize.height);
// CCFileUtils::sharedFileUtils()->setResourceDirectory(designResolutionRes.directory);
pDirector->setContentScaleFactor(fScale);
CCLOG(“setContentScaleFactor fscale: %f res.size(%f %f) deSize(%f %f)“ fScale designResolutionRes.size.width designResolutionRes.size.height designResolutionSize.width designResolutionSize.height);

// turn on display FPS   lyp 取消帧率
//pDirector->setDisplayStats(true);

// set FPS. the default value is 1.0/60 if you don‘t call this  lyp 取消帧率
//pDirector->setAnimationInterval(1.0 / 50);

// create a scene. it‘s an autorelease object
// CCScene* pScene = CSceneInit::scene();
// CCScene* pScene = SceneLogo::scene();
CCScene* pScene = LoadingScene::scene(TargetSceneMainScene);

// run
pDirector->runWithScene(pScene);

    return true;
}

// This function will be called when the app is inactive. When comes a phone callit‘s be invoked too
void AppDelegate::applicationDidEnterBackground() {
CCDirector::sharedDirector()->stopAnimation();

// if you use SimpleAudioEngine it must be pause
// SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
// if you use SimpleAudioEngine it must be pause
CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseAllEffects();
}

// this function will be called when the app is active again
void AppDelegate::ap

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3258  2014-07-09 14:50  majiang\Classes\AppDelegate.cpp

     文件       1339  2014-12-11 11:53  majiang\Classes\AppDelegate.cpp--

     文件       1110  2014-07-08 21:34  majiang\Classes\AppDelegate.h

     文件        955  2014-12-11 11:53  majiang\Classes\AppDelegate.h--

     文件       4394  2014-06-22 18:33  majiang\Classes\AppMacros.cpp

     文件       2862  2014-01-08 11:06  majiang\Classes\AppMacros.h

     文件       2765  2014-12-11 11:53  majiang\Classes\AppMacros.h--

     文件       2012  2014-07-08 21:55  majiang\Classes\CallJni.cpp

     文件        482  2014-07-08 21:38  majiang\Classes\CallJni.h

     文件      97038  2016-03-27 02:06  majiang\Classes\Common\CommonFunction.cpp

     文件       8102  2014-06-27 15:31  majiang\Classes\Common\CommonFunction.h

     文件      60029  2016-03-27 15:37  majiang\Classes\Common\ConstantDef.h

     文件       9410  2013-08-09 15:20  majiang\Classes\Common\md5.cpp

     文件       1396  2013-08-09 15:20  majiang\Classes\Common\md5.h

     文件      14310  2014-01-07 09:43  majiang\Classes\Common\MyTinyxmlParser.cpp

     文件        840  2014-01-06 17:49  majiang\Classes\Common\MyTinyxmlParser.h

     文件        219  2013-08-09 15:20  majiang\Classes\Entity\DeskEntity.cpp

     文件        820  2013-08-09 15:20  majiang\Classes\Entity\DeskEntity.h

     文件      30472  2014-01-03 14:01  majiang\Classes\GameCore\AI\Robot.cpp

     文件       3358  2014-01-03 12:13  majiang\Classes\GameCore\AI\Robot.h

     文件       8537  2014-01-03 15:15  majiang\Classes\GameCore\ClientCommon.h

     文件       4811  2014-01-03 15:15  majiang\Classes\GameCore\ClientframeDefs.h

     文件      13268  2013-08-09 15:20  majiang\Classes\GameCore\ClientMjDefs.h

     文件       1977  2014-01-03 15:15  majiang\Classes\GameCore\ClientScoreDefs.h

     文件     190666  2014-01-03 12:09  majiang\Classes\GameCore\GameLogical.cpp

     文件      15752  2014-01-03 12:08  majiang\Classes\GameCore\GameLogical.h

     文件      11356  2014-06-27 22:16  majiang\Classes\GameCore\MjDef.h

     文件       1014  2013-08-09 15:20  majiang\Classes\GameCore\RuleGen\RuleDef.h

     文件       6018  2014-01-03 12:09  majiang\Classes\GameCore\ServerframeDefs.h

     文件        706  2014-01-02 16:52  majiang\Classes\GameCore\TypeDef.h

............此处省略799个文件信息

评论

共有 条评论