PRINCE: Beginning of makeInvCursor and dialog functions

This commit is contained in:
lukaslw 2014-06-16 21:33:30 +02:00
parent 2ba814516c
commit e452e088f4
3 changed files with 38 additions and 2 deletions

View File

@ -436,6 +436,22 @@ void PrinceEngine::changeCursor(uint16 curId) {
CursorMan.showMouse(true);
}
void PrinceEngine::makeInvCursor(int itemNr) {
const Graphics::Surface *cur1Surface = nullptr;
cur1Surface = _cursor1->getSurface();
int cur1W = cur1Surface->w;
int cur1H = cur1Surface->h;
const Graphics::Surface *itemSurface = nullptr;
itemSurface = _allInvList[itemNr].getSurface();
int itemW = itemSurface->w;
int itemH = itemSurface->h;
int cur2W = cur1W + itemW / 2;
int cur2H = cur1H + itemH / 2;
//TODO
}
bool PrinceEngine::playNextFrame() {
if (!_flicPlayer.isVideoLoaded())
return false;
@ -1919,7 +1935,17 @@ void PrinceEngine::displayInventory() {
}
}
void PrinceEngine::makeInvCursor(int itemNr) {
void PrinceEngine::createDialogBox(Common::Array<DialogLine> &dialogData) {
int lineSpace = 10;
int dBoxWidth = 600;
int dialogLines = 0;
int nrOfDialogLines = 0; // ebp
int nrOfSentence = 0; // edx
}
void PrinceEngine::runDialog() {
}

View File

@ -199,6 +199,11 @@ struct DrawNode {
void (*drawFunction)(Graphics::Surface *, DrawNode *);
};
struct DialogLine {
int _nr;
Common::String _line;
};
struct DebugChannel {
enum Type {
@ -260,6 +265,7 @@ public:
Common::Array<AnimListItem> _animList;
Common::Array<BackgroundAnim> _backAnimList;
Common::Array<Common::Array<DialogLine>> _dialogBoxList;
Common::RandomSource _randomSource;
@ -340,6 +346,9 @@ public:
void inventoryLeftMouseButton();
void inventoryRightMouseButton();
void createDialogBox(Common::Array<DialogLine> &dialogData);
void runDialog();
int testAnimNr;
int testAnimFrame;
@ -386,7 +395,7 @@ private:
Common::SeekableReadStream *_voiceStream[MAX_SAMPLES];
Audio::SoundHandle _soundHandle[MAX_SAMPLES];
Animation *_zoom;
//Animation *_zoom;
Common::Array<PScr *> _pscrList;
Common::Array<Mob> _mobList;
Common::Array<Object *> _objList;

View File

@ -1235,6 +1235,7 @@ void Interpreter::O_DISABLEDIALOGOPT() {
void Interpreter::O_SHOWDIALOGBOX() {
uint16 box = readScriptFlagValue();
debugInterpreter("O_SHOWDIALOGBOX box %d", box);
_vm->createDialogBox(_vm->_dialogBoxList[box]);
}
void Interpreter::O_STOPSAMPLE() {