mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-14 20:50:09 +00:00
SAGA2: Rename enums in sensor.h, setup.h and speech.h
This commit is contained in:
parent
7f4dd6aaaa
commit
4d6ca3173b
@ -479,10 +479,10 @@ int16 scriptActorSay(int16 *args) {
|
|||||||
// Actor speech enums -- move these to include file
|
// Actor speech enums -- move these to include file
|
||||||
// MOVED TO SPEECH.H - EO
|
// MOVED TO SPEECH.H - EO
|
||||||
// enum {
|
// enum {
|
||||||
// speakContinued = (1<<0), // Append next speech
|
// kSpeakContinued = (1<<0), // Append next speech
|
||||||
// speakNoAnimate = (1<<1), // Don't animate speaking
|
// kSpeakNoAnimate = (1<<1), // Don't animate speaking
|
||||||
// speakWait = (1<<2), // wait until speech finished
|
// kSpeakWait = (1<<2), // wait until speech finished
|
||||||
// speakLock = (1<<3), // LockUI while speaking
|
// kSpeakLock = (1<<3), // LockUI while speaking
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// 'obj' is the actor doing the speaking.
|
// 'obj' is the actor doing the speaking.
|
||||||
@ -503,8 +503,8 @@ int16 scriptActorSay(int16 *args) {
|
|||||||
if (sp == nullptr) {
|
if (sp == nullptr) {
|
||||||
uint16 spFlags = 0;
|
uint16 spFlags = 0;
|
||||||
|
|
||||||
if (flags & speakNoAnimate) spFlags |= Speech::spNoAnimate;
|
if (flags & kSpeakNoAnimate) spFlags |= Speech::kSpNoAnimate;
|
||||||
if (flags & speakLock) spFlags |= Speech::spLock;
|
if (flags & kSpeakLock) spFlags |= Speech::kSpLock;
|
||||||
|
|
||||||
sp = speechList.newTask(obj->thisID(), spFlags);
|
sp = speechList.newTask(obj->thisID(), spFlags);
|
||||||
|
|
||||||
@ -522,9 +522,9 @@ int16 scriptActorSay(int16 *args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If we're ready to activate the speech
|
// If we're ready to activate the speech
|
||||||
if (!(flags & speakContinued)) {
|
if (!(flags & kSpeakContinued)) {
|
||||||
// If we're going to wait for it synchronously
|
// If we're going to wait for it synchronously
|
||||||
if (flags & speakWait) {
|
if (flags & kSpeakWait) {
|
||||||
thisThread->waitForEvent(Thread::kWaitOther, nullptr);
|
thisThread->waitForEvent(Thread::kWaitOther, nullptr);
|
||||||
sp->setWakeUp(getThreadID(thisThread));
|
sp->setWakeUp(getThreadID(thisThread));
|
||||||
}
|
}
|
||||||
|
@ -88,27 +88,27 @@ void readSensor(int16 ctr, Common::InSaveFile *in) {
|
|||||||
debugC(3, kDebugSaveload, "type = %d", type);
|
debugC(3, kDebugSaveload, "type = %d", type);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case protaganistSensor:
|
case kProtaganistSensor:
|
||||||
sensor = new ProtaganistSensor(in, ctr);
|
sensor = new ProtaganistSensor(in, ctr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case specificObjectSensor:
|
case kSpecificObjectSensor:
|
||||||
sensor = new SpecificObjectSensor(in, ctr);
|
sensor = new SpecificObjectSensor(in, ctr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case objectPropertySensor:
|
case kObjectPropertySensor:
|
||||||
sensor = new ObjectPropertySensor(in, ctr);
|
sensor = new ObjectPropertySensor(in, ctr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case specificActorSensor:
|
case kSpecificActorSensor:
|
||||||
sensor = new SpecificActorSensor(in, ctr);
|
sensor = new SpecificActorSensor(in, ctr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case actorPropertySensor:
|
case kActorPropertySensor:
|
||||||
sensor = new ActorPropertySensor(in, ctr);
|
sensor = new ActorPropertySensor(in, ctr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case eventSensor:
|
case kEventSensor:
|
||||||
sensor = new EventSensor(in, ctr);
|
sensor = new EventSensor(in, ctr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -404,7 +404,7 @@ void Sensor::write(Common::MemoryWriteStreamDynamic *out) {
|
|||||||
// Return an integer representing the type of this sensor
|
// Return an integer representing the type of this sensor
|
||||||
|
|
||||||
int16 ProtaganistSensor::getType() {
|
int16 ProtaganistSensor::getType() {
|
||||||
return protaganistSensor;
|
return kProtaganistSensor;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -558,7 +558,7 @@ void SpecificObjectSensor::write(Common::MemoryWriteStreamDynamic *out) {
|
|||||||
// Return an integer representing the type of this sensor
|
// Return an integer representing the type of this sensor
|
||||||
|
|
||||||
int16 SpecificObjectSensor::getType() {
|
int16 SpecificObjectSensor::getType() {
|
||||||
return specificObjectSensor;
|
return kSpecificObjectSensor;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -636,7 +636,7 @@ void ObjectPropertySensor::write(Common::MemoryWriteStreamDynamic *out) {
|
|||||||
// Return an integer representing the type of this sensor
|
// Return an integer representing the type of this sensor
|
||||||
|
|
||||||
int16 ObjectPropertySensor::getType() {
|
int16 ObjectPropertySensor::getType() {
|
||||||
return objectPropertySensor;
|
return kObjectPropertySensor;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -690,7 +690,7 @@ void SpecificActorSensor::write(Common::MemoryWriteStreamDynamic *out) {
|
|||||||
// Return an integer representing the type of this sensor
|
// Return an integer representing the type of this sensor
|
||||||
|
|
||||||
int16 SpecificActorSensor::getType() {
|
int16 SpecificActorSensor::getType() {
|
||||||
return specificActorSensor;
|
return kSpecificActorSensor;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -757,7 +757,7 @@ void ActorPropertySensor::write(Common::MemoryWriteStreamDynamic *out) {
|
|||||||
// Return an integer representing the type of this sensor
|
// Return an integer representing the type of this sensor
|
||||||
|
|
||||||
int16 ActorPropertySensor::getType() {
|
int16 ActorPropertySensor::getType() {
|
||||||
return actorPropertySensor;
|
return kActorPropertySensor;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@ -806,7 +806,7 @@ void EventSensor::write(Common::MemoryWriteStreamDynamic *out) {
|
|||||||
// Return an integer representing the type of this sensor
|
// Return an integer representing the type of this sensor
|
||||||
|
|
||||||
int16 EventSensor::getType() {
|
int16 EventSensor::getType() {
|
||||||
return eventSensor;
|
return kEventSensor;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -39,12 +39,12 @@ const int16 maxSenseRange = 0;
|
|||||||
|
|
||||||
// Integers representing sensor types
|
// Integers representing sensor types
|
||||||
enum SensorType {
|
enum SensorType {
|
||||||
protaganistSensor,
|
kProtaganistSensor,
|
||||||
specificObjectSensor,
|
kSpecificObjectSensor,
|
||||||
objectPropertySensor,
|
kObjectPropertySensor,
|
||||||
specificActorSensor,
|
kSpecificActorSensor,
|
||||||
actorPropertySensor,
|
kActorPropertySensor,
|
||||||
eventSensor
|
kEventSensor
|
||||||
};
|
};
|
||||||
|
|
||||||
// Sensors will be checked every 5 frames
|
// Sensors will be checked every 5 frames
|
||||||
|
@ -45,9 +45,9 @@ struct WindowDecoration;
|
|||||||
|
|
||||||
// enum for the three levels in the trio view
|
// enum for the three levels in the trio view
|
||||||
enum trioViews {
|
enum trioViews {
|
||||||
top,
|
kTrioTop,
|
||||||
mid,
|
kTrioMid,
|
||||||
bot
|
kTrioBot
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ContainerInfo {
|
struct ContainerInfo {
|
||||||
@ -74,12 +74,12 @@ extern const ContainerInfo indivReadyContInfoBot;
|
|||||||
// List of decorations for main window
|
// List of decorations for main window
|
||||||
|
|
||||||
enum borderIDs {
|
enum borderIDs {
|
||||||
MWBottomBorder = 0,
|
kMWBottomBorder = 0,
|
||||||
MWTopBorder,
|
kMWTopBorder,
|
||||||
MWLeftBorder,
|
kMWLeftBorder,
|
||||||
MWRightBorder1,
|
kMWRightBorder1,
|
||||||
MWRightBorder2,
|
kMWRightBorder2,
|
||||||
MWRightBorder3
|
kMWRightBorder3
|
||||||
};
|
};
|
||||||
|
|
||||||
const int extraObjects = 512,
|
const int extraObjects = 512,
|
||||||
|
@ -169,7 +169,7 @@ void Speech::read(Common::InSaveFile *in) {
|
|||||||
debugC(4, kDebugSaveload, "...... _speechBuffer = %s", _speechBuffer);
|
debugC(4, kDebugSaveload, "...... _speechBuffer = %s", _speechBuffer);
|
||||||
|
|
||||||
// Requeue the speech if needed
|
// Requeue the speech if needed
|
||||||
if (_speechFlags & spQueued) {
|
if (_speechFlags & kSpQueued) {
|
||||||
// Add to the active list
|
// Add to the active list
|
||||||
speechList.remove(this);
|
speechList.remove(this);
|
||||||
speechList._list.push_back(this);
|
speechList._list.push_back(this);
|
||||||
@ -212,7 +212,7 @@ void Speech::write(Common::MemoryWriteStreamDynamic *out) {
|
|||||||
|
|
||||||
// Store the flags. NOTE: Make sure this speech is not stored
|
// Store the flags. NOTE: Make sure this speech is not stored
|
||||||
// as being active
|
// as being active
|
||||||
out->writeSint16LE(_speechFlags & ~spActive);
|
out->writeSint16LE(_speechFlags & ~kSpActive);
|
||||||
|
|
||||||
debugC(4, kDebugSaveload, "...... _sampleCount = %d", _sampleCount);
|
debugC(4, kDebugSaveload, "...... _sampleCount = %d", _sampleCount);
|
||||||
debugC(4, kDebugSaveload, "...... _charCount = %d", _charCount);
|
debugC(4, kDebugSaveload, "...... _charCount = %d", _charCount);
|
||||||
@ -268,7 +268,7 @@ bool Speech::activate() {
|
|||||||
// Add to the active list
|
// Add to the active list
|
||||||
speechList._list.push_back(this);
|
speechList._list.push_back(this);
|
||||||
|
|
||||||
_speechFlags |= spQueued;
|
_speechFlags |= kSpQueued;
|
||||||
|
|
||||||
// This routine can't fail
|
// This routine can't fail
|
||||||
return true;
|
return true;
|
||||||
@ -282,7 +282,7 @@ bool Speech::setupActive() {
|
|||||||
int16 buttonNum = 0,
|
int16 buttonNum = 0,
|
||||||
buttonChars;
|
buttonChars;
|
||||||
|
|
||||||
_speechFlags |= spActive;
|
_speechFlags |= kSpActive;
|
||||||
|
|
||||||
speechFinished.set((_charCount * 4 / 2) + ticksPerSecond);
|
speechFinished.set((_charCount * 4 / 2) + ticksPerSecond);
|
||||||
|
|
||||||
@ -313,18 +313,18 @@ bool Speech::setupActive() {
|
|||||||
|
|
||||||
/// EO SEARCH ///
|
/// EO SEARCH ///
|
||||||
if (sayVoiceAt(_sampleID, loc))
|
if (sayVoiceAt(_sampleID, loc))
|
||||||
_speechFlags |= spHasVoice;
|
_speechFlags |= kSpHasVoice;
|
||||||
else
|
else
|
||||||
_speechFlags &= ~spHasVoice;
|
_speechFlags &= ~kSpHasVoice;
|
||||||
|
|
||||||
} else _speechFlags &= ~spHasVoice;
|
} else _speechFlags &= ~kSpHasVoice;
|
||||||
|
|
||||||
speechLineCount = buttonWrap(speechLineList,
|
speechLineCount = buttonWrap(speechLineList,
|
||||||
speechButtonList,
|
speechButtonList,
|
||||||
speechButtonCount,
|
speechButtonCount,
|
||||||
_speechBuffer,
|
_speechBuffer,
|
||||||
_bounds.width,
|
_bounds.width,
|
||||||
!g_vm->_speechText && (_speechFlags & spHasVoice),
|
!g_vm->_speechText && (_speechFlags & kSpHasVoice),
|
||||||
_textPort);
|
_textPort);
|
||||||
|
|
||||||
// Compute height of bitmap based on number of lines of text.
|
// Compute height of bitmap based on number of lines of text.
|
||||||
@ -403,10 +403,10 @@ bool Speech::setupActive() {
|
|||||||
speechList.SetLock(false);
|
speechList.SetLock(false);
|
||||||
} else {
|
} else {
|
||||||
// If there is a lock flag on this speech, then LockUI()
|
// If there is a lock flag on this speech, then LockUI()
|
||||||
speechList.SetLock(_speechFlags & spLock);
|
speechList.SetLock(_speechFlags & kSpLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(_speechFlags & spNoAnimate) && isActor(_objID)) {
|
if (!(_speechFlags & kSpNoAnimate) && isActor(_objID)) {
|
||||||
Actor *a = (Actor *)GameObject::objectAddress(_objID);
|
Actor *a = (Actor *)GameObject::objectAddress(_objID);
|
||||||
|
|
||||||
if (!a->isDead() && !a->isMoving()) MotionTask::talk(*a);
|
if (!a->isDead() && !a->isMoving()) MotionTask::talk(*a);
|
||||||
@ -432,7 +432,7 @@ void Speech::setWidth() {
|
|||||||
speechButtonCount_,
|
speechButtonCount_,
|
||||||
_speechBuffer,
|
_speechBuffer,
|
||||||
defaultWidth,
|
defaultWidth,
|
||||||
!g_vm->_speechText && (_speechFlags & spHasVoice),
|
!g_vm->_speechText && (_speechFlags & kSpHasVoice),
|
||||||
_textPort);
|
_textPort);
|
||||||
|
|
||||||
// If it's more than 3 lines, then use the max line width.
|
// If it's more than 3 lines, then use the max line width.
|
||||||
@ -443,7 +443,7 @@ void Speech::setWidth() {
|
|||||||
speechButtonCount_,
|
speechButtonCount_,
|
||||||
_speechBuffer,
|
_speechBuffer,
|
||||||
maxWidth,
|
maxWidth,
|
||||||
!g_vm->_speechText && (_speechFlags & spHasVoice),
|
!g_vm->_speechText && (_speechFlags & kSpHasVoice),
|
||||||
_textPort);
|
_textPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ void Speech::dispose() {
|
|||||||
speechLineCount = speechButtonCount = 0;
|
speechLineCount = speechButtonCount = 0;
|
||||||
speakButtonControls->enable(false);
|
speakButtonControls->enable(false);
|
||||||
|
|
||||||
if (!(_speechFlags & spNoAnimate) && isActor(_objID)) {
|
if (!(_speechFlags & kSpNoAnimate) && isActor(_objID)) {
|
||||||
Actor *a = (Actor *)GameObject::objectAddress(_objID);
|
Actor *a = (Actor *)GameObject::objectAddress(_objID);
|
||||||
|
|
||||||
if (a->_moveTask)
|
if (a->_moveTask)
|
||||||
@ -552,7 +552,7 @@ void updateSpeech() {
|
|||||||
// if there is a speech object
|
// if there is a speech object
|
||||||
if ((sp = speechList.currentActive()) != nullptr) {
|
if ((sp = speechList.currentActive()) != nullptr) {
|
||||||
// If there is no bitmap, then set one up.
|
// If there is no bitmap, then set one up.
|
||||||
if (!(sp->_speechFlags & Speech::spActive)) {
|
if (!(sp->_speechFlags & Speech::kSpActive)) {
|
||||||
sp->setupActive();
|
sp->setupActive();
|
||||||
|
|
||||||
// If speech failed to set up, then skip it
|
// If speech failed to set up, then skip it
|
||||||
@ -575,7 +575,7 @@ void updateSpeech() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Speech::longEnough() {
|
bool Speech::longEnough() {
|
||||||
if (_speechFlags & spHasVoice)
|
if (_speechFlags & kSpHasVoice)
|
||||||
return (!stillDoingVoice(_sampleID));
|
return (!stillDoingVoice(_sampleID));
|
||||||
else
|
else
|
||||||
return (_selectedButton != 0 || speechFinished.check());
|
return (_selectedButton != 0 || speechFinished.check());
|
||||||
@ -586,7 +586,7 @@ bool Speech::longEnough() {
|
|||||||
void Speech::abortSpeech() {
|
void Speech::abortSpeech() {
|
||||||
// Start by displaying first frame straight off, no delay
|
// Start by displaying first frame straight off, no delay
|
||||||
speechFinished.set(0);
|
speechFinished.set(0);
|
||||||
if (_speechFlags & spHasVoice) {
|
if (_speechFlags & kSpHasVoice) {
|
||||||
PlayVoice(nullptr);
|
PlayVoice(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -992,7 +992,7 @@ Speech *SpeechTaskList::newTask(ObjectID id, uint16 flags) {
|
|||||||
|
|
||||||
sp->_sampleCount = sp->_charCount = 0;
|
sp->_sampleCount = sp->_charCount = 0;
|
||||||
sp->_objID = id;
|
sp->_objID = id;
|
||||||
sp->_speechFlags = flags & (Speech::spNoAnimate | Speech::spLock);
|
sp->_speechFlags = flags & (Speech::kSpNoAnimate | Speech::kSpLock);
|
||||||
sp->_outlineColor = 15 + 9;
|
sp->_outlineColor = 15 + 9;
|
||||||
sp->_thread = NoThread;
|
sp->_thread = NoThread;
|
||||||
sp->_selectedButton = 0;
|
sp->_selectedButton = 0;
|
||||||
|
@ -61,10 +61,10 @@ extern int16 speechButtonCount; // count of speech buttons
|
|||||||
// Actor speech enums -- move these to include file
|
// Actor speech enums -- move these to include file
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
speakContinued = (1 << 0), // Append next speech
|
kSpeakContinued = (1 << 0), // Append next speech
|
||||||
speakNoAnimate = (1 << 1), // Don't animate speaking
|
kSpeakNoAnimate = (1 << 1), // Don't animate speaking
|
||||||
speakWait = (1 << 2), // wait until speech finished
|
kSpeakWait = (1 << 2), // wait until speech finished
|
||||||
speakLock = (1 << 3) // lock UI while speech in progress
|
kSpeakLock = (1 << 3) // lock UI while speech in progress
|
||||||
};
|
};
|
||||||
|
|
||||||
class Speech {
|
class Speech {
|
||||||
@ -122,11 +122,11 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
enum SpeechFlags {
|
enum SpeechFlags {
|
||||||
spNoAnimate = (1 << 0), // Don't animate actor
|
kSpNoAnimate = (1 << 0), // Don't animate actor
|
||||||
spHasVoice = (1 << 1), // The audio interface is playing this voice
|
kSpHasVoice = (1 << 1), // The audio interface is playing this voice
|
||||||
spQueued = (1 << 2), // In active queue
|
kSpQueued = (1 << 2), // In active queue
|
||||||
spActive = (1 << 3), // Is current active speech
|
kSpActive = (1 << 3), // Is current active speech
|
||||||
spLock = (1 << 4) // Lock UI while speaking
|
kSpLock = (1 << 4) // Lock UI while speaking
|
||||||
};
|
};
|
||||||
|
|
||||||
// remove speech, dealloc resources
|
// remove speech, dealloc resources
|
||||||
|
@ -206,12 +206,12 @@ static bool inCombat,
|
|||||||
// inside a header. GT 09/11/95
|
// inside a header. GT 09/11/95
|
||||||
|
|
||||||
static StaticWindow mainWindowDecorations[] = {
|
static StaticWindow mainWindowDecorations[] = {
|
||||||
{{0, 0, 640, 20}, nullptr, MWTopBorder}, // top border
|
{{0, 0, 640, 20}, nullptr, kMWTopBorder}, // top border
|
||||||
{{0, 440, 640, 40}, nullptr, MWBottomBorder}, // bottom border
|
{{0, 440, 640, 40}, nullptr, kMWBottomBorder}, // bottom border
|
||||||
{{0, 20, 20, 420}, nullptr, MWLeftBorder}, // left border
|
{{0, 20, 20, 420}, nullptr, kMWLeftBorder}, // left border
|
||||||
{{460, 20, 180, 142}, nullptr, MWRightBorder1}, // right border #1
|
{{460, 20, 180, 142}, nullptr, kMWRightBorder1}, // right border #1
|
||||||
{{460, 162, 180, 151}, nullptr, MWRightBorder2}, // right border #2
|
{{460, 162, 180, 151}, nullptr, kMWRightBorder2}, // right border #2
|
||||||
{{460, 313, 180, 127}, nullptr, MWRightBorder3}, // right border #3
|
{{460, 313, 180, 127}, nullptr, kMWRightBorder3}, // right border #3
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ===================================================================== *
|
/* ===================================================================== *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user