FULLPIPE: Implement sceneHandlerIntro()

This commit is contained in:
Eugene Sandulenko 2013-10-28 00:49:26 +02:00
parent 09128132c7
commit 0d4055fe7f
4 changed files with 81 additions and 2 deletions

View file

@ -35,12 +35,17 @@ namespace Fullpipe {
#define MSG_ENABLESAVES 5202
#define MSG_HMRKICK_METAL 4764
#define MSG_HMRKICK_STUCCO 4765
#define MSG_INTR_ENDINTRO 5139
#define MSG_INTR_GETUPMAN 5135
#define MSG_INTR_SWITCHTO1 5145
#define MSG_INTR_SWITCHTO2 5134
#define MSG_MANSHADOWSOFF 5196
#define MSG_MANSHADOWSON 5197
#define MSG_RESTARTGAME 4767
#define MSG_SC1_SHOWOSK 1019
#define MSG_SC1_SHOWOSK2 468
#define MSG_SC1_UTRUBACLICK 1100
#define MV_IN1MAN_SLEEP 5111
#define MV_MAN_GOLADDER 451
#define MV_MAN_GOLADDER2 2844
#define MV_MAN_LOOKUP 4773
@ -93,6 +98,9 @@ namespace Fullpipe {
#define PIC_SC1_OSK 1018
#define PIC_SC1_OSK2 2932
#define PIC_SCD_SEL 734
#define QU_IN2_DO 5144
#define QU_INTR_FINISH 5138
#define QU_INTR_GETUPMAN 5136
#define SC_1 301
#define SC_10 653
#define SC_11 654
@ -147,6 +155,7 @@ namespace Fullpipe {
#define SC_TITLES 5166
#define SND_CMN_031 3516
#define SND_CMN_070 5199
#define ST_IN1MAN_SLEEP 5112
#define ST_LBN_0N 2832
#define ST_LBN_0P 2833
#define ST_LBN_1N 2753

View file

@ -756,4 +756,23 @@ void updateGlobalMessageQueue(int id, int objid) {
}
}
bool chainQueue(int queueId, int flags) {
MessageQueue *mq = g_fullpipe->_currentScene->getMessageQueueById(queueId);
if (!mq)
return false;
MessageQueue *nmq = new MessageQueue(mq, 0, 0);
nmq->_flags |= flags;
if (!mq->chain(0)) {
delete mq;
return false;
}
return true;
}
} // End of namespace Fullpipe

View file

@ -173,6 +173,8 @@ void processMessages();
void updateGlobalMessageQueue(int id, int objid);
void clearGlobalMessageQueueList1();
bool chainQueue(int queueId, int flags);
} // End of namespace Fullpipe
#endif /* FULLPIPE_MESSAGEQUEUE_H */

View file

@ -1422,8 +1422,57 @@ void sceneIntro_initScene(Scene *sc) {
g_fullpipe->_modalObject = new ModalIntro;
}
int sceneHandlerIntro(ExCommand *cmd) {
warning("STUB: sceneHandlerIntro()");
void sceneHandlerIntro_part1() {
g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO1);
chainQueue(QU_INTR_FINISH, 0);
}
void sceneHandlerIntro_part2() {
g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO2);
chainQueue(QU_IN2_DO, 0);
}
int sceneHandlerIntro(ExCommand *ex) {
if (ex->_messageKind != 17)
return 0;
switch (ex->_messageNum) {
case MSG_INTR_ENDINTRO:
g_vars->sceneIntro_playing = 0;
return 0;
case MSG_INTR_SWITCHTO1:
sceneHandlerIntro_part1();
return 0;
case MSG_INTR_GETUPMAN:
g_vars->sceneIntro_needSleep = 0;
g_vars->sceneIntro_needGetup = 1;
return 0;
case MSG_INTR_SWITCHTO2:
sceneHandlerIntro_part2();
return 0;
case 33:
// fall trhough
break;
default:
return 0;
}
if (g_vars->sceneIntro_needSleep) {
if (!g_vars->sceneIntro_aniin1man->_movement && g_vars->sceneIntro_aniin1man->_statics->_staticsId == ST_IN1MAN_SLEEP)
g_vars->sceneIntro_aniin1man->startAnim(MV_IN1MAN_SLEEP, 0, -1);
} else if (g_vars->sceneIntro_needGetup && !g_vars->sceneIntro_aniin1man->_movement &&
g_vars->sceneIntro_aniin1man->_statics->_staticsId == ST_IN1MAN_SLEEP) {
g_vars->sceneIntro_needGetup = 0;
chainQueue(QU_INTR_GETUPMAN, 0);
}
g_fullpipe->startSceneTrack();
return 0;
}