22 #ifndef KYRA_SCRIPT_TIM_H 23 #define KYRA_SCRIPT_TIM_H 25 #include "kyra/kyra_v1.h" 27 #include "common/array.h" 28 #include "common/func.h" 29 #include "common/str.h" 60 uint8 cyclesCompleted;
73 void init(
int animIndex,
Movie *wsa,
int x,
int y,
int wsaCopyParams,
int frameDelay);
74 void reset(
int animIndex,
bool clearStruct);
76 void displayFrame(
int animIndex,
int page,
int frame,
int flags = -1);
78 const Movie *getWsaCPtr(
int animIndex) {
return (animIndex >= 0 && animIndex < 6) ? _animations[animIndex].wsa : 0; }
79 int getAnimX(
int animIndex) {
return (animIndex >= 0 && animIndex < 6) ? _animations[animIndex].x : 0; }
80 int getAnimY(
int animIndex) {
return (animIndex >= 0 && animIndex < 6) ? _animations[animIndex].y : 0; }
83 void setupPart(
int animIndex,
int part,
int firstFrame,
int lastFrame,
int cycles,
int nextPart,
int partDelay,
int f,
int sfxIndex,
int sfxFrame);
84 void start(
int animIndex,
int part);
85 void stop(
int animIndex);
86 void update(
int animIndex);
87 void playPart(
int animIndex,
int firstFrame,
int lastFrame,
int delay);
88 int resetLastPart(
int animIndex);
102 const bool _useParts;
111 uint16 clickedButton;
162 void unload(
TIM *&tim)
const;
166 virtual int initAnimStruct(
int index,
const char *filename,
int x,
int y,
int,
int offscreenBuffer, uint16 wsaFlags);
167 virtual int freeAnimStruct(
int index);
170 void setLangData(
const char *filename);
171 void clearLangData() {
delete[] _langData; _langData = 0; }
173 const char *getCTableEntry(uint idx)
const;
175 void resetFinishedFlag() { _finished =
false; }
176 bool finished()
const {
return _finished; }
178 int exec(
TIM *tim,
bool loop);
179 void stopCurFunc() {
if (_currentTim) cmd_stopCurFunc(0); }
180 void stopAllFuncs(
TIM *tim);
182 void refreshTimersAfterPause(uint32 elapsedTime);
184 void displayText(uint16 textId, int16 flags);
185 void displayText(uint16 textId, int16 flags, uint8 color);
186 void setupTextPalette(uint index,
int fadePalette);
188 virtual void resetDialogueState(
TIM *tim) {}
192 int _palDelayInc, _palDiff, _palDelayAcc;
209 const char *_filename;
214 virtual void update() {}
215 virtual void checkSpeechProgress() {}
217 char _audioFilename[32];
220 char *getTableEntry(uint idx);
222 uint8 *_textAreaBuffer;
224 virtual int execCommand(
int cmd,
const uint16 *param);
235 int cmd_initFunc0(
const uint16 *param);
236 int cmd_stopCurFunc(
const uint16 *param);
237 int cmd_initWSA(
const uint16 *param);
238 int cmd_uninitWSA(
const uint16 *param);
239 int cmd_initFunc(
const uint16 *param);
240 int cmd_stopFunc(
const uint16 *param);
241 int cmd_wsaDisplayFrame(
const uint16 *param);
242 int cmd_displayText(
const uint16 *param);
243 int cmd_loadVocFile(
const uint16 *param);
244 int cmd_unloadVocFile(
const uint16 *param);
245 int cmd_playVocFile(
const uint16 *param);
246 int cmd_loadSoundFile(
const uint16 *param);
247 int cmd_playMusicTrack(
const uint16 *param);
248 virtual int cmd_setLoopIp(
const uint16 *param);
249 virtual int cmd_continueLoop(
const uint16 *param);
250 int cmd_resetLoopIp(
const uint16 *param);
251 int cmd_resetAllRuntimes(
const uint16 *param);
252 int cmd_execOpcode(
const uint16 *param);
253 int cmd_initFuncNow(
const uint16 *param);
254 int cmd_stopFuncNow(
const uint16 *param);
255 #define cmd_return(n, v) \ 256 int cmd_return_##n(const uint16 *){ return v; } 267 TIMInterpreter_LoL(LoLEngine *engine,
Screen_v2 *screen_v2,
OSystem *system);
269 int initAnimStruct(
int index,
const char *filename,
int x,
int y,
int frameDelay,
int, uint16 wsaCopyParams)
override;
270 int freeAnimStruct(
int index)
override;
272 void resetDialogueState(
TIM *tim)
override;
275 void update()
override;
276 void checkSpeechProgress()
override;
278 const char *getTableString(
int id);
279 void advanceToOpcode(
int opcode);
284 int execCommand(
int cmd,
const uint16 *param)
override;
286 typedef int (TIMInterpreter_LoL::*CommandProc)(
const uint16 *);
295 int cmd_stopAllFuncs(
const uint16 *param);
296 int cmd_setLoopIp(
const uint16 *param)
override;
297 int cmd_continueLoop(
const uint16 *param)
override;
298 int cmd_processDialogue(
const uint16 *param);
299 int cmd_dialogueBox(
const uint16 *param);
Definition: script_tim.h:51
Definition: kyra_v1.h:126
Definition: script_tim.h:121
Definition: script_tim.h:227
Definition: script_tim.h:137
Definition: script_tim.h:156
Definition: wsamovie.h:31
Definition: detection.h:27
Definition: script_tim.h:108
Definition: script_tim.h:38
Definition: script_tim.h:40
Definition: screen_v2.h:30
Definition: iff_container.h:160