format
This commit is contained in:
iris-wy 2015-05-28 11:03:49 +08:00
parent 9e477303f1
commit bbfc33dfd2
2 changed files with 49 additions and 59 deletions

View File

@ -199,7 +199,7 @@ THE SOFTWARE.
#include "platform/android/CCGL-android.h" #include "platform/android/CCGL-android.h"
#include "platform/android/CCStdC-android.h" #include "platform/android/CCStdC-android.h"
//Enhance modification begin //Enhance modification begin
#include "platform/android/CCEnhanceAPI-android.h" #include "platform/android/CCEnhanceAPI-android.h"
//Enhance modification end //Enhance modification end
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID

View File

@ -451,71 +451,61 @@ public class Cocos2dxHelper {
} }
//Enhance API modification begin //Enhance API modification begin
public static int setResolutionPercent(int per) public static int setResolutionPercent(int per) {
{ try {
try{ if (mGameServiceBinder != null) {
if(mGameServiceBinder != null) return mGameServiceBinder.setPreferredResolution(per);
{ }
return mGameServiceBinder.setPreferredResolution(per); return -1;
} } catch (Exception e) {
return -1;
}catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return -1; return -1;
} }
} }
public static int setFPS(int fps) public static int setFPS(int fps) {
{ try {
try{ if (mGameServiceBinder != null) {
if(mGameServiceBinder != null) return mGameServiceBinder.setFramePerSecond(fps);
{ }
return mGameServiceBinder.setFramePerSecond(fps); return -1;
} } catch (Exception e) {
return -1;
}catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return -1; return -1;
} }
} }
public static int fastLoading(int sec) public static int fastLoading(int sec) {
{ try {
try{ if (mGameServiceBinder != null) {
if(mGameServiceBinder != null) return mGameServiceBinder.boostUp(sec);
{ }
return mGameServiceBinder.boostUp(sec); return -1;
} } catch (Exception e) {
return -1;
}catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return -1; return -1;
} }
} }
public static int getTemperature() public static int getTemperature() {
{ try {
try{ if (mGameServiceBinder != null) {
if(mGameServiceBinder != null) return mGameServiceBinder.getAbstractTemperature();
{ }
return mGameServiceBinder.getAbstractTemperature(); return -1;
} } catch (Exception e) {
return -1;
}catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return -1; return -1;
} }
} }
public static int setLowPowerMode(boolean enable) public static int setLowPowerMode(boolean enable) {
{ try {
try{ if (mGameServiceBinder != null) {
if(mGameServiceBinder != null) return mGameServiceBinder.setGamePowerSaving(enable);
{ }
return mGameServiceBinder.setGamePowerSaving(enable); return -1;
} } catch (Exception e) {
return -1;
}catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return -1; return -1;
} }