aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2015-12-07 07:18:16 +0100
committerWillem Jan Palenstijn2015-12-23 21:33:52 +0100
commit895d29c1ae411d6a28135451e91e88eba1693f99 (patch)
tree3a41882a36e4a841b8ecce179243b346fca5ef11 /engines
parentd264621832bbfe99cb1232f7fd8165cdc2ecc475 (diff)
downloadscummvm-rg350-895d29c1ae411d6a28135451e91e88eba1693f99.tar.gz
scummvm-rg350-895d29c1ae411d6a28135451e91e88eba1693f99.tar.bz2
scummvm-rg350-895d29c1ae411d6a28135451e91e88eba1693f99.zip
LAB: Some more renaming, remove useless variables
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/engine.cpp16
-rw-r--r--engines/lab/eventman.cpp2
-rw-r--r--engines/lab/interface.cpp50
-rw-r--r--engines/lab/interface.h12
-rw-r--r--engines/lab/intro.cpp10
-rw-r--r--engines/lab/map.cpp19
-rw-r--r--engines/lab/special.cpp22
7 files changed, 62 insertions, 69 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index 17ae4cc560..80035f3877 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -132,7 +132,7 @@ void LabEngine::freeScreens() {
void LabEngine::perFlipGadget(uint16 gadgetId) {
for (GadgetList::iterator gadget = _moveGadgetList.begin(); gadget != _moveGadgetList.end(); ++gadget) {
Gadget *topGadget = *gadget;
- if (topGadget->GadgetID == gadgetId) {
+ if (topGadget->_gadgetID == gadgetId) {
Image *tmpImage = topGadget->_image;
topGadget->_image = topGadget->_altImage;
topGadget->_altImage = tmpImage;
@@ -516,11 +516,11 @@ void LabEngine::mainGameLoop() {
gotMessage = true;
Common::Point curPos;
- curPos.x = curMsg->mouseX;
- curPos.y = curMsg->mouseY;
+ curPos.x = curMsg->_mouseX;
+ curPos.y = curMsg->_mouseY;
_followingCrumbs = false;
- if (!from_crumbs(curMsg->msgClass, curMsg->code, curMsg->qualifier, curPos, curInv, curMsg, forceDraw, curMsg->gadgetID, actionMode))
+ if (!from_crumbs(curMsg->_msgClass, curMsg->_code, curMsg->_qualifier, curPos, curInv, curMsg, forceDraw, curMsg->_gadgetID, actionMode))
break;
}
}
@@ -618,14 +618,14 @@ bool LabEngine::from_crumbs(uint32 tmpClass, uint16 code, uint16 Qualifier, Comm
_music->updateMusic();
_anim->diffNextFrame();
} else {
- if (curMsg->msgClass == RAWKEY) {
- if ((curMsg->code == 'Y') || (curMsg->code == 'y') || (curMsg->code == 'Q') || (curMsg->code == 'q')) {
+ if (curMsg->_msgClass == RAWKEY) {
+ if ((curMsg->_code == 'Y') || (curMsg->_code == 'y') || (curMsg->_code == 'Q') || (curMsg->_code == 'q')) {
doit = true;
break;
- } else if (curMsg->code < 128) {
+ } else if (curMsg->_code < 128) {
break;
}
- } else if (curMsg->msgClass == MOUSEBUTTONS) {
+ } else if (curMsg->_msgClass == MOUSEBUTTONS) {
break;
}
}
diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp
index aeb6fa3b44..b1b1a68e70 100644
--- a/engines/lab/eventman.cpp
+++ b/engines/lab/eventman.cpp
@@ -63,7 +63,7 @@ Gadget *EventManager::checkGadgetHit(GadgetList *gadgetList, Common::Point pos)
if ((pos.x >= gadget->x) && (pos.y >= gadget->y) &&
(pos.x <= (gadget->x + gadget->_image->_width)) &&
(pos.y <= (gadget->y + gadget->_image->_height)) &&
- !(GADGETOFF & gadget->GadgetFlags)) {
+ !(GADGETOFF & gadget->_flags)) {
if (_vm->_isHiRes) {
_hitGadget = gadget;
} else {
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
index d437fd233e..a044fda849 100644
--- a/engines/lab/interface.cpp
+++ b/engines/lab/interface.cpp
@@ -48,8 +48,8 @@ Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image
if ((gptr = new Gadget())) {
gptr->x = x;
gptr->y = y;
- gptr->GadgetID = id;
- gptr->KeyEquiv = key;
+ gptr->_gadgetID = id;
+ gptr->_keyEquiv = key;
gptr->_image = im;
gptr->_altImage = imalt;
@@ -79,7 +79,7 @@ void drawGadgetList(GadgetList *gadgetList) {
for (GadgetList::iterator gadget = gadgetList->begin(); gadget != gadgetList->end(); ++gadget) {
(*gadget)->_image->drawImage((*gadget)->x, (*gadget)->y);
- if (GADGETOFF & (*gadget)->GadgetFlags)
+ if (GADGETOFF & (*gadget)->_flags)
disableGadget((*gadget), 1);
}
}
@@ -90,7 +90,7 @@ void drawGadgetList(GadgetList *gadgetList) {
/*****************************************************************************/
void disableGadget(Gadget *curgad, uint16 pencolor) {
g_lab->_graphics->overlayRect(pencolor, curgad->x, curgad->y, curgad->x + curgad->_image->_width - 1, curgad->y + curgad->_image->_height - 1);
- curgad->GadgetFlags |= GADGETOFF;
+ curgad->_flags |= GADGETOFF;
}
@@ -100,7 +100,7 @@ void disableGadget(Gadget *curgad, uint16 pencolor) {
/*****************************************************************************/
void enableGadget(Gadget *curgad) {
curgad->_image->drawImage(curgad->x, curgad->y);
- curgad->GadgetFlags &= !(GADGETOFF);
+ curgad->_flags &= !(GADGETOFF);
}
@@ -126,9 +126,9 @@ Gadget *LabEngine::checkNumGadgetHit(GadgetList *gadgetList, uint16 key) {
for (GadgetList::iterator gadgetItr = gadgetList->begin(); gadgetItr != gadgetList->end(); ++gadgetItr) {
Gadget *gadget = *gadgetItr;
- if ((gkey - 1 == gadget->GadgetID || (gkey == 0 && gadget->GadgetID == 9) ||
- (gadget->KeyEquiv != 0 && makeGadgetKeyEquiv(key) == gadget->KeyEquiv))
- && !(GADGETOFF & gadget->GadgetFlags)) {
+ if ((gkey - 1 == gadget->_gadgetID || (gkey == 0 && gadget->_gadgetID == 9) ||
+ (gadget->_keyEquiv != 0 && makeGadgetKeyEquiv(key) == gadget->_keyEquiv))
+ && !(GADGETOFF & gadget->_flags)) {
_event->mouseHide();
gadget->_altImage->drawImage(gadget->x, gadget->y);
_event->mouseShow();
@@ -156,30 +156,30 @@ IntuiMessage *LabEngine::getMsg() {
if ((curgad = _event->mouseGadget()) != NULL) {
_event->updateMouse();
- IMessage.msgClass = GADGETUP;
- IMessage.code = curgad->GadgetID;
- IMessage.gadgetID = curgad->GadgetID;
- IMessage.qualifier = Qualifiers;
+ IMessage._msgClass = GADGETUP;
+ IMessage._code = curgad->_gadgetID;
+ IMessage._gadgetID = curgad->_gadgetID;
+ IMessage._qualifier = Qualifiers;
return &IMessage;
- } else if (_event->mouseButton(&IMessage.mouseX, &IMessage.mouseY, true)) { /* Left Button */
- IMessage.qualifier = IEQUALIFIER_LEFTBUTTON | Qualifiers;
- IMessage.msgClass = MOUSEBUTTONS;
+ } else if (_event->mouseButton(&IMessage._mouseX, &IMessage._mouseY, true)) { /* Left Button */
+ IMessage._qualifier = IEQUALIFIER_LEFTBUTTON | Qualifiers;
+ IMessage._msgClass = MOUSEBUTTONS;
return &IMessage;
- } else if (_event->mouseButton(&IMessage.mouseX, &IMessage.mouseY, false)) { /* Right Button */
- IMessage.qualifier = IEQUALIFIER_RBUTTON | Qualifiers;
- IMessage.msgClass = MOUSEBUTTONS;
+ } else if (_event->mouseButton(&IMessage._mouseX, &IMessage._mouseY, false)) { /* Right Button */
+ IMessage._qualifier = IEQUALIFIER_RBUTTON | Qualifiers;
+ IMessage._msgClass = MOUSEBUTTONS;
return &IMessage;
- } else if (_event->keyPress(&IMessage.code)) { /* Keyboard key */
- curgad = checkNumGadgetHit(_event->_screenGadgetList, IMessage.code);
+ } else if (_event->keyPress(&IMessage._code)) { /* Keyboard key */
+ curgad = checkNumGadgetHit(_event->_screenGadgetList, IMessage._code);
if (curgad) {
- IMessage.msgClass = GADGETUP;
- IMessage.code = curgad->GadgetID;
- IMessage.gadgetID = curgad->GadgetID;
+ IMessage._msgClass = GADGETUP;
+ IMessage._code = curgad->_gadgetID;
+ IMessage._gadgetID = curgad->_gadgetID;
} else
- IMessage.msgClass = RAWKEY;
+ IMessage._msgClass = RAWKEY;
- IMessage.qualifier = Qualifiers;
+ IMessage._qualifier = Qualifiers;
return &IMessage;
} else
return NULL;
diff --git a/engines/lab/interface.h b/engines/lab/interface.h
index 83c8badc15..a8d1140959 100644
--- a/engines/lab/interface.h
+++ b/engines/lab/interface.h
@@ -37,16 +37,16 @@
namespace Lab {
struct IntuiMessage {
- uint32 msgClass;
- uint16 code, qualifier, mouseX, mouseY, gadgetID;
- uint32 seconds, micros;
+ uint32 _msgClass;
+ uint16 _code, _qualifier, _mouseX, _mouseY, _gadgetID;
+ uint32 _seconds, _micros;
};
struct Gadget {
- uint16 x, y, GadgetID;
- uint16 KeyEquiv; // if not zero, a key that activates gadget
- uint32 GadgetFlags;
+ uint16 x, y, _gadgetID;
+ uint16 _keyEquiv; // if not zero, a key that activates gadget
+ uint32 _flags;
Image *_image, *_altImage;
};
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
index 070b03fd3c..7727ac1f93 100644
--- a/engines/lab/intro.cpp
+++ b/engines/lab/intro.cpp
@@ -53,8 +53,8 @@ void Intro::introEatMessages() {
if (msg == NULL)
return;
else {
- if (((msg->msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & msg->qualifier)) ||
- ((msg->msgClass == RAWKEY) && (msg->code == 27))
+ if (((msg->_msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & msg->_qualifier)) ||
+ ((msg->_msgClass == RAWKEY) && (msg->_code == 27))
)
_quitIntro = true;
}
@@ -151,9 +151,9 @@ void Intro::doPictText(const char *filename, TextFont *msgFont, bool isScreen) {
_vm->waitTOF();
} else {
- cls = msg->msgClass;
- qualifier = msg->qualifier;
- code = msg->code;
+ cls = msg->_msgClass;
+ qualifier = msg->_qualifier;
+ code = msg->_code;
if (((cls == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & qualifier)) ||
((cls == RAWKEY) && (code == 27))) {
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
index a565f31d06..7256562988 100644
--- a/engines/lab/map.cpp
+++ b/engines/lab/map.cpp
@@ -52,8 +52,6 @@ static Image *Map, *Room, *UpArrowRoom, *DownArrowRoom, *Bridge,
static uint16 MaxRooms;
static MapData *Maps;
-extern char *LOWERFLOORS, *MIDDLEFLOORS, *UPPERFLOORS, *MEDMAZEFLOORS, *HEDGEMAZEFLOORS, *SURMAZEFLOORS, *CARNIVALFLOOR, *SURMAZEMSG;
-
static uint16 MapGadX[3] = {101, 55, 8}, MapGadY[3] = {105, 105, 105};
static Gadget
@@ -71,8 +69,6 @@ static GadgetList *MapGadgetList;
#define SURMAZEFLOOR 6
#define CARNIVAL 7
-
-
static uint16 mapScaleX(uint16 x) {
if (g_lab->_isHiRes)
return (x - 45);
@@ -80,8 +76,6 @@ static uint16 mapScaleX(uint16 x) {
return ((x - 45) >> 1);
}
-
-
static uint16 mapScaleY(uint16 y) {
if (g_lab->_isHiRes)
return y;
@@ -89,7 +83,6 @@ static uint16 mapScaleY(uint16 y) {
return ((y - 35) >> 1) - (y >> 6);
}
-
/*****************************************************************************/
/* Loads in the map data. */
/*****************************************************************************/
@@ -532,12 +525,12 @@ void LabEngine::processMap(uint16 CurRoom) {
place = 1;
} else {
- Class = Msg->msgClass;
- Code = Msg->code;
- GadgetID = Msg->gadgetID;
- Qualifier = Msg->qualifier;
- MouseX = Msg->mouseX;
- MouseY = Msg->mouseY;
+ Class = Msg->_msgClass;
+ Code = Msg->_code;
+ GadgetID = Msg->_gadgetID;
+ Qualifier = Msg->_qualifier;
+ MouseX = Msg->_mouseX;
+ MouseY = Msg->_mouseY;
if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) ||
((Class == RAWKEY) && (Code == 27)))
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index f4c8439a57..0bed4181dd 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -200,8 +200,8 @@ static bool loadJournalData() {
delete journalFile;
- BackG.KeyEquiv = VKEY_LTARROW;
- ForwardG.KeyEquiv = VKEY_RTARROW;
+ BackG._keyEquiv = VKEY_LTARROW;
+ ForwardG._keyEquiv = VKEY_RTARROW;
uint16 counter = 0;
@@ -219,7 +219,7 @@ static bool loadJournalData() {
else
gadget->y = g_lab->_graphics->VGAScaleY(JGadY[counter]) - g_lab->_graphics->SVGACord(1);
- gadget->GadgetID = counter;
+ gadget->_gadgetID = counter;
counter++;
}
@@ -345,9 +345,9 @@ void LabEngine::processJournal() {
if (Msg == NULL) {
_music->updateMusic();
} else {
- Class = Msg->msgClass;
- Qualifier = Msg->qualifier;
- GadID = Msg->code;
+ Class = Msg->_msgClass;
+ Qualifier = Msg->_qualifier;
+ GadID = Msg->_code;
if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) ||
((Class == RAWKEY) && (GadID == 27)))
@@ -554,11 +554,11 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isintera
if (Msg == NULL) {
_music->updateMusic();
} else {
- Class = Msg->msgClass;
- Qualifier = Msg->qualifier;
- MouseX = Msg->mouseX;
- MouseY = Msg->mouseY;
- Code = Msg->code;
+ Class = Msg->_msgClass;
+ Qualifier = Msg->_qualifier;
+ MouseX = Msg->_mouseX;
+ MouseY = Msg->_mouseY;
+ Code = Msg->_code;
if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) ||
((Class == RAWKEY) && (Code == 27)))