Manual.cpp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. ASRegisterManualFirst_Addons(engine);
  88. ASRegisterManualFirst_Graphics(engine);
  89. ASRegisterManualFirst_Core(engine);
  90. ASRegisterManualFirst_Math(engine);
  91. ASRegisterManualFirst_IO(engine);
  92. ASRegisterManualFirst_Scene(engine);
  93. ASRegisterManualFirst_UI(engine);
  94. ASRegisterManualFirst_Input(engine);
  95. ASRegisterManualFirst_Engine(engine);
  96. ASRegisterManualFirst_Audio(engine);
  97. ASRegisterManualFirst_Container(engine);
  98. ASRegisterManualFirst_Resource(engine);
  99. #ifdef URHO3D_PHYSICS
  100. ASRegisterManualFirst_Physics(engine);
  101. #endif
  102. #ifdef URHO3D_NETWORK
  103. ASRegisterManualFirst_Network(engine);
  104. #endif
  105. #ifdef URHO3D_IK
  106. ASRegisterManualFirst_IK(engine);
  107. #endif
  108. #ifdef URHO3D_DATABASE
  109. ASRegisterManualFirst_Database(engine);
  110. #endif
  111. #ifdef URHO3D_URHO2D
  112. ASRegisterManualFirst_Urho2D(engine);
  113. #endif
  114. }
  115. // This function is called after ASRegisterGenerated()
  116. void ASRegisterManualLast(asIScriptEngine* engine)
  117. {
  118. ASRegisterManualLast_Addons(engine);
  119. ASRegisterManualLast_Graphics(engine);
  120. ASRegisterManualLast_Core(engine);
  121. ASRegisterManualLast_Math(engine);
  122. ASRegisterManualLast_IO(engine);
  123. ASRegisterManualLast_Scene(engine);
  124. ASRegisterManualLast_UI(engine);
  125. ASRegisterManualLast_Input(engine);
  126. ASRegisterManualLast_Engine(engine);
  127. ASRegisterManualLast_Audio(engine);
  128. ASRegisterManualLast_Container(engine);
  129. ASRegisterManualLast_Resource(engine);
  130. #ifdef URHO3D_PHYSICS
  131. ASRegisterManualLast_Physics(engine);
  132. #endif
  133. #ifdef URHO3D_NETWORK
  134. ASRegisterManualLast_Network(engine);
  135. #endif
  136. #ifdef URHO3D_IK
  137. ASRegisterManualLast_IK(engine);
  138. #endif
  139. #ifdef URHO3D_DATABASE
  140. ASRegisterManualLast_Database(engine);
  141. #endif
  142. #ifdef URHO3D_URHO2D
  143. ASRegisterManualLast_Urho2D(engine);
  144. #endif
  145. }
  146. } // namespace Urho3D