lua_Global.cpp 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075
  1. #include "ScriptController.h"
  2. #include "lua_Global.h"
  3. namespace gameplay
  4. {
  5. void luaRegister_lua_Global()
  6. {
  7. gameplay::ScriptUtil::registerFunction("strcmpnocase", lua__strcmpnocase);
  8. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Button");
  9. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "CheckBox");
  10. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Container");
  11. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Control");
  12. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Form");
  13. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "ImageControl");
  14. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Joint");
  15. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "JoystickControl");
  16. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Label");
  17. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "MaterialParameter");
  18. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Node");
  19. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "RadioButton");
  20. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Slider");
  21. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "TextBox");
  22. gameplay::ScriptUtil::setGlobalHierarchyPair("AnimationTarget", "Transform");
  23. gameplay::ScriptUtil::setGlobalHierarchyPair("Button", "CheckBox");
  24. gameplay::ScriptUtil::setGlobalHierarchyPair("Button", "RadioButton");
  25. gameplay::ScriptUtil::setGlobalHierarchyPair("Camera::Listener", "AudioListener");
  26. gameplay::ScriptUtil::setGlobalHierarchyPair("Camera::Listener", "TerrainPatch");
  27. gameplay::ScriptUtil::setGlobalHierarchyPair("Container", "Form");
  28. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "Button");
  29. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "CheckBox");
  30. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "Container");
  31. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "Form");
  32. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "ImageControl");
  33. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "JoystickControl");
  34. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "Label");
  35. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "RadioButton");
  36. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "Slider");
  37. gameplay::ScriptUtil::setGlobalHierarchyPair("Control", "TextBox");
  38. gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "Button");
  39. gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "CheckBox");
  40. gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "RadioButton");
  41. gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "Slider");
  42. gameplay::ScriptUtil::setGlobalHierarchyPair("Label", "TextBox");
  43. gameplay::ScriptUtil::setGlobalHierarchyPair("Layout", "AbsoluteLayout");
  44. gameplay::ScriptUtil::setGlobalHierarchyPair("Layout", "FlowLayout");
  45. gameplay::ScriptUtil::setGlobalHierarchyPair("Layout", "VerticalLayout");
  46. gameplay::ScriptUtil::setGlobalHierarchyPair("Node", "Joint");
  47. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsCollisionObject", "PhysicsCharacter");
  48. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsCollisionObject", "PhysicsGhostObject");
  49. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsCollisionObject", "PhysicsRigidBody");
  50. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsCollisionObject", "PhysicsVehicle");
  51. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsCollisionObject", "PhysicsVehicleWheel");
  52. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsConstraint", "PhysicsFixedConstraint");
  53. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsConstraint", "PhysicsGenericConstraint");
  54. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsConstraint", "PhysicsHingeConstraint");
  55. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsConstraint", "PhysicsSocketConstraint");
  56. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsConstraint", "PhysicsSpringConstraint");
  57. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsGenericConstraint", "PhysicsFixedConstraint");
  58. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsGenericConstraint", "PhysicsSpringConstraint");
  59. gameplay::ScriptUtil::setGlobalHierarchyPair("PhysicsGhostObject", "PhysicsCharacter");
  60. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "AIAgent");
  61. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "AIState");
  62. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "AbsoluteLayout");
  63. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Animation");
  64. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "AnimationClip");
  65. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "AudioBuffer");
  66. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "AudioSource");
  67. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Bundle");
  68. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Button");
  69. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Camera");
  70. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "CheckBox");
  71. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Container");
  72. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Control");
  73. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Curve");
  74. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "DepthStencilTarget");
  75. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Effect");
  76. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "FlowLayout");
  77. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Font");
  78. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Form");
  79. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "FrameBuffer");
  80. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "HeightField");
  81. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Image");
  82. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "ImageControl");
  83. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Joint");
  84. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "JoystickControl");
  85. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Label");
  86. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Layout");
  87. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Light");
  88. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Material");
  89. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "MaterialParameter");
  90. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Mesh");
  91. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Model");
  92. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Node");
  93. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "ParticleEmitter");
  94. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Pass");
  95. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "PhysicsCollisionShape");
  96. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "RadioButton");
  97. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "RenderState");
  98. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "RenderState::StateBlock");
  99. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "RenderTarget");
  100. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Scene");
  101. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Slider");
  102. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Technique");
  103. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Terrain");
  104. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "TextBox");
  105. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Texture");
  106. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Texture::Sampler");
  107. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Theme");
  108. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "Theme::ThemeImage");
  109. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "VertexAttributeBinding");
  110. gameplay::ScriptUtil::setGlobalHierarchyPair("Ref", "VerticalLayout");
  111. gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Material");
  112. gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Pass");
  113. gameplay::ScriptUtil::setGlobalHierarchyPair("RenderState", "Technique");
  114. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIAgent");
  115. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "AIState");
  116. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Button");
  117. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "CheckBox");
  118. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Container");
  119. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Control");
  120. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Form");
  121. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "ImageControl");
  122. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Joint");
  123. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "JoystickControl");
  124. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Label");
  125. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Node");
  126. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "PhysicsController");
  127. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "RadioButton");
  128. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Slider");
  129. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "TextBox");
  130. gameplay::ScriptUtil::setGlobalHierarchyPair("ScriptTarget", "Transform");
  131. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform", "Joint");
  132. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform", "Node");
  133. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "AudioSource");
  134. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "Camera");
  135. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "MeshSkin");
  136. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsCharacter");
  137. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsGhostObject");
  138. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "PhysicsRigidBody");
  139. gameplay::ScriptUtil::setGlobalHierarchyPair("Transform::Listener", "Terrain");
  140. gameplay::ScriptUtil::addStringFromEnumConversionFunction(&gameplay::lua_stringFromEnumGlobal);
  141. // Register enumeration AIMessage::ParameterType.
  142. {
  143. std::vector<std::string> scopePath;
  144. scopePath.push_back("AIMessage");
  145. gameplay::ScriptUtil::registerConstantString("UNDEFINED", "UNDEFINED", scopePath);
  146. gameplay::ScriptUtil::registerConstantString("INTEGER", "INTEGER", scopePath);
  147. gameplay::ScriptUtil::registerConstantString("LONG", "LONG", scopePath);
  148. gameplay::ScriptUtil::registerConstantString("FLOAT", "FLOAT", scopePath);
  149. gameplay::ScriptUtil::registerConstantString("DOUBLE", "DOUBLE", scopePath);
  150. gameplay::ScriptUtil::registerConstantString("BOOLEAN", "BOOLEAN", scopePath);
  151. gameplay::ScriptUtil::registerConstantString("STRING", "STRING", scopePath);
  152. }
  153. // Register enumeration AnimationClip::Listener::EventType.
  154. {
  155. std::vector<std::string> scopePath;
  156. scopePath.push_back("AnimationClip");
  157. scopePath.push_back("Listener");
  158. gameplay::ScriptUtil::registerConstantString("BEGIN", "BEGIN", scopePath);
  159. gameplay::ScriptUtil::registerConstantString("END", "END", scopePath);
  160. gameplay::ScriptUtil::registerConstantString("TIME", "TIME", scopePath);
  161. }
  162. // Register enumeration AudioSource::State.
  163. {
  164. std::vector<std::string> scopePath;
  165. scopePath.push_back("AudioSource");
  166. gameplay::ScriptUtil::registerConstantString("INITIAL", "INITIAL", scopePath);
  167. gameplay::ScriptUtil::registerConstantString("PLAYING", "PLAYING", scopePath);
  168. gameplay::ScriptUtil::registerConstantString("PAUSED", "PAUSED", scopePath);
  169. gameplay::ScriptUtil::registerConstantString("STOPPED", "STOPPED", scopePath);
  170. }
  171. // Register enumeration Camera::Type.
  172. {
  173. std::vector<std::string> scopePath;
  174. scopePath.push_back("Camera");
  175. gameplay::ScriptUtil::registerConstantString("PERSPECTIVE", "PERSPECTIVE", scopePath);
  176. gameplay::ScriptUtil::registerConstantString("ORTHOGRAPHIC", "ORTHOGRAPHIC", scopePath);
  177. }
  178. // Register enumeration Container::Direction.
  179. {
  180. std::vector<std::string> scopePath;
  181. scopePath.push_back("Container");
  182. gameplay::ScriptUtil::registerConstantString("UP", "UP", scopePath);
  183. gameplay::ScriptUtil::registerConstantString("DOWN", "DOWN", scopePath);
  184. gameplay::ScriptUtil::registerConstantString("LEFT", "LEFT", scopePath);
  185. gameplay::ScriptUtil::registerConstantString("RIGHT", "RIGHT", scopePath);
  186. gameplay::ScriptUtil::registerConstantString("NEXT", "NEXT", scopePath);
  187. gameplay::ScriptUtil::registerConstantString("PREVIOUS", "PREVIOUS", scopePath);
  188. }
  189. // Register enumeration Container::Scroll.
  190. {
  191. std::vector<std::string> scopePath;
  192. scopePath.push_back("Container");
  193. gameplay::ScriptUtil::registerConstantString("SCROLL_NONE", "SCROLL_NONE", scopePath);
  194. gameplay::ScriptUtil::registerConstantString("SCROLL_HORIZONTAL", "SCROLL_HORIZONTAL", scopePath);
  195. gameplay::ScriptUtil::registerConstantString("SCROLL_VERTICAL", "SCROLL_VERTICAL", scopePath);
  196. gameplay::ScriptUtil::registerConstantString("SCROLL_BOTH", "SCROLL_BOTH", scopePath);
  197. }
  198. // Register enumeration Control::Alignment.
  199. {
  200. std::vector<std::string> scopePath;
  201. scopePath.push_back("Control");
  202. gameplay::ScriptUtil::registerConstantString("ALIGN_LEFT", "ALIGN_LEFT", scopePath);
  203. gameplay::ScriptUtil::registerConstantString("ALIGN_HCENTER", "ALIGN_HCENTER", scopePath);
  204. gameplay::ScriptUtil::registerConstantString("ALIGN_RIGHT", "ALIGN_RIGHT", scopePath);
  205. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP", "ALIGN_TOP", scopePath);
  206. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER", "ALIGN_VCENTER", scopePath);
  207. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM", "ALIGN_BOTTOM", scopePath);
  208. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_LEFT", "ALIGN_TOP_LEFT", scopePath);
  209. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_LEFT", "ALIGN_VCENTER_LEFT", scopePath);
  210. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_LEFT", "ALIGN_BOTTOM_LEFT", scopePath);
  211. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_HCENTER", "ALIGN_TOP_HCENTER", scopePath);
  212. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_HCENTER", "ALIGN_VCENTER_HCENTER", scopePath);
  213. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_HCENTER", "ALIGN_BOTTOM_HCENTER", scopePath);
  214. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_RIGHT", "ALIGN_TOP_RIGHT", scopePath);
  215. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_RIGHT", "ALIGN_VCENTER_RIGHT", scopePath);
  216. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_RIGHT", "ALIGN_BOTTOM_RIGHT", scopePath);
  217. }
  218. // Register enumeration Control::AutoSize.
  219. {
  220. std::vector<std::string> scopePath;
  221. scopePath.push_back("Control");
  222. gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_NONE", "AUTO_SIZE_NONE", scopePath);
  223. gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_WIDTH", "AUTO_SIZE_WIDTH", scopePath);
  224. gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_HEIGHT", "AUTO_SIZE_HEIGHT", scopePath);
  225. gameplay::ScriptUtil::registerConstantString("AUTO_SIZE_BOTH", "AUTO_SIZE_BOTH", scopePath);
  226. }
  227. // Register enumeration Control::Listener::EventType.
  228. {
  229. std::vector<std::string> scopePath;
  230. scopePath.push_back("Control");
  231. scopePath.push_back("Listener");
  232. gameplay::ScriptUtil::registerConstantString("PRESS", "PRESS", scopePath);
  233. gameplay::ScriptUtil::registerConstantString("RELEASE", "RELEASE", scopePath);
  234. gameplay::ScriptUtil::registerConstantString("CLICK", "CLICK", scopePath);
  235. gameplay::ScriptUtil::registerConstantString("VALUE_CHANGED", "VALUE_CHANGED", scopePath);
  236. gameplay::ScriptUtil::registerConstantString("TEXT_CHANGED", "TEXT_CHANGED", scopePath);
  237. gameplay::ScriptUtil::registerConstantString("MIDDLE_CLICK", "MIDDLE_CLICK", scopePath);
  238. gameplay::ScriptUtil::registerConstantString("RIGHT_CLICK", "RIGHT_CLICK", scopePath);
  239. gameplay::ScriptUtil::registerConstantString("FOCUS_GAINED", "FOCUS_GAINED", scopePath);
  240. gameplay::ScriptUtil::registerConstantString("FOCUS_LOST", "FOCUS_LOST", scopePath);
  241. }
  242. // Register enumeration Control::State.
  243. {
  244. std::vector<std::string> scopePath;
  245. scopePath.push_back("Control");
  246. gameplay::ScriptUtil::registerConstantString("NORMAL", "NORMAL", scopePath);
  247. gameplay::ScriptUtil::registerConstantString("FOCUS", "FOCUS", scopePath);
  248. gameplay::ScriptUtil::registerConstantString("ACTIVE", "ACTIVE", scopePath);
  249. gameplay::ScriptUtil::registerConstantString("DISABLED", "DISABLED", scopePath);
  250. gameplay::ScriptUtil::registerConstantString("HOVER", "HOVER", scopePath);
  251. }
  252. // Register enumeration Curve::InterpolationType.
  253. {
  254. std::vector<std::string> scopePath;
  255. scopePath.push_back("Curve");
  256. gameplay::ScriptUtil::registerConstantString("BEZIER", "BEZIER", scopePath);
  257. gameplay::ScriptUtil::registerConstantString("BSPLINE", "BSPLINE", scopePath);
  258. gameplay::ScriptUtil::registerConstantString("FLAT", "FLAT", scopePath);
  259. gameplay::ScriptUtil::registerConstantString("HERMITE", "HERMITE", scopePath);
  260. gameplay::ScriptUtil::registerConstantString("LINEAR", "LINEAR", scopePath);
  261. gameplay::ScriptUtil::registerConstantString("SMOOTH", "SMOOTH", scopePath);
  262. gameplay::ScriptUtil::registerConstantString("STEP", "STEP", scopePath);
  263. gameplay::ScriptUtil::registerConstantString("QUADRATIC_IN", "QUADRATIC_IN", scopePath);
  264. gameplay::ScriptUtil::registerConstantString("QUADRATIC_OUT", "QUADRATIC_OUT", scopePath);
  265. gameplay::ScriptUtil::registerConstantString("QUADRATIC_IN_OUT", "QUADRATIC_IN_OUT", scopePath);
  266. gameplay::ScriptUtil::registerConstantString("QUADRATIC_OUT_IN", "QUADRATIC_OUT_IN", scopePath);
  267. gameplay::ScriptUtil::registerConstantString("CUBIC_IN", "CUBIC_IN", scopePath);
  268. gameplay::ScriptUtil::registerConstantString("CUBIC_OUT", "CUBIC_OUT", scopePath);
  269. gameplay::ScriptUtil::registerConstantString("CUBIC_IN_OUT", "CUBIC_IN_OUT", scopePath);
  270. gameplay::ScriptUtil::registerConstantString("CUBIC_OUT_IN", "CUBIC_OUT_IN", scopePath);
  271. gameplay::ScriptUtil::registerConstantString("QUARTIC_IN", "QUARTIC_IN", scopePath);
  272. gameplay::ScriptUtil::registerConstantString("QUARTIC_OUT", "QUARTIC_OUT", scopePath);
  273. gameplay::ScriptUtil::registerConstantString("QUARTIC_IN_OUT", "QUARTIC_IN_OUT", scopePath);
  274. gameplay::ScriptUtil::registerConstantString("QUARTIC_OUT_IN", "QUARTIC_OUT_IN", scopePath);
  275. gameplay::ScriptUtil::registerConstantString("QUINTIC_IN", "QUINTIC_IN", scopePath);
  276. gameplay::ScriptUtil::registerConstantString("QUINTIC_OUT", "QUINTIC_OUT", scopePath);
  277. gameplay::ScriptUtil::registerConstantString("QUINTIC_IN_OUT", "QUINTIC_IN_OUT", scopePath);
  278. gameplay::ScriptUtil::registerConstantString("QUINTIC_OUT_IN", "QUINTIC_OUT_IN", scopePath);
  279. gameplay::ScriptUtil::registerConstantString("SINE_IN", "SINE_IN", scopePath);
  280. gameplay::ScriptUtil::registerConstantString("SINE_OUT", "SINE_OUT", scopePath);
  281. gameplay::ScriptUtil::registerConstantString("SINE_IN_OUT", "SINE_IN_OUT", scopePath);
  282. gameplay::ScriptUtil::registerConstantString("SINE_OUT_IN", "SINE_OUT_IN", scopePath);
  283. gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_IN", "EXPONENTIAL_IN", scopePath);
  284. gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_OUT", "EXPONENTIAL_OUT", scopePath);
  285. gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_IN_OUT", "EXPONENTIAL_IN_OUT", scopePath);
  286. gameplay::ScriptUtil::registerConstantString("EXPONENTIAL_OUT_IN", "EXPONENTIAL_OUT_IN", scopePath);
  287. gameplay::ScriptUtil::registerConstantString("CIRCULAR_IN", "CIRCULAR_IN", scopePath);
  288. gameplay::ScriptUtil::registerConstantString("CIRCULAR_OUT", "CIRCULAR_OUT", scopePath);
  289. gameplay::ScriptUtil::registerConstantString("CIRCULAR_IN_OUT", "CIRCULAR_IN_OUT", scopePath);
  290. gameplay::ScriptUtil::registerConstantString("CIRCULAR_OUT_IN", "CIRCULAR_OUT_IN", scopePath);
  291. gameplay::ScriptUtil::registerConstantString("ELASTIC_IN", "ELASTIC_IN", scopePath);
  292. gameplay::ScriptUtil::registerConstantString("ELASTIC_OUT", "ELASTIC_OUT", scopePath);
  293. gameplay::ScriptUtil::registerConstantString("ELASTIC_IN_OUT", "ELASTIC_IN_OUT", scopePath);
  294. gameplay::ScriptUtil::registerConstantString("ELASTIC_OUT_IN", "ELASTIC_OUT_IN", scopePath);
  295. gameplay::ScriptUtil::registerConstantString("OVERSHOOT_IN", "OVERSHOOT_IN", scopePath);
  296. gameplay::ScriptUtil::registerConstantString("OVERSHOOT_OUT", "OVERSHOOT_OUT", scopePath);
  297. gameplay::ScriptUtil::registerConstantString("OVERSHOOT_IN_OUT", "OVERSHOOT_IN_OUT", scopePath);
  298. gameplay::ScriptUtil::registerConstantString("OVERSHOOT_OUT_IN", "OVERSHOOT_OUT_IN", scopePath);
  299. gameplay::ScriptUtil::registerConstantString("BOUNCE_IN", "BOUNCE_IN", scopePath);
  300. gameplay::ScriptUtil::registerConstantString("BOUNCE_OUT", "BOUNCE_OUT", scopePath);
  301. gameplay::ScriptUtil::registerConstantString("BOUNCE_IN_OUT", "BOUNCE_IN_OUT", scopePath);
  302. gameplay::ScriptUtil::registerConstantString("BOUNCE_OUT_IN", "BOUNCE_OUT_IN", scopePath);
  303. }
  304. // Register enumeration DepthStencilTarget::Format.
  305. {
  306. std::vector<std::string> scopePath;
  307. scopePath.push_back("DepthStencilTarget");
  308. gameplay::ScriptUtil::registerConstantString("DEPTH", "DEPTH", scopePath);
  309. gameplay::ScriptUtil::registerConstantString("DEPTH_STENCIL", "DEPTH_STENCIL", scopePath);
  310. }
  311. // Register enumeration Font::Format.
  312. {
  313. std::vector<std::string> scopePath;
  314. scopePath.push_back("Font");
  315. gameplay::ScriptUtil::registerConstantString("BITMAP", "BITMAP", scopePath);
  316. gameplay::ScriptUtil::registerConstantString("DISTANCE_FIELD", "DISTANCE_FIELD", scopePath);
  317. }
  318. // Register enumeration Font::Justify.
  319. {
  320. std::vector<std::string> scopePath;
  321. scopePath.push_back("Font");
  322. gameplay::ScriptUtil::registerConstantString("ALIGN_LEFT", "ALIGN_LEFT", scopePath);
  323. gameplay::ScriptUtil::registerConstantString("ALIGN_HCENTER", "ALIGN_HCENTER", scopePath);
  324. gameplay::ScriptUtil::registerConstantString("ALIGN_RIGHT", "ALIGN_RIGHT", scopePath);
  325. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP", "ALIGN_TOP", scopePath);
  326. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER", "ALIGN_VCENTER", scopePath);
  327. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM", "ALIGN_BOTTOM", scopePath);
  328. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_LEFT", "ALIGN_TOP_LEFT", scopePath);
  329. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_LEFT", "ALIGN_VCENTER_LEFT", scopePath);
  330. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_LEFT", "ALIGN_BOTTOM_LEFT", scopePath);
  331. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_HCENTER", "ALIGN_TOP_HCENTER", scopePath);
  332. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_HCENTER", "ALIGN_VCENTER_HCENTER", scopePath);
  333. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_HCENTER", "ALIGN_BOTTOM_HCENTER", scopePath);
  334. gameplay::ScriptUtil::registerConstantString("ALIGN_TOP_RIGHT", "ALIGN_TOP_RIGHT", scopePath);
  335. gameplay::ScriptUtil::registerConstantString("ALIGN_VCENTER_RIGHT", "ALIGN_VCENTER_RIGHT", scopePath);
  336. gameplay::ScriptUtil::registerConstantString("ALIGN_BOTTOM_RIGHT", "ALIGN_BOTTOM_RIGHT", scopePath);
  337. }
  338. // Register enumeration Font::Style.
  339. {
  340. std::vector<std::string> scopePath;
  341. scopePath.push_back("Font");
  342. gameplay::ScriptUtil::registerConstantString("PLAIN", "PLAIN", scopePath);
  343. gameplay::ScriptUtil::registerConstantString("BOLD", "BOLD", scopePath);
  344. gameplay::ScriptUtil::registerConstantString("ITALIC", "ITALIC", scopePath);
  345. gameplay::ScriptUtil::registerConstantString("BOLD_ITALIC", "BOLD_ITALIC", scopePath);
  346. }
  347. // Register enumeration Game::ClearFlags.
  348. {
  349. std::vector<std::string> scopePath;
  350. scopePath.push_back("Game");
  351. gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR", "CLEAR_COLOR", scopePath);
  352. gameplay::ScriptUtil::registerConstantString("CLEAR_DEPTH", "CLEAR_DEPTH", scopePath);
  353. gameplay::ScriptUtil::registerConstantString("CLEAR_STENCIL", "CLEAR_STENCIL", scopePath);
  354. gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR_DEPTH", "CLEAR_COLOR_DEPTH", scopePath);
  355. gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR_STENCIL", "CLEAR_COLOR_STENCIL", scopePath);
  356. gameplay::ScriptUtil::registerConstantString("CLEAR_DEPTH_STENCIL", "CLEAR_DEPTH_STENCIL", scopePath);
  357. gameplay::ScriptUtil::registerConstantString("CLEAR_COLOR_DEPTH_STENCIL", "CLEAR_COLOR_DEPTH_STENCIL", scopePath);
  358. }
  359. // Register enumeration Game::State.
  360. {
  361. std::vector<std::string> scopePath;
  362. scopePath.push_back("Game");
  363. gameplay::ScriptUtil::registerConstantString("UNINITIALIZED", "UNINITIALIZED", scopePath);
  364. gameplay::ScriptUtil::registerConstantString("RUNNING", "RUNNING", scopePath);
  365. gameplay::ScriptUtil::registerConstantString("PAUSED", "PAUSED", scopePath);
  366. }
  367. // Register enumeration Gamepad::ButtonMapping.
  368. {
  369. std::vector<std::string> scopePath;
  370. scopePath.push_back("Gamepad");
  371. gameplay::ScriptUtil::registerConstantString("BUTTON_A", "BUTTON_A", scopePath);
  372. gameplay::ScriptUtil::registerConstantString("BUTTON_B", "BUTTON_B", scopePath);
  373. gameplay::ScriptUtil::registerConstantString("BUTTON_C", "BUTTON_C", scopePath);
  374. gameplay::ScriptUtil::registerConstantString("BUTTON_X", "BUTTON_X", scopePath);
  375. gameplay::ScriptUtil::registerConstantString("BUTTON_Y", "BUTTON_Y", scopePath);
  376. gameplay::ScriptUtil::registerConstantString("BUTTON_Z", "BUTTON_Z", scopePath);
  377. gameplay::ScriptUtil::registerConstantString("BUTTON_MENU1", "BUTTON_MENU1", scopePath);
  378. gameplay::ScriptUtil::registerConstantString("BUTTON_MENU2", "BUTTON_MENU2", scopePath);
  379. gameplay::ScriptUtil::registerConstantString("BUTTON_MENU3", "BUTTON_MENU3", scopePath);
  380. gameplay::ScriptUtil::registerConstantString("BUTTON_MENU4", "BUTTON_MENU4", scopePath);
  381. gameplay::ScriptUtil::registerConstantString("BUTTON_L1", "BUTTON_L1", scopePath);
  382. gameplay::ScriptUtil::registerConstantString("BUTTON_L2", "BUTTON_L2", scopePath);
  383. gameplay::ScriptUtil::registerConstantString("BUTTON_L3", "BUTTON_L3", scopePath);
  384. gameplay::ScriptUtil::registerConstantString("BUTTON_R1", "BUTTON_R1", scopePath);
  385. gameplay::ScriptUtil::registerConstantString("BUTTON_R2", "BUTTON_R2", scopePath);
  386. gameplay::ScriptUtil::registerConstantString("BUTTON_R3", "BUTTON_R3", scopePath);
  387. gameplay::ScriptUtil::registerConstantString("BUTTON_UP", "BUTTON_UP", scopePath);
  388. gameplay::ScriptUtil::registerConstantString("BUTTON_DOWN", "BUTTON_DOWN", scopePath);
  389. gameplay::ScriptUtil::registerConstantString("BUTTON_LEFT", "BUTTON_LEFT", scopePath);
  390. gameplay::ScriptUtil::registerConstantString("BUTTON_RIGHT", "BUTTON_RIGHT", scopePath);
  391. }
  392. // Register enumeration Gamepad::GamepadEvent.
  393. {
  394. std::vector<std::string> scopePath;
  395. scopePath.push_back("Gamepad");
  396. gameplay::ScriptUtil::registerConstantString("CONNECTED_EVENT", "CONNECTED_EVENT", scopePath);
  397. gameplay::ScriptUtil::registerConstantString("DISCONNECTED_EVENT", "DISCONNECTED_EVENT", scopePath);
  398. gameplay::ScriptUtil::registerConstantString("BUTTON_EVENT", "BUTTON_EVENT", scopePath);
  399. gameplay::ScriptUtil::registerConstantString("JOYSTICK_EVENT", "JOYSTICK_EVENT", scopePath);
  400. gameplay::ScriptUtil::registerConstantString("TRIGGER_EVENT", "TRIGGER_EVENT", scopePath);
  401. }
  402. // Register enumeration Gesture::GestureEvent.
  403. {
  404. std::vector<std::string> scopePath;
  405. scopePath.push_back("Gesture");
  406. gameplay::ScriptUtil::registerConstantString("GESTURE_TAP", "GESTURE_TAP", scopePath);
  407. gameplay::ScriptUtil::registerConstantString("GESTURE_SWIPE", "GESTURE_SWIPE", scopePath);
  408. gameplay::ScriptUtil::registerConstantString("GESTURE_PINCH", "GESTURE_PINCH", scopePath);
  409. gameplay::ScriptUtil::registerConstantString("GESTURE_LONG_TAP", "GESTURE_LONG_TAP", scopePath);
  410. gameplay::ScriptUtil::registerConstantString("GESTURE_DRAG", "GESTURE_DRAG", scopePath);
  411. gameplay::ScriptUtil::registerConstantString("GESTURE_DROP", "GESTURE_DROP", scopePath);
  412. gameplay::ScriptUtil::registerConstantString("GESTURE_ANY_SUPPORTED", "GESTURE_ANY_SUPPORTED", scopePath);
  413. }
  414. // Register enumeration Image::Format.
  415. {
  416. std::vector<std::string> scopePath;
  417. scopePath.push_back("Image");
  418. gameplay::ScriptUtil::registerConstantString("RGB", "RGB", scopePath);
  419. gameplay::ScriptUtil::registerConstantString("RGBA", "RGBA", scopePath);
  420. }
  421. // Register enumeration Keyboard::Key.
  422. {
  423. std::vector<std::string> scopePath;
  424. scopePath.push_back("Keyboard");
  425. gameplay::ScriptUtil::registerConstantString("KEY_NONE", "KEY_NONE", scopePath);
  426. gameplay::ScriptUtil::registerConstantString("KEY_PAUSE", "KEY_PAUSE", scopePath);
  427. gameplay::ScriptUtil::registerConstantString("KEY_SCROLL_LOCK", "KEY_SCROLL_LOCK", scopePath);
  428. gameplay::ScriptUtil::registerConstantString("KEY_PRINT", "KEY_PRINT", scopePath);
  429. gameplay::ScriptUtil::registerConstantString("KEY_SYSREQ", "KEY_SYSREQ", scopePath);
  430. gameplay::ScriptUtil::registerConstantString("KEY_BREAK", "KEY_BREAK", scopePath);
  431. gameplay::ScriptUtil::registerConstantString("KEY_ESCAPE", "KEY_ESCAPE", scopePath);
  432. gameplay::ScriptUtil::registerConstantString("KEY_BACKSPACE", "KEY_BACKSPACE", scopePath);
  433. gameplay::ScriptUtil::registerConstantString("KEY_TAB", "KEY_TAB", scopePath);
  434. gameplay::ScriptUtil::registerConstantString("KEY_BACK_TAB", "KEY_BACK_TAB", scopePath);
  435. gameplay::ScriptUtil::registerConstantString("KEY_RETURN", "KEY_RETURN", scopePath);
  436. gameplay::ScriptUtil::registerConstantString("KEY_CAPS_LOCK", "KEY_CAPS_LOCK", scopePath);
  437. gameplay::ScriptUtil::registerConstantString("KEY_SHIFT", "KEY_SHIFT", scopePath);
  438. gameplay::ScriptUtil::registerConstantString("KEY_CTRL", "KEY_CTRL", scopePath);
  439. gameplay::ScriptUtil::registerConstantString("KEY_ALT", "KEY_ALT", scopePath);
  440. gameplay::ScriptUtil::registerConstantString("KEY_MENU", "KEY_MENU", scopePath);
  441. gameplay::ScriptUtil::registerConstantString("KEY_HYPER", "KEY_HYPER", scopePath);
  442. gameplay::ScriptUtil::registerConstantString("KEY_INSERT", "KEY_INSERT", scopePath);
  443. gameplay::ScriptUtil::registerConstantString("KEY_HOME", "KEY_HOME", scopePath);
  444. gameplay::ScriptUtil::registerConstantString("KEY_PG_UP", "KEY_PG_UP", scopePath);
  445. gameplay::ScriptUtil::registerConstantString("KEY_DELETE", "KEY_DELETE", scopePath);
  446. gameplay::ScriptUtil::registerConstantString("KEY_END", "KEY_END", scopePath);
  447. gameplay::ScriptUtil::registerConstantString("KEY_PG_DOWN", "KEY_PG_DOWN", scopePath);
  448. gameplay::ScriptUtil::registerConstantString("KEY_LEFT_ARROW", "KEY_LEFT_ARROW", scopePath);
  449. gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_ARROW", "KEY_RIGHT_ARROW", scopePath);
  450. gameplay::ScriptUtil::registerConstantString("KEY_UP_ARROW", "KEY_UP_ARROW", scopePath);
  451. gameplay::ScriptUtil::registerConstantString("KEY_DOWN_ARROW", "KEY_DOWN_ARROW", scopePath);
  452. gameplay::ScriptUtil::registerConstantString("KEY_NUM_LOCK", "KEY_NUM_LOCK", scopePath);
  453. gameplay::ScriptUtil::registerConstantString("KEY_KP_PLUS", "KEY_KP_PLUS", scopePath);
  454. gameplay::ScriptUtil::registerConstantString("KEY_KP_MINUS", "KEY_KP_MINUS", scopePath);
  455. gameplay::ScriptUtil::registerConstantString("KEY_KP_MULTIPLY", "KEY_KP_MULTIPLY", scopePath);
  456. gameplay::ScriptUtil::registerConstantString("KEY_KP_DIVIDE", "KEY_KP_DIVIDE", scopePath);
  457. gameplay::ScriptUtil::registerConstantString("KEY_KP_ENTER", "KEY_KP_ENTER", scopePath);
  458. gameplay::ScriptUtil::registerConstantString("KEY_KP_HOME", "KEY_KP_HOME", scopePath);
  459. gameplay::ScriptUtil::registerConstantString("KEY_KP_UP", "KEY_KP_UP", scopePath);
  460. gameplay::ScriptUtil::registerConstantString("KEY_KP_PG_UP", "KEY_KP_PG_UP", scopePath);
  461. gameplay::ScriptUtil::registerConstantString("KEY_KP_LEFT", "KEY_KP_LEFT", scopePath);
  462. gameplay::ScriptUtil::registerConstantString("KEY_KP_FIVE", "KEY_KP_FIVE", scopePath);
  463. gameplay::ScriptUtil::registerConstantString("KEY_KP_RIGHT", "KEY_KP_RIGHT", scopePath);
  464. gameplay::ScriptUtil::registerConstantString("KEY_KP_END", "KEY_KP_END", scopePath);
  465. gameplay::ScriptUtil::registerConstantString("KEY_KP_DOWN", "KEY_KP_DOWN", scopePath);
  466. gameplay::ScriptUtil::registerConstantString("KEY_KP_PG_DOWN", "KEY_KP_PG_DOWN", scopePath);
  467. gameplay::ScriptUtil::registerConstantString("KEY_KP_INSERT", "KEY_KP_INSERT", scopePath);
  468. gameplay::ScriptUtil::registerConstantString("KEY_KP_DELETE", "KEY_KP_DELETE", scopePath);
  469. gameplay::ScriptUtil::registerConstantString("KEY_F1", "KEY_F1", scopePath);
  470. gameplay::ScriptUtil::registerConstantString("KEY_F2", "KEY_F2", scopePath);
  471. gameplay::ScriptUtil::registerConstantString("KEY_F3", "KEY_F3", scopePath);
  472. gameplay::ScriptUtil::registerConstantString("KEY_F4", "KEY_F4", scopePath);
  473. gameplay::ScriptUtil::registerConstantString("KEY_F5", "KEY_F5", scopePath);
  474. gameplay::ScriptUtil::registerConstantString("KEY_F6", "KEY_F6", scopePath);
  475. gameplay::ScriptUtil::registerConstantString("KEY_F7", "KEY_F7", scopePath);
  476. gameplay::ScriptUtil::registerConstantString("KEY_F8", "KEY_F8", scopePath);
  477. gameplay::ScriptUtil::registerConstantString("KEY_F9", "KEY_F9", scopePath);
  478. gameplay::ScriptUtil::registerConstantString("KEY_F10", "KEY_F10", scopePath);
  479. gameplay::ScriptUtil::registerConstantString("KEY_F11", "KEY_F11", scopePath);
  480. gameplay::ScriptUtil::registerConstantString("KEY_F12", "KEY_F12", scopePath);
  481. gameplay::ScriptUtil::registerConstantString("KEY_SPACE", "KEY_SPACE", scopePath);
  482. gameplay::ScriptUtil::registerConstantString("KEY_EXCLAM", "KEY_EXCLAM", scopePath);
  483. gameplay::ScriptUtil::registerConstantString("KEY_QUOTE", "KEY_QUOTE", scopePath);
  484. gameplay::ScriptUtil::registerConstantString("KEY_NUMBER", "KEY_NUMBER", scopePath);
  485. gameplay::ScriptUtil::registerConstantString("KEY_DOLLAR", "KEY_DOLLAR", scopePath);
  486. gameplay::ScriptUtil::registerConstantString("KEY_PERCENT", "KEY_PERCENT", scopePath);
  487. gameplay::ScriptUtil::registerConstantString("KEY_CIRCUMFLEX", "KEY_CIRCUMFLEX", scopePath);
  488. gameplay::ScriptUtil::registerConstantString("KEY_AMPERSAND", "KEY_AMPERSAND", scopePath);
  489. gameplay::ScriptUtil::registerConstantString("KEY_APOSTROPHE", "KEY_APOSTROPHE", scopePath);
  490. gameplay::ScriptUtil::registerConstantString("KEY_LEFT_PARENTHESIS", "KEY_LEFT_PARENTHESIS", scopePath);
  491. gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_PARENTHESIS", "KEY_RIGHT_PARENTHESIS", scopePath);
  492. gameplay::ScriptUtil::registerConstantString("KEY_ASTERISK", "KEY_ASTERISK", scopePath);
  493. gameplay::ScriptUtil::registerConstantString("KEY_PLUS", "KEY_PLUS", scopePath);
  494. gameplay::ScriptUtil::registerConstantString("KEY_COMMA", "KEY_COMMA", scopePath);
  495. gameplay::ScriptUtil::registerConstantString("KEY_MINUS", "KEY_MINUS", scopePath);
  496. gameplay::ScriptUtil::registerConstantString("KEY_PERIOD", "KEY_PERIOD", scopePath);
  497. gameplay::ScriptUtil::registerConstantString("KEY_SLASH", "KEY_SLASH", scopePath);
  498. gameplay::ScriptUtil::registerConstantString("KEY_ZERO", "KEY_ZERO", scopePath);
  499. gameplay::ScriptUtil::registerConstantString("KEY_ONE", "KEY_ONE", scopePath);
  500. gameplay::ScriptUtil::registerConstantString("KEY_TWO", "KEY_TWO", scopePath);
  501. gameplay::ScriptUtil::registerConstantString("KEY_THREE", "KEY_THREE", scopePath);
  502. gameplay::ScriptUtil::registerConstantString("KEY_FOUR", "KEY_FOUR", scopePath);
  503. gameplay::ScriptUtil::registerConstantString("KEY_FIVE", "KEY_FIVE", scopePath);
  504. gameplay::ScriptUtil::registerConstantString("KEY_SIX", "KEY_SIX", scopePath);
  505. gameplay::ScriptUtil::registerConstantString("KEY_SEVEN", "KEY_SEVEN", scopePath);
  506. gameplay::ScriptUtil::registerConstantString("KEY_EIGHT", "KEY_EIGHT", scopePath);
  507. gameplay::ScriptUtil::registerConstantString("KEY_NINE", "KEY_NINE", scopePath);
  508. gameplay::ScriptUtil::registerConstantString("KEY_COLON", "KEY_COLON", scopePath);
  509. gameplay::ScriptUtil::registerConstantString("KEY_SEMICOLON", "KEY_SEMICOLON", scopePath);
  510. gameplay::ScriptUtil::registerConstantString("KEY_LESS_THAN", "KEY_LESS_THAN", scopePath);
  511. gameplay::ScriptUtil::registerConstantString("KEY_EQUAL", "KEY_EQUAL", scopePath);
  512. gameplay::ScriptUtil::registerConstantString("KEY_GREATER_THAN", "KEY_GREATER_THAN", scopePath);
  513. gameplay::ScriptUtil::registerConstantString("KEY_QUESTION", "KEY_QUESTION", scopePath);
  514. gameplay::ScriptUtil::registerConstantString("KEY_AT", "KEY_AT", scopePath);
  515. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_A", "KEY_CAPITAL_A", scopePath);
  516. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_B", "KEY_CAPITAL_B", scopePath);
  517. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_C", "KEY_CAPITAL_C", scopePath);
  518. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_D", "KEY_CAPITAL_D", scopePath);
  519. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_E", "KEY_CAPITAL_E", scopePath);
  520. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_F", "KEY_CAPITAL_F", scopePath);
  521. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_G", "KEY_CAPITAL_G", scopePath);
  522. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_H", "KEY_CAPITAL_H", scopePath);
  523. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_I", "KEY_CAPITAL_I", scopePath);
  524. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_J", "KEY_CAPITAL_J", scopePath);
  525. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_K", "KEY_CAPITAL_K", scopePath);
  526. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_L", "KEY_CAPITAL_L", scopePath);
  527. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_M", "KEY_CAPITAL_M", scopePath);
  528. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_N", "KEY_CAPITAL_N", scopePath);
  529. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_O", "KEY_CAPITAL_O", scopePath);
  530. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_P", "KEY_CAPITAL_P", scopePath);
  531. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_Q", "KEY_CAPITAL_Q", scopePath);
  532. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_R", "KEY_CAPITAL_R", scopePath);
  533. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_S", "KEY_CAPITAL_S", scopePath);
  534. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_T", "KEY_CAPITAL_T", scopePath);
  535. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_U", "KEY_CAPITAL_U", scopePath);
  536. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_V", "KEY_CAPITAL_V", scopePath);
  537. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_W", "KEY_CAPITAL_W", scopePath);
  538. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_X", "KEY_CAPITAL_X", scopePath);
  539. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_Y", "KEY_CAPITAL_Y", scopePath);
  540. gameplay::ScriptUtil::registerConstantString("KEY_CAPITAL_Z", "KEY_CAPITAL_Z", scopePath);
  541. gameplay::ScriptUtil::registerConstantString("KEY_LEFT_BRACKET", "KEY_LEFT_BRACKET", scopePath);
  542. gameplay::ScriptUtil::registerConstantString("KEY_BACK_SLASH", "KEY_BACK_SLASH", scopePath);
  543. gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_BRACKET", "KEY_RIGHT_BRACKET", scopePath);
  544. gameplay::ScriptUtil::registerConstantString("KEY_UNDERSCORE", "KEY_UNDERSCORE", scopePath);
  545. gameplay::ScriptUtil::registerConstantString("KEY_GRAVE", "KEY_GRAVE", scopePath);
  546. gameplay::ScriptUtil::registerConstantString("KEY_A", "KEY_A", scopePath);
  547. gameplay::ScriptUtil::registerConstantString("KEY_B", "KEY_B", scopePath);
  548. gameplay::ScriptUtil::registerConstantString("KEY_C", "KEY_C", scopePath);
  549. gameplay::ScriptUtil::registerConstantString("KEY_D", "KEY_D", scopePath);
  550. gameplay::ScriptUtil::registerConstantString("KEY_E", "KEY_E", scopePath);
  551. gameplay::ScriptUtil::registerConstantString("KEY_F", "KEY_F", scopePath);
  552. gameplay::ScriptUtil::registerConstantString("KEY_G", "KEY_G", scopePath);
  553. gameplay::ScriptUtil::registerConstantString("KEY_H", "KEY_H", scopePath);
  554. gameplay::ScriptUtil::registerConstantString("KEY_I", "KEY_I", scopePath);
  555. gameplay::ScriptUtil::registerConstantString("KEY_J", "KEY_J", scopePath);
  556. gameplay::ScriptUtil::registerConstantString("KEY_K", "KEY_K", scopePath);
  557. gameplay::ScriptUtil::registerConstantString("KEY_L", "KEY_L", scopePath);
  558. gameplay::ScriptUtil::registerConstantString("KEY_M", "KEY_M", scopePath);
  559. gameplay::ScriptUtil::registerConstantString("KEY_N", "KEY_N", scopePath);
  560. gameplay::ScriptUtil::registerConstantString("KEY_O", "KEY_O", scopePath);
  561. gameplay::ScriptUtil::registerConstantString("KEY_P", "KEY_P", scopePath);
  562. gameplay::ScriptUtil::registerConstantString("KEY_Q", "KEY_Q", scopePath);
  563. gameplay::ScriptUtil::registerConstantString("KEY_R", "KEY_R", scopePath);
  564. gameplay::ScriptUtil::registerConstantString("KEY_S", "KEY_S", scopePath);
  565. gameplay::ScriptUtil::registerConstantString("KEY_T", "KEY_T", scopePath);
  566. gameplay::ScriptUtil::registerConstantString("KEY_U", "KEY_U", scopePath);
  567. gameplay::ScriptUtil::registerConstantString("KEY_V", "KEY_V", scopePath);
  568. gameplay::ScriptUtil::registerConstantString("KEY_W", "KEY_W", scopePath);
  569. gameplay::ScriptUtil::registerConstantString("KEY_X", "KEY_X", scopePath);
  570. gameplay::ScriptUtil::registerConstantString("KEY_Y", "KEY_Y", scopePath);
  571. gameplay::ScriptUtil::registerConstantString("KEY_Z", "KEY_Z", scopePath);
  572. gameplay::ScriptUtil::registerConstantString("KEY_LEFT_BRACE", "KEY_LEFT_BRACE", scopePath);
  573. gameplay::ScriptUtil::registerConstantString("KEY_BAR", "KEY_BAR", scopePath);
  574. gameplay::ScriptUtil::registerConstantString("KEY_RIGHT_BRACE", "KEY_RIGHT_BRACE", scopePath);
  575. gameplay::ScriptUtil::registerConstantString("KEY_TILDE", "KEY_TILDE", scopePath);
  576. gameplay::ScriptUtil::registerConstantString("KEY_EURO", "KEY_EURO", scopePath);
  577. gameplay::ScriptUtil::registerConstantString("KEY_POUND", "KEY_POUND", scopePath);
  578. gameplay::ScriptUtil::registerConstantString("KEY_YEN", "KEY_YEN", scopePath);
  579. gameplay::ScriptUtil::registerConstantString("KEY_MIDDLE_DOT", "KEY_MIDDLE_DOT", scopePath);
  580. gameplay::ScriptUtil::registerConstantString("KEY_SEARCH", "KEY_SEARCH", scopePath);
  581. }
  582. // Register enumeration Keyboard::KeyEvent.
  583. {
  584. std::vector<std::string> scopePath;
  585. scopePath.push_back("Keyboard");
  586. gameplay::ScriptUtil::registerConstantString("KEY_PRESS", "KEY_PRESS", scopePath);
  587. gameplay::ScriptUtil::registerConstantString("KEY_RELEASE", "KEY_RELEASE", scopePath);
  588. gameplay::ScriptUtil::registerConstantString("KEY_CHAR", "KEY_CHAR", scopePath);
  589. }
  590. // Register enumeration Layout::Type.
  591. {
  592. std::vector<std::string> scopePath;
  593. scopePath.push_back("Layout");
  594. gameplay::ScriptUtil::registerConstantString("LAYOUT_FLOW", "LAYOUT_FLOW", scopePath);
  595. gameplay::ScriptUtil::registerConstantString("LAYOUT_VERTICAL", "LAYOUT_VERTICAL", scopePath);
  596. gameplay::ScriptUtil::registerConstantString("LAYOUT_ABSOLUTE", "LAYOUT_ABSOLUTE", scopePath);
  597. }
  598. // Register enumeration Light::Type.
  599. {
  600. std::vector<std::string> scopePath;
  601. scopePath.push_back("Light");
  602. gameplay::ScriptUtil::registerConstantString("DIRECTIONAL", "DIRECTIONAL", scopePath);
  603. gameplay::ScriptUtil::registerConstantString("POINT", "POINT", scopePath);
  604. gameplay::ScriptUtil::registerConstantString("SPOT", "SPOT", scopePath);
  605. }
  606. // Register enumeration Logger::Level.
  607. {
  608. std::vector<std::string> scopePath;
  609. scopePath.push_back("Logger");
  610. gameplay::ScriptUtil::registerConstantString("LEVEL_INFO", "LEVEL_INFO", scopePath);
  611. gameplay::ScriptUtil::registerConstantString("LEVEL_WARN", "LEVEL_WARN", scopePath);
  612. gameplay::ScriptUtil::registerConstantString("LEVEL_ERROR", "LEVEL_ERROR", scopePath);
  613. }
  614. // Register enumeration Mesh::IndexFormat.
  615. {
  616. std::vector<std::string> scopePath;
  617. scopePath.push_back("Mesh");
  618. gameplay::ScriptUtil::registerConstantString("INDEX8", "INDEX8", scopePath);
  619. gameplay::ScriptUtil::registerConstantString("INDEX16", "INDEX16", scopePath);
  620. gameplay::ScriptUtil::registerConstantString("INDEX32", "INDEX32", scopePath);
  621. }
  622. // Register enumeration Mesh::PrimitiveType.
  623. {
  624. std::vector<std::string> scopePath;
  625. scopePath.push_back("Mesh");
  626. gameplay::ScriptUtil::registerConstantString("TRIANGLES", "TRIANGLES", scopePath);
  627. gameplay::ScriptUtil::registerConstantString("TRIANGLE_STRIP", "TRIANGLE_STRIP", scopePath);
  628. gameplay::ScriptUtil::registerConstantString("LINES", "LINES", scopePath);
  629. gameplay::ScriptUtil::registerConstantString("LINE_STRIP", "LINE_STRIP", scopePath);
  630. gameplay::ScriptUtil::registerConstantString("POINTS", "POINTS", scopePath);
  631. }
  632. // Register enumeration Mouse::MouseEvent.
  633. {
  634. std::vector<std::string> scopePath;
  635. scopePath.push_back("Mouse");
  636. gameplay::ScriptUtil::registerConstantString("MOUSE_PRESS_LEFT_BUTTON", "MOUSE_PRESS_LEFT_BUTTON", scopePath);
  637. gameplay::ScriptUtil::registerConstantString("MOUSE_RELEASE_LEFT_BUTTON", "MOUSE_RELEASE_LEFT_BUTTON", scopePath);
  638. gameplay::ScriptUtil::registerConstantString("MOUSE_PRESS_MIDDLE_BUTTON", "MOUSE_PRESS_MIDDLE_BUTTON", scopePath);
  639. gameplay::ScriptUtil::registerConstantString("MOUSE_RELEASE_MIDDLE_BUTTON", "MOUSE_RELEASE_MIDDLE_BUTTON", scopePath);
  640. gameplay::ScriptUtil::registerConstantString("MOUSE_PRESS_RIGHT_BUTTON", "MOUSE_PRESS_RIGHT_BUTTON", scopePath);
  641. gameplay::ScriptUtil::registerConstantString("MOUSE_RELEASE_RIGHT_BUTTON", "MOUSE_RELEASE_RIGHT_BUTTON", scopePath);
  642. gameplay::ScriptUtil::registerConstantString("MOUSE_MOVE", "MOUSE_MOVE", scopePath);
  643. gameplay::ScriptUtil::registerConstantString("MOUSE_WHEEL", "MOUSE_WHEEL", scopePath);
  644. }
  645. // Register enumeration Node::Type.
  646. {
  647. std::vector<std::string> scopePath;
  648. scopePath.push_back("Node");
  649. gameplay::ScriptUtil::registerConstantString("NODE", "NODE", scopePath);
  650. gameplay::ScriptUtil::registerConstantString("JOINT", "JOINT", scopePath);
  651. }
  652. // Register enumeration ParticleEmitter::TextureBlending.
  653. {
  654. std::vector<std::string> scopePath;
  655. scopePath.push_back("ParticleEmitter");
  656. gameplay::ScriptUtil::registerConstantString("BLEND_OPAQUE", "BLEND_OPAQUE", scopePath);
  657. gameplay::ScriptUtil::registerConstantString("BLEND_TRANSPARENT", "BLEND_TRANSPARENT", scopePath);
  658. gameplay::ScriptUtil::registerConstantString("BLEND_ADDITIVE", "BLEND_ADDITIVE", scopePath);
  659. gameplay::ScriptUtil::registerConstantString("BLEND_MULTIPLIED", "BLEND_MULTIPLIED", scopePath);
  660. }
  661. // Register enumeration PhysicsCollisionObject::CollisionListener::EventType.
  662. {
  663. std::vector<std::string> scopePath;
  664. scopePath.push_back("PhysicsCollisionObject");
  665. scopePath.push_back("CollisionListener");
  666. gameplay::ScriptUtil::registerConstantString("COLLIDING", "COLLIDING", scopePath);
  667. gameplay::ScriptUtil::registerConstantString("NOT_COLLIDING", "NOT_COLLIDING", scopePath);
  668. }
  669. // Register enumeration PhysicsCollisionObject::Type.
  670. {
  671. std::vector<std::string> scopePath;
  672. scopePath.push_back("PhysicsCollisionObject");
  673. gameplay::ScriptUtil::registerConstantString("RIGID_BODY", "RIGID_BODY", scopePath);
  674. gameplay::ScriptUtil::registerConstantString("CHARACTER", "CHARACTER", scopePath);
  675. gameplay::ScriptUtil::registerConstantString("GHOST_OBJECT", "GHOST_OBJECT", scopePath);
  676. gameplay::ScriptUtil::registerConstantString("VEHICLE", "VEHICLE", scopePath);
  677. gameplay::ScriptUtil::registerConstantString("VEHICLE_WHEEL", "VEHICLE_WHEEL", scopePath);
  678. gameplay::ScriptUtil::registerConstantString("NONE", "NONE", scopePath);
  679. }
  680. // Register enumeration PhysicsCollisionShape::Type.
  681. {
  682. std::vector<std::string> scopePath;
  683. scopePath.push_back("PhysicsCollisionShape");
  684. gameplay::ScriptUtil::registerConstantString("SHAPE_NONE", "SHAPE_NONE", scopePath);
  685. gameplay::ScriptUtil::registerConstantString("SHAPE_BOX", "SHAPE_BOX", scopePath);
  686. gameplay::ScriptUtil::registerConstantString("SHAPE_SPHERE", "SHAPE_SPHERE", scopePath);
  687. gameplay::ScriptUtil::registerConstantString("SHAPE_CAPSULE", "SHAPE_CAPSULE", scopePath);
  688. gameplay::ScriptUtil::registerConstantString("SHAPE_MESH", "SHAPE_MESH", scopePath);
  689. gameplay::ScriptUtil::registerConstantString("SHAPE_HEIGHTFIELD", "SHAPE_HEIGHTFIELD", scopePath);
  690. }
  691. // Register enumeration PhysicsController::Listener::EventType.
  692. {
  693. std::vector<std::string> scopePath;
  694. scopePath.push_back("PhysicsController");
  695. scopePath.push_back("Listener");
  696. gameplay::ScriptUtil::registerConstantString("ACTIVATED", "ACTIVATED", scopePath);
  697. gameplay::ScriptUtil::registerConstantString("DEACTIVATED", "DEACTIVATED", scopePath);
  698. }
  699. // Register enumeration Properties::Type.
  700. {
  701. std::vector<std::string> scopePath;
  702. scopePath.push_back("Properties");
  703. gameplay::ScriptUtil::registerConstantString("NONE", "NONE", scopePath);
  704. gameplay::ScriptUtil::registerConstantString("STRING", "STRING", scopePath);
  705. gameplay::ScriptUtil::registerConstantString("NUMBER", "NUMBER", scopePath);
  706. gameplay::ScriptUtil::registerConstantString("VECTOR2", "VECTOR2", scopePath);
  707. gameplay::ScriptUtil::registerConstantString("VECTOR3", "VECTOR3", scopePath);
  708. gameplay::ScriptUtil::registerConstantString("VECTOR4", "VECTOR4", scopePath);
  709. gameplay::ScriptUtil::registerConstantString("MATRIX", "MATRIX", scopePath);
  710. }
  711. // Register enumeration RenderState::AutoBinding.
  712. {
  713. std::vector<std::string> scopePath;
  714. scopePath.push_back("RenderState");
  715. gameplay::ScriptUtil::registerConstantString("NONE", "NONE", scopePath);
  716. gameplay::ScriptUtil::registerConstantString("WORLD_MATRIX", "WORLD_MATRIX", scopePath);
  717. gameplay::ScriptUtil::registerConstantString("VIEW_MATRIX", "VIEW_MATRIX", scopePath);
  718. gameplay::ScriptUtil::registerConstantString("PROJECTION_MATRIX", "PROJECTION_MATRIX", scopePath);
  719. gameplay::ScriptUtil::registerConstantString("WORLD_VIEW_MATRIX", "WORLD_VIEW_MATRIX", scopePath);
  720. gameplay::ScriptUtil::registerConstantString("VIEW_PROJECTION_MATRIX", "VIEW_PROJECTION_MATRIX", scopePath);
  721. gameplay::ScriptUtil::registerConstantString("WORLD_VIEW_PROJECTION_MATRIX", "WORLD_VIEW_PROJECTION_MATRIX", scopePath);
  722. gameplay::ScriptUtil::registerConstantString("INVERSE_TRANSPOSE_WORLD_MATRIX", "INVERSE_TRANSPOSE_WORLD_MATRIX", scopePath);
  723. gameplay::ScriptUtil::registerConstantString("INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX", "INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX", scopePath);
  724. gameplay::ScriptUtil::registerConstantString("CAMERA_WORLD_POSITION", "CAMERA_WORLD_POSITION", scopePath);
  725. gameplay::ScriptUtil::registerConstantString("CAMERA_VIEW_POSITION", "CAMERA_VIEW_POSITION", scopePath);
  726. gameplay::ScriptUtil::registerConstantString("MATRIX_PALETTE", "MATRIX_PALETTE", scopePath);
  727. gameplay::ScriptUtil::registerConstantString("SCENE_AMBIENT_COLOR", "SCENE_AMBIENT_COLOR", scopePath);
  728. }
  729. // Register enumeration RenderState::Blend.
  730. {
  731. std::vector<std::string> scopePath;
  732. scopePath.push_back("RenderState");
  733. gameplay::ScriptUtil::registerConstantString("BLEND_ZERO", "BLEND_ZERO", scopePath);
  734. gameplay::ScriptUtil::registerConstantString("BLEND_ONE", "BLEND_ONE", scopePath);
  735. gameplay::ScriptUtil::registerConstantString("BLEND_SRC_COLOR", "BLEND_SRC_COLOR", scopePath);
  736. gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_SRC_COLOR", "BLEND_ONE_MINUS_SRC_COLOR", scopePath);
  737. gameplay::ScriptUtil::registerConstantString("BLEND_DST_COLOR", "BLEND_DST_COLOR", scopePath);
  738. gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_DST_COLOR", "BLEND_ONE_MINUS_DST_COLOR", scopePath);
  739. gameplay::ScriptUtil::registerConstantString("BLEND_SRC_ALPHA", "BLEND_SRC_ALPHA", scopePath);
  740. gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_SRC_ALPHA", "BLEND_ONE_MINUS_SRC_ALPHA", scopePath);
  741. gameplay::ScriptUtil::registerConstantString("BLEND_DST_ALPHA", "BLEND_DST_ALPHA", scopePath);
  742. gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_DST_ALPHA", "BLEND_ONE_MINUS_DST_ALPHA", scopePath);
  743. gameplay::ScriptUtil::registerConstantString("BLEND_CONSTANT_ALPHA", "BLEND_CONSTANT_ALPHA", scopePath);
  744. gameplay::ScriptUtil::registerConstantString("BLEND_ONE_MINUS_CONSTANT_ALPHA", "BLEND_ONE_MINUS_CONSTANT_ALPHA", scopePath);
  745. gameplay::ScriptUtil::registerConstantString("BLEND_SRC_ALPHA_SATURATE", "BLEND_SRC_ALPHA_SATURATE", scopePath);
  746. }
  747. // Register enumeration RenderState::CullFaceSide.
  748. {
  749. std::vector<std::string> scopePath;
  750. scopePath.push_back("RenderState");
  751. gameplay::ScriptUtil::registerConstantString("CULL_FACE_SIDE_BACK", "CULL_FACE_SIDE_BACK", scopePath);
  752. gameplay::ScriptUtil::registerConstantString("CULL_FACE_SIDE_FRONT", "CULL_FACE_SIDE_FRONT", scopePath);
  753. gameplay::ScriptUtil::registerConstantString("CULL_FACE_SIDE_FRONT_AND_BACK", "CULL_FACE_SIDE_FRONT_AND_BACK", scopePath);
  754. }
  755. // Register enumeration RenderState::DepthFunction.
  756. {
  757. std::vector<std::string> scopePath;
  758. scopePath.push_back("RenderState");
  759. gameplay::ScriptUtil::registerConstantString("DEPTH_NEVER", "DEPTH_NEVER", scopePath);
  760. gameplay::ScriptUtil::registerConstantString("DEPTH_LESS", "DEPTH_LESS", scopePath);
  761. gameplay::ScriptUtil::registerConstantString("DEPTH_EQUAL", "DEPTH_EQUAL", scopePath);
  762. gameplay::ScriptUtil::registerConstantString("DEPTH_LEQUAL", "DEPTH_LEQUAL", scopePath);
  763. gameplay::ScriptUtil::registerConstantString("DEPTH_GREATER", "DEPTH_GREATER", scopePath);
  764. gameplay::ScriptUtil::registerConstantString("DEPTH_NOTEQUAL", "DEPTH_NOTEQUAL", scopePath);
  765. gameplay::ScriptUtil::registerConstantString("DEPTH_GEQUAL", "DEPTH_GEQUAL", scopePath);
  766. gameplay::ScriptUtil::registerConstantString("DEPTH_ALWAYS", "DEPTH_ALWAYS", scopePath);
  767. }
  768. // Register enumeration RenderState::FrontFace.
  769. {
  770. std::vector<std::string> scopePath;
  771. scopePath.push_back("RenderState");
  772. gameplay::ScriptUtil::registerConstantString("FRONT_FACE_CW", "FRONT_FACE_CW", scopePath);
  773. gameplay::ScriptUtil::registerConstantString("FRONT_FACE_CCW", "FRONT_FACE_CCW", scopePath);
  774. }
  775. // Register enumeration RenderState::StencilFunction.
  776. {
  777. std::vector<std::string> scopePath;
  778. scopePath.push_back("RenderState");
  779. gameplay::ScriptUtil::registerConstantString("STENCIL_NEVER", "STENCIL_NEVER", scopePath);
  780. gameplay::ScriptUtil::registerConstantString("STENCIL_ALWAYS", "STENCIL_ALWAYS", scopePath);
  781. gameplay::ScriptUtil::registerConstantString("STENCIL_LESS", "STENCIL_LESS", scopePath);
  782. gameplay::ScriptUtil::registerConstantString("STENCIL_LEQUAL", "STENCIL_LEQUAL", scopePath);
  783. gameplay::ScriptUtil::registerConstantString("STENCIL_EQUAL", "STENCIL_EQUAL", scopePath);
  784. gameplay::ScriptUtil::registerConstantString("STENCIL_GREATER", "STENCIL_GREATER", scopePath);
  785. gameplay::ScriptUtil::registerConstantString("STENCIL_GEQUAL", "STENCIL_GEQUAL", scopePath);
  786. gameplay::ScriptUtil::registerConstantString("STENCIL_NOTEQUAL", "STENCIL_NOTEQUAL", scopePath);
  787. }
  788. // Register enumeration RenderState::StencilOperation.
  789. {
  790. std::vector<std::string> scopePath;
  791. scopePath.push_back("RenderState");
  792. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_KEEP", "STENCIL_OP_KEEP", scopePath);
  793. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_ZERO", "STENCIL_OP_ZERO", scopePath);
  794. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_REPLACE", "STENCIL_OP_REPLACE", scopePath);
  795. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INCR", "STENCIL_OP_INCR", scopePath);
  796. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_DECR", "STENCIL_OP_DECR", scopePath);
  797. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INVERT", "STENCIL_OP_INVERT", scopePath);
  798. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_INCR_WRAP", "STENCIL_OP_INCR_WRAP", scopePath);
  799. gameplay::ScriptUtil::registerConstantString("STENCIL_OP_DECR_WRAP", "STENCIL_OP_DECR_WRAP", scopePath);
  800. }
  801. // Register enumeration Terrain::Flags.
  802. {
  803. std::vector<std::string> scopePath;
  804. scopePath.push_back("Terrain");
  805. gameplay::ScriptUtil::registerConstantString("DEBUG_PATCHES", "DEBUG_PATCHES", scopePath);
  806. gameplay::ScriptUtil::registerConstantString("FRUSTUM_CULLING", "FRUSTUM_CULLING", scopePath);
  807. gameplay::ScriptUtil::registerConstantString("LEVEL_OF_DETAIL", "LEVEL_OF_DETAIL", scopePath);
  808. }
  809. // Register enumeration TextBox::InputMode.
  810. {
  811. std::vector<std::string> scopePath;
  812. scopePath.push_back("TextBox");
  813. gameplay::ScriptUtil::registerConstantString("TEXT", "TEXT", scopePath);
  814. gameplay::ScriptUtil::registerConstantString("PASSWORD", "PASSWORD", scopePath);
  815. }
  816. // Register enumeration Texture::Filter.
  817. {
  818. std::vector<std::string> scopePath;
  819. scopePath.push_back("Texture");
  820. gameplay::ScriptUtil::registerConstantString("NEAREST", "NEAREST", scopePath);
  821. gameplay::ScriptUtil::registerConstantString("LINEAR", "LINEAR", scopePath);
  822. gameplay::ScriptUtil::registerConstantString("NEAREST_MIPMAP_NEAREST", "NEAREST_MIPMAP_NEAREST", scopePath);
  823. gameplay::ScriptUtil::registerConstantString("LINEAR_MIPMAP_NEAREST", "LINEAR_MIPMAP_NEAREST", scopePath);
  824. gameplay::ScriptUtil::registerConstantString("NEAREST_MIPMAP_LINEAR", "NEAREST_MIPMAP_LINEAR", scopePath);
  825. gameplay::ScriptUtil::registerConstantString("LINEAR_MIPMAP_LINEAR", "LINEAR_MIPMAP_LINEAR", scopePath);
  826. }
  827. // Register enumeration Texture::Format.
  828. {
  829. std::vector<std::string> scopePath;
  830. scopePath.push_back("Texture");
  831. gameplay::ScriptUtil::registerConstantString("UNKNOWN", "UNKNOWN", scopePath);
  832. gameplay::ScriptUtil::registerConstantString("RGB", "RGB", scopePath);
  833. gameplay::ScriptUtil::registerConstantString("RGBA", "RGBA", scopePath);
  834. gameplay::ScriptUtil::registerConstantString("ALPHA", "ALPHA", scopePath);
  835. }
  836. // Register enumeration Texture::Wrap.
  837. {
  838. std::vector<std::string> scopePath;
  839. scopePath.push_back("Texture");
  840. gameplay::ScriptUtil::registerConstantString("REPEAT", "REPEAT", scopePath);
  841. gameplay::ScriptUtil::registerConstantString("CLAMP", "CLAMP", scopePath);
  842. }
  843. // Register enumeration Touch::TouchEvent.
  844. {
  845. std::vector<std::string> scopePath;
  846. scopePath.push_back("Touch");
  847. gameplay::ScriptUtil::registerConstantString("TOUCH_PRESS", "TOUCH_PRESS", scopePath);
  848. gameplay::ScriptUtil::registerConstantString("TOUCH_RELEASE", "TOUCH_RELEASE", scopePath);
  849. gameplay::ScriptUtil::registerConstantString("TOUCH_MOVE", "TOUCH_MOVE", scopePath);
  850. }
  851. // Register enumeration VertexFormat::Usage.
  852. {
  853. std::vector<std::string> scopePath;
  854. scopePath.push_back("VertexFormat");
  855. gameplay::ScriptUtil::registerConstantString("POSITION", "POSITION", scopePath);
  856. gameplay::ScriptUtil::registerConstantString("NORMAL", "NORMAL", scopePath);
  857. gameplay::ScriptUtil::registerConstantString("COLOR", "COLOR", scopePath);
  858. gameplay::ScriptUtil::registerConstantString("TANGENT", "TANGENT", scopePath);
  859. gameplay::ScriptUtil::registerConstantString("BINORMAL", "BINORMAL", scopePath);
  860. gameplay::ScriptUtil::registerConstantString("BLENDWEIGHTS", "BLENDWEIGHTS", scopePath);
  861. gameplay::ScriptUtil::registerConstantString("BLENDINDICES", "BLENDINDICES", scopePath);
  862. gameplay::ScriptUtil::registerConstantString("TEXCOORD0", "TEXCOORD0", scopePath);
  863. gameplay::ScriptUtil::registerConstantString("TEXCOORD1", "TEXCOORD1", scopePath);
  864. gameplay::ScriptUtil::registerConstantString("TEXCOORD2", "TEXCOORD2", scopePath);
  865. gameplay::ScriptUtil::registerConstantString("TEXCOORD3", "TEXCOORD3", scopePath);
  866. gameplay::ScriptUtil::registerConstantString("TEXCOORD4", "TEXCOORD4", scopePath);
  867. gameplay::ScriptUtil::registerConstantString("TEXCOORD5", "TEXCOORD5", scopePath);
  868. gameplay::ScriptUtil::registerConstantString("TEXCOORD6", "TEXCOORD6", scopePath);
  869. gameplay::ScriptUtil::registerConstantString("TEXCOORD7", "TEXCOORD7", scopePath);
  870. }
  871. }
  872. int lua__strcmpnocase(lua_State* state)
  873. {
  874. // Get the number of parameters.
  875. int paramCount = lua_gettop(state);
  876. // Attempt to match the parameters to a valid binding.
  877. switch (paramCount)
  878. {
  879. case 2:
  880. {
  881. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
  882. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  883. {
  884. // Get parameter 1 off the stack.
  885. const char* param1 = gameplay::ScriptUtil::getString(1, false);
  886. // Get parameter 2 off the stack.
  887. const char* param2 = gameplay::ScriptUtil::getString(2, false);
  888. int result = strcmpnocase(param1, param2);
  889. // Push the return value onto the stack.
  890. lua_pushinteger(state, result);
  891. return 1;
  892. }
  893. lua_pushstring(state, "lua__strcmpnocase - Failed to match the given parameters to a valid function signature.");
  894. lua_error(state);
  895. break;
  896. }
  897. default:
  898. {
  899. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  900. lua_error(state);
  901. break;
  902. }
  903. }
  904. return 0;
  905. }
  906. static const char* enumStringEmpty = "";
  907. const char* lua_stringFromEnumGlobal(std::string& enumname, unsigned int value)
  908. {
  909. if (enumname == "AIMessage::ParameterType")
  910. return lua_stringFromEnum_AIMessageParameterType((AIMessage::ParameterType)value);
  911. if (enumname == "AnimationClip::Listener::EventType")
  912. return lua_stringFromEnum_AnimationClipListenerEventType((AnimationClip::Listener::EventType)value);
  913. if (enumname == "AudioSource::State")
  914. return lua_stringFromEnum_AudioSourceState((AudioSource::State)value);
  915. if (enumname == "Camera::Type")
  916. return lua_stringFromEnum_CameraType((Camera::Type)value);
  917. if (enumname == "Container::Direction")
  918. return lua_stringFromEnum_ContainerDirection((Container::Direction)value);
  919. if (enumname == "Container::Scroll")
  920. return lua_stringFromEnum_ContainerScroll((Container::Scroll)value);
  921. if (enumname == "Control::Alignment")
  922. return lua_stringFromEnum_ControlAlignment((Control::Alignment)value);
  923. if (enumname == "Control::AutoSize")
  924. return lua_stringFromEnum_ControlAutoSize((Control::AutoSize)value);
  925. if (enumname == "Control::Listener::EventType")
  926. return lua_stringFromEnum_ControlListenerEventType((Control::Listener::EventType)value);
  927. if (enumname == "Control::State")
  928. return lua_stringFromEnum_ControlState((Control::State)value);
  929. if (enumname == "Curve::InterpolationType")
  930. return lua_stringFromEnum_CurveInterpolationType((Curve::InterpolationType)value);
  931. if (enumname == "DepthStencilTarget::Format")
  932. return lua_stringFromEnum_DepthStencilTargetFormat((DepthStencilTarget::Format)value);
  933. if (enumname == "Font::Format")
  934. return lua_stringFromEnum_FontFormat((Font::Format)value);
  935. if (enumname == "Font::Justify")
  936. return lua_stringFromEnum_FontJustify((Font::Justify)value);
  937. if (enumname == "Font::Style")
  938. return lua_stringFromEnum_FontStyle((Font::Style)value);
  939. if (enumname == "Game::ClearFlags")
  940. return lua_stringFromEnum_GameClearFlags((Game::ClearFlags)value);
  941. if (enumname == "Game::State")
  942. return lua_stringFromEnum_GameState((Game::State)value);
  943. if (enumname == "Gamepad::ButtonMapping")
  944. return lua_stringFromEnum_GamepadButtonMapping((Gamepad::ButtonMapping)value);
  945. if (enumname == "Gamepad::GamepadEvent")
  946. return lua_stringFromEnum_GamepadGamepadEvent((Gamepad::GamepadEvent)value);
  947. if (enumname == "Gesture::GestureEvent")
  948. return lua_stringFromEnum_GestureGestureEvent((Gesture::GestureEvent)value);
  949. if (enumname == "Image::Format")
  950. return lua_stringFromEnum_ImageFormat((Image::Format)value);
  951. if (enumname == "Keyboard::Key")
  952. return lua_stringFromEnum_KeyboardKey((Keyboard::Key)value);
  953. if (enumname == "Keyboard::KeyEvent")
  954. return lua_stringFromEnum_KeyboardKeyEvent((Keyboard::KeyEvent)value);
  955. if (enumname == "Layout::Type")
  956. return lua_stringFromEnum_LayoutType((Layout::Type)value);
  957. if (enumname == "Light::Type")
  958. return lua_stringFromEnum_LightType((Light::Type)value);
  959. if (enumname == "Logger::Level")
  960. return lua_stringFromEnum_LoggerLevel((Logger::Level)value);
  961. if (enumname == "Mesh::IndexFormat")
  962. return lua_stringFromEnum_MeshIndexFormat((Mesh::IndexFormat)value);
  963. if (enumname == "Mesh::PrimitiveType")
  964. return lua_stringFromEnum_MeshPrimitiveType((Mesh::PrimitiveType)value);
  965. if (enumname == "Mouse::MouseEvent")
  966. return lua_stringFromEnum_MouseMouseEvent((Mouse::MouseEvent)value);
  967. if (enumname == "Node::Type")
  968. return lua_stringFromEnum_NodeType((Node::Type)value);
  969. if (enumname == "ParticleEmitter::TextureBlending")
  970. return lua_stringFromEnum_ParticleEmitterTextureBlending((ParticleEmitter::TextureBlending)value);
  971. if (enumname == "PhysicsCollisionObject::CollisionListener::EventType")
  972. return lua_stringFromEnum_PhysicsCollisionObjectCollisionListenerEventType((PhysicsCollisionObject::CollisionListener::EventType)value);
  973. if (enumname == "PhysicsCollisionObject::Type")
  974. return lua_stringFromEnum_PhysicsCollisionObjectType((PhysicsCollisionObject::Type)value);
  975. if (enumname == "PhysicsCollisionShape::Type")
  976. return lua_stringFromEnum_PhysicsCollisionShapeType((PhysicsCollisionShape::Type)value);
  977. if (enumname == "PhysicsController::Listener::EventType")
  978. return lua_stringFromEnum_PhysicsControllerListenerEventType((PhysicsController::Listener::EventType)value);
  979. if (enumname == "Properties::Type")
  980. return lua_stringFromEnum_PropertiesType((Properties::Type)value);
  981. if (enumname == "RenderState::AutoBinding")
  982. return lua_stringFromEnum_RenderStateAutoBinding((RenderState::AutoBinding)value);
  983. if (enumname == "RenderState::Blend")
  984. return lua_stringFromEnum_RenderStateBlend((RenderState::Blend)value);
  985. if (enumname == "RenderState::CullFaceSide")
  986. return lua_stringFromEnum_RenderStateCullFaceSide((RenderState::CullFaceSide)value);
  987. if (enumname == "RenderState::DepthFunction")
  988. return lua_stringFromEnum_RenderStateDepthFunction((RenderState::DepthFunction)value);
  989. if (enumname == "RenderState::FrontFace")
  990. return lua_stringFromEnum_RenderStateFrontFace((RenderState::FrontFace)value);
  991. if (enumname == "RenderState::StencilFunction")
  992. return lua_stringFromEnum_RenderStateStencilFunction((RenderState::StencilFunction)value);
  993. if (enumname == "RenderState::StencilOperation")
  994. return lua_stringFromEnum_RenderStateStencilOperation((RenderState::StencilOperation)value);
  995. if (enumname == "Terrain::Flags")
  996. return lua_stringFromEnum_TerrainFlags((Terrain::Flags)value);
  997. if (enumname == "TextBox::InputMode")
  998. return lua_stringFromEnum_TextBoxInputMode((TextBox::InputMode)value);
  999. if (enumname == "Texture::Filter")
  1000. return lua_stringFromEnum_TextureFilter((Texture::Filter)value);
  1001. if (enumname == "Texture::Format")
  1002. return lua_stringFromEnum_TextureFormat((Texture::Format)value);
  1003. if (enumname == "Texture::Wrap")
  1004. return lua_stringFromEnum_TextureWrap((Texture::Wrap)value);
  1005. if (enumname == "Touch::TouchEvent")
  1006. return lua_stringFromEnum_TouchTouchEvent((Touch::TouchEvent)value);
  1007. if (enumname == "VertexFormat::Usage")
  1008. return lua_stringFromEnum_VertexFormatUsage((VertexFormat::Usage)value);
  1009. GP_ERROR("Unrecognized enumeration type '%s'.", enumname.c_str());
  1010. return enumStringEmpty;
  1011. }
  1012. }