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

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

?? drawscrn.pas

?? 解元 傳奇2客戶端delphi源程序
?? PAS
字號:
unit DrawScrn;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  DXDraws, DXClass, DirectX, IntroScn, Actor, cliUtil, clFunc,
  HUtil32;


const
   MAXSYSLINE = 8;

   BOTTOMBOARD = 1;
   VIEWCHATLINE = 9;
   AREASTATEICONBASE = 150;
   HEALTHBAR_BLACK = 0;
   HEALTHBAR_RED = 1;


type
   TDrawScreen = class
   private
      frametime, framecount, drawframecount: longword;
      SysMsg: TStringList;
   public
      CurrentScene: TScene;
      ChatStrs: TStringList;
      ChatBks: TList;
      ChatBoardTop: integer;

      HintList: TStringList;
      HintX, HintY, HintWidth, HintHeight: integer;
      HintUp: Boolean;
      HintColor: TColor;

      constructor Create;
      destructor Destroy; override;
      procedure KeyPress (var Key: Char);
      procedure KeyDown (var Key: Word; Shift: TShiftState);
      procedure MouseMove (Shift: TShiftState; X, Y: Integer);
      procedure MouseDown (Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
      procedure Initialize;
      procedure Finalize;
      procedure ChangeScene (scenetype: TSceneType);
      procedure DrawScreen (MSurface: TDirectDrawSurface);
      procedure DrawScreenTop (MSurface: TDirectDrawSurface);
      procedure AddSysMsg (msg: string);
      procedure AddChatBoardString (str: string; fcolor, bcolor: integer);
      procedure ClearChatBoard;

      procedure ShowHint (x, y: integer; str: string; color: TColor; drawup: Boolean);
      procedure ClearHint;
      procedure DrawHint (MSurface: TDirectDrawSurface);
   end;


implementation

uses
   ClMain;
   

constructor TDrawScreen.Create;
var
   i: integer;
begin
   CurrentScene := nil;
   frametime := GetTickCount;
   framecount := 0;
   SysMsg := TStringList.Create;
   ChatStrs := TStringList.Create;
   ChatBks := TList.Create;
   ChatBoardTop := 0;

   HintList := TStringList.Create;

end;

destructor TDrawScreen.Destroy;
begin
   SysMsg.Free;
   ChatStrs.Free;
   ChatBks.Free;
   HintList.Free;
   inherited Destroy;
end;

procedure TDrawScreen.Initialize;
begin
end;

procedure TDrawScreen.Finalize;
begin
end;

procedure TDrawScreen.KeyPress (var Key: Char);
begin
   if CurrentScene <> nil then
      CurrentScene.KeyPress (Key);
end;

procedure TDrawScreen.KeyDown (var Key: Word; Shift: TShiftState);
begin
   if CurrentScene <> nil then
      CurrentScene.KeyDown (Key, Shift);
end;

procedure TDrawScreen.MouseMove (Shift: TShiftState; X, Y: Integer);
begin
   if CurrentScene <> nil then
      CurrentScene.MouseMove (Shift, X, Y);
end;

procedure TDrawScreen.MouseDown (Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
   if CurrentScene <> nil then
      CurrentScene.MouseDown (Button, Shift, X, Y);
end;

procedure TDrawScreen.ChangeScene (scenetype: TSceneType);
begin
   if CurrentScene <> nil then
      CurrentScene.CloseScene;
   case scenetype of
      stIntro:  CurrentScene := IntroScene;
      stLogin:  CurrentScene := LoginScene;
      stSelectCountry:  ;
      stSelectChr: CurrentScene := SelectChrScene;
      stNewChr:     ;
      stLoading:    ;
      stLoginNotice: CurrentScene := LoginNoticeScene;
      stPlayGame: CurrentScene := PlayScene;
   end;
   if CurrentScene <> nil then
      CurrentScene.OpenScene;
end;
//添加系統信息
procedure TDrawScreen.AddSysMsg (msg: string);
begin
   if SysMsg.Count >= 10 then SysMsg.Delete (0);
   SysMsg.AddObject (msg, TObject(GetTickCount));
end;

//添加信息聊天板
procedure TDrawScreen.AddChatBoardString (str: string; fcolor, bcolor: integer);
var
   i, len, aline: integer;
   dline, temp: string;
const
   BOXWIDTH = 374; //41;
begin
   len := Length (str);
   temp := '';
   i := 1;
   while TRUE do begin
      if i > len then break;
      if byte (str[i]) >= 128 then begin
         temp := temp + str[i];
         Inc (i);
         if i <= len then temp := temp + str[i]
         else break;
      end else
         temp := temp + str[i];

      aline := FrmMain.Canvas.TextWidth (temp);
      if aline > BOXWIDTH then begin
         ChatStrs.AddObject (temp, TObject(fcolor));
         ChatBks.Add (Pointer(bcolor));
         str := Copy (str, i+1, Len-i);
         temp := '';
         break;
      end;
      Inc (i);
   end;
   if temp <> '' then begin
      ChatStrs.AddObject (temp, TObject(fcolor));
      ChatBks.Add (Pointer(bcolor));
      str := '';
   end;
   if ChatStrs.Count > 200 then begin
      ChatStrs.Delete (0);
      ChatBks.Delete (0);
      if ChatStrs.Count - ChatBoardTop < VIEWCHATLINE then Dec(ChatBoardTop);
   end else if (ChatStrs.Count-ChatBoardTop) > VIEWCHATLINE then begin
      Inc (ChatBoardTop);
   end;

   if str <> '' then
      AddChatBoardString (' ' + str, fcolor, bcolor);
end;

//這里只計算提示信息的寬度和高度,并不顯示
procedure TDrawScreen.ShowHint (x, y: integer; str: string; color: TColor; drawup: Boolean);
var
   data: string;
   w, h: integer;
begin
   ClearHint;
   HintX := x;
   HintY := y;
   HintWidth := 0;
   HintHeight := 0;
   HintUp := drawup;
   HintColor := color;
   while TRUE do begin
      if str = '' then break;
      str := GetValidStr3 (str, data, ['\']);
      w := FrmMain.Canvas.TextWidth (data) + 4{咯歸} * 2;
      if w > HintWidth then HintWidth := w;
      if data <> '' then
         HintList.Add (data)
   end;
   HintHeight := (FrmMain.Canvas.TextHeight('A') + 1) * HintList.Count + 3{咯歸} * 2;
   if HintUp then
      HintY := HintY - HintHeight;
end;

procedure TDrawScreen.ClearHint;
begin
   HintList.Clear;
end;

procedure TDrawScreen.ClearChatBoard;
begin
   SysMsg.Clear;
   ChatStrs.Clear;
   ChatBks.Clear;
   ChatBoardTop := 0;
end;


procedure TDrawScreen.DrawScreen (MSurface: TDirectDrawSurface);
   procedure NameTextOut (surface: TDirectDrawSurface; x, y, fcolor, bcolor: integer; namestr: string);
   var
      i, row: integer;
      nstr: string;
   begin
      row := 0;
      for i:=0 to 10 do begin
         if namestr = '' then break;
         namestr := GetValidStr3 (namestr, nstr, ['\']);
         BoldTextOut (surface,
                      x - surface.Canvas.TextWidth(nstr) div 2,
                      y + row * 12,
                      fcolor, bcolor, nstr);
         Inc (row);
      end;
   end;
var
   i, k, line, sx, sy, fcolor, bcolor: integer;
   actor: TActor;
   str, uname: string;
   dsurface: TDirectDrawSurface;
   d: TDirectDrawSurface;
   rc: TRect;
begin
   MSurface.Fill(0);
   if CurrentScene <> nil then
      CurrentScene.PlayScene (MSurface);

   if GetTickCount - frametime > 1000 then begin
      frametime := GetTickCount;
      drawframecount := framecount;    //FPS
      framecount := 0;
   end;
   Inc (framecount);

   if Myself = nil then exit;

   if CurrentScene = PlayScene then begin
      with MSurface do begin
         with PlayScene do begin
            for k:=0 to ActorList.Count-1 do begin   //畫出每一個人物的狀態
               actor := ActorList[k];
               if (actor.BoOpenHealth or actor.BoInstanceOpenHealth) and not actor.Death then begin
                  //畫人物的“血”(頭上的一個橫杠)
                  if actor.BoInstanceOpenHealth then
                     if GetTickCount - actor.OpenHealthStart > actor.OpenHealthTime then
                        actor.BoInstanceOpenHealth := FALSE;
                  d := FrmMain.WProgUse2.Images[HEALTHBAR_BLACK];
                  if d <> nil then
                     MSurface.Draw (actor.SayX - d.Width div 2, actor.SayY - 10, d.ClientRect, d, TRUE);
                  d := FrmMain.WProgUse2.Images[HEALTHBAR_RED];
                  if d <> nil then begin
                     rc := d.ClientRect;
                     if actor.Abil.MaxHP > 0 then
                        rc.Right := Round((rc.Right-rc.Left) / actor.Abil.MaxHP * actor.Abil.HP);
                     MSurface.Draw (actor.SayX - d.Width div 2, actor.SayY - 10, rc, d, TRUE);
                  end;
               end;
            end;
         end;

         //畫當前選擇的物品/人物的名字
         SetBkMode (Canvas.Handle, TRANSPARENT);
         if (FocusCret <> nil) and PlayScene.IsValidActor (FocusCret) then begin
            uname := FocusCret.DescUserName + '\' + FocusCret.UserName;
            NameTextOut (MSurface,
                      FocusCret.SayX, // - Canvas.TextWidth(uname) div 2,
                      FocusCret.SayY + 30,
                      FocusCret.NameColor, clBlack,
                      uname);
         end;
         //玩家名稱
         if BoSelectMyself then begin
            uname := Myself.DescUserName + '\' + Myself.UserName;
            NameTextOut (MSurface,
                      Myself.SayX, // - Canvas.TextWidth(uname) div 2,
                      Myself.SayY + 30,
                      Myself.NameColor, clBlack,
                      uname);
         end;

         Canvas.Font.Color := clWhite;

         //char saying
         with PlayScene do begin
            for k:=0 to ActorList.Count-1 do begin
               actor := ActorList[k];
               if actor.Saying[0] <> '' then begin
                  if GetTickCount - actor.SayTime < 4 * 1000 then begin
                     for i:=0 to actor.SayLineCount-1 do  //顯示每個玩家說的話
                        if actor.Death then         //死了的話就灰/黑色顯示
                           BoldTextOut (MSurface,
                                     actor.SayX - (actor.SayWidths[i] div 2),
                                     actor.SayY - (actor.SayLineCount*16) + i*14,
                                     clGray, clBlack,
                                     actor.Saying[i])
                        else                        //正常的玩家用黑/白色顯示
                           BoldTextOut (MSurface,
                                     actor.SayX - (actor.SayWidths[i] div 2),
                                     actor.SayY - (actor.SayLineCount*16) + i*14,
                                     clWhite, clBlack,
                                     actor.Saying[i]);
                  end else
                     actor.Saying[0] := '';  //說的話顯示4秒
               end;
            end;
         end;

         //BoldTextOut (MSurface, 0, 0, clWhite, clBlack, IntToStr(SendCount) + ' : ' + IntToStr(ReceiveCount));
         //BoldTextOut (MSurface, 0, 0, clWhite, clBlack, 'HITSPEED=' + IntToStr(Myself.HitSpeed));
         //BoldTextOut (MSurface, 0, 0, clWhite, clBlack, 'DupSel=' + IntToStr(DupSelection));
         //BoldTextOut (MSurface, 0, 0, clWhite, clBlack, IntToStr(LastHookKey));
         //BoldTextOut (MSurface, 0, 0, clWhite, clBlack,
         //             IntToStr(
         //                int64(GetTickCount - LatestSpellTime) - int64(700 + MagicDelayTime)
         //                ));
         //BoldTextOut (MSurface, 0, 0, clWhite, clBlack, IntToStr(PlayScene.EffectList.Count));
         //BoldTextOut (MSurface, 0, 0, clWhite, clBlack,
         //                  IntToStr(Myself.XX) + ',' + IntToStr(Myself.YY) + '  ' +
         //                  IntToStr(Myself.ShiftX) + ',' + IntToStr(Myself.ShiftY));

         //System Message
         //甘狼 惑怕 釬矯 (烙矯 釬矯)
         
         if (AreaStateValue and $04) <> 0 then begin
            BoldTextOut (MSurface, 0, 0, clWhite, clBlack, '傍己傈瘤開');
         end;

         Canvas.Release;


         //顯示地圖狀態,16種:0000000000000000 從右到左,為1表示:戰斗、安全、上面的那種狀態 (當前只有這幾種狀態)
         k := 0;
         for i:=0 to 15 do begin
            if AreaStateValue and ($01 shr i) <> 0 then begin
               d := FrmMain.WProgUse.Images[AREASTATEICONBASE + i];
               if d <> nil then begin
                  k := k + d.Width;
                  MSurface.Draw (SCREENWIDTH-k, 0, d.ClientRect, d, TRUE);
               end;
            end;
         end;

      end;
   end;
end;

procedure TDrawScreen.DrawScreenTop (MSurface: TDirectDrawSurface);
var
   i, sx, sy: integer;
begin
   if Myself = nil then exit;
   //游戲狀態:顯示所有系統消息(左上角顯示的)
   if CurrentScene = PlayScene then begin
      with MSurface do begin
         SetBkMode (Canvas.Handle, TRANSPARENT);
         if SysMsg.Count > 0 then begin
            sx := 30;
            sy := 40;
            for i:=0 to SysMsg.Count-1 do begin
               BoldTextOut (MSurface, sx, sy, clGreen, clBlack, SysMsg[i]);
               inc (sy, 16);
            end;
            //3秒減少一個系統消息
            if GetTickCount - longword(SysMsg.Objects[0]) >= 3000 then
               SysMsg.Delete (0);
         end;
         Canvas.Release;
      end;
   end;
end;

//顯示提示信息
procedure TDrawScreen.DrawHint (MSurface: TDirectDrawSurface);
var
   d: TDirectDrawSurface;
   i, hx, hy, old: integer;
   str: string;
begin
   //顯示提示框
   if HintList.Count > 0 then begin
      d := FrmMain.WProgUse.Images[394];
      if d <> nil then begin
         if HintWidth > d.Width then HintWidth := d.Width;
         if HintHeight > d.Height then HintHeight := d.Height;
         if HintX + HintWidth > SCREENWIDTH then hx := SCREENWIDTH - HintWidth
         else hx := HintX;
         if HintY < 0 then hy := 0
         else hy := HintY;
         if hx < 0 then hx := 0;

         DrawBlendEx (MSurface, hx, hy, d, 0, 0, HintWidth, HintHeight, 0);
      end;
   end;
   //在提示框中顯示提示信息
   with MSurface do begin
      SetBkMode (Canvas.Handle, TRANSPARENT);
      if HintList.Count > 0 then begin
         Canvas.Font.Color := HintColor;
         for i:=0 to HintList.Count-1 do begin
            Canvas.TextOut (hx+4, hy+3+(Canvas.TextHeight('A')+1)*i, HintList[i]);
         end;
      end;

      if Myself <> nil then begin
         if CheckBadMapMode then begin
              str := IntToStr(drawframecount) +  ' '
              + '  Mouse ' + IntToStr(MouseX) + ':' + IntToStr(MouseY) + '(' + IntToStr(MCX) + ':' + IntToStr(MCY) + ')'
              + '  HP' + IntToStr(Myself.Abil.HP) + '/' + IntToStr(Myself.Abil.MaxHP)
              + '  D0 ' + IntToStr(DebugCount)
              + ' D1 ' + IntToStr(DebugCount1) + ' D2 '
              + IntToStr(DebugCount2);
         end;
         BoldTextOut (MSurface, 10, 0, clWhite, clBlack, str);
         BoldTextOut (MSurface, 8, SCREENHEIGHT-20, clWhite, clBlack, MapTitle + ' ' + IntToStr(Myself.XX) + ':' + IntToStr(Myself.YY));
      end;
      Canvas.Release;
   end;
end;


end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区免费在线| 欧美视频你懂的| 欧美视频精品在线观看| 国产欧美一区二区在线| 五月激情综合网| 色婷婷精品久久二区二区蜜臂av| 欧美电影免费观看高清完整版在 | 亚洲线精品一区二区三区| 国内精品不卡在线| 在线观看91精品国产麻豆| 亚洲精品视频一区| 色综合天天性综合| 久久久久久久久99精品| 免费高清在线视频一区·| 欧美日韩高清不卡| 午夜久久久久久久久久一区二区| eeuss鲁片一区二区三区| 欧美激情综合网| 东方aⅴ免费观看久久av| 久久一日本道色综合| 激情综合色丁香一区二区| 制服丝袜av成人在线看| 日韩国产欧美在线观看| 欧美猛男男办公室激情| 亚洲一区影音先锋| 欧美色手机在线观看| 亚洲午夜影视影院在线观看| 91成人国产精品| 亚洲国产日韩精品| 在线成人免费观看| 裸体在线国模精品偷拍| 日韩欧美成人一区二区| 激情都市一区二区| 久久午夜色播影院免费高清| 国产乱码精品一区二区三区av| 精品国产伦一区二区三区观看体验 | 亚洲综合色网站| 欧美理论在线播放| 蜜臀久久久99精品久久久久久| 91精品久久久久久蜜臀| 美日韩一区二区三区| 日韩欧美的一区| 国产91丝袜在线18| 亚洲男人的天堂网| 欧美日韩亚洲综合在线| 蜜臀a∨国产成人精品| 久久综合狠狠综合久久激情| 国产a久久麻豆| 亚洲免费资源在线播放| 91精品蜜臀在线一区尤物| 久久se这里有精品| 国产目拍亚洲精品99久久精品| 99久久久精品| 亚洲va在线va天堂| 久久综合999| 91福利国产成人精品照片| 日韩1区2区3区| 国产无遮挡一区二区三区毛片日本| 99久久国产综合精品麻豆| 日韩精品欧美精品| 国产亚洲午夜高清国产拍精品| 色婷婷一区二区三区四区| 麻豆91在线播放| 中文字幕亚洲综合久久菠萝蜜| 欧美剧情片在线观看| 国产精品1024| 亚洲成va人在线观看| 中文字幕不卡的av| 91精品国产色综合久久不卡蜜臀 | 欧美猛男男办公室激情| 国产美女在线精品| 亚洲第一激情av| 国产天堂亚洲国产碰碰| 欧美欧美欧美欧美首页| 成人深夜在线观看| 亚洲国产色一区| 国产精品女主播在线观看| 69成人精品免费视频| 一本一道综合狠狠老| 国产精品99久久久久久久女警 | 欧美视频一区二区三区| 国产不卡在线播放| 丝袜美腿亚洲一区| 亚洲精品写真福利| 国产精品久久久久久久浪潮网站 | 日韩一区欧美小说| 久久久久久久性| 欧美一区国产二区| 欧美日韩午夜精品| 色视频一区二区| 高清国产一区二区| 蜜桃视频一区二区| 亚洲第一精品在线| 亚洲精品视频观看| 亚洲人成影院在线观看| 亚洲国产精品国自产拍av| xnxx国产精品| 精品国产一区二区精华| 在线不卡一区二区| 欧美日韩成人综合在线一区二区| 99久久精品国产精品久久| 成人丝袜高跟foot| 成人黄页在线观看| 成人激情午夜影院| 99精品视频在线免费观看| 丰满亚洲少妇av| 成人激情黄色小说| 99久久夜色精品国产网站| 国产69精品久久99不卡| 国产精品小仙女| 丁香啪啪综合成人亚洲小说| 激情久久五月天| 国产成a人无v码亚洲福利| 国产成人综合网站| av色综合久久天堂av综合| 99re这里只有精品首页| 色婷婷亚洲一区二区三区| 欧美中文字幕一区二区三区亚洲| 91福利在线免费观看| 欧美日韩另类国产亚洲欧美一级| 欧美电影在线免费观看| 日韩一区二区三区av| 日韩精品一区二区三区四区视频| 精品剧情在线观看| 久久网站热最新地址| 国产精品情趣视频| 亚洲男同性视频| 日本视频一区二区| 国产精品亚洲一区二区三区妖精| 成人动漫一区二区三区| 日本丶国产丶欧美色综合| 欧美日韩高清在线播放| 欧美α欧美αv大片| 国产日韩欧美麻豆| 亚洲国产综合91精品麻豆| 奇米精品一区二区三区在线观看一 | 国产91丝袜在线播放| 色94色欧美sute亚洲线路一久| 欧美片在线播放| 久久精品日韩一区二区三区| 国产精品不卡视频| 天天色天天操综合| 国产成人日日夜夜| 欧美日韩在线播放| 国产亚洲一区字幕| 亚洲成av人片一区二区梦乃| 久草这里只有精品视频| 91国在线观看| 精品久久久久久久久久久院品网| 国产精品你懂的在线| 日韩精品乱码免费| www.在线成人| 欧美一区二区三区白人| 国产精品青草久久| 精品在线你懂的| 欧美特级限制片免费在线观看| 久久亚洲免费视频| 性欧美大战久久久久久久久| 成人h动漫精品一区二| 日韩午夜在线观看| 亚洲黄色片在线观看| 国产酒店精品激情| 91精品国产欧美日韩| 亚洲免费在线观看| 国产成人精品一区二| 日韩一二三区不卡| 亚洲国产成人va在线观看天堂| 国产精品自拍av| 欧美一区二区三区在| 夜夜嗨av一区二区三区四季av | 一级特黄大欧美久久久| 国产精选一区二区三区| 日韩一区二区在线观看| 亚洲在线观看免费| 99精品久久只有精品| 国产亚洲欧美色| 久久福利视频一区二区| 欧美一区二区三区人| 亚洲午夜私人影院| 91高清在线观看| 免费观看一级特黄欧美大片| 欧美日韩久久不卡| 一区二区三区免费在线观看| 成人国产亚洲欧美成人综合网| 久久影院午夜片一区| 久久精品国产免费| 日韩欧美在线123| 日韩高清国产一区在线| 欧美亚洲一区二区三区四区| 亚洲人成网站精品片在线观看| 成人h版在线观看| 欧美激情一区二区三区蜜桃视频| 国产精品1区2区| 亚洲国产成人在线| 99精品桃花视频在线观看| 亚洲日本乱码在线观看| 色综合久久综合中文综合网| 一区二区三区中文字幕精品精品 | 久久精品国产网站| 久久久久久久久久久电影|