22 #ifndef DREAMWEB_DREAMWEB_H 23 #define DREAMWEB_DREAMWEB_H 25 #include "common/error.h" 26 #include "common/keyboard.h" 27 #include "common/random.h" 28 #include "common/rect.h" 29 #include "common/scummsys.h" 30 #include "common/system.h" 32 #include "engines/engine.h" 34 #include "graphics/surface.h" 36 #include "dreamweb/console.h" 38 #include "dreamweb/structs.h" 40 #define SCUMMVM_HEADER MKTAG('S', 'C', 'V', 'M') 41 #define SCUMMVM_BLOCK_MAGIC_SIZE 0x1234 42 #define SAVEGAME_VERSION 1 50 const unsigned int kNumReelRoutines = 57;
51 const unsigned int kUnderTextSizeX = 180;
52 const unsigned int kUnderTextSizeY = 10;
53 const unsigned int kUnderTimedTextSizeY = 24;
54 const unsigned int kUnderTextSizeX_f = 228;
55 const unsigned int kUnderTextSizeY_f = 13;
56 const unsigned int kUnderTimedTextSizeY_f = 30;
57 const unsigned int kUnderTextBufSize = kUnderTextSizeX_f * kUnderTextSizeY_f;
58 const unsigned int kUnderTimedTextBufSize = 256 * kUnderTimedTextSizeY_f;
59 const unsigned int kLengthOfVars = 68;
60 const unsigned int kNumChanges = 250;
61 const unsigned int kLenOfMapStore = 22*8*20*8;
62 const unsigned int kMapWidth = 66;
63 const unsigned int kMapHeight = 60;
64 const unsigned int kLengthOfMap = kMapWidth * kMapHeight;
65 const unsigned int kNumExObjects = 114;
66 const unsigned int kScreenwidth = 320;
67 const unsigned int kScreenheight = 200;
68 const unsigned int kDiaryx = (68+24);
69 const unsigned int kDiaryy = (48+12);
70 const unsigned int kInventx = 80;
71 const unsigned int kInventy = 58;
72 const unsigned int kMenux = (80+40);
73 const unsigned int kMenuy = 60;
74 const unsigned int kOpsx = 60;
75 const unsigned int kOpsy = 52;
76 const unsigned int kSymbolx = 64;
77 const unsigned int kSymboly = 56;
78 const unsigned int kLengthofvars = 68;
79 const unsigned int kFrameBlocksize = 2080;
80 const unsigned int kGraphicsFileFrameSize = 347;
81 const unsigned int kNumexobjects = 114;
82 const unsigned int kNumExTexts = kNumexobjects + 2;
83 const uint16 kExtextlen = 18000;
84 const uint16 kExframeslen = 30000;
85 const unsigned int kLengthofextra = kFrameBlocksize + kExframeslen +
sizeof(DynObject)*kNumexobjects +
sizeof(uint16)*kNumExTexts + kExtextlen;
86 const unsigned int kItempicsize = 44;
87 const unsigned int kNumSetTexts = 130;
88 const unsigned int kNumBlockTexts = 98;
89 const unsigned int kNumRoomTexts = 38;
90 const unsigned int kNumFreeTexts = 82;
91 const unsigned int kNumPersonTexts = 1026;
95 kDebugAnimation = (1 << 0),
96 kDebugSaveLoad = (1 << 1)
99 struct DreamWebGameDescription;
105 uint32 _vSyncPrevTick;
111 void pauseEngineIntern(
bool pause)
override;
122 uint8 randomNumber() {
return _rnd.getRandomNumber(255); }
124 void mouseCall(uint16 *x, uint16 *y, uint16 *state);
125 void processEvents(
bool processSoundEvents =
true);
126 void blit(
const uint8 *src,
int pitch,
int x,
int y,
int w,
int h);
131 void getPalette(uint8 *data, uint start, uint count);
132 void setPalette(
const uint8 *data, uint start, uint count);
136 void setShakePos(
int pos) { _system->setShakePos(0, pos); }
137 void printUnderMonitor();
142 uint8 modifyChar(uint8 c)
const;
145 const Common::String& getDatafilePrefix() {
return _datafilePrefix; }
146 const Common::Path& getSpeechDirName() {
return _speechDirName; }
151 uint8 _keyBuffer[16];
155 void keyPressed(uint16 ascii);
156 void setSpeed(uint speed);
172 uint8 *_backdropBlocks;
174 uint8 _mapData[kLengthOfMap + 32];
179 uint16 _pressPointer;
196 char _currentFile[14];
199 uint8 _roomsCanGo[16];
202 uint16 _openChangeSize;
209 char _saveNames[17*21];
210 char _saveNamesOld[17*21];
213 uint8 _workspace[(0x1000 + 2) * 16];
214 uint8 _mapStore[kLenOfMapStore + 32];
221 uint8 _textUnder[kUnderTextBufSize];
224 uint8 _pointerBack[32*32];
226 uint8 _startPal[3*256];
227 uint8 _endPal[3*256];
228 uint8 _mainPal[3*256];
234 uint8 _zoomSpace[46*40];
235 Change _listOfChanges[kNumChanges];
236 uint8 _underTimedText[kUnderTimedTextBufSize];
284 uint16 _personFramesLE[12];
298 bool _foreignRelease;
311 bool _copyProtection;
315 uint16 _textAddressX;
316 uint16 _textAddressY;
344 uint8 _manIsOffScreen;
346 uint8 _leaveDirection;
348 uint8 _turnDirection;
400 uint8 _needToDumpTimed;
403 uint8 _loadingOrSave;
408 uint8 _fadeDirection;
414 uint16 _lastSoundReel;
415 Common::KeyCode _lastHardKey;
418 uint8 _reAssesChanges;
421 uint8 _pointerFirstPath;
429 uint8 _lineDirection;
434 Common::CodePage _textEncoding;
438 uint8 getXAd(
const uint8 *setData, uint8 *result);
439 uint8 getYAd(
const uint8 *setData, uint8 *result);
440 uint8 getMapAd(
const uint8 *setData, uint16 *x, uint16 *y);
441 void calcFrFrame(
const Frame &frame, uint8* width, uint8* height, uint16 x, uint16 y,
ObjPos *objPos);
442 void makeBackOb(
SetObject *objData, uint16 x, uint16 y);
444 void getDimension(uint8 *mapXstart, uint8 *mapYstart, uint8 *mapXsize, uint8 *mapYsize);
453 void singleKey(uint8 key, uint16 x, uint16 y);
456 bool isItRight(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
457 void addToPressList();
469 void buttonPress(uint8 buttonId);
474 void enterCode(uint8 digit0, uint8 digit1, uint8 digit2, uint8 digit3);
478 byte makeCaps(byte c);
480 void monMessage(uint8 index);
483 void randomAccess(uint16 count);
484 void printOuterMon();
485 void showCurrentFile();
486 void accessLightOn();
487 void accessLightOff();
490 void powerLightOff();
492 void scrollMonitor();
493 const char *monPrint(
const char *
string);
500 const char *parser();
501 const char *searchForString(
const char *topic,
const char *text);
502 const char *getKeyAndLogo(
const char *foundString);
504 void dirFile(
const char *dirName);
508 int findCommand(
const char *
const cmdList[]);
511 void getUnderCenter();
512 void putUnderCenter();
514 uint8 getLocation(uint8 index);
515 void setLocation(uint8 index);
516 void clearLocation(uint8 index);
517 void resetLocation(uint8 index);
522 void selectLocation();
533 void obToInv(uint8 index, uint8 flag, uint16 x, uint16 y);
535 void removeObFromInv();
536 void deleteExObject(uint8 index);
537 void deleteExFrame(uint16 frameNum);
538 void deleteExText(uint8 textNum);
539 void purgeALocation(uint8 index);
540 const uint8 *getObTextStart();
545 byte getOpenedSlotSize();
546 byte getOpenedSlotCount();
553 void transferText(uint8 from, uint8 to);
554 void pickupConts(uint8 from, uint8 containerEx);
555 byte transferToEx(uint8 from);
560 bool checkObjectSize();
564 void examineOb(
bool examineAgain =
true);
570 void turnPathOn(uint8 param);
571 void turnPathOff(uint8 param);
572 void turnAnyPathOn(uint8 param, uint8 room);
573 void turnAnyPathOff(uint8 param, uint8 room);
578 void checkDest(
const RoomPaths *roomsPaths);
579 void findXYFromPath();
580 bool checkIfPathIsOn(uint8 index);
582 void workoutFrames();
583 byte findFirstPath(byte x, byte y);
584 byte findPathOfPoint(byte x, byte y);
587 void setupInitialReelRoutines();
643 uint8 getNextWord(
const GraphicsFile &charSet,
const uint8 *
string, uint8 *totalWidth, uint8 *charCount);
644 void printChar(
const GraphicsFile &charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height,
bool kerning =
false);
645 void printChar(
const GraphicsFile &charSet, uint16 x, uint16 y, uint8 c, uint8 nextChar, uint8 *width, uint8 *height);
646 void printBoth(
const GraphicsFile &charSet, uint16 *x, uint16 y, uint8 c, uint8 nextChar);
647 uint8 printDirect(
const uint8**
string, uint16 x, uint16 *y, uint8 maxWidth,
bool centered,
bool kerning =
false);
648 uint8 printDirect(
const uint8*
string, uint16 x, uint16 y, uint8 maxWidth,
bool centered);
649 uint8 getNumber(
const GraphicsFile &charSet,
const uint8 *
string, uint16 maxWidth,
bool centered, uint16 *offset);
650 uint8 kernChars(uint8 firstChar, uint8 secondChar, uint8 width);
651 uint8 printSlow(
const uint8 *
string, uint16 x, uint16 y, uint8 maxWidth,
bool centered);
655 void rollEndCreditsGameWon();
656 void rollEndCreditsGameLost();
660 void doLoad(
int slot);
671 void loadPosition(
unsigned int slot);
672 void savePosition(
unsigned int slot,
const char *descbuf);
675 void showDecisions();
679 void selectSaveLoadPage();
688 void printASprite(
const Sprite *sprite);
690 Sprite *makeSprite(uint8 x, uint8 y,
bool _mainManCallback,
const GraphicsFile *frameData);
692 void walking(
Sprite *sprite);
693 void aboutTurn(
Sprite *sprite);
694 void backObject(
Sprite *sprite);
704 Reel *getReelStart(uint16 reelPointer);
706 void showReelFrame(
Reel *reel);
708 const Frame *getReelFrameAX(uint16 frame);
709 void moveMap(uint8 param);
710 void checkOne(uint8 x, uint8 y, uint8 *flag, uint8 *flagEx, uint8 *type, uint8 *flagX, uint8 *flagY);
712 uint8 getBlockOfPixel(uint8 x, uint8 y);
713 void splitIntoLines(uint8 x, uint8 y);
717 void intro2Text(uint16 nextReelPointer);
718 void intro3Text(uint16 nextReelPointer);
721 void monks2ShowText(uint8 textIndex, uint8 x, uint8 y);
723 void textForMonkHelper(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
726 void soundOnReels(uint16 reelPointer);
727 void clearBeforeLoad();
729 void getRidOfReels();
730 void liftNoise(uint8 index);
731 void checkForExit(
Sprite *sprite);
732 void mainMan(
Sprite *sprite);
736 void reelsOnScreen();
739 void setupInitialVars();
749 void switchRyanOff();
752 uint16 readMouseState();
753 void hangOn(uint16 frameCount);
756 void findOrMake(uint8 index, uint8 value, uint8 type);
760 void *getAnyAdDir(uint8 index, uint8 flag);
767 void *getAnyAd(uint8 *slotSize, uint8 *slotCount);
768 const uint8 *getTextInFile1(uint16 index);
769 uint8 findNextColon(
const uint8 **
string);
770 void allocateBuffers();
771 void loadTextFile(
TextFile &file,
const char *suffix);
772 void loadGraphicsFile(
GraphicsFile &file,
const char *suffix);
775 void loadTravelText();
776 void loadTempText(
const char *suffix);
778 void loadRoomData(
const Room &room,
bool skipDat);
781 void useCharsetIcons1();
782 void useCharsetTempgraphics();
784 void printMessage(uint16 x, uint16 y, uint8 index, uint8 maxWidth,
bool centered);
785 void printMessage2(uint16 x, uint16 y, uint8 index, uint8 maxWidth,
bool centered, uint8 count);
786 bool isItDescribed(
const ObjPos *objPos);
791 void commandOnlyCond(uint8 command, uint8 commandType);
792 void commandOnly(uint8 command);
793 void commandWithOb(uint8 command, uint8 type, uint8 index);
801 void getFlagUnderP(uint8 *flag, uint8 *flagEx);
802 void workToScreenM();
810 void showRightPage();
811 void underTextLine();
812 void hangOnP(uint16 count);
815 void examineInventory();
818 void getBackFromOb();
819 void getBackFromOps();
823 bool compare(uint8 index, uint8 flag,
const char id[4]);
824 void hangOnW(uint16 frameCount);
825 void getRidOfTempText();
827 void placeSetObject(uint8 index);
828 void removeSetObject(uint8 index);
829 bool isSetObOnMap(uint8 index);
833 void findRoomInLoc();
837 void dealWithSpecial(uint8 firstParam, uint8 secondParam);
838 void plotReel(uint16 &reelPointer);
839 void setupTimedTemp(uint8 textIndex, uint8 voiceIndex, uint8 x, uint8 y, uint16 countToTimed, uint16 timeCount);
840 void getUnderTimed();
841 void putUnderTimed();
844 void dumpTimedText();
846 void doChange(uint8 index, uint8 value, uint8 type);
847 bool isRyanHolding(
const char *
id);
851 uint16 findSetObject(
const char *
id);
852 void hangOnCurs(uint16 frameCount);
853 const uint8 *findObName(uint8 type, uint8 index);
854 void copyName(uint8 type, uint8 index, uint8 *dst);
855 uint16 findExObject(
const char *
id);
856 void makeMainScreen();
857 void showWatchReel();
859 void examineObText();
860 void blockNameText();
861 void personNameText();
864 void setAllChanges();
866 void redrawMainScrn();
872 void startLoading(
const Room &room);
875 bool objectMatches(
void *
object,
const char *
id);
876 void checkFolderCoords();
880 void obsThatDoThings();
882 void speakObject(
const char *text);
883 void putBackObStuff();
884 void showDiaryPage();
885 void showDiaryKeys();
886 void dumpDiaryKeys();
889 void edensFlatReminders();
893 bool finishedWalking();
894 void emergencyPurge(uint8 from);
896 uint8 nextSymbol(uint8 symbol);
899 void updateSymbolTop();
900 void updateSymbolBot();
901 void pickupOb(uint8 command, uint8 pos);
902 void errorMessage1();
903 void errorMessage2();
904 void errorMessage3();
910 void searchForFiles(
const char *filesString);
911 void triggerMessage(uint16 index);
912 void processTrigger();
913 void dreamwebFinalize();
917 bool checkIfPerson(uint8 x, uint8 y);
918 bool checkIfFree(uint8 x, uint8 y);
919 bool checkIfEx(uint8 x, uint8 y);
920 void walkAndExamine();
921 void obName(uint8 command, uint8 commandType);
922 bool checkIfSet(uint8 x, uint8 y);
938 uint16 getPersFrame(uint8 index);
939 const uint8 *getPersonText(uint8 index, uint8 talkPos);
951 void hangOne(uint16 delay);
955 void loadIntroRoom();
956 void set16ColPalette();
963 void placeFreeObject(uint8 index);
964 void removeFreeObject(uint8 index);
965 void setupTimedUse(uint16 offset, uint16 countToTimed, uint16 timeCount, byte x, byte y);
967 uint16 checkInside(uint16 command, uint16 type);
968 void showPuzText(uint16 command, uint16 count);
969 void useText(
const uint8 *
string);
971 void showSecondUse();
973 void edensCDPlayer();
983 void callHotelLift();
985 void useCoveredBox();
987 void useChurchHole();
993 void callEdensDLift();
994 void callEdensLift();
995 void openYourNeighbor();
1002 void useChurchGate();
1005 bool defaultUseHandler(
const char *
id);
1022 void openHotelDoor();
1023 void openHotelDoor2();
1024 void grafittiDoor();
1025 void useCardReader1();
1026 void useCardReader2();
1027 void useCardReader3();
1028 void usePoolReader();
1032 void hotelControl();
1043 void notHeldError();
1051 void delEverything();
1052 void afterIntroRoom();
1055 void clearStartPal();
1057 void palToStartPal();
1058 void endPalToStart();
1059 void startPalToEnd();
1063 void fadeCalculation();
1064 void fadeUpYellows();
1065 void fadeUpMonFirst();
1068 void initialMonCols();
1069 void fadeScreenUp();
1070 void fadeScreenUps();
1071 void fadeScreenUpHalf();
1072 void fadeScreenDown();
1073 void fadeScreenDowns();
1074 void fadeScreenDownHalf();
1075 void clearPalette();
1076 void greyscaleSum();
1081 inline uint8 *workspace() {
return _workspace; }
1087 void transferFrame(uint8 from, uint8 to, uint8 offset);
1089 void multiGet(uint8 *dst, uint16 x, uint16 y, uint8 width, uint8 height);
1090 void multiPut(
const uint8 *src, uint16 x, uint16 y, uint8 width, uint8 height);
1091 void multiDump(uint16 x, uint16 y, uint8 width, uint8 height);
1092 void workToScreen();
1093 void frameOutV(uint8 *dst,
const uint8 *src, uint16 pitch, uint16 width, uint16 height, int16 x, int16 y);
1094 void frameOutNm(uint8 *dst,
const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
1095 void frameOutBh(uint8 *dst,
const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
1096 void frameOutFx(uint8 *dst,
const uint8 *src, uint16 pitch, uint16 width, uint16 height, uint16 x, uint16 y);
1100 void showFrameInternal(
const uint8 *pSrc, uint16 x, uint16 y, uint8 effectsFlag, uint8 width, uint8 height);
1101 void showFrame(
const GraphicsFile &frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag, uint8 *width, uint8 *height);
1102 void showFrame(
const GraphicsFile &frameData, uint16 x, uint16 y, uint16 frameNumber, uint8 effectsFlag);
1103 bool pixelCheckSet(
const ObjPos *pos, uint8 x, uint8 y);
1104 void loadPalFromIFF();
1106 void createPanel2();
EngineFeature
Definition: engine.h:253
Definition: structs.h:265
Definition: structs.h:394
Definition: structs.h:332
Definition: structs.h:282
Definition: structs.h:154
Definition: algorithm.h:29
Definition: structs.h:131
Definition: detection.h:27
Definition: structs.h:270
Definition: text-to-speech.h:145
Definition: structs.h:249
Definition: structs.h:117
Definition: structs.h:312
Definition: structs.h:210
Definition: structs.h:107
Definition: structs.h:187
Language
Definition: language.h:45
Definition: dreamweb.h:102