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