mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
Thread-related IHNM differences.
svn-id: r18602
This commit is contained in:
parent
ba107e3799
commit
372a483ceb
@ -143,6 +143,8 @@ SagaEngine::SagaEngine(GameDetector *detector, OSystem *syst)
|
||||
_sound = NULL;
|
||||
_puzzle = NULL;
|
||||
|
||||
_frameCount = 0;
|
||||
|
||||
|
||||
// The Linux version of Inherit the Earth puts all data files in an
|
||||
// 'itedata' sub-directory, except for voices.rsc
|
||||
|
@ -638,6 +638,9 @@ public:
|
||||
GameDisplayInfo _gameDisplayInfo;
|
||||
Common::Rect _displayClip;
|
||||
|
||||
public:
|
||||
int32 _frameCount;
|
||||
|
||||
public:
|
||||
bool initGame(void);
|
||||
// RSCFILE_CONTEXT *getFileContext(uint16 type, int param);
|
||||
|
@ -104,7 +104,8 @@ enum ThreadWaitTypes {
|
||||
kWaitTypeRequest = 6, // a request is up
|
||||
kWaitTypePause = 7,
|
||||
kWaitTypePlacard = 8,
|
||||
kWaitTypeStatusTextInput = 9
|
||||
kWaitTypeStatusTextInput = 9,
|
||||
kWaitTypeWaitFrames = 10 // IHNM. waiting for a frame count
|
||||
};
|
||||
|
||||
enum OpCodes {
|
||||
@ -262,6 +263,7 @@ public:
|
||||
|
||||
uint16 _instructionOffset; // Instruction offset
|
||||
|
||||
int32 _frameWait;
|
||||
|
||||
public:
|
||||
byte *baseAddress(byte addrMode) {
|
||||
|
@ -117,13 +117,19 @@ void Script::executeThreads(uint msec) {
|
||||
if (thread->_flags & kTFlagFinished)
|
||||
setPointerVerb();
|
||||
|
||||
threadIterator = _threadList.erase(threadIterator);
|
||||
if (_vm->getGameType() == GType_IHNM) {
|
||||
thread->_flags &= ~kTFlagFinished;
|
||||
thread->_flags |= kTFlagAborted;
|
||||
} else {
|
||||
threadIterator = _threadList.erase(threadIterator);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (thread->_flags & kTFlagWaiting) {
|
||||
|
||||
if (thread->_waitType == kWaitTypeDelay) {
|
||||
switch (thread->_waitType) {
|
||||
case kWaitTypeDelay:
|
||||
if (thread->_sleepTime < msec) {
|
||||
thread->_sleepTime = 0;
|
||||
} else {
|
||||
@ -132,14 +138,22 @@ void Script::executeThreads(uint msec) {
|
||||
|
||||
if (thread->_sleepTime == 0)
|
||||
thread->_flags &= ~kTFlagWaiting;
|
||||
} else {
|
||||
if (thread->_waitType == kWaitTypeWalk) {
|
||||
break;
|
||||
|
||||
case kWaitTypeWalk:
|
||||
{
|
||||
ActorData *actor;
|
||||
actor = (ActorData *)thread->_threadObj;
|
||||
if (actor->currentAction == kActionWait) {
|
||||
thread->_flags &= ~kTFlagWaiting;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kWaitTypeWaitFrames: // IHNM
|
||||
if (thread->_frameWait < _vm->_frameCount)
|
||||
thread->_flags &= ~kTFlagWaiting;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,7 +183,9 @@ void Script::abortAllThreads(void) {
|
||||
}
|
||||
|
||||
void Script::completeThread(void) {
|
||||
for (int i = 0; i < 40 && !_threadList.isEmpty() ; i++)
|
||||
int limit = (_vm->getGameType() == GType_IHNM) ? 100 : 40;
|
||||
|
||||
for (int i = 0; i < limit && !_threadList.isEmpty() ; i++)
|
||||
executeThreads(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user