⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adksprites.pas

📁 N年前有个法国小组用Delphi写了一个2D网游(AD&D类型)
💻 PAS
字号:
unit ADKSprites;

{
 Biblith鑡ue de Sprites pour le projet ADK-ISO (c)2002 Paul TOTH <tothpaul@free.fr>

 http://www.web-synergy.net/naug-land/

}

interface

uses
 Windows,Classes,SysUtils,Graphics,ADKCompress,ADKDepth,ADKScreens;

Const
 LIB_SIGN:array[0..3] of char='SPRL';
 LIB_VERSION=105;

// historique des versions
// 101 - premi鑢e version
// 102 - ajout de TFrameHeader pour g閞er les d閜lacements
// 103 - s閜aration des actions en plusieurs fichiers SPR
// 104 - nouvelle compression (supportant le clipping) dans ADKCompress
// 105 - palette RGB et non BGR

type
 TDirection=(dirN,dirNE,dirE,dirSE,dirS,dirSW,dirW,dirNW);

 TFrameHeader=packed record
  Left  :word;
  Top   :word;
  Width :word;
  Height:word;
  Delay :integer;
  MoveX :integer;
  MoveY :integer;
  MoveZ :integer;
 end;
 PFrameHeader=^TFrameHeader;

 TSpriteFrames=packed record
  Colors:Cardinal; { Palette color index }
  First :word;     { Offsets index of the first frame }
  Count :word;     { number of frames for that sprite }
  Trans :byte;     { transparent color }
  Origin:TPoint;
 end;
 PSpriteFrames=^TSpriteFrames;

 TSpriteHeader=packed record
  Sign    :integer;
  Version :word;
  Width   :word;
  Height  :word;
  Sprites :array[TDirection] of TSpriteFrames;
  Offsets :Cardinal; // tableau d'offsets
  Palettes:Cardinal; // tableau de palette
 end;

 TSpriteOffsets=array[word] of integer;
// TSpritePalettes=array[word] of TPalette32;
 PPalette32=^TPalette32;

 TADKSprite=class(TADKCompressedDIB)
 private
  fFileName:string;
  fReadOnly:boolean;      // mode d'acc鑣 au fichier
  fFile    :integer;      // Handle du fichier
  fSize    :Cardinal;     // Taille du fichier
  fMap     :integer;      // le FileMapping !
  fBase    :pchar;        // pointer sur le fichier sur "disque mapp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -