CCEnhanceAPI-android.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /****************************************************************************
  2. * Samsung API for cocos
  3. * Developed by Game Engine part
  4. *
  5. * Copyright 2015 by Mobile Solution Lab, MSG, SRC-NJ.
  6. * Wang Ying
  7. * All rights reserved.
  8. *
  9. * This software is the confidential and proprietary information of
  10. * Samsung Electronics, Inc. ("Confidential Information"). You
  11. * Shall not disclose such Confidential Information and shall use
  12. * it only in accordance with the terms of the license agreement
  13. * you entered into with Samsung
  14. ****************************************************************************/
  15. #ifndef __CC_ENHANCEAPI_ANDROID_H__
  16. #define __CC_ENHANCEAPI_ANDROID_H__
  17. #include "platform/CCPlatformConfig.h"
  18. #if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
  19. #include "platform/CCCommon.h"
  20. #include "platform/CCApplicationProtocol.h"
  21. NS_CC_BEGIN
  22. /**
  23. * The purpose of Enhance API is to optimize Cocos2D-X game engine special for Samsung products.
  24. * Note: The minimum required Android version is 5.0.
  25. *
  26. */
  27. class CC_DLL EnhanceAPI
  28. {
  29. public:
  30. /**
  31. * @js ctor
  32. */
  33. EnhanceAPI();
  34. /**
  35. * @js NA
  36. * @lua NA
  37. */
  38. virtual ~EnhanceAPI();
  39. /**
  40. * @brief The function is used to set screen buffer size ratio.
  41. * The purpose of the API is to modify off screen buffer size for the game app.
  42. * It will reduce the off screen buffer according to the given ration.
  43. * The ration value varies from 50 to 100. 100 means using 100% size of the on screen buffer
  44. * as off screen buffer and 50 means 50% size of the on screen buffer will be used as off screen buffer.
  45. *
  46. * @param percent The optimized percent value, value varies from 50 to 100.
  47. * @return success: 0, fail: -1.
  48. */
  49. static int setResolutionPercent(int percent);
  50. /**
  51. *@brief The function is used to set FPS level.
  52. *@Warn The input fps level(0-99) corresponds to game fps value(0-60).
  53. * FPS level 99 means game FPS value 60.
  54. * The purpose of the API is reducing power consumption when we set dynamic fps in some situations.
  55. *@param fps the fps value.
  56. *@return success: 0, fail: -1.
  57. */
  58. static int setFPS(int fps);
  59. /**
  60. *@brief The function is used to set Boost Up seconds.
  61. * The input parameter means the loading seconds. The maximum settings seconds is 7.
  62. * The purpose of the API is reducing the application's loading time.
  63. *@param sec The fast loading seconds.
  64. *@return success: 0, fail: -1.
  65. */
  66. static int fastLoading(int sec);
  67. /**
  68. *@brief The function is used to get temperature level(0-3).
  69. * The purpose of the API is get temperature status of the device.
  70. * Temperature 0 means normal temperature and 1-3 means different temperature level.
  71. * 1 is the minimum high temperature level and 3 is the maximum high temperature level.
  72. *@return -1: fail to get temperature.
  73. * - 0: normal temperature
  74. * - 1: high
  75. * - 2,3: very high
  76. */
  77. static int getTemperature();
  78. /**
  79. *@brief The function is used to set power saving mode for true or false.
  80. * The purpose of the API is reducing Power consumption when set power saving mode for true.
  81. *
  82. *@return -1: fail to get temperature
  83. * - 0: normal temperature
  84. * - 1: high
  85. * - 2,3: very high
  86. */
  87. static int setLowPowerMode(bool enable);
  88. };
  89. NS_CC_END
  90. #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
  91. #endif // __CC_ENHANCEAPI_ANDROID_H__