-
Notifications
You must be signed in to change notification settings - Fork 1
/
Engine_Reg.pas
244 lines (227 loc) · 11.2 KB
/
Engine_Reg.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
unit Engine_Reg;
(*******************************)
(*<<< XEngine v0.41 header >>>*)
(*******************************)
(* Created by XProger *)
(* begin : 29.10.2003 *)
(* end : 07.03.2005 *)
(*******************************)
(* site : www.XProger.narod.ru *)
(* mail : [email protected] *)
(*******************************)
interface
uses
Windows, Graph_Lib, Type_Lib;
const
EngDLL = 'XEngine.dll';
(*** Log ***)
//Èíèöèàëèçàöèÿ ëîãà
procedure Log_Init; stdcall; external EngDLL;
//Âûâîäèòü ëè â êîíñîëü ëîã
procedure Log_ConWrite(ConsoleWrite: boolean); stdcall; external EngDLL;
//Âûâîä ñòàðîêè â ôàéë/êîíñîëü
procedure Log(Str: ShortString); stdcall; external EngDLL;
//Âûâîä ñîîáùåíèÿ â ëîã ôàéë è îêíî êîíñîëè
procedure Log_Console(Str: ShortString); stdcall; external EngDLL;
//Çàêðûòèå ôàéëà
procedure Log_Close; stdcall; external EngDLL;
(*** Engine ***)
//Âåðñèÿ äâèæêà
function Engine_Version: PChar; stdcall; external EngDLL;
//Äâèæîê çàêîí÷èë ñâîþ ðàáîòó?
function Engine_isQuit: boolean; stdcall; external EngDLL;
//Çàêîí÷èòü ðàáîòó äâèæêà (âûõîä èç ïðîãðàììû)
procedure Engine_Quit; stdcall; external EngDLL;
// îáíóëåíèå ñ÷¸ò÷èêà àïäåéòîâ (òàéìåðà)
procedure Engine_FlushTimer; stdcall; external EngDLL;
//Ïîèñê ìîäîâ
procedure Engine_FindMods; stdcall; external EngDLL;
//Âûäà¸ò êîëè÷åñòâî íàéäåííûõ ìîäîâ
function Engine_ModCount: integer; stdcall; external EngDLL;
//Âûäà¸ò èíôîðìàöèþ î ìîäå
function Engine_GetMod(ModNum: integer; var ModData: TMod): boolean; stdcall; external EngDLL;
//Íîìåð òåêóùåãî ìîäà
function Engine_CurMod: integer; stdcall; external EngDLL;
//Íàçâàíèå òåêóùåãî ìîäà
function Engine_ModName: ShortString; stdcall; external EngDLL;
//ïóòü ê ïàïêå ìîäà\
function Engine_ModDir: ShortString; stdcall; external EngDLL;
//ïóòü ê ïàïêå äâèæêà\
function Engine_Dir: ShortString; stdcall; external EngDLL;
//Ñìåíà ìîäà íà ìîä ïîä íîìåðîì ModNum
function Engine_ChangeMod(ModNum: integer): boolean; stdcall; external EngDLL;
//Çàïðîñ íà ñìåíó ìîäà
function Engine_ChangeModQuery(ModNum: integer): boolean; stdcall; external EngDLL;
//Àêòèâíî ëè îêíî
function Engine_isActive: boolean; stdcall; external EngDLL;
// Óñòàíîâèòü êîëè÷åñòâî îäíîâëåíèé â ñåêóíäó (1..499)
procedure Engine_SetUPS(UPS: WORD); stdcall; external EngDLL;
// Óçíàòü ÷èñëî îáíîâëåíèé â ñåêóíäó
function Engine_GetUPS: WORD; stdcall; external EngDLL;
(*** Console ***)
//Ïîëó÷àåì óêàçàòåëü íà ñâîéñòâà(ïàðàìåòðû) êîíñîëè
function Console_Prop: PConsoleProp; stdcall; external EngDLL;
//Óñòàíàâëèâàåì ïðîöåäóðó êîíôèãà
procedure Console_SetCfgProc(Proc: pointer); stdcall; external EngDLL;
//Îáðàáîòêà êîìàíäû
function Console_Cmd(Cmd: ShortString): boolean; stdcall; external EngDLL;
//Ðåãèñòðàöèÿ êîìàíäû
procedure Console_CmdReg(Cmd: ShortString; Proc: PConsoleCmdProc); stdcall; external EngDLL;
//Ðåãèñòðàöèÿ "ñàìîñòîÿòåëüíîé" êîìàíäû
procedure Console_CmdRegEx(Name : ShortString;
Variable : pointer;
VarType : TVarType;
min, max : integer;
cfgProc : boolean = false); stdcall; external EngDLL;
//Äîáàâëåíèå ñòðîêè â êîíñîëü
procedure Console_Msg(Msg: ShortString); stdcall; external EngDLL;
//Óäàëåíèå ñòðîêè ñòðîêè â êîíñîëü
procedure Console_DeleteMsg(i: integer); stdcall; external EngDLL;
//Íàéòè ïåðåìåííóþ ïî å¸ èìåíè (nil - åñëè òàêîâîé íå èìååòñÿ)
function Console_GetVar(VarName: ShortString): pointer; stdcall; external EngDLL;
(*** XGL ****)
//Ïàðàìåòðû ýêðàíà
procedure xglViewport(X, Y: SmallInt; Width, Height: WORD; Perspective: boolean); stdcall; external EngDLL;
procedure xglChangePerspective; stdcall; external EngDLL;
//Øèðèíà ýêðàíà
function xglWidth: WORD; stdcall; external EngDLL;
//Âûñîòà ýêðàíà
function xglHeight: WORD; stdcall; external EngDLL;
//Ãëóáèíà öâåòà
function xglDisBPP: Byte; stdcall; external EngDLL;
//×àñòîòà ìîíèòîðà
function xglDisFreq: WORD; stdcall; external EngDLL;
//Î÷èñòêà âñåãî
procedure xglClear; stdcall; external EngDLL;
//Âñ¸ ÷òî íàðèñîâàííî íà ýêðàí
procedure xglSwap; stdcall; external EngDLL;
//Ñìåíà âèäåî ðåæèìà
function xglChangeMode(FullScreen: boolean; Width, Height: integer; BPP: Byte; Freq: Byte): boolean; stdcall; external EngDLL;
//Èãðàåì â FullScreen ðåæèìå?
function xglisFullScreen: boolean; stdcall; external EngDLL;
//Êàêîé âèä ïðèìèòèâà ðèñóåì?
function xglGetMode: SmallInt; stdcall; external EngDLL;
//Íà÷àòü îòðèñîâêó
procedure xglBegin(Mode: SmallInt); stdcall; external EngDLL;
//Çàêîí÷èòü îòðèñîâêó
procedure xglEnd; stdcall; external EngDLL;
//Òèï àëüôà ñìåøèâàíèÿ
procedure xglAlphaBlend(_type: Byte); stdcall; external EngDLL;
// Óñòàíîâèòü ÿðêîñòü äèñïëåÿ
procedure xglGamma_Set(gamma: integer); stdcall; external EngDLL;
// Óçíàòü ÿðêîñòü äèñïëåÿ
function xglGamma_Get: integer; stdcall; external EngDLL;
(*** Texture ***)
//Çàãðóçêà äàííûõ èçîáðàæåíèÿ áåç ñîçäàíèÿ òåêñòóðû
function xglTex_LoadData(FileName: PChar; TexData: PTexData): boolean; stdcall; external EngDLL;
//Âûñâîáîæäåíèå ïàìÿòè ïîä äàííûå
procedure xglTex_FreeData(TexData: PTexData); stdcall; external EngDLL;
//Çàãðóçêà äàííûõ èçîáðàæåíèÿ c ñîçäàíèåì òåêñòóðû
function xglTex_Load(FileName: PChar; TexData: PTexData): boolean; stdcall; external EngDLL;
//Ñîçäàíèå òåêñòóðû ïî äàííûì èçîáðàæåíèÿ
procedure xglTex_Create(TexData: PTexData); stdcall; external EngDLL;
//Óäàëåíèå òåêñòóðû èç ïàìÿòè
procedure xglTex_Free(TexData: PTexData); stdcall; external EngDLL;
//Ïðèìåòèòü òåêñòóðó (ñäåëàòü òåêóùåé)
procedure xglTex_Enable(TexData: PTexData); stdcall; external EngDLL;
//Íå èñïîëüçîâàòü òåêñòóðó
procedure xglTex_Disable; stdcall; external EngDLL;
// Ñêðèíøîò â 24 áèòíîì öâåòå :) (Quality - òîëüêî äëÿ jpg)
function xglScreenShot(FileName: PChar): boolean; stdcall; external EngDLL;
// ïèøåòñÿ ëè "âèäåî"
function xglWriteAVI: Byte; stdcall; external EngDLL;
(*** Sprite ***)
//Âûâîä ïðÿìîóãîëüíîãî ñïðàéòà
procedure Sprite_Draw(Source, Dest: TRect;
TexData: PTexData); stdcall; external EngDLL;
(*** Clipboard ***)
//×èòàåì òåêñò (256 ñèìâîëîâ) èç áóôôåðà îáìåíà
function Clipboard_GetText: ShortString; stdcall; external EngDLL;
(*** Input ***)
function Input_KeyDown(KeyValue: integer): boolean; stdcall; external EngDLL;
function Input_KeyNum(KeyName: PChar): integer; stdcall; external EngDLL;
function Input_KeyName(KeyValue: integer): PChar; stdcall; external EngDLL;
function Input_LastKey: integer; stdcall; external EngDLL;
function Input_MouseDown(BtnNum: Byte): boolean; stdcall; external EngDLL;
function Input_MouseDelta: TPoint; stdcall; external EngDLL;
function Input_MouseWheelDelta: integer; stdcall; external EngDLL;
function Input_JoyDown(JoyNum, Button: Byte): boolean; stdcall; external EngDLL;
procedure Input_JoyPos(JoyNum: Byte; var X, Y, Z: DWORD); stdcall; external EngDLL;
function Input_JoyPosX(JoyNum: Byte): DWORD; stdcall; external EngDLL;
function Input_JoyPosY(JoyNum: Byte): DWORD; stdcall; external EngDLL;
function Input_JoyPosZ(JoyNum: Byte): DWORD; stdcall; external EngDLL;
(*** SOUND ***)
// Íà÷àëî îáíîâëåíèÿ-ïîäãðóçêè
procedure snd_BeginUpdate; stdcall; external EngDLL;
// Îêîí÷àíèå. Òå ÷òî íå íóæíû óäàëÿþòñÿ èç ñïèñêà
procedure snd_EndUpdate; stdcall; external EngDLL;
// Çàãðóçêà çâóêà èç wav ôàéëà
function snd_Load(FileName : PChar): integer; stdcall; external EngDLL;
// Óäàëåíèå ñýìïëà èç ïàìÿòè
function snd_Free(Sample_ID: integer): boolean; stdcall; external EngDLL;
// Íà÷àòü ïðîèãðûâàíèå
function snd_Play(Sample_ID: integer; Loop: boolean; X, Y: single; bind: boolean = false; psnd: pointer = nil): integer; stdcall; external EngDLL;
// Îñòàíîâèòü
function snd_Stop(Channel_ID: integer): boolean; stdcall; external EngDLL;
// Îñòíîâèòü ïðîèãðûâàíèå âñåõ çâóêîâ ýòîãî òèïà (0 - îñòàíîâèòü âñå)
procedure snd_StopAll(Sound_ID: integer); stdcall; external EngDLL;
// Óðîâåíü ãðîìêîñòè êàíàëà
function snd_SetVolume(Channel_ID: integer; Volume: integer): boolean; stdcall; external EngDLL;
// Ïîçèöèÿ íàõîæäåíèÿ èñòî÷íèêà çâó÷àíèÿ/êàíàëà
function snd_SetPos(Channel_ID: integer; Pos: TPoint2f): boolean; stdcall; external EngDLL;
// ×àñòîòà çâóêà
function snd_SetFreq(Channel_ID: integer; Freq: DWORD): boolean; stdcall; external EngDLL;
// Ïîçèöèÿ "óøåé" â 3ä ïðîñòðàíñòâå
procedure snd_SetGlobalPos(Pos: TPoint2f); stdcall; external EngDLL;
// Music âñ¸ ÷òî äåðæèò MediaPlayer! Äàæå avi :)
// íà÷àòü ïðîèãðûâàíèå
function mus_Play(FileName : PChar): integer; stdcall; external EngDLL;
// Ïîâòîðèòü
function mus_RePlay(music_id: WORD): boolean; stdcall; external EngDLL;
// îñòàíîâèòü ïðîèãðûâàíèå
procedure mus_Stop(music_id: WORD); stdcall; external EngDLL;
(*** NET ***)
//Èíèöèàëèçàöèÿ ñåòåâîãî ïðîòîêîëà
function NET_Init: boolean; stdcall; external EngDLL;
// Ñîçäàíèå ñîêåòà
function NET_InitSocket(Port: WORD): integer; stdcall; external EngDLL;
//Îñâîáîæäåíèå ðåñóðñîâ ïîä ñåòü
procedure NET_Free; stdcall; external EngDLL;
//IP êîìïüþòåðà â ëîêàëüíîé ñåòè
function NET_GetLocalIP: PChar; stdcall; external EngDLL;
//IP êîìïüþòåðà â èíòåðíåòå
function NET_GetExternalIP: PChar; stdcall; external EngDLL;
//Äà¸ò èìÿ êîìïüþòåðà â ñåòè
function NET_GetHost: PChar; stdcall; external EngDLL;
// Äà¸ò IP ïî õîñòó
function NET_HostToIP(Host: PChar): PChar; stdcall; external EngDLL;
//Î÷èñòêà áóôåðà
procedure NET_Clear; stdcall; external EngDLL;
//Î÷èñòêà APL áóôåðà
procedure NET_ClearAPL; stdcall; external EngDLL;
//Çàïèñàòü äàííûå buf äëèíîé Count áàéò â áóôåð
function NET_Write(Buf: pointer; Count: integer): boolean; stdcall; external EngDLL;
//Ïðî÷èòàòü ñëåäóþùèé ïàêåò èç áóôåðà (-1 ïðè ïóñòîì áóôåðå)
function NET_Recv(Buf: pointer; Count: integer; var IP: PChar; var Port: integer): integer; stdcall; external EngDLL;
//Ïîñëàòü ïàêåò (äàííûå èç áóôåðà) ïî óêàçàííîìó IP è Port
function NET_Send(IP: PChar; Port: WORD; APL: boolean): integer; stdcall; external EngDLL;
//Îáíîâëåíèå ñîñòîÿíèÿ ñåòåâîãî ïðîòîêîëà äâèæêà (àâòîìàòè÷åñêè âûçûâàåòñÿ ðàç â òèê)
procedure NET_Update; stdcall; external EngDLL;
(*** Font ***)
function Font_Create(FileName: PChar; Font: PTexData): boolean; stdcall; external EngDLL;
procedure Font_Free(Font: PTexData); stdcall; external EngDLL;
(*** Text ***)
function Text_TagOut(X, Y: SmallInt; Font: pointer; Shadow: boolean; Text: PChar): integer; stdcall; external EngDLL;
procedure TextOut(X, Y: SmallInt; Text: PChar); stdcall; external EngDLL;
(*** Utils ***)
function Utils_GetCPU: PChar; stdcall; external EngDLL;
function Utils_GetMemory: DWORD; stdcall; external EngDLL;
function Utils_CRC32(initCRC: DWORD; Buf: pointer; Size: DWORD): DWORD; stdcall; external EngDLL;
//Winamp Control
procedure Winamp_Play; stdcall; external EngDLL;
procedure Winamp_Pause; stdcall; external EngDLL;
procedure Winamp_Stop; stdcall; external EngDLL;
procedure Winamp_Next; stdcall; external EngDLL;
procedure Winamp_Prev; stdcall; external EngDLL;
implementation
end.