23 #ifndef M4_WSCRIPT_WS_MACHINE_H 24 #define M4_WSCRIPT_WS_MACHINE_H 26 #include "common/algorithm.h" 27 #include "m4/m4_types.h" 28 #include "m4/gui/gui.h" 32 #define DEAD_MACHINE_ID 0xdeaddead 80 typedef void (*MessageCB)(
frac16 myMessage,
struct machine *sender);
102 M4Rect *currLocation =
nullptr;
103 M4Rect *newLocation =
nullptr;
104 M4Rect *maxArea =
nullptr;
108 uint32 *streamSSHeader =
nullptr;
109 uint32 *streamSpriteSource =
nullptr;
110 void *myStream =
nullptr;
111 char *seriesName =
nullptr;
114 #define JSR_STACK_MAX 8 117 int32 eosReqOffset = 0;
118 int32 eosReqCount = 0;
119 Anim8 *next =
nullptr;
120 Anim8 *prev =
nullptr;
122 Anim8 *infront =
nullptr;
123 Anim8 *behind =
nullptr;
124 Anim8 *myParent =
nullptr;
126 MemHandle sequHandle =
nullptr;
128 CCB *myCCB =
nullptr;
130 MemHandle dataHandle =
nullptr;
131 int32 dataOffset = 0;
133 int32 switchTime = 0;
140 int32 numLocalVars = 0;
143 int32 returnStackIndex = 0;
144 uint32 returnHashes[JSR_STACK_MAX] = { 0 };
145 int32 returnOffsets[JSR_STACK_MAX] = { 0 };
148 Common::fill(returnHashes, returnHashes + JSR_STACK_MAX, 0);
149 Common::fill(returnOffsets, returnOffsets + JSR_STACK_MAX, 0);
158 char *machName =
nullptr;
159 MemHandle machHandle = 0;
160 int32 machInstrOffset = 0;
161 int32 stateTableOffset = 0;
163 int32 numOfStates = 0;
164 uint32 recurseLevel = 0;
165 Anim8 *myAnim8 =
nullptr;
166 Anim8 *parentAnim8 =
nullptr;
168 MemHandle dataHandle = 0;
169 int32 dataOffset = 0;
170 int32 targetCount = 0;
171 struct machine *msgReplyXM =
nullptr;
189 int32 _pauseTime = 0;
191 bool _enginesPaused =
false;
193 int32 *_dataFormats =
nullptr;
194 uint32 _machineIDCount = 0;
195 machine *_firstMachine =
nullptr;
201 frac16 *_ws_globals =
nullptr;
202 void *_addrExists =
nullptr;
205 bool ws_Initialize(
frac16 *theGlobals);
208 void unpauseEngines();
209 void addPauseTime(int32 myTime);
211 void cycleEngines(
Buffer *cleanBackground, int16 *depth_table,
Buffer *screenCodes,
212 uint8 *myPalette, uint8 *ICT,
bool updateVideo);
213 void ws_RefreshWoodscriptBuffer(
Buffer *cleanBackground, int16 *depth_table,
214 Buffer *screenCodes, uint8 *myPalette, uint8 *ICT);
216 void terminateMachine(
machine *m);
217 void terminateMachinesByHash(uint32 machHash);
218 void terminateMachineAndNull(
machine *&m);
219 bool verifyMachineExists(
machine *m);
220 int32 ws_KillMachines();
221 void ws_KillDeadMachines();
222 void ws_StepWhile(
machine *m, int32 pcOffset, int32 pcCount);
224 machine *TriggerMachineByHash(int32 myHash,
Anim8 *parentAnim8, int32 dataHash, int32 dataRow, MessageCB CintrMsg,
bool debug,
const char *machName);
225 machine *TriggerMachineByHash(int32 val1, int32 val2, int32 val3, int32 val4, int32 val5, int32 val6,
226 int32 x, int32 y, int32
scale, int32 layer,
bool flag,
227 MessageCB intrMsg,
const char *machName);
228 machine *TriggerMachineByHash(MessageCB intrMsg,
const char *machName);
234 uint32 machHash,
machine *sendM, int32 msgCount);
236 int32 trigger, int32 series2, int32 val6, int32 val7, int32 val8);
238 #define kernel_spawn_machine(name,hash,callback) TriggerMachineByHash(hash, nullptr, -1, -1, callback, false, name) 239 #define kernel_terminate_machine(m) terminateMachine(m) Definition: ws_machine.h:153
Definition: ws_machine.h:83
Definition: ws_machine.h:115
Definition: ws_machine.h:71
intptr frac16
Definition: m4_types.h:46
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
void debug(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: m4_types.h:67
Definition: database.h:28
Definition: ws_machine.h:179
Definition: ws_machine.h:188
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Definition: ws_machine.h:92
Definition: ws_machine.h:99
void sendWSMessage(uint32 msgHash, frac16 msgValue, machine *recvM, uint32 machHash, machine *sendM, int32 msgCount)