[Scummvm-git-logs] scummvm master -> 0ae8d6c3070fc431400f8af9caf567c5933566a3
a-yyg
76591232+a-yyg at users.noreply.github.com
Thu Aug 19 21:08:03 UTC 2021
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4758d1734e SAGA2: Rename variables in band.h
e4aa889834 SAGA2: Rename variables/constants in beegee.h
d4a3dc97c0 SAGA2: Remove bitarray.h
1fcdb25a19 SAGA2: Rename classes in button.h
0ae8d6c307 SAGA2: Rename class variables in button.h
Commit: 4758d1734ef7e487792f7795767e379027531ef1
https://github.com/scummvm/scummvm/commit/4758d1734ef7e487792f7795767e379027531ef1
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T06:07:30+09:00
Commit Message:
SAGA2: Rename variables in band.h
Changed paths:
engines/saga2/band.cpp
engines/saga2/band.h
diff --git a/engines/saga2/band.cpp b/engines/saga2/band.cpp
index e9cce0eecf..21d22b7366 100644
--- a/engines/saga2/band.cpp
+++ b/engines/saga2/band.cpp
@@ -255,17 +255,17 @@ void cleanupBands(void) {
Band member functions
* ===================================================================== */
-Band::Band() : leader(nullptr), memberCount(0) {
+Band::Band() : _leader(nullptr), _memberCount(0) {
g_vm->_bandList->addBand(this);
- for (int i = 0; i < maxBandMembers; i++)
- members[i] = nullptr;
+ for (int i = 0; i < kMaxBandMembers; i++)
+ _members[i] = nullptr;
}
-Band::Band(Actor *l) : leader(l), memberCount(0) {
+Band::Band(Actor *l) : _leader(l), _memberCount(0) {
g_vm->_bandList->addBand(this);
- for (int i = 0; i < maxBandMembers; i++)
- members[i] = nullptr;
+ for (int i = 0; i < kMaxBandMembers; i++)
+ _members[i] = nullptr;
}
Band::Band(Common::InSaveFile *in) {
@@ -273,24 +273,24 @@ Band::Band(Common::InSaveFile *in) {
// Restore the leader pointer
assert(isActor(leaderID));
- leader = (Actor *)GameObject::objectAddress(leaderID);
+ _leader = (Actor *)GameObject::objectAddress(leaderID);
debugC(4, kDebugSaveload, "... leaderID = %d", leaderID);
// Restore the member count
- memberCount = in->readSint16LE();
- assert(memberCount < ARRAYSIZE(members));
+ _memberCount = in->readSint16LE();
+ assert(_memberCount < ARRAYSIZE(_members));
- debugC(4, kDebugSaveload, "... memberCount = %d", memberCount);
+ debugC(4, kDebugSaveload, "... _memberCount = %d", _memberCount);
- for (int i = 0; i < maxBandMembers; i++)
- members[i] = nullptr;
+ for (int i = 0; i < kMaxBandMembers; i++)
+ _members[i] = nullptr;
// Restore the member pointers
- for (int i = 0; i < memberCount; i++) {
+ for (int i = 0; i < _memberCount; i++) {
ObjectID id = in->readUint16LE();
assert(isActor(id));
- members[i] = (Actor *)GameObject::objectAddress(id);
+ _members[i] = (Actor *)GameObject::objectAddress(id);
debugC(4, kDebugSaveload , "... id = %d", id);
}
@@ -302,25 +302,25 @@ Band::Band(Common::InSaveFile *in) {
int32 Band::archiveSize(void) {
return sizeof(ObjectID) // leader ID
- + sizeof(memberCount)
- + sizeof(ObjectID) * memberCount; // members' ID's
+ + sizeof(_memberCount)
+ + sizeof(ObjectID) * _memberCount; // members' ID's
}
void Band::write(Common::MemoryWriteStreamDynamic *out) {
// Store the leader's ID
- out->writeUint16LE(leader->thisID());
+ out->writeUint16LE(_leader->thisID());
- debugC(4, kDebugSaveload, "... leader->thisID() = %d", leader->thisID());
+ debugC(4, kDebugSaveload, "... _leader->thisID() = %d", _leader->thisID());
// Store the member count
- out->writeSint16LE(memberCount);
+ out->writeSint16LE(_memberCount);
- debugC(4, kDebugSaveload, "... memberCount = %d", memberCount);
+ debugC(4, kDebugSaveload, "... _memberCount = %d", _memberCount);
// Store the members' ID's
- for (int i = 0; i < memberCount; i++) {
- out->writeUint16LE(members[i]->thisID());
- debugC(4, kDebugSaveload, "... members[%d]->thisID() = %d", i, members[i]->thisID());
+ for (int i = 0; i < _memberCount; i++) {
+ out->writeUint16LE(_members[i]->thisID());
+ debugC(4, kDebugSaveload, "... _members[%d]->thisID() = %d", i, _members[i]->thisID());
}
}
diff --git a/engines/saga2/band.h b/engines/saga2/band.h
index 8a0fbdef50..96013f875d 100644
--- a/engines/saga2/band.h
+++ b/engines/saga2/band.h
@@ -31,7 +31,6 @@ namespace Saga2 {
class Actor;
class Band;
-const int maxBandMembers = 32;
/* ===================================================================== *
Function prototypes
@@ -115,10 +114,14 @@ public:
* ===================================================================== */
class Band {
- Actor *leader;
+ enum {
+ kMaxBandMembers = 32
+ };
+
+ Actor *_leader;
- int16 memberCount;
- Actor *members[maxBandMembers];
+ int16 _memberCount;
+ Actor *_members[kMaxBandMembers];
public:
@@ -136,12 +139,12 @@ public:
void write(Common::MemoryWriteStreamDynamic *out);
Actor *getLeader(void) {
- return leader;
+ return _leader;
}
bool add(Actor *newMember) {
- if (memberCount < ARRAYSIZE(members)) {
- members[memberCount++] = newMember;
+ if (_memberCount < ARRAYSIZE(_members)) {
+ _members[_memberCount++] = newMember;
return true;
} else
return false;
@@ -150,12 +153,12 @@ public:
void remove(Actor *member) {
int i;
- for (i = 0; i < memberCount; i++) {
- if (members[i] == member) {
- memberCount--;
+ for (i = 0; i < _memberCount; i++) {
+ if (_members[i] == member) {
+ _memberCount--;
- for (; i < memberCount; i++)
- members[i] = members[i + 1];
+ for (; i < _memberCount; i++)
+ _members[i] = _members[i + 1];
break;
}
@@ -163,21 +166,21 @@ public:
}
void remove(int index) {
- assert(index < memberCount);
+ assert(index < _memberCount);
int i;
- memberCount--;
+ _memberCount--;
- for (i = index; i < memberCount; i++)
- members[i] = members[i + 1];
+ for (i = index; i < _memberCount; i++)
+ _members[i] = _members[i + 1];
}
int size(void) {
- return memberCount;
+ return _memberCount;
}
Actor *const &operator [](int index) {
- return members[index];
+ return _members[index];
}
};
Commit: e4aa889834a04eee217bff4dba8ebe3129ef91b6
https://github.com/scummvm/scummvm/commit/e4aa889834a04eee217bff4dba8ebe3129ef91b6
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T06:07:30+09:00
Commit Message:
SAGA2: Rename variables/constants in beegee.h
Changed paths:
engines/saga2/beegee.cpp
engines/saga2/beegee.h
diff --git a/engines/saga2/beegee.cpp b/engines/saga2/beegee.cpp
index 97ec6bbd15..de49342528 100644
--- a/engines/saga2/beegee.cpp
+++ b/engines/saga2/beegee.cpp
@@ -67,6 +67,10 @@ enum audioTerrains {
kAudioTerrainLIMIT
};
+enum {
+ kCheckGameTime = 1000
+};
+
struct IntermittentAudioRecord {
int noSoundOdds;
int soundOdds[4];
@@ -120,8 +124,6 @@ inline int8 musicMapping(int16 musicChoice) {
const static StaticTilePoint AudibilityVector = { 1, 1, 0 };
-const int32 checkGameTime = 1000;
-
/* ===================================================================== *
Imports
* ===================================================================== */
@@ -153,7 +155,7 @@ static bool playingExternalLoop = false;
int activeFactions[maxFactions];
-static StaticTilePoint themeVectors[MaxThemes] = {
+static StaticTilePoint themeVectors[kMaxThemes] = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
@@ -174,7 +176,7 @@ static StaticTilePoint themeVectors[MaxThemes] = {
-int16 themeCount[MaxThemes];
+int16 themeCount[kMaxThemes];
/* ===================================================================== *
Prototypes
@@ -184,7 +186,7 @@ int16 themeCount[MaxThemes];
inline metaTileNoise getSound(MetaTilePtr mt) {
int hmm = mt->HeavyMetaMusic();
- return (hmm >= 0 && hmm < MaxThemes) ? hmm : 0;
+ return (hmm >= 0 && hmm < kMaxThemes) ? hmm : 0;
}
inline uint32 metaNoiseID(metaTileNoise mtnID) {
return mtnID ? MKTAG('T', 'E', 'R', mtnID) : 0;
@@ -359,7 +361,7 @@ void audioEnvironmentCheck(void) {
lastGameTime = gameTime;
if (currentTheme > 0 && currentTheme <= kAudioTerrainLIMIT) {
elapsedGameTime += delta;
- if (elapsedGameTime > checkGameTime) {
+ if (elapsedGameTime > kCheckGameTime) {
int i;
elapsedGameTime = 0;
const IntermittentAudioRecord &iar = intermittentAudioRecords[currentTheme];
@@ -396,9 +398,6 @@ void audioEnvironmentCheck(void) {
//-----------------------------------------------------------------------
// Intermittent sound check
-int Deejay::current = 0;
-int Deejay::currentID = 0;
-
void Deejay::select(void) {
int choice = 0;
#if DEBUG & 0
@@ -406,33 +405,33 @@ void Deejay::select(void) {
choice = 0;
else
#endif
- if (susp)
+ if (_susp)
choice = 0;
- else if (enemy >= 0)
- choice = enemy + 6;
- else if (aggr)
+ else if (_enemy >= 0)
+ choice = _enemy + 6;
+ else if (_aggr)
choice = 5;
- else if (ugd)
+ else if (_ugd)
choice = 3;
//else if ( !day )
// choice=4;
- else if (current != 4 && (current > 2 || current < 1)) {
+ else if (_current != 4 && (_current > 2 || _current < 1)) {
choice = 1 + g_vm->_rnd->getRandomNumber(2);
if (choice == 3) choice++;
} else
- choice = current;
+ choice = _current;
- if (currentID != musicMapping(choice)) {
- currentID = musicMapping(choice);
- if (currentID)
- playMusic(musicResID(currentID));
+ if (_currentID != musicMapping(choice)) {
+ _currentID = musicMapping(choice);
+ if (_currentID)
+ playMusic(musicResID(_currentID));
else
playMusic(0);
}
- current = choice;
+ _current = choice;
#if DEBUG
if (debugAudioThemes) {
- WriteStatusF(8, "Music: %2.2d => %2.2d ", current, currentID);
+ WriteStatusF(8, "Music: %2.2d => %2.2d ", _current, _currentID);
}
#endif
@@ -462,7 +461,7 @@ void useActiveFactions(void) {
if (highCount)
g_vm->_grandMasterFTA->setEnemy(highFaction);
else
- g_vm->_grandMasterFTA->setEnemy(NoEnemy);
+ g_vm->_grandMasterFTA->setEnemy(kNoEnemy);
}
//-----------------------------------------------------------------------
diff --git a/engines/saga2/beegee.h b/engines/saga2/beegee.h
index 72296daa25..038c314d42 100644
--- a/engines/saga2/beegee.h
+++ b/engines/saga2/beegee.h
@@ -29,46 +29,11 @@
namespace Saga2 {
-struct audioEnvironment {
-private:
- static uint8 musicPlaying;
- static uint8 loopPlaying;
- static uint8 soundPlaying;
- static uint32 lastSoundAt;
-
-public:
- uint8 musicID;
- uint8 loopID;
- uint8 sounds;
- uint8 sound[4];
- uint32 maxRandomSoundTime;
- uint32 minRandomSoundTime;
-
- audioEnvironment() {
- musicID = 0;
- loopID = 0;
- sounds = 0;
- sound[0] = 0;
- sound[1] = 0;
- sound[2] = 0;
- sound[3] = 0;
- minRandomSoundTime = 0;
- maxRandomSoundTime = 0;
- }
-
- void activate(void);
- void check(uint32 deltaT);
-
-private:
- void playMusic(uint8 musicID);
- void playLoop(uint8 loopID);
- void playIntermittent(int soundNo);
+enum {
+ kNoEnemy = -1,
+ kMaxThemes = 16
};
-const int16 NoEnemy = -1;
-const int16 MaxThemes = 16;
-const uint32 FarAway = 250;
-
/* ===================================================================== *
Types
* ===================================================================== */
@@ -78,22 +43,24 @@ const uint32 FarAway = 250;
class Deejay {
private:
- int enemy;
- bool aggr;
- bool day;
- bool ugd;
- bool susp;
+ int _enemy;
+ bool _aggr;
+ bool _day;
+ bool _ugd;
+ bool _susp;
- static int current;
- static int currentID;
+ int _current;
+ int _currentID;
public:
Deejay() {
- enemy = -1;
- aggr = false;
- day = true;
- susp = false;
- ugd = false;
+ _enemy = -1;
+ _aggr = false;
+ _day = true;
+ _susp = false;
+ _ugd = false;
+ _current = 0;
+ _currentID = 0;
}
~Deejay() {}
@@ -102,23 +69,23 @@ private:
public:
void setEnemy(int16 enemyType = -1) {
- enemy = enemyType;
+ _enemy = enemyType;
select();
}
void setAggression(bool aggressive) {
- aggr = aggressive;
+ _aggr = aggressive;
select();
}
void setDaytime(bool daytime) {
- day = daytime;
+ _day = daytime;
select();
}
void setSuspend(bool suspended) {
- susp = suspended;
+ _susp = suspended;
select();
}
void setWorld(bool underground) {
- ugd = underground;
+ _ugd = underground;
select();
}
};
Commit: d4a3dc97c02ebb102b9b0897096241acdea576f9
https://github.com/scummvm/scummvm/commit/d4a3dc97c02ebb102b9b0897096241acdea576f9
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T06:07:30+09:00
Commit Message:
SAGA2: Remove bitarray.h
Changed paths:
R engines/saga2/bitarray.h
engines/saga2/oncall.h
diff --git a/engines/saga2/bitarray.h b/engines/saga2/bitarray.h
deleted file mode 100644
index d42dcae68f..0000000000
--- a/engines/saga2/bitarray.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- *
- * Based on the original sources
- * Faery Tale II -- The Halls of the Dead
- * (c) 1993-1996 The Wyrmkeep Entertainment Co.
- */
-
-#ifndef SAGA2_BITARRAY_H
-#define SAGA2_BITARRAY_H
-
-namespace Saga2 {
-
-class BitArray {
-private:
- uint16 size;
- uint32 *b;
-
- void clear(uint16 n) {
- if (n) for (int i = 0; i < n / 32 + 1; i++) b[i] = 0;
- }
-
-public:
-
- BitArray(uint16 newSize = 0) {
- if (newSize) b = (uint32 *)malloc(sizeof(uint32) * (newSize / 32 + 1));
- size = newSize;
- clear(newSize);
- }
-
- ~BitArray() {
- /*if (size) delete[] b;*/ size = 0;
- }
-
- void resize(uint16 newSize) {
- uint32 *t = b;
- if (newSize) {
- b = (uint32 *)malloc(sizeof(uint32) * (newSize / 32 + 1));
- clear(newSize);
- if (size) for (int i = 0; i < MIN(size, newSize) / 32 + 1; i++) b[i] = t[i];
- }
- //if ( size ) delete[] t;
- size = newSize;
- }
-
- uint16 currentSize(void) {
- return size;
- }
-
- uint32 getChunk(uint16 i) {
- return b[i];
- }
-
- bool operator[](uint32 ind) {
- return (ind < size && (b[ind / 32] & ((uint32) 1 << (ind % 32))));
- }
-
- void Bit(uint32 ind, bool val) {
- if (ind < size) {
- if (val) b[ind / 32] |= ((uint32) 1 << (ind % 32));
- else b[ind / 32] &= ~((uint32) 1 << (ind % 32));
- }
- }
-
- void clearAll(void) {
- clear(size);
- }
-
-// Untested below here
-
- friend BitArray operator& (BitArray c, BitArray d) {
- BitArray t(MAX(c.currentSize(), d.currentSize()));
- for (uint16 i = 0; i < t.currentSize(); i++) t.b[i] = c.b[i] & d.b[i];
- return t;
- }
-
- friend BitArray operator| (BitArray c, BitArray d) {
- BitArray t(MAX(c.currentSize(), d.currentSize()));
- for (uint16 i = 0; i < t.currentSize(); i++) t.b[i] = c.b[i] | d.b[i];
- return t;
- }
-
- friend BitArray operator|= (BitArray c, BitArray d) {
- for (uint16 i = 0; i < c.currentSize(); i++) c.b[i] |= d.b[i];
- return c;
- }
-
- friend bool operator!= (BitArray c, BitArray d) {
- for (uint16 i = 0; i < c.currentSize(); i++) if (c.b[i] != d.b[i]) return true;
- return false;
- }
-
- friend BitArray operator^ (BitArray c, BitArray d) {
- BitArray t(MAX(c.currentSize(), d.currentSize()));
- for (uint16 i = 0; i < t.currentSize(); i++) t.b[i] = c.b[i] ^ d.b[i];
- return t;
- }
-
-#ifdef THIS_SHOULD_NOT_BE_DEFINED
- void operator>>=(int a) {
- bool c = b[0] & 1;
- b[0] >>= (uint32)a;
- b[1] >>= (uint32)a;
- b[1] |= ((1 << 31) & (uint32)c);
- }
-
- void operator<<=(int a) {
- bool c = b[1] & (1 << 31);
- b[0] >>= (uint32)a;
- b[0] |= (1 & (uint32)c);
- b[1] >>= (uint32)a;
- }
-
- friend BitArray operator+ (BitArray c, BitArray d) {
- BitArray t(MAX(c.currentSize(), d.currentSize()));
- for (uint16 i = 0; i < t.currentSize(); i++) t.b[i] = c.b[i] + d.b[i];
- return t;
- }
-
- bool isSet(int i) {
- return b[i >> 5] & ((uint32) 1 << (i & 31));
- }
-
- void SetBit(int16 i) {
- b[i / 32] |= ((uint32) 1 << (i % 32)) ;
- }
- void NotBit(int16 i) {
- b[i / 32] &= ~((uint32) 1 << (i % 32));
- }
- void Reset(uint32 c, uint32 d) {
- b[0] = c;
- b[1] = d;
- }
- bool Test() {
- return (b[0] || b[1]);
- }
-#endif
-
-};
-
-} // end of namespace Saga2
-
-#endif
diff --git a/engines/saga2/oncall.h b/engines/saga2/oncall.h
index 4d79be27a2..b054be253e 100644
--- a/engines/saga2/oncall.h
+++ b/engines/saga2/oncall.h
@@ -27,17 +27,13 @@
#ifndef SAGA2_ONCALL_H
#define SAGA2_ONCALL_H
-#include "saga2/bitarray.h"
-
namespace Saga2 {
-#define isValidPtr(p) ((p!=NULL)&&(p!=(void *)0xCDCDCDCD))
-
class HandleArray {
private:
Common::Array<byte*> _handles;
uint32 _tileID;
- byte*(*_loader)(hResID, bool);
+ byte *(*_loader)(hResID, bool);
public:
HandleArray(uint16 size, byte*(*loadfunction)(hResID, bool), uint32 newID) {
for (int i = 0; i < size; ++i)
Commit: 1fcdb25a195a3fa6ff905302dcea34b91ec3e0f9
https://github.com/scummvm/scummvm/commit/1fcdb25a195a3fa6ff905302dcea34b91ec3e0f9
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T06:07:30+09:00
Commit Message:
SAGA2: Rename classes in button.h
Changed paths:
engines/saga2/automap.cpp
engines/saga2/button.cpp
engines/saga2/button.h
engines/saga2/contain.cpp
engines/saga2/contain.h
engines/saga2/document.cpp
engines/saga2/intrface.cpp
engines/saga2/intrface.h
engines/saga2/objects.cpp
engines/saga2/uidialog.cpp
diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index 9c5503ddcc..4ac1a06a70 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -569,9 +569,9 @@ int16 openAutoMap() {
pAutoMap = new AutoMap(autoMapRect, (uint8 *)_summaryData, 0, NULL);
- new gCompButton(*pAutoMap, closeAutoMapBtnRect, closeBtnImage, numBtnImages, 0, cmdAutoMapQuit);
+ new GfxCompButton(*pAutoMap, closeAutoMapBtnRect, closeBtnImage, numBtnImages, 0, cmdAutoMapQuit);
- new gCompButton(*pAutoMap, scrollBtnRect, scrollBtnImage, numBtnImages, 0, cmdAutoMapScroll);
+ new GfxCompButton(*pAutoMap, scrollBtnRect, scrollBtnImage, numBtnImages, 0, cmdAutoMapScroll);
pAutoMap->setDecorations(autoMapDecorations,
ARRAYSIZE(autoMapDecorations),
diff --git a/engines/saga2/button.cpp b/engines/saga2/button.cpp
index 7d1a3bdbef..039a74fd2e 100644
--- a/engines/saga2/button.cpp
+++ b/engines/saga2/button.cpp
@@ -42,7 +42,7 @@ extern void playMemSound(uint32 s); // play click # s
Compressed image class
* ======================================================================= */
-void gCompImage::init(void) {
+void GfxCompImage::init(void) {
compImages = NULL;
max = 0;
min = 0;
@@ -52,7 +52,7 @@ void gCompImage::init(void) {
textFont = &Onyx10Font; // default
}
-gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void *image, uint16 ident,
+GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, uint16 ident,
AppFunc *cmd) : gControl(list, box, NULL, ident, cmd) {
// setup a single image configuration
@@ -66,7 +66,7 @@ gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void *image, uint16
}
}
-gCompImage::gCompImage(gPanelList &list,
+GfxCompImage::GfxCompImage(gPanelList &list,
const Rect16 &box,
uint32 contextID,
char a, char b, char c,
@@ -86,7 +86,7 @@ gCompImage::gCompImage(gPanelList &list,
for (i = 0, rNum = resNum; i < numImages; i++, rNum++) {
compImages[i] = LoadResource(resContext,
MKTAG(a, b, c, rNum),
- " gCompImage ");
+ " GfxCompImage ");
}
max = numImages - 1;
@@ -98,7 +98,7 @@ gCompImage::gCompImage(gPanelList &list,
resContext = NULL;
}
-gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void *image, const char *text, textPallete &pal, uint16 ident,
+GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, const char *text, textPallete &pal, uint16 ident,
AppFunc *cmd) : gControl(list, box, text, ident, cmd) {
// setup a single image configuration
init();
@@ -116,7 +116,7 @@ gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void *image, const c
textPal = pal;
}
-gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void **images,
+GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
int16 numRes, int16 initial,
uint16 ident, AppFunc *cmd) : gControl(list, box, NULL, ident, cmd) {
init();
@@ -131,7 +131,7 @@ gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void **images,
currentImage = clamp(min, initial, max);
}
-gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void **images,
+GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
int16 numRes, int16 initial, const char *text, textPallete &pal,
uint16 ident, AppFunc *cmd) : gControl(list, box, text, ident, cmd) {
init();
@@ -149,7 +149,7 @@ gCompImage::gCompImage(gPanelList &list, const Rect16 &box, void **images,
textPal = pal;
}
-gCompImage::gCompImage(gPanelList &list, const StaticRect &box, void **images,
+GfxCompImage::GfxCompImage(gPanelList &list, const StaticRect &box, void **images,
int16 numRes, int16 initial, const char *text, textPallete &pal,
uint16 ident, AppFunc *cmd) : gControl(list, box, text, ident, cmd) {
init();
@@ -168,7 +168,7 @@ gCompImage::gCompImage(gPanelList &list, const StaticRect &box, void **images,
}
-gCompImage::~gCompImage(void) {
+GfxCompImage::~GfxCompImage(void) {
// delete any allocated image pointers
// for JEFFL: I took out the winklude #ifdefs becuase I belive
// I fixed the problem that was causing the crash under win32
@@ -188,22 +188,22 @@ gCompImage::~gCompImage(void) {
}
}
-void gCompImage::pointerMove(gPanelMessage &msg) {
+void GfxCompImage::pointerMove(gPanelMessage &msg) {
// call the superclass's pointerMove
gControl::pointerMove(msg);
notify(gEventMouseMove, (msg.pointerEnter ? enter : 0) | (msg.pointerLeave ? leave : 0));
}
-void gCompImage::enable(bool abled) {
+void GfxCompImage::enable(bool abled) {
gPanel::enable(abled);
}
-void gCompImage::invalidate(Rect16 *) {
+void GfxCompImage::invalidate(Rect16 *) {
window.update(extent);
}
-void gCompImage::draw(void) {
+void GfxCompImage::draw(void) {
gPort &port = window.windowPort;
Rect16 rect = window.getExtent();
@@ -215,7 +215,7 @@ void gCompImage::draw(void) {
g_vm->_pointer->show(port, extent); // show mouse pointer
}
-void *gCompImage::getCurrentCompImage(void) {
+void *GfxCompImage::getCurrentCompImage(void) {
if (compImages) {
return compImages[currentImage]; // return the image pointed to by compImage
} else {
@@ -224,13 +224,13 @@ void *gCompImage::getCurrentCompImage(void) {
}
// waring! : the number of images has has to be == to the inital number
-void gCompImage::setImages(void **images) {
+void GfxCompImage::setImages(void **images) {
if (images) {
compImages = images;
}
}
-void gCompImage::setImage(void *image) {
+void GfxCompImage::setImage(void *image) {
if (image) {
compImages[0] = image;
max = 0;
@@ -238,7 +238,7 @@ void gCompImage::setImage(void *image) {
}
}
-void gCompImage::select(uint16 val) {
+void GfxCompImage::select(uint16 val) {
setCurrent(val);
if (getEnabled()) {
@@ -246,19 +246,19 @@ void gCompImage::select(uint16 val) {
}
}
-void gCompImage::select(uint16 val, const Rect16 &rect) {
+void GfxCompImage::select(uint16 val, const Rect16 &rect) {
select(val);
setExtent(rect);
}
-void gCompImage::setExtent(const Rect16 &rect) {
+void GfxCompImage::setExtent(const Rect16 &rect) {
// set the new extent
extent = rect;
}
// getCurrentCompImage() is virtual function that should return
// the current image to be displayed (to be used across all sub-classes)
-void gCompImage::drawClipped(gPort &port,
+void GfxCompImage::drawClipped(gPort &port,
const Point16 &offset,
const Rect16 &r) {
if (!extent.overlap(r)) return;
@@ -293,11 +293,11 @@ void gCompImage::drawClipped(gPort &port,
}
/* ===================================================================== *
- gCompImageButton class member functions
+ GfxSpriteImage class member functions
* ===================================================================== */
-gSpriteImage::gSpriteImage(gPanelList &list, const Rect16 &box, GameObject *object, char,
- uint16 ident, AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd) {
+GfxSpriteImage::GfxSpriteImage(gPanelList &list, const Rect16 &box, GameObject *object, char,
+ uint16 ident, AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
// get the prototype for the object
ProtoObj *proto = object->proto();
@@ -310,7 +310,7 @@ gSpriteImage::gSpriteImage(gPanelList &list, const Rect16 &box, GameObject *obje
// getCurrentCompImage() is virtual function that should return
// the current image to be displayed (to be used across all sub-classes)
-void gSpriteImage::drawClipped(gPort &port,
+void GfxSpriteImage::drawClipped(gPort &port,
const Point16 &offset,
const Rect16 &r) {
if (!extent.overlap(r)) return;
@@ -340,10 +340,10 @@ void gSpriteImage::drawClipped(gPort &port,
}
/* ===================================================================== *
- gCompImageButton class member functions
+ GfxCompButton class member functions
* ===================================================================== */
-void gCompButton::loadImages(hResContext *con, hResID res1, hResID res2) {
+void GfxCompButton::loadImages(hResContext *con, hResID res1, hResID res2) {
if (con) {
forImage = LoadResource(con, res1, "CBtn fore image");
resImage = LoadResource(con, res2, "CBtn res image");
@@ -358,7 +358,7 @@ void gCompButton::loadImages(hResContext *con, hResID res1, hResID res2) {
dimmed = false;
}
-void gCompButton::loadImages(hResID contextID, hResID res1, hResID res2) {
+void GfxCompButton::loadImages(hResID contextID, hResID res1, hResID res2) {
// init the resource context handle
hResContext *con = resFile->newContext(contextID,
"container window resource");
@@ -367,33 +367,33 @@ void gCompButton::loadImages(hResID contextID, hResID res1, hResID res2) {
resFile->disposeContext(con); // get rid of this context
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, hResContext *con, hResID resID1, hResID resID2, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd), extent(box) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, hResID resID1, hResID resID2, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
loadImages(con, resID1, resID2);
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, hResID contextID, hResID resID1, hResID resID2, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd), extent(box) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResID contextID, hResID resID1, hResID resID2, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
loadImages(contextID, resID1, resID2);
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd), extent(box) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
loadImages(con, MKTAG(a, b, c, butNum_1), MKTAG(a, b, c, butNum_2));
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, hResID contextID, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd), extent(box) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResID contextID, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
loadImages(contextID, MKTAG(a, b, c, butNum_1), MKTAG(a, b, c, butNum_2));
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, hResContext *con, int16 butNum, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd), extent(box) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, int16 butNum, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
loadImages(con, MKTAG('B', 'T', 'N', butNum), MKTAG('B', 'T', 'N', butNum + 1));
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
forImage = images[0];
resImage = images[1];
@@ -409,8 +409,8 @@ gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void **images, int
extent = box;
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
forImage = images[0];
resImage = images[1];
@@ -426,8 +426,8 @@ gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void **images, int
extent = box;
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, void *newDimImage, bool dimNess, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, void *newDimImage, bool dimNess, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
forImage = images[0];
resImage = images[1];
@@ -448,8 +448,8 @@ gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void **images, int
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void *image, uint16 ident,
- AppFunc *cmd) : gCompImage(list, box, NULL, ident, cmd)
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void *image, uint16 ident,
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd)
{
if (image) {
@@ -467,7 +467,7 @@ gCompButton::gCompButton(gPanelList &list, const Rect16 &box, void *image, uint1
extent = box;
}
-gCompButton::gCompButton(gPanelList &list, const StaticRect &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident, AppFunc *cmd) : gCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
+GfxCompButton::GfxCompButton(gPanelList &list, const StaticRect &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident, AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
forImage = images[0];
resImage = images[1];
@@ -483,7 +483,7 @@ gCompButton::gCompButton(gPanelList &list, const StaticRect &box, void **images,
extent = box;
}
-gCompButton::gCompButton(gPanelList &list, const Rect16 &box, AppFunc *cmd) : gCompImage(list, box, NULL, 0, cmd) {
+GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, cmd) {
forImage = NULL;
resImage = NULL;
dimImage = NULL;
@@ -493,7 +493,7 @@ gCompButton::gCompButton(gPanelList &list, const Rect16 &box, AppFunc *cmd) : gC
extent = box;
}
-gCompButton::~gCompButton(void) {
+GfxCompButton::~GfxCompButton(void) {
if (internalAlloc) {
if (forImage) {
free(forImage);
@@ -512,7 +512,7 @@ gCompButton::~gCompButton(void) {
}
}
-void gCompButton::dim(bool enableFlag) {
+void GfxCompButton::dim(bool enableFlag) {
if (enableFlag) {
if (!dimmed) dimmed = true;
} else {
@@ -523,13 +523,13 @@ void gCompButton::dim(bool enableFlag) {
}
-void gCompButton::deactivate(void) {
+void GfxCompButton::deactivate(void) {
selected = 0;
window.update(extent);
gPanel::deactivate();
}
-bool gCompButton::activate(gEventType why) {
+bool GfxCompButton::activate(gEventType why) {
selected = 1;
window.update(extent);
@@ -541,21 +541,21 @@ bool gCompButton::activate(gEventType why) {
return false;
}
-void gCompButton::pointerMove(gPanelMessage &msg) {
+void GfxCompButton::pointerMove(gPanelMessage &msg) {
if (dimmed) return;
//notify( gEventMouseMove, (msg.pointerEnter ? enter : 0)|(msg.pointerLeave ? leave : 0));
- gCompImage::pointerMove(msg);
+ GfxCompImage::pointerMove(msg);
}
-bool gCompButton::pointerHit(gPanelMessage &) {
+bool GfxCompButton::pointerHit(gPanelMessage &) {
if (dimmed) return false;
activate(gEventMouseDown);
return true;
}
-void gCompButton::pointerRelease(gPanelMessage &) {
+void GfxCompButton::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it.
if (selected) {
@@ -564,23 +564,23 @@ void gCompButton::pointerRelease(gPanelMessage &) {
} else deactivate();
}
-void gCompButton::pointerDrag(gPanelMessage &msg) {
+void GfxCompButton::pointerDrag(gPanelMessage &msg) {
if (selected != msg.inPanel) {
selected = msg.inPanel;
window.update(extent);
}
}
-void gCompButton::enable(bool abled) {
+void GfxCompButton::enable(bool abled) {
gPanel::enable(abled);
}
-void gCompButton::invalidate(Rect16 *) {
+void GfxCompButton::invalidate(Rect16 *) {
window.update(extent);
}
-void gCompButton::draw(void) {
+void GfxCompButton::draw(void) {
gPort &port = window.windowPort;
Rect16 rect = window.getExtent();
@@ -590,7 +590,7 @@ void gCompButton::draw(void) {
g_vm->_pointer->show(port, extent); // show mouse pointer
}
-void *gCompButton::getCurrentCompImage(void) {
+void *GfxCompButton::getCurrentCompImage(void) {
if (dimmed) {
return dimImage;
} else if (selected) {
@@ -601,69 +601,16 @@ void *gCompButton::getCurrentCompImage(void) {
}
/************************************************************************
-* gToggleCompButton -- like a gCompButton but toggle on and off. *
-************************************************************************/
-
-gToggleCompButton::gToggleCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, con, a, b, c, butNum_1, butNum_2, ident, cmd) {
-
-}
-
-
-gToggleCompButton::gToggleCompButton(gPanelList &list, const Rect16 &box, hResContext *con, int16 butNum, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, con, butNum, ident, cmd) {
-
-}
-
-gToggleCompButton::gToggleCompButton(gPanelList &list, const Rect16 &box, void **images, int16 butRes, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, images, butRes, ident, cmd) {
-
-}
-
-gToggleCompButton::gToggleCompButton(gPanelList &list, const Rect16 &box, void **images, int16 butRes, char *text, textPallete &pal, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, images, butRes, text, pal, ident, cmd) {
-
-}
-
-bool gToggleCompButton::activate(gEventType why) {
- if (why == gEventKeyDown || why == gEventMouseDown) {
-// playSound( MKTAG('C','B','T',3) );
-
- selected = !selected;
- window.update(extent);
- gPanel::deactivate();
- notify(gEventNewValue, selected); // notify App of successful hit
- playMemSound(1);
- }
- return false;
-}
-
-bool gToggleCompButton::pointerHit(gPanelMessage &) {
- return activate(gEventMouseDown);
-}
-
-void gToggleCompButton::select(uint16 val) {
- selected = val;
-
- setCurrent(val);
-
- if (getEnabled()) {
- window.update(extent);
- }
-}
-
-
-/************************************************************************
-* gOwnerSelCompButton -- like a gCompButton but does not chage the *
+* GfxOwnerSelCompButton -- like a GfxCompButton but does not chage the *
* selector bit *
************************************************************************/
-gOwnerSelCompButton::gOwnerSelCompButton(gPanelList &list, const Rect16 &box, void **images, int16 butRes, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, images, butRes, ident, cmd) {
+GfxOwnerSelCompButton::GfxOwnerSelCompButton(gPanelList &list, const Rect16 &box, void **images, int16 butRes, uint16 ident,
+ AppFunc *cmd) : GfxCompButton(list, box, images, butRes, ident, cmd) {
}
-bool gOwnerSelCompButton::activate(gEventType why) {
+bool GfxOwnerSelCompButton::activate(gEventType why) {
if (why == gEventKeyDown || why == gEventMouseDown) {
// selected = !selected;
// window.update( extent );
@@ -674,11 +621,11 @@ bool gOwnerSelCompButton::activate(gEventType why) {
return false;
}
-bool gOwnerSelCompButton::pointerHit(gPanelMessage &) {
+bool GfxOwnerSelCompButton::pointerHit(gPanelMessage &) {
return activate(gEventMouseDown);
}
-void gOwnerSelCompButton::select(uint16 val) {
+void GfxOwnerSelCompButton::select(uint16 val) {
selected = val;
setCurrent(val);
@@ -689,11 +636,11 @@ void gOwnerSelCompButton::select(uint16 val) {
}
/************************************************************************
-* gMultCompButton -- like gCompButton but does any number of images *
+* GfxMultCompButton -- like GfxCompButton but does any number of images *
************************************************************************/
-gMultCompButton::gMultCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 resStart, int16 numRes, int16 initial, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
+GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 resStart, int16 numRes, int16 initial, uint16 ident,
+ AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
int16 i, k;
@@ -712,8 +659,8 @@ gMultCompButton::gMultCompButton(gPanelList &list, const Rect16 &box, hResContex
extent = box;
}
-gMultCompButton::gMultCompButton(gPanelList &list, const Rect16 &box, void **newImages, int16 numRes, int16 initial, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
+GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, void **newImages, int16 numRes, int16 initial, uint16 ident,
+ AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
if (!newImages) {
images = NULL;
max = 0;
@@ -734,9 +681,9 @@ gMultCompButton::gMultCompButton(gPanelList &list, const Rect16 &box, void **new
extent = box;
}
-gMultCompButton::gMultCompButton(gPanelList &list, const Rect16 &box, void **newImages,
+GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, void **newImages,
int16 numRes, int16 initial, bool hitResponse, uint16 ident,
- AppFunc *cmd) : gCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
+ AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
if (!newImages) {
images = NULL;
max = 0;
@@ -757,7 +704,7 @@ gMultCompButton::gMultCompButton(gPanelList &list, const Rect16 &box, void **new
extent = box;
}
-gMultCompButton::~gMultCompButton(void) {
+GfxMultCompButton::~GfxMultCompButton(void) {
int16 i;
if (images && internalAlloc) {
@@ -772,7 +719,7 @@ gMultCompButton::~gMultCompButton(void) {
}
}
-bool gMultCompButton::activate(gEventType why) {
+bool GfxMultCompButton::activate(gEventType why) {
if (why == gEventKeyDown || why == gEventMouseDown) {
if (response) {
if (++current > max) {
@@ -789,22 +736,22 @@ bool gMultCompButton::activate(gEventType why) {
return false;
}
-bool gMultCompButton::pointerHit(gPanelMessage &) {
+bool GfxMultCompButton::pointerHit(gPanelMessage &) {
return activate(gEventMouseDown);
}
-void *gMultCompButton::getCurrentCompImage(void) {
+void *GfxMultCompButton::getCurrentCompImage(void) {
return images[current];
}
/* ===================================================================== *
- gSlider class
+ GfxSlider class
* ===================================================================== */
-gSlider::gSlider(gPanelList &list, const Rect16 &box, const Rect16 &imageBox,
+GfxSlider::GfxSlider(gPanelList &list, const Rect16 &box, const Rect16 &imageBox,
int16 sliderStart, int16 sliderEnd, void **newImages, int16 resStart,
int16 initial, uint16 ident,
- AppFunc *cmd) : gMultCompButton(list, box, newImages, resStart, initial, ident, cmd) {
+ AppFunc *cmd) : GfxMultCompButton(list, box, newImages, resStart, initial, ident, cmd) {
int16 calcX;
imageRect = imageBox;
@@ -821,7 +768,7 @@ gSlider::gSlider(gPanelList &list, const Rect16 &box, const Rect16 &imageBox,
extent.width - imageRect.x);
}
-void *gSlider::getCurrentCompImage(void) {
+void *GfxSlider::getCurrentCompImage(void) {
int16 val;
int32 index;
@@ -838,7 +785,7 @@ void *gSlider::getCurrentCompImage(void) {
return images[index];
}
-int16 gSlider::getSliderLenVal(void) {
+int16 GfxSlider::getSliderLenVal(void) {
int16 val = 0;
if (slValMin < 0 && slValMax < 0) {
@@ -854,7 +801,7 @@ int16 gSlider::getSliderLenVal(void) {
return val;
}
-void gSlider::draw(void) {
+void GfxSlider::draw(void) {
gPort &port = window.windowPort;
Point16 offset = Point16(0, 0);
@@ -871,7 +818,7 @@ inline int16 quantizedVolume(uint16 trueVolume) {
return quantized;
}
-void gSlider::drawClipped(gPort &port,
+void GfxSlider::drawClipped(gPort &port,
const Point16 &offset,
const Rect16 &r) {
void *dispImage = getCurrentCompImage();
@@ -886,7 +833,7 @@ void gSlider::drawClipped(gPort &port,
}
}
-bool gSlider::activate(gEventType why) {
+bool GfxSlider::activate(gEventType why) {
if (why == gEventKeyDown || why == gEventMouseDown) {
selected = 1;
window.update(extent);
@@ -896,13 +843,13 @@ bool gSlider::activate(gEventType why) {
return false;
}
-void gSlider::deactivate(void) {
+void GfxSlider::deactivate(void) {
selected = 0;
window.update(extent);
gPanel::deactivate();
}
-bool gSlider::pointerHit(gPanelMessage &msg) {
+bool GfxSlider::pointerHit(gPanelMessage &msg) {
// update the image index
updateSliderIndexes(msg.pickPos);
@@ -913,7 +860,7 @@ bool gSlider::pointerHit(gPanelMessage &msg) {
return true;
}
-void gSlider::pointerMove(gPanelMessage &msg) {
+void GfxSlider::pointerMove(gPanelMessage &msg) {
if (selected) {
// update the image index
updateSliderIndexes(msg.pickPos);
@@ -925,7 +872,7 @@ void gSlider::pointerMove(gPanelMessage &msg) {
}
}
-void gSlider::pointerRelease(gPanelMessage &) {
+void GfxSlider::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it.
if (selected) {
deactivate(); // give back input focus
@@ -933,7 +880,7 @@ void gSlider::pointerRelease(gPanelMessage &) {
} else deactivate();
}
-void gSlider::pointerDrag(gPanelMessage &msg) {
+void GfxSlider::pointerDrag(gPanelMessage &msg) {
// update the image index
updateSliderIndexes(msg.pickPos);
@@ -942,7 +889,7 @@ void gSlider::pointerDrag(gPanelMessage &msg) {
window.update(extent);
}
-void gSlider::updateSliderIndexes(Point16 &pos) {
+void GfxSlider::updateSliderIndexes(Point16 &pos) {
pos.x = quantizedVolume(pos.x);
// get x position units
int32 unit = (extent.width * 100) / clamp(1, pos.x, extent.width);
diff --git a/engines/saga2/button.h b/engines/saga2/button.h
index 0c143d7ecf..e047051789 100644
--- a/engines/saga2/button.h
+++ b/engines/saga2/button.h
@@ -93,7 +93,7 @@ class GameObject;
Compressed image class
* ======================================================================= */
-class gCompImage : public gControl {
+class GfxCompImage : public gControl {
private:
enum {
@@ -124,18 +124,18 @@ public:
leave = (1 << 1)
};
- gCompImage(gPanelList &, const Rect16 &, void *, uint16, AppFunc *cmd = NULL);
+ GfxCompImage(gPanelList &, const Rect16 &, void *, uint16, AppFunc *cmd = NULL);
- gCompImage(gPanelList &, const Rect16 &, void *, const char *,
+ GfxCompImage(gPanelList &, const Rect16 &, void *, const char *,
textPallete &, uint16, AppFunc *cmd = NULL);
- gCompImage(gPanelList &, const Rect16 &, void **, int16, int16,
+ GfxCompImage(gPanelList &, const Rect16 &, void **, int16, int16,
uint16, AppFunc *cmd = NULL);
- gCompImage(gPanelList &, const Rect16 &, void **, int16, int16,
+ GfxCompImage(gPanelList &, const Rect16 &, void **, int16, int16,
const char *, textPallete &, uint16, AppFunc *cmd = NULL);
- gCompImage(gPanelList &list,
+ GfxCompImage(gPanelList &list,
const Rect16 &box,
uint32 contextID,
char a, char b, char c,
@@ -144,10 +144,10 @@ public:
uint16 ident,
AppFunc *cmd);
- gCompImage(gPanelList &, const StaticRect &, void **, int16, int16,
+ GfxCompImage(gPanelList &, const StaticRect &, void **, int16, int16,
const char *, textPallete &, uint16, AppFunc *cmd = NULL);
- ~gCompImage(void);
+ ~GfxCompImage(void);
void pointerMove(gPanelMessage &msg);
void enable(bool);
@@ -176,7 +176,7 @@ public:
const Rect16 &);
};
-class gSpriteImage : public gCompImage {
+class GfxSpriteImage : public GfxCompImage {
private:
// Color set to draw the object.
@@ -187,7 +187,7 @@ protected:
public:
// this one takes a sprite pointer
- gSpriteImage(gPanelList &, const Rect16 &, GameObject *, char,
+ GfxSpriteImage(gPanelList &, const Rect16 &, GameObject *, char,
uint16, AppFunc *cmd = NULL);
@@ -200,7 +200,7 @@ public:
Compressed image button
* ======================================================================= */
-class gCompButton : public gCompImage {
+class GfxCompButton : public GfxCompImage {
protected:
void *forImage; // pointer to forground compress image data
void *resImage; // pointer to resessed compressed image data
@@ -211,45 +211,45 @@ protected:
public:
- gCompButton(gPanelList &, const Rect16 &, hResContext *, hResID res1, hResID res2,
+ GfxCompButton(gPanelList &, const Rect16 &, hResContext *, hResID res1, hResID res2,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, hResID contextID, hResID res1, hResID res2,
+ GfxCompButton(gPanelList &, const Rect16 &, hResID contextID, hResID res1, hResID res2,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, hResContext *, char, char, char, int16, int16,
+ GfxCompButton(gPanelList &, const Rect16 &, hResContext *, char, char, char, int16, int16,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, hResID, char, char, char, int16, int16,
+ GfxCompButton(gPanelList &, const Rect16 &, hResID, char, char, char, int16, int16,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, hResContext *, uint32 resID, int8, int8,
+ GfxCompButton(gPanelList &, const Rect16 &, hResContext *, uint32 resID, int8, int8,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, hResID, uint32, int8, int8,
+ GfxCompButton(gPanelList &, const Rect16 &, hResID, uint32, int8, int8,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, hResContext *, int16,
+ GfxCompButton(gPanelList &, const Rect16 &, hResContext *, int16,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, void **, int16,
+ GfxCompButton(gPanelList &, const Rect16 &, void **, int16,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, void **, int16,
+ GfxCompButton(gPanelList &, const Rect16 &, void **, int16,
const char *, textPallete &, uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, void **, int16, void *, bool,
+ GfxCompButton(gPanelList &, const Rect16 &, void **, int16, void *, bool,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, void *,
+ GfxCompButton(gPanelList &, const Rect16 &, void *,
uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const StaticRect &, void **, int16,
+ GfxCompButton(gPanelList &, const StaticRect &, void **, int16,
const char *, textPallete &, uint16, AppFunc *cmd = NULL);
- gCompButton(gPanelList &, const Rect16 &, AppFunc *cmd = NULL);
+ GfxCompButton(gPanelList &, const Rect16 &, AppFunc *cmd = NULL);
- ~gCompButton(void);
+ ~GfxCompButton(void);
bool activate(gEventType why); // activate the control
@@ -279,43 +279,15 @@ protected:
virtual void *getCurrentCompImage(void);
};
-
-/************************************************************************
-* gToggleCompButton -- like a gCompButton but toggle on and off. *
-************************************************************************/
-
-class gToggleCompButton : public gCompButton {
-public:
- gToggleCompButton(gPanelList &, const Rect16 &, hResContext *, char, char, char, int16, int16,
- uint16, AppFunc *cmd = NULL);
-
- gToggleCompButton(gPanelList &, const Rect16 &, hResContext *, int16,
- uint16, AppFunc *cmd = NULL);
-
- gToggleCompButton(gPanelList &, const Rect16 &, void **, int16,
- uint16, AppFunc *cmd = NULL);
-
- gToggleCompButton(gPanelList &, const Rect16 &, void **, int16,
- char *, textPallete &, uint16, AppFunc *cmd = NULL);
-
-protected:
- bool activate(gEventType why); // activate the control
- bool pointerHit(gPanelMessage &msg);
-
-public:
- void select(uint16 val);
-
-};
-
/************************************************************************
-* gOwnerSelCompButton -- like a gCompButton but does not chage the *
+* GfxOwnerSelCompButton -- like a GfxCompButton but does not chage the *
* selector bit *
************************************************************************/
-class gOwnerSelCompButton : public gCompButton {
+class GfxOwnerSelCompButton : public GfxCompButton {
public:
- gOwnerSelCompButton(gPanelList &, const Rect16 &, void **, int16,
+ GfxOwnerSelCompButton(gPanelList &, const Rect16 &, void **, int16,
uint16, AppFunc *cmd = NULL);
//protected:
@@ -325,10 +297,10 @@ public:
};
/************************************************************************
-* gMultCompButton -- like gCompButton but does any number of images *
+* GfxMultCompButton -- like GfxCompButton but does any number of images *
************************************************************************/
-class gMultCompButton : public gCompButton {
+class GfxMultCompButton : public GfxCompButton {
private:
bool response; // tells whether to display an image when hit.
@@ -341,17 +313,17 @@ protected:
public:
- gMultCompButton(gPanelList &, const Rect16 &, hResContext *, char, char, char, int16, int16, int16,
+ GfxMultCompButton(gPanelList &, const Rect16 &, hResContext *, char, char, char, int16, int16, int16,
uint16, AppFunc *cmd = NULL);
- gMultCompButton(gPanelList &, const Rect16 &, void **, int16, int16,
+ GfxMultCompButton(gPanelList &, const Rect16 &, void **, int16, int16,
uint16, AppFunc *cmd = NULL);
- gMultCompButton(gPanelList &, const Rect16 &, void **,
+ GfxMultCompButton(gPanelList &, const Rect16 &, void **,
int16, int16, bool,
uint16, AppFunc *cmd = NULL);
- ~gMultCompButton(void);
+ ~GfxMultCompButton(void);
int16 getCurrent(void) {
return current;
@@ -380,10 +352,10 @@ protected:
/* ===================================================================== *
- gSlider class
+ GfxSlider class
* ===================================================================== */
-class gSlider : public gMultCompButton {
+class GfxSlider : public GfxMultCompButton {
protected:
Rect16 imageRect;
int16 slValMin;
@@ -392,7 +364,7 @@ protected:
int16 imagePosX;
public:
- gSlider(gPanelList &, const Rect16 &, const Rect16 &, int16, int16,
+ GfxSlider(gPanelList &, const Rect16 &, const Rect16 &, int16, int16,
void **, int16, int16,
uint16, AppFunc *cmd = NULL);
diff --git a/engines/saga2/contain.cpp b/engines/saga2/contain.cpp
index a75fb94e17..7923264e61 100644
--- a/engines/saga2/contain.cpp
+++ b/engines/saga2/contain.cpp
@@ -1162,7 +1162,7 @@ ContainerWindow::ContainerWindow(ContainerNode &nd,
view = NULL;
// create the close button for this window
- closeCompButton = new gCompButton(
+ closeCompButton = new GfxCompButton(
*this,
app.closeRect, // rect for button
containerRes, // resource context
@@ -1189,7 +1189,7 @@ ScrollableContainerWindow::ScrollableContainerWindow(
view = new ContainerView(*this, app.viewRect, nd, app);
// make the button conected to this window
- scrollCompButton = new gCompButton(
+ scrollCompButton = new GfxCompButton(
*this,
app.scrollRect, // rect for button
containerRes, // resource context
@@ -1274,7 +1274,7 @@ void TangibleContainerWindow::setContainerSprite(void) {
sprPos.x = objRect.x - (spr->size.x >> 1); //objRect.x + ( spr->size.x >> 1 );
sprPos.y = objRect.y - (spr->size.y >> 1);
- containerSpriteImg = new gSpriteImage(
+ containerSpriteImg = new GfxSpriteImage(
*this,
Rect16(sprPos.x,
sprPos.y,
@@ -1312,7 +1312,7 @@ IntangibleContainerWindow::IntangibleContainerWindow(
ContainerNode &nd, ContainerAppearanceDef &app)
: ScrollableContainerWindow(nd, app, "MentalWindow") {
// make the button conected to this window
- mindSelectorCompButton = new gMultCompButton(
+ mindSelectorCompButton = new GfxMultCompButton(
*this,
Rect16(49, 15 - 13, 52, 67),
containerRes,
@@ -1342,7 +1342,7 @@ EnchantmentContainerWindow::EnchantmentContainerWindow(
view = new EnchantmentContainerView(*this, nd, app);
// make the button conected to this window
- scrollCompButton = new gCompButton(
+ scrollCompButton = new GfxCompButton(
*this,
app.scrollRect, // rect for button
containerRes, // resource context
@@ -1955,7 +1955,7 @@ APPFUNC(cmdMindContainerFunc) {
g_vm->_mouseInfo->setText(textBuffer);
}
- if (ev.value == gCompImage::leave) {
+ if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(NULL);
}
}
@@ -1977,9 +1977,9 @@ APPFUNC(cmdCloseButtonFunc) {
g_vm->_mouseInfo->setText(NULL);
}
} else if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
g_vm->_mouseInfo->setText(CLOSE_MOUSE);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(NULL);
}
}
@@ -1997,9 +1997,9 @@ APPFUNC(cmdScrollFunc) {
cw->scrollDown();
ev.window->update(cw->getView().getExtent());
} else if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
g_vm->_mouseInfo->setText(SCROLL_MOUSE);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(NULL);
}
}
diff --git a/engines/saga2/contain.h b/engines/saga2/contain.h
index 5d1615fb61..b24535667e 100644
--- a/engines/saga2/contain.h
+++ b/engines/saga2/contain.h
@@ -50,9 +50,9 @@ struct ContainerAppearanceDef;
class CMassWeightIndicator;
class ProtoObj;
-class gCompButton;
-class gCompImage;
-class gMultCompButton;
+class GfxCompButton;
+class GfxCompImage;
+class GfxMultCompButton;
struct TilePoint;
/* ===================================================================== *
@@ -273,7 +273,7 @@ public:
class ContainerWindow : public FloatingWindow {
protected:
- gCompButton *closeCompButton; // the close button object
+ GfxCompButton *closeCompButton; // the close button object
ContainerView *view; // the container view object
public:
@@ -294,7 +294,7 @@ public:
// Base class for all container windows with scroll control
class ScrollableContainerWindow : public ContainerWindow {
protected:
- gCompButton *scrollCompButton;
+ GfxCompButton *scrollCompButton;
public:
ScrollableContainerWindow(ContainerNode &nd,
@@ -314,7 +314,7 @@ public:
// A container window for tangible containers
class TangibleContainerWindow : public ScrollableContainerWindow {
private:
- gCompImage *containerSpriteImg;
+ GfxCompImage *containerSpriteImg;
CMassWeightIndicator *massWeightIndicator;
Rect16 objRect;
@@ -339,7 +339,7 @@ class IntangibleContainerWindow : public ScrollableContainerWindow {
protected:
friend void setMindContainer(int index, IntangibleContainerWindow &cw);
private:
- gMultCompButton *mindSelectorCompButton;
+ GfxMultCompButton *mindSelectorCompButton;
public:
@@ -348,7 +348,7 @@ public:
class EnchantmentContainerWindow : public ContainerWindow {
protected:
- gCompButton *scrollCompButton;
+ GfxCompButton *scrollCompButton;
public:
EnchantmentContainerWindow(ContainerNode &nd,
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index 55f7c7f530..07e1acbba5 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -732,7 +732,7 @@ int16 openScroll(uint16 textScript) {
CDocument *win = NULL;
// close button
- gCompButton *closeScroll;
+ GfxCompButton *closeScroll;
void **closeBtnImage;
uint16 buttonResID = 0;
hResContext *decRes;
@@ -747,7 +747,7 @@ int16 openScroll(uint16 textScript) {
win = new CDocument(scrollAppearance, bookText, &Script10Font, 0, NULL);
// make the quit button
- closeScroll = new gCompButton(*win, scrollAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit);
+ closeScroll = new GfxCompButton(*win, scrollAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit);
closeScroll->accelKey = 0x1B;
@@ -790,7 +790,7 @@ int16 openBook(uint16 textScript) {
// point to book
CDocument *win = NULL;
- gCompButton *closeBook;
+ GfxCompButton *closeBook;
hResContext *decRes;
decRes = resFile->newContext(MKTAG('S', 'C', 'R', 'L'), "book resources");
@@ -799,7 +799,7 @@ int16 openBook(uint16 textScript) {
win = new CDocument(bookAppearance, bookText, &Script10Font, 0, NULL);
// make the quit button
- closeBook = new gCompButton(*win, bookAppearance.closeRect, cmdDocumentQuit);
+ closeBook = new GfxCompButton(*win, bookAppearance.closeRect, cmdDocumentQuit);
closeBook->accelKey = 0x1B;
// attach the structure to the book, open the book
@@ -836,7 +836,7 @@ int16 openParchment(uint16 textScript) {
// point to book
CDocument *win = NULL;
- gCompButton *closeParchment;
+ GfxCompButton *closeParchment;
hResContext *decRes;
decRes = resFile->newContext(MKTAG('S', 'C', 'R', 'L'), "book resources");
@@ -844,7 +844,7 @@ int16 openParchment(uint16 textScript) {
// create the window
win = new CDocument(parchAppearance, bookText, &Script10Font, 0, NULL);
// make the quit button
- closeParchment = new gCompButton(*win, parchAppearance.closeRect, cmdDocumentQuit);
+ closeParchment = new GfxCompButton(*win, parchAppearance.closeRect, cmdDocumentQuit);
closeParchment->accelKey = 0x1B;
// attach the structure to the book, open the book
diff --git a/engines/saga2/intrface.cpp b/engines/saga2/intrface.cpp
index fde4bb7824..8b52eccbf9 100644
--- a/engines/saga2/intrface.cpp
+++ b/engines/saga2/intrface.cpp
@@ -58,9 +58,9 @@ extern uint8 fixedColors[16];
Classes
* ===================================================================== */
-// Private subclass of gCompImage for armor display
+// Private subclass of GfxCompImage for armor display
-class gArmorIndicator : public gCompImage {
+class gArmorIndicator : public GfxCompImage {
public:
ArmorAttributes attr;
void drawClipped(gPort &,
@@ -70,7 +70,7 @@ public:
void setValue(PlayerActorID pID);
gArmorIndicator(gPanelList &list, const Rect16 &box, void *img, uint16 ident, AppFunc *cmd = nullptr)
- : gCompImage(list, box, img, ident, cmd) {
+ : GfxCompImage(list, box, img, ident, cmd) {
attr.damageAbsorbtion = 0;
attr.damageDivider = 1;
attr.defenseBonus = 0;
@@ -288,38 +288,38 @@ static const StaticRect botBox[numButtons] = {
// options button
-gCompButton *optBtn;
+GfxCompButton *optBtn;
gEnchantmentDisplay *enchDisp;
// brother buttons
-gOwnerSelCompButton *julBtn;
-gOwnerSelCompButton *phiBtn;
-gOwnerSelCompButton *kevBtn;
-gCompImage *broBtnFrame;
+GfxOwnerSelCompButton *julBtn;
+GfxOwnerSelCompButton *phiBtn;
+GfxOwnerSelCompButton *kevBtn;
+GfxCompImage *broBtnFrame;
// trio controls
-gMultCompButton *portBtns[kNumViews];
-gOwnerSelCompButton *aggressBtns[kNumViews];
-//gCompButton *jumpBtns[kNumViews];
-gOwnerSelCompButton *centerBtns[kNumViews];
-gOwnerSelCompButton *bandingBtns[kNumViews];
-gCompImage *namePlates[kNumViews];
-gCompImage *namePlateFrames[kNumViews];
+GfxMultCompButton *portBtns[kNumViews];
+GfxOwnerSelCompButton *aggressBtns[kNumViews];
+//GfxCompButton *jumpBtns[kNumViews];
+GfxOwnerSelCompButton *centerBtns[kNumViews];
+GfxOwnerSelCompButton *bandingBtns[kNumViews];
+GfxCompImage *namePlates[kNumViews];
+GfxCompImage *namePlateFrames[kNumViews];
gArmorIndicator *armorInd[kNumViews];
// individual
-gMultCompButton *indivPortBtn;
-gOwnerSelCompButton *indivAggressBtn;
-//gCompButton *indivJumpBtn;
-gOwnerSelCompButton *indivCenterBtn;
-gOwnerSelCompButton *indivBandingBtn;
-gCompImage *indivNamePlate;
-gCompImage *indivNamePlateFrame;
+GfxMultCompButton *indivPortBtn;
+GfxOwnerSelCompButton *indivAggressBtn;
+//GfxCompButton *indivJumpBtn;
+GfxOwnerSelCompButton *indivCenterBtn;
+GfxOwnerSelCompButton *indivBandingBtn;
+GfxCompImage *indivNamePlate;
+GfxCompImage *indivNamePlateFrame;
gArmorIndicator *indivArmorInd;
// mental button/indicators
-gCompButton *menConBtn;
+GfxCompButton *menConBtn;
// [brother panels] compressed image non-allocated pointer arrays
@@ -495,8 +495,8 @@ void CPlaqText::drawClipped(gPort &port,
Portrait control class
* ===================================================================== */
-CPortrait::CPortrait(gMultCompButton **portraits,
- gMultCompButton *indivPort,
+CPortrait::CPortrait(GfxMultCompButton **portraits,
+ GfxMultCompButton *indivPort,
const uint16 numPorts,
uint16 numBrothers) { // numBrothers = post 1
// do some checking
@@ -749,7 +749,7 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
// attach controls to the indivControls panel
// these butttons will get deactivated along with the panel
- pieMass = new gCompImage(*panel,
+ pieMass = new GfxCompImage(*panel,
Rect16(massPiePos.x, massPiePos.y, pieXSize, pieYSize),
pieIndImag,
numPieIndImages,
@@ -757,7 +757,7 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
type,
cmdMassInd);
- pieBulk = new gCompImage(*panel,
+ pieBulk = new GfxCompImage(*panel,
Rect16(bulkPiePos.x, bulkPiePos.y, pieXSize, pieYSize),
pieIndImag,
numPieIndImages,
@@ -766,7 +766,7 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
cmdBulkInd);
// mass/bulk back image
- new gCompImage(*panel,
+ new GfxCompImage(*panel,
Rect16(backImagePos.x, backImagePos.y, backImageXSize, backImageYSize),
massBulkImag,
uiIndiv,
@@ -858,7 +858,7 @@ static uint8 manaColorMap[CManaIndicator::numManaTypes][CManaIndicator::numManaC
};
-CManaIndicator::CManaIndicator(gPanelList &list) : gCompImage(list,
+CManaIndicator::CManaIndicator(gPanelList &list) : GfxCompImage(list,
Rect16(x, y, xSize, ySize),
nullptr,
0,
@@ -1263,7 +1263,7 @@ CHealthIndicator::CHealthIndicator(AppFunc *cmd) {
// health controls for the trio view
// deallocated with panel
for (i = 0; i < numControls; i++) {
- starBtns[i] = new gCompImage(*trioControls,
+ starBtns[i] = new GfxCompImage(*trioControls,
Rect16(starXPos,
starYPos + starYOffset * i,
starXSize,
@@ -1276,7 +1276,7 @@ CHealthIndicator::CHealthIndicator(AppFunc *cmd) {
// image control for the star border/frame trio mode
- new gCompImage(*trioControls,
+ new GfxCompImage(*trioControls,
Rect16(frameXPos,
frameYPos + starYOffset * i,
frameXSize,
@@ -1289,7 +1289,7 @@ CHealthIndicator::CHealthIndicator(AppFunc *cmd) {
}
// health control for individual mode
// deallocated with panel
- indivStarBtn = new gCompImage(*indivControls,
+ indivStarBtn = new GfxCompImage(*indivControls,
Rect16(starXPos,
starYPos,
starXSize,
@@ -1301,7 +1301,7 @@ CHealthIndicator::CHealthIndicator(AppFunc *cmd) {
cmd);
// image control for the star border/frame indiv mode
- new gCompImage(*indivControls,
+ new GfxCompImage(*indivControls,
Rect16(frameXPos,
frameYPos,
frameXSize,
@@ -1328,7 +1328,7 @@ CHealthIndicator::~CHealthIndicator(void) {
// Recalculate and update the health star for a particular brother
-void CHealthIndicator::updateStar(gCompImage *starCtl, int32 bro, int32 baseVitality, int32 curVitality) {
+void CHealthIndicator::updateStar(GfxCompImage *starCtl, int32 bro, int32 baseVitality, int32 curVitality) {
assert(baseVitality >= 0);
int16 maxStar, imageIndex;
@@ -1607,20 +1607,20 @@ void SetupUserControls(void) {
// setup stand alone controls
- optBtn = new gCompButton(*playControls, optBtnRect, optBtnImag, numBtnImages, 0, cmdOptions);
+ optBtn = new GfxCompButton(*playControls, optBtnRect, optBtnImag, numBtnImages, 0, cmdOptions);
enchDisp = new gEnchantmentDisplay(*playControls, 0);
// setup the trio user cntl buttons
for (n = 0; n < kNumViews; n++) {
// portrait button
- portBtns[n] = new gMultCompButton(*trioControls, views[n][index++],
+ portBtns[n] = new GfxMultCompButton(*trioControls, views[n][index++],
portImag[n], numPortImages, 0, false, brotherIDs[n], cmdPortrait);
portBtns[n]->setMousePoll(true);
// aggressive button
- aggressBtns[n] = new gOwnerSelCompButton(*trioControls, views[n][index++],
+ aggressBtns[n] = new GfxOwnerSelCompButton(*trioControls, views[n][index++],
aggressImag, numBtnImages, brotherIDs[n], cmdAggressive);
// name plates that go under the portraits
@@ -1628,19 +1628,19 @@ void SetupUserControls(void) {
armorImag, brotherIDs[n], cmdArmor);
// center on brother
- centerBtns[n] = new gOwnerSelCompButton(*trioControls, views[n][index++],
+ centerBtns[n] = new GfxOwnerSelCompButton(*trioControls, views[n][index++],
centerImag, numBtnImages, brotherIDs[n], cmdCenter);
// banding
- bandingBtns[n] = new gOwnerSelCompButton(*trioControls, views[n][index++],
+ bandingBtns[n] = new GfxOwnerSelCompButton(*trioControls, views[n][index++],
bandingImag, numBtnImages, brotherIDs[n], cmdBand);
// name plates that go under the portraits
- namePlates[n] = new gCompImage(*trioControls, views[n][index++],
+ namePlates[n] = new GfxCompImage(*trioControls, views[n][index++],
namePlateImages[n], 0, nullptr);
// the frames for the name plates
- namePlateFrames[n] = new gCompImage(*trioControls, views[n][index++],
+ namePlateFrames[n] = new GfxCompImage(*trioControls, views[n][index++],
namePlateFrameImag, 0, nullptr);
index = 0;
@@ -1649,30 +1649,30 @@ void SetupUserControls(void) {
// individual control buttons
// portrait button
- indivPortBtn = new gMultCompButton(*indivControls, views[0][index++],
+ indivPortBtn = new GfxMultCompButton(*indivControls, views[0][index++],
portImag[0], numPortImages, 0, false, uiIndiv, cmdPortrait);
indivPortBtn->setMousePoll(true);
// aggressive button
- indivAggressBtn = new gOwnerSelCompButton(*indivControls, views[0][index++],
+ indivAggressBtn = new GfxOwnerSelCompButton(*indivControls, views[0][index++],
aggressImag, numBtnImages, uiIndiv, cmdAggressive);
indivArmorInd = new gArmorIndicator(*indivControls, views[0][index++],
armorImag, uiIndiv, cmdArmor);
// center on brother
- indivCenterBtn = new gOwnerSelCompButton(*indivControls, views[0][index++],
+ indivCenterBtn = new GfxOwnerSelCompButton(*indivControls, views[0][index++],
centerImag, numBtnImages, uiIndiv, cmdCenter);
// banding
- indivBandingBtn = new gOwnerSelCompButton(*indivControls, views[0][index++],
+ indivBandingBtn = new GfxOwnerSelCompButton(*indivControls, views[0][index++],
bandingImag, numBtnImages, uiIndiv, cmdBand);
// name plates that go under the portraits
- indivNamePlate = new gCompImage(*indivControls, views[0][index++],
+ indivNamePlate = new GfxCompImage(*indivControls, views[0][index++],
namePlateImages[0], 0, nullptr);
// the frames for the name plates
- indivNamePlateFrame = new gCompImage(*indivControls, views[0][index++],
+ indivNamePlateFrame = new GfxCompImage(*indivControls, views[0][index++],
namePlateFrameImag, 0, nullptr);
// setup the portrait object
@@ -1683,15 +1683,15 @@ void SetupUserControls(void) {
// mental container button
- menConBtn = new gCompButton(*indivControls, menConBtnRect, menConBtnImag, numBtnImages, uiIndiv, cmdBrain);
+ menConBtn = new GfxCompButton(*indivControls, menConBtnRect, menConBtnImag, numBtnImages, uiIndiv, cmdBrain);
// brother selection buttons >>> need to replace these with sticky buttons
- julBtn = new gOwnerSelCompButton(*indivControls, julBtnRect, julBtnImag, numBtnImages, uiJulian, cmdBroChange);
- phiBtn = new gOwnerSelCompButton(*indivControls, phiBtnRect, phiBtnImag, numBtnImages, uiPhillip, cmdBroChange);
- kevBtn = new gOwnerSelCompButton(*indivControls, kevBtnRect, kevBtnImag, numBtnImages, uiKevin, cmdBroChange);
+ julBtn = new GfxOwnerSelCompButton(*indivControls, julBtnRect, julBtnImag, numBtnImages, uiJulian, cmdBroChange);
+ phiBtn = new GfxOwnerSelCompButton(*indivControls, phiBtnRect, phiBtnImag, numBtnImages, uiPhillip, cmdBroChange);
+ kevBtn = new GfxOwnerSelCompButton(*indivControls, kevBtnRect, kevBtnImag, numBtnImages, uiKevin, cmdBroChange);
// frame for brother buttons
- broBtnFrame = new gCompImage(*indivControls, broBtnRect, broBtnFrameImag, uiIndiv, nullptr);
+ broBtnFrame = new GfxCompImage(*indivControls, broBtnRect, broBtnFrameImag, uiIndiv, nullptr);
// make the mana indicator
ManaIndicator = new CManaIndicator(*indivControls);
@@ -2156,7 +2156,7 @@ APPFUNC(cmdPortrait) {
case gEventMouseMove:
- if (ev.value == gCompImage::leave) {
+ if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
g_vm->_mouseInfo->setDoable(true);
break;
@@ -2232,12 +2232,12 @@ APPFUNC(cmdAggressive) {
// }
// else setAggression( transBroID, !wasAggressive );
} else if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
// set the text in the cursor
g_vm->_mouseInfo->setText(isAggressive(transBroID)
? ON_AGRESS
: OFF_AGRESS);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2265,7 +2265,7 @@ APPFUNC( cmdJump )
APPFUNC(cmdArmor) {
if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
gArmorIndicator *gai = (gArmorIndicator *)ev.panel;
char buf[128];
@@ -2282,7 +2282,7 @@ APPFUNC(cmdArmor) {
// set the text in the cursor
g_vm->_mouseInfo->setText(buf);
}
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2297,12 +2297,12 @@ APPFUNC(cmdCenter) {
else setCenterBrother(transBroID);
}
if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
// set the text in the cursor
g_vm->_mouseInfo->setText(getCenterActorPlayerID() == transBroID
? ON_CENTER
: OFF_CENTER);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2331,12 +2331,12 @@ APPFUNC(cmdBand) {
// }
// else setBanded( transBroID, !wasBanded );
} else if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
// set the text in the cursor
g_vm->_mouseInfo->setText(isBanded(transBroID)
? ON_BANDED
: OFF_BANDED);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2347,8 +2347,8 @@ APPFUNC(cmdOptions) {
OptionsDialog();
//openOptionsPanel();
} else if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) g_vm->_mouseInfo->setText(OPTIONS_PANEL);
- else if (ev.value == gCompImage::leave) g_vm->_mouseInfo->setText(nullptr);
+ if (ev.value == GfxCompImage::enter) g_vm->_mouseInfo->setText(OPTIONS_PANEL);
+ else if (ev.value == GfxCompImage::leave) g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2367,7 +2367,7 @@ APPFUNC(cmdBroChange) {
uint16 panID = ev.panel->id;
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
// working buffer
char buf[bufSize];
char state[stateBufSize];
@@ -2388,7 +2388,7 @@ APPFUNC(cmdBroChange) {
}
// set the text in the cursor
g_vm->_mouseInfo->setText(buf);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2398,12 +2398,12 @@ APPFUNC(cmdHealthStar) {
uint16 transBroID = translatePanID(ev.panel->id);
if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::leave) {
+ if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
return;
}
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
ev.panel->setMousePoll(true);
}
@@ -2423,7 +2423,7 @@ APPFUNC(cmdMassInd) {
GameObject *containerObject = nullptr;
if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
const int bufSize = 40;
int curWeight;
uint16 baseWeight;
@@ -2449,7 +2449,7 @@ APPFUNC(cmdMassInd) {
g_vm->_mouseInfo->setText(buf);
} else
g_vm->_mouseInfo->setText(UNK_WEIGHT_HINT);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2461,7 +2461,7 @@ APPFUNC(cmdBulkInd) {
if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::enter) {
+ if (ev.value == GfxCompImage::enter) {
const int bufSize = 40;
uint16 baseBulk = 100;
char buf[bufSize];
@@ -2487,7 +2487,7 @@ APPFUNC(cmdBulkInd) {
g_vm->_mouseInfo->setText(buf);
} else
g_vm->_mouseInfo->setText(UNK_BULK_HINT);
- } else if (ev.value == gCompImage::leave) {
+ } else if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
}
}
@@ -2495,7 +2495,7 @@ APPFUNC(cmdBulkInd) {
APPFUNC(cmdManaInd) {
if (ev.eventType == gEventMouseMove) {
- if (ev.value != gCompImage::leave) {
+ if (ev.value != GfxCompImage::leave) {
const int BUF_SIZE = 64;
char textBuffer[BUF_SIZE];
int manaType = -1;
diff --git a/engines/saga2/intrface.h b/engines/saga2/intrface.h
index cb35821e7b..55bc44c27e 100644
--- a/engines/saga2/intrface.h
+++ b/engines/saga2/intrface.h
@@ -269,14 +269,14 @@ private:
PortraitType currentState[kNumViews + 1];
uint16 numButtons;
uint16 _numViews;
- gMultCompButton **buttons;
- gMultCompButton *indivButton;
+ GfxMultCompButton **buttons;
+ GfxMultCompButton *indivButton;
void setPortrait(uint16);
public:
// button array, number of buttons per view, num views
- CPortrait(gMultCompButton *[], gMultCompButton *, const uint16, uint16);
+ CPortrait(GfxMultCompButton *[], GfxMultCompButton *, const uint16, uint16);
void ORset(uint16, PortraitType type);
void set(uint16 brotherID, PortraitType type);
@@ -332,8 +332,8 @@ private:
void **pieIndImag;
// image control buttons
- gCompImage *pieMass;
- gCompImage *pieBulk;
+ GfxCompImage *pieMass;
+ GfxCompImage *pieBulk;
public:
@@ -363,7 +363,7 @@ public:
};
-class CManaIndicator : public gCompImage {
+class CManaIndicator : public GfxCompImage {
public:
// sizes of the mana star images
@@ -584,8 +584,8 @@ private:
hResContext *healthRes;
// buttons
- gCompImage *starBtns[numControls];
- gCompImage *indivStarBtn;
+ GfxCompImage *starBtns[numControls];
+ GfxCompImage *indivStarBtn;
// array of pointer to the star imagery
void **starImag;
@@ -593,7 +593,7 @@ private:
// health star frame imagery
void *starFrameImag;
- void updateStar(gCompImage *starCtl, int32 bro, int32 baseVitality, int32 curVitality);
+ void updateStar(GfxCompImage *starCtl, int32 bro, int32 baseVitality, int32 curVitality);
public:
uint16 starIDs[3];
diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp
index ad31eacb24..96b8b7950c 100644
--- a/engines/saga2/objects.cpp
+++ b/engines/saga2/objects.cpp
@@ -4375,7 +4375,7 @@ APPFUNC(cmdBrain) {
}
}
} else if (ev.eventType == gEventMouseMove) {
- if (ev.value == gCompImage::leave) {
+ if (ev.value == GfxCompImage::leave) {
g_vm->_mouseInfo->setText(nullptr);
} else { //if (ev.value == gCompImage::enter)
// set the text in the cursor
diff --git a/engines/saga2/uidialog.cpp b/engines/saga2/uidialog.cpp
index 506b6eef2e..ce5d23baaf 100644
--- a/engines/saga2/uidialog.cpp
+++ b/engines/saga2/uidialog.cpp
@@ -534,7 +534,7 @@ static StaticWindow messageDecorations[kNumMessagePanels] = {
// pointer to the auto aggression button
-gOwnerSelCompButton *autoAggressBtn,
+GfxOwnerSelCompButton *autoAggressBtn,
*autoWeaponBtn,
*nightBtn,
*speechTextBtn;
@@ -696,17 +696,17 @@ int16 FileDialog(int16 fileProcess) {
win = new ModalWindow(saveLoadWindowRect, 0, nullptr);
// make the quit button
- new gCompButton(*win, *saveLoadButtonRects[0], pushBtnIm, numBtnImages, btnStrings[stringIndex][0], pal, 0, cmdDialogQuit);
+ new GfxCompButton(*win, *saveLoadButtonRects[0], pushBtnIm, numBtnImages, btnStrings[stringIndex][0], pal, 0, cmdDialogQuit);
//t->accelKey=0x1B;
// make the Save/Load button
- new gCompButton(*win, *saveLoadButtonRects[1], pushBtnIm, numBtnImages, btnStrings[stringIndex][1], pal, fileProcess, fileCommands[fileProcess]);
+ new GfxCompButton(*win, *saveLoadButtonRects[1], pushBtnIm, numBtnImages, btnStrings[stringIndex][1], pal, fileProcess, fileCommands[fileProcess]);
//t->accelKey=0x0D;
// make the up arrow
- new gCompButton(*win, *saveLoadButtonRects[2], arrowUpIm, numBtnImages, 0, cmdSaveDialogUp);
+ new GfxCompButton(*win, *saveLoadButtonRects[2], arrowUpIm, numBtnImages, 0, cmdSaveDialogUp);
//t->accelKey=33+0x80;
// make the down arrow
- new gCompButton(*win, *saveLoadButtonRects[3], arrowDnIm, numBtnImages, 0, cmdSaveDialogDown);
+ new GfxCompButton(*win, *saveLoadButtonRects[3], arrowDnIm, numBtnImages, 0, cmdSaveDialogDown);
//t->accelKey=34+0x80;
// attach the title
new CPlaqText(*win, *saveLoadTextRects[0], textStrings[stringIndex][0], &Plate18Font, 0, pal, 0, nullptr);
@@ -842,60 +842,60 @@ int16 OptionsDialog(bool disableSaveResume) {
// create the window
win = new ModalWindow(optionsWindowRect, 0, nullptr);
- gCompButton *t;
+ GfxCompButton *t;
// buttons
if (!disableSaveResume) {
- t = new gCompButton(*win, *optionsButtonRects[0],
+ t = new GfxCompButton(*win, *optionsButtonRects[0],
dialogPushImag, numBtnImages, btnStrings[0], pal, 0, cmdDialogQuit);
t->accelKey = 0x1B;
- t = new gCompButton(*win, *optionsButtonRects[1],
+ t = new GfxCompButton(*win, *optionsButtonRects[1],
dialogPushImag, numBtnImages, btnStrings[1], pal, 0, cmdOptionsSaveGame); // make the quit button
t->accelKey = 'S';
} else {
- t = new gCompButton(*win, *optionsButtonRects[1],
+ t = new GfxCompButton(*win, *optionsButtonRects[1],
dialogPushImag, numBtnImages, OPTN_DIALOG_BUTTON6, pal, 0, cmdOptionsNewGame);
t->accelKey = 'N';
}
- t = new gCompButton(*win, *optionsButtonRects[2],
+ t = new GfxCompButton(*win, *optionsButtonRects[2],
dialogPushImag, numBtnImages, btnStrings[2], pal, 0, cmdOptionsLoadGame); // make the quit button
t->accelKey = 'L';
- t = new gCompButton(*win, *optionsButtonRects[3],
+ t = new GfxCompButton(*win, *optionsButtonRects[3],
dialogPushImag, numBtnImages, btnStrings[3], pal, 0, cmdQuitGame);
t->accelKey = 'Q';
- t = new gCompButton(*win, *optionsButtonRects[4],
+ t = new GfxCompButton(*win, *optionsButtonRects[4],
dialogPushImag, numBtnImages, btnStrings[4], pal, 0, cmdCredits);
t->accelKey = 'C';
- autoAggressBtn = new gOwnerSelCompButton(*win, *optionsButtonRects[5],
+ autoAggressBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[5],
checkImag, numBtnImages, 0, cmdAutoAggression);
autoAggressBtn->select(isAutoAggressionSet());
- autoWeaponBtn = new gOwnerSelCompButton(*win, *optionsButtonRects[6],
+ autoWeaponBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[6],
checkImag, numBtnImages, 0, cmdAutoWeapon);
autoWeaponBtn->select(isAutoWeaponSet());
- speechTextBtn = new gOwnerSelCompButton(*win, *optionsButtonRects[7],
+ speechTextBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[7],
checkImag, numBtnImages, 0, cmdSpeechText);
speechTextBtn->select(g_vm->_speechText);
- nightBtn = new gOwnerSelCompButton(*win, *optionsButtonRects[8],
+ nightBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[8],
checkImag, numBtnImages, 0, cmdNight);
nightBtn->select(g_vm->_showNight);
- new gSlider(*win, optTopSliderRect, optTopFaceRect, 0,
+ new GfxSlider(*win, optTopSliderRect, optTopFaceRect, 0,
Audio::Mixer::kMaxMixerVolume, slideFaceImag, numSlideFace, ConfMan.getInt("sfx_volume"),
0, cmdSetSoundVolume);
- new gSlider(*win, optMidSliderRect, optMidFaceRect, 0,
+ new GfxSlider(*win, optMidSliderRect, optMidFaceRect, 0,
Audio::Mixer::kMaxMixerVolume, slideFaceImag, numSlideFace, ConfMan.getInt("speech_volume"),
0, cmdSetSpeechVolume);
- new gSlider(*win, optBotSliderRect, optBotFaceRect, 0,
+ new GfxSlider(*win, optBotSliderRect, optBotFaceRect, 0,
Audio::Mixer::kMaxMixerVolume, slideFaceImag, numSlideFace, ConfMan.getInt("music_volume"),
0, cmdSetMIDIVolume);
@@ -1077,25 +1077,25 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
udrInfo.result = -1;
udrInfo.running = true;
- gCompButton *t;
+ GfxCompButton *t;
// button one
if (numBtns >= 1) {
- t = new gCompButton(*udWin, messageButtonRects[0],
+ t = new GfxCompButton(*udWin, messageButtonRects[0],
udDialogPushImag, numBtnImages, btnMsg1, pal, 10, cmdDialogQuit);
t->accel = k1;
}
// button two
if (numBtns >= 2) {
- t = new gCompButton(*udWin, messageButtonRects[1],
+ t = new GfxCompButton(*udWin, messageButtonRects[1],
udDialogPushImag, numBtnImages, btnMsg2, pal, 11, cmdDialogQuit);
t->accel = k2;
}
// button three
if (numBtns >= 3) {
- t = new gCompButton(*udWin, messageButtonRects[2],
+ t = new GfxCompButton(*udWin, messageButtonRects[2],
udDialogPushImag, numBtnImages, btnMsg3, pal, 12, cmdDialogQuit);
t->accel = k3;
}
@@ -1192,25 +1192,25 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
// create the window
win = new ModalWindow(messageWindowRect, 0, nullptr);
- gCompButton *t;
+ GfxCompButton *t;
// button one
if (numBtns >= 1) {
- t = new gCompButton(*win, *messageButtonRects[0],
+ t = new GfxCompButton(*win, *messageButtonRects[0],
dialogPushImag, numBtnImages, btnMsg1, pal, 10, cmdDialogQuit);
t->accelKey = k1;
}
// button two
if (numBtns >= 2) {
- t = new gCompButton(*win, *messageButtonRects[1],
+ t = new GfxCompButton(*win, *messageButtonRects[1],
dialogPushImag, numBtnImages, btnMsg2, pal, 11, cmdDialogQuit);
t->accelKey = k2;
}
// button three
if (numBtns >= 3) {
- t = new gCompButton(*win, *messageButtonRects[2],
+ t = new GfxCompButton(*win, *messageButtonRects[2],
dialogPushImag, numBtnImages, btnMsg3, pal, 12, cmdDialogQuit);
t->accelKey = k3;
}
Commit: 0ae8d6c3070fc431400f8af9caf567c5933566a3
https://github.com/scummvm/scummvm/commit/0ae8d6c3070fc431400f8af9caf567c5933566a3
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-20T06:07:30+09:00
Commit Message:
SAGA2: Rename class variables in button.h
Changed paths:
engines/saga2/automap.cpp
engines/saga2/button.cpp
engines/saga2/button.h
engines/saga2/contain.cpp
engines/saga2/document.cpp
engines/saga2/floating.cpp
engines/saga2/grequest.cpp
engines/saga2/gtextbox.cpp
engines/saga2/intrface.cpp
engines/saga2/modal.cpp
engines/saga2/msgbox.cpp
engines/saga2/panel.cpp
engines/saga2/panel.h
engines/saga2/uidialog.cpp
engines/saga2/videobox.cpp
diff --git a/engines/saga2/automap.cpp b/engines/saga2/automap.cpp
index 4ac1a06a70..fa1762d465 100644
--- a/engines/saga2/automap.cpp
+++ b/engines/saga2/automap.cpp
@@ -298,7 +298,7 @@ gPanel *AutoMap::keyTest(int16 key) {
void AutoMap::pointerMove(gPanelMessage &msg) {
Point16 pos = msg.pickAbsPos;
- if (Rect16(extent.x, extent.y, extent.width, extent.height).ptInside(pos)) {
+ if (Rect16(_extent.x, _extent.y, _extent.width, _extent.height).ptInside(pos)) {
// mouse hit inside autoMap
TileRegion viewRegion;
// Calculate the actual region we are going to draw as the intersection of
@@ -321,7 +321,7 @@ void AutoMap::pointerMove(gPanelMessage &msg) {
bool AutoMap::pointerHit(gPanelMessage &msg) {
Point16 pos = msg.pickAbsPos;
- if (Rect16(0, 0, extent.width, extent.height).ptInside(pos)) {
+ if (Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
// mouse hit inside autoMap
if (g_vm->_teleportOnMap) {
@@ -390,7 +390,7 @@ void AutoMap::drawClipped(
const Point16 &offset,
const Rect16 &clipRect) {
// return if no change
- if (!extent.overlap(clipRect)) return;
+ if (!_extent.overlap(clipRect)) return;
// clear out the buffer
memset(_tPort.map->data, 0, _sumMapArea.width * _sumMapArea.height);
@@ -408,8 +408,8 @@ void AutoMap::drawClipped(
// rendering
if (dec->extent.overlap(clipRect)) {
- Point16 pos(dec->extent.x - extent.x - offset.x,
- dec->extent.y - extent.y - offset.y);
+ Point16 pos(dec->extent.x - _extent.x - offset.x,
+ dec->extent.y - _extent.y - offset.y);
drawCompressedImage(_tPort, pos, dec->image);
}
@@ -425,7 +425,7 @@ void AutoMap::drawClipped(
port.setMode(drawModeMatte);
port.bltPixels(*_tPort.map,
0, 0,
- extent.x, extent.y,
+ _extent.x, _extent.y,
_sumMapArea.width, _sumMapArea.height);
// show the cursor again
@@ -437,7 +437,7 @@ void AutoMap::drawClipped(
void AutoMap::draw(void) { // redraw the window
// draw the entire panel
- drawClipped(g_vm->_mainPort, Point16(0, 0), extent);
+ drawClipped(g_vm->_mainPort, Point16(0, 0), _extent);
}
// ------------------------------------------------------------------------
diff --git a/engines/saga2/button.cpp b/engines/saga2/button.cpp
index 039a74fd2e..5eaceb6505 100644
--- a/engines/saga2/button.cpp
+++ b/engines/saga2/button.cpp
@@ -43,13 +43,13 @@ extern void playMemSound(uint32 s); // play click # s
* ======================================================================= */
void GfxCompImage::init(void) {
- compImages = NULL;
- max = 0;
- min = 0;
- internalAlloc = false;
- currentImage = 0;
- numPtrAlloc = 0;
- textFont = &Onyx10Font; // default
+ _compImages = NULL;
+ _max = 0;
+ _min = 0;
+ _internalAlloc = false;
+ _currentImage = 0;
+ _numPtrAlloc = 0;
+ _textFont = &Onyx10Font; // default
}
GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, uint16 ident,
@@ -59,10 +59,10 @@ GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, uin
init();
if (image) {
- compImages = (void **)malloc(sizeof(pVOID) * 1); // allocate room for one pointer
- compImages[0] = image;
- internalAlloc = false;
- numPtrAlloc = 1;
+ _compImages = (void **)malloc(sizeof(pVOID) * 1); // allocate room for one pointer
+ _compImages[0] = image;
+ _internalAlloc = false;
+ _numPtrAlloc = 1;
}
}
@@ -81,17 +81,17 @@ GfxCompImage::GfxCompImage(gPanelList &list,
hResContext *resContext = resFile->newContext(contextID, "container window resource");
// setup for a numImages image configuration
- compImages = (void **)malloc(sizeof(void *)*numImages); // allocate room for numImages pointers
+ _compImages = (void **)malloc(sizeof(void *)*numImages); // allocate room for numImages pointers
for (i = 0, rNum = resNum; i < numImages; i++, rNum++) {
- compImages[i] = LoadResource(resContext,
+ _compImages[i] = LoadResource(resContext,
MKTAG(a, b, c, rNum),
" GfxCompImage ");
}
- max = numImages - 1;
- internalAlloc = true;
- numPtrAlloc = numImages;
+ _max = numImages - 1;
+ _internalAlloc = true;
+ _numPtrAlloc = numImages;
// get rid of this context
resFile->disposeContext(resContext);
@@ -106,14 +106,14 @@ GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, con
if (!image)
return;
- compImages = (void **)malloc(sizeof(void *) * 1); // allocate room for one pointer
+ _compImages = (void **)malloc(sizeof(void *) * 1); // allocate room for one pointer
- compImages[0] = image;
- max = 0;
- numPtrAlloc = 1;
+ _compImages[0] = image;
+ _max = 0;
+ _numPtrAlloc = 1;
title = text;
- textFont = &Onyx10Font; // >>> this should be dynamic
- textPal = pal;
+ _textFont = &Onyx10Font; // >>> this should be dynamic
+ _textPal = pal;
}
GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
@@ -124,11 +124,11 @@ GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
if (!images)
return;
- compImages = images;
+ _compImages = images;
// set up limits
- max = numRes - 1;
- currentImage = clamp(min, initial, max);
+ _max = numRes - 1;
+ _currentImage = clamp(_min, initial, _max);
}
GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
@@ -137,16 +137,16 @@ GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
init();
if (images) {
- compImages = images;
+ _compImages = images;
// set up limits
- max = numRes - 1;
- currentImage = clamp(min, initial, max);
+ _max = numRes - 1;
+ _currentImage = clamp(_min, initial, _max);
}
title = text;
- textFont = &Onyx10Font; // >>> this should be dynamic
- textPal = pal;
+ _textFont = &Onyx10Font; // >>> this should be dynamic
+ _textPal = pal;
}
GfxCompImage::GfxCompImage(gPanelList &list, const StaticRect &box, void **images,
@@ -155,16 +155,16 @@ GfxCompImage::GfxCompImage(gPanelList &list, const StaticRect &box, void **image
init();
if (images) {
- compImages = images;
+ _compImages = images;
// set up limits
- max = numRes - 1;
- currentImage = clamp(min, initial, max);
+ _max = numRes - 1;
+ _currentImage = clamp(_min, initial, _max);
}
title = text;
- textFont = &Onyx10Font; // >>> this should be dynamic
- textPal = pal;
+ _textFont = &Onyx10Font; // >>> this should be dynamic
+ _textPal = pal;
}
@@ -176,15 +176,15 @@ GfxCompImage::~GfxCompImage(void) {
// a precaution
// if we LoadRes'ed image internally RDispose those
- if (internalAlloc) {
- for (int16 i = 0; i < numPtrAlloc; i++) {
- free(compImages[i]);
+ if (_internalAlloc) {
+ for (int16 i = 0; i < _numPtrAlloc; i++) {
+ free(_compImages[i]);
}
}
// delete any pointer arrays new'ed
- if (numPtrAlloc > 0) {
- free(compImages);
+ if (_numPtrAlloc > 0) {
+ free(_compImages);
}
}
@@ -200,7 +200,7 @@ void GfxCompImage::enable(bool abled) {
}
void GfxCompImage::invalidate(Rect16 *) {
- window.update(extent);
+ window.update(_extent);
}
void GfxCompImage::draw(void) {
@@ -208,16 +208,16 @@ void GfxCompImage::draw(void) {
Rect16 rect = window.getExtent();
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
drawClipped(port,
Point16(0, 0),
Rect16(0, 0, rect.width, rect.height));
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
void *GfxCompImage::getCurrentCompImage(void) {
- if (compImages) {
- return compImages[currentImage]; // return the image pointed to by compImage
+ if (_compImages) {
+ return _compImages[_currentImage]; // return the image pointed to by compImage
} else {
return NULL;
}
@@ -226,15 +226,15 @@ void *GfxCompImage::getCurrentCompImage(void) {
// waring! : the number of images has has to be == to the inital number
void GfxCompImage::setImages(void **images) {
if (images) {
- compImages = images;
+ _compImages = images;
}
}
void GfxCompImage::setImage(void *image) {
if (image) {
- compImages[0] = image;
- max = 0;
- currentImage = 0;
+ _compImages[0] = image;
+ _max = 0;
+ _currentImage = 0;
}
}
@@ -242,7 +242,7 @@ void GfxCompImage::select(uint16 val) {
setCurrent(val);
if (getEnabled()) {
- window.update(extent);
+ window.update(_extent);
}
}
@@ -253,7 +253,7 @@ void GfxCompImage::select(uint16 val, const Rect16 &rect) {
void GfxCompImage::setExtent(const Rect16 &rect) {
// set the new extent
- extent = rect;
+ _extent = rect;
}
// getCurrentCompImage() is virtual function that should return
@@ -261,7 +261,7 @@ void GfxCompImage::setExtent(const Rect16 &rect) {
void GfxCompImage::drawClipped(gPort &port,
const Point16 &offset,
const Rect16 &r) {
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
SAVE_GPORT_STATE(port);
@@ -271,10 +271,10 @@ void GfxCompImage::drawClipped(gPort &port,
// make sure the image is valid
if (dispImage) {
// will part of this be drawn on screen?
- if (extent.overlap(r)) {
+ if (_extent.overlap(r)) {
// offset the image?
- Point16 pos(extent.x - offset.x,
- extent.y - offset.y
+ Point16 pos(_extent.x - offset.x,
+ _extent.y - offset.y
);
// draw the compressed image
if (isGhosted()) drawCompressedImageGhosted(port, pos, dispImage);
@@ -282,11 +282,11 @@ void GfxCompImage::drawClipped(gPort &port,
// this could be modified to get the current text coloring
if (title) {
- Rect16 textRect = extent;
+ Rect16 textRect = _extent;
textRect.x -= offset.x;
textRect.y -= offset.y;
- writePlaqText(port, textRect, textFont, 0, textPal, selected, title);
+ writePlaqText(port, textRect, _textFont, 0, _textPal, selected, title);
}
}
}
@@ -302,10 +302,10 @@ GfxSpriteImage::GfxSpriteImage(gPanelList &list, const Rect16 &box, GameObject *
ProtoObj *proto = object->proto();
// assign the sprites remapped colors
- object->getColorTranslation(objColors);
+ object->getColorTranslation(_objColors);
// assing the sprite pointer
- sprPtr = proto->getSprite(object, ProtoObj::objInContainerView).sp;
+ _sprPtr = proto->getSprite(object, ProtoObj::objInContainerView).sp;
}
// getCurrentCompImage() is virtual function that should return
@@ -313,7 +313,7 @@ GfxSpriteImage::GfxSpriteImage(gPanelList &list, const Rect16 &box, GameObject *
void GfxSpriteImage::drawClipped(gPort &port,
const Point16 &offset,
const Rect16 &r) {
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
SAVE_GPORT_STATE(port);
@@ -321,7 +321,7 @@ void GfxSpriteImage::drawClipped(gPort &port,
gPixelMap map;
//map.size = Point16( extent.height, extent.width );
- map.size = sprPtr->size;
+ map.size = _sprPtr->size;
map.data = (uint8 *)malloc(map.bytes() * sizeof(uint8));
if (map.data == NULL) return;
@@ -329,11 +329,11 @@ void GfxSpriteImage::drawClipped(gPort &port,
memset(map.data, 0, map.bytes());
// Render the sprite into the bitmap image sequence
- ExpandColorMappedSprite(map, sprPtr, objColors);
+ ExpandColorMappedSprite(map, _sprPtr, _objColors);
port.setMode(drawModeMatte);
port.bltPixels(map, 0, 0,
- extent.x - offset.x, extent.y - offset.y,
+ _extent.x - offset.x, _extent.y - offset.y,
map.size.x, map.size.y);
free(map.data);
@@ -345,17 +345,17 @@ void GfxSpriteImage::drawClipped(gPort &port,
void GfxCompButton::loadImages(hResContext *con, hResID res1, hResID res2) {
if (con) {
- forImage = LoadResource(con, res1, "CBtn fore image");
- resImage = LoadResource(con, res2, "CBtn res image");
- dimImage = NULL;
+ _forImage = LoadResource(con, res1, "CBtn fore image");
+ _resImage = LoadResource(con, res2, "CBtn res image");
+ _dimImage = NULL;
} else {
- forImage = NULL;
- resImage = NULL;
- dimImage = NULL;
+ _forImage = NULL;
+ _resImage = NULL;
+ _dimImage = NULL;
}
- internalAlloc = true;
- dimmed = false;
+ _internalAlloc = true;
+ _dimmed = false;
}
void GfxCompButton::loadImages(hResID contextID, hResID res1, hResID res2) {
@@ -368,83 +368,83 @@ void GfxCompButton::loadImages(hResID contextID, hResID res1, hResID res2) {
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, hResID resID1, hResID resID2, uint16 ident,
- AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
loadImages(con, resID1, resID2);
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResID contextID, hResID resID1, hResID resID2, uint16 ident,
- AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
loadImages(contextID, resID1, resID2);
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
- AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
loadImages(con, MKTAG(a, b, c, butNum_1), MKTAG(a, b, c, butNum_2));
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResID contextID, char a, char b, char c, int16 butNum_1, int16 butNum_2, uint16 ident,
- AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
loadImages(contextID, MKTAG(a, b, c, butNum_1), MKTAG(a, b, c, butNum_2));
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, hResContext *con, int16 butNum, uint16 ident,
- AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), extent(box) {
+ AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd), _extent(box) {
loadImages(con, MKTAG('B', 'T', 'N', butNum), MKTAG('B', 'T', 'N', butNum + 1));
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, uint16 ident,
AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
- forImage = images[0];
- resImage = images[1];
- dimImage = NULL;
+ _forImage = images[0];
+ _resImage = images[1];
+ _dimImage = NULL;
} else {
- forImage = NULL;
- resImage = NULL;
- dimImage = NULL;
+ _forImage = NULL;
+ _resImage = NULL;
+ _dimImage = NULL;
}
- internalAlloc = false;
- dimmed = false;
- extent = box;
+ _internalAlloc = false;
+ _dimmed = false;
+ _extent = box;
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident,
AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
- forImage = images[0];
- resImage = images[1];
- dimImage = NULL;
+ _forImage = images[0];
+ _resImage = images[1];
+ _dimImage = NULL;
} else {
- forImage = NULL;
- resImage = NULL;
- dimImage = NULL;
+ _forImage = NULL;
+ _resImage = NULL;
+ _dimImage = NULL;
}
- internalAlloc = false;
- dimmed = false;
- extent = box;
+ _internalAlloc = false;
+ _dimmed = false;
+ _extent = box;
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void **images, int16 numRes, void *newDimImage, bool dimNess, uint16 ident,
AppFunc *cmd) : GfxCompImage(list, box, NULL, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
- forImage = images[0];
- resImage = images[1];
+ _forImage = images[0];
+ _resImage = images[1];
} else {
- forImage = NULL;
- resImage = NULL;
+ _forImage = NULL;
+ _resImage = NULL;
}
if (newDimImage) {
- dimImage = newDimImage;
+ _dimImage = newDimImage;
} else {
- dimImage = NULL;
+ _dimImage = NULL;
}
- internalAlloc = false;
- dimmed = dimNess;
- extent = box;
+ _internalAlloc = false;
+ _dimmed = dimNess;
+ _extent = box;
}
@@ -453,85 +453,87 @@ GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, void *image, u
{
if (image) {
- forImage = image;
- resImage = image;
- dimImage = NULL;
+ _forImage = image;
+ _resImage = image;
+ _dimImage = NULL;
} else {
- forImage = NULL;
- resImage = NULL;
- dimImage = NULL;
+ _forImage = NULL;
+ _resImage = NULL;
+ _dimImage = NULL;
}
- internalAlloc = false;
- dimmed = false;
- extent = box;
+ _internalAlloc = false;
+ _dimmed = false;
+ _extent = box;
}
GfxCompButton::GfxCompButton(gPanelList &list, const StaticRect &box, void **images, int16 numRes, const char *text, textPallete &pal, uint16 ident, AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, 0, text, pal, ident, cmd) {
if (images[0] && images[1] && numRes == 2) {
- forImage = images[0];
- resImage = images[1];
- dimImage = nullptr;
+ _forImage = images[0];
+ _resImage = images[1];
+ _dimImage = nullptr;
} else {
- forImage = nullptr;
- resImage = nullptr;
- dimImage = nullptr;
+ _forImage = nullptr;
+ _resImage = nullptr;
+ _dimImage = nullptr;
}
- internalAlloc = false;
- dimmed = false;
- extent = box;
+ _internalAlloc = false;
+ _dimmed = false;
+ _extent = box;
}
GfxCompButton::GfxCompButton(gPanelList &list, const Rect16 &box, AppFunc *cmd) : GfxCompImage(list, box, NULL, 0, cmd) {
- forImage = NULL;
- resImage = NULL;
- dimImage = NULL;
+ _forImage = NULL;
+ _resImage = NULL;
+ _dimImage = NULL;
- internalAlloc = false;
- dimmed = false;
- extent = box;
+ _internalAlloc = false;
+ _dimmed = false;
+ _extent = box;
}
GfxCompButton::~GfxCompButton(void) {
- if (internalAlloc) {
- if (forImage) {
- free(forImage);
- forImage = NULL;
+ if (_internalAlloc) {
+ if (_forImage) {
+ free(_forImage);
+ _forImage = NULL;
}
- if (resImage) {
- free(resImage);
- resImage = NULL;
+ if (_resImage) {
+ free(_resImage);
+ _resImage = NULL;
}
- if (dimImage) {
- free(dimImage);
- dimImage = NULL;
+ if (_dimImage) {
+ free(_dimImage);
+ _dimImage = NULL;
}
}
}
void GfxCompButton::dim(bool enableFlag) {
if (enableFlag) {
- if (!dimmed) dimmed = true;
+ if (!_dimmed)
+ _dimmed = true;
} else {
- if (dimmed) dimmed = false;
+ if (_dimmed)
+ _dimmed = false;
}
- window.update(extent);
+ window.update(_extent);
}
void GfxCompButton::deactivate(void) {
selected = 0;
- window.update(extent);
+ window.update(_extent);
gPanel::deactivate();
}
bool GfxCompButton::activate(gEventType why) {
selected = 1;
- window.update(extent);
+ window.update(_extent);
if (why == gEventKeyDown) { // momentarily depress
deactivate();
@@ -542,14 +544,16 @@ bool GfxCompButton::activate(gEventType why) {
}
void GfxCompButton::pointerMove(gPanelMessage &msg) {
- if (dimmed) return;
+ if (_dimmed)
+ return;
//notify( gEventMouseMove, (msg.pointerEnter ? enter : 0)|(msg.pointerLeave ? leave : 0));
GfxCompImage::pointerMove(msg);
}
bool GfxCompButton::pointerHit(gPanelMessage &) {
- if (dimmed) return false;
+ if (_dimmed)
+ return false;
activate(gEventMouseDown);
return true;
@@ -567,7 +571,7 @@ void GfxCompButton::pointerRelease(gPanelMessage &) {
void GfxCompButton::pointerDrag(gPanelMessage &msg) {
if (selected != msg.inPanel) {
selected = msg.inPanel;
- window.update(extent);
+ window.update(_extent);
}
}
@@ -576,7 +580,7 @@ void GfxCompButton::enable(bool abled) {
}
void GfxCompButton::invalidate(Rect16 *) {
- window.update(extent);
+ window.update(_extent);
}
@@ -585,18 +589,18 @@ void GfxCompButton::draw(void) {
Rect16 rect = window.getExtent();
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
drawClipped(port, Point16(0, 0), Rect16(0, 0, rect.width, rect.height));
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
void *GfxCompButton::getCurrentCompImage(void) {
- if (dimmed) {
- return dimImage;
+ if (_dimmed) {
+ return _dimImage;
} else if (selected) {
- return resImage;
+ return _resImage;
} else {
- return forImage;
+ return _forImage;
}
}
@@ -631,7 +635,7 @@ void GfxOwnerSelCompButton::select(uint16 val) {
setCurrent(val);
if (getEnabled()) {
- window.update(extent);
+ window.update(_extent);
}
}
@@ -644,92 +648,92 @@ GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, hResCo
int16 i, k;
- images = (void **)malloc(sizeof(void *)*numRes);
+ _images = (void **)malloc(sizeof(void *)*numRes);
for (i = 0, k = resStart; i < numRes; i++, k++) {
- images[i] = LoadResource(con, MKTAG(a, b, c, k), "Multi btn image");
+ _images[i] = LoadResource(con, MKTAG(a, b, c, k), "Multi btn image");
}
- response = true;
- internalAlloc = true;
- max = numRes - 1;
- min = 0;
- current = clamp(min, initial, max);
+ _response = true;
+ _internalAlloc = true;
+ _max = numRes - 1;
+ _min = 0;
+ _current = clamp(_min, initial, _max);
- extent = box;
+ _extent = box;
}
GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, void **newImages, int16 numRes, int16 initial, uint16 ident,
AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
if (!newImages) {
- images = NULL;
- max = 0;
- min = 0;
- current = 0;
- response = false;
+ _images = NULL;
+ _max = 0;
+ _min = 0;
+ _current = 0;
+ _response = false;
return;
}
- images = newImages;
+ _images = newImages;
- response = true;
- internalAlloc = false;
- max = numRes - 1;
- min = 0;
- current = initial;
+ _response = true;
+ _internalAlloc = false;
+ _max = numRes - 1;
+ _min = 0;
+ _current = initial;
- extent = box;
+ _extent = box;
}
GfxMultCompButton::GfxMultCompButton(gPanelList &list, const Rect16 &box, void **newImages,
int16 numRes, int16 initial, bool hitResponse, uint16 ident,
AppFunc *cmd) : GfxCompButton(list, box, (hResContext *)NULL, 0, ident, cmd) {
if (!newImages) {
- images = NULL;
- max = 0;
- min = 0;
- current = 0;
- response = hitResponse;
+ _images = NULL;
+ _max = 0;
+ _min = 0;
+ _current = 0;
+ _response = hitResponse;
return;
}
- images = newImages;
+ _images = newImages;
- response = hitResponse;
- internalAlloc = false;
- max = numRes - 1;
- min = 0;
- current = initial;
+ _response = hitResponse;
+ _internalAlloc = false;
+ _max = numRes - 1;
+ _min = 0;
+ _current = initial;
- extent = box;
+ _extent = box;
}
GfxMultCompButton::~GfxMultCompButton(void) {
int16 i;
- if (images && internalAlloc) {
- for (i = 0; i <= max; i++) {
- if (images[i]) {
- free(images[i]);
+ if (_images && _internalAlloc) {
+ for (i = 0; i <= _max; i++) {
+ if (_images[i]) {
+ free(_images[i]);
}
}
- free(images);
- images = NULL;
+ free(_images);
+ _images = NULL;
}
}
bool GfxMultCompButton::activate(gEventType why) {
if (why == gEventKeyDown || why == gEventMouseDown) {
- if (response) {
- if (++current > max) {
- current = 0;
+ if (_response) {
+ if (++_current > _max) {
+ _current = 0;
}
- window.update(extent);
+ window.update(_extent);
}
gPanel::deactivate();
- notify(gEventNewValue, current); // notify App of successful hit
+ notify(gEventNewValue, _current); // notify App of successful hit
playMemSound(1);
// playSound( MKTAG('C','B','T',5) );
}
@@ -741,7 +745,7 @@ bool GfxMultCompButton::pointerHit(gPanelMessage &) {
}
void *GfxMultCompButton::getCurrentCompImage(void) {
- return images[current];
+ return _images[_current];
}
/* ===================================================================== *
@@ -754,18 +758,18 @@ GfxSlider::GfxSlider(gPanelList &list, const Rect16 &box, const Rect16 &imageBox
AppFunc *cmd) : GfxMultCompButton(list, box, newImages, resStart, initial, ident, cmd) {
int16 calcX;
- imageRect = imageBox;
- slValMin = sliderStart;
- slValMax = sliderEnd;
- slCurrent = initial;
+ _imageRect = imageBox;
+ _slValMin = sliderStart;
+ _slValMax = sliderEnd;
+ _slCurrent = initial;
// find out the position of the slider
- calcX = (slValMax * 100) / clamp(1, slCurrent, slCurrent);
- calcX = (extent.width * 100) / clamp(1, calcX, calcX);
+ calcX = (_slValMax * 100) / clamp(1, _slCurrent, _slCurrent);
+ calcX = (_extent.width * 100) / clamp(1, calcX, calcX);
- imagePosX = clamp(extent.x,
+ _imagePosX = clamp(_extent.x,
calcX,
- extent.width - imageRect.x);
+ _extent.width - _imageRect.x);
}
void *GfxSlider::getCurrentCompImage(void) {
@@ -776,26 +780,26 @@ void *GfxSlider::getCurrentCompImage(void) {
// max == number of images in array indexing;
- index = val / clamp(1, max + 1, max + 1);
+ index = val / clamp(1, _max + 1, _max + 1);
- index = slCurrent / clamp(1, index, index);
+ index = _slCurrent / clamp(1, index, index);
- index = clamp(0, index, max);
+ index = clamp(0, index, _max);
- return images[index];
+ return _images[index];
}
int16 GfxSlider::getSliderLenVal(void) {
int16 val = 0;
- if (slValMin < 0 && slValMax < 0) {
- val = slValMax - slValMin;
- } else if (slValMin < 0 && slValMax >= 0) {
- val = ABS(slValMin) + slValMax;
- } else if (slValMin >= 0 && slValMax < 0) {
- val = ABS(slValMax) - slValMin;
- } else if (slValMin >= 0 && slValMax >= 0) {
- val = slValMax - slValMin;
+ if (_slValMin < 0 && _slValMax < 0) {
+ val = _slValMax - _slValMin;
+ } else if (_slValMin < 0 && _slValMax >= 0) {
+ val = ABS(_slValMin) + _slValMax;
+ } else if (_slValMin >= 0 && _slValMax < 0) {
+ val = ABS(_slValMax) - _slValMin;
+ } else if (_slValMin >= 0 && _slValMax >= 0) {
+ val = _slValMax - _slValMin;
}
return val;
@@ -806,9 +810,9 @@ void GfxSlider::draw(void) {
Point16 offset = Point16(0, 0);
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
- drawClipped(port, offset, Rect16(0, 0, imageRect.width, imageRect.height));
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
+ drawClipped(port, offset, Rect16(0, 0, _imageRect.width, _imageRect.height));
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
@@ -823,9 +827,9 @@ void GfxSlider::drawClipped(gPort &port,
const Rect16 &r) {
void *dispImage = getCurrentCompImage();
if (dispImage) {
- if (extent.overlap(r)) {
- Point16 pos(imagePosX - offset.x,
- extent.y - offset.y
+ if (_extent.overlap(r)) {
+ Point16 pos(_imagePosX - offset.x,
+ _extent.y - offset.y
);
if (isGhosted()) drawCompressedImageGhosted(port, pos, dispImage);
else drawCompressedImage(port, pos, dispImage);
@@ -836,16 +840,16 @@ void GfxSlider::drawClipped(gPort &port,
bool GfxSlider::activate(gEventType why) {
if (why == gEventKeyDown || why == gEventMouseDown) {
selected = 1;
- window.update(extent);
+ window.update(_extent);
gPanel::deactivate();
- notify(gEventNewValue, slCurrent); // notify App of successful hit
+ notify(gEventNewValue, _slCurrent); // notify App of successful hit
}
return false;
}
void GfxSlider::deactivate(void) {
selected = 0;
- window.update(extent);
+ window.update(_extent);
gPanel::deactivate();
}
@@ -854,7 +858,7 @@ bool GfxSlider::pointerHit(gPanelMessage &msg) {
updateSliderIndexes(msg.pickPos);
// redraw the control should any visual change hath occured
- window.update(extent);
+ window.update(_extent);
activate(gEventMouseDown);
return true;
@@ -866,9 +870,9 @@ void GfxSlider::pointerMove(gPanelMessage &msg) {
updateSliderIndexes(msg.pickPos);
// redraw the control should any visual change hath occured
- window.update(extent);
+ window.update(_extent);
- notify(gEventMouseMove, slCurrent);
+ notify(gEventMouseMove, _slCurrent);
}
}
@@ -876,7 +880,7 @@ void GfxSlider::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it.
if (selected) {
deactivate(); // give back input focus
- notify(gEventNewValue, slCurrent); // notify App of successful hit
+ notify(gEventNewValue, _slCurrent); // notify App of successful hit
} else deactivate();
}
@@ -884,23 +888,23 @@ void GfxSlider::pointerDrag(gPanelMessage &msg) {
// update the image index
updateSliderIndexes(msg.pickPos);
- notify(gEventNewValue, slCurrent); // notify App of successful hit
+ notify(gEventNewValue, _slCurrent); // notify App of successful hit
// redraw the control should any visual change hath occured
- window.update(extent);
+ window.update(_extent);
}
void GfxSlider::updateSliderIndexes(Point16 &pos) {
pos.x = quantizedVolume(pos.x);
// get x position units
- int32 unit = (extent.width * 100) / clamp(1, pos.x, extent.width);
+ int32 unit = (_extent.width * 100) / clamp(1, pos.x, _extent.width);
// find the ratio and get the current slider value
- slCurrent = (slValMax * 100) / clamp(1, unit, unit);
+ _slCurrent = (_slValMax * 100) / clamp(1, unit, unit);
// update the image position index
- imagePosX = clamp(extent.x,
+ _imagePosX = clamp(_extent.x,
pos.x,
- extent.width - imageRect.x);
+ _extent.width - _imageRect.x);
}
} // end of namespace Saga2
diff --git a/engines/saga2/button.h b/engines/saga2/button.h
index e047051789..fa70443f50 100644
--- a/engines/saga2/button.h
+++ b/engines/saga2/button.h
@@ -96,21 +96,16 @@ class GameObject;
class GfxCompImage : public gControl {
private:
- enum {
- textSize = 128
- };
-
// number of image pointer allocated
- uint16 numPtrAlloc;
- bool internalAlloc;
+ uint16 _numPtrAlloc;
+ bool _internalAlloc;
protected:
- void **compImages; // double pointer(s) the compressed image(s)
- uint16 currentImage; // current image index
- uint16 max, min; // min max of the index
- textPallete textPal; // contains info about coloring for multi-depth text rendering
- gFont *textFont; // pointer to font for this button
-// char imageText[textSize]; // text to render on button
+ void **_compImages; // double pointer(s) the compressed image(s)
+ uint16 _currentImage; // current image index
+ uint16 _max, _min; // min max of the index
+ textPallete _textPal; // contains info about coloring for multi-depth text rendering
+ gFont *_textFont; // pointer to font for this button
protected:
virtual void *getCurrentCompImage(void); // get the current image
@@ -153,16 +148,16 @@ public:
void enable(bool);
void invalidate(Rect16 *unused = nullptr); // invalidates the drawing
int16 getCurrent(void) {
- return currentImage;
+ return _currentImage;
}
int16 getMin(void) {
- return min;
+ return _min;
}
int16 getMax(void) {
- return max;
+ return _max;
}
void setCurrent(uint16 val) {
- currentImage = clamp(min, val, max);
+ _currentImage = clamp(_min, val, _max);
}
void setExtent(const Rect16 &rect);
void select(uint16 val);
@@ -180,10 +175,10 @@ class GfxSpriteImage : public GfxCompImage {
private:
// Color set to draw the object.
- ColorTable objColors;
+ ColorTable _objColors;
protected:
- Sprite *sprPtr;
+ Sprite *_sprPtr;
public:
// this one takes a sprite pointer
@@ -202,12 +197,12 @@ public:
class GfxCompButton : public GfxCompImage {
protected:
- void *forImage; // pointer to forground compress image data
- void *resImage; // pointer to resessed compressed image data
- void *dimImage; // pointer to dimmed commpressed image data
- Rect16 extent; // area that image covers
- bool dimmed; // duh dim bit
- bool internalAlloc; // set if memory allocated in class
+ void *_forImage; // pointer to forground compress image data
+ void *_resImage; // pointer to resessed compressed image data
+ void *_dimImage; // pointer to dimmed commpressed image data
+ Rect16 _extent; // area that image covers
+ bool _dimmed; // duh dim bit
+ bool _internalAlloc; // set if memory allocated in class
public:
@@ -261,10 +256,10 @@ public:
void draw(void); // redraw the panel.
void dim(bool);
void setForImage(void *image) {
- if (image) forImage = image;
+ if (image) _forImage = image;
}
void setResImage(void *image) {
- if (image) resImage = image;
+ if (image) _resImage = image;
}
private:
@@ -302,14 +297,14 @@ public:
class GfxMultCompButton : public GfxCompButton {
private:
- bool response; // tells whether to display an image when hit.
+ bool _response; // tells whether to display an image when hit.
protected:
- void **images;
- Rect16 extent;
- int16 current;
- int16 min;
- int16 max;
+ void **_images;
+ Rect16 _extent;
+ int16 _current;
+ int16 _min;
+ int16 _max;
public:
@@ -326,22 +321,23 @@ public:
~GfxMultCompButton(void);
int16 getCurrent(void) {
- return current;
+ return _current;
}
int16 getMin(void) {
- return min;
+ return _min;
}
int16 getMax(void) {
- return max;
+ return _max;
}
void setCurrent(int16 val) {
- current = clamp(min, val, max);
+ _current = clamp(_min, val, _max);
}
void setImages(void **newImages) {
- if (images && newImages) images = newImages;
+ if (_images && newImages)
+ _images = newImages;
}
void setResponse(bool resp) {
- response = resp;
+ _response = resp;
}
protected:
@@ -357,11 +353,11 @@ protected:
class GfxSlider : public GfxMultCompButton {
protected:
- Rect16 imageRect;
- int16 slValMin;
- int16 slValMax;
- int16 slCurrent;
- int16 imagePosX;
+ Rect16 _imageRect;
+ int16 _slValMin;
+ int16 _slValMax;
+ int16 _slCurrent;
+ int16 _imagePosX;
public:
GfxSlider(gPanelList &, const Rect16 &, const Rect16 &, int16, int16,
@@ -382,10 +378,10 @@ private:
public:
void setSliderCurrent(int16 val) {
- slCurrent = val;
+ _slCurrent = val;
}
int16 getSliderCurrent(void) {
- return slCurrent;
+ return _slCurrent;
}
int16 getSliderLenVal(void);
virtual void *getCurrentCompImage(void);
diff --git a/engines/saga2/contain.cpp b/engines/saga2/contain.cpp
index 7923264e61..3ac4f77daa 100644
--- a/engines/saga2/contain.cpp
+++ b/engines/saga2/contain.cpp
@@ -379,8 +379,8 @@ void ContainerView::drawClipped(
y;
// Coordinates for slot 0,0.
- int16 originX = extent.x - offset.x + iconOrigin.x,
- originY = extent.y - offset.y + iconOrigin.y;
+ int16 originX = _extent.x - offset.x + iconOrigin.x,
+ originY = _extent.y - offset.y + iconOrigin.y;
ObjectID objID;
GameObject *item;
@@ -392,7 +392,7 @@ void ContainerView::drawClipped(
ColorTable objColors;
// If there's no overlap between extent and clip, then return.
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
// Iterate through each item within the container.
while ((objID = iter.next(&item)) != Nothing) {
@@ -679,7 +679,7 @@ bool ContainerView::pointerHit(gPanelMessage &msg) {
// total the mass and bulk of all the objects in this container
totalObjects();
- window.update(extent);
+ window.update(_extent);
return activate(gEventMouseDown);
}
@@ -1019,8 +1019,8 @@ void ReadyContainerView::drawClipped(
y;
// Coordinates for slot 0,0.
- int16 originX = extent.x - offset.x + iconOrigin.x,
- originY = extent.y - offset.y + iconOrigin.y;
+ int16 originX = _extent.x - offset.x + iconOrigin.x,
+ originY = _extent.y - offset.y + iconOrigin.y;
// Row an column number of the inventory slot.
int16 col,
@@ -1036,14 +1036,14 @@ void ReadyContainerView::drawClipped(
ColorTable objColors;
// If there's no overlap between extent and clip, then return.
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
// Draw the boxes for visible rows and cols.
if (backImages) {
int16 i;
- Point16 drawOrg(extent.x - offset.x + backOriginX,
- extent.y - offset.y + backOriginY);
+ Point16 drawOrg(_extent.x - offset.x + backOriginX,
+ _extent.y - offset.y + backOriginY);
for (y = drawOrg.y, row = 0;
row < visibleRows;
@@ -1298,7 +1298,7 @@ void TangibleContainerWindow::drawClipped(
gPort &port,
const Point16 &offset,
const Rect16 &clip) {
- if (!extent.overlap(clip)) return;
+ if (!_extent.overlap(clip)) return;
// draw the decorations
ScrollableContainerWindow::drawClipped(port, offset, clip);
diff --git a/engines/saga2/document.cpp b/engines/saga2/document.cpp
index 07e1acbba5..038f758578 100644
--- a/engines/saga2/document.cpp
+++ b/engines/saga2/document.cpp
@@ -279,14 +279,14 @@ gPanel *CDocument::keyTest(int16 key) {
void CDocument::pointerMove(gPanelMessage &msg) {
Point16 pos = msg.pickPos;
- if (msg.inPanel && Rect16(0, 0, extent.width, extent.height).ptInside(pos)) {
+ if (msg.inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
if (app.orientation == pageOrientVertical) {
// find out which end of the book we're on
- if (pos.y < extent.height / 2) setMouseImage(kMousePgUpImage, -7, -7);
+ if (pos.y < _extent.height / 2) setMouseImage(kMousePgUpImage, -7, -7);
else setMouseImage(kMousePgDownImage, -7, -7);
} else {
// find out which side of the book we're on
- if (pos.x < extent.width / 2) setMouseImage(kMousePgLeftImage, -7, -7);
+ if (pos.x < _extent.width / 2) setMouseImage(kMousePgLeftImage, -7, -7);
else setMouseImage(kMousePgRightImage, -7, -7);
}
} else if (msg.pointerLeave) {
@@ -305,15 +305,15 @@ void CDocument::pointerDrag(gPanelMessage &) {
bool CDocument::pointerHit(gPanelMessage &msg) {
Point16 pos = msg.pickPos;
- if (msg.inPanel && Rect16(0, 0, extent.width, extent.height).ptInside(pos)) {
+ if (msg.inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
gEvent ev;
if (app.orientation == pageOrientVertical) {
// find out which end of the book we're on
- if (pos.y < extent.height / 2) cmdDocumentUp(ev); //gotoPage( currentPage - app.numPages );
+ if (pos.y < _extent.height / 2) cmdDocumentUp(ev); //gotoPage( currentPage - app.numPages );
else cmdDocumentDn(ev); //gotoPage( currentPage + app.numPages );
} else {
// find out which side of the book we're on
- if (pos.x < extent.width / 2) cmdDocumentLt(ev); //gotoPage( currentPage - app.numPages );
+ if (pos.x < _extent.width / 2) cmdDocumentLt(ev); //gotoPage( currentPage - app.numPages );
else cmdDocumentRt(ev); //gotoPage( currentPage + app.numPages );
}
} else {
@@ -557,7 +557,7 @@ void CDocument::renderText(void) {
assert(textFont);
- Rect16 bltRect(0, 0, extent.width, extent.height);
+ Rect16 bltRect(0, 0, _extent.width, _extent.height);
if (NewTempPort(tPort, bltRect.width, bltRect.height)) {
// clear out the text buffer
@@ -572,8 +572,8 @@ void CDocument::renderText(void) {
// draw a new copy of the background to the temp port
drawClipped(tPort,
- Point16(extent.x, extent.y),
- Rect16(0, 0, extent.width, extent.height));
+ Point16(_extent.x, _extent.y),
+ Rect16(0, 0, _extent.width, _extent.height));
tPort.setFont(textFont); // setup the string pointer
for (pageIndex = 0; pageIndex < currentPage; pageIndex++) {
@@ -656,7 +656,7 @@ void CDocument::drawClipped(
void CDocument::draw(void) { // redraw the window
// draw the book image
- drawClipped(g_vm->_mainPort, Point16(0, 0), extent);
+ drawClipped(g_vm->_mainPort, Point16(0, 0), _extent);
// draw the text onto the book
renderText();
diff --git a/engines/saga2/floating.cpp b/engines/saga2/floating.cpp
index b4b2d9a18e..7bec32f7f0 100644
--- a/engines/saga2/floating.cpp
+++ b/engines/saga2/floating.cpp
@@ -87,7 +87,7 @@ void DecoratedWindow::drawClipped(
int16 i;
if (displayEnabled())
- if (extent.overlap(clipRect)) {
+ if (_extent.overlap(clipRect)) {
// For each "decorative panel" within the frame of the window
for (dec = decorations, i = 0; i < numDecorations; i++, dec++) {
@@ -248,7 +248,7 @@ void DecoratedWindow::removeDecorations(void) {
void DecoratedWindow::draw(void) { // redraw the window
g_vm->_pointer->hide();
if (displayEnabled())
- drawClipped(g_vm->_mainPort, Point16(0, 0), extent);
+ drawClipped(g_vm->_mainPort, Point16(0, 0), _extent);
g_vm->_pointer->show();
}
@@ -263,8 +263,8 @@ bool DecoratedWindow::isBackdrop(void) {
void DecoratedWindow::update(const Rect16 &updateRect) {
Rect16 r = updateRect;
- r.x += extent.x;
- r.y += extent.y;
+ r.x += _extent.x;
+ r.y += _extent.y;
updateWindowSection(r);
}
@@ -272,8 +272,8 @@ void DecoratedWindow::update(const Rect16 &updateRect) {
void DecoratedWindow::update(const StaticRect &updateRect) {
Rect16 r = updateRect;
- r.x += extent.x;
- r.y += extent.y;
+ r.x += _extent.x;
+ r.y += _extent.y;
updateWindowSection(r);
}
@@ -413,10 +413,10 @@ void gButton::draw(void) {
gPort &port = window.windowPort;
Rect16 rect = window.getExtent();
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
if (displayEnabled())
drawClipped(port, Point16(0, 0), Rect16(0, 0, rect.width, rect.height));
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
@@ -428,12 +428,12 @@ void gImageButton::drawClipped(gPort &port, const Point16 &offset, const Rect16
gPixelMap *currentImage = selected ? selImage : deselImage;
if (displayEnabled())
- if (extent.overlap(r))
+ if (_extent.overlap(r))
port.bltPixels(*currentImage,
0,
0,
- extent.x - offset.x,
- extent.y - offset.y,
+ _extent.x - offset.x,
+ _extent.y - offset.y,
currentImage->size.x,
currentImage->size.y);
}
@@ -485,25 +485,25 @@ void LabeledButton::drawClipped(
const Point16 &offset,
const Rect16 &r) {
if (!displayEnabled()) return;
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
Point16 origin,
textOrigin;
gFont *textFont = mainFont;
- origin.x = extent.x - offset.x;
- origin.y = extent.y - offset.y;
+ origin.x = _extent.x - offset.x;
+ origin.y = _extent.y - offset.y;
SAVE_GPORT_STATE(port);
port.setColor(14);
- port.fillRect(origin.x, origin.y, extent.width, extent.height);
+ port.fillRect(origin.x, origin.y, _extent.width, _extent.height);
gImageButton::drawClipped(port, offset, r);
- textOrigin.x = origin.x + ((extent.width -
+ textOrigin.x = origin.x + ((_extent.width -
TextWidth(textFont, title, -1, textStyleUnderBar)) >> 1);
- textOrigin.y = origin.y + ((extent.height - textFont->height) >> 1);
+ textOrigin.y = origin.y + ((_extent.height - textFont->height) >> 1);
port.setColor(2);
port.moveTo(textOrigin);
@@ -536,12 +536,12 @@ void FloatingWindow::drawClipped(
gPort &port,
const Point16 &offset,
const Rect16 &r) {
- Rect16 rect = extent;
+ Rect16 rect = _extent;
WindowDecoration *dec;
int16 i;
if (displayEnabled())
- if (extent.overlap(r)) {
+ if (_extent.overlap(r)) {
// do'nt do the temp stuff if there are decorations present
if (numDecorations == 0) {
rect.x -= offset.x;
@@ -556,8 +556,8 @@ void FloatingWindow::drawClipped(
// For each "decorative panel" within the frame of the window
for (dec = decorations, i = 0; i < numDecorations; i++, dec++) {
- Point16 pos(dec->extent.x /* - decOffset.x */ - offset.x + extent.x,
- dec->extent.y /* - decOffset.y */ - offset.y + extent.y);
+ Point16 pos(dec->extent.x /* - decOffset.x */ - offset.x + _extent.x,
+ dec->extent.y /* - decOffset.y */ - offset.y + _extent.y);
drawCompressedImage(port, pos, dec->image);
}
@@ -575,8 +575,8 @@ void FloatingWindow::setExtent(const Rect16 &r) {
#endif
// now reset the extent
- extent.height = r.height;
- extent.width = r.width;
+ _extent.height = r.height;
+ _extent.width = r.width;
setPos(Point16(r.x, r.y));
}
@@ -594,7 +594,7 @@ bool FloatingWindow::open(void) {
// Close this window and redraw the screen under it.
void FloatingWindow::close(void) {
gWindow::close();
- updateWindowSection(extent);
+ updateWindowSection(_extent);
}
diff --git a/engines/saga2/grequest.cpp b/engines/saga2/grequest.cpp
index 706a8b9598..138b4b000d 100644
--- a/engines/saga2/grequest.cpp
+++ b/engines/saga2/grequest.cpp
@@ -172,7 +172,7 @@ void ModalDialogWindow::drawClipped(
gPort &port,
const Point16 &offset,
const Rect16 &r) {
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
int16 i;
Point16 origin;
@@ -181,13 +181,13 @@ void ModalDialogWindow::drawClipped(
SAVE_GPORT_STATE(port);
- origin.x = extent.x - offset.x;
- origin.y = extent.y - offset.y;
+ origin.x = _extent.x - offset.x;
+ origin.y = _extent.y - offset.y;
rect.x = origin.x;
rect.y = origin.y;
- rect.width = extent.width;
- rect.height = extent.height;
+ rect.width = _extent.width;
+ rect.height = _extent.height;
port.setColor(4);
port.frameRect(rect, 2);
diff --git a/engines/saga2/gtextbox.cpp b/engines/saga2/gtextbox.cpp
index e098d42a4f..14baf521d1 100644
--- a/engines/saga2/gtextbox.cpp
+++ b/engines/saga2/gtextbox.cpp
@@ -458,7 +458,7 @@ void gTextBox::scroll(int8 req) {
Rect16 textBoxExtent = editRect;
// setup the editing extent
- textBoxExtent.y = (fontOffset * visIndex) + extent.y;
+ textBoxExtent.y = (fontOffset * visIndex) + _extent.y;
setEditExtent(textBoxExtent);
fullRedraw = true;
@@ -568,7 +568,7 @@ bool gTextBox::pointerHit(gPanelMessage &msg) {
int16 newPos;
- if (Rect16(0, 0, extent.width, extent.height).ptInside(pos)) {
+ if (Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
int8 newIndex;
// get the position of the line
newIndex = clamp(0, pos.y / fontOffset, linesPerPage - 1);
@@ -800,11 +800,11 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
// Now, redraw the contents.
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
drawContents(); // draw the string
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
return true;
}
@@ -854,14 +854,14 @@ void gTextBox::handleTimerTick(int32 tick) {
if (tick - blinkStart > blinkTime) {
gPort &port = window.windowPort;
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
port.setPenMap(port.penMap);
port.setStyle(0);
port.setColor(blinkState ? blinkColor0 : blinkColor1);
port.fillRect(editRect.x + blinkX - ((blinkWide + 1) / 2), editRect.y + 1, blinkWide, editRect.height - 1);
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
blinkState = !blinkState;
blinkStart = tick;
@@ -1002,7 +1002,7 @@ void gTextBox::drawClipped(void) {
WriteStatusF(11, "Entry %d[%d] (%d:%d)", index, currentLen[index], cursorPos, anchorPos);
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
if (fullRedraw) {
drawAll(port, Point16(0, 0), Rect16(0, 0, rect.width, rect.height));
@@ -1018,7 +1018,7 @@ void gTextBox::drawClipped(void) {
drawAll(port, Point16(0, 0), Rect16(0, 0, rect.width, rect.height));
}
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
@@ -1093,7 +1093,7 @@ void gTextBox::drawAll(gPort &port,
port.setMode(drawModeMatte);
port.bltPixels(*tempPort.map, 0, 0,
- extent.x + 1, extent.y + 1,
+ _extent.x + 1, _extent.y + 1,
bufRect.width, bufRect.height);
}
diff --git a/engines/saga2/intrface.cpp b/engines/saga2/intrface.cpp
index 8b52eccbf9..ed5f36dcba 100644
--- a/engines/saga2/intrface.cpp
+++ b/engines/saga2/intrface.cpp
@@ -452,7 +452,7 @@ void CPlaqText::enable(bool abled) {
}
void CPlaqText::invalidate(Rect16 *) {
- window.update(extent);
+ window.update(_extent);
}
void CPlaqText::draw(void) {
@@ -468,9 +468,9 @@ void CPlaqText::draw(void) {
port.setMode(drawModeMatte);
port.setFont(buttonFont);
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
drawClipped(port, Point16(0, 0), Rect16(0, 0, rect.width, rect.height));
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
// reset the old font
port.setFont(oldFont);
@@ -479,9 +479,9 @@ void CPlaqText::draw(void) {
void CPlaqText::drawClipped(gPort &port,
const Point16 &offset,
const Rect16 &r) {
- if (extent.overlap(r)) {
+ if (_extent.overlap(r)) {
if (*lineBuf) {
- textRect = extent;
+ textRect = _extent;
textRect.x -= offset.x;
textRect.y -= offset.y;
@@ -673,7 +673,7 @@ void CStatusLine::experationCheck(void) {
&& (waitAlarm.check()
|| (queueTail != queueHead && minWaitAlarm.check()))) {
enable(false);
- window.update(extent);
+ window.update(_extent);
lineDisplayed = false;
}
@@ -698,7 +698,7 @@ void CStatusLine::experationCheck(void) {
queueTail = bump(queueTail);
// draw the new textline
- window.update(extent);
+ window.update(_extent);
lineDisplayed = true;
}
@@ -706,7 +706,7 @@ void CStatusLine::experationCheck(void) {
void CStatusLine::clear(void) {
enable(false);
- window.update(extent);
+ window.update(_extent);
lineDisplayed = false;
queueHead = queueTail = 0;
@@ -968,9 +968,9 @@ void CManaIndicator::draw(void) {
// setup the port
port.setMode(drawModeMatte);
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
drawClipped(port, Point16(0, 0), Rect16(0, 0, xSize, ySize));
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
@@ -986,16 +986,16 @@ void CManaIndicator::drawClipped(gPort &port,
calcDraw = update(g_vm->_playerList[getCenterActorPlayerID()]);
if (!calcDraw) {
- if (!extent.overlap(clipRect)) return;
+ if (!_extent.overlap(clipRect)) return;
// draw the saved image to the port
port.setMode(drawModeMatte);
port.bltPixels(savedMap, 0, 0,
- extent.x - offset.x, extent.y - offset.y,
+ _extent.x - offset.x, _extent.y - offset.y,
xSize, ySize);
// draw the frame
- drawCompressedImage(port, Point16(extent.x - offset.x, extent.y - offset.y), backImage);
+ drawCompressedImage(port, Point16(_extent.x - offset.x, _extent.y - offset.y), backImage);
// and finish
return;
@@ -1109,11 +1109,11 @@ void CManaIndicator::drawClipped(gPort &port,
// Blit the pixelmap to the main screen
port.setMode(drawModeMatte);
port.bltPixels(*tempPort.map, 0, 0,
- extent.x - offset.x, extent.y - offset.y,
+ _extent.x - offset.x, _extent.y - offset.y,
xSize, ySize);
// now blit the frame on top of it all.
- drawCompressedImage(port, Point16(extent.x - offset.x, extent.y - offset.y), backImage);
+ drawCompressedImage(port, Point16(_extent.x - offset.x, _extent.y - offset.y), backImage);
// dispose of temporary pixelmap
DisposeTempPort(tempPort);
@@ -2619,7 +2619,7 @@ void gArmorIndicator::setValue(PlayerActorID brotherID) {
void gArmorIndicator::drawClipped(gPort &port,
const Point16 &offset,
const Rect16 &r) {
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
SAVE_GPORT_STATE(port);
@@ -2629,12 +2629,12 @@ void gArmorIndicator::drawClipped(gPort &port,
// make sure the image is valid
if (dispImage) {
// will part of this be drawn on screen?
- if (extent.overlap(r)) {
+ if (_extent.overlap(r)) {
char buf[8];
// offset the image?
- Point16 pos(extent.x - offset.x,
- extent.y - offset.y
+ Point16 pos(_extent.x - offset.x,
+ _extent.y - offset.y
);
// draw the compressed image
if (isGhosted()) {
@@ -2655,24 +2655,24 @@ void gArmorIndicator::drawClipped(gPort &port,
sprintf(buf, "%d/%d", attr.damageAbsorbtion, attr.damageDivider);
else sprintf(buf, "%d", attr.damageAbsorbtion);
- port.drawTextInBox(buf, -1, Rect16(pos.x, pos.y, extent.width, extent.height),
+ port.drawTextInBox(buf, -1, Rect16(pos.x, pos.y, _extent.width, _extent.height),
textPosRight | textPosHigh, Point16(0, 2));
if (attr.damageAbsorbtion == 0 && attr.defenseBonus == 0)
sprintf(buf, "-");
else sprintf(buf, "%d", attr.defenseBonus);
- port.drawTextInBox(buf, -1, Rect16(pos.x, pos.y, extent.width, extent.height),
+ port.drawTextInBox(buf, -1, Rect16(pos.x, pos.y, _extent.width, _extent.height),
textPosRight | textPosLow, Point16(0, 2));
}
}
}
void gEnchantmentDisplay::drawClipped(gPort &port, const Point16 &offset, const Rect16 &r) {
- Point16 pos(extent.x + extent.width - 10, extent.y + 1);
+ Point16 pos(_extent.x + _extent.width - 10, _extent.y + 1);
pos += offset;
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
for (int i = 0; i < iconCount; i++) {
if (iconFlags[i]) {
@@ -2688,7 +2688,7 @@ void gEnchantmentDisplay::pointerMove(gPanelMessage &msg) {
if (msg.pointerLeave) {
g_vm->_mouseInfo->setText(nullptr);
} else {
- int16 x = extent.width - 10;
+ int16 x = _extent.width - 10;
setMousePoll(true);
setValue(getCenterActorPlayerID());
diff --git a/engines/saga2/modal.cpp b/engines/saga2/modal.cpp
index d7ac63dd6f..947d252144 100644
--- a/engines/saga2/modal.cpp
+++ b/engines/saga2/modal.cpp
@@ -98,7 +98,7 @@ void ModalWindow::close(void) {
gWindow::close();
GameMode::SetStack(prevModeStackPtr, prevModeStackCtr);
- updateWindowSection(extent);
+ updateWindowSection(_extent);
}
diff --git a/engines/saga2/msgbox.cpp b/engines/saga2/msgbox.cpp
index 69bc018c10..d0b8632c26 100644
--- a/engines/saga2/msgbox.cpp
+++ b/engines/saga2/msgbox.cpp
@@ -236,16 +236,16 @@ void SimpleWindow::update(const Rect16 &) {
}
void SimpleWindow::draw(void) {
- g_vm->_pointer->hide(g_vm->_mainPort, extent); // hide mouse pointer
- drawClipped(g_vm->_mainPort, Point16(0, 0), extent);
- g_vm->_pointer->show(g_vm->_mainPort, extent); // show mouse pointer
+ g_vm->_pointer->hide(g_vm->_mainPort, _extent); // hide mouse pointer
+ drawClipped(g_vm->_mainPort, Point16(0, 0), _extent);
+ g_vm->_pointer->show(g_vm->_mainPort, _extent); // show mouse pointer
}
void SimpleWindow::drawClipped(
gPort &port,
const Point16 &p,
const Rect16 &r) {
- Rect16 box = extent;
+ Rect16 box = _extent;
//gFont *buttonFont=&Onyx10Font;
int16 textPos = textPosHigh;
//textPallete pal( 33+9, 36+9, 41+9, 34+9, 40+9, 43+9 );
@@ -257,14 +257,14 @@ void SimpleWindow::drawClipped(
box.height -= 100;
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
- DrawOutlineFrame(port, extent, windowColor);
+ DrawOutlineFrame(port, _extent, windowColor);
writeWrappedPlaqText(port, box, mbButtonFont, textPos, pal, false, title);
gWindow::drawClipped(port, p, r);
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
/* ===================================================================== *
@@ -398,11 +398,11 @@ void SimpleButton::draw(void) {
Rect16 rect = window->getExtent();
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
drawClipped(port,
Point16(0, 0),
Rect16(0, 0, rect.width, rect.height));
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
void SimpleButton::drawClipped(
@@ -411,22 +411,22 @@ void SimpleButton::drawClipped(
const Rect16 &) {
Rect16 base = window->getExtent();
- Rect16 box = Rect16(extent.x + 1,
- extent.y + 1,
- extent.width - 2,
- extent.height - 2);
+ Rect16 box = Rect16(_extent.x + 1,
+ _extent.y + 1,
+ _extent.width - 2,
+ _extent.height - 2);
box.x += base.x;
box.y += base.y;
SAVE_GPORT_STATE(port); // save pen color, etc.
- g_vm->_pointer->hide(port, extent); // hide mouse pointer
+ g_vm->_pointer->hide(port, _extent); // hide mouse pointer
SimpleWindow::DrawOutlineFrame(port, // draw outer frame
box,
buttonColor);
drawTitle((enum text_positions)0);
- g_vm->_pointer->show(port, extent); // show mouse pointer
+ g_vm->_pointer->show(port, _extent); // show mouse pointer
}
} // end of namespace Saga2
diff --git a/engines/saga2/panel.cpp b/engines/saga2/panel.cpp
index 1ff6624f31..5aa888fa61 100644
--- a/engines/saga2/panel.cpp
+++ b/engines/saga2/panel.cpp
@@ -56,7 +56,7 @@ int lockUINest = 0;
* ======================================================================= */
gPanel::gPanel(gWindow &win, const Rect16 &box, AppFunc *cmd)
- : window(win), extent(box), command(cmd) {
+ : window(win), _extent(box), command(cmd) {
enabled = 1;
ghosted = 0;
selected = 0;
@@ -71,7 +71,7 @@ gPanel::gPanel(gPanelList &list, const Rect16 &box,
const char *newTitle, uint16 ident, AppFunc *cmd)
: window(list.window) {
title = newTitle;
- extent = box;
+ _extent = box;
enabled = 1;
ghosted = 0;
selected = 0;
@@ -86,7 +86,7 @@ gPanel::gPanel(gPanelList &list, const Rect16 &box,
gPixelMap &pic, uint16 ident, AppFunc *cmd)
: window(list.window) {
title = (char *)&pic;
- extent = box;
+ _extent = box;
enabled = 1;
ghosted = 0;
selected = 0;
@@ -101,7 +101,7 @@ gPanel::gPanel(gPanelList &list, const StaticRect &box,
const char *newTitle, uint16 ident, AppFunc *cmd)
: window(list.window) {
title = newTitle;
- extent = Rect16(box);
+ _extent = Rect16(box);
enabled = 1;
ghosted = 0;
selected = 0;
@@ -159,8 +159,8 @@ void gPanel::notify(enum gEventType type, int32 value) {
ev.panel = this;
ev.eventType = type;
ev.value = value;
- ev.mouse.x = g_vm->_toolBase->pickPos.x - extent.x;
- ev.mouse.y = g_vm->_toolBase->pickPos.y - extent.y;
+ ev.mouse.x = g_vm->_toolBase->pickPos.x - _extent.x;
+ ev.mouse.y = g_vm->_toolBase->pickPos.y - _extent.y;
ev.window = &window;
if (command) command(ev);
@@ -181,13 +181,13 @@ void gPanel::makeActive(void) {
void gPanel::invalidate(Rect16 *) {
assert(displayEnabled());
- window.update(extent);
+ window.update(_extent);
}
void gPanel::drawTitle(enum text_positions placement) {
gPort &port = window.windowPort;
- Rect16 r = extent;
+ Rect16 r = _extent;
const gPixelMap *img = nullptr;
if (title == NULL)
@@ -205,27 +205,27 @@ void gPanel::drawTitle(enum text_positions placement) {
switch (placement) {
case textPosLeft:
r.x -= r.width + 2;
- r.y += (extent.height - r.height) / 2 + 1;
+ r.y += (_extent.height - r.height) / 2 + 1;
break;
case textPosRight:
- r.x += extent.width + 3;
- r.y += (extent.height - r.height) / 2 + 1;
+ r.x += _extent.width + 3;
+ r.y += (_extent.height - r.height) / 2 + 1;
break;
case textPosHigh:
- r.x += (extent.width - r.width) / 2;
+ r.x += (_extent.width - r.width) / 2;
r.y -= r.height + 1;
break;
case textPosLow:
- r.x += (extent.width - r.width) / 2;
- r.y += extent.height + 2;
+ r.x += (_extent.width - r.width) / 2;
+ r.y += _extent.height + 2;
break;
default:
- r.x += (extent.width - r.width) / 2;
- r.y += (extent.height - r.height) / 2;
+ r.x += (_extent.width - r.width) / 2;
+ r.y += (_extent.height - r.height) / 2;
break;
}
@@ -248,7 +248,7 @@ void gPanel::drawTitle(enum text_positions placement) {
}
gPanel *gPanel::hitTest(const Point16 &p) {
- return enabled && !ghosted && extent.ptInside(p) ? this : NULL;
+ return enabled && !ghosted && _extent.ptInside(p) ? this : NULL;
}
gPanel *gPanel::keyTest(int16) {
@@ -333,8 +333,8 @@ void gPanelList::drawClipped(
const Point16 &offset,
const Rect16 &r) {
gPanel *ctl;
- Point16 tmpOffset = offset - Point16(extent.x, extent.y);
- Rect16 tmpR = r - Point16(extent.x, extent.y);
+ Point16 tmpOffset = offset - Point16(_extent.x, _extent.y);
+ Rect16 tmpR = r - Point16(_extent.x, _extent.y);
if (displayEnabled())
if (enabled) {
@@ -483,7 +483,7 @@ void gWindow::toFront(void) { // re-order the windows
g_vm->_toolBase->activeWindow = this;
// redraw the window
- update(extent);
+ update(_extent);
}
bool gWindow::isModal(void) {
@@ -493,20 +493,20 @@ bool gWindow::isModal(void) {
void gWindow::setPos(Point16 pos) {
Rect16 newClip;
- extent.x = pos.x;
- extent.y = pos.y;
+ _extent.x = pos.x;
+ _extent.y = pos.y;
// int16 titleHeight = mainFont->height + 5;
// We also need to set up the window's port in a similar fashion.
- windowPort.origin.x = extent.x;
- windowPort.origin.y = extent.y;
+ windowPort.origin.x = _extent.x;
+ windowPort.origin.y = _extent.y;
// set port's clip
- newClip = intersect(extent, g_vm->_mainPort.clip);
- newClip.x -= extent.x;
- newClip.y -= extent.y;
+ newClip = intersect(_extent, g_vm->_mainPort.clip);
+ newClip.x -= _extent.x;
+ newClip.y -= _extent.y;
windowPort.setClip(newClip);
//saver.onMove(this);
@@ -514,8 +514,8 @@ void gWindow::setPos(Point16 pos) {
}
void gWindow::setExtent(const Rect16 &r) {
- extent.width = r.width;
- extent.height = r.height;
+ _extent.width = r.width;
+ _extent.height = r.height;
//saver.onSize(this);
setPos(Point16(r.x, r.y));
@@ -671,12 +671,12 @@ gPanel *gControl::keyTest(int16 key) {
// drawClipped with the main port.
void gControl::draw(void) {
- g_vm->_pointer->hide(window.windowPort, extent);
+ g_vm->_pointer->hide(window.windowPort, _extent);
if (displayEnabled())
drawClipped(*globalPort,
- Point16(-window.extent.x, -window.extent.y),
- window.extent);
- g_vm->_pointer->show(window.windowPort, extent);
+ Point16(-window._extent.x, -window._extent.y),
+ window._extent);
+ g_vm->_pointer->show(window.windowPort, _extent);
}
/* ===================================================================== *
@@ -802,11 +802,11 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
// Set up the pick position relative to the window
if (activePanel) {
- pickPos.x = _curMouseState.pos.x - activePanel->window.extent.x;
- pickPos.y = _curMouseState.pos.y - activePanel->window.extent.y;
+ pickPos.x = _curMouseState.pos.x - activePanel->window._extent.x;
+ pickPos.y = _curMouseState.pos.y - activePanel->window._extent.y;
} else {
- pickPos.x = _curMouseState.pos.x - w->extent.x;
- pickPos.y = _curMouseState.pos.y - w->extent.y;
+ pickPos.x = _curMouseState.pos.x - w->_extent.x;
+ pickPos.y = _curMouseState.pos.y - w->_extent.y;
}
// Fill in the message to be sent to the various panels
@@ -826,7 +826,7 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
// is occuring outside the panel, then it should be
// deselected.
- if (activePanel->extent.ptInside(pickPos) == false)
+ if (activePanel->_extent.ptInside(pickPos) == false)
activePanel->deactivate();
}
@@ -848,11 +848,11 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
Common::List<gWindow *>::iterator it;
for (it = windowList.begin(); it != windowList.end(); ++it) {
w = *it;
- if (w->extent.ptInside(_curMouseState.pos) || w->isModal()) {
+ if (w->_extent.ptInside(_curMouseState.pos) || w->isModal()) {
// Set up the pick position relative to the window
- pickPos.x = _curMouseState.pos.x - w->extent.x;
- pickPos.y = _curMouseState.pos.y - w->extent.y;
+ pickPos.x = _curMouseState.pos.x - w->_extent.x;
+ pickPos.y = _curMouseState.pos.y - w->_extent.y;
if ((ctl = w->hitTest(pickPos)) != NULL)
pickPanel = ctl;
@@ -876,13 +876,13 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
if (&mousePanel->window != w) {
// Temporarily adjust pickPos to be relative to the old panel's window
// instead of the new panel's window.
- pickPos.x = _curMouseState.pos.x - mousePanel->window.extent.x;
- pickPos.y = _curMouseState.pos.y - mousePanel->window.extent.y;
+ pickPos.x = _curMouseState.pos.x - mousePanel->window._extent.x;
+ pickPos.y = _curMouseState.pos.y - mousePanel->window._extent.y;
setMsgQ(msg, mousePanel); // set up gPanelMessage
- pickPos.x = _curMouseState.pos.x - w->extent.x;
- pickPos.y = _curMouseState.pos.y - w->extent.y;
+ pickPos.x = _curMouseState.pos.x - w->_extent.x;
+ pickPos.y = _curMouseState.pos.y - w->_extent.y;
} else {
setMsgQ(msg, mousePanel); // set up gPanelMessage
}
diff --git a/engines/saga2/panel.h b/engines/saga2/panel.h
index 59d8cc6328..c5cece37bc 100644
--- a/engines/saga2/panel.h
+++ b/engines/saga2/panel.h
@@ -128,7 +128,7 @@ class gPanel {
AppFunc *command; // application function
protected:
gWindow &window; // window this belongs to
- Rect16 extent; // rectangular bounds of the control
+ Rect16 _extent; // rectangular bounds of the control
const char *title; // title of the panel
byte enabled, // allows disabling the panel
selected, // some panels have a selected state
@@ -196,7 +196,7 @@ public:
}
void makeActive(void);
Rect16 getExtent(void) {
- return extent;
+ return _extent;
}
bool isSelected(void) {
return selected != 0;
@@ -367,7 +367,7 @@ private:
public:
void setExtent(const Rect16 &); // set window position and size
Rect16 getExtent(void) {
- return extent; // set window position and size
+ return _extent; // set window position and size
}
protected:
void setPos(Point16 pos); // set window position
@@ -515,8 +515,8 @@ private:
if (panel == &panel->window)
msg_.pickPos = pickPos;
else {
- msg.pickPos.x = (int16)(pickPos.x - panel->extent.x);
- msg.pickPos.y = (int16)(pickPos.y - panel->extent.y);
+ msg.pickPos.x = (int16)(pickPos.x - panel->_extent.x);
+ msg.pickPos.y = (int16)(pickPos.y - panel->_extent.y);
}
}
@@ -524,8 +524,8 @@ private:
setMsgQ(msg_, panel);
msg.inPanel = (msg_.pickPos.x >= 0
&& msg_.pickPos.y >= 0
- && msg_.pickPos.x < panel->extent.width
- && msg_.pickPos.y < panel->extent.height);
+ && msg_.pickPos.x < panel->_extent.width
+ && msg_.pickPos.y < panel->_extent.height);
// panel->extent.ptInside( pickPos );
}
diff --git a/engines/saga2/uidialog.cpp b/engines/saga2/uidialog.cpp
index ce5d23baaf..bb8d69cbbd 100644
--- a/engines/saga2/uidialog.cpp
+++ b/engines/saga2/uidialog.cpp
@@ -1342,7 +1342,7 @@ void CPlacardWindow::drawClipped(
gPort &port,
const Point16 &offset,
const Rect16 &r) {
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
// do background drawing first...
ModalWindow::drawClipped(port, offset, r);
@@ -1353,13 +1353,13 @@ void CPlacardWindow::drawClipped(
SAVE_GPORT_STATE(port);
- origin.x = extent.x - offset.x;
- origin.y = extent.y - offset.y;
+ origin.x = _extent.x - offset.x;
+ origin.y = _extent.y - offset.y;
rect.x = origin.x;
rect.y = origin.y;
- rect.width = extent.width;
- rect.height = extent.height;
+ rect.width = _extent.width;
+ rect.height = _extent.height;
for (i = 0; i < titleCount; i++) {
Point16 textPos = origin + titlePos[i];
@@ -1435,7 +1435,7 @@ void CPlacardPanel::drawClipped(
gPort &port,
const Point16 &offset,
const Rect16 &r) {
- if (!extent.overlap(r)) return;
+ if (!_extent.overlap(r)) return;
// do background drawing first...
int16 i;
@@ -1444,13 +1444,13 @@ void CPlacardPanel::drawClipped(
SAVE_GPORT_STATE(port);
- origin.x = extent.x - offset.x;
- origin.y = extent.y - offset.y;
+ origin.x = _extent.x - offset.x;
+ origin.y = _extent.y - offset.y;
rect.x = origin.x;
rect.y = origin.y;
- rect.width = extent.width;
- rect.height = extent.height;
+ rect.width = _extent.width;
+ rect.height = _extent.height;
for (i = 0; i < titleCount; i++) {
Point16 textPos = origin + titlePos[i];
diff --git a/engines/saga2/videobox.cpp b/engines/saga2/videobox.cpp
index ecc7d3856d..d5598f5146 100644
--- a/engines/saga2/videobox.cpp
+++ b/engines/saga2/videobox.cpp
@@ -122,7 +122,7 @@ void CVideoBox::drawClipped(
void CVideoBox::draw(void) { // redraw the window
// draw the decoration stuff
- drawClipped(g_vm->_mainPort, Point16(0, 0), extent);
+ drawClipped(g_vm->_mainPort, Point16(0, 0), _extent);
}
More information about the Scummvm-git-logs
mailing list