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/plugins/ags_plugin_evts.h" 39 #include "ags/engine/util/library_scummvm.h" 44 #ifndef DIRECTDRAW_VERSION 45 typedef void *LPDIRECTDRAW2;
46 typedef void *LPDIRECTDRAWSURFACE2;
49 #ifndef DIRECTSOUND_VERSION 50 typedef void *LPDIRECTSOUND;
53 #ifndef DIRECTINPUT_VERSION 54 typedef void *LPDIRECTINPUTDEVICE;
60 #if !defined(_WINDOWS_) 66 #define AGSIFUNC(type) virtual type 68 #define MASK_WALKABLE 1 69 #define MASK_WALKBEHIND 2 70 #define MASK_HOTSPOT 3 72 #define MASK_REGIONS 4 74 #define PLUGIN_FILENAME_MAX (49) 81 unsigned char r, g, b;
82 unsigned char padding;
88 int32 disabled_user_interface;
94 int32 inv_top, inv_numdisp, inv_numorder, inv_numinline;
96 int32 sierra_inv_color;
98 int32 inv_item_wid, inv_item_hit;
99 int32 speech_text_shadow;
100 int32 swap_portrait_side;
101 int32 speech_textwindow_gui;
102 int32 follow_change_room_timer;
105 int32 no_multiloop_repeat;
106 int32 roomscript_finished;
108 int32 no_textbg_when_voice;
109 int32 max_dialogoption_width;
110 int32 no_hicolor_fadein;
111 int32 bgspeech_game_speed;
112 int32 bgspeech_stay_on_display;
113 int32 unfactor_speech_from_textlength;
114 int32 mp3_loop_before_end;
115 int32 speech_music_drop;
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 136 int32 room = 0, prevroom = 0;
137 int32 x = 0, y = 0, wait = 0;
140 short followinfo = 0;
142 short idletime = 0, idleleft = 0;
143 short transparency = 0;
149 short walkspeed_y = 0, pic_yoffs = 0;
152 short loop = 0, frame = 0;
153 short walking = 0, animating = 0;
154 short walkspeed = 0, animspeed = 0;
156 short actx = 0, acty = 0;
163 #define OBJF_NOINTERACT 0x01 // not clickable 164 #define OBJF_NOWALKBEHINDS 0x02 // ignore walk-behinds 168 int32 transparent = 0;
172 short view = 0, loop = 0, frame = 0;
173 short wait = 0, moving = 0;
175 int8 overall_speed = 0;
181 #define FRAF_MIRRORED 1 // flipped left to right 185 short xoffs = 0, yoffs = 0;
189 int32 reserved_for_future[2];
193 #define MCF_ANIMATEMOVE 1 194 #define MCF_DISABLED 2 195 #define MCF_STANDARD 4 196 #define MCF_ONLYANIMOVERHOTSPOT 8 200 short hotx = 0, hoty = 0;
216 AGSIFUNC(HWND) GetEditorHandle();
218 AGSIFUNC(HWND) GetWindowHandle();
220 AGSIFUNC(
void) RegisterScriptHeader(
const char *header);
222 AGSIFUNC(
void) UnregisterScriptHeader(
const char *header);
226 #define FNT_INVALID 0 232 #define PSND_MP3STREAM 2 233 #define PSND_MP3STATIC 3 234 #define PSND_OGGSTREAM 4 235 #define PSND_OGGSTATIC 5 244 virtual int Dispose(
void *address,
bool force) = 0;
246 virtual const char *GetType() = 0;
249 virtual int Serialize(
void *address,
char *buffer,
int bufsize) = 0;
259 virtual void Unserialize(
int key,
const char *serializedData,
int dataSize) = 0;
268 float WorldMatrix[16];
269 float ViewMatrix[16];
270 float ProjMatrix[16];
305 AGSIFUNC(
void) AbortGame(
const char *reason);
307 AGSIFUNC(
const char *) GetEngineVersion();
309 AGSIFUNC(
void) RegisterScriptFunction(
const char *name,
311 AGSIFUNC(
void) RegisterBuiltInFunction(
const char *name,
313 #ifdef WINDOWS_VERSION 315 AGSIFUNC(HWND) GetWindowHandle();
317 AGSIFUNC(LPDIRECTDRAW2) GetDirectDraw2();
319 AGSIFUNC(LPDIRECTDRAWSURFACE2) GetBitmapSurface(
BITMAP *);
322 AGSIFUNC(
BITMAP *) GetScreen();
326 AGSIFUNC(
void) RequestEventHook(int32 event);
328 AGSIFUNC(
int) GetSavedData(
char *buffer, int32 bufsize);
332 AGSIFUNC(
BITMAP *) GetVirtualScreen();
334 AGSIFUNC(
void) DrawText(int32 x, int32 y, int32 font, int32
color,
const char *text);
336 AGSIFUNC(
void) GetScreenDimensions(int32 *width, int32 *height, int32 *coldepth);
338 AGSIFUNC(
int) GetBitmapPitch(
BITMAP *);
340 AGSIFUNC(uint8 *) GetRawBitmapSurface(
BITMAP *);
342 AGSIFUNC(
void) ReleaseBitmapSurface(
BITMAP *);
344 AGSIFUNC(
void) GetMousePosition(int32 *x, int32 *y);
348 AGSIFUNC(
int) GetCurrentRoom();
350 AGSIFUNC(
int) GetNumBackgrounds();
352 AGSIFUNC(
int) GetCurrentBackground();
354 AGSIFUNC(
BITMAP *) GetBackgroundScene(int32);
356 AGSIFUNC(
void) GetBitmapDimensions(
BITMAP *bmp, int32 *width, int32 *height, int32 *coldepth);
360 AGSIFUNC(
int) FWrite(
void *, int32, int32);
362 AGSIFUNC(
int) FRead(
void *, int32, int32);
364 AGSIFUNC(
bool)FSeek(soff_t offset,
int origin, int32 handle);
366 AGSIFUNC(
void) DrawTextWrapped(int32 x, int32 y, int32 width, int32 font, int32 color,
const char *text);
368 AGSIFUNC(
void) SetVirtualScreen(
BITMAP *);
370 AGSIFUNC(
int) LookupParserWord(
const char *word);
372 AGSIFUNC(
void) BlitBitmap(int32 x, int32 y,
BITMAP *, int32 masked);
374 AGSIFUNC(
void) PollSystem();
378 AGSIFUNC(
int) GetNumCharacters();
386 AGSIFUNC(
void) SetPalette(int32 start, int32 finish,
AGSColor *);
390 AGSIFUNC(
int) GetPlayerCharacter();
392 AGSIFUNC(
void) RoomToViewport(int32 *x, int32 *y);
394 AGSIFUNC(
void) ViewportToRoom(int32 *x, int32 *y);
396 AGSIFUNC(
int) GetNumObjects();
400 AGSIFUNC(
BITMAP *) GetSpriteGraphic(int32);
402 AGSIFUNC(
BITMAP *) CreateBlankBitmap(int32 width, int32 height, int32 coldep);
404 AGSIFUNC(
void) FreeBitmap(
BITMAP *);
408 AGSIFUNC(
BITMAP *) GetRoomMask(int32);
412 AGSIFUNC(
AGSViewFrame *) GetViewFrame(int32 view, int32 loop, int32 frame);
414 AGSIFUNC(
int) GetWalkbehindBaseline(int32 walkbehind);
418 AGSIFUNC(
int) GetBitmapTransparentColor(
BITMAP *);
420 AGSIFUNC(
int) GetAreaScaling(int32 x, int32 y);
422 AGSIFUNC(
int) IsGamePaused();
426 AGSIFUNC(
int) GetRawPixelColor(int32 color);
430 AGSIFUNC(
int) GetSpriteWidth(int32);
431 AGSIFUNC(
int) GetSpriteHeight(int32);
433 AGSIFUNC(
void) GetTextExtent(int32 font,
const char *text, int32 *width, int32 *height);
435 AGSIFUNC(
void) PrintDebugConsole(
const char *text);
437 AGSIFUNC(
void) PlaySoundChannel(int32 channel, int32 soundType, int32 volume, int32 loop,
const char *filename);
439 AGSIFUNC(
int) IsChannelPlaying(int32 channel);
443 AGSIFUNC(
void) MarkRegionDirty(int32 left, int32 top, int32 right, int32 bottom);
447 AGSIFUNC(
void) GetRawColorComponents(int32 coldepth, int32 color, int32 *red, int32 *green, int32 *blue, int32 *alpha);
449 AGSIFUNC(
int) MakeRawColorPixel(int32 coldepth, int32 red, int32 green, int32 blue, int32 alpha);
451 AGSIFUNC(
int) GetFontType(int32 fontNum);
453 AGSIFUNC(
int) CreateDynamicSprite(int32 coldepth, int32 width, int32 height);
455 AGSIFUNC(
void) DeleteDynamicSprite(int32 slot);
457 AGSIFUNC(
int) IsSpriteAlphaBlended(int32 slot);
461 AGSIFUNC(
void) UnrequestEventHook(int32 event);
463 AGSIFUNC(
void) BlitSpriteTranslucent(int32 x, int32 y,
BITMAP *, int32 trans);
465 AGSIFUNC(
void) BlitSpriteRotated(int32 x, int32 y,
BITMAP *, int32 angle);
468 #ifdef WINDOWS_VERSION 470 AGSIFUNC(LPDIRECTSOUND) GetDirectSound();
473 AGSIFUNC(
void) DisableSound();
475 AGSIFUNC(
int) CanRunScriptFunctionNow();
477 AGSIFUNC(
int) CallGameScriptFunction(
const char *name, int32 globalScript, int32 numArgs,
long arg1 = 0,
long arg2 = 0,
long arg3 = 0);
481 AGSIFUNC(
void) NotifySpriteUpdated(int32 slot);
483 AGSIFUNC(
void) SetSpriteAlphaBlended(int32 slot, int32 isAlphaBlended);
485 AGSIFUNC(
void) QueueGameScriptFunction(
const char *name, int32 globalScript, int32 numArgs,
long arg1 = 0,
long arg2 = 0);
495 AGSIFUNC(
void *) GetManagedObjectAddressByKey(
int key);
497 AGSIFUNC(
int) GetManagedObjectKeyByAddress(
void *address);
501 AGSIFUNC(
const char *) CreateScriptString(
const char *fromText);
505 AGSIFUNC(
int) IncrementManagedObjectRefCount(
void *address);
507 AGSIFUNC(
int) DecrementManagedObjectRefCount(
void *address);
509 AGSIFUNC(
void) SetMousePosition(int32 x, int32 y);
511 AGSIFUNC(
void) SimulateMouseClick(int32 button);
513 AGSIFUNC(
int) GetMovementPathWaypointCount(int32 pathId);
515 AGSIFUNC(
int) GetMovementPathLastWaypoint(int32 pathId);
517 AGSIFUNC(
void) GetMovementPathWaypointLocation(int32 pathId, int32 waypoint, int32 *x, int32 *y);
519 AGSIFUNC(
void) GetMovementPathWaypointSpeed(int32 pathId, int32 waypoint, int32 *xSpeed, int32 *ySpeed);
523 AGSIFUNC(
const char *) GetGraphicsDriverID();
527 AGSIFUNC(
int) IsRunningUnderDebugger();
529 AGSIFUNC(
void) BreakIntoDebugger();
531 AGSIFUNC(
void) GetPathToFileInCompiledFolder(
const char *fileName,
char *buffer);
534 #ifdef WINDOWS_VERSION 536 AGSIFUNC(LPDIRECTINPUTDEVICE) GetDirectInputKeyboard();
538 AGSIFUNC(LPDIRECTINPUTDEVICE) GetDirectInputMouse();
555 AGSIFUNC(
void) NotifyFontUpdated(
int fontNumber);
559 AGSIFUNC(
const char *) ResolveFilePath(
const char *script_path);
566 bool available =
false;
569 int invalidatedRegion = 0;
570 bool builtin =
false;
580 extern void PluginSimulateMouseClick(
int pluginButtonID);
Definition: ags_plugin.h:257
Definition: ags_plugin.h:132
Definition: ags_plugin.h:267
Definition: ags_plugin.h:239
Definition: ags_plugin.h:207
Definition: ags_plugin.h:274
Definition: library_scummvm.h:35
Definition: ags_plugin.h:198
Definition: ags_plugin.h:562
Definition: plugin_base.h:171
Definition: ags_plugin.h:166
Definition: ags_plugin.h:85
Definition: ags_font_renderer.h:51
Definition: ags_plugin.h:296
Definition: ags_plugin.h:80
Definition: plugin_base.h:151
Definition: ags_plugin.h:183
Definition: plugin_base.h:189
Definition: ags_plugin.h:283
Definition: ags_font_renderer.h:33