30 #ifndef AGS_PLUGINS_AGS_PLUGIN_H 31 #define AGS_PLUGINS_AGS_PLUGIN_H 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" 43 #ifndef DIRECTDRAW_VERSION 44 typedef void *LPDIRECTDRAW2;
45 typedef void *LPDIRECTDRAWSURFACE2;
48 #ifndef DIRECTSOUND_VERSION 49 typedef void *LPDIRECTSOUND;
52 #ifndef DIRECTINPUT_VERSION 53 typedef void *LPDIRECTINPUTDEVICE;
59 #if !defined(_WINDOWS_) 65 #define AGSIFUNC(type) virtual type 67 #define MASK_WALKABLE 1 68 #define MASK_WALKBEHIND 2 69 #define MASK_HOTSPOT 3 71 #define MASK_REGIONS 4 73 #define PLUGIN_FILENAME_MAX (49) 80 unsigned char r, g, b;
81 unsigned char padding;
87 int32 disabled_user_interface;
93 int32 inv_top, inv_numdisp, inv_numorder, inv_numinline;
95 int32 sierra_inv_color;
97 int32 inv_item_wid, inv_item_hit;
98 int32 speech_text_shadow;
99 int32 swap_portrait_side;
100 int32 speech_textwindow_gui;
101 int32 follow_change_room_timer;
104 int32 no_multiloop_repeat;
105 int32 roomscript_finished;
107 int32 no_textbg_when_voice;
108 int32 max_dialogoption_width;
109 int32 no_hicolor_fadein;
110 int32 bgspeech_game_speed;
111 int32 bgspeech_stay_on_display;
112 int32 unfactor_speech_from_textlength;
113 int32 mp3_loop_before_end;
114 int32 speech_music_drop;
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 135 int32 room = 0, prevroom = 0;
136 int32 x = 0, y = 0, wait = 0;
139 short followinfo = 0;
141 short idletime = 0, idleleft = 0;
142 short transparency = 0;
148 short walkspeed_y = 0, pic_yoffs = 0;
151 short loop = 0, frame = 0;
152 short walking = 0, animating = 0;
153 short walkspeed = 0, animspeed = 0;
155 short actx = 0, acty = 0;
162 #define OBJF_NOINTERACT 1 // not clickable 163 #define OBJF_NOWALKBEHINDS 2 // ignore walk-behinds 167 int32 transparent = 0;
171 short view = 0, loop = 0, frame = 0;
172 short wait = 0, moving = 0;
174 int8 overall_speed = 0;
180 #define FRAF_MIRRORED 1 // flipped left to right 184 short xoffs = 0, yoffs = 0;
188 int32 reserved_for_future[2];
192 #define MCF_ANIMATEMOVE 1 193 #define MCF_DISABLED 2 194 #define MCF_STANDARD 4 195 #define MCF_ONLYANIMOVERHOTSPOT 8 199 short hotx = 0, hoty = 0;
215 AGSIFUNC(HWND) GetEditorHandle();
217 AGSIFUNC(HWND) GetWindowHandle();
219 AGSIFUNC(
void) RegisterScriptHeader(
const char *header);
221 AGSIFUNC(
void) UnregisterScriptHeader(
const char *header);
226 #define AGSE_KEYPRESS 1 227 #define AGSE_MOUSECLICK 2 228 #define AGSE_POSTSCREENDRAW 4 230 #define AGSE_PRESCREENDRAW 8 232 #define AGSE_SAVEGAME 0x10 233 #define AGSE_RESTOREGAME 0x20 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 241 #define AGSE_FINALSCREENDRAW 0x800 242 #define AGSE_TRANSLATETEXT 0x1000 244 #define AGSE_SCRIPTDEBUG 0x2000 245 #define AGSE_AUDIODECODE 0x4000 // obsolete, no longer supported 247 #define AGSE_SPRITELOAD 0x8000 249 #define AGSE_PRERENDER 0x10000 251 #define AGSE_PRESAVEGAME 0x20000 252 #define AGSE_POSTRESTOREGAME 0x40000 254 #define AGSE_POSTROOMDRAW 0x80000 255 #define AGSE_TOOHIGH 0x100000 258 #define FNT_INVALID 0 264 #define PSND_MP3STREAM 2 265 #define PSND_MP3STATIC 3 266 #define PSND_OGGSTREAM 4 267 #define PSND_OGGSTATIC 5 276 virtual int Dispose(
const char *address,
bool force) = 0;
278 virtual const char *GetType() = 0;
281 virtual int Serialize(
const char *address,
char *buffer,
int bufsize) = 0;
291 virtual void Unserialize(
int key,
const char *serializedData,
int dataSize) = 0;
300 float WorldMatrix[16];
301 float ViewMatrix[16];
302 float ProjMatrix[16];
337 AGSIFUNC(
void) AbortGame(
const char *reason);
339 AGSIFUNC(
const char *) GetEngineVersion();
341 AGSIFUNC(
void) RegisterScriptFunction(
const char *name,
343 AGSIFUNC(
void) RegisterBuiltInFunction(
const char *name,
345 #ifdef WINDOWS_VERSION 347 AGSIFUNC(HWND) GetWindowHandle();
349 AGSIFUNC(LPDIRECTDRAW2) GetDirectDraw2();
351 AGSIFUNC(LPDIRECTDRAWSURFACE2) GetBitmapSurface(
BITMAP *);
354 AGSIFUNC(
BITMAP *) GetScreen();
358 AGSIFUNC(
void) RequestEventHook(int32 event);
360 AGSIFUNC(
int) GetSavedData(
char *buffer, int32 bufsize);
364 AGSIFUNC(
BITMAP *) GetVirtualScreen();
366 AGSIFUNC(
void) DrawText(int32 x, int32 y, int32 font, int32
color,
const char *text);
368 AGSIFUNC(
void) GetScreenDimensions(int32 *width, int32 *height, int32 *coldepth);
370 AGSIFUNC(
int) GetBitmapPitch(
BITMAP *);
372 AGSIFUNC(uint8 *) GetRawBitmapSurface(
BITMAP *);
374 AGSIFUNC(
void) ReleaseBitmapSurface(
BITMAP *);
376 AGSIFUNC(
void) GetMousePosition(int32 *x, int32 *y);
380 AGSIFUNC(
int) GetCurrentRoom();
382 AGSIFUNC(
int) GetNumBackgrounds();
384 AGSIFUNC(
int) GetCurrentBackground();
386 AGSIFUNC(
BITMAP *) GetBackgroundScene(int32);
388 AGSIFUNC(
void) GetBitmapDimensions(
BITMAP *bmp, int32 *width, int32 *height, int32 *coldepth);
392 AGSIFUNC(
int) FWrite(
void *, int32, int32);
394 AGSIFUNC(
int) FRead(
void *, int32, int32);
396 AGSIFUNC(
bool)FSeek(soff_t offset,
int origin, int32 handle);
398 AGSIFUNC(
void) DrawTextWrapped(int32 x, int32 y, int32 width, int32 font, int32 color,
const char *text);
400 AGSIFUNC(
void) SetVirtualScreen(
BITMAP *);
402 AGSIFUNC(
int) LookupParserWord(
const char *word);
404 AGSIFUNC(
void) BlitBitmap(int32 x, int32 y,
BITMAP *, int32 masked);
406 AGSIFUNC(
void) PollSystem();
410 AGSIFUNC(
int) GetNumCharacters();
418 AGSIFUNC(
void) SetPalette(int32 start, int32 finish,
AGSColor *);
422 AGSIFUNC(
int) GetPlayerCharacter();
424 AGSIFUNC(
void) RoomToViewport(int32 *x, int32 *y);
426 AGSIFUNC(
void) ViewportToRoom(int32 *x, int32 *y);
428 AGSIFUNC(
int) GetNumObjects();
432 AGSIFUNC(
BITMAP *) GetSpriteGraphic(int32);
434 AGSIFUNC(
BITMAP *) CreateBlankBitmap(int32 width, int32 height, int32 coldep);
436 AGSIFUNC(
void) FreeBitmap(
BITMAP *);
440 AGSIFUNC(
BITMAP *) GetRoomMask(int32);
444 AGSIFUNC(
AGSViewFrame *) GetViewFrame(int32 view, int32 loop, int32 frame);
446 AGSIFUNC(
int) GetWalkbehindBaseline(int32 walkbehind);
450 AGSIFUNC(
int) GetBitmapTransparentColor(
BITMAP *);
452 AGSIFUNC(
int) GetAreaScaling(int32 x, int32 y);
454 AGSIFUNC(
int) IsGamePaused();
458 AGSIFUNC(
int) GetRawPixelColor(int32 color);
462 AGSIFUNC(
int) GetSpriteWidth(int32);
463 AGSIFUNC(
int) GetSpriteHeight(int32);
465 AGSIFUNC(
void) GetTextExtent(int32 font,
const char *text, int32 *width, int32 *height);
467 AGSIFUNC(
void) PrintDebugConsole(
const char *text);
469 AGSIFUNC(
void) PlaySoundChannel(int32 channel, int32 soundType, int32 volume, int32 loop,
const char *filename);
471 AGSIFUNC(
int) IsChannelPlaying(int32 channel);
475 AGSIFUNC(
void) MarkRegionDirty(int32 left, int32 top, int32 right, int32 bottom);
479 AGSIFUNC(
void) GetRawColorComponents(int32 coldepth, int32 color, int32 *red, int32 *green, int32 *blue, int32 *alpha);
481 AGSIFUNC(
int) MakeRawColorPixel(int32 coldepth, int32 red, int32 green, int32 blue, int32 alpha);
483 AGSIFUNC(
int) GetFontType(int32 fontNum);
485 AGSIFUNC(
int) CreateDynamicSprite(int32 coldepth, int32 width, int32 height);
487 AGSIFUNC(
void) DeleteDynamicSprite(int32 slot);
489 AGSIFUNC(
int) IsSpriteAlphaBlended(int32 slot);
493 AGSIFUNC(
void) UnrequestEventHook(int32 event);
495 AGSIFUNC(
void) BlitSpriteTranslucent(int32 x, int32 y,
BITMAP *, int32 trans);
497 AGSIFUNC(
void) BlitSpriteRotated(int32 x, int32 y,
BITMAP *, int32 angle);
500 #ifdef WINDOWS_VERSION 502 AGSIFUNC(LPDIRECTSOUND) GetDirectSound();
505 AGSIFUNC(
void) DisableSound();
507 AGSIFUNC(
int) CanRunScriptFunctionNow();
509 AGSIFUNC(
int) CallGameScriptFunction(
const char *name, int32 globalScript, int32 numArgs,
long arg1 = 0,
long arg2 = 0,
long arg3 = 0);
513 AGSIFUNC(
void) NotifySpriteUpdated(int32 slot);
515 AGSIFUNC(
void) SetSpriteAlphaBlended(int32 slot, int32 isAlphaBlended);
517 AGSIFUNC(
void) QueueGameScriptFunction(
const char *name, int32 globalScript, int32 numArgs,
long arg1 = 0,
long arg2 = 0);
527 AGSIFUNC(
void *) GetManagedObjectAddressByKey(
int key);
529 AGSIFUNC(
int) GetManagedObjectKeyByAddress(
const char *address);
533 AGSIFUNC(
const char *) CreateScriptString(
const char *fromText);
537 AGSIFUNC(
int) IncrementManagedObjectRefCount(
const char *address);
539 AGSIFUNC(
int) DecrementManagedObjectRefCount(
const char *address);
541 AGSIFUNC(
void) SetMousePosition(int32 x, int32 y);
543 AGSIFUNC(
void) SimulateMouseClick(int32 button);
545 AGSIFUNC(
int) GetMovementPathWaypointCount(int32 pathId);
547 AGSIFUNC(
int) GetMovementPathLastWaypoint(int32 pathId);
549 AGSIFUNC(
void) GetMovementPathWaypointLocation(int32 pathId, int32 waypoint, int32 *x, int32 *y);
551 AGSIFUNC(
void) GetMovementPathWaypointSpeed(int32 pathId, int32 waypoint, int32 *xSpeed, int32 *ySpeed);
555 AGSIFUNC(
const char *) GetGraphicsDriverID();
559 AGSIFUNC(
int) IsRunningUnderDebugger();
561 AGSIFUNC(
void) BreakIntoDebugger();
563 AGSIFUNC(
void) GetPathToFileInCompiledFolder(
const char *fileName,
char *buffer);
566 #ifdef WINDOWS_VERSION 568 AGSIFUNC(LPDIRECTINPUTDEVICE) GetDirectInputKeyboard();
570 AGSIFUNC(LPDIRECTINPUTDEVICE) GetDirectInputMouse();
587 AGSIFUNC(
void) NotifyFontUpdated(
int fontNumber);
594 bool available =
false;
595 char *savedata =
nullptr;
596 int savedatasize = 0;
598 int invalidatedRegion = 0;
599 bool builtin =
false;
609 extern void PluginSimulateMouseClick(
int pluginButtonID);
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: plugin_base.h:171
Definition: ags_plugin.h:165
Definition: ags_plugin.h:84
Definition: ags_font_renderer.h:47
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_plugin.h:315
Definition: ags_font_renderer.h:29