22 #ifndef AGS_PLUGINS_AGSFLASHLIGHT_AGSFLASHLIGHT_H 23 #define AGS_PLUGINS_AGSFLASHLIGHT_AGSFLASHLIGHT_H 25 #include "ags/plugins/ags_plugin.h" 26 #include "ags/plugins/serializer.h" 27 #include "ags/lib/allegro.h" 31 namespace AGSFlashlight {
40 int32 screen_width = 320;
41 int32 screen_height = 200;
42 int32 screen_color_depth = 16;
43 bool g_BitmapMustBeUpdated =
true;
47 int g_DarknessLightLevel = 100;
48 int g_BrightnessLightLevel = 100;
49 int g_DarknessSize = 0;
50 int g_DarknessDiameter = 0;
51 int g_BrightnessSize = 0;
52 int g_ScaleFactor = 1;
53 int32 g_FlashlightX = 0;
54 int32 g_FlashlightY = 0;
55 int32 g_FlashlightDrawAtX = 0;
56 int32 g_FlashlightDrawAtY = 0;
57 bool g_FlashlightFollowMouse =
false;
58 int g_FollowCharacterId = 0;
59 int g_FollowCharacterDx = 0;
60 int g_FollowCharacterDy = 0;
61 int g_FollowCharacterHorz = 0;
62 int g_FollowCharacterVert = 0;
64 BITMAP *g_LightBitmap =
nullptr;
65 uint32 flashlight_x = 0, flashlight_n = 0;
73 inline uint32 _blender_alpha16_bgr(uint32 y);
74 inline void calc_x_n(uint32 x);
75 inline void setPixel(
int x,
int y, uint32
color, uint32 *pixel);
76 void plotCircle(
int xm,
int ym,
int r, uint32 color);
77 void ClipToRange(
int &variable,
int min,
int max);
78 void AlphaBlendBitmap();
81 void CreateLightBitmap();
83 uint32 blendPixel(uint32 col,
bool isAlpha24,
int light);
117 const char *AGS_GetPluginName()
override;
118 void AGS_EngineStartup(
IAGSEngine *engine)
override;
119 int64 AGS_EngineOnEvent(
int event,
NumberPtr data)
override;
120 int AGS_PluginV2()
const override {
return 1; };
Definition: ags_plugin.h:132
Definition: serializer.h:32
Definition: plugin_base.h:171
Definition: plugin_base.h:131
Definition: ags_plugin.h:296
Definition: ags_flashlight.h:37