Manual.cpp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. //
  2. // Copyright (c) 2008-2020 the Urho3D project.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  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 "../Precompiled.h"
  23. #include "../AngelScript/APITemplates.h"
  24. namespace Urho3D
  25. {
  26. void ASRegisterManualFirst_Addons(asIScriptEngine* engine);
  27. void ASRegisterManualLast_Addons(asIScriptEngine* engine);
  28. void ASRegisterManualFirst_Graphics(asIScriptEngine* engine);
  29. void ASRegisterManualLast_Graphics(asIScriptEngine* engine);
  30. void ASRegisterManualFirst_Core(asIScriptEngine* engine);
  31. void ASRegisterManualLast_Core(asIScriptEngine* engine);
  32. void ASRegisterManualFirst_Math(asIScriptEngine* engine);
  33. void ASRegisterManualLast_Math(asIScriptEngine* engine);
  34. void ASRegisterManualFirst_IO(asIScriptEngine* engine);
  35. void ASRegisterManualLast_IO(asIScriptEngine* engine);
  36. void ASRegisterManualFirst_Scene(asIScriptEngine* engine);
  37. void ASRegisterManualLast_Scene(asIScriptEngine* engine);
  38. void ASRegisterManualFirst_UI(asIScriptEngine* engine);
  39. void ASRegisterManualLast_UI(asIScriptEngine* engine);
  40. void ASRegisterManualFirst_Input(asIScriptEngine* engine);
  41. void ASRegisterManualLast_Input(asIScriptEngine* engine);
  42. void ASRegisterManualFirst_Engine(asIScriptEngine* engine);
  43. void ASRegisterManualLast_Engine(asIScriptEngine* engine);
  44. void ASRegisterManualFirst_Audio(asIScriptEngine* engine);
  45. void ASRegisterManualLast_Audio(asIScriptEngine* engine);
  46. void ASRegisterManualFirst_Container(asIScriptEngine* engine);
  47. void ASRegisterManualLast_Container(asIScriptEngine* engine);
  48. void ASRegisterManualFirst_Resource(asIScriptEngine* engine);
  49. void ASRegisterManualLast_Resource(asIScriptEngine* engine);
  50. #ifdef URHO3D_PHYSICS
  51. void ASRegisterManualFirst_Physics(asIScriptEngine* engine);
  52. void ASRegisterManualLast_Physics(asIScriptEngine* engine);
  53. #endif
  54. #ifdef URHO3D_NETWORK
  55. void ASRegisterManualFirst_Network(asIScriptEngine* engine);
  56. void ASRegisterManualLast_Network(asIScriptEngine* engine);
  57. #endif
  58. #ifdef URHO3D_IK
  59. void ASRegisterManualFirst_IK(asIScriptEngine* engine);
  60. void ASRegisterManualLast_IK(asIScriptEngine* engine);
  61. #endif
  62. #ifdef URHO3D_DATABASE
  63. void ASRegisterManualFirst_Database(asIScriptEngine* engine);
  64. void ASRegisterManualLast_Database(asIScriptEngine* engine);
  65. #endif
  66. #ifdef URHO3D_URHO2D
  67. void ASRegisterManualFirst_Urho2D(asIScriptEngine* engine);
  68. void ASRegisterManualLast_Urho2D(asIScriptEngine* engine);
  69. #endif
  70. // This function is called before ASRegisterGenerated()
  71. void ASRegisterManualFirst(asIScriptEngine* engine)
  72. {
  73. if (sizeof(long) == 4)
  74. {
  75. engine->RegisterTypedef("long", "int");
  76. engine->RegisterTypedef("ulong", "uint");
  77. }
  78. else
  79. {
  80. engine->RegisterTypedef("long", "int64");
  81. engine->RegisterTypedef("ulong", "uint64");
  82. }
  83. if (sizeof(size_t) == 4)
  84. engine->RegisterTypedef("size_t", "uint");
  85. else
  86. engine->RegisterTypedef("size_t", "uint64");
  87. engine->RegisterTypedef("SDL_JoystickID", "int");
  88. ASRegisterManualFirst_Addons(engine);
  89. ASRegisterManualFirst_Graphics(engine);
  90. ASRegisterManualFirst_Core(engine);
  91. ASRegisterManualFirst_Math(engine);
  92. ASRegisterManualFirst_IO(engine);
  93. ASRegisterManualFirst_Scene(engine);
  94. ASRegisterManualFirst_UI(engine);
  95. ASRegisterManualFirst_Input(engine);
  96. ASRegisterManualFirst_Engine(engine);
  97. ASRegisterManualFirst_Audio(engine);
  98. ASRegisterManualFirst_Container(engine);
  99. ASRegisterManualFirst_Resource(engine);
  100. #ifdef URHO3D_PHYSICS
  101. ASRegisterManualFirst_Physics(engine);
  102. #endif
  103. #ifdef URHO3D_NETWORK
  104. ASRegisterManualFirst_Network(engine);
  105. #endif
  106. #ifdef URHO3D_IK
  107. ASRegisterManualFirst_IK(engine);
  108. #endif
  109. #ifdef URHO3D_DATABASE
  110. ASRegisterManualFirst_Database(engine);
  111. #endif
  112. #ifdef URHO3D_URHO2D
  113. ASRegisterManualFirst_Urho2D(engine);
  114. #endif
  115. }
  116. // This function is called after ASRegisterGenerated()
  117. void ASRegisterManualLast(asIScriptEngine* engine)
  118. {
  119. ASRegisterManualLast_Addons(engine);
  120. ASRegisterManualLast_Graphics(engine);
  121. ASRegisterManualLast_Core(engine);
  122. ASRegisterManualLast_Math(engine);
  123. ASRegisterManualLast_IO(engine);
  124. ASRegisterManualLast_Scene(engine);
  125. ASRegisterManualLast_UI(engine);
  126. ASRegisterManualLast_Input(engine);
  127. ASRegisterManualLast_Engine(engine);
  128. ASRegisterManualLast_Audio(engine);
  129. ASRegisterManualLast_Container(engine);
  130. ASRegisterManualLast_Resource(engine);
  131. #ifdef URHO3D_PHYSICS
  132. ASRegisterManualLast_Physics(engine);
  133. #endif
  134. #ifdef URHO3D_NETWORK
  135. ASRegisterManualLast_Network(engine);
  136. #endif
  137. #ifdef URHO3D_IK
  138. ASRegisterManualLast_IK(engine);
  139. #endif
  140. #ifdef URHO3D_DATABASE
  141. ASRegisterManualLast_Database(engine);
  142. #endif
  143. #ifdef URHO3D_URHO2D
  144. ASRegisterManualLast_Urho2D(engine);
  145. #endif
  146. }
  147. } // namespace Urho3D