|
| 1 | +/**************************************************************************** |
| 2 | +Copyright (c) 2010-2012 cocos2d-x.org |
| 3 | +Copyright (c) 2013-2016 Chukong Technologies Inc. |
| 4 | +Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. |
| 5 | +Copyright (c) 2019 Xiamen Yaji Software Co., Ltd. |
| 6 | +
|
| 7 | +http://www.cocos2d-x.org |
| 8 | +
|
| 9 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 10 | +of this software and associated documentation files (the "Software"), to deal |
| 11 | +in the Software without restriction, including without limitation the rights |
| 12 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 13 | +copies of the Software, and to permit persons to whom the Software is |
| 14 | +furnished to do so, subject to the following conditions: |
| 15 | +
|
| 16 | +The above copyright notice and this permission notice shall be included in |
| 17 | +all copies or substantial portions of the Software. |
| 18 | +
|
| 19 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 20 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 21 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 22 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 23 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 24 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 25 | +THE SOFTWARE. |
| 26 | +****************************************************************************/ |
| 27 | + |
| 28 | +#include "platform/CCDataManager.h" |
| 29 | + |
| 30 | +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID |
| 31 | +# include "platform/android/jni/JniHelper.h" |
| 32 | +# define DataManagerClassName "org/cocos2dx/lib/Cocos2dxDataManager" |
| 33 | +#endif |
| 34 | + |
| 35 | +NS_CC_BEGIN |
| 36 | + |
| 37 | +void DataManager::setProcessID(int pid){ |
| 38 | +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID |
| 39 | + JniHelper::callStaticVoidMethod(DataManagerClassName, "setProcessID", pid); |
| 40 | +#endif |
| 41 | +} |
| 42 | +void DataManager::setFrameSize(int width, int height){ |
| 43 | +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID |
| 44 | + JniHelper::callStaticVoidMethod(DataManagerClassName, "setFrameSize", width, height); |
| 45 | +#endif |
| 46 | +} |
| 47 | +void DataManager::onSceneLoaderBegin(){ |
| 48 | +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID |
| 49 | + JniHelper::callStaticVoidMethod(DataManagerClassName, "onSceneLoaderBegin"); |
| 50 | +#endif |
| 51 | +} |
| 52 | +void DataManager::onSceneLoaderEnd(){ |
| 53 | +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID |
| 54 | + JniHelper::callStaticVoidMethod(DataManagerClassName, "onSceneLoaderEnd"); |
| 55 | +#endif |
| 56 | +} |
| 57 | +void DataManager::onShaderLoaderBegin(){ |
| 58 | +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID |
| 59 | + JniHelper::callStaticVoidMethod(DataManagerClassName, "onShaderLoaderBegin"); |
| 60 | +#endif |
| 61 | +} |
| 62 | +void DataManager::onShaderLoaderEnd(){ |
| 63 | +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID |
| 64 | + JniHelper::callStaticVoidMethod(DataManagerClassName, "onShaderLoaderEnd"); |
| 65 | +#endif |
| 66 | +} |
| 67 | + |
| 68 | +NS_CC_END |
0 commit comments