22 #ifndef DRASCULA_DRASCULA_H 23 #define DRASCULA_DRASCULA_H 25 #include "common/scummsys.h" 26 #include "common/archive.h" 27 #include "common/endian.h" 28 #include "common/events.h" 29 #include "common/file.h" 30 #include "common/hash-str.h" 31 #include "common/keyboard.h" 32 #include "common/ptr.h" 33 #include "common/random.h" 34 #include "common/savefile.h" 35 #include "common/system.h" 36 #include "common/util.h" 37 #include "common/text-to-speech.h" 39 #include "engines/savestate.h" 41 #include "drascula/console.h" 42 #include "drascula/detection.h" 44 #include "audio/mixer.h" 46 #include "engines/engine.h" 58 #define DRASCULA_DAT_VER 7 59 #define DATAALIGNMENT 4 61 enum DRASCULAActions {
72 kActionVolumeControls,
74 kActionSubtitlesEnable,
75 kActionSubtitlesDisable,
103 enum InventoryItems {
113 kItemCigarettes = 16,
120 kItemEarWithEarPlug = 23,
125 enum InventoryItems2 {
137 kColorLightGreen = 3,
158 enum IgorTalkerTypes {
166 enum VonBraunTalkerTypes {
171 enum AnimFrameTypes {
182 enum DialogOptionStatus {
183 kDialogOptionUnselected = 1,
184 kDialogOptionSelected = 2,
185 kDialogOptionClicked = 3
188 enum TalkSequenceCommands {
199 kTrackProtagonist = 10,
206 kTalkerVBNormal = 17,
208 kTalkerIgorSeated = 19,
209 kTalkerWerewolf = 20,
211 kTalkerDrascula = 22,
212 kTalkerBartender0 = 23,
213 kTalkerBartender1 = 24
216 enum CharacterDirections {
224 kCursorCrosshair = 0,
225 kCursorCurrentItem = 1
240 #define TEXTD_START 68 280 void enableFallback(
bool val) { _fallBack = val; }
282 void registerArchive(
const Common::Path &filename,
int priority);
294 void getLine(
char *buf);
299 void parseInt(
int &result);
300 void parseString(
char *result);
310 #define DIF_MASK_HARE 72 311 #define DIF_MASK_ABC 22 313 #define CHAR_HEIGHT 6 315 #define TALK_HEIGHT 25 316 #define TALK_WIDTH 23 319 #define CHARACTER_HEIGHT 70 320 #define CHARACTER_WIDTH 43 321 #define FEET_HEIGHT 12 323 #define CHAR_WIDTH_OPC 6 324 #define CHAR_HEIGHT_OPC 5 327 #define COMPLETE_PAL 256 330 #define KEYBUFSIZE 16 331 #define ACTIONBUFSIZE 16 333 static const int interf_x[] = { 1, 65, 129, 193, 1, 65, 129 };
334 static const int interf_y[] = { 51, 51, 51, 51, 83, 83, 83 };
348 void syncSoundSettings()
override;
357 uint32 getFeatures()
const;
369 void loadPic(
int roomNum, byte *targetSurface,
int colorCount = 1) {
372 loadPic(rm, targetSurface, colorCount);
375 void loadPic(
const char *NamePcc, byte *targetSurface,
int colorCount = 1);
377 typedef signed char DacPalette256[256][3];
379 void setRGB(byte *pal,
int plt);
380 void assignPalette(DacPalette256 pal);
381 void setDefaultPalette(DacPalette256 pal);
382 void setPalette(byte *PalBuf);
383 void copyBackground(
int xorg,
int yorg,
int xdes,
int ydes,
int width,
384 int height, byte *src, byte *dest);
386 void copyBackground() {
387 copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
390 void copyRect(
int xorg,
int yorg,
int xdes,
int ydes,
int width,
391 int height, byte *src, byte *dest);
392 void updateScreen() {
393 updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
395 void updateScreen(
int xorg,
int yorg,
int xdes,
int ydes,
int width,
int height, byte *buffer);
396 int checkWrapX(
int x) {
398 if (x > 319) x -= 320;
401 int checkWrapY(
int y) {
403 if (y > 199) y -= 200;
407 DacPalette256 gamePalette;
408 DacPalette256 defaultPalette;
409 DacPalette256 brightPalette;
410 DacPalette256 darkPalette;
412 byte *crosshairCursor;
432 int previousMusic, roomMusic;
435 char currentData[20];
437 char menuBackground[20];
439 char objName[30][20];
440 char iconName[44][13];
442 int objectNum[40], visible[40], isDoor[40];
445 int inventoryObjects[43];
446 int _doorDestRoom[40];
448 int trackCharacter_alkeva[40], _roomExitId[40];
450 int takeObject, pickedObject;
451 bool _subtitlesDisabled;
452 bool _menuBar, _menuScreen, _hasName;
457 int flags[NUM_FLAGS];
460 int curX, curY, curDirection, trackProtagonist, _characterFrame;
461 bool _characterMoved, _characterVisible;
462 int roomX, roomY, checkFlags;
465 int curHeight, curWidth, feetHeight;
467 int lowerLimit, upperLimit;
475 int vonBraunX, trackVonBraun, vonBraunHasMoved;
476 float newHeight, newWidth;
480 int igorX, igorY, trackIgor;
481 int drasculaX, drasculaY, trackDrascula;
484 bool _loadedDifferentChapter;
485 int _currentSaveSlot;
489 int _mouseX, _mouseY, _leftMouseButton, _rightMouseButton;
490 bool _leftMouseButtonHeld;
497 int _actionBufferHead;
498 int _actionBufferTail;
500 bool loadDrasculaDat();
502 bool runCurrentChapter();
504 void pickObject(
int);
508 void placeVonBraun(
int pointX);
509 void hipo_sin_nadie(
int counter);
510 void toggleDoor(
int nflag,
int doorNum,
int action);
518 void selectVerbFromBar();
521 Common::KeyCode getScan();
523 void flushKeyBuffer();
526 void flushActionBuffer();
527 void selectVerb(
int);
528 int updateVolume(
int prevVolume,
int prevVolumeY);
529 void volumeControls();
531 bool saveLoadScreen();
532 bool scummVMSaveLoadDialog(
bool isSave);
534 void loadSaveNames();
536 bool loadGame(
int slot);
537 void checkForOldSaveGames();
540 void print_abc(
const char *,
int,
int);
544 void chooseObject(
int object);
546 int removeObject(
int osj);
547 void playFLI(
const char *filefli,
int vel);
548 void fadeFromBlack(
int fadeSpeed);
549 void fadeToBlack(
int fadeSpeed);
550 signed char adjustToVGA(
signed char value);
551 void color_abc(
int cl);
552 bool textFitsCentered(
char *text,
int x);
553 void centerText(
const char *,
int,
int);
554 void playSound(
int soundNum);
555 bool animate(
const char *animation,
int FPS);
558 void placeDrascula();
560 void talkInit(
const char *filename);
561 bool isTalkFinished();
562 void talk_igor(
int,
int);
563 void talk_drascula(
int index,
int talkerType = 0);
564 void talk_solo(
const char *,
const char *);
565 void talk_bartender(
int,
int talkerType = 0);
566 void talk_pen(
const char *,
const char *,
int);
567 void talk_bj_bed(
int);
570 void talk_trunk(
int);
572 void talk(
const char *,
const char *);
573 void talk_sync(
const char *,
const char *,
const char *);
574 void talk_drunk(
int);
575 void talk_pianist(
int);
576 void talk_werewolf(
int);
578 void talk_drascula_big(
int);
579 void talk_vonBraun(
int,
int);
580 void talk_blind(
int);
581 void talk_hacker(
int);
582 void talk_generic(
const char* said,
const char* filename,
int* faces,
int faceCount,
int* coords, byte* surface);
587 void playMusic(
int p);
592 void updateDoor(
int);
593 void setPaletteBase(
int darkness);
594 void updateVisible();
596 void updateRefresh();
597 void updateRefresh_pre();
598 void moveCharacters();
604 bool checkAction(
int);
605 void setCursor(
int cursor);
608 bool isCursorVisible();
609 bool soundIsActive();
611 void mixVideo(byte *OldScreen, byte *NewScreen, uint16 oldPitch);
612 void decodeRLE(byte *BufferRLE, byte *MiVideoRLE, uint16 pitch = 320);
613 void decodeOffset(byte *BufferOFF, byte *MiVideoOFF,
int length);
624 void reduce_hare_chico(
int,
int,
int,
int,
int,
int,
int, byte *, byte *);
629 void increaseFrameNum();
631 bool checkMenuFlags();
632 void setupRoomsTable();
633 void freeRoomsTable();
634 bool roomParse(
int,
int);
635 void cleanupString(
char *
string);
636 void playTalkSequence(
int sequence);
639 int print_abc_opc(
const char *,
int,
int);
641 void activatePendulum();
644 void playFile(
const char *fname);
647 void updateAnim(
int y,
int destX,
int destY,
int width,
int height,
int count, byte* src,
int delayVal = 3,
bool copyRectangle =
false);
649 bool room(
int rN,
int fl);
691 void animation_1_1();
692 void animation_2_1();
693 void animation_3_1();
694 void animation_4_1();
696 void animation_2_2();
697 void animation_4_2();
698 void animation_5_2();
699 void animation_6_2();
700 void animation_7_2();
701 void animation_11_2();
702 void animation_12_2();
703 void animation_13_2();
704 void animation_14_2();
705 void animation_16_2();
706 void animation_20_2();
707 void animation_23_2();
708 void animation_24_2();
709 void animation_25_2();
710 void animation_26_2();
711 void animation_27_2();
712 void animation_29_2();
713 void animation_31_2();
714 void animation_34_2();
715 void animation_35_2();
716 void animation_36_2();
718 void animation_2_3();
719 void animation_6_3();
721 void animation_castle();
722 void animation_1_4();
723 void animation_5_4();
724 void animation_6_4();
725 void animation_7_4();
726 void animation_8_4();
728 void animation_1_5();
729 void animation_5_5();
730 void animation_12_5();
731 void animation_12_5_frankenstein();
732 void animation_14_5();
734 void animation_1_6();
735 void animation_5_6();
736 void animation_6_6();
737 void animation_9_6();
738 void animation_19_6();
746 void update_14_pre();
748 void update_16_pre();
749 void update_18_pre();
750 void update_23_pre();
751 void update_26_pre();
753 void update_35_pre();
755 void update_58_pre();
756 void update_59_pre();
757 void update_60_pre();
760 void update_62_pre();
763 void sayText(
const Common::String &text, Common::TextToSpeechManager::Action action);
771 int _itemLocationsSize;
779 int _roomPreUpdatesSize;
780 int _roomUpdatesSize;
781 int _roomActionsSize;
782 int _talkSequencesSize;
803 int *_x1d_menu, *_y1d_menu;
805 int *_candleX, *_candleY;
806 int *_pianistX, *_drunkX;
812 Common::CodePage _ttsTextEncoding;
815 void freeTexts(
char **ptr);
818 RoomHandlers *_roomHandlers;
Definition: drascula.h:244
EngineFeature
Definition: engine.h:260
Definition: drascula.h:233
Definition: drascula.h:252
uint32 CustomEventType
Definition: events.h:204
Definition: drascula.h:290
int sprintf_s(char *dst, size_t size, MSVC_PRINTF const char *format,...) GCC_PRINTF(3
Definition: drascula.h:338
Definition: archive.h:330
Definition: drascula.h:265
Definition: keyboard.h:294
Definition: detection.h:33
Definition: drascula.h:270
Definition: drascula.h:276
Language
Definition: language.h:45