Glyph.cpp 648 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "Glyph.h"
  2. namespace gameplay
  3. {
  4. Glyph::Glyph(void) :
  5. index(0),
  6. width(0)
  7. {
  8. fillArray(uvCoords, 0.0f, 4);
  9. }
  10. Glyph::~Glyph(void)
  11. {
  12. }
  13. const char* Glyph::getElementName(void) const
  14. {
  15. return "Glyph";
  16. }
  17. void Glyph::writeBinary(FILE* file)
  18. {
  19. Object::writeBinary(file);
  20. write(index, file);
  21. write(width, file);
  22. write(uvCoords, 4, file);
  23. }
  24. void Glyph::writeText(FILE* file)
  25. {
  26. fprintElementStart(file);
  27. fprintfElement(file, "index", index);
  28. fprintfElement(file, "width", width);
  29. fprintfElement(file, "uvCoords", uvCoords, 4);
  30. fprintElementEnd(file);
  31. }
  32. }