/// <summary> /// 初始化屏幕分辨率,从UserOption里面读取数据 /// </summary> public void Awake() { this.m_log.Debug("ScreenManager.Awake()"); if (!CommonDefine.IsMobilePlatform) //如果不是手机平台 { int width = GraphicsManager.Default.Width; //默认为屏幕支持的分辨率的中间 int height = GraphicsManager.Default.Height; EnumDisplayMode enumDisplayMode = EnumDisplayMode.eDisplayMode_Window; //默认为窗口模式 if (UserOptions.Singleton.HasSet) //如果用户设置过的话,就采取用户设置的 { width = UserOptions.Singleton.Resolution.Width; height = UserOptions.Singleton.Resolution.Height; enumDisplayMode = (EnumDisplayMode)UserOptions.Singleton.DisplayMode; if (enumDisplayMode == EnumDisplayMode.eDisplayMode_FullAndWindow) { enumDisplayMode = EnumDisplayMode.eDisplayMode_FullScreen; UserOptions.Singleton.DisplayMode = (int)enumDisplayMode; } } else { UserOptions.Singleton.DisplayMode = (int)enumDisplayMode; UserOptions.Singleton.Resolution = GraphicsManager.CreateResolution(width, height); } this.SetResolution(width, height, enumDisplayMode); } }
/// <summary> /// 设置游戏分辨率,如果显示模式为全屏,无论改width,height都是全屏 /// 通知UIManager和XRenderTextureManager分辨率改了 /// </summary> /// <param name="nWidth"></param> /// <param name="nHeight"></param> /// <param name="eDisplayMode"></param> public void SetResolution(int nWidth, int nHeight, EnumDisplayMode eDisplayMode) { if (eDisplayMode == EnumDisplayMode.eDisplayMode_FullScreen) { if (GraphicsManager.GoodGraphicsResolution.Count > 0) { IGraphicsResolution graphicsResolution = GraphicsManager.GoodGraphicsResolution[GraphicsManager.GoodGraphicsResolution.Count - 1]; nWidth = graphicsResolution.Width; nHeight = graphicsResolution.Height; } } this.SetResolution(nWidth, nHeight, eDisplayMode == EnumDisplayMode.eDisplayMode_FullScreen); }
public void Update() { if (this.finalized) return; switch (opt.CutMethod) { case Option.EnumSegMethods.Ours: if (opt.Part_Type) { is_a_part_brush = true; if (hasharmonic == false) { ApplyHarmonicSolver_Cholmod(); this.ObtainIsolines(); this.ObtainIsolinesOnStroke(); this.LocateBestCut(); this.hasharmonic = true; } else { UpdateHarmonicField(); } this.ShowPatches = false; } else { is_a_part_brush = false; patch_type_decompose(); AssignPatchColors(); this.ShowPatches = true; } break; case Option.EnumSegMethods.CGI07: CGI_Cut(); AssignPatchColors(); this.ShowPatches = true; break; } this.displayMode = EnumDisplayMode.Segmentation; user_operation_stack.Push(is_a_part_brush); RecordPrevStrokes(); }
public void LoadSegmentation(StreamReader sr) { this.all_patches.Clear(); this.patchid = new byte[mesh.FaceCount]; //char[] delimiters = { ' ', '\t' }; string s = ""; //s = sr.ReadLine(); //string[] tokens = s.Split(delimiters); //int count = int.Parse(tokens[0]); // Use patchid as read buffer // Keep the max label to find number of patches int maxLabel = 0; for (int faceId = 0; faceId < this.patchid.Length; faceId++ ) { s = sr.ReadLine(); int label = int.Parse(s); if (maxLabel < label) maxLabel = label; this.patchid[faceId] = (byte)label; } for (int i = 1; i <= maxLabel; ++i) { Patch p = new Patch(i); all_patches.Add(p); } for (int i = 0; i < this.patchid.Length; i++) { // For in-patch faces, assign them into corresponding patches if (this.patchid[i] < maxLabel) { all_patches[patchid[i]].faces.Add(i); } } /* while (sr.Peek() > -1) { s = sr.ReadLine(); tokens = s.Split(delimiters); int index = int.Parse(tokens[1]); int f = int.Parse(tokens[0]); all_patches[index].faces.Add(f); this.patchid[f] = (byte)index; } */ this.AssignPatchColors(); this.displayMode = EnumDisplayMode.Segmentation; }
public static extern int EnumDisplaySettings(string lpszDeviceName, EnumDisplayMode iModeNum, ref DEVMODE lpDevMode);