// // CocosConfig.cpp // 修改增加2dx的一些默认功能,默认这些功能全不生效 // // Created by 杜家兑macbook on 17/11/27. // // #include "CocosConfig.h" static bool _CCBAudioEnable = true; //ccb音效开关控制 static bool _ignoreCCBPath = false; //ccb加载是否去掉路径 static bool _opacityCCBEnable = false; //ccb加载是否打开透明穿透 static bool _colorCCBEnable = false; //ccb加载是否打开颜色穿透 static bool _particleVisibleReset = false; // 粒子显隐帧的时候是否resetSystem.(true的话可以在ccb里K显隐帧,粒子就会reset了) static bool _particleOpacity = false; // 粒子是否支持透明 static std::string _defaultEmptyPic = ""; // 加载图片的时候无图片用默认图片替代防崩溃,不设置的话如果加载一张不存的图会崩溃 static bool _CCBParticleUseEmitrate = false;//默认为不使用速率,ccb的效果和游戏内不同 static bool _AutoAddSingleImage2Cache=false;//是否自动添加单图到SpriteFrameCache中. static bool _isAndroidMp3ReplaceOgg = false;//是否android使用ogg声音文件代替mp3 如果ogg存在 static bool _isPictureReplaceWebp = false;//是否使用webp文件代替图片资源文件,如果图片资源文件不存在 static bool _isParticleUpdateOptimize = false;//粒子update 不显示的时候不做更新 static int _minAudioCacheSupportAndroidSystemVersion = 17; // zhuge 默认最低安卓版本为17 static bool _isCCBParticleUseTexturePlist = false; // zhuge 修改CocosBuilder 粒子可以选择大图 static bool _pushNotificationWhenCCBSoundPlayed = false; // zhuge 播放ccb中的音效时,发送消息 static bool _isCCBParticlePositionTypeSettable = true; // zhuge CCB中是否可以配置粒子的PositionType static bool _isAdmobBannerMoveToUpByNumPixels = false; //点消组需求ios admob banner要上移12像素,其他组默认不动 static bool _isSetParticlePositionTypeGroupWhenSetTexture = true; //决定例子图源时是否配置粒子的PositionType为group static bool _isIgnoreScaleFactor4Label = false; //决定label是否忽略CC_CONTENT_SCALE_FACTOR static std::string _ccbEfxPrefix = ""; static bool _isAddImageAsyncWith2Threads = false; //异步加载图片是否开启双线程 static float _mergeScale = 1.f; //合批的缩放值 static bool _isCharacterRbCache = true; //默认为高端机 缓存rb std::string CocosConfig::getCcbEfxPrefix(){ return _ccbEfxPrefix; } void CocosConfig::setCcbEfxPrefix(std::string prefix){ _ccbEfxPrefix = prefix; } CocosConfig::CocosConfig() { } CocosConfig::~CocosConfig() { } bool CocosConfig::getCCBAudioEnable(){ return _CCBAudioEnable; } void CocosConfig::setCCBAudioEnable(bool enable){ _CCBAudioEnable = enable; } bool CocosConfig::getIgnoreCCBPath(){ return _ignoreCCBPath; } void CocosConfig::setIgnoreCCBPath(bool enable){ _ignoreCCBPath = enable; } bool CocosConfig::getOpacityCCBEnable(){ return _opacityCCBEnable; } void CocosConfig::setOpacityCCBEnable(bool enable){ _opacityCCBEnable = enable; } bool CocosConfig::getParticleVisibleReset(){ return _particleVisibleReset; } void CocosConfig::setParticleVisibleReset(bool enable){ _particleVisibleReset = enable; } bool CocosConfig::getParticleOpacity(){ return _particleOpacity; } void CocosConfig::setParticleOpacity(bool enable){ _particleOpacity = enable; } std::string CocosConfig::getDefaultEmptyPic(){ return _defaultEmptyPic; } void CocosConfig::setDefaultEmptyPic(std::string picName){ _defaultEmptyPic = picName; } bool CocosConfig::isCCBParticleUseEmitrate(){ return _CCBParticleUseEmitrate; } void CocosConfig::setCCBParticleUseEmitrate(bool use){ _CCBParticleUseEmitrate = use; } bool CocosConfig::getAutoAddSingleImage2Cache(){ return _AutoAddSingleImage2Cache; } void CocosConfig::setAutoAddSingleImage2Cache(bool enable){ _AutoAddSingleImage2Cache = enable; } bool CocosConfig::isAndroidMp3ReplaceOgg(){ return _isAndroidMp3ReplaceOgg; } void CocosConfig::setAndroidMp3ReplaceOgg(bool replace){ _isAndroidMp3ReplaceOgg = replace; } bool CocosConfig::isPictureReplaceWebp(){ return _isPictureReplaceWebp; } void CocosConfig::setPictureReplaceWebp(bool replace){ _isPictureReplaceWebp = replace; } bool CocosConfig::isParticleUpdateOptimize(){ return _isParticleUpdateOptimize; } void CocosConfig::setParticleUpdateOptimize(bool enable){ _isParticleUpdateOptimize = enable; } int CocosConfig::minAudioCacheSupportAndroidSystemVersion() { return _minAudioCacheSupportAndroidSystemVersion; } void CocosConfig::setMinAudioCacheSupportAndroidSystemVersion(int version) { _minAudioCacheSupportAndroidSystemVersion = version; } bool CocosConfig::isCCBParticleUseTexturePlist() { return _isCCBParticleUseTexturePlist; } void CocosConfig::setCCBParticleUseTexturePlist(bool b) { _isCCBParticleUseTexturePlist = b; } bool CocosConfig::getColorCCBEnable(){ return _colorCCBEnable; } void CocosConfig::setColorCCBEnable(bool enable){ _colorCCBEnable = enable; } bool CocosConfig::pushNotificationWhenCCBSoundPlayed() { return _pushNotificationWhenCCBSoundPlayed; } void CocosConfig::setPushNotificationWhenCCBSoundPlayed(bool b) { _pushNotificationWhenCCBSoundPlayed = b; } bool CocosConfig::isCCBParticlePositionTypeSettable() { return _isCCBParticlePositionTypeSettable; } void CocosConfig::setCCBParticlePositionTypeSettable(bool b) { _isCCBParticlePositionTypeSettable = b; } bool CocosConfig::isAdmobBannerMoveToUpByNumPixels() { return _isAdmobBannerMoveToUpByNumPixels; } void CocosConfig::setAdmobBannerMoveToUpByNumPixels(bool b) { _isAdmobBannerMoveToUpByNumPixels = b; } bool CocosConfig::isParticlePositionTypeGroupWhenSetTexture() { return _isSetParticlePositionTypeGroupWhenSetTexture; } void CocosConfig::setParticlePositionTypeGroupWhenSetTexture(bool b) { _isSetParticlePositionTypeGroupWhenSetTexture = b; } bool CocosConfig::isIgnoreScaleFactor4Label(){ return _isIgnoreScaleFactor4Label; } void CocosConfig::setIgnoreScaleFactor4Label(bool b){ _isIgnoreScaleFactor4Label = b; } bool CocosConfig::isAddImageAsyncWith2Threads(){ return _isAddImageAsyncWith2Threads; } void CocosConfig::setAddImageAsyncWith2Threads(bool b){ _isAddImageAsyncWith2Threads = b; } float CocosConfig::getMergeScale(){ return _mergeScale; } void CocosConfig::setMergeScale(float mergeScale){ _mergeScale = mergeScale; } bool CocosConfig::isCharacterRbCache(){ return _isCharacterRbCache; } void CocosConfig::setCharacterRbCache(bool b){ _isCharacterRbCache = b; }