Glyph.cpp 675 B

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