22 #ifndef PRINCE_PRINCE_H 23 #define PRINCE_PRINCE_H 25 #include "common/random.h" 26 #include "common/system.h" 27 #include "common/debug.h" 28 #include "common/debug-channels.h" 29 #include "common/textconsole.h" 30 #include "common/text-to-speech.h" 31 #include "common/rect.h" 32 #include "common/events.h" 33 #include "common/endian.h" 34 #include "common/savefile.h" 35 #include "common/serializer.h" 39 #include "gui/debugger.h" 41 #include "engines/engine.h" 42 #include "engines/util.h" 44 #include "audio/mixer.h" 46 #include "video/flic_decoder.h" 48 #include "prince/mob.h" 49 #include "prince/object.h" 50 #include "prince/pscr.h" 51 #include "prince/detection.h" 64 struct SavegameHeader;
70 class InterpreterFlags;
86 int16 saveYear, saveMonth, saveDay;
87 int16 saveHour, saveMinutes;
91 #define kSavegameStrSize 14 92 #define kSavegameStr "SCUMMVM_PRINCE" 137 const int kStructSizeBAS = 28;
146 const int kStructSizeBASA = 8;
169 int32 _currShadowFrame;
170 int16 _packShadowFlag;
184 int16 getAnimData(Anim::AnimOffsets offset) {
193 error(
"getAnimData() - Wrong offset type: %d", (
int)offset);
197 void setAnimData(Anim::AnimOffsets offset, int16 value) {
198 if (offset == kAnimX) {
201 error(
"setAnimData() - Wrong offset: %d, value: %d", (
int)offset, value);
212 kBackgroundAnimation,
231 return READ_LE_UINT16(_data);
235 return READ_LE_UINT16(_data + 2);
238 int16 getWidth()
const {
239 return READ_LE_UINT16(_data + 4);
242 int16 getHeight()
const {
243 return READ_LE_UINT16(_data + 6);
246 byte *getMask()
const {
247 return (byte *)(_data + 8);
280 static const uint8 kHeroTextColor = 220;
290 bool scummVMSaveLoadDialog(
bool isSave);
293 void pauseEngineIntern(
bool pause)
override;
304 bool loadGame(
int slotNumber);
307 int32 _creditsDataSize;
309 void scrollCredits();
311 int getGameType()
const;
312 const char *getGameId()
const;
313 uint32 getFeatures()
const;
324 uint32 _mobTranslationSize;
325 byte *_mobTranslationData;
329 bool loadLocation(uint16 locationNr);
330 bool loadAnim(uint16 animNr,
bool loop);
331 bool loadVoice(uint32 textSlot, uint32 sampleSlot,
const Common::String &name);
333 bool loadZoom(byte *zoomBitmap, uint32 dataSize,
const char *resourceName);
334 bool loadShadow(byte *shadowBitmap, uint32 dataSize,
const char *resourceName1,
const char *resourceName2);
335 bool loadTrans(byte *transTable,
const char *resourceName);
336 bool loadMobPriority(
const char *resourceName);
338 void loadMobTranslationTexts();
339 void setMobTranslationTexts();
341 bool loadMusic(
int musNumber);
344 void playSample(uint16 sampleId, uint16 loopType);
345 void stopSample(uint16 sampleId);
346 void stopAllSamples();
347 void freeSample(uint16 sampleId);
348 void freeAllSamples();
350 void setVoice(uint16 slot, uint32 sampleSlot, uint16 flag);
352 void changeCursor(uint16 curId);
353 void printAt(uint32 slot, uint8 color,
char *s, uint16 x, uint16 y);
354 int calcTextLines(
const char *s);
355 int calcTextTime(
int numberOfLines);
356 void correctStringDEU(
char *s);
358 void sayText(
const Common::String &text,
bool isSpeech, Common::TextToSpeechManager::Action action = Common::TextToSpeechManager::INTERRUPT);
361 bool checkConversionTable(
const byte *character,
int &index, byte *convertedBytes,
const uint16 *table)
const;
363 void setTTSVoice(uint8 textColor)
const;
364 void stopTextToSpeech()
const;
366 static const uint8 kMaxTexts = 32;
367 Text _textSlots[kMaxTexts];
384 bool _printMapNotification;
403 int32 _shadScaleValue;
406 void setShadowScale(int32 shadowScale);
408 static const int16 kFPS = 15;
409 static const int32 kIntMax = 2147483647;
411 static const int16 kMaxPicWidth = 1280;
412 static const int16 kMaxPicHeight = 480;
413 static const int16 kZoomStep = 4;
414 static const int32 kZoomBitmapLen = kMaxPicHeight / kZoomStep * kMaxPicWidth / kZoomStep;
415 static const int32 kShadowBitmapSize = kMaxPicWidth * kMaxPicHeight / 8;
416 static const int16 kShadowLineArraySize = 2 * 1280 * 4;
417 static const int16 kZoomBitmapWidth = kMaxPicWidth / kZoomStep;
418 static const int16 kZoomBitmapHeight = kMaxPicHeight / kZoomStep;
419 static const int16 kNormalWidth = 640;
420 static const int16 kNormalHeight = 480;
421 static const uint32 kTransTableSize = 256 * 256;
423 static const int kMaxNormAnims = 64;
424 static const int kMaxBackAnims = 64;
425 static const int kMaxObjects = 64;
426 static const int kMaxMobs = 64;
438 void freeNormAnim(
int slot);
439 void freeAllNormAnims();
440 void removeSingleBackAnim(
int slot);
444 void checkMasks(
int x1,
int y1,
int sprWidth,
int sprHeight,
int z);
456 int _currentPointerNumber;
458 static const int16 kMaxInv = 90;
459 static const uint16 kMaxItems = 30;
474 int _invOptionsWidth;
475 int _invOptionsHeight;
479 int _invOptionsNumber;
483 bool _showInventoryFlag;
485 bool _inventoryBackgroundRemember;
507 void inventoryFlagChange(
bool inventoryState);
509 void rememberScreenInv();
510 void prepareInventoryToView();
512 void displayInventory();
513 void addInv(
int heroId,
int item,
bool addItemQuiet);
514 void remInv(
int heroId,
int item);
515 void clearInv(
int heroId);
516 void swapInv(
int heroId);
518 void makeInvCursor(
int itemNr);
519 void enableOptions(
bool checkType);
521 void checkInvOptions();
522 void openInventoryCheck();
524 void leftMouseButton();
525 void rightMouseButton();
526 void inventoryLeftMouseButton();
527 void inventoryRightMouseButton();
528 void dialogLeftMouseButton(byte *
string,
int dialogSelected);
530 uint32 _dialogDatSize;
534 byte *_dialogBoxAddr[32];
535 byte *_dialogOptAddr[32];
536 int _dialogOptLines[4 * 32];
543 int _dialogLineSpace;
546 int _previousSelectedDialog;
550 void createDialogBox(
int dialogBoxNr);
552 void talkHero(
int slot);
553 void doTalkAnim(
int animNumber,
int slot, AnimType animType);
555 static const uint8 zoomInStep = 8;
556 void initZoomIn(
int slot);
557 void initZoomOut(
int slot);
558 void doZoomIn(
int slot);
559 void doZoomOut(
int slot);
560 void freeZoomObject(
int slot);
562 static const uint8 kFadeStep = 4;
564 void setPalette(
const byte *palette);
569 static const int16 kCurveLen = 17;
570 static const int kCelStep = 4;
577 static const uint16 kPowerBarPosX = 288;
578 static const uint16 kPowerBarPosY = 430;
579 static const uint8 kPowerBarWidth = 64;
580 static const uint8 kPowerBarHeight = 16;
581 static const uint8 kPowerBarBackgroundColor = 0;
582 static const uint16 kPowerBarGreenPosY = 434;
583 static const uint8 kPowerBarGreenColor1 = 202;
584 static const uint8 kPowerBarGreenColor2 = 235;
585 static const uint8 kPowerBarGreenHeight = 8;
589 static const int16 kPathGridStep = 2;
590 static const uint32 kPathBitmapLen = (kMaxPicHeight / kPathGridStep * kMaxPicWidth / kPathGridStep) / 8;
591 static const int32 kTracePts = 8000;
592 static const int32 kPBW = kMaxPicWidth / 16;
593 static const int kMinDistance = 2500;
595 byte *_roomPathBitmap;
596 byte *_roomPathBitmapTemp;
605 bool _traceLineFirstPointFlag;
606 bool _tracePointFirstPointFlag;
607 byte *_directionTable;
610 byte *_checkBitmapTemp;
616 byte *_rembBitmapTemp;
625 int drawLine(
int x0,
int y0,
int x1,
int y1,
int (*plotProc)(
int,
int,
void *),
void *data);
626 bool loadPath(
const char *resourceName);
627 byte *makePath(
int heroId,
int currX,
int currY,
int destX,
int destY);
628 void findPoint(
int x,
int y);
629 int getPixelAddr(byte *pathBitmap,
int x,
int y);
630 static int plotTraceLine(
int x,
int y,
void *data);
631 void specialPlotInside(
int x,
int y);
632 bool tracePath(
int x1,
int y1,
int x2,
int y2);
633 Direction makeDirection(
int x1,
int y1,
int x2,
int y2);
634 void specialPlot(
int x,
int y);
635 void specialPlot2(
int x,
int y);
639 static int plotTracePoint(
int x,
int y,
void *data);
640 void specialPlotInside2(
int x,
int y);
642 void freeDirectionTable();
643 void scanDirections();
644 int scanDirectionsFindNext(byte *coords,
int xDiff,
int yDiff);
647 void moveRunHero(
int heroId,
int x,
int y,
int dir,
bool runHeroFlag);
663 int checkLeftDownDir();
668 int checkLeftUpDir();
669 int checkRightDownDir();
670 int checkRightUpDir();
673 bool playNextFLCFrame();
680 void showAnim(
Anim &anim);
681 void showNormAnims();
682 void setBackAnim(
Anim &backAnim);
683 void showBackAnims();
684 void clearBackAnimList();
685 bool spriteCheck(
int sprWidth,
int sprHeight,
int destX,
int destY);
686 void showSprite(
Graphics::Surface *spriteSurface,
int destX,
int destY,
int destZ);
687 void showSpriteShadow(
Graphics::Surface *shadowSurface,
int destX,
int destY,
int destZ);
692 void makeShadowTable(
int brightness);
693 void pausePrinceEngine(
int fps = kFPS);
695 uint32 getTextWidth(
const char *s);
696 void debugEngine(
const char *s, ...);
708 static const int kMaxSamples = 60;
EngineFeature
Definition: engine.h:260
Definition: savefile.h:54
Definition: detection.h:42
Definition: flic_decoder.h:50
Definition: animation.h:32
Definition: animation.h:30
Definition: atari-cursor.h:35
bool skipThumbnail(Common::SeekableReadStream &in)
Definition: variatxt.h:26
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: audiostream.h:109
Definition: graphics.h:33
Definition: debugger.h:33
Language
Definition: language.h:45