oxygine_helper.py 991 B

123456789101112131415161718192021222324252627
  1. import os
  2. import sys
  3. class helper(object):
  4. def __init__(self, root, version=0):
  5. self.path_root = root + "/"
  6. self.path_process_xml = self.path_root + "tools/oxyresbuild.py"
  7. self.path_bmfont = self.path_root + "/3rdPartyTools/BMFont/bmfont.com"
  8. if sys.platform == "darwin":
  9. self.path_pvrtextool = self.path_root + "/3rdPartyTools/macosx/PVRTexToolCLI "
  10. elif sys.platform == "linux2":
  11. self.path_pvrtextool = self.path_root + "/3rdPartyTools/linux/PVRTexToolCLI "
  12. else:
  13. self.path_pvrtextool = self.path_root + "/3rdPartyTools/PVRTexToolCL.exe "
  14. def process_xml(self, embedded, args):
  15. if embedded:
  16. folder = self.path_root + "tools"
  17. if folder not in sys.path:
  18. sys.path.append(folder)
  19. import oxyresbuild
  20. return oxyresbuild.process(args)
  21. else:
  22. os.system("python \"{}\" {}".format(self.path_process_xml, args))