public static long GetCurrTime() { #if false // 精度がいまいち return((long)GameWin32.GetTickCount64()); #else //uint currCount = (uint)GetNowCount_TEST(); // test uint currCount = (uint)DX.GetNowCount(); if (currCount < GCT_LastCount) // ? DX.GetNowCount()のカンスト(オーバーフロー) { GCT_BaseTime += (long)uint.MaxValue + 1; } GCT_LastCount = currCount; long currTime = GCT_BaseTime + currCount; if (currTime < 0) { throw null; // ? __int64のカンスト(オーバーフロー) } if (currTime < GCT_LastTime) { throw null; // ? 時間が戻った || カンスト(オーバーフロー) } //if (GCT_LastTime != -1L && GCT_LastTime + 60000L < currTime) throw null; // ? 1分以上経過 <- 飛び過ぎ // タイトルバーを長時間掴んでいれば有り得る。 GCT_LastTime = currTime; return(currTime); #endif }
public static void SetScreenPosition(int l, int t) { DX.SetWindowPosition(l, t); GameWin32.POINT p; p.X = 0; p.Y = 0; GameWin32.ClientToScreen(GameWin32.GetMainWindowHandle(), out p); int pToTrgX = l - (int)p.X; int pToTrgY = t - (int)p.Y; DX.SetWindowPosition(l + pToTrgX, t + pToTrgY); }