ScummVM API documentation
ags_plugin.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 //=============================================================================
23 //
24 // AGS Plugin interface header file
25 //
26 // #define THIS_IS_THE_PLUGIN beforehand if including from the plugin
27 //
28 //=============================================================================
29 
30 #ifndef AGS_PLUGINS_AGS_PLUGIN_H
31 #define AGS_PLUGINS_AGS_PLUGIN_H
32 
33 #include "common/array.h"
34 #include "ags/shared/core/types.h"
35 #include "ags/shared/font/ags_font_renderer.h"
36 #include "ags/shared/util/string.h"
37 #include "ags/plugins/plugin_base.h"
38 #include "ags/engine/util/library_scummvm.h"
39 
40 namespace AGS3 {
41 
42 // If the plugin isn't using DDraw, don't require the headers
43 #ifndef DIRECTDRAW_VERSION
44 typedef void *LPDIRECTDRAW2;
45 typedef void *LPDIRECTDRAWSURFACE2;
46 #endif
47 
48 #ifndef DIRECTSOUND_VERSION
49 typedef void *LPDIRECTSOUND;
50 #endif
51 
52 #ifndef DIRECTINPUT_VERSION
53 typedef void *LPDIRECTINPUTDEVICE;
54 #endif
55 
56 class BITMAP;
57 
58 // If not using windows.h, define HWND
59 #if !defined(_WINDOWS_)
60 typedef int HWND;
61 #endif
62 
63 #define MAXPLUGINS 20
64 
65 #define AGSIFUNC(type) virtual type
66 
67 #define MASK_WALKABLE 1
68 #define MASK_WALKBEHIND 2
69 #define MASK_HOTSPOT 3
70 // MASK_REGIONS is interface version 11 and above only
71 #define MASK_REGIONS 4
72 
73 #define PLUGIN_FILENAME_MAX (49)
74 
75 // **** WARNING: DO NOT ALTER THESE CLASSES IN ANY WAY!
76 // **** CHANGING THE ORDER OF THE FUNCTIONS OR ADDING ANY VARIABLES
77 // **** WILL CRASH THE SYSTEM.
78 
79 struct AGSColor {
80  unsigned char r, g, b;
81  unsigned char padding;
82 };
83 
85  int32 score; // player's current score
86  int32 usedmode; // set by ProcessClick to last cursor mode used
87  int32 disabled_user_interface; // >0 while in cutscene/etc
88  int32 gscript_timer; // obsolete
89  int32 debug_mode; // whether we're in debug mode
90  int32 globalvars[50]; // obsolete
91  int32 messagetime; // time left for auto-remove messages
92  int32 usedinv; // inventory item last used
93  int32 inv_top, inv_numdisp, inv_numorder, inv_numinline;
94  int32 text_speed; // how quickly text is removed
95  int32 sierra_inv_color; // background used to paint defualt inv window
96  int32 talkanim_speed; // animation speed of talking anims
97  int32 inv_item_wid, inv_item_hit; // set by SetInvDimensions
98  int32 speech_text_shadow; // colour of outline fonts (default black)
99  int32 swap_portrait_side; // sierra-style speech swap sides
100  int32 speech_textwindow_gui; // textwindow used for sierra-style speech
101  int32 follow_change_room_timer; // delay before moving following characters into new room
102  int32 totalscore; // maximum possible score
103  int32 skip_display; // how the user can skip normal Display windows
104  int32 no_multiloop_repeat; // for backwards compatibility
105  int32 roomscript_finished; // on_call finished in room
106  int32 used_inv_on; // inv item they clicked on
107  int32 no_textbg_when_voice; // no textwindow bgrnd when voice speech is used
108  int32 max_dialogoption_width; // max width of dialog options text window
109  int32 no_hicolor_fadein; // fade out but instant in for hi-color
110  int32 bgspeech_game_speed; // is background speech relative to game speed
111  int32 bgspeech_stay_on_display; // whether to remove bg speech when DisplaySpeech is used
112  int32 unfactor_speech_from_textlength; // remove "&10" when calculating time for text to stay
113  int32 mp3_loop_before_end; // loop this time before end of track (ms)
114  int32 speech_music_drop; // how much to drop music volume by when speech is played
115  int32 in_cutscene; // we are between a StartCutscene and EndCutscene
116  int32 fast_forward; // player has elected to skip cutscene
117  int32 room_width; // width of current room
118  int32 room_height; // height of current room
119 };
120 
121 // AGSCharacter.flags
122 #define CHF_NOSCALING 1
123 #define CHF_FIXVIEW 2 // between SetCharView and ReleaseCharView
124 #define CHF_NOINTERACT 4
125 #define CHF_NODIAGONAL 8
126 #define CHF_ALWAYSIDLE 0x10
127 #define CHF_NOLIGHTING 0x20
128 #define CHF_NOTURNING 0x40
129 #define CHF_NOWALKBEHINDS 0x80
130 
131 struct AGSCharacter {
132  int32 defview = 0;
133  int32 talkview = 0;
134  int32 view = 0;
135  int32 room = 0, prevroom = 0;
136  int32 x = 0, y = 0, wait = 0;
137  int32 flags = 0;
138  short following = 0;
139  short followinfo = 0;
140  int32 idleview = 0; // the loop will be randomly picked
141  short idletime = 0, idleleft = 0; // num seconds idle before playing anim
142  short transparency = 0; // if character is transparent
143  short baseline = 0;
144  int32 activeinv = 0;
145  int32 talkcolor = 0;
146  int32 thinkview = 0;
147  int32 reserved[2];
148  short walkspeed_y = 0, pic_yoffs = 0;
149  int32 z = 0;
150  int32 reserved2[5];
151  short loop = 0, frame = 0;
152  short walking = 0, animating = 0;
153  short walkspeed = 0, animspeed = 0;
154  short inv[301];
155  short actx = 0, acty = 0;
156  char name[40];
157  char scrname[20];
158  int8 on = 0;
159 };
160 
161 // AGSObject.flags
162 #define OBJF_NOINTERACT 1 // not clickable
163 #define OBJF_NOWALKBEHINDS 2 // ignore walk-behinds
164 
165 struct AGSObject {
166  int32 x = 0, y = 0;
167  int32 transparent = 0; // current transparency setting
168  int32 reserved[4];
169  short num = 0; // sprite slot number
170  short baseline = 0; // <=0 to use Y co-ordinate; >0 for specific baseline
171  short view = 0, loop = 0, frame = 0; // only used to track animation - 'num' holds the current sprite
172  short wait = 0, moving = 0;
173  int8 cycling = 0; // is it currently animating?
174  int8 overall_speed = 0;
175  int8 on = 0;
176  int8 flags = 0;
177 };
178 
179 // AGSViewFrame.flags
180 #define FRAF_MIRRORED 1 // flipped left to right
181 
182 struct AGSViewFrame {
183  int32 pic = 0; // sprite slot number
184  short xoffs = 0, yoffs = 0;
185  short speed = 0;
186  int32 flags = 0;
187  int32 sound = 0; // play sound when this frame comes round
188  int32 reserved_for_future[2];
189 };
190 
191 // AGSMouseCursor.flags
192 #define MCF_ANIMATEMOVE 1
193 #define MCF_DISABLED 2
194 #define MCF_STANDARD 4
195 #define MCF_ONLYANIMOVERHOTSPOT 8
196 
198  int32 pic = 0; // sprite slot number
199  short hotx = 0, hoty = 0; // x,y hotspot co-ordinates
200  short view = 0; // view (for animating cursors) or -1
201  char name[10]; // name of cursor mode
202  int8 flags = 0; // MCF_flags above
203 };
204 
205 // The editor-to-plugin interface
206 class IAGSEditor {
207 public:
208  int32 version = 0;
209  int32 pluginId = 0; // used internally, do not touch this
210 
211 public:
212  virtual ~IAGSEditor() {}
213 
214  // get the HWND of the main editor frame
215  AGSIFUNC(HWND) GetEditorHandle();
216  // get the HWND of the current active window
217  AGSIFUNC(HWND) GetWindowHandle();
218  // add some script to the default header
219  AGSIFUNC(void) RegisterScriptHeader(const char *header);
220  // de-register a script header (pass same pointer as when added)
221  AGSIFUNC(void) UnregisterScriptHeader(const char *header);
222 };
223 
224 
225 // Below are interface 3 and later
226 #define AGSE_KEYPRESS 1
227 #define AGSE_MOUSECLICK 2
228 #define AGSE_POSTSCREENDRAW 4
229 // Below are interface 4 and later
230 #define AGSE_PRESCREENDRAW 8
231 // Below are interface 5 and later
232 #define AGSE_SAVEGAME 0x10
233 #define AGSE_RESTOREGAME 0x20
234 // Below are interface 6 and later
235 #define AGSE_PREGUIDRAW 0x40
236 #define AGSE_LEAVEROOM 0x80
237 #define AGSE_ENTERROOM 0x100
238 #define AGSE_TRANSITIONIN 0x200
239 #define AGSE_TRANSITIONOUT 0x400
240 // Below are interface 12 and later
241 #define AGSE_FINALSCREENDRAW 0x800
242 #define AGSE_TRANSLATETEXT 0x1000
243 // Below are interface 13 and later
244 #define AGSE_SCRIPTDEBUG 0x2000
245 #define AGSE_AUDIODECODE 0x4000 // obsolete, no longer supported
246 // Below are interface 18 and later
247 #define AGSE_SPRITELOAD 0x8000
248 // Below are interface 21 and later
249 #define AGSE_PRERENDER 0x10000
250 // Below are interface 24 and later
251 #define AGSE_PRESAVEGAME 0x20000
252 #define AGSE_POSTRESTOREGAME 0x40000
253 // Below are interface 26 and later
254 #define AGSE_POSTROOMDRAW 0x80000
255 #define AGSE_TOOHIGH 0x100000
256 
257 // GetFontType font types
258 #define FNT_INVALID 0
259 #define FNT_SCI 1
260 #define FNT_TTF 2
261 
262 // PlaySoundChannel sound types
263 #define PSND_WAVE 1
264 #define PSND_MP3STREAM 2
265 #define PSND_MP3STATIC 3
266 #define PSND_OGGSTREAM 4
267 #define PSND_OGGSTATIC 5
268 #define PSND_MIDI 6
269 #define PSND_MOD 7
270 
272 public:
273  // when a ref count reaches 0, this is called with the address
274  // of the object. Return 1 to remove the object from memory, 0 to
275  // leave it
276  virtual int Dispose(const char *address, bool force) = 0;
277  // return the type name of the object
278  virtual const char *GetType() = 0;
279  // serialize the object into BUFFER (which is BUFSIZE bytes)
280  // return number of bytes used
281  virtual int Serialize(const char *address, char *buffer, int bufsize) = 0;
282 protected:
284  }
285  virtual ~IAGSScriptManagedObject() {
286  }
287 };
288 
290 public:
291  virtual void Unserialize(int key, const char *serializedData, int dataSize) = 0;
292 protected:
294  }
295  virtual ~IAGSManagedObjectReader() {
296  }
297 };
298 
300  float WorldMatrix[16];
301  float ViewMatrix[16];
302  float ProjMatrix[16];
303 };
304 
305 // Render stage description
307  // Which version of the plugin interface the struct corresponds to;
308  // this field must be filled by a plugin before passing the struct into the engine!
309  int Version = 0;
310  // Stage's matrixes, for 3D rendering: Projection, World and View
311  AGSRenderMatrixes Matrixes;
312 };
313 
314 // Game info
315 struct AGSGameInfo {
316  // Which version of the plugin interface the struct corresponds to;
317  // this field must be filled by a plugin before passing the struct into the engine!
318  int Version;
319  // Game title (human-readable text)
320  char GameName[50];
321  // Game's GUID
322  char Guid[40];
323  // Random key identifying the game (deprecated)
324  int UniqueId;
325 };
326 
327 // The plugin-to-engine interface
328 class IAGSEngine {
329 public:
330  int32 version = 0;
331  int32 pluginId = 0; // used internally, do not touch
332 
333 public:
334  virtual ~IAGSEngine() {}
335 
336  // quit the game
337  AGSIFUNC(void) AbortGame(const char *reason);
338  // get engine version
339  AGSIFUNC(const char *) GetEngineVersion();
340  // register a script function with the system
341  AGSIFUNC(void) RegisterScriptFunction(const char *name,
342  Plugins::ScriptContainer *instance);
343  AGSIFUNC(void) RegisterBuiltInFunction(const char *name,
344  Plugins::ScriptContainer *instance);
345 #ifdef WINDOWS_VERSION
346  // get game window handle
347  AGSIFUNC(HWND) GetWindowHandle();
348  // get reference to main DirectDraw interface
349  AGSIFUNC(LPDIRECTDRAW2) GetDirectDraw2();
350  // get the DDraw surface associated with a bitmap
351  AGSIFUNC(LPDIRECTDRAWSURFACE2) GetBitmapSurface(BITMAP *);
352  #endif
353  // get a reference to the screen bitmap
354  AGSIFUNC(BITMAP *) GetScreen();
355 
356  // *** BELOW ARE INTERFACE VERSION 2 AND ABOVE ONLY
357  // ask the engine to call back when a certain event happens
358  AGSIFUNC(void) RequestEventHook(int32 event);
359  // get the options data saved in the editor
360  AGSIFUNC(int) GetSavedData(char *buffer, int32 bufsize);
361 
362  // *** BELOW ARE INTERFACE VERSION 3 AND ABOVE ONLY
363  // get the virtual screen
364  AGSIFUNC(BITMAP *) GetVirtualScreen();
365  // write text to the screen in the specified font and colour
366  AGSIFUNC(void) DrawText(int32 x, int32 y, int32 font, int32 color, const char *text);
367  // get screen dimensions
368  AGSIFUNC(void) GetScreenDimensions(int32 *width, int32 *height, int32 *coldepth);
369  // get screen surface pitch
370  AGSIFUNC(int) GetBitmapPitch(BITMAP *);
371  // get screen surface to draw on
372  AGSIFUNC(uint8 *) GetRawBitmapSurface(BITMAP *);
373  // release the surface
374  AGSIFUNC(void) ReleaseBitmapSurface(BITMAP *);
375  // get the current mouse co-ordinates
376  AGSIFUNC(void) GetMousePosition(int32 *x, int32 *y);
377 
378  // *** BELOW ARE INTERFACE VERSION 4 AND ABOVE ONLY
379  // get the current room number
380  AGSIFUNC(int) GetCurrentRoom();
381  // get the number of background scenes in this room
382  AGSIFUNC(int) GetNumBackgrounds();
383  // get the current background frame
384  AGSIFUNC(int) GetCurrentBackground();
385  // get a background scene bitmap
386  AGSIFUNC(BITMAP *) GetBackgroundScene(int32);
387  // get dimensions of a bitmap
388  AGSIFUNC(void) GetBitmapDimensions(BITMAP *bmp, int32 *width, int32 *height, int32 *coldepth);
389 
390  // *** BELOW ARE INTERFACE VERSION 5 AND ABOVE ONLY
391  // similar to fwrite - buffer, size, filehandle
392  AGSIFUNC(int) FWrite(void *, int32, int32);
393  // similar to fread - buffer, size, filehandle
394  AGSIFUNC(int) FRead(void *, int32, int32);
395  // similar to fseek
396  AGSIFUNC(bool)FSeek(soff_t offset, int origin, int32 handle);
397  // print text, wrapping as usual
398  AGSIFUNC(void) DrawTextWrapped(int32 x, int32 y, int32 width, int32 font, int32 color, const char *text);
399  // set the current active 'screen'
400  AGSIFUNC(void) SetVirtualScreen(BITMAP *);
401  // look up a word in the parser dictionary
402  AGSIFUNC(int) LookupParserWord(const char *word);
403  // draw a bitmap to the active screen
404  AGSIFUNC(void) BlitBitmap(int32 x, int32 y, BITMAP *, int32 masked);
405  // update the mouse and music
406  AGSIFUNC(void) PollSystem();
407 
408  // *** BELOW ARE INTERFACE VERSION 6 AND ABOVE ONLY
409  // get number of characters in game
410  AGSIFUNC(int) GetNumCharacters();
411  // get reference to specified character struct
412  AGSIFUNC(AGSCharacter *) GetCharacter(int32);
413  // get reference to game struct
414  AGSIFUNC(AGSGameOptions *) GetGameOptions();
415  // get reference to current palette
416  AGSIFUNC(AGSColor *) GetPalette();
417  // update palette
418  AGSIFUNC(void) SetPalette(int32 start, int32 finish, AGSColor *);
419 
420  // *** BELOW ARE INTERFACE VERSION 7 AND ABOVE ONLY
421  // get the current player character
422  AGSIFUNC(int) GetPlayerCharacter();
423  // adjust to main viewport co-ordinates
424  AGSIFUNC(void) RoomToViewport(int32 *x, int32 *y);
425  // adjust from main viewport co-ordinates (ignores viewport bounds)
426  AGSIFUNC(void) ViewportToRoom(int32 *x, int32 *y);
427  // number of objects in current room
428  AGSIFUNC(int) GetNumObjects();
429  // get reference to specified object
430  AGSIFUNC(AGSObject *) GetObject(int32);
431  // get sprite graphic
432  AGSIFUNC(BITMAP *) GetSpriteGraphic(int32);
433  // create a new blank bitmap
434  AGSIFUNC(BITMAP *) CreateBlankBitmap(int32 width, int32 height, int32 coldep);
435  // free a created bitamp
436  AGSIFUNC(void) FreeBitmap(BITMAP *);
437 
438  // *** BELOW ARE INTERFACE VERSION 8 AND ABOVE ONLY
439  // get one of the room area masks
440  AGSIFUNC(BITMAP *) GetRoomMask(int32);
441 
442  // *** BELOW ARE INTERFACE VERSION 9 AND ABOVE ONLY
443  // get a particular view frame
444  AGSIFUNC(AGSViewFrame *) GetViewFrame(int32 view, int32 loop, int32 frame);
445  // get the walk-behind baseline of a specific WB area
446  AGSIFUNC(int) GetWalkbehindBaseline(int32 walkbehind);
447  // get the address of a script function
448  AGSIFUNC(Plugins::PluginMethod) GetScriptFunctionAddress(const char *funcName);
449  // get the transparent colour of a bitmap
450  AGSIFUNC(int) GetBitmapTransparentColor(BITMAP *);
451  // get the character scaling level at a particular point
452  AGSIFUNC(int) GetAreaScaling(int32 x, int32 y);
453  // equivalent to the text script function
454  AGSIFUNC(int) IsGamePaused();
455 
456  // *** BELOW ARE INTERFACE VERSION 10 AND ABOVE ONLY
457  // get the raw pixel value to use for the specified AGS colour
458  AGSIFUNC(int) GetRawPixelColor(int32 color);
459 
460  // *** BELOW ARE INTERFACE VERSION 11 AND ABOVE ONLY
461  // get the width / height of the specified sprite
462  AGSIFUNC(int) GetSpriteWidth(int32);
463  AGSIFUNC(int) GetSpriteHeight(int32);
464  // get the dimensions of the specified string in the specified font
465  AGSIFUNC(void) GetTextExtent(int32 font, const char *text, int32 *width, int32 *height);
466  // print a message to the debug console
467  AGSIFUNC(void) PrintDebugConsole(const char *text);
468  // play a sound on the specified channel
469  AGSIFUNC(void) PlaySoundChannel(int32 channel, int32 soundType, int32 volume, int32 loop, const char *filename);
470  // same as text script function
471  AGSIFUNC(int) IsChannelPlaying(int32 channel);
472 
473  // *** BELOW ARE INTERFACE VERSION 12 AND ABOVE ONLY
474  // invalidate a region of the virtual screen
475  AGSIFUNC(void) MarkRegionDirty(int32 left, int32 top, int32 right, int32 bottom);
476  // get mouse cursor details
477  AGSIFUNC(AGSMouseCursor *) GetMouseCursor(int32 cursor);
478  // get the various components of a pixel
479  AGSIFUNC(void) GetRawColorComponents(int32 coldepth, int32 color, int32 *red, int32 *green, int32 *blue, int32 *alpha);
480  // make a pixel colour from the supplied components
481  AGSIFUNC(int) MakeRawColorPixel(int32 coldepth, int32 red, int32 green, int32 blue, int32 alpha);
482  // get whether the font is TTF or SCI
483  AGSIFUNC(int) GetFontType(int32 fontNum);
484  // create a new dynamic sprite slot
485  AGSIFUNC(int) CreateDynamicSprite(int32 coldepth, int32 width, int32 height);
486  // free a created dynamic sprite
487  AGSIFUNC(void) DeleteDynamicSprite(int32 slot);
488  // check if a sprite has an alpha channel
489  AGSIFUNC(int) IsSpriteAlphaBlended(int32 slot);
490 
491  // *** BELOW ARE INTERFACE VERSION 13 AND ABOVE ONLY
492  // un-request an event, requested earlier with RequestEventHook
493  AGSIFUNC(void) UnrequestEventHook(int32 event);
494  // draw a translucent bitmap to the active screen
495  AGSIFUNC(void) BlitSpriteTranslucent(int32 x, int32 y, BITMAP *, int32 trans);
496  // draw a sprite to the screen, but rotated around its centre
497  AGSIFUNC(void) BlitSpriteRotated(int32 x, int32 y, BITMAP *, int32 angle);
498 
499  // *** BELOW ARE INTERFACE VERSION 14 AND ABOVE ONLY
500  #ifdef WINDOWS_VERSION
501  // get reference to main DirectSound interface
502  AGSIFUNC(LPDIRECTSOUND) GetDirectSound();
503  #endif
504  // disable AGS sound engine
505  AGSIFUNC(void) DisableSound();
506  // check whether a script function can be run now
507  AGSIFUNC(int) CanRunScriptFunctionNow();
508  // call a user-defined script function
509  AGSIFUNC(int) CallGameScriptFunction(const char *name, int32 globalScript, int32 numArgs, long arg1 = 0, long arg2 = 0, long arg3 = 0);
510 
511  // *** BELOW ARE INTERFACE VERSION 15 AND ABOVE ONLY
512  // force any sprites on-screen using the slot to be updated
513  AGSIFUNC(void) NotifySpriteUpdated(int32 slot);
514  // change whether the specified sprite is a 32-bit alpha blended image
515  AGSIFUNC(void) SetSpriteAlphaBlended(int32 slot, int32 isAlphaBlended);
516  // run the specified script function whenever script engine is available
517  AGSIFUNC(void) QueueGameScriptFunction(const char *name, int32 globalScript, int32 numArgs, long arg1 = 0, long arg2 = 0);
518  // register a new dynamic managed script object
519  AGSIFUNC(int) RegisterManagedObject(const void *object, IAGSScriptManagedObject *callback);
520  // add an object reader for the specified object type
521  AGSIFUNC(void) AddManagedObjectReader(const char *typeName, IAGSManagedObjectReader *reader);
522  // register an un-serialized managed script object
523  AGSIFUNC(void) RegisterUnserializedObject(int key, const void *object, IAGSScriptManagedObject *callback);
524 
525  // *** BELOW ARE INTERFACE VERSION 16 AND ABOVE ONLY
526  // get the address of a managed object based on its key
527  AGSIFUNC(void *) GetManagedObjectAddressByKey(int key);
528  // get managed object's key from its address
529  AGSIFUNC(int) GetManagedObjectKeyByAddress(const char *address);
530 
531  // *** BELOW ARE INTERFACE VERSION 17 AND ABOVE ONLY
532  // create a new script string
533  AGSIFUNC(const char *) CreateScriptString(const char *fromText);
534 
535  // *** BELOW ARE INTERFACE VERSION 18 AND ABOVE ONLY
536  // increment reference count
537  AGSIFUNC(int) IncrementManagedObjectRefCount(const char *address);
538  // decrement reference count
539  AGSIFUNC(int) DecrementManagedObjectRefCount(const char *address);
540  // set mouse position
541  AGSIFUNC(void) SetMousePosition(int32 x, int32 y);
542  // simulate the mouse being clicked
543  AGSIFUNC(void) SimulateMouseClick(int32 button);
544  // get number of waypoints on this movement path
545  AGSIFUNC(int) GetMovementPathWaypointCount(int32 pathId);
546  // get the last waypoint that the char/obj passed
547  AGSIFUNC(int) GetMovementPathLastWaypoint(int32 pathId);
548  // get the co-ordinates of the specified waypoint
549  AGSIFUNC(void) GetMovementPathWaypointLocation(int32 pathId, int32 waypoint, int32 *x, int32 *y);
550  // get the speeds of the specified waypoint
551  AGSIFUNC(void) GetMovementPathWaypointSpeed(int32 pathId, int32 waypoint, int32 *xSpeed, int32 *ySpeed);
552 
553  // *** BELOW ARE INTERFACE VERSION 19 AND ABOVE ONLY
554  // get the current graphics driver ID
555  AGSIFUNC(const char *) GetGraphicsDriverID();
556 
557  // *** BELOW ARE INTERFACE VERSION 22 AND ABOVE ONLY
558  // get whether we are running under the editor's debugger
559  AGSIFUNC(int) IsRunningUnderDebugger();
560  // tells the engine to break into the debugger when the next line of script is run
561  AGSIFUNC(void) BreakIntoDebugger();
562  // fills buffer with <install dir>\fileName, as appropriate
563  AGSIFUNC(void) GetPathToFileInCompiledFolder(const char *fileName, char *buffer);
564 
565  // *** BELOW ARE INTERFACE VERSION 23 AND ABOVE ONLY
566  #ifdef WINDOWS_VERSION
567  // get reference to keyboard Direct Input device
568  AGSIFUNC(LPDIRECTINPUTDEVICE) GetDirectInputKeyboard();
569  // get reference to mouse Direct Input device
570  AGSIFUNC(LPDIRECTINPUTDEVICE) GetDirectInputMouse();
571  #endif
572  // install a replacement renderer for the specified font number
573  AGSIFUNC(IAGSFontRenderer *) ReplaceFontRenderer(int fontNumber, IAGSFontRenderer *newRenderer);
574 
575  // *** BELOW ARE INTERFACE VERSION 25 AND ABOVE ONLY
576  // fills the provided AGSRenderStageDesc struct with current render stage description;
577  // please note that plugin MUST fill the struct's Version field before passing it into the function!
578  AGSIFUNC(void) GetRenderStageDesc(AGSRenderStageDesc *desc);
579 
580  // *** BELOW ARE INTERFACE VERSION 26 AND ABOVE ONLY
581  // fills the provided AGSGameInfo struct
582  // please note that plugin MUST fill the struct's Version field before passing it into the function!
583  AGSIFUNC(void) GetGameInfo(AGSGameInfo* ginfo);
584  // install a replacement renderer (extended interface) for the specified font number
585  AGSIFUNC(IAGSFontRenderer*) ReplaceFontRenderer2(int fontNumber, IAGSFontRenderer2* newRenderer);
586  // notify the engine that certain custom font has been updated
587  AGSIFUNC(void) NotifyFontUpdated(int fontNumber);
588 };
589 
590 struct EnginePlugin {
591  AGS::Shared::String filename;
592  AGS::Engine::Library library;
593  Plugins::PluginBase *_plugin = nullptr;
594  bool available = false;
595  char *savedata = nullptr;
596  int savedatasize = 0;
597  int wantHook = 0;
598  int invalidatedRegion = 0;
599  bool builtin = false;
600 
601  IAGSEngine eiface;
602 
603  EnginePlugin() {
604  eiface.version = 0;
605  eiface.pluginId = 0;
606  }
607 };
608 
609 extern void PluginSimulateMouseClick(int pluginButtonID);
610 
611 } // namespace AGS3
612 
613 #endif
Definition: ags_plugin.h:289
Definition: ags_plugin.h:131
Definition: ags_plugin.h:299
Definition: ags_plugin.h:271
Definition: ags_plugin.h:206
Definition: ags_plugin.h:306
Definition: library_scummvm.h:35
Definition: ags_plugin.h:197
Definition: ags_plugin.h:590
Definition: surface.h:32
Definition: plugin_base.h:171
Definition: ags_plugin.h:165
Definition: ags_plugin.h:84
Definition: version.h:39
Definition: ags_font_renderer.h:47
Definition: color.h:49
Definition: string.h:62
Definition: ags_plugin.h:328
Definition: ags_plugin.h:79
Definition: plugin_base.h:151
Definition: ags_plugin.h:182
Definition: plugin_base.h:189
Definition: ags.h:40
Definition: ags_plugin.h:315
Definition: ags_font_renderer.h:29