Game.cpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /****************************************************************************
  2. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
  3. http://www.cocos.com
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated engine source code (the "Software"), a limited,
  6. worldwide, royalty-free, non-assignable, revocable and non-exclusive license
  7. to use Cocos Creator solely to develop games on your target platforms. You
  8. shall not use Cocos Creator software for developing other software or tools
  9. that's used for developing games. You are not granted to publish, distribute,
  10. sublicense, and/or sell copies of Cocos Creator.
  11. The software or tools in this License Agreement are licensed, not sold.
  12. Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to
  13. you.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. THE SOFTWARE.
  21. ****************************************************************************/
  22. #include "Game.h"
  23. #ifndef GAME_NAME
  24. #define GAME_NAME "CocosGame";
  25. #endif
  26. #ifndef SCRIPT_XXTEAKEY
  27. #define SCRIPT_XXTEAKEY "";
  28. #endif
  29. Game::Game() = default;
  30. int Game::init() {
  31. _windowInfo.title = GAME_NAME;
  32. // configurate window size
  33. // _windowInfo.height = 600;
  34. // _windowInfo.width = 800;
  35. #if CC_DEBUG
  36. _debuggerInfo.enabled = true;
  37. #else
  38. _debuggerInfo.enabled = false;
  39. #endif
  40. _debuggerInfo.port = 6086;
  41. _debuggerInfo.address = "0.0.0.0";
  42. _debuggerInfo.pauseOnStart = false;
  43. _xxteaKey = SCRIPT_XXTEAKEY;
  44. BaseGame::init();
  45. return 0;
  46. }
  47. void Game::onPause() { BaseGame::onPause(); }
  48. void Game::onResume() { BaseGame::onResume(); }
  49. void Game::onClose() { BaseGame::onClose(); }
  50. CC_REGISTER_APPLICATION(Game);