亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dxclass.pas

?? 傳奇源代碼的delphi版本
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit DXClass;

interface

{$INCLUDE DelphiXcfg.inc}

uses
  Windows, Messages, SysUtils, Classes, Controls, Forms, MMSystem,
{$IfDef StandardDX}
  {$IfDef DX9}
  Direct3D, DirectInput9,
  {$EndIf}
  DirectDraw, DirectSound;
{$Else}
  DirectX;
{$EndIf}

type

  {  EDirectDrawError  }

  EDirectXError = class(Exception);

  {  TDirectX  }

  TDirectX = class(TPersistent)
  private
    procedure SetDXResult(Value: HRESULT);
  protected
    FDXResult: HRESULT;
    procedure Check; virtual;
  public
    property DXResult: HRESULT read FDXResult write SetDXResult;
  end;

  {  TDirectXDriver  }

  TDirectXDriver = class(TCollectionItem)
  private
    FGUID: PGUID;
    FGUID2: TGUID;
    FDescription: string;
    FDriverName: string;
    procedure SetGUID(Value: PGUID);
  public
    property GUID: PGUID read FGUID write SetGUID;
    property Description: string read FDescription write FDescription;
    property DriverName: string read FDriverName write FDriverName;
  end;

  {  TDirectXDrivers  }

  TDirectXDrivers = class(TCollection)
  private
    function GetDriver(Index: Integer): TDirectXDriver;
  public
    constructor Create;
    property Drivers[Index: Integer]: TDirectXDriver read GetDriver; default;
  end;

  {  TDXForm  }

  TDXForm = class(TForm)
  private
    FStoreWindow: Boolean;
    FWindowPlacement: TWindowPlacement;
    procedure WMSYSCommand(var Msg: TWMSYSCommand); message WM_SYSCOMMAND;
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    constructor Create(AOnwer: TComponent); override;
    destructor Destroy; override;
    procedure RestoreWindow;
    procedure StoreWindow;
  end;

  {  TCustomDXTimer  }

  TDXTimerEvent = procedure(Sender: TObject; LagCount: Integer) of object;

  TCustomDXTimer = class(TComponent)
  private
    FActiveOnly: Boolean;
    FEnabled: Boolean;
    FFrameRate: Integer;
    FInitialized: Boolean;
    FInterval: Cardinal;
    FInterval2: Cardinal;
    FNowFrameRate: Integer;
    FOldTime: DWORD;
    FOldTime2: DWORD;
    FOnActivate: TNotifyEvent;
    FOnDeactivate: TNotifyEvent;
    FOnTimer: TDXTimerEvent;
    procedure AppIdle(Sender: TObject; var Done: Boolean);
    function AppProc(var Message: TMessage): Boolean;
    procedure Finalize;
    procedure Initialize;
    procedure Resume;
    procedure SetActiveOnly(Value: Boolean);
    procedure SetEnabled(Value: Boolean);
    procedure SetInterval(Value: Cardinal);
    procedure Suspend;
  protected
    procedure DoActivate; virtual;
    procedure DoDeactivate; virtual;
    procedure DoTimer(LagCount: Integer); virtual;
    procedure Loaded; override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    property ActiveOnly: Boolean read FActiveOnly write SetActiveOnly;
    property Enabled: Boolean read FEnabled write SetEnabled;
    property FrameRate: Integer read FFrameRate;
    property Interval: Cardinal read FInterval write SetInterval;
    property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
    property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
    property OnTimer: TDXTimerEvent read FOnTimer write FOnTimer;
  end;

  {  TDXTimer  }

  TDXTimer = class(TCustomDXTimer)
  published
    property ActiveOnly;
    property Enabled;
    property Interval;
    property OnActivate;
    property OnDeactivate;
    property OnTimer;
  end;

  {  TControlSubClass  }

  TControlSubClassProc = procedure(var Message: TMessage; DefWindowProc: TWndMethod) of object;

  TControlSubClass = class
  private
    FControl: TControl;
    FDefWindowProc: TWndMethod;
    FWindowProc: TControlSubClassProc;
    procedure WndProc(var Message: TMessage);
  public
    constructor Create(Control: TControl; WindowProc: TControlSubClassProc);
    destructor Destroy; override;
  end;

  {  THashCollectionItem  }

  THashCollectionItem = class(TCollectionItem)
  private
    FHashCode: Integer;
    FIndex: Integer;
    FName: string;
    FLeft: THashCollectionItem;
    FRight: THashCollectionItem;
    procedure SetName(const Value: string);
    procedure AddHash;
    procedure DeleteHash;
  protected
    function GetDisplayName: string; override;
    procedure SetIndex(Value: Integer); override;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    property Index: Integer read FIndex write SetIndex;
  published
    property Name: string read FName write SetName;
  end;

  {  THashCollection  }

  THashCollection = class(TCollection)
  private
    FHash: array[0..255] of THashCollectionItem;
  public
    function IndexOf(const Name: string): Integer;
  end;

function Max(Val1, Val2: Integer): Integer;
function Min(Val1, Val2: Integer): Integer;

function Cos256(i: Integer): Double;
function Sin256(i: Integer): Double;

function PointInRect(const Point: TPoint; const Rect: TRect): Boolean;
function RectInRect(const Rect1, Rect2: TRect): Boolean;
function OverlapRect(const Rect1, Rect2: TRect): Boolean;

function WideRect(ALeft, ATop, AWidth, AHeight: Integer): TRect;

{ Transformations routines}

const
  L_Curve = 0;//The left curve
  R_Curve = 1;//The right curve

  C_Add = 0;//Increase (BTC)
  C_Dec = 1;//Decrease (ETC)

Type
  TDblPoint = Record
    X,Y: Double;
  end;

  //Transformation matrix
  T2DRowCol = Array[1..3] of Array[1..3] of Double;
  T2DVector = Array[1..3] of Double;
  //Distance between 2 points
  function Get2PointRange(a,b: TDblPoint):Double;
  //From vector angular calculation
  function Get256(dX,dY: Double):Double;
  //The angular calculation of the A from B
  function GetARadFromB(A,B: TDblPoint):Double;

  //It calculates the TDblPoint
  function DblPoint(a,b:Double):TDblPoint;
  //It converts the TDboPoint to the TPoint
  function TruncDblPoint(DblPos: TDblPoint): TPoint;

  function GetPointFromRangeAndAngle(SP: TDblPoint; Range,Angle: Double): TDblPoint;

  function Ini2DRowCol: T2DRowCol;
  function Trans2DRowCol(x,y:double):T2DRowCol;
  function Scale2DRowCol(x,y:double):T2DRowCol;
  function Rotate2DRowCol(Theta:double):T2DRowCol;
  function RotateIntoX2DRowCol(x,y: double):T2DRowCol;
  function Multiply2DRowCol(A,B:T2DRowCol):T2DRowCol;
  function ScaleAt2DRowCol(x,y,Sx,Sy:double):T2DRowCol;
  function ReflectAcross2DRowCol(x,y,dx,dy:Double): T2DRowCol;
  function Apply2DVector(V:T2DVector; M:T2DRowCol): T2DVector;
  function RotateAround2DRowCol(x,y,Theta:Double): T2DRowCol;

  //Collision decision
  function PointInCircle(PPos,CPos: TPoint; R: integer): Boolean;
  function CircleInCircle(C1Pos,C2Pos: TPoint; R1,R2:Integer): Boolean;
  function SegmentInCircle(SPos,EPos,CPos: TPoint; R: Integer): Boolean;

  //If A is closer than B from starting point S, the True is  returned.
  function CheckNearAThanB(S,A,B: TDblPoint): Boolean;

  //The Angle of 256 period is returned
  function Angle256(Angle: Single): Single;

{ Support functions }

procedure ReleaseCom(out Com);
function DXLoadLibrary(const FileName, FuncName: string): TFarProc;

implementation

uses DXConsts;

function Max(Val1, Val2: Integer): Integer;
begin
  if Val1>=Val2 then Result := Val1 else Result := Val2;
end;

function Min(Val1, Val2: Integer): Integer;
begin
  if Val1<=Val2 then Result := Val1 else Result := Val2;
end;

function PointInRect(const Point: TPoint; const Rect: TRect): Boolean;
begin
  Result := (Point.X >= Rect.Left) and
            (Point.X <= Rect.Right) and
            (Point.Y >= Rect.Top) and
            (Point.Y <= Rect.Bottom);
end;

function RectInRect(const Rect1, Rect2: TRect): Boolean;
begin
  Result := (Rect1.Left >= Rect2.Left) and
            (Rect1.Right <= Rect2.Right) and
            (Rect1.Top >= Rect2.Top) and
            (Rect1.Bottom <= Rect2.Bottom);
end;

function OverlapRect(const Rect1, Rect2: TRect): Boolean;
begin
  Result := (Rect1.Left < Rect2.Right) and
            (Rect1.Right > Rect2.Left) and
            (Rect1.Top < Rect2.Bottom) and
            (Rect1.Bottom > Rect2.Top);
end;

function WideRect(ALeft, ATop, AWidth, AHeight: Integer): TRect;
begin
  with Result do
  begin
    Left := ALeft;
    Top := ATop;
    Right := ALeft+AWidth;
    Bottom := ATop+AHeight;
  end;
end;

var
  CosinTable: array[0..255] of Double;

procedure InitCosinTable;
var
  i: Integer;
begin
  for i:=0 to 255 do
    CosinTable[i] := Cos((i/256)*2*PI);
end;

function Cos256(i: Integer): Double;
begin
  Result := CosinTable[i and 255];
end;

function Sin256(i: Integer): Double;
begin
  Result := CosinTable[(i+192) and 255];
end;

procedure ReleaseCom(out Com);
begin
end;

var
  LibList: TStringList;

function DXLoadLibrary(const FileName, FuncName: string): Pointer;
var
  i: Integer;
  h: THandle;
begin
  if LibList=nil then
    LibList := TStringList.Create;

  i := LibList.IndexOf(AnsiLowerCase(FileName));
  if i=-1 then
  begin
    {  DLL is loaded.  }
    h := LoadLibrary(PChar(FileName));
    if h=0 then
      raise Exception.CreateFmt(SDLLNotLoaded, [FileName]);
    LibList.AddObject(AnsiLowerCase(FileName), Pointer(h));
  end else
  begin
    {  DLL has already been loaded.  }
    h := THandle(LibList.Objects[i]);
  end;

  Result := GetProcAddress(h, PChar(FuncName));
  if Result=nil then
    raise Exception.CreateFmt(SDLLNotLoaded, [FileName]);
end;

procedure FreeLibList;
var
  i: Integer;
begin
  if LibList<>nil then
  begin
    for i:=0 to LibList.Count-1 do
      FreeLibrary(THandle(LibList.Objects[i]));
    LibList.Free;
  end;
end;

{  TDirectX  }

procedure TDirectX.Check;
begin
end;

procedure TDirectX.SetDXResult(Value: HRESULT);
begin
  FDXResult := Value;
  if FDXResult<>0 then Check;
end;

{  TDirectXDriver  }

procedure TDirectXDriver.SetGUID(Value: PGUID);
begin
  if not IsBadHugeReadPtr(Value, SizeOf(TGUID)) then
  begin
    FGUID2 := Value^;
    FGUID := @FGUID2;
  end else
    FGUID := Value;
end;

{  TDirectXDrivers  }

constructor TDirectXDrivers.Create;
begin
  inherited Create(TDirectXDriver);
end;

function TDirectXDrivers.GetDriver(Index: Integer): TDirectXDriver;
begin
  Result := (inherited Items[Index]) as TDirectXDriver;
end;

{  TDXForm  }

var
  SetAppExStyleCount: Integer;

constructor TDXForm.Create(AOnwer: TComponent);
var
  ExStyle: Integer;
begin
  inherited Create(AOnwer);
  Inc(SetAppExStyleCount);
  ExStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);
  ExStyle := ExStyle or WS_EX_TOOLWINDOW;
  SetWindowLong(Application.Handle, GWL_EXSTYLE, ExStyle);
end;

destructor TDXForm.Destroy;
var
  ExStyle: Integer;
begin
  Dec(SetAppExStyleCount);
  if SetAppExStyleCount=0 then
  begin
    ExStyle := GetWindowLong(Application.Handle, GWL_EXSTYLE);
    ExStyle := ExStyle and (not WS_EX_TOOLWINDOW);
    SetWindowLong(Application.Handle, GWL_EXSTYLE, ExStyle);
  end;
  inherited Destroy;
end;

procedure TDXForm.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
end;

procedure TDXForm.RestoreWindow;
begin
  if FStoreWindow then
  begin
    SetWindowPlacement(Handle, @FWindowPlacement);
    FStoreWindow := False;
  end;
end;

procedure TDXForm.StoreWindow;
begin
  FWindowPlacement.Length := SizeOf(FWindowPlacement);
  FStoreWindow := GetWindowPlacement(Handle, @FWindowPlacement);
end;

procedure TDXForm.WMSYSCommand(var Msg: TWMSYSCommand);
begin
  if Msg.CmdType = SC_MINIMIZE then
  begin
    DefaultHandler(Msg);
    WindowState := wsMinimized;
  end else
    inherited;
end;

{  TCustomDXTimer  }

constructor TCustomDXTimer.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  FActiveOnly := True;
  FEnabled := True;
  Interval := 1000;
  Application.HookMainWindow(AppProc);
end;

destructor TCustomDXTimer.Destroy;
begin
  Finalize;
  Application.UnHookMainWindow(AppProc);
  inherited Destroy;
end;

procedure TCustomDXTimer.AppIdle(Sender: TObject; var Done: Boolean);
var
  t, t2: DWORD;
  LagCount, i: Integer;
begin
  Done := False;

  t := TimeGetTime;
  t2 := t-FOldTime;
  if t2>=FInterval then
  begin
    FOldTime := t;

    LagCount := t2 div FInterval2;
    if LagCount<1 then LagCount := 1;

    Inc(FNowFrameRate);

    i := Max(t-FOldTime2, 1);
    if i>=1000 then
    begin
      FFrameRate := Round(FNowFrameRate*1000/i);
      FNowFrameRate := 0;
      FOldTime2 := t;
    end;

    DoTimer(LagCount);
  end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕第一区| 日本成人中文字幕| 国产性色一区二区| 欧美va天堂va视频va在线| 国产午夜精品在线观看| 中文字幕亚洲精品在线观看| 国产色一区二区| 中文字幕日韩精品一区| 国产精品久久久久久久久久久免费看| 51精品国自产在线| 日韩视频在线你懂得| 精品福利一区二区三区 | 在线观看国产一区二区| 一本色道久久综合精品竹菊| 欧美日韩一区小说| 日韩精品一区二区三区swag| 中文字幕制服丝袜一区二区三区| 亚洲综合精品自拍| 国产91精品一区二区麻豆亚洲| www.欧美色图| 国产一区二区中文字幕| 欧美主播一区二区三区| 91成人免费在线视频| 欧美久久久影院| 欧美另类久久久品| 国产精品性做久久久久久| 久久久亚洲精华液精华液精华液| 久久久亚洲高清| 一区二区在线观看av| 亚洲高清视频中文字幕| 天堂久久久久va久久久久| 国内精品在线播放| 91黄色免费版| 精品国产一区二区三区忘忧草| 国产精品视频观看| 日韩vs国产vs欧美| heyzo一本久久综合| 91麻豆精品国产自产在线观看一区 | 日本在线播放一区二区三区| 国产在线精品一区二区夜色| aaa亚洲精品一二三区| 欧美日韩精品一二三区| 欧美激情一二三区| 亚洲国产综合91精品麻豆| 经典三级一区二区| 欧美日韩一区二区三区视频| 久久久亚洲高清| 香蕉成人啪国产精品视频综合网| 国产精品一区二区三区网站| 欧美日韩在线播放一区| 国产色婷婷亚洲99精品小说| 爽爽淫人综合网网站| 99久久er热在这里只有精品15| 日韩一级免费观看| 亚洲午夜免费电影| www.日本不卡| 国产日韩欧美在线一区| 美女国产一区二区| 欧美在线不卡一区| 亚洲精品在线观| 亚洲国产精品自拍| 91在线精品一区二区| 国产精品网站在线观看| 国产在线精品一区二区三区不卡| 91精品国产全国免费观看| 一区二区日韩av| 91免费国产在线| 中文字幕一区在线观看视频| 成人精品在线视频观看| 国产视频一区在线播放| 韩国一区二区视频| 久久嫩草精品久久久精品| 久久精品国产澳门| 日韩三级免费观看| 美女视频免费一区| 日韩精品一区二区三区在线播放 | 亚洲色图视频网站| 国产凹凸在线观看一区二区| 国产欧美精品在线观看| 国产福利一区二区| 国产精品色在线观看| 不卡的av电影| 亚洲一区二区三区在线| 欧美私人免费视频| 婷婷综合久久一区二区三区| 91麻豆精品国产91久久久久久久久 | 免播放器亚洲一区| 日韩精品中午字幕| 国产精品一区二区你懂的| 久久久久久亚洲综合| 国产xxx精品视频大全| 中文字幕视频一区二区三区久| 99精品视频在线观看| 亚洲123区在线观看| 日韩精品一区二区三区视频| 成人性生交大片免费看在线播放| 中文字幕制服丝袜成人av| 色一情一乱一乱一91av| 日韩国产精品久久久| 久久无码av三级| 一本大道久久a久久精品综合| 亚洲国产一区二区三区| 日韩精品一区二区三区在线播放 | 国产精品萝li| 欧美日韩国产高清一区二区三区 | 欧洲精品在线观看| 日韩高清不卡一区二区| 国产午夜精品一区二区三区四区 | 日本美女一区二区| 国产亚洲综合性久久久影院| 欧洲一区二区三区免费视频| 狠狠狠色丁香婷婷综合激情| 一区二区不卡在线播放 | 67194成人在线观看| 国产精品亚洲一区二区三区妖精| 亚洲男同性视频| 日韩视频一区在线观看| eeuss鲁片一区二区三区| 日本亚洲欧美天堂免费| ...xxx性欧美| 精品久久久久久久久久久久久久久 | 国产欧美一区二区精品婷婷| 欧美日韩国产片| 99免费精品在线| 激情综合色播激情啊| 一区二区三区四区中文字幕| 久久免费美女视频| 91精品免费观看| 色系网站成人免费| 国产成人在线电影| 久久99这里只有精品| 亚洲午夜久久久久中文字幕久| 中文字幕+乱码+中文字幕一区| 日韩视频一区二区在线观看| 在线观看成人免费视频| av中文字幕不卡| 成人听书哪个软件好| 久99久精品视频免费观看| 天天亚洲美女在线视频| 亚洲一区二区三区四区五区中文| 国产精品免费av| 国产视频一区二区三区在线观看| 日韩欧美一区在线| 69堂国产成人免费视频| 欧美私人免费视频| 欧美日韩中文精品| 欧美日韩在线观看一区二区 | 国产91高潮流白浆在线麻豆| 裸体在线国模精品偷拍| 免费在线观看精品| 日本不卡视频在线| 久久不见久久见免费视频7| 美女视频免费一区| 韩国精品主播一区二区在线观看| 久久精品国产色蜜蜜麻豆| 免费精品视频最新在线| 免费观看一级欧美片| 欧美aⅴ一区二区三区视频| 日韩高清在线不卡| 免费高清视频精品| 精品一区二区三区香蕉蜜桃| 国内不卡的二区三区中文字幕| 国产伦精品一区二区三区视频青涩| 精品中文字幕一区二区| 国产精品99久久久久久似苏梦涵| 国产不卡在线视频| 91色九色蝌蚪| 在线91免费看| 久久亚洲一区二区三区明星换脸| 国产色91在线| 亚洲精品国产第一综合99久久| 亚洲午夜激情av| 免费观看成人av| 成人av高清在线| 欧美日韩一区二区在线视频| 日韩一级黄色大片| 欧美国产激情二区三区| 亚洲美女屁股眼交| 午夜精品免费在线| 国产一区视频导航| 色一情一伦一子一伦一区| 宅男在线国产精品| 国产亚洲视频系列| 亚洲一区中文日韩| 毛片av一区二区| av在线免费不卡| 日韩欧美国产综合| 亚洲欧美在线另类| 免费人成精品欧美精品| a4yy欧美一区二区三区| 日韩一区二区三区四区| 欧美国产日韩一二三区| 日韩激情视频在线观看| 成人18精品视频| 欧美一区二区视频网站| 成人免费在线播放视频| 黄页网站大全一区二区| 欧洲av在线精品| 欧美激情一区二区三区蜜桃视频| 爽好多水快深点欧美视频|