lua_RenderStateDepthFunction.cpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "Base.h"
  2. #include "lua_RenderStateDepthFunction.h"
  3. namespace gameplay
  4. {
  5. static const char* enumStringEmpty = "";
  6. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_NEVER = "DEPTH_NEVER";
  7. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_LESS = "DEPTH_LESS";
  8. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_EQUAL = "DEPTH_EQUAL";
  9. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_LEQUAL = "DEPTH_LEQUAL";
  10. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_GREATER = "DEPTH_GREATER";
  11. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_NOTEQUAL = "DEPTH_NOTEQUAL";
  12. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_GEQUAL = "DEPTH_GEQUAL";
  13. static const char* luaEnumString_RenderStateDepthFunction_DEPTH_ALWAYS = "DEPTH_ALWAYS";
  14. RenderState::DepthFunction lua_enumFromString_RenderStateDepthFunction(const char* s)
  15. {
  16. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_NEVER) == 0)
  17. return RenderState::DEPTH_NEVER;
  18. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_LESS) == 0)
  19. return RenderState::DEPTH_LESS;
  20. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_EQUAL) == 0)
  21. return RenderState::DEPTH_EQUAL;
  22. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_LEQUAL) == 0)
  23. return RenderState::DEPTH_LEQUAL;
  24. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_GREATER) == 0)
  25. return RenderState::DEPTH_GREATER;
  26. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_NOTEQUAL) == 0)
  27. return RenderState::DEPTH_NOTEQUAL;
  28. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_GEQUAL) == 0)
  29. return RenderState::DEPTH_GEQUAL;
  30. if (strcmp(s, luaEnumString_RenderStateDepthFunction_DEPTH_ALWAYS) == 0)
  31. return RenderState::DEPTH_ALWAYS;
  32. return RenderState::DEPTH_NEVER;
  33. }
  34. const char* lua_stringFromEnum_RenderStateDepthFunction(RenderState::DepthFunction e)
  35. {
  36. if (e == RenderState::DEPTH_NEVER)
  37. return luaEnumString_RenderStateDepthFunction_DEPTH_NEVER;
  38. if (e == RenderState::DEPTH_LESS)
  39. return luaEnumString_RenderStateDepthFunction_DEPTH_LESS;
  40. if (e == RenderState::DEPTH_EQUAL)
  41. return luaEnumString_RenderStateDepthFunction_DEPTH_EQUAL;
  42. if (e == RenderState::DEPTH_LEQUAL)
  43. return luaEnumString_RenderStateDepthFunction_DEPTH_LEQUAL;
  44. if (e == RenderState::DEPTH_GREATER)
  45. return luaEnumString_RenderStateDepthFunction_DEPTH_GREATER;
  46. if (e == RenderState::DEPTH_NOTEQUAL)
  47. return luaEnumString_RenderStateDepthFunction_DEPTH_NOTEQUAL;
  48. if (e == RenderState::DEPTH_GEQUAL)
  49. return luaEnumString_RenderStateDepthFunction_DEPTH_GEQUAL;
  50. if (e == RenderState::DEPTH_ALWAYS)
  51. return luaEnumString_RenderStateDepthFunction_DEPTH_ALWAYS;
  52. return enumStringEmpty;
  53. }
  54. }