2020-11-01 16:45:29 +01:00
|
|
|
#pragma once
|
|
|
|
#include "TPinballComponent.h"
|
2021-01-01 14:14:11 +01:00
|
|
|
|
|
|
|
struct gdrv_bitmap8;
|
|
|
|
|
2021-01-29 14:42:05 +01:00
|
|
|
struct TLight_player_backup
|
2021-01-01 14:14:11 +01:00
|
|
|
{
|
|
|
|
int MessageField;
|
2022-08-24 12:32:35 +02:00
|
|
|
bool LightOnFlag;
|
|
|
|
int LightOnBmpIndex;
|
|
|
|
bool FlasherOnFlag;
|
2021-01-01 14:14:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-11-01 16:45:29 +01:00
|
|
|
class TLight :
|
2022-09-06 15:57:56 +02:00
|
|
|
public TPinballComponent
|
2020-11-01 16:45:29 +01:00
|
|
|
{
|
|
|
|
public:
|
2021-01-01 14:14:11 +01:00
|
|
|
TLight(TPinballTable* table, int groupIndex);
|
2022-09-06 15:57:56 +02:00
|
|
|
int Message(MessageCode code, float value) override;
|
2021-01-01 14:14:11 +01:00
|
|
|
void Reset();
|
|
|
|
void schedule_timeout(float time);
|
2022-08-24 12:32:35 +02:00
|
|
|
void flasher_stop(int bmpIndex);
|
|
|
|
void flasher_start(bool bmpIndex);
|
|
|
|
void SetSpriteBmp(gdrv_bitmap8* bmp);
|
2021-01-01 14:14:11 +01:00
|
|
|
|
|
|
|
static void TimerExpired(int timerId, void* caller);
|
|
|
|
static void flasher_callback(int timerId, void* caller);
|
2022-08-24 12:32:35 +02:00
|
|
|
static void UndoTmpOverride(int timerId, void* caller);
|
2020-11-01 16:45:29 +01:00
|
|
|
|
2022-08-24 12:32:35 +02:00
|
|
|
gdrv_bitmap8* BmpArr[2];
|
|
|
|
float FlashDelay[2];
|
|
|
|
int FlashTimer;
|
|
|
|
bool FlashLightOnFlag;
|
|
|
|
bool LightOnFlag{};
|
|
|
|
bool FlasherOnFlag;
|
|
|
|
bool ToggledOffFlag{};
|
|
|
|
bool ToggledOnFlag{};
|
|
|
|
bool TurnOffAfterFlashingFg{};
|
|
|
|
int LightOnBmpIndex{};
|
|
|
|
float SourceDelay[2]{};
|
|
|
|
int TimeoutTimer;
|
|
|
|
int UndoOverrideTimer;
|
|
|
|
bool TemporaryOverrideFlag{};
|
|
|
|
gdrv_bitmap8* PreviousBitmap{};
|
2021-10-02 17:58:54 +02:00
|
|
|
TLight_player_backup PlayerData[4]{};
|
2021-01-01 14:14:11 +01:00
|
|
|
};
|