UnityPlatformWin32.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #if (UNITY_WP8)
  2. using System;
  3. using CommonUI_Unity3D.Platform;
  4. using UnityEngine;
  5. using CommonUI.Gemo;
  6. using CommonLang.Concurrent;
  7. using MPQ.Updater;
  8. using System.IO;
  9. using CommonLang;
  10. namespace CommonUI_Unity3D_WP8
  11. {
  12. public class UnityPlatformWinPhone8 : IUnityPlatform
  13. {
  14. public bool IsNativeUnzip { get { return false; } }
  15. public void Assert(string msg)
  16. {
  17. }
  18. public long GetAvaliableSpace(string path)
  19. {
  20. return long.MaxValue;
  21. }
  22. public long GetTotalSpace(string path)
  23. {
  24. return long.MaxValue;
  25. }
  26. public Texture2D SysFontTexture(string text, bool readable, CommonUI.Display.FontStyle style, int fontSize, uint fontColor, int borderTime, uint borderColor, Size2D expectSize, out int boundW, out int boundH)
  27. {
  28. throw new NotImplementedException();
  29. }
  30. public bool TestTextLineBreak(string text, float size, CommonUI.Display.FontStyle style, int borderTime, float testWidth, out float realWidth, out float realHeight)
  31. {
  32. throw new NotImplementedException();
  33. }
  34. public void CopyPixels(Texture2D src, int sx, int sy, int sw, int sh, Texture2D dst, int dx, int dy)
  35. {
  36. throw new NotImplementedException();
  37. }
  38. public bool NativeDecompressFile(MPQUpdater updater, MPQUpdater.RemoteFileInfo zip_file, MPQUpdater.RemoteFileInfo mpq_file, AtomicLong current_unzip_bytes)
  39. {
  40. return CommonMPQ.SharpZipLib.Unzip.SharpZipLib_RunUnzipMPQ(updater, zip_file, mpq_file, current_unzip_bytes);
  41. }
  42. public bool NativeDecompressMemory(ArraySegment<byte> src, ArraySegment<byte> dst)
  43. {
  44. return CommonMPQ.SharpZipLib.Unzip.SharpZipLib_DecompressZ(src, dst);
  45. }
  46. public bool NativeGetFileMD5(string fullname, out string md5)
  47. {
  48. using (var fs = new FileStream(fullname, FileMode.Open, FileAccess.Read))
  49. {
  50. md5 = CMD5.CalculateMD5(fs);
  51. }
  52. return true;
  53. }
  54. }
  55. }
  56. #endif