[Scummvm-git-logs] scummvm master -> 5e2fdae32989850da91defc361cdfed44afbf963
a-yyg
76591232+a-yyg at users.noreply.github.com
Thu Aug 19 16:42:52 UTC 2021
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
931b31318f SAGA2: Rename variables in assign.h
7bddd59b77 SAGA2: Rename class and typedefs in audio.h
5e2fdae329 SAGA2: Rename class variables/constants in automap.h
Commit: 931b31318feb2f0b562473a3b08ec94a25820899
https://github.com/scummvm/scummvm/commit/931b31318feb2f0b562473a3b08ec94a25820899
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T01:41:41+09:00
Commit Message:
SAGA2: Rename variables in assign.h
Changed paths:
engines/saga2/assign.cpp
engines/saga2/assign.h
diff --git a/engines/saga2/assign.cpp b/engines/saga2/assign.cpp
index 828d4c7748..a972183326 100644
--- a/engines/saga2/assign.cpp
+++ b/engines/saga2/assign.cpp
@@ -41,18 +41,18 @@ const uint16 indefinitely = CalenderTime::framesPerDay;
// Constructor
ActorAssignment::ActorAssignment(Actor *a, uint16 until) :
- startFrame(calender.frameInDay()),
- endFrame(until) {
+ _startFrame(calender.frameInDay()),
+ _endFrame(until) {
_actor = a;
debugC(2, kDebugActors, "New assignment for %p (%s) from %d until %d: %p",
- (void *)a, a->objName(), startFrame, endFrame, (void *)this);
+ (void *)a, a->objName(), _startFrame, _endFrame, (void *)this);
a->_assignment = this;
a->_flags |= hasAssignment;
}
ActorAssignment::ActorAssignment(Actor *ac, Common::SeekableReadStream *stream) {
- startFrame = stream->readUint16LE();
- endFrame = stream->readUint16LE();
+ _startFrame = stream->readUint16LE();
+ _endFrame = stream->readUint16LE();
_actor = ac;
ac->_assignment = this;
@@ -84,12 +84,12 @@ ActorAssignment::~ActorAssignment(void) {
// assignment
inline int32 ActorAssignment::archiveSize(void) const {
- return sizeof(startFrame) + sizeof(endFrame);
+ return sizeof(_startFrame) + sizeof(_endFrame);
}
void ActorAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
- out->writeUint16LE(startFrame);
- out->writeUint16LE(endFrame);
+ out->writeUint16LE(_startFrame);
+ out->writeUint16LE(_endFrame);
}
//----------------------------------------------------------------------
@@ -98,8 +98,8 @@ void ActorAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
bool ActorAssignment::isValid(void) {
uint16 frame = calender.frameInDay();
- return frame < endFrame
- || (startFrame >= endFrame && frame >= startFrame);
+ return frame < _endFrame
+ || (_startFrame >= _endFrame && frame >= _startFrame);
}
//----------------------------------------------------------------------
@@ -171,11 +171,11 @@ PatrolRouteAssignment::PatrolRouteAssignment(
int16 start,
int16 end) :
ActorAssignment(a, until),
- routeNo(rteNo),
- startingWayPoint(start),
- endingWayPoint(end),
- routeFlags(patrolFlags),
- flags(0) {
+ _routeNo(rteNo),
+ _startingWayPoint(start),
+ _endingWayPoint(end),
+ _routeFlags(patrolFlags),
+ _flags(0) {
}
PatrolRouteAssignment::PatrolRouteAssignment(Actor *a, Common::SeekableReadStream *stream) :
@@ -183,16 +183,16 @@ PatrolRouteAssignment::PatrolRouteAssignment(Actor *a, Common::SeekableReadStrea
debugC(4, kDebugSaveload, "... Loading PatrolRouteAssignment");
// Restore route number
- routeNo = stream->readSint16LE();
+ _routeNo = stream->readSint16LE();
// Restore the starting way point
- startingWayPoint = stream->readSint16LE();
+ _startingWayPoint = stream->readSint16LE();
// Restore the ending way point
- endingWayPoint = stream->readSint16LE();
+ _endingWayPoint = stream->readSint16LE();
// Restore the route flags
- routeFlags = stream->readByte();
+ _routeFlags = stream->readByte();
// Restore the assignment flags
- flags = stream->readByte();
+ _flags = stream->readByte();
}
//----------------------------------------------------------------------
@@ -201,11 +201,11 @@ PatrolRouteAssignment::PatrolRouteAssignment(Actor *a, Common::SeekableReadStrea
inline int32 PatrolRouteAssignment::archiveSize(void) const {
return ActorAssignment::archiveSize()
- + sizeof(routeNo)
- + sizeof(startingWayPoint)
- + sizeof(endingWayPoint)
- + sizeof(routeFlags)
- + sizeof(flags);
+ + sizeof(_routeNo)
+ + sizeof(_startingWayPoint)
+ + sizeof(_endingWayPoint)
+ + sizeof(_routeFlags)
+ + sizeof(_flags);
}
void PatrolRouteAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
@@ -215,14 +215,14 @@ void PatrolRouteAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
ActorAssignment::write(out);
// Store the route number
- out->writeSint16LE(routeNo);
- out->writeSint16LE(startingWayPoint);
- out->writeSint16LE(endingWayPoint);
+ out->writeSint16LE(_routeNo);
+ out->writeSint16LE(_startingWayPoint);
+ out->writeSint16LE(_endingWayPoint);
// Store the route flags
- out->writeByte(routeFlags);
+ out->writeByte(_routeFlags);
// Store the assignment flags
- out->writeByte(flags);
+ out->writeByte(_flags);
}
//----------------------------------------------------------------------
@@ -238,7 +238,7 @@ int16 PatrolRouteAssignment::type(void) const {
// of a task which the assignment had created.
void PatrolRouteAssignment::handleTaskCompletion(TaskResult result) {
- if (result == taskSucceeded) flags |= routeCompleted;
+ if (result == taskSucceeded) _flags |= routeCompleted;
}
//----------------------------------------------------------------------
@@ -247,7 +247,7 @@ void PatrolRouteAssignment::handleTaskCompletion(TaskResult result) {
bool PatrolRouteAssignment::isValid(void) {
// If the route has already been completed, then the assignment is
// no longer valid
- if (flags & routeCompleted) return false;
+ if (_flags & routeCompleted) return false;
return ActorAssignment::isValid();
}
@@ -257,22 +257,22 @@ bool PatrolRouteAssignment::isValid(void) {
bool PatrolRouteAssignment::taskNeeded(void) {
// If the route has already been completed, then no task is needed
- return !(flags & routeCompleted);
+ return !(_flags & routeCompleted);
}
//----------------------------------------------------------------------
// Construct a Task for this assignment
Task *PatrolRouteAssignment::getTask(TaskStack *ts) {
- int16 startPoint = startingWayPoint;
+ int16 startPoint = _startingWayPoint;
uint8 mapNum = getActor()->getMapNum();
- startingWayPoint = -1;
+ _startingWayPoint = -1;
if (startPoint == -1) {
int16 i;
uint16 bestDist = maxuint16;
- const PatrolRoute &route = patrolRouteList[mapNum]->getRoute(routeNo);
+ const PatrolRoute &route = patrolRouteList[mapNum]->getRoute(_routeNo);
TilePoint actorLoc = getActor()->getLocation();
for (i = 0; i < route.vertices(); i++) {
@@ -280,7 +280,7 @@ Task *PatrolRouteAssignment::getTask(TaskStack *ts) {
if (dist < bestDist) {
bestDist = dist;
- startPoint = (routeFlags & patrolRouteReverse) ? i : (i + 1) % route.vertices();
+ startPoint = (_routeFlags & patrolRouteReverse) ? i : (i + 1) % route.vertices();
}
}
}
@@ -289,13 +289,13 @@ Task *PatrolRouteAssignment::getTask(TaskStack *ts) {
PatrolRouteIterator
iter = PatrolRouteIterator(
mapNum,
- routeNo,
- routeFlags,
+ _routeNo,
+ _routeFlags,
startPoint);
// Construct a FollowPatrolRouteTask
- return endingWayPoint != -1
- ? new FollowPatrolRouteTask(ts, iter, endingWayPoint)
+ return _endingWayPoint != -1
+ ? new FollowPatrolRouteTask(ts, iter, _endingWayPoint)
: new FollowPatrolRouteTask(ts, iter);
}
@@ -321,11 +321,11 @@ HuntToBeNearLocationAssignment::HuntToBeNearLocationAssignment(Actor *a, const T
void HuntToBeNearLocationAssignment::initialize(
const Target &targ,
uint16 r) {
- assert(targ.size() <= sizeof(targetMem));
+ assert(targ.size() <= sizeof(_targetMem));
// Make a copy of the target
- targ.clone(targetMem);
+ targ.clone(_targetMem);
- range = r;
+ _range = r;
}
HuntToBeNearLocationAssignment::HuntToBeNearLocationAssignment(Actor *a, Common::SeekableReadStream *stream) :
@@ -333,10 +333,10 @@ HuntToBeNearLocationAssignment::HuntToBeNearLocationAssignment(Actor *a, Common:
debugC(4, kDebugSaveload, "... Loading HuntToBeNearLocationAssignment");
// Restore the target
- readTarget(targetMem, stream);
+ readTarget(_targetMem, stream);
// Restore the range
- range = stream->readUint16LE();
+ _range = stream->readUint16LE();
}
//----------------------------------------------------------------------
@@ -346,7 +346,7 @@ HuntToBeNearLocationAssignment::HuntToBeNearLocationAssignment(Actor *a, Common:
inline int32 HuntToBeNearLocationAssignment::archiveSize(void) const {
return ActorAssignment::archiveSize()
+ targetArchiveSize(getTarget())
- + sizeof(range);
+ + sizeof(_range);
}
void HuntToBeNearLocationAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
@@ -359,7 +359,7 @@ void HuntToBeNearLocationAssignment::write(Common::MemoryWriteStreamDynamic *out
writeTarget(getTarget(), out);
// Store the range
- out->writeUint16LE(range);
+ out->writeUint16LE(_range);
}
//----------------------------------------------------------------------
@@ -377,14 +377,14 @@ bool HuntToBeNearLocationAssignment::taskNeeded(void) {
Actor *a = getActor();
TilePoint actorLoc = a->getLocation();
- return !a->inRange(getTarget()->where(a->world(), actorLoc), range);
+ return !a->inRange(getTarget()->where(a->world(), actorLoc), _range);
}
//----------------------------------------------------------------------
// Construct a Task for this assignment
Task *HuntToBeNearLocationAssignment::getTask(TaskStack *ts) {
- return new HuntToBeNearLocationTask(ts, *getTarget(), range);
+ return new HuntToBeNearLocationTask(ts, *getTarget(), _range);
}
/* ===================================================================== *
@@ -419,26 +419,26 @@ void HuntToBeNearActorAssignment::initialize(
const ActorTarget &at,
uint16 r,
bool trackFlag) {
- assert(at.size() <= sizeof(targetMem));
+ assert(at.size() <= sizeof(_targetMem));
// Copy the target
- at.clone(targetMem);
+ at.clone(_targetMem);
- range = r;
- flags = trackFlag ? track : 0;
+ _range = r;
+ _flags = trackFlag ? track : 0;
}
HuntToBeNearActorAssignment::HuntToBeNearActorAssignment(Actor *a, Common::SeekableReadStream *stream) :
ActorAssignment(a, stream) {
debugC(4, kDebugSaveload, "... Loading HuntToBeNearActorAssignment");
- readTarget(targetMem, stream);
+ readTarget(_targetMem, stream);
// Restore the range
- range = stream->readUint16LE();
+ _range = stream->readUint16LE();
// Restore the flags
- flags = stream->readByte();
+ _flags = stream->readByte();
}
//----------------------------------------------------------------------
@@ -448,8 +448,8 @@ HuntToBeNearActorAssignment::HuntToBeNearActorAssignment(Actor *a, Common::Seeka
inline int32 HuntToBeNearActorAssignment::archiveSize(void) const {
return ActorAssignment::archiveSize()
+ targetArchiveSize(getTarget())
- + sizeof(range)
- + sizeof(flags);
+ + sizeof(_range)
+ + sizeof(_flags);
}
void HuntToBeNearActorAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
@@ -462,10 +462,10 @@ void HuntToBeNearActorAssignment::write(Common::MemoryWriteStreamDynamic *out) c
writeTarget(getTarget(), out);
// Store the range
- out->writeUint16LE(range);
+ out->writeUint16LE(_range);
// Store the flags
- out->writeByte(flags);
+ out->writeByte(_flags);
}
//----------------------------------------------------------------------
@@ -484,7 +484,7 @@ bool HuntToBeNearActorAssignment::taskNeeded(void) {
TilePoint actorLoc = a->getLocation(),
targetLoc = getTarget()->where(a->world(), actorLoc);
- return !a->inRange(targetLoc, range)
+ return !a->inRange(targetLoc, _range)
|| a->inRange(targetLoc, HuntToBeNearActorTask::tooClose);
}
@@ -495,8 +495,8 @@ Task *HuntToBeNearActorAssignment::getTask(TaskStack *ts) {
return new HuntToBeNearActorTask(
ts,
*getTarget(),
- range,
- (flags & track) != false);
+ _range,
+ (_flags & track) != false);
}
/* ===================================================================== *
@@ -528,12 +528,12 @@ void HuntToKillAssignment::initialize(
const ActorTarget &at,
bool trackFlag,
bool specificActorFlag) {
- assert(at.size() <= sizeof(targetMem));
+ assert(at.size() <= sizeof(_targetMem));
// Copy the target
- at.clone(targetMem);
+ at.clone(_targetMem);
- flags = (trackFlag ? track : 0)
+ _flags = (trackFlag ? track : 0)
| (specificActorFlag ? specificActor : 0);
}
@@ -544,7 +544,7 @@ void HuntToKillAssignment::initialize(
inline int32 HuntToKillAssignment::archiveSize(void) const {
return ActorAssignment::archiveSize()
+ targetArchiveSize(getTarget())
- + sizeof(flags);
+ + sizeof(_flags);
}
void HuntToKillAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
@@ -557,7 +557,7 @@ void HuntToKillAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
writeTarget(getTarget(), out);
// Store the flags
- out->writeByte(flags);
+ out->writeByte(_flags);
}
//----------------------------------------------------------------------
@@ -566,7 +566,7 @@ void HuntToKillAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
bool HuntToKillAssignment::isValid(void) {
// If the target actor is already dead, then this is not a valid
// assignment
- if (flags & specificActor) {
+ if (_flags & specificActor) {
const SpecificActorTarget *sat = (const SpecificActorTarget *)getTarget();
if (sat->getTargetActor()->isDead()) return false;
@@ -591,7 +591,7 @@ int16 HuntToKillAssignment::type(void) const {
bool HuntToKillAssignment::taskNeeded(void) {
// If we're hunting a specific actor, we only need a task if that
// actor is still alive.
- if (flags & specificActor) {
+ if (_flags & specificActor) {
const SpecificActorTarget *sat = (const SpecificActorTarget *)getTarget();
return !sat->getTargetActor()->isDead();
@@ -608,7 +608,7 @@ Task *HuntToKillAssignment::getTask(TaskStack *ts) {
return new HuntToKillTask(
ts,
*getTarget(),
- (flags & track) != false);
+ (_flags & track) != false);
}
/* ===================================================================== *
@@ -619,10 +619,10 @@ TetheredAssignment::TetheredAssignment(Actor *ac, Common::SeekableReadStream *st
debugC(4, kDebugSaveload, "... Loading TetheredAssignment");
// Read data from buffer
- minU = stream->readSint16LE();
- minV = stream->readSint16LE();
- maxU = stream->readSint16LE();
- maxV = stream->readSint16LE();
+ _minU = stream->readSint16LE();
+ _minV = stream->readSint16LE();
+ _maxU = stream->readSint16LE();
+ _maxV = stream->readSint16LE();
}
//----------------------------------------------------------------------
@@ -631,10 +631,10 @@ TetheredAssignment::TetheredAssignment(Actor *ac, Common::SeekableReadStream *st
inline int32 TetheredAssignment::archiveSize(void) const {
return ActorAssignment::archiveSize()
- + sizeof(minU)
- + sizeof(minV)
- + sizeof(maxU)
- + sizeof(maxV);
+ + sizeof(_minU)
+ + sizeof(_minV)
+ + sizeof(_maxU)
+ + sizeof(_maxV);
}
void TetheredAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
@@ -644,10 +644,10 @@ void TetheredAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
ActorAssignment::write(out);
// Copy data to buffer
- out->writeSint16LE(minU);
- out->writeSint16LE(minV);
- out->writeSint16LE(maxU);
- out->writeSint16LE(maxV);
+ out->writeSint16LE(_minU);
+ out->writeSint16LE(_minV);
+ out->writeSint16LE(_maxU);
+ out->writeSint16LE(_maxV);
}
/* ===================================================================== *
@@ -676,7 +676,7 @@ int16 TetheredWanderAssignment::type(void) const {
// Construct a Task for this assignment
Task *TetheredWanderAssignment::getTask(TaskStack *ts) {
- return new TetheredWanderTask(ts, minU, minV, maxU, maxV);
+ return new TetheredWanderTask(ts, _minU, _minV, _maxU, _maxV);
}
/* ===================================================================== *
@@ -688,7 +688,7 @@ Task *TetheredWanderAssignment::getTask(TaskStack *ts) {
AttendAssignment::AttendAssignment(Actor *a, uint16 until, GameObject *o) :
ActorAssignment(a, until),
- obj(o) {
+ _obj(o) {
}
AttendAssignment::AttendAssignment(Actor *a, Common::SeekableReadStream *stream) : ActorAssignment(a, stream) {
@@ -700,7 +700,7 @@ AttendAssignment::AttendAssignment(Actor *a, Common::SeekableReadStream *stream)
objID = stream->readUint16LE();
// Convert the object ID to an object pointer
- obj = objID != Nothing ? GameObject::objectAddress(objID) : NULL;
+ _obj = objID != Nothing ? GameObject::objectAddress(objID) : NULL;
}
//----------------------------------------------------------------------
@@ -721,7 +721,7 @@ void AttendAssignment::write(Common::MemoryWriteStreamDynamic *out) const {
ObjectID objID;
// Convert the object pointer to an object ID
- objID = obj != NULL ? obj->thisID() : Nothing;
+ objID = _obj != NULL ? _obj->thisID() : Nothing;
// Store the object ID
out->writeUint16LE(objID);
@@ -739,7 +739,7 @@ int16 AttendAssignment::type(void) const {
// Construct a Task for this assignment
Task *AttendAssignment::getTask(TaskStack *ts) {
- return new AttendTask(ts, obj);
+ return new AttendTask(ts, _obj);
}
/* ===================================================================== *
diff --git a/engines/saga2/assign.h b/engines/saga2/assign.h
index 41de8fc482..497c5ed83a 100644
--- a/engines/saga2/assign.h
+++ b/engines/saga2/assign.h
@@ -55,8 +55,8 @@ class ActorAssignment {
hasAssignment = (1 << 3)
};
- uint16 startFrame, // Time in day when this was constructed
- endFrame; // End time of the assignment
+ uint16 _startFrame, // Time in day when this was constructed
+ _endFrame; // End time of the assignment
Actor *_actor;
@@ -106,12 +106,12 @@ protected:
* ===================================================================== */
class PatrolRouteAssignment : public ActorAssignment {
- int16 routeNo, // Patrol route number
- startingWayPoint, // Way point at which to start (-1 = default)
- endingWayPoint; // Way point at which to end (-1 = default)
- uint8 routeFlags, // Flags indicating how patrol route should
+ int16 _routeNo, // Patrol route number
+ _startingWayPoint, // Way point at which to start (-1 = default)
+ _endingWayPoint; // Way point at which to end (-1 = default)
+ uint8 _routeFlags, // Flags indicating how patrol route should
// be followed
- flags; // Flags representing the state of this
+ _flags; // Flags representing the state of this
// assignment
enum {
@@ -159,8 +159,8 @@ protected:
* ===================================================================== */
class HuntToBeNearLocationAssignment : public ActorAssignment {
- TargetPlaceHolder targetMem;
- uint16 range;
+ TargetPlaceHolder _targetMem;
+ uint16 _range;
// An initialization function which provides a common ground for
// the initial constructors.
@@ -212,7 +212,7 @@ protected:
Task *getTask(TaskStack *ts);
const Target *getTarget(void) const {
- return (const Target *)targetMem;
+ return (const Target *)_targetMem;
}
};
@@ -221,9 +221,9 @@ protected:
* ===================================================================== */
class HuntToBeNearActorAssignment : public ActorAssignment {
- TargetPlaceHolder targetMem;
- uint16 range;
- uint8 flags;
+ TargetPlaceHolder _targetMem;
+ uint16 _range;
+ uint8 _flags;
enum {
track = (1 << 0) // This hunt is a track.
@@ -291,7 +291,7 @@ protected:
Task *getTask(TaskStack *ts);
const ActorTarget *getTarget(void) const {
- return (const ActorTarget *)targetMem;
+ return (const ActorTarget *)_targetMem;
}
};
@@ -300,8 +300,8 @@ protected:
* ===================================================================== */
class HuntToKillAssignment : public ActorAssignment {
- TargetPlaceHolder targetMem;
- uint8 flags;
+ TargetPlaceHolder _targetMem;
+ uint8 _flags;
enum {
track = (1 << 0), // This hunt is a track.
@@ -366,7 +366,7 @@ protected:
Task *getTask(TaskStack *ts);
const ActorTarget *getTarget(void) const {
- return (const ActorTarget *)targetMem;
+ return (const ActorTarget *)_targetMem;
}
};
@@ -377,19 +377,19 @@ protected:
class TetheredAssignment : public ActorAssignment {
protected:
// Tether region
- int16 minU, // Minimum U coordinate in tether
- minV, // Minimum V coordinate in tether
- maxU, // Maximum U coordinate in tether
- maxV; // Maximum V coordinate in tether
+ int16 _minU, // Minimum U coordinate in tether
+ _minV, // Minimum V coordinate in tether
+ _maxU, // Maximum U coordinate in tether
+ _maxV; // Maximum V coordinate in tether
public:
// Constructor -- initial assignment construction
TetheredAssignment(Actor *a, uint16 until, const TileRegion ®) :
ActorAssignment(a, until),
- minU(reg.min.u),
- minV(reg.min.v),
- maxU(reg.max.u),
- maxV(reg.max.v) {
+ _minU(reg.min.u),
+ _minV(reg.min.v),
+ _maxU(reg.max.u),
+ _maxV(reg.max.v) {
}
TetheredAssignment(Actor *a, Common::SeekableReadStream *stream);
@@ -425,7 +425,7 @@ protected:
* ===================================================================== */
class AttendAssignment : public ActorAssignment {
- GameObject *obj; // Object to which to attend
+ GameObject *_obj; // Object to which to attend
public:
// Constructor -- initial assignment construction
Commit: 7bddd59b77718c27f1d03009c6afec78c2c9724b
https://github.com/scummvm/scummvm/commit/7bddd59b77718c27f1d03009c6afec78c2c9724b
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T01:41:41+09:00
Commit Message:
SAGA2: Rename class and typedefs in audio.h
Changed paths:
engines/saga2/audio.cpp
engines/saga2/audio.h
engines/saga2/beegee.cpp
engines/saga2/idtypes.h
engines/saga2/uidialog.cpp
diff --git a/engines/saga2/audio.cpp b/engines/saga2/audio.cpp
index 4186ec2e21..abdea77a48 100644
--- a/engines/saga2/audio.cpp
+++ b/engines/saga2/audio.cpp
@@ -40,7 +40,7 @@
namespace Saga2 {
-audioInterface *audio;
+AudioInterface *audio;
static const StaticPoint32 VeryFarAway = {32767, 32766};
@@ -59,7 +59,7 @@ extern hResource *voiceResFile; // script resources
extern int32 clickSizes[];
extern uint8 *clickData[];
-soundSegment currentLoop;
+uint32 currentLoop;
hResContext *voiceRes, *musicRes, *soundRes, *loopRes, *longRes;
@@ -88,7 +88,7 @@ bool hResCheckResID(hResContext *hrc, uint32 s[]);
//-----------------------------------------------------------------------
// our distance based volume attenuator
-static byte volumeFromDist(sampleLocation loc, byte maxVol) {
+static byte volumeFromDist(Point32 loc, byte maxVol) {
TilePoint tp(loc.x, loc.y, 0);
uint32 dist = tp.quickHDistance();
if (dist < fullVolumeDist) {
@@ -422,8 +422,8 @@ void playLoopAt(uint32 s, Point32 loc) {
audio->stopLoop();
}
-void addAuxTheme(Location loc, soundSegment lid);
-void killAuxTheme(soundSegment lid);
+void addAuxTheme(Location loc, uint32 lid);
+void killAuxTheme(uint32 lid);
void killAllAuxThemes(void);
void playLoopAt(uint32 s, Location playAt) {
@@ -545,7 +545,7 @@ void PlayMusic(char IDstr[]) {
////////////////////////////////////////////////////////////////
bool initAudio() {
- audio = new audioInterface();
+ audio = new AudioInterface();
return true;
}
@@ -553,28 +553,28 @@ void cleanupAudio() {
delete audio;
}
-audioInterface::audioInterface() {
+AudioInterface::AudioInterface() {
_music = nullptr;
_mixer = g_system->getMixer();
}
-audioInterface::~audioInterface() {
+AudioInterface::~AudioInterface() {
delete _music;
}
-void audioInterface::initAudioInterface(hResContext *musicContext) {
+void AudioInterface::initAudioInterface(hResContext *musicContext) {
_music = new Music(musicContext);
}
-bool audioInterface::playFlag(void) {
- debugC(5, kDebugSound, "audioInterface::playFlag()");
+bool AudioInterface::playFlag(void) {
+ debugC(5, kDebugSound, "AudioInterface::playFlag()");
if (_speechQueue.size() == 0 && !_mixer->isSoundHandleActive(_speechSoundHandle))
_currentSpeech.seg = 0;
return _speechQueue.size() > 0 || _sfxQueue.size() > 0;
}
-void audioInterface::playMe(void) {
+void AudioInterface::playMe(void) {
if (_speechQueue.size() > 0 && !_mixer->isSoundHandleActive(_speechSoundHandle)) {
SoundInstance si = _speechQueue.front();
_speechQueue.pop_front();
@@ -601,7 +601,7 @@ void audioInterface::playMe(void) {
}
}
-void audioInterface::playMusic(soundSegment s, int16 loopFactor, sampleLocation where) {
+void AudioInterface::playMusic(uint32 s, int16 loopFactor, Point32 where) {
_music->play(s, loopFactor ? MUSIC_LOOP : MUSIC_NORMAL);
_currentMusic.seg = s;
@@ -609,11 +609,11 @@ void audioInterface::playMusic(soundSegment s, int16 loopFactor, sampleLocation
_currentMusic.loc = where;
}
-void audioInterface::stopMusic(void) {
+void AudioInterface::stopMusic(void) {
_music->stop();
}
-void audioInterface::queueSound(soundSegment s, int16 loopFactor, sampleLocation where) {
+void AudioInterface::queueSound(uint32 s, int16 loopFactor, Point32 where) {
SoundInstance si;
si.seg = s;
@@ -623,7 +623,7 @@ void audioInterface::queueSound(soundSegment s, int16 loopFactor, sampleLocation
_sfxQueue.push(si);
}
-void audioInterface::playLoop(soundSegment s, int16 loopFactor, sampleLocation where) {
+void AudioInterface::playLoop(uint32 s, int16 loopFactor, Point32 where) {
_currentLoop.seg = s;
_currentLoop.loop = loopFactor;
_currentLoop.loc = where;
@@ -636,11 +636,11 @@ void audioInterface::playLoop(soundSegment s, int16 loopFactor, sampleLocation w
_mixer->playStream(Audio::Mixer::kSFXSoundType, &audio->_loopSoundHandle, laud, -1, vol);
}
-void audioInterface::stopLoop(void) {
+void AudioInterface::stopLoop(void) {
_mixer->stopHandle(_loopSoundHandle);
}
-void audioInterface::setLoopPosition(sampleLocation newLoc) {
+void AudioInterface::setLoopPosition(Point32 newLoc) {
if (_currentLoop.loc == newLoc)
return;
@@ -650,7 +650,7 @@ void audioInterface::setLoopPosition(sampleLocation newLoc) {
_mixer->setChannelVolume(_loopSoundHandle, vol);
}
-void audioInterface::queueVoice(soundSegment s, sampleLocation where) {
+void AudioInterface::queueVoice(uint32 s, Point32 where) {
SoundInstance si;
si.seg = s;
@@ -660,10 +660,10 @@ void audioInterface::queueVoice(soundSegment s, sampleLocation where) {
_speechQueue.push_back(si);
}
-void audioInterface::queueVoice(soundSegment s[], sampleLocation where) {
+void AudioInterface::queueVoice(uint32 s[], Point32 where) {
SoundInstance si;
- soundSegment *p = s;
+ uint32 *p = s;
while (*p) {
si.seg = *p;
si.loop = false;
@@ -674,15 +674,15 @@ void audioInterface::queueVoice(soundSegment s[], sampleLocation where) {
}
}
-void audioInterface::stopVoice(void) {
+void AudioInterface::stopVoice(void) {
_mixer->stopHandle(_speechSoundHandle);
}
-bool audioInterface::talking(void) {
+bool AudioInterface::talking(void) {
return _mixer->isSoundHandleActive(_speechSoundHandle);
}
-bool audioInterface::saying(soundSegment s) {
+bool AudioInterface::saying(uint32 s) {
if (_currentSpeech.seg == s)
return true;
@@ -693,7 +693,7 @@ bool audioInterface::saying(soundSegment s) {
return false;
}
-byte audioInterface::getVolume(VolumeTarget src) {
+byte AudioInterface::getVolume(VolumeTarget src) {
switch (src) {
case kVolMusic:
return ConfMan.getInt("music_volume");
@@ -708,11 +708,11 @@ byte audioInterface::getVolume(VolumeTarget src) {
return 0;
}
-void audioInterface::suspend(void) {
+void AudioInterface::suspend(void) {
_mixer->pauseAll(true);
}
-void audioInterface::resume(void) {
+void AudioInterface::resume(void) {
_mixer->pauseAll(false);
}
diff --git a/engines/saga2/audio.h b/engines/saga2/audio.h
index 692f5ef66c..bc1b787c65 100644
--- a/engines/saga2/audio.h
+++ b/engines/saga2/audio.h
@@ -34,8 +34,6 @@ namespace Saga2 {
class Music;
class hResContext;
-typedef Point32 sampleLocation;
-
#define Here Point32(0,0)
enum VolumeTarget {
@@ -45,12 +43,12 @@ enum VolumeTarget {
};
struct SoundInstance {
- soundSegment seg;
+ uint32 seg;
bool loop;
- sampleLocation loc;
+ Point32 loc;
};
-class audioInterface {
+class AudioInterface {
private:
SoundInstance _currentSpeech;
SoundInstance _currentLoop;
@@ -71,8 +69,8 @@ public:
public:
// ctor, dtor, initialization
- audioInterface();
- ~audioInterface();
+ AudioInterface();
+ ~AudioInterface();
// init, cleanup
void initAudioInterface(hResContext *musicContext);
@@ -82,26 +80,26 @@ public:
void playMe(void);
// music calls
- void playMusic(soundSegment s, int16 loopFactor = 1, sampleLocation where = Here);
+ void playMusic(uint32 s, int16 loopFactor = 1, Point32 where = Here);
void stopMusic(void);
// sound calls
- void queueSound(soundSegment s, int16 loopFactor = 1, sampleLocation where = Here);
+ void queueSound(uint32 s, int16 loopFactor = 1, Point32 where = Here);
// loop calls
- void playLoop(soundSegment s, int16 loopFactor = 0, sampleLocation where = Here);
+ void playLoop(uint32 s, int16 loopFactor = 0, Point32 where = Here);
void stopLoop(void);
- void setLoopPosition(sampleLocation newLoc);
- soundSegment currentLoop(void) {
+ void setLoopPosition(Point32 newLoc);
+ uint32 currentLoop(void) {
return _currentLoop.seg;
}
// voice calls
- void queueVoice(soundSegment s, sampleLocation where = Here);
- void queueVoice(soundSegment s[], sampleLocation where = Here);
+ void queueVoice(uint32 s, Point32 where = Here);
+ void queueVoice(uint32 s[], Point32 where = Here);
void stopVoice(void);
bool talking(void);
- bool saying(soundSegment s);
+ bool saying(uint32 s);
byte getVolume(VolumeTarget src);
void suspend(void);
diff --git a/engines/saga2/beegee.cpp b/engines/saga2/beegee.cpp
index 0c9bc9e118..97ec6bbd15 100644
--- a/engines/saga2/beegee.cpp
+++ b/engines/saga2/beegee.cpp
@@ -38,7 +38,7 @@ namespace Saga2 {
struct auxAudioTheme {
bool active;
StaticLocation l;
- soundSegment loopID;
+ uint32 loopID;
};
static const StaticTilePoint NullTile = {(int16)minint16, (int16)minint16, (int16)minint16};
@@ -48,8 +48,8 @@ static auxAudioTheme aats[AUXTHEMES] = {
{false, {NullTile, 0}, 0}
};
-void addAuxTheme(Location loc, soundSegment lid);
-void killAuxTheme(soundSegment lid);
+void addAuxTheme(Location loc, uint32 lid);
+void killAuxTheme(uint32 lid);
void killAllAuxThemes(void);
@@ -207,7 +207,7 @@ void initAudioEnvirons(void) {
Looped sound engine
* ===================================================================== */
-void addAuxTheme(Location loc, soundSegment lid) {
+void addAuxTheme(Location loc, uint32 lid) {
for (int i = 0; i < AUXTHEMES; i++) {
if (!aats[i].active) {
aats[i].l.set(loc, loc.context);
@@ -218,7 +218,7 @@ void addAuxTheme(Location loc, soundSegment lid) {
}
}
-void killAuxTheme(soundSegment lid) {
+void killAuxTheme(uint32 lid) {
for (int i = 0; i < AUXTHEMES; i++) {
if (aats[i].active && aats[i].loopID == lid) {
aats[i].active = false;
@@ -257,7 +257,7 @@ void setAreaSound(const TilePoint &) {
TilePoint baseCoords = centerActorCoords() >> kTileUVShift;
TilePoint mtPos;
metaTileNoise loopID = 0;
- soundSegment ss = 0;
+ uint32 ss = 0;
Point32 themePos;
for (int r = 1; r < 5 && loopID == 0 ; r++) {
TileRegion regn;
diff --git a/engines/saga2/idtypes.h b/engines/saga2/idtypes.h
index 78e80481ac..c343112f21 100644
--- a/engines/saga2/idtypes.h
+++ b/engines/saga2/idtypes.h
@@ -227,8 +227,6 @@ typedef int16 SensorID;
typedef int16 BandID;
const BandID NoBand = -1;
-typedef uint32 soundSegment;
-
typedef uint8 gPen; // a pen index number
typedef uint16 weaponID;
diff --git a/engines/saga2/uidialog.cpp b/engines/saga2/uidialog.cpp
index 9a0d268da4..506b6eef2e 100644
--- a/engines/saga2/uidialog.cpp
+++ b/engines/saga2/uidialog.cpp
@@ -33,7 +33,6 @@
#include "saga2/gtextbox.h"
#include "saga2/saveload.h"
#include "saga2/script.h"
-#include "saga2/audio.h"
#include "saga2/uidialog.h"
#include "saga2/document.h"
@@ -81,7 +80,6 @@ APPFUNCV(cmdSaveVolumeSettings);
External declarations
* ===================================================================== */
extern BackWindow *mainWindow;
-extern audioInterface *audio;
extern bool fullInitialized;
/* ===================================================================== *
Commit: 5e2fdae32989850da91defc361cdfed44afbf963
https://github.com/scummvm/scummvm/commit/5e2fdae32989850da91defc361cdfed44afbf963
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T01:41:42+09:00
Commit Message:
SAGA2: Rename class variables/constants in automap.h
Changed paths:
engines/saga2/automap.cpp
engines/saga2/automap.h
diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index 0a6296e2ab..9c5503ddcc 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -54,7 +54,7 @@ requestInfo rInfo;
bool autoMapCheat = false;
#endif
-static CAutoMap *pAutoMap = NULL;
+static AutoMap *pAutoMap = NULL;
/* ===================================================================== *
Constants
@@ -157,42 +157,42 @@ APPFUNC(cmdAutoMapAffFunc);
/* ===================================================================== *
- CAutoMap class implementation
+ AutoMap class implementation
* ===================================================================== */
// ------------------------------------------------------------------------
// ctor
-CAutoMap::CAutoMap(const Rect16 box,
+AutoMap::AutoMap(const Rect16 box,
uint8 *summary,
uint16 ident,
AppFunc *cmd)
: ModalWindow(box, ident, cmd) {
// setup boundry definitions
- sumMapArea = Rect16(0, 0, sumMapAreaWidth, sumMapAreaHeight);
- summaryData = summary;
+ _sumMapArea = Rect16(0, 0, kSumMapAreaWidth, kSumMapAreaHeight);
+ _summaryData = summary;
// init the temporary blit surface port
- if (!NewTempPort(tPort, sumMapArea.width, sumMapArea.height)) {
+ if (!NewTempPort(_tPort, _sumMapArea.width, _sumMapArea.height)) {
return;
}
- trackPos = getCenterActor()->getLocation();
+ _trackPos = getCenterActor()->getLocation();
}
// ------------------------------------------------------------------------
// dtor
-CAutoMap::~CAutoMap() {
+AutoMap::~AutoMap() {
// dispose of temporary pixelmap
- DisposeTempPort(tPort);
+ DisposeTempPort(_tPort);
}
// ------------------------------------------------------------------------
// read map data
-void CAutoMap::locateRegion(void) {
+void AutoMap::locateRegion(void) {
hResContext *areaRes; // tile resource handle
uint16 *trRes;
int16 regionCount;
@@ -209,20 +209,20 @@ void CAutoMap::locateRegion(void) {
assert(trRes != NULL);
regionCount = *trRes;
- centerCoords = trackPos >> (kTileUVShift + kPlatShift);
+ _centerCoords = _trackPos >> (kTileUVShift + kPlatShift);
- localAreaRegion.min.u = localAreaRegion.min.v = 0;
- localAreaRegion.max.u = localAreaRegion.max.v = wMap->mapSize;
+ _localAreaRegion.min.u = _localAreaRegion.min.v = 0;
+ _localAreaRegion.max.u = _localAreaRegion.max.v = wMap->mapSize;
for (i = 0, tr = (TileRect *)(trRes + 1); i < regionCount; i++, tr++) {
- if (centerCoords.u >= tr->uMin
- && centerCoords.u <= tr->uMax
- && centerCoords.v >= tr->vMin
- && centerCoords.v <= tr->vMax) {
- localAreaRegion.min.u = tr->uMin;
- localAreaRegion.max.u = tr->uMax;
- localAreaRegion.min.v = tr->vMin;
- localAreaRegion.max.v = tr->vMax;
+ if (_centerCoords.u >= tr->uMin
+ && _centerCoords.u <= tr->uMax
+ && _centerCoords.v >= tr->vMin
+ && _centerCoords.v <= tr->vMax) {
+ _localAreaRegion.min.u = tr->uMin;
+ _localAreaRegion.max.u = tr->uMax;
+ _localAreaRegion.min.v = tr->vMin;
+ _localAreaRegion.max.v = tr->vMax;
break;
}
}
@@ -231,14 +231,14 @@ void CAutoMap::locateRegion(void) {
auxResFile->disposeContext(areaRes);
- baseCoords.u = centerCoords.u - summaryRadius;
- baseCoords.v = centerCoords.v - summaryRadius;
+ _baseCoords.u = _centerCoords.u - kSummaryRadius;
+ _baseCoords.v = _centerCoords.v - kSummaryRadius;
}
// ------------------------------------------------------------------------
// deactivation
-void CAutoMap::deactivate(void) {
+void AutoMap::deactivate(void) {
selected = 0;
gPanel::deactivate();
}
@@ -246,7 +246,7 @@ void CAutoMap::deactivate(void) {
// ------------------------------------------------------------------------
// activation
-bool CAutoMap::activate(gEventType why) {
+bool AutoMap::activate(gEventType why) {
if (why == gEventMouseDown) { // momentarily depress
selected = 1;
notify(why, 0); // notify App of successful hit
@@ -255,7 +255,7 @@ bool CAutoMap::activate(gEventType why) {
return false;
}
-bool CAutoMap::keyStroke(gPanelMessage &msg) {
+bool AutoMap::keyStroke(gPanelMessage &msg) {
gEvent ev;
switch (msg.key) {
case Common::ASCII_ESCAPE:
@@ -280,7 +280,7 @@ bool CAutoMap::keyStroke(gPanelMessage &msg) {
-gPanel *CAutoMap::keyTest(int16 key) {
+gPanel *AutoMap::keyTest(int16 key) {
switch (key) {
case Common::ASCII_ESCAPE:
case Common::KEYCODE_HOME:
@@ -295,7 +295,7 @@ gPanel *CAutoMap::keyTest(int16 key) {
// ------------------------------------------------------------------------
// mouse movement event handler
-void CAutoMap::pointerMove(gPanelMessage &msg) {
+void AutoMap::pointerMove(gPanelMessage &msg) {
Point16 pos = msg.pickAbsPos;
if (Rect16(extent.x, extent.y, extent.width, extent.height).ptInside(pos)) {
@@ -304,11 +304,11 @@ void CAutoMap::pointerMove(gPanelMessage &msg) {
// Calculate the actual region we are going to draw as the intersection of
// the local dungeon rectangle, and the rectangle of the scrolling map display
// in metatile coords.
- viewRegion.min.u = MAX(localAreaRegion.min.u, baseCoords.u);
- viewRegion.max.u = MIN<int16>(localAreaRegion.max.u, baseCoords.u + (int16)summaryDiameter) - 1;
- viewRegion.min.v = MAX(localAreaRegion.min.v, baseCoords.v);
- viewRegion.max.v = MIN<int16>(localAreaRegion.max.v, baseCoords.v + (int16)summaryDiameter) - 1;
- char *mtext = getMapFeaturesText(viewRegion, currentWorld->mapNum, baseCoords, pos) ;
+ viewRegion.min.u = MAX(_localAreaRegion.min.u, _baseCoords.u);
+ viewRegion.max.u = MIN<int16>(_localAreaRegion.max.u, _baseCoords.u + (int16)kSummaryDiameter) - 1;
+ viewRegion.min.v = MAX(_localAreaRegion.min.v, _baseCoords.v);
+ viewRegion.max.v = MIN<int16>(_localAreaRegion.max.v, _baseCoords.v + (int16)kSummaryDiameter) - 1;
+ char *mtext = getMapFeaturesText(viewRegion, currentWorld->mapNum, _baseCoords, pos) ;
g_vm->_mouseInfo->setText(mtext);
} else {
notify(gEventMouseMove, 0);
@@ -318,7 +318,7 @@ void CAutoMap::pointerMove(gPanelMessage &msg) {
// ------------------------------------------------------------------------
// mouse click event handler
-bool CAutoMap::pointerHit(gPanelMessage &msg) {
+bool AutoMap::pointerHit(gPanelMessage &msg) {
Point16 pos = msg.pickAbsPos;
if (Rect16(0, 0, extent.width, extent.height).ptInside(pos)) {
@@ -329,7 +329,7 @@ bool CAutoMap::pointerHit(gPanelMessage &msg) {
((259 - pos.y) << (kTileUVShift + kPlatShift - 2)) - ((pos.x - 265) << (kTileUVShift + kPlatShift - 3)),
0);
- TilePoint pt = centerPt + (baseCoords << (kTileUVShift + kPlatShift));
+ TilePoint pt = centerPt + (_baseCoords << (kTileUVShift + kPlatShift));
Actor *a = getCenterActor();
@@ -367,7 +367,7 @@ bool CAutoMap::pointerHit(gPanelMessage &msg) {
// ------------------------------------------------------------------------
// mouse drag event handler
-void CAutoMap::pointerDrag(gPanelMessage &) {
+void AutoMap::pointerDrag(gPanelMessage &) {
if (selected) {
notify(gEventMouseDrag, 0);
}
@@ -376,7 +376,7 @@ void CAutoMap::pointerDrag(gPanelMessage &) {
// ------------------------------------------------------------------------
// mouse click release event handler
-void CAutoMap::pointerRelease(gPanelMessage &) {
+void AutoMap::pointerRelease(gPanelMessage &) {
if (selected) notify(gEventMouseUp, 0); // notify App of successful hit
deactivate();
}
@@ -385,7 +385,7 @@ void CAutoMap::pointerRelease(gPanelMessage &) {
// blit
// this drawclipped does not call all inherited drawclip
-void CAutoMap::drawClipped(
+void AutoMap::drawClipped(
gPort &port,
const Point16 &offset,
const Rect16 &clipRect) {
@@ -393,7 +393,7 @@ void CAutoMap::drawClipped(
if (!extent.overlap(clipRect)) return;
// clear out the buffer
- memset(tPort.map->data, 0, sumMapArea.width * sumMapArea.height);
+ memset(_tPort.map->data, 0, _sumMapArea.width * _sumMapArea.height);
// draw the parts of the panel
WindowDecoration *dec;
@@ -411,7 +411,7 @@ void CAutoMap::drawClipped(
Point16 pos(dec->extent.x - extent.x - offset.x,
dec->extent.y - extent.y - offset.y);
- drawCompressedImage(tPort, pos, dec->image);
+ drawCompressedImage(_tPort, pos, dec->image);
}
}
@@ -423,10 +423,10 @@ void CAutoMap::drawClipped(
// Blit the pixelmap to the main screen
port.setMode(drawModeMatte);
- port.bltPixels(*tPort.map,
+ port.bltPixels(*_tPort.map,
0, 0,
extent.x, extent.y,
- sumMapArea.width, sumMapArea.height);
+ _sumMapArea.width, _sumMapArea.height);
// show the cursor again
g_vm->_pointer->show();
@@ -435,7 +435,7 @@ void CAutoMap::drawClipped(
// ------------------------------------------------------------------------
// draw
-void CAutoMap::draw(void) { // redraw the window
+void AutoMap::draw(void) { // redraw the window
// draw the entire panel
drawClipped(g_vm->_mainPort, Point16(0, 0), extent);
}
@@ -444,7 +444,7 @@ void CAutoMap::draw(void) { // redraw the window
// build summary
// create a summary map on the tPort gPixelMap buffer
-void CAutoMap::createSmallMap(void) {
+void AutoMap::createSmallMap(void) {
WorldMapData *wMap = &mapList[currentWorld->mapNum];
uint16 *mapData = wMap->map->mapData;
@@ -461,27 +461,27 @@ void CAutoMap::createSmallMap(void) {
// Info about summary data
gPixelMap map;
- int16 sumSize = tileSumWidth * tileSumHeight;
- int16 tileSumWidthHalved = tileSumWidth / 2;
+ int16 sumSize = kTileSumWidth * kTileSumHeight;
+ int16 tileSumWidthHalved = kTileSumWidth / 2;
// Set up pixel map to blit summary data from
- map.size = Point16(tileSumWidth, tileSumHeight);
+ map.size = Point16(kTileSumWidth, kTileSumHeight);
// optimizations done based on these numbers
assert(sumSize == 64); // opt:2
- baseCoords.u = clamp(0, baseCoords.u, wMap->mapSize - summaryDiameter);
- baseCoords.v = clamp(0, baseCoords.v, wMap->mapSize - summaryDiameter);
+ _baseCoords.u = clamp(0, _baseCoords.u, wMap->mapSize - kSummaryDiameter);
+ _baseCoords.v = clamp(0, _baseCoords.v, wMap->mapSize - kSummaryDiameter);
// Calculate the actual region we are going to draw as the intersection of
// the local dungeon rectangle, and the rectangle of the scrolling map display
// in metatile coords.
- viewRegion.min.u = MAX(localAreaRegion.min.u, baseCoords.u);
- viewRegion.max.u = MIN<int16>(localAreaRegion.max.u, baseCoords.u + (int16)summaryDiameter) - 1;
- viewRegion.min.v = MAX(localAreaRegion.min.v, baseCoords.v);
- viewRegion.max.v = MIN<int16>(localAreaRegion.max.v, baseCoords.v + (int16)summaryDiameter) - 1;
+ viewRegion.min.u = MAX(_localAreaRegion.min.u, _baseCoords.u);
+ viewRegion.max.u = MIN<int16>(_localAreaRegion.max.u, _baseCoords.u + (int16)kSummaryDiameter) - 1;
+ viewRegion.min.v = MAX(_localAreaRegion.min.v, _baseCoords.v);
+ viewRegion.max.v = MIN<int16>(_localAreaRegion.max.v, _baseCoords.v + (int16)kSummaryDiameter) - 1;
- topPt = viewRegion.max - baseCoords;
+ topPt = viewRegion.max - _baseCoords;
xBase = (topPt.u - topPt.v) * tileSumWidthHalved + 261;
yBase = 255 - (topPt.u + topPt.v) * 2;
@@ -502,10 +502,10 @@ void CAutoMap::createSmallMap(void) {
#endif
(mtile & metaTileVisited)) {
// get the tile data
- map.data = &summaryData[(mtile & ~metaTileVisited) << 6];
+ map.data = &_summaryData[(mtile & ~metaTileVisited) << 6];
// blit this tile onto the temp surface
- TBlit(tPort.map,
+ TBlit(_tPort.map,
&map,
x,
y);
@@ -513,27 +513,27 @@ void CAutoMap::createSmallMap(void) {
}
}
- drawMapFeatures(viewRegion, currentWorld->mapNum, baseCoords, tPort);
+ drawMapFeatures(viewRegion, currentWorld->mapNum, _baseCoords, _tPort);
// if (blink)
- if (centerCoords.u >= viewRegion.min.u
- && centerCoords.u <= viewRegion.max.u
- && centerCoords.v >= viewRegion.min.v
- && centerCoords.v <= viewRegion.max.v) {
+ if (_centerCoords.u >= viewRegion.min.u
+ && _centerCoords.u <= viewRegion.max.u
+ && _centerCoords.v >= viewRegion.min.v
+ && _centerCoords.v <= viewRegion.max.v) {
// Calculate the position of the cross-hairs showing the position of
// the center actor.
- centerPt = trackPos - (baseCoords << (kTileUVShift + kPlatShift));
+ centerPt = _trackPos - (_baseCoords << (kTileUVShift + kPlatShift));
x = ((centerPt.u - centerPt.v) >> (kTileUVShift + kPlatShift - 2)) + 261 + 4;
y = 255 + 4 - ((centerPt.u + centerPt.v) >> (kTileUVShift + kPlatShift - 1));
- tPort.setColor(9 + 15); // black
- tPort.fillRect(x - 3, y - 1, 7, 3);
- tPort.fillRect(x - 1, y - 3, 3, 7);
- tPort.setColor(9 + 1); // white
- tPort.hLine(x - 2, y, 5);
- tPort.vLine(x, y - 2, 5);
+ _tPort.setColor(9 + 15); // black
+ _tPort.fillRect(x - 3, y - 1, 7, 3);
+ _tPort.fillRect(x - 1, y - 3, 3, 7);
+ _tPort.setColor(9 + 1); // white
+ _tPort.hLine(x - 2, y, 5);
+ _tPort.vLine(x, y - 2, 5);
}
}
@@ -546,7 +546,7 @@ int16 openAutoMap() {
rInfo.running = true;
hResContext *decRes;
- void *summaryData;
+ void *_summaryData;
void **closeBtnImage;
void **scrollBtnImage;
@@ -561,13 +561,13 @@ int16 openAutoMap() {
decRes = resFile->newContext(MKTAG('A', 'M', 'A', 'P'), "Automap Resources");
// debug
- summaryData = LoadResource(decRes, MKTAG('S', 'U', 'M', currentMapNum), "summary data");
+ _summaryData = LoadResource(decRes, MKTAG('S', 'U', 'M', currentMapNum), "summary data");
// get the graphics associated with the buttons
closeBtnImage = loadButtonRes(decRes, closeButtonResID, numBtnImages);
scrollBtnImage = loadButtonRes(decRes, scrollButtonResID, 2);
- pAutoMap = new CAutoMap(autoMapRect, (uint8 *)summaryData, 0, NULL);
+ pAutoMap = new AutoMap(autoMapRect, (uint8 *)_summaryData, 0, NULL);
new gCompButton(*pAutoMap, closeAutoMapBtnRect, closeBtnImage, numBtnImages, 0, cmdAutoMapQuit);
@@ -591,7 +591,7 @@ int16 openAutoMap() {
unloadImageRes(closeBtnImage, numBtnImages);
unloadImageRes(scrollBtnImage, 2);
- free(summaryData);
+ free(_summaryData);
resFile->disposeContext(decRes);
decRes = NULL;
@@ -629,10 +629,10 @@ APPFUNC(cmdAutoMapScroll) {
static const Rect16 uNegRect(0, scrollBtnHeight / 2, scrollBtnWidth / 2, scrollBtnHeight / 2);
static const Rect16 vNegRect(scrollBtnWidth / 2, scrollBtnHeight / 2, scrollBtnWidth / 2, scrollBtnHeight / 2);
- if (uPosRect.ptInside(ev.mouse)) pAutoMap->baseCoords.u += 2;
- else if (uNegRect.ptInside(ev.mouse)) pAutoMap->baseCoords.u -= 2;
- else if (vPosRect.ptInside(ev.mouse)) pAutoMap->baseCoords.v += 2;
- else if (vNegRect.ptInside(ev.mouse)) pAutoMap->baseCoords.v -= 2;
+ if (uPosRect.ptInside(ev.mouse)) pAutoMap->_baseCoords.u += 2;
+ else if (uNegRect.ptInside(ev.mouse)) pAutoMap->_baseCoords.u -= 2;
+ else if (vPosRect.ptInside(ev.mouse)) pAutoMap->_baseCoords.v += 2;
+ else if (vNegRect.ptInside(ev.mouse)) pAutoMap->_baseCoords.v -= 2;
pAutoMap->draw();
}
@@ -656,7 +656,7 @@ APPFUNC(cmdAutoMapAppFunc) {
}
}
-APPFUNCV(CAutoMap::cmdAutoMapEsc) {
+APPFUNCV(AutoMap::cmdAutoMapEsc) {
requestInfo *ri = (requestInfo *) userData;
if (ri) {
ri->running = 0;
@@ -664,20 +664,20 @@ APPFUNCV(CAutoMap::cmdAutoMapEsc) {
}
}
-APPFUNCV(CAutoMap::cmdAutoMapHome) {
- baseCoords.v += 2;
+APPFUNCV(AutoMap::cmdAutoMapHome) {
+ _baseCoords.v += 2;
draw();
}
-APPFUNCV(CAutoMap::cmdAutoMapEnd) {
- baseCoords.u -= 2;
+APPFUNCV(AutoMap::cmdAutoMapEnd) {
+ _baseCoords.u -= 2;
draw();
}
-APPFUNCV(CAutoMap::cmdAutoMapPgUp) {
- baseCoords.u += 2;
+APPFUNCV(AutoMap::cmdAutoMapPgUp) {
+ _baseCoords.u += 2;
draw();
}
-APPFUNCV(CAutoMap::cmdAutoMapPgDn) {
- baseCoords.v -= 2;
+APPFUNCV(AutoMap::cmdAutoMapPgDn) {
+ _baseCoords.v -= 2;
draw();
}
diff --git a/engines/saga2/automap.h b/engines/saga2/automap.h
index afb80af566..fe933d2168 100644
--- a/engines/saga2/automap.h
+++ b/engines/saga2/automap.h
@@ -31,39 +31,39 @@
namespace Saga2 {
-class CAutoMap : public ModalWindow {
+class AutoMap : public ModalWindow {
private:
enum summaryMapEnum {
- tileSumWidth = 8,
- tileSumHeight = 8,
- sumMapAreaWidth = 544, // the sumMap number could be more efficient
- sumMapAreaHeight = 324,
+ kTileSumWidth = 8,
+ kTileSumHeight = 8,
+ kSumMapAreaWidth = 544, // the sumMap number could be more efficient
+ kSumMapAreaHeight = 324,
- summaryDiameter = 62,
- summaryRadius = summaryDiameter / 2
+ kSummaryDiameter = 62,
+ kSummaryRadius = kSummaryDiameter / 2
};
public:
- TilePoint trackPos,
- centerCoords,
- baseCoords;
- TileRegion localAreaRegion;
+ TilePoint _trackPos,
+ _centerCoords,
+ _baseCoords;
+ TileRegion _localAreaRegion;
private:
// used as a temporary blit surface
- gPort tPort;
+ gPort _tPort;
// tile summary data
- uint8 *summaryData;
- Rect16 sumMapArea;
+ uint8 *_summaryData;
+ Rect16 _sumMapArea;
public:
- CAutoMap(const Rect16 box,
+ AutoMap(const Rect16 box,
uint8 *summary,
uint16 ident,
AppFunc *cmd);
- ~CAutoMap();
+ ~AutoMap();
void drawClipped(gPort &port,
const Point16 &offset,
More information about the Scummvm-git-logs
mailing list