LightInstance.cpp 833 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include "LightInstance.h"
  2. #include "assert.h"
  3. namespace gameplay
  4. {
  5. LightInstance::LightInstance(void) : _ref(NULL)
  6. {
  7. }
  8. LightInstance::~LightInstance(void)
  9. {
  10. }
  11. unsigned int LightInstance::getTypeId(void) const
  12. {
  13. return LIGHTINSTANCE_ID;
  14. }
  15. const char* LightInstance::getElementName(void) const
  16. {
  17. return "LightInstance";
  18. }
  19. void LightInstance::writeBinary(FILE* file)
  20. {
  21. if (_ref != NULL)
  22. {
  23. _ref->writeBinary(file);
  24. }
  25. }
  26. void LightInstance::writeText(FILE* file)
  27. {
  28. if (_ref != NULL)
  29. {
  30. _ref->writeText(file);
  31. }
  32. }
  33. Light* LightInstance::getLight() const
  34. {
  35. return _ref;
  36. }
  37. void LightInstance::setLight(Light* light)
  38. {
  39. _ref = light;
  40. }
  41. bool LightInstance::isAmbient() const
  42. {
  43. return _ref != NULL && _ref->isAmbient();
  44. }
  45. }