BAGEL: Renames in baglib/var.h

This commit is contained in:
Eugene Sandulenko 2024-05-05 13:21:18 +02:00
parent 29a8eaf7c7
commit b6c6f43b62
29 changed files with 493 additions and 493 deletions

View File

@ -374,7 +374,7 @@ void SBBasePda::setPdaState() {
const char *pdaMode;
const char *pdaPos;
CBagVar *curVar = VAR_MANAGER->GetVariable("INBAR");
CBagVar *curVar = g_VarManager->getVariable("INBAR");
if (curVar != nullptr) {
// Defined as global
@ -386,35 +386,35 @@ void SBBasePda::setPdaState() {
}
// Save the pda state and position
curVar = VAR_MANAGER->GetVariable(pdaMode);
curVar = g_VarManager->getVariable(pdaMode);
if (curVar != nullptr) {
switch (_pdaMode) {
case NOMODE:
curVar->SetValue("NOMODE");
curVar->setValue("NOMODE");
break;
case MAPMODE:
curVar->SetValue("MAPMODE");
curVar->setValue("MAPMODE");
break;
case INVMODE:
curVar->SetValue("INVMODE");
curVar->setValue("INVMODE");
break;
case LOGMODE:
curVar->SetValue("LOGMODE");
curVar->setValue("LOGMODE");
break;
case MOOMODE:
curVar->SetValue("MOOMODE");
curVar->setValue("MOOMODE");
break;
}
}
curVar = VAR_MANAGER->GetVariable(pdaPos);
curVar = g_VarManager->getVariable(pdaPos);
if (curVar != nullptr) {
switch (_pdaPos) {
case PDAUP:
curVar->SetValue("UP");
curVar->setValue("UP");
break;
case PDADOWN:
curVar->SetValue("DOWN");
curVar->setValue("DOWN");
break;
default:
break;
@ -428,7 +428,7 @@ void SBBasePda::getPdaState() {
const char *pdaMode;
const char *pdaPos;
CBagVar *curVar = VAR_MANAGER->GetVariable("INBAR");
CBagVar *curVar = g_VarManager->getVariable("INBAR");
if (curVar != nullptr) {
// Defined as global
@ -439,9 +439,9 @@ void SBBasePda::getPdaState() {
pdaPos = "PDAPOSITION";
}
curVar = VAR_MANAGER->GetVariable(pdaMode);
curVar = g_VarManager->getVariable(pdaMode);
if (curVar) {
pdaState = curVar->GetValue();
pdaState = curVar->getValue();
// Now set the internal PDA state based on this info.
// If we saved during a movie, then restore to map mode.
if (pdaState.find("MAP") != -1 || pdaState.find("MOO") != -1) {
@ -458,9 +458,9 @@ void SBBasePda::getPdaState() {
}
// Get the PDA up/down position
curVar = VAR_MANAGER->GetVariable(pdaPos);
curVar = g_VarManager->getVariable(pdaPos);
if (curVar) {
pdaState = curVar->GetValue();
pdaState = curVar->getValue();
if (pdaState.find("UP") != -1) {
_pdaPos = PDAUP;
} else {

View File

@ -221,7 +221,7 @@ bool CBagCommandObject::runObject() {
} else if (getFileName() == "TURN") {
// Cause 1 turn to go by
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
} else if (getFileName() == "RP_UPDATE_QUEUE") {
// Execute any waiting residue printing results.

View File

@ -116,7 +116,7 @@ void CDevDlg::onMouseMove(uint32 /*nFlags*/, CBofPoint * /*pPoint*/, void *) {
void CDevDlg::onClose() {
assert(isValidObject(this));
CBagVar *varDialogReturn = VAR_MANAGER->GetVariable("DIALOGRETURN");
CBagVar *varDialogReturn = g_VarManager->getVariable("DIALOGRETURN");
if (varDialogReturn != nullptr) {
// If we need to parse the input for 2 words (Deven-7 Code words)
if (_useExtraFl) {
@ -127,15 +127,15 @@ void CDevDlg::onClose() {
p++;
// Set variable 2 (DIALOGRETURN2)
CBagVar *varDialogReturn2 = VAR_MANAGER->GetVariable("DIALOGRETURN2");
CBagVar *varDialogReturn2 = g_VarManager->getVariable("DIALOGRETURN2");
if (varDialogReturn2 != nullptr) {
varDialogReturn2->SetValue(p);
varDialogReturn2->setValue(p);
}
}
}
// Set variable 1 (DIALOGRETURN)
varDialogReturn->SetValue(_achGuess);
varDialogReturn->setValue(_achGuess);
}
delete _guessText;

View File

@ -53,9 +53,9 @@ bool CBagExpression::evaluate(CBagVar *leftHandOper, CBagVar *rightHandOper, OPE
// If the variable is named "RANDOM", generate a random number for its value
if (leftHandOper->getName() == "RANDOM")
leftHandOper->SetValue(g_engine->getRandomNumber());
leftHandOper->setValue(g_engine->getRandomNumber());
if (rightHandOper->getName() == "RANDOM")
rightHandOper->SetValue(g_engine->getRandomNumber());
rightHandOper->setValue(g_engine->getRandomNumber());
switch (oper) {
case OP_NONE:
@ -141,7 +141,7 @@ CBagVar *CBagExpression::getVariable(int itemPos) {
CBagVar *curVar = _varList.getNodeItem(itemPos);
// If the variable is a reference (OBJ.PROPERTY)
if (curVar->IsReference()) {
if (curVar->isReference()) {
char frontStr[256];
Common::strcpy_s(frontStr, curVar->getName());
@ -155,7 +155,7 @@ CBagVar *CBagExpression::getVariable(int itemPos) {
CBofString stringProperty(backStr, 256);
int newVal = g_SDevManager->getObjectValue(stringObject, stringProperty);
curVar->SetValue(newVal);
curVar->setValue(newVal);
}
}
@ -333,11 +333,11 @@ bool CBagExpression::onAssign(CBagVar *leftHandOper, CBagVar *rightHandOper, CBa
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
char buffer[256];
Common::strcpy_s(buffer, rightHandOper->GetValue());
Common::strcpy_s(buffer, rightHandOper->getValue());
assert(strlen(buffer) < 256);
CBofString newLeftHandValue(buffer, 256);
leftHandOper->SetValue(newLeftHandValue);
leftHandOper->setValue(newLeftHandValue);
return true;
}
@ -346,8 +346,8 @@ bool CBagExpression::onAssign(CBagVar *leftHandOper, CBagVar *rightHandOper, CBa
bool CBagExpression::onEqual(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
bool retVal = leftHandOper->GetValue() == rightHandOper->GetValue();
resultOper.SetBoolValue(retVal);
bool retVal = leftHandOper->getValue() == rightHandOper->getValue();
resultOper.setBoolValue(retVal);
return retVal;
}
@ -355,8 +355,8 @@ bool CBagExpression::onEqual(CBagVar *leftHandOper, CBagVar *rightHandOper, CBag
bool CBagExpression::onNotEqual(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
bool retVal = leftHandOper->GetValue() != rightHandOper->GetValue();
resultOper.SetBoolValue(retVal);
bool retVal = leftHandOper->getValue() != rightHandOper->getValue();
resultOper.setBoolValue(retVal);
return retVal;
}
@ -364,24 +364,24 @@ bool CBagExpression::onNotEqual(CBagVar *leftHandOper, CBagVar *rightHandOper, C
bool CBagExpression::onLessThan(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
bool retVal = leftHandOper->GetNumValue() < rightHandOper->GetNumValue();
resultOper.SetBoolValue(retVal);
bool retVal = leftHandOper->getNumValue() < rightHandOper->getNumValue();
resultOper.setBoolValue(retVal);
return retVal;
}
bool CBagExpression::onGreaterThan(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
bool retVal = leftHandOper->GetNumValue() > rightHandOper->GetNumValue();
resultOper.SetBoolValue(retVal);
bool retVal = leftHandOper->getNumValue() > rightHandOper->getNumValue();
resultOper.setBoolValue(retVal);
return retVal;
}
bool CBagExpression::onLessThanEqual(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
bool retVal = leftHandOper->GetNumValue() <= rightHandOper->GetNumValue();
resultOper.SetBoolValue(retVal);
bool retVal = leftHandOper->getNumValue() <= rightHandOper->getNumValue();
resultOper.setBoolValue(retVal);
return retVal;
}
@ -389,8 +389,8 @@ bool CBagExpression::onLessThanEqual(CBagVar *leftHandOper, CBagVar *rightHandOp
bool CBagExpression::onGreaterThanEqual(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
bool retVal = leftHandOper->GetNumValue() >= rightHandOper->GetNumValue();
resultOper.SetBoolValue(retVal);
bool retVal = leftHandOper->getNumValue() >= rightHandOper->getNumValue();
resultOper.setBoolValue(retVal);
return retVal;
}
@ -398,11 +398,11 @@ bool CBagExpression::onGreaterThanEqual(CBagVar *leftHandOper, CBagVar *rightHan
bool CBagExpression::onPlusAssign(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
if (leftHandOper->IsNumeric() && rightHandOper->IsNumeric()) {
int leftHandNum = leftHandOper->GetNumValue();
int rightHandNum = rightHandOper->GetNumValue();
leftHandOper->SetValue(leftHandNum + rightHandNum);
resultOper.SetValue(leftHandOper->GetNumValue());
if (leftHandOper->isNumeric() && rightHandOper->isNumeric()) {
int leftHandNum = leftHandOper->getNumValue();
int rightHandNum = rightHandOper->getNumValue();
leftHandOper->setValue(leftHandNum + rightHandNum);
resultOper.setValue(leftHandOper->getNumValue());
}
return true;
@ -412,11 +412,11 @@ bool CBagExpression::onPlusAssign(CBagVar *leftHandOper, CBagVar *rightHandOper,
bool CBagExpression::onMinusAssign(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
if (leftHandOper->IsNumeric() && rightHandOper->IsNumeric()) {
int leftHandNum = leftHandOper->GetNumValue();
int rightHandNum = rightHandOper->GetNumValue();
leftHandOper->SetValue(leftHandNum - rightHandNum);
resultOper.SetValue(leftHandOper->GetNumValue());
if (leftHandOper->isNumeric() && rightHandOper->isNumeric()) {
int leftHandNum = leftHandOper->getNumValue();
int rightHandNum = rightHandOper->getNumValue();
leftHandOper->setValue(leftHandNum - rightHandNum);
resultOper.setValue(leftHandOper->getNumValue());
}
return true;
@ -426,11 +426,11 @@ bool CBagExpression::onMinusAssign(CBagVar *leftHandOper, CBagVar *rightHandOper
bool CBagExpression::onContains(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar & /* resultOper, unused */) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
CBagStorageDev *sDev = g_SDevManager->getStorageDevice(leftHandOper->GetValue());
CBagStorageDev *sDev = g_SDevManager->getStorageDevice(leftHandOper->getValue());
if (sDev == nullptr)
return false;
CBagObject *curObj = sDev->getObject(rightHandOper->GetValue());
CBagObject *curObj = sDev->getObject(rightHandOper->getValue());
if ((curObj != nullptr) && curObj->isActive())
return true;
@ -440,11 +440,11 @@ bool CBagExpression::onContains(CBagVar *leftHandOper, CBagVar *rightHandOper, C
bool CBagExpression::onHas(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar & /* resultOper, unused */) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
CBagStorageDev *sDev = g_SDevManager->getStorageDevice(leftHandOper->GetValue());
CBagStorageDev *sDev = g_SDevManager->getStorageDevice(leftHandOper->getValue());
if (sDev == nullptr)
return false;
CBagObject *curObj = sDev->getObjectByType(rightHandOper->GetValue(), true);
CBagObject *curObj = sDev->getObjectByType(rightHandOper->getValue(), true);
if (curObj == nullptr)
return false;
@ -454,11 +454,11 @@ bool CBagExpression::onHas(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVa
bool CBagExpression::onStatus(CBagVar *pLHOper, CBagVar * /* rightHandOper, unused */, CBagVar & /* resultOper, unused */) {
assert(pLHOper != nullptr);
CBagStorageDev *sDev = g_SDevManager->getStorageDeviceContaining(pLHOper->GetValue());
CBagStorageDev *sDev = g_SDevManager->getStorageDeviceContaining(pLHOper->getValue());
if (sDev == nullptr)
return false;
CBagObject *curObj = sDev->getObject(pLHOper->GetValue());
CBagObject *curObj = sDev->getObject(pLHOper->getValue());
if (curObj == nullptr)
return false;
@ -473,10 +473,10 @@ bool CBagExpression::onCurrSDev(CBagVar * /* leftHandOper, unused*/, CBagVar * /
bool CBagExpression::onPlus(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
if (leftHandOper->IsNumeric() && rightHandOper->IsNumeric()) {
int leftHandNum = leftHandOper->GetNumValue();
int rightHandNum = rightHandOper->GetNumValue();
resultOper.SetValue(leftHandNum + rightHandNum);
if (leftHandOper->isNumeric() && rightHandOper->isNumeric()) {
int leftHandNum = leftHandOper->getNumValue();
int rightHandNum = rightHandOper->getNumValue();
resultOper.setValue(leftHandNum + rightHandNum);
}
return true;
@ -486,10 +486,10 @@ bool CBagExpression::onPlus(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagV
bool CBagExpression::onMinus(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
if (leftHandOper->IsNumeric() && rightHandOper->IsNumeric()) {
int leftHandNum = leftHandOper->GetNumValue();
int rightHandNum = rightHandOper->GetNumValue();
resultOper.SetValue(leftHandNum - rightHandNum);
if (leftHandOper->isNumeric() && rightHandOper->isNumeric()) {
int leftHandNum = leftHandOper->getNumValue();
int rightHandNum = rightHandOper->getNumValue();
resultOper.setValue(leftHandNum - rightHandNum);
}
return true;
@ -499,11 +499,11 @@ bool CBagExpression::onMinus(CBagVar *leftHandOper, CBagVar *rightHandOper, CBag
bool CBagExpression::onMultiply(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
if (leftHandOper->IsNumeric() && rightHandOper->IsNumeric()) {
int leftHandNum = leftHandOper->GetNumValue();
int rightHandNum = rightHandOper->GetNumValue();
if (leftHandOper->isNumeric() && rightHandOper->isNumeric()) {
int leftHandNum = leftHandOper->getNumValue();
int rightHandNum = rightHandOper->getNumValue();
resultOper.SetValue(leftHandNum * rightHandNum);
resultOper.setValue(leftHandNum * rightHandNum);
}
return true;
@ -513,14 +513,14 @@ bool CBagExpression::onMultiply(CBagVar *leftHandOper, CBagVar *rightHandOper, C
bool CBagExpression::onDivide(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
if (leftHandOper->IsNumeric() && rightHandOper->IsNumeric()) {
int leftHandNum = leftHandOper->GetNumValue();
int rightHandNum = rightHandOper->GetNumValue();
if (leftHandOper->isNumeric() && rightHandOper->isNumeric()) {
int leftHandNum = leftHandOper->getNumValue();
int rightHandNum = rightHandOper->getNumValue();
// Divide by Zero error?
assert(rightHandNum != 0);
resultOper.SetValue(leftHandNum / rightHandNum);
resultOper.setValue(leftHandNum / rightHandNum);
}
return true;
@ -530,14 +530,14 @@ bool CBagExpression::onDivide(CBagVar *leftHandOper, CBagVar *rightHandOper, CBa
bool CBagExpression::onMod(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
if (leftHandOper->IsNumeric() && rightHandOper->IsNumeric()) {
int leftHandNum = leftHandOper->GetNumValue();
int rightHandNum = rightHandOper->GetNumValue();
if (leftHandOper->isNumeric() && rightHandOper->isNumeric()) {
int leftHandNum = leftHandOper->getNumValue();
int rightHandNum = rightHandOper->getNumValue();
// Divide by Zero error?
assert(rightHandNum != 0);
resultOper.SetValue(leftHandNum % rightHandNum);
resultOper.setValue(leftHandNum % rightHandNum);
}
return true;
@ -547,14 +547,14 @@ bool CBagExpression::onMod(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVa
bool CBagExpression::onAnd(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar & /* resultOper, unused */) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
return (!leftHandOper->GetValue().find("true") && !rightHandOper->GetValue().find("true"));
return (!leftHandOper->getValue().find("true") && !rightHandOper->getValue().find("true"));
}
bool CBagExpression::onOr(CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar & /* resultOper, unused */) {
assert((leftHandOper != nullptr) && (rightHandOper != nullptr));
return (!leftHandOper->GetValue().find("true") || !rightHandOper->GetValue().find("true"));
return (!leftHandOper->getValue().find("true") || !rightHandOper->getValue().find("true"));
}
@ -580,19 +580,19 @@ ParseCodes CBagExpression::setInfo(CBagIfstream &istr) {
istr.eatWhite();
getAlphaNumFromStream(istr, tmpStr);
CBagVar *curVar = VAR_MANAGER->GetVariable(tmpStr);
CBagVar *curVar = g_VarManager->getVariable(tmpStr);
if (!curVar) {
// This must be a reference, make a new variable
if (tmpStr.find("~~") > 0) {
curVar = new CBagVar;
curVar->setName(tmpStr);
curVar->SetReference();
curVar->setReference();
} else {
// This is an error condition, constants can only be rhopers
curVar = new CBagVar;
curVar->setName(tmpStr);
curVar->SetValue(tmpStr);
curVar->SetConstant();
curVar->setValue(tmpStr);
curVar->setConstant();
}
}
_varList.addToTail(curVar);
@ -611,19 +611,19 @@ ParseCodes CBagExpression::setInfo(CBagIfstream &istr) {
istr.eatWhite();
getAlphaNumFromStream(istr, tmpStr);
curVar = VAR_MANAGER->GetVariable(tmpStr);
curVar = g_VarManager->getVariable(tmpStr);
if (!curVar) {
if (tmpStr.find("~~") > 0) {
// This must be a reference, make a new variable
curVar = new CBagVar;
curVar->setName(tmpStr);
curVar->SetReference();
curVar->setReference();
} else {
// This must be a constant, make a new variable
curVar = new CBagVar;
curVar->setName(tmpStr);
curVar->SetValue(tmpStr);
curVar->SetConstant();
curVar->setValue(tmpStr);
curVar->setConstant();
}
}
_varList.addToTail(curVar);

View File

@ -57,12 +57,12 @@ bool CBagExpressionObject::runObject() {
CBofString objectStr = getFileName().left(nIndex);
CBofString propertyStr = getFileName().mid(nIndex + 2);
g_SDevManager->setObjectValue(objectStr, propertyStr, localVar.GetNumValue());
g_SDevManager->setObjectValue(objectStr, propertyStr, localVar.getNumValue());
} else {
CBagVar *pVar = VAR_MANAGER->GetVariable(getFileName());
CBagVar *pVar = g_VarManager->getVariable(getFileName());
if (pVar)
pVar->SetValue(localVar.GetValue());
pVar->setValue(localVar.getValue());
}
}
}

View File

@ -64,12 +64,12 @@ ErrorCode CBagInv::activateLocalObject(const CBofString &objectName) {
if (zoomedFl == false) {
// Check to see if we are in the bar
CBagVar *var = VAR_MANAGER->GetVariable("INBAR");
CBagVar *var = g_VarManager->getVariable("INBAR");
if (var != nullptr) {
var = VAR_MANAGER->GetVariable("FIRST_STASH");
var = g_VarManager->getVariable("FIRST_STASH");
// If this is our first stash, play the smacker associated with it.
if ((var != nullptr) && (var->GetNumValue() == 0)) {
if ((var != nullptr) && (var->getNumValue() == 0)) {
CBagMovieObject *pMovie = (CBagMovieObject *)getObject(FIRS_STASH_MOV);
if (pMovie) {
if (pMovie->isAttached() == false) {
@ -80,7 +80,7 @@ ErrorCode CBagInv::activateLocalObject(const CBofString &objectName) {
pMovie->runObject();
}
var->SetValue(1);
var->setValue(1);
}
}
}

View File

@ -173,9 +173,9 @@ bool CBagLinkObject::runObject() {
if (getFileName().find("$LASTWORLD") != -1) {
curStr = getFileName();
CBagVar *var = VAR_MANAGER->GetVariable("$LASTWORLD");
CBagVar *var = g_VarManager->getVariable("$LASTWORLD");
if (var != nullptr) {
curStr.replaceStr("$LASTWORLD", var->GetValue());
curStr.replaceStr("$LASTWORLD", var->getValue());
}
}
@ -197,7 +197,7 @@ bool CBagLinkObject::runObject() {
CBagStorageDevWnd *otherSDev = CBagel::getBagApp()->getMasterWnd()->getCurrentStorageDev();
if (!curSDev->isCloseup() && !otherSDev->isCloseup()) {
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
}
return CBagObject::runObject();

View File

@ -64,9 +64,9 @@ CBofPoint CBagLog::arrangeFloater(CBofPoint pos, CBagObject *bagObj) {
int borderSize = 0;
// Get this from script, allows individual log states to set border.
CBagVar *curVar = VAR_MANAGER->GetVariable("LOGBORDER");
CBagVar *curVar = g_VarManager->getVariable("LOGBORDER");
if (curVar != nullptr) {
borderSize = curVar->GetNumValue();
borderSize = curVar->getNumValue();
}
if (borderSize == 0) {
@ -187,10 +187,10 @@ int CBagLog::getCurFltPage() {
int nCurFltPage = 0;
// Read in their total nuggets from game
CBagVar *curVar = VAR_MANAGER->GetVariable("CUR_BAR_LOG_PAGE");
CBagVar *curVar = g_VarManager->getVariable("CUR_BAR_LOG_PAGE");
if (curVar) {
nCurFltPage = curVar->GetNumValue();
nCurFltPage = curVar->getNumValue();
}
return nCurFltPage;
@ -198,10 +198,10 @@ int CBagLog::getCurFltPage() {
void CBagLog::setCurFltPage(int fltPage) {
// Read in their total nuggets from game
CBagVar *curVar = VAR_MANAGER->GetVariable("CUR_BAR_LOG_PAGE");
CBagVar *curVar = g_VarManager->getVariable("CUR_BAR_LOG_PAGE");
if (curVar)
curVar->SetValue(fltPage);
curVar->setValue(fltPage);
}
ErrorCode CBagLog::releaseMsg() {
@ -533,8 +533,8 @@ int CBagLogMsg::getProperty(const CBofString &prop) {
ErrorCode CBagLogMsg::update(CBofBitmap *bmp, CBofPoint pt, CBofRect *srcRect, int maskColor) {
// We could use a variable here, translate it's value if that's the case.
if (getMsgTime() == 0) {
CBagVar *pVar = VAR_MANAGER->GetVariable(_msgTimeStr);
int nMsgTime = pVar->GetNumValue();
CBagVar *pVar = g_VarManager->getVariable(_msgTimeStr);
int nMsgTime = pVar->getNumValue();
setMsgTime(nMsgTime);
}
@ -912,9 +912,9 @@ ErrorCode CBagEnergyDetectorObject::attach() {
CBofString zhapsString(zhapsBuffer, 256);
// We could use a variable here, translate it's value if that's the case.
CBagVar *curVar = VAR_MANAGER->GetVariable(_energyTimeStr);
CBagVar *curVar = g_VarManager->getVariable(_energyTimeStr);
if (curVar) {
nMsgTime = curVar->GetNumValue();
nMsgTime = curVar->getNumValue();
} else {
nMsgTime = atoi(_energyTimeStr.getBuffer());
}
@ -923,17 +923,17 @@ ErrorCode CBagEnergyDetectorObject::attach() {
int minute = nMsgTime - (hour * 100);
// Get the number of zhaps.
curVar = VAR_MANAGER->GetVariable(_zhapsStr);
curVar = g_VarManager->getVariable(_zhapsStr);
if (curVar) {
zhapsString = curVar->GetValue();
zhapsString = curVar->getValue();
} else {
zhapsString = _zhapsStr;
}
// Get the cause
curVar = VAR_MANAGER->GetVariable(_causeStr);
curVar = g_VarManager->getVariable(_causeStr);
if (curVar) {
causeString = curVar->GetValue();
causeString = curVar->getValue();
} else {
causeString = _causeStr;
}
@ -986,10 +986,10 @@ ErrorCode CBagLogClue::attach() {
// Format the text appropriately.
Common::sprintf_s(szClueStr, cFormat.getBuffer(),
(_stringVar1 ? (const char *)_stringVar1->GetValue() : (const char *)""),
(_stringVar2 ? (const char *)_stringVar2->GetValue() : (const char *)""),
(_stringVar3 ? (const char *)_stringVar3->GetValue() : (const char *)""),
(_stringVar4 ? (const char *)_stringVar4->GetValue() : (const char *)""));
(_stringVar1 ? (const char *)_stringVar1->getValue() : (const char *)""),
(_stringVar2 ? (const char *)_stringVar2->getValue() : (const char *)""),
(_stringVar3 ? (const char *)_stringVar3->getValue() : (const char *)""),
(_stringVar4 ? (const char *)_stringVar4->getValue() : (const char *)""));
CBofString cStr(szClueStr);
setPSText(&cStr);
@ -1017,7 +1017,7 @@ ParseCodes CBagLogClue::setInfo(CBagIfstream &istr) {
if (!sStr.find("STRINGVAR")) {
istr.eatWhite();
getAlphaNumFromStream(istr, sStr);
CBagVar *pVar = VAR_MANAGER->GetVariable(sStr);
CBagVar *pVar = g_VarManager->getVariable(sStr);
// The variable must have been found, if it wasn't, then
// complain violently.

View File

@ -393,7 +393,7 @@ ErrorCode CBagMasterWin::loadFile(const CBofString &wldName, const CBofString &s
}
if (_variableList != nullptr) {
_variableList->ReleaseVariables(false);
_variableList->releaseVariables(false);
}
delete _gameSDevList;
@ -546,10 +546,10 @@ void CBagMasterWin::saveSDevStack() {
assert(strlen(tempBuf) < MAX_VAR_VALUE);
// Store our current sdev location stack in a global variable.
CBagVar *var = VAR_MANAGER->GetVariable("$LASTWORLD");
CBagVar *var = g_VarManager->getVariable("$LASTWORLD");
if (var != nullptr) {
curStr = tempBuf;
var->SetValue(curStr);
var->setValue(curStr);
}
}
}
@ -599,7 +599,7 @@ ErrorCode CBagMasterWin::loadGlobalVars(const CBofString &wldName) {
CBagVar *var = new CBagVar;
fpInput.eatWhite();
var->setInfo(fpInput);
var->SetGlobal();
var->setGlobal();
break;
}
@ -1065,7 +1065,7 @@ void CBagMasterWin::onKeyHit(uint32 keyCode, uint32 repCount) {
_waitSound->play();
}
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
// Prefilter this guy, could cause something to change in the
// pan or the PDA or a closeup.
@ -1426,9 +1426,9 @@ void CBagMasterWin::fillSaveBuffer(StBagelSave *saveBuf) {
// Walk variable list and save each global variable
int j = 0;
int n = varManager->GetNumVars();
int n = varManager->getNumVars();
for (int i = 0; i < n; i++) {
CBagVar *curVar = varManager->GetVariable(i);
CBagVar *curVar = varManager->getVariable(i);
if (curVar != nullptr) {
// Need to save local variables in flashbacks.
// Let me know if this breaks anything.
@ -1440,18 +1440,18 @@ void CBagMasterWin::fillSaveBuffer(StBagelSave *saveBuf) {
Common::strcpy_s(saveBuf->_stVarList[j]._szName, curVar->getName());
}
if (!curVar->GetValue().isEmpty()) {
assert(strlen(curVar->GetValue()) < MAX_VAR_VALUE);
Common::strcpy_s(saveBuf->_stVarList[j]._szValue, curVar->GetValue());
if (!curVar->getValue().isEmpty()) {
assert(strlen(curVar->getValue()) < MAX_VAR_VALUE);
Common::strcpy_s(saveBuf->_stVarList[j]._szValue, curVar->getValue());
}
saveBuf->_stVarList[j]._nType = (uint16)curVar->getType();
saveBuf->_stVarList[j]._bGlobal = (byte)curVar->IsGlobal();
saveBuf->_stVarList[j]._bConstant = (byte)curVar->IsConstant();
saveBuf->_stVarList[j]._bReference = (byte)curVar->IsReference();
saveBuf->_stVarList[j]._bTimer = (byte)curVar->IsTimer();
saveBuf->_stVarList[j]._bRandom = (byte)curVar->IsRandom();
saveBuf->_stVarList[j]._bNumeric = (byte)curVar->IsNumeric();
saveBuf->_stVarList[j]._bGlobal = (byte)curVar->isGlobal();
saveBuf->_stVarList[j]._bConstant = (byte)curVar->isConstant();
saveBuf->_stVarList[j]._bReference = (byte)curVar->isReference();
saveBuf->_stVarList[j]._bTimer = (byte)curVar->isTimer();
saveBuf->_stVarList[j]._bRandom = (byte)curVar->isRandom();
saveBuf->_stVarList[j]._bNumeric = (byte)curVar->isNumeric();
saveBuf->_stVarList[j]._bAttached = (byte)curVar->isAttached();
saveBuf->_stVarList[j]._bUsed = 1;
j++;
@ -1631,9 +1631,9 @@ void CBagMasterWin::doRestore(StBagelSave *saveBuf) {
// If this entry is actually used to store Var info
if (saveBuf->_stVarList[i]._bUsed) {
// Find the Global Var (already in memory)
CBagVar *var = varManager->GetVariable(saveBuf->_stVarList[i]._szName);
CBagVar *var = varManager->getVariable(saveBuf->_stVarList[i]._szName);
if (var != nullptr) {
var->SetValue(saveBuf->_stVarList[i]._szValue);
var->setValue(saveBuf->_stVarList[i]._szValue);
} else {
logError(buildString("Global Variable NOT found: %s", saveBuf->_stVarList[i]._szName));
@ -2049,10 +2049,10 @@ void setCICStatus(CBagStorageDev *sdev) {
// that this is the case. Don't reset when we're zooming the PDA.
if (sdev && sdev->getName() != "BPDAZ_WLD") {
workStr = "IN_CIC";
CBagVar *cicVar = VAR_MANAGER->GetVariable(workStr);
CBagVar *cicVar = g_VarManager->getVariable(workStr);
if (cicVar) {
workStr = sdev->isCIC() ? "TRUE" : "FALSE";
cicVar->SetValue(workStr);
cicVar->setValue(workStr);
}
}
}
@ -2063,9 +2063,9 @@ bool getCICStatus() {
bool retValFl = false;
workStr = "IN_CIC";
CBagVar *cicVar = VAR_MANAGER->GetVariable(workStr);
CBagVar *cicVar = g_VarManager->getVariable(workStr);
if (cicVar) {
retValFl = (cicVar->GetValue() == "TRUE");
retValFl = (cicVar->getValue() == "TRUE");
}
return retValFl;

View File

@ -36,7 +36,7 @@
namespace Bagel {
#define g_SDevManager CBagel::getBagApp()->getMasterWnd()->getStorageDevManager()
#define VAR_MANAGER CBagel::getBagApp()->getMasterWnd()->getVariableManager()
#define g_VarManager CBagel::getBagApp()->getMasterWnd()->getVariableManager()
class CBagStorageDevManager;
class CBagStorageDevWnd;

View File

@ -475,13 +475,13 @@ bool CBagMenu::trackPopupMenu(uint32 /*nFlags*/, int x, int y, CBofWindow *pWnd,
// Selecting this menu item causes a turn to go by
if (nNumCalls == 1 && pCurSDEV->isCustom() == false) {
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
}
} else if (bCaption && (nNumCalls == 2)) {
// Selecting this menu item causes a turn to go by
dlg._pSelectedObject = nullptr;
if (pCurSDEV->isCustom() == false) {
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
}
}
}

View File

@ -220,7 +220,7 @@ bool CBagMovieObject::runObject() {
// Increment timer one, pda message counts as one turn
// Allow scripter to override timer increment
if (isIncrement()) {
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
}
}

View File

@ -157,7 +157,7 @@ bool CBagObject::runObject() {
if (isTimeless())
return true;
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
return true;
}

View File

@ -199,7 +199,7 @@ ParseCodes CBagRPObject::setInfo(CBagIfstream &istr) {
// Get the variable name from the definition line, then find it
// in the global list.
_pTouchedVar = VAR_MANAGER->GetVariable(sStr);
_pTouchedVar = g_VarManager->getVariable(sStr);
break;
}
@ -288,7 +288,7 @@ ParseCodes CBagRPObject::setInfo(CBagIfstream &istr) {
// Get the variable name from the definition line, then find it
// in the global list.
getAlphaNumFromStream(istr, sStr);
_pSaveVar = VAR_MANAGER->GetVariable(sStr);
_pSaveVar = g_VarManager->getVariable(sStr);
// the variable must have been found, if it wasn't, then
// complain violently.
@ -356,7 +356,7 @@ ParseCodes CBagRPObject::setInfo(CBagIfstream &istr) {
// Get the variable name from the definition line, then find it
// in the global list.
getAlphaNumFromStream(istr, sStr);
_pVarObj = VAR_MANAGER->GetVariable(sStr);
_pVarObj = g_VarManager->getVariable(sStr);
// the variable must have been found, if it wasn't, then
// complain violently.
@ -604,13 +604,13 @@ int CBagRPObject::runResiduePrintedQueue() {
// Get the turncount variable.
if (_turnCount == nullptr) {
_turnCount = VAR_MANAGER->GetVariable("TURNCOUNT");
_turnCount = g_VarManager->getVariable("TURNCOUNT");
}
//
assert(_turnCount != nullptr);
// Get the current time
int nCurSBTime = _turnCount->GetNumValue();
int nCurSBTime = _turnCount->getNumValue();
int nCount = _pRPList->getCount();
for (int i = 0; i < nCount; i++) {
@ -648,7 +648,7 @@ int CBagRPObject::updateResiduePrintedQueue() {
for (int i = 0; i < nCount; i++) {
CBagRPObject *pRPObj = _pRPList->getNodeItem(i);
if (pRPObj) {
cStr = pRPObj->_pVarObj->GetValue();
cStr = pRPObj->_pVarObj->getValue();
// If it's value is NOT 3000, then store its value in the associative
// rp object.
@ -667,7 +667,7 @@ int CBagRPObject::updateResiduePrintedQueue() {
// Reset back to "3000"
cStr = "3000";
pRPObj->_pVarObj->SetValue(cStr);
pRPObj->_pVarObj->setValue(cStr);
}
}
}
@ -979,7 +979,7 @@ void CBagRPObject::evaluateDossiers() {
// If we have a touched variable, then evaluate and if it is not 3000, then
// we know it's been touched.
if (_pTouchedVar) {
if (_pTouchedVar->GetValue() != "3000") {
if (_pTouchedVar->getValue() != "3000") {
_bTouched = true;
}
}
@ -1038,11 +1038,11 @@ void CBagRPObject::setLogState(RPStates eLogMode) {
// Also, so we know where to return to, make sure we set the previous log
// state to whatever LOG_STATE is right now.
if (_pLogStateVar == nullptr) {
_pLogStateVar = VAR_MANAGER->GetVariable("LOG_STATE");
_pLogStateVar = g_VarManager->getVariable("LOG_STATE");
}
if (_pPrevLogStateVar == nullptr) {
_pPrevLogStateVar = VAR_MANAGER->GetVariable("PREV_LOG_STATE");
_pPrevLogStateVar = g_VarManager->getVariable("PREV_LOG_STATE");
}
assert(_pLogStateVar != nullptr && _pPrevLogStateVar != nullptr);
@ -1077,27 +1077,27 @@ void CBagRPObject::setLogState(RPStates eLogMode) {
if (_eRPMode != RP_READ_DOSSIER) {
if (bRemember) {
_pPrevLogStateVar->SetValue(_pLogStateVar->GetValue());
_pPrevLogStateVar->setValue(_pLogStateVar->getValue());
}
}
_pLogStateVar->SetValue(cStr);
_pLogStateVar->setValue(cStr);
if (bSavePage || bRestorePage) {
if (_pPrevBarPage == nullptr) {
_pPrevBarPage = VAR_MANAGER->GetVariable("PREV_BAR_LOG_PAGE");
_pPrevBarPage = g_VarManager->getVariable("PREV_BAR_LOG_PAGE");
}
if (_pCurBarPage == nullptr) {
_pCurBarPage = VAR_MANAGER->GetVariable("CUR_BAR_LOG_PAGE");
_pCurBarPage = g_VarManager->getVariable("CUR_BAR_LOG_PAGE");
}
if (_pPrevBarPage && _pCurBarPage) {
if (bSavePage) {
_pPrevBarPage->SetValue(_pCurBarPage->GetValue());
_pPrevBarPage->setValue(_pCurBarPage->getValue());
}
if (bRestorePage) {
_pCurBarPage->SetValue(_pPrevBarPage->GetValue());
_pCurBarPage->setValue(_pPrevBarPage->getValue());
}
}
}
@ -1109,7 +1109,7 @@ void CBagRPObject::setLogState(RPStates eLogMode) {
// Return the current log state
RPStates CBagRPObject::getLogState() {
if (_pLogStateVar == nullptr) {
_pLogStateVar = VAR_MANAGER->GetVariable("LOG_STATE");
_pLogStateVar = g_VarManager->getVariable("LOG_STATE");
}
_eRPMode = RP_NOMODE;
@ -1119,7 +1119,7 @@ RPStates CBagRPObject::getLogState() {
char szLocalBuff[256];
CBofString cStr(szLocalBuff, 256);
cStr = _pLogStateVar->GetValue();
cStr = _pLogStateVar->getValue();
if (cStr == "CODE_RP_RESULTS") {
_eRPMode = RP_RESULTS;
} else if (cStr == "CODE_RP_DOSSIER") {
@ -1137,13 +1137,13 @@ RPStates CBagRPObject::getLogState() {
// Set the current number of pages in both script and code.
void CBagRPObject::setLogPages(int nPages) {
if (_pBarLogPages == nullptr) {
_pBarLogPages = VAR_MANAGER->GetVariable("CODE_TOTAL_LOG_PAGES");
_pBarLogPages = g_VarManager->getVariable("CODE_TOTAL_LOG_PAGES");
}
assert(_pBarLogPages != nullptr);
if (_pBarLogPages) {
_pBarLogPages->SetValue(nPages);
_pBarLogPages->setValue(nPages);
}
// Let the float code know how many pages we have.
@ -1248,7 +1248,7 @@ void CBagRPObject::saveResiduePrintedVars() {
}
}
_pSaveVar->SetValue(nVars);
_pSaveVar->setValue(nVars);
}
// Restore the residue print variable from memory
@ -1257,7 +1257,7 @@ void CBagRPObject::restoreResiduePrintedVars() {
return;
}
uint32 nVars = _pSaveVar->GetNumValue();
uint32 nVars = _pSaveVar->getNumValue();
for (int i = 0; i < NUM_RP_FIELDS; i++) {
switch (i) {
@ -1565,7 +1565,7 @@ bool CBagRPObject::initialize() {
// the zoom pda are propagated down to the regular PDA.
void CBagRPObject::synchronizeResiduePrintedObjects(bool bLogFrontmost) {
// only synchronize in the bar
CBagVar *pVar = VAR_MANAGER->GetVariable("INBAR");
CBagVar *pVar = g_VarManager->getVariable("INBAR");
if (pVar == nullptr) {
return;
}

View File

@ -157,11 +157,11 @@ ErrorCode CBagTextObject::attach() {
*_psText += pTextBuff;
if (_psInitInfo != nullptr) {
CBagVar *pVar = VAR_MANAGER->GetVariable(*_psInitInfo);
CBagVar *pVar = g_VarManager->getVariable(*_psInitInfo);
if (pVar != nullptr) {
_bReAttach = true;
_psText->replaceStr("%s", pVar->GetValue());
_psText->replaceStr("%s", pVar->getValue());
}
}

View File

@ -260,11 +260,11 @@ ErrorCode CBagTimeObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect * /*pS
CBofString sTimeString(szLocalBuff, 256);
ErrorCode rc = ERR_NONE;
CBagVar *xVar = VAR_MANAGER->GetVariable(_sVariable);
CBagVar *xVar = g_VarManager->getVariable(_sVariable);
// If everything looks good
if (isAttached() && xVar && !(xVar->GetValue().isEmpty())) {
int nTimeVal = xVar->GetNumValue();
if (isAttached() && xVar && !(xVar->getValue().isEmpty())) {
int nTimeVal = xVar->getNumValue();
sTimeString = buildString("%04d", nTimeVal);
char sDigString[2] = "0";
@ -311,11 +311,11 @@ ErrorCode CBagTimeObject::update(CBofWindow *pWnd, CBofPoint pt, CBofRect *, int
ErrorCode rc = ERR_NONE;
CBagVar *xVar = VAR_MANAGER->GetVariable(_sVariable);
CBagVar *xVar = g_VarManager->getVariable(_sVariable);
// If everything looks good
if (isAttached() && xVar && !(xVar->GetValue().isEmpty())) {
int nTimeVal = xVar->GetNumValue();
if (isAttached() && xVar && !(xVar->getValue().isEmpty())) {
int nTimeVal = xVar->getNumValue();
sTimeString = buildString("%04d", nTimeVal);
char sDigString[2] = "0";

View File

@ -36,112 +36,112 @@ void CBagVarManager::initialize() {
}
CBagVar::CBagVar() {
SetGlobal(false);
SetConstant(false);
SetReference(false);
setGlobal(false);
setConstant(false);
setReference(false);
setTimer(false);
SetString();
SetRandom(false);
VAR_MANAGER->RegisterVariable(this);
setString();
setRandom(false);
g_VarManager->registerVariable(this);
}
CBagVar::CBagVar(const CBofString &sName, const CBofString &sValue, bool bAddToList) {
SetConstant(false);
SetReference(false);
setConstant(false);
setReference(false);
setTimer(false);
SetString();
setString();
setName(sName);
SetValue(sValue);
SetRandom(false);
SetGlobal(false);
setValue(sValue);
setRandom(false);
setGlobal(false);
if (bAddToList)
VAR_MANAGER->RegisterVariable(this);
g_VarManager->registerVariable(this);
}
CBagVar::~CBagVar() {
if (CBagel::getBagApp() &&
CBagel::getBagApp()->getMasterWnd() &&
CBagel::getBagApp()->getMasterWnd()->getVariableManager())
VAR_MANAGER->UnRegisterVariable(this);
g_VarManager->unRegisterVariable(this);
}
void CBagVar::SetValue(const CBofString &s) {
void CBagVar::setValue(const CBofString &s) {
assert(isValidObject(this));
if (!s.isEmpty()) {
char c = s[0];
if (Common::isDigit(c) || c == '-')
SetNumeric();
setNumeric();
}
m_sVarValue = s;
_sVarValue = s;
}
const CBofString &CBagVar::GetValue() {
const CBofString &CBagVar::getValue() {
assert(isValidObject(this));
// WORKAROUND: If you finish the Deven7 flashback without having previously
// asked him about betting, it hangs him. Work around this by force setting
// betting to have been discussed
if (m_sVarName == "BETWITHDEVEN") {
if (VAR_MANAGER->GetVariable("DEVENCODE1")->GetValue() != "NOTSETYET")
if (_sVarName == "BETWITHDEVEN") {
if (g_VarManager->getVariable("DEVENCODE1")->getValue() != "NOTSETYET")
// Finished flashback, so ensure betting flag is set
m_sVarValue = "1";
_sVarValue = "1";
}
// Check if these items should be replaced by the current sdev
if (!m_sVarName.isEmpty() && !m_sVarName.find(CURRSDEV_TOKEN)) {
if (!_sVarName.isEmpty() && !_sVarName.find(CURRSDEV_TOKEN)) {
CBofString CurrSDev;
if (CBagel::getBagApp()->getMasterWnd()->getCurrentStorageDev()) {
m_sVarValue = CBagel::getBagApp()->getMasterWnd()->getCurrentStorageDev()->getName();
_sVarValue = CBagel::getBagApp()->getMasterWnd()->getCurrentStorageDev()->getName();
}
} else {
// Check if these items should be replaced by the previous sdev
if (!m_sVarName.isEmpty() && !m_sVarName.find(PREVSDEV_TOKEN)) {
if (!_sVarName.isEmpty() && !_sVarName.find(PREVSDEV_TOKEN)) {
CBofString CurrSDev;
if (CBagel::getBagApp()->getMasterWnd()->getCurrentStorageDev()) {
m_sVarValue = CBagel::getBagApp()->getMasterWnd()->getCurrentStorageDev()->getPrevSDev();
_sVarValue = CBagel::getBagApp()->getMasterWnd()->getCurrentStorageDev()->getPrevSDev();
}
}
}
return m_sVarValue;
return _sVarValue;
}
void CBagVar::SetBoolValue(bool bVal) {
void CBagVar::setBoolValue(bool bVal) {
assert(isValidObject(this));
if (bVal)
m_sVarValue = "TRUE";
_sVarValue = "TRUE";
else
m_sVarValue = "FALSE";
_sVarValue = "FALSE";
}
void CBagVar::SetValue(int nVal) {
void CBagVar::setValue(int nVal) {
assert(isValidObject(this));
SetNumeric();
setNumeric();
Common::String tmp = Common::String::format("%d", nVal);
m_sVarValue = tmp.c_str();
_sVarValue = tmp.c_str();
}
int CBagVar::GetNumValue() {
int CBagVar::getNumValue() {
assert(isValidObject(this));
if (IsRandom())
if (isRandom())
return g_engine->getRandomNumber();
return atoi(m_sVarValue);
return atoi(_sVarValue);
}
void CBagVar::Increment() {
void CBagVar::increment() {
assert(isValidObject(this));
if (IsNumeric())
SetValue(GetNumValue() + 1);
if (isNumeric())
setValue(getNumValue() + 1);
}
ParseCodes CBagVar::setInfo(CBagIfstream &istr) {
@ -168,13 +168,13 @@ ParseCodes CBagVar::setInfo(CBagIfstream &istr) {
getAlphaNumFromStream(istr, sStr);
if (!sStr.find("TIMER")) {
setTimer();
VAR_MANAGER->UpdateRegistration();
g_VarManager->updateRegistration();
} else if (!sStr.find("RANDOM")) {
SetRandom(true);
VAR_MANAGER->UpdateRegistration();
setRandom(true);
g_VarManager->updateRegistration();
} else if (!sStr.find("GLOBAL")) {
SetGlobal(true);
VAR_MANAGER->UpdateRegistration();
setGlobal(true);
g_VarManager->updateRegistration();
} else {
putbackStringOnStream(istr, sStr);
putbackStringOnStream(istr, "AS ");
@ -190,7 +190,7 @@ ParseCodes CBagVar::setInfo(CBagIfstream &istr) {
istr.getCh();
istr.eatWhite();
getAlphaNumFromStream(istr, sStr);
SetValue(sStr);
setValue(sStr);
}
istr.eatWhite();
@ -205,11 +205,11 @@ CBagVarManager::CBagVarManager() {
CBagVarManager::~CBagVarManager() {
if (nVarMngrs) {
nVarMngrs--;
ReleaseVariables();
m_xVarList.removeAll();
releaseVariables();
_xVarList.removeAll();
for (int i = 0; i < VAR_HTABLE_SIZE; i++) {
m_xVarHashList[i].removeAll();
_xVarHashList[i].removeAll();
}
}
}
@ -223,31 +223,31 @@ static int HASHVAR(const char *p, int l) {
return h;
}
ErrorCode CBagVarManager::RegisterVariable(CBagVar *pVar) {
m_xVarList.addToTail(pVar);
ErrorCode CBagVarManager::registerVariable(CBagVar *pVar) {
_xVarList.addToTail(pVar);
return ERR_NONE;
}
// Arranges the list so that timer variables are in the front
ErrorCode CBagVarManager::UpdateRegistration() {
ErrorCode CBagVarManager::updateRegistration() {
bool bFoundLastTimer = false;
int i;
// Read the timers at the beginning
for (i = 0; i < m_xVarList.getCount() && !bFoundLastTimer; ++i) {
if (!m_xVarList[i]->IsTimer()) {
for (i = 0; i < _xVarList.getCount() && !bFoundLastTimer; ++i) {
if (!_xVarList[i]->isTimer()) {
bFoundLastTimer = true;
}
}
// Make sure there are no more timers in the list
if (bFoundLastTimer) {
for (/*- i determined in previous for loop -*/ ; i < m_xVarList.getCount(); ++i) {
if (m_xVarList[i]->IsTimer()) {
CBagVar *pVar = m_xVarList[i];
m_xVarList.remove(i);
m_xVarList.addToHead(pVar);
for (/*- i determined in previous for loop -*/ ; i < _xVarList.getCount(); ++i) {
if (_xVarList[i]->isTimer()) {
CBagVar *pVar = _xVarList[i];
_xVarList.remove(i);
_xVarList.addToHead(pVar);
}
}
}
@ -255,15 +255,15 @@ ErrorCode CBagVarManager::UpdateRegistration() {
return ERR_UNKNOWN;
}
ErrorCode CBagVarManager::UnRegisterVariable(CBagVar *pVar) {
ErrorCode CBagVarManager::unRegisterVariable(CBagVar *pVar) {
// Find and remove specified variable from the Var manager list
//
CBofListNode<CBagVar *> *pList = m_xVarList.getTail();
CBofListNode<CBagVar *> *pList = _xVarList.getTail();
while (pList != nullptr) {
if (pList->getNodeItem() == pVar) {
m_xVarList.remove(pList);
_xVarList.remove(pList);
break;
}
@ -277,7 +277,7 @@ ErrorCode CBagVarManager::UnRegisterVariable(CBagVar *pVar) {
// Hash it
int nHashVal = HASHVAR(szLocalBuff, varStr.getLength());
CBofList<CBagVar *> *pVarList = &m_xVarHashList[nHashVal];
CBofList<CBagVar *> *pVarList = &_xVarHashList[nHashVal];
// Search the hash table and remove it when we're done.
for (int i = 0; i < pVarList->getCount(); ++i) {
@ -292,21 +292,21 @@ ErrorCode CBagVarManager::UnRegisterVariable(CBagVar *pVar) {
}
// The timers must be at the beginning of the list
ErrorCode CBagVarManager::IncrementTimers() {
ErrorCode CBagVarManager::incrementTimers() {
volatile bool bFoundLastTimer = false;
// Read the timers at the beginning
for (int i = 0; i < m_xVarList.getCount() && !bFoundLastTimer; ++i) {
CBagVar *pVar = m_xVarList[i];
if (pVar->IsTimer()) {
for (int i = 0; i < _xVarList.getCount() && !bFoundLastTimer; ++i) {
CBagVar *pVar = _xVarList[i];
if (pVar->isTimer()) {
// Hack to keep the game time from exceeding 22:50
if (pVar->getName().compareNoCase("TURNCOUNT") == 0) {
if (pVar->GetNumValue() == 2250) {
if (pVar->getNumValue() == 2250) {
continue;
}
}
pVar->Increment();
pVar->increment();
}
}
@ -317,21 +317,21 @@ ErrorCode CBagVarManager::IncrementTimers() {
return ERR_NONE;
}
ErrorCode CBagVarManager::ReleaseVariables(bool bIncludeGlobals) {
ErrorCode CBagVarManager::releaseVariables(bool bIncludeGlobals) {
if (bIncludeGlobals) {
while (m_xVarList.getCount()) {
CBagVar *pVar = m_xVarList.removeHead();
while (_xVarList.getCount()) {
CBagVar *pVar = _xVarList.removeHead();
if (pVar) {
delete pVar;
}
}
} else { // Do not include globals
for (int i = m_xVarList.getCount() - 1; i >= 0; i--) {
CBagVar *pVar = m_xVarList[i];
if (pVar && !pVar->IsGlobal()) {
m_xVarList.remove(i);
for (int i = _xVarList.getCount() - 1; i >= 0; i--) {
CBagVar *pVar = _xVarList[i];
if (pVar && !pVar->isGlobal()) {
_xVarList.remove(i);
delete pVar;
}
}
@ -339,7 +339,7 @@ ErrorCode CBagVarManager::ReleaseVariables(bool bIncludeGlobals) {
return ERR_NONE;
}
CBagVar *CBagVarManager::GetVariable(const CBofString &sName) {
CBagVar *CBagVarManager::getVariable(const CBofString &sName) {
CBagVar *pVar = nullptr;
// Use the hash table to find the variable.
@ -349,7 +349,7 @@ CBagVar *CBagVarManager::GetVariable(const CBofString &sName) {
int nHashVal = HASHVAR(szLocalBuff, varStr.getLength());
CBofList<CBagVar *> *pVarList = &m_xVarHashList[nHashVal];
CBofList<CBagVar *> *pVarList = &_xVarHashList[nHashVal];
for (int i = 0; i < pVarList->getCount(); ++i) {
pVar = pVarList->getNodeItem(i);
if (pVar != nullptr && (pVar->getName().getLength() == sName.getLength()) && !pVar->getName().find(sName)) {
@ -361,7 +361,7 @@ CBagVar *CBagVarManager::GetVariable(const CBofString &sName) {
}
void CBagVar::setName(const CBofString &s) {
m_sVarName = s;
_sVarName = s;
CBagel *pApp = CBagel::getBagApp();
if (pApp) {
@ -370,9 +370,9 @@ void CBagVar::setName(const CBofString &s) {
if (!s.isEmpty() && pMainWin && pMainWin->getVariableManager()) {
char szLocalBuff[256];
CBofString varStr(szLocalBuff, 256);
varStr = m_sVarName;
varStr = _sVarName;
int nHashVal = HASHVAR(szLocalBuff, varStr.getLength());
VAR_MANAGER->m_xVarHashList[nHashVal].addToTail(this);
g_VarManager->_xVarHashList[nHashVal].addToTail(this);
}
}
}

View File

@ -31,17 +31,17 @@ namespace Bagel {
class CBagVar : public CBagParseObject, public CBofObject {
public:
enum VARTYPE { STRING = 0, NUMBER = 1, boolEAN = 2 };
enum VARTYPE { STRING = 0, NUMBER = 1, BOOLEAN = 2 };
private:
CBofString m_sVarName; // Name of the variable
CBofString m_sVarValue; // Value of the variable if not a reference
VARTYPE m_xVarType; // Type of variable, string
bool m_bGlobal : 1; // Is the variable a constant
bool m_bConstant : 1; // Is the variable a constant
bool m_bReference : 1; // Is the variable a reference to an objects state date
bool m_bTimer : 1; // Is the variable updated on object timer events
bool m_bRandom : 1; // Is the variable updated as a random number
CBofString _sVarName; // Name of the variable
CBofString _sVarValue; // Value of the variable if not a reference
VARTYPE _xVarType; // Type of variable, string
bool _bGlobal : 1; // Is the variable a constant
bool _bConstant : 1; // Is the variable a constant
bool _bReference : 1; // Is the variable a reference to an objects state date
bool _bTimer : 1; // Is the variable updated on object timer events
bool _bRandom : 1; // Is the variable updated as a random number
public:
CBagVar();
@ -51,71 +51,71 @@ public:
ParseCodes setInfo(CBagIfstream &);
const CBofString &getName() {
return m_sVarName;
return _sVarName;
}
// const CBofString& GetValue() { return m_sVarValue; }
const CBofString &GetValue();
int GetNumValue();
bool IsGlobal() {
return m_bGlobal;
// const CBofString& getValue() { return _sVarValue; }
const CBofString &getValue();
int getNumValue();
bool isGlobal() {
return _bGlobal;
}
bool IsConstant() {
return m_bConstant;
bool isConstant() {
return _bConstant;
}
bool IsNumeric() {
return m_xVarType == NUMBER;
bool isNumeric() {
return _xVarType == NUMBER;
}
bool IsBoolean() {
return m_xVarType == boolEAN;
bool isBoolean() {
return _xVarType == BOOLEAN;
}
bool IsString() {
return m_xVarType == STRING;
bool isString() {
return _xVarType == STRING;
}
bool IsReference() {
return m_bReference;
bool isReference() {
return _bReference;
}
bool IsTimer() {
return m_bTimer;
bool isTimer() {
return _bTimer;
}
bool IsRandom() {
return m_bRandom;
bool isRandom() {
return _bRandom;
}
VARTYPE getType() {
return m_xVarType;
return _xVarType;
}
// Whenever setting the name, add this object to the hash table.
void setName(const CBofString &s);
void SetValue(const CBofString &s);
void SetValue(int nVal);
void SetBoolValue(bool bVal);
void SetGlobal(bool bVal = true) {
m_bGlobal = bVal;
void setValue(const CBofString &s);
void setValue(int nVal);
void setBoolValue(bool bVal);
void setGlobal(bool bVal = true) {
_bGlobal = bVal;
}
void SetConstant(bool bVal = true) {
m_bConstant = bVal;
void setConstant(bool bVal = true) {
_bConstant = bVal;
}
void SetReference(bool bVal = true) {
m_bReference = bVal;
void setReference(bool bVal = true) {
_bReference = bVal;
}
void setTimer(bool bVal = true) {
m_bTimer = bVal;
_bTimer = bVal;
}
void SetRandom(bool bVal = true) {
m_bRandom = bVal;
void setRandom(bool bVal = true) {
_bRandom = bVal;
}
void SetString() {
m_xVarType = STRING;
void setString() {
_xVarType = STRING;
}
void SetNumeric() {
m_xVarType = NUMBER;
void setNumeric() {
_xVarType = NUMBER;
}
void SetBoolean() {
m_xVarType = boolEAN;
void setBoolean() {
_xVarType = BOOLEAN;
}
// void setType(VARTYPE xType) { m_xVarType = xType; }
// void setType(VARTYPE xType) { _xVarType = xType; }
void Increment();
void increment();
};
// This could be templated with the storage device manager
@ -124,29 +124,29 @@ public:
class CBagVarManager : public CBagParseObject, public CBofObject {
private:
static int nVarMngrs;
CBofList<CBagVar *> m_xVarList;
CBofList<CBagVar *> _xVarList;
public:
CBagVarManager();
virtual ~CBagVarManager();
static void initialize();
ErrorCode RegisterVariable(CBagVar *pVar);
ErrorCode UnRegisterVariable(CBagVar *pVar);
ErrorCode UpdateRegistration();
ErrorCode ReleaseVariables(bool bIncludeGlobals = true);
ErrorCode registerVariable(CBagVar *pVar);
ErrorCode unRegisterVariable(CBagVar *pVar);
ErrorCode updateRegistration();
ErrorCode releaseVariables(bool bIncludeGlobals = true);
ErrorCode IncrementTimers();
CBagVar *GetVariable(const CBofString &sName);
CBagVar *GetVariable(int i) {
return m_xVarList[i];
ErrorCode incrementTimers();
CBagVar *getVariable(const CBofString &sName);
CBagVar *getVariable(int i) {
return _xVarList[i];
}
int GetNumVars() {
return m_xVarList.getCount();
int getNumVars() {
return _xVarList.getCount();
}
// Use a hash table to lookup variables.
CBofList<CBagVar *> m_xVarHashList[VAR_HTABLE_SIZE];
CBofList<CBagVar *> _xVarHashList[VAR_HTABLE_SIZE];
};
} // namespace Bagel

View File

@ -38,10 +38,10 @@ CBagVariableObject::~CBagVariableObject() {
}
ErrorCode CBagVariableObject::attach() {
CBagVar *xVar = VAR_MANAGER->GetVariable(getFileName());
CBagVar *xVar = g_VarManager->getVariable(getFileName());
if (xVar && !getRefName().isEmpty())
xVar->SetValue(getRefName());
xVar->setValue(getRefName());
return CBagObject::attach();
}
@ -152,9 +152,9 @@ ParseCodes CBagVariableObject::setInfo(CBagIfstream &istr) {
ErrorCode CBagVariableObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *pSrcRect, int) {
ErrorCode rc = ERR_NONE;
CBagVar *xVar = VAR_MANAGER->GetVariable(getFileName());
CBagVar *xVar = g_VarManager->getVariable(getFileName());
if (isAttached() && xVar && !(xVar->GetValue().isEmpty())) {
if (isAttached() && xVar && !(xVar->getValue().isEmpty())) {
// FIXME: Offset for the last accessed time and # times counter in
// entryway computer terminal. Otherwise, there's no space between
// them and the preceding text
@ -168,7 +168,7 @@ ErrorCode CBagVariableObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *p
pt.x += 5;
CBofRect r(pt, pSrcRect->size());
rc = paintText(pBmp, &r, xVar->GetValue(), MapFontPointSize(m_nPointSize), TEXT_NORMAL, m_nFGColor);
rc = paintText(pBmp, &r, xVar->getValue(), MapFontPointSize(m_nPointSize), TEXT_NORMAL, m_nFGColor);
// Don't need to redraw!
setDirty(false);
@ -178,12 +178,12 @@ ErrorCode CBagVariableObject::update(CBofBitmap *pBmp, CBofPoint pt, CBofRect *p
ErrorCode CBagVariableObject::Update(CBofWindow *pWnd, CBofPoint pt, CBofRect *pSrcRect, int) {
ErrorCode rc = ERR_NONE;
CBagVar *xVar = VAR_MANAGER->GetVariable(getFileName());
CBagVar *xVar = g_VarManager->getVariable(getFileName());
if (isAttached() && xVar && !(xVar->GetValue().isEmpty())) {
if (isAttached() && xVar && !(xVar->getValue().isEmpty())) {
CBofRect r(pt, pSrcRect->size());
rc = paintText(pWnd, &r, xVar->GetValue(), MapFontPointSize(m_nPointSize), TEXT_NORMAL, m_nFGColor);
rc = paintText(pWnd, &r, xVar->getValue(), MapFontPointSize(m_nPointSize), TEXT_NORMAL, m_nFGColor);
// Don't need to redraw!
setDirty(false);

View File

@ -46,13 +46,13 @@ bool Console::cmdVar(int argc, const char **argv) {
return true;
}
CBagVar *var = VAR_MANAGER->GetVariable(argv[1]);
CBagVar *var = g_VarManager->getVariable(argv[1]);
assert(var);
if (argc == 2) {
debugPrintf("Current value = %s\n", var->GetValue().getBuffer());
debugPrintf("Current value = %s\n", var->getValue().getBuffer());
} else {
var->SetValue(argv[2]);
var->setValue(argv[2]);
debugPrintf("Variable set\n");
}
@ -60,11 +60,11 @@ bool Console::cmdVar(int argc, const char **argv) {
}
bool Console::cmdVars(int argc, const char **argv) {
for (int i = 0; i < VAR_MANAGER->GetNumVars(); i++) {
CBagVar *pVar = VAR_MANAGER->GetVariable(i);
for (int i = 0; i < g_VarManager->getNumVars(); i++) {
CBagVar *pVar = g_VarManager->getVariable(i);
if (pVar != nullptr) {
debugPrintf("VAR[%d]: %s = %s\n", i, (const char *)pVar->getName(),
(const char *)pVar->GetValue());
(const char *)pVar->getValue());
}
}
@ -72,8 +72,8 @@ bool Console::cmdVars(int argc, const char **argv) {
}
bool Console::cmdFleebix(int argc, const char **argv) {
CBofString inner = VAR_MANAGER->GetVariable("NDJAM_INNERDIAL_DISPLAY")->GetValue();
CBofString outer = VAR_MANAGER->GetVariable("NDJAM_OUTERDIAL_DISPLAY")->GetValue();
CBofString inner = g_VarManager->getVariable("NDJAM_INNERDIAL_DISPLAY")->getValue();
CBofString outer = g_VarManager->getVariable("NDJAM_OUTERDIAL_DISPLAY")->getValue();
debugPrintf("Frequency is %s.%s\n", inner.getBuffer(), outer.getBuffer());
return true;

View File

@ -64,26 +64,26 @@ ErrorCode SBarBibOddsWnd::detach() {
}
void SBarBibOddsWnd::onKeyHit(uint32 lKey, uint32 lRepCount) {
CBagVar *pVar = VAR_MANAGER->GetVariable("TORSOSTATE");
CBagVar *pVar = g_VarManager->getVariable("TORSOSTATE");
if (pVar != nullptr) {
CBofString StateStr = pVar->GetValue();
CBofString StateStr = pVar->getValue();
if (StateStr == "MAINMENU") {
switch (lKey) {
case BKEY_1:
pVar->SetValue("VIDINFO");
pVar->setValue("VIDINFO");
attachActiveObjects();
break;
case BKEY_2:
pVar->SetValue("SETBIBBLE");
pVar->setValue("SETBIBBLE");
attachActiveObjects();
break;
case BKEY_3:
pVar->SetValue("BADCODE");
pVar->setValue("BADCODE");
attachActiveObjects();
break;
case BKEY_4:
pVar->SetValue("TIPS");
pVar->setValue("TIPS");
attachActiveObjects();
break;
case BKEY_5:
@ -96,11 +96,11 @@ void SBarBibOddsWnd::onKeyHit(uint32 lKey, uint32 lRepCount) {
} else if (StateStr == "SETBIBBLE") {
switch (lKey) {
case BKEY_1:
pVar->SetValue("SETBONK");
pVar->setValue("SETBONK");
attachActiveObjects();
break;
case BKEY_2:
pVar->SetValue("SETBAB");
pVar->setValue("SETBAB");
attachActiveObjects();
break;
default:

View File

@ -267,14 +267,14 @@ ErrorCode CBibbleWindow::attach() {
CBagVar *pVar;
if ((pVar = VAR_MANAGER->GetVariable("NUGGETS")) != nullptr) {
_nNumCredits = pVar->GetNumValue();
if ((pVar = g_VarManager->getVariable("NUGGETS")) != nullptr) {
_nNumCredits = pVar->getNumValue();
}
logInfo(buildString("\tCredits: %d", _nNumCredits));
g_bBibbleHack = false;
if ((pVar = VAR_MANAGER->GetVariable("BIBBLEHACK")) != nullptr) {
if (pVar->GetNumValue() != 0) {
if ((pVar = g_VarManager->getVariable("BIBBLEHACK")) != nullptr) {
if (pVar->getNumValue() != 0) {
g_bBibbleHack = true;
}
}
@ -446,8 +446,8 @@ ErrorCode CBibbleWindow::detach() {
// Write out new value of nuggets
CBagVar *pVar;
if ((pVar = VAR_MANAGER->GetVariable("NUGGETS")) != nullptr) {
pVar->SetValue(_nNumCredits);
if ((pVar = g_VarManager->getVariable("NUGGETS")) != nullptr) {
pVar->setValue(_nNumCredits);
}
if (_pBkgSnd->isPlaying()) {
@ -515,7 +515,7 @@ ErrorCode CBibbleWindow::detach() {
CBagStorageDevWnd::detach();
// Playing BibbleBonk has made 1 turn go by.
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
return _errCode;
}

View File

@ -229,7 +229,7 @@ ErrorCode SBarComputer::detach() {
CBagStorageDevWnd::detach();
// Going into mr drinkmaster makes 1 turn go by
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
logInfo("Detached SBarComputer");
@ -706,12 +706,12 @@ void SBarComputer::order() {
// Deduct 1 Nugget from the player
// Read in their total nuggets from game
CBagVar *pVar = VAR_MANAGER->GetVariable("NUGGETS");
CBagVar *pVar2 = VAR_MANAGER->GetVariable("HAVEDRINK");
CBagVar *pVar = g_VarManager->getVariable("NUGGETS");
CBagVar *pVar2 = g_VarManager->getVariable("HAVEDRINK");
if (pVar) {
int nCredits = pVar->GetNumValue();
int nHaveDrink = pVar2->GetNumValue();
int nCredits = pVar->getNumValue();
int nHaveDrink = pVar2->getNumValue();
// If the player is out of nuggets, then put up a text message.
if (nCredits < 1) {
@ -752,8 +752,8 @@ void SBarComputer::order() {
else {
pSoldierSDev->activateLocalObject(CompItem._pDrink);
BofPlaySound(BuildBarcDir(ORDERAUDIO), SOUND_MIX);
pVar->SetValue(nCredits - 1);
pVar2->SetValue(1);
pVar->setValue(nCredits - 1);
pVar2->setValue(1);
}
if (bRefuse) {

View File

@ -236,43 +236,43 @@ static void GetVilVars() {
// check if HUD is on
cStr = "HUDON";
g_pHudOn = VAR_MANAGER->GetVariable(cStr);
g_pHudOn = g_VarManager->getVariable(cStr);
cStr = "DGRAFITTI";
g_pDGrafiti = VAR_MANAGER->GetVariable(cStr);
g_pDGrafiti = g_VarManager->getVariable(cStr);
cStr = "DRADIO";
g_pDRadio = VAR_MANAGER->GetVariable(cStr);
g_pDRadio = g_VarManager->getVariable(cStr);
cStr = "PRECIPITATION";
g_pPrecip = VAR_MANAGER->GetVariable(cStr);
g_pPrecip = g_VarManager->getVariable(cStr);
cStr = "PRECDECIMAL";
g_pPrecDecimal = VAR_MANAGER->GetVariable(cStr);
g_pPrecDecimal = g_VarManager->getVariable(cStr);
cStr = "DUST";
g_pDust = VAR_MANAGER->GetVariable(cStr);
g_pDust = g_VarManager->getVariable(cStr);
cStr = "DUSTDECIMAL";
g_pDustDecimal = VAR_MANAGER->GetVariable(cStr);
g_pDustDecimal = g_VarManager->getVariable(cStr);
cStr = "DVOICEID";
g_pDVoiceID = VAR_MANAGER->GetVariable(cStr);
g_pDVoiceID = g_VarManager->getVariable(cStr);
cStr = "DCHIPID";
g_pDChipID = VAR_MANAGER->GetVariable(cStr);
g_pDChipID = g_VarManager->getVariable(cStr);
cStr = "TDIG1";
g_pTDig1 = VAR_MANAGER->GetVariable(cStr);
g_pTDig1 = g_VarManager->getVariable(cStr);
cStr = "TDIG2";
g_pTDig2 = VAR_MANAGER->GetVariable(cStr);
g_pTDig2 = g_VarManager->getVariable(cStr);
cStr = "TDIG3";
g_pTDig3 = VAR_MANAGER->GetVariable(cStr);
g_pTDig3 = g_VarManager->getVariable(cStr);
cStr = "TDIG4";
g_pTDig4 = VAR_MANAGER->GetVariable(cStr);
g_pTDig4 = g_VarManager->getVariable(cStr);
}
@ -301,8 +301,8 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
g_engine->viewRect.intersectRect(pBmp->getRect(), g_engine->viewPortRect);
}
if (g_pHudOn->GetNumValue() == 1) {
if (g_pDGrafiti->GetNumValue()) {
if (g_pHudOn->getNumValue() == 1) {
if (g_pDGrafiti->getNumValue()) {
CBofRect SrcRect(pGrafittiBmp->getRect());
pGrafittiBmp->paint(pBmp, g_engine->viewRect.left, g_engine->viewRect.top, &SrcRect, 1);
}
@ -310,7 +310,7 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
CBofRect rect(g_engine->viewRect.left, g_engine->viewRect.top, g_engine->viewRect.right, g_engine->viewRect.top + 20);
// Display internal radio setting.
if (g_pDRadio->GetNumValue()) {
if (g_pDRadio->getNumValue()) {
paintText(pBmp, &rect, kRadioOnString, VILDROIDSTATSTEXTSIZE, TEXT_BOLD, RGB(0, 255, 6), JUSTIFY_LEFT, FORMAT_DEFAULT);
} else {
paintText(pBmp, &rect, kRadioOffString, VILDROIDSTATSTEXTSIZE, TEXT_BOLD, RGB(0, 255, 6), JUSTIFY_LEFT, FORMAT_DEFAULT);
@ -318,17 +318,17 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
// Display chance of precipitation.
char szVBuff2[256];
Common::sprintf_s(szVBuff2, "%s%d.%d%%", kPrecipString, g_pPrecip->GetNumValue(), g_pPrecDecimal->GetNumValue());
Common::sprintf_s(szVBuff2, "%s%d.%d%%", kPrecipString, g_pPrecip->getNumValue(), g_pPrecDecimal->getNumValue());
CBofRect cleanRect((g_engine->viewRect.right - 250), g_engine->viewRect.top, g_engine->viewRect.right - 5, g_engine->viewRect.top + 20);
paintText(pBmp, &cleanRect, szVBuff2, VILDROIDSTATSTEXTSIZE, TEXT_BOLD, RGB(0, 255, 6), JUSTIFY_RIGHT, FORMAT_DEFAULT);
// Display dust level.
Common::sprintf_s(szVBuff2, "%s%d.%dp/cmm", kDustString, g_pDust->GetNumValue(), g_pDustDecimal->GetNumValue());
Common::sprintf_s(szVBuff2, "%s%d.%dp/cmm", kDustString, g_pDust->getNumValue(), g_pDustDecimal->getNumValue());
cleanRect.bottom += 20;
cleanRect.top += 20;
paintText(pBmp, &cleanRect, szVBuff2, VILDROIDSTATSTEXTSIZE, TEXT_BOLD, RGB(0, 255, 6), JUSTIFY_RIGHT, FORMAT_DEFAULT);
int voiceId = g_pDVoiceID->GetNumValue();
int voiceId = g_pDVoiceID->getNumValue();
const char *pVoiceIdString = voiceNameArray[voiceId];
rect.top += 20;
@ -350,7 +350,7 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
pTipBmp->paint(pBmp, &rect, &srcTipRect, 0);
// moved up here to use chipID later on bar
int chipID = g_pDChipID->GetNumValue();
int chipID = g_pDChipID->getNumValue();
if (CMainWindow::chipdisp == false) {
switch (chipID) {
@ -452,7 +452,7 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
break;
}
}
} else if (g_pDChipID->GetNumValue() == 3) {
} else if (g_pDChipID->getNumValue() == 3) {
CBofRect txtRect(g_engine->viewRect);
uint32 lDiff;
uint32 timer = getTimer();
@ -534,8 +534,8 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
case 29: {
paintText(pBmp, &txtRect,
buildString("You have been assigned Maintenance Mode PIN: %d%d%d%d",
g_pTDig1->GetNumValue(), g_pTDig2->GetNumValue(),
g_pTDig3->GetNumValue(), g_pTDig4->GetNumValue()),
g_pTDig1->getNumValue(), g_pTDig2->getNumValue(),
g_pTDig3->getNumValue(), g_pTDig4->getNumValue()),
VILDROIDTIPSTEXTSIZE, TEXT_BOLD, RGB(255, 7, 0),
JUSTIFY_CENTER, FORMAT_TOP_CENTER);
break;
@ -544,7 +544,7 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
default: {
CMainWindow::chipdisp = false;
waitCount = 0;
g_pDChipID->SetValue(0);
g_pDChipID->setValue(0);
break;
}
@ -566,7 +566,7 @@ static bool VildroidFilter(CBofBitmap *pBmp, CBofRect *pRect) {
if ((getTimer() - waitCount) > 15000) {
CMainWindow::chipdisp = false;
waitCount = 0;
g_pDChipID->SetValue(0);
g_pDChipID->setValue(0);
char szCString[256];
CBofString cString(szCString, 256);
@ -606,7 +606,7 @@ static bool TriFilter(CBofBitmap *pBmp, CBofRect *pRect) {
g_engine->viewRect.intersectRect(pBmp->getRect(), g_engine->viewPortRect);
}
if (VAR_MANAGER->GetVariable("GLASSESON")->GetNumValue()) {
if (g_VarManager->getVariable("GLASSESON")->getNumValue()) {
CBofRect SrcRect(pTriBmp->getRect());
pTriBmp->paint(pBmp, g_engine->viewRect.left, g_engine->viewRect.top, &SrcRect, 1);
}
@ -632,11 +632,11 @@ static bool ZzazzlFilter(CBofBitmap *pBmp, CBofRect *pRect) {
}
zStr = "ZZAZZLVISION";
CBagVar *pVar = VAR_MANAGER->GetVariable(zStr);
CBagVar *pVar = g_VarManager->getVariable(zStr);
if (pVar != nullptr) {
bZzazzlVision = true;
if (pVar->GetNumValue() > 0) {
if (pVar->getNumValue() > 0) {
CMainWindow::setZzazzlVision(true); // zzazzl paint is on in the script
int dx = g_engine->viewRect.width() / 3; // + 1;
int dy = g_engine->viewRect.height() / 3; // + 1;
@ -697,7 +697,7 @@ static bool HalucinateFilter(CBofBitmap *pBmp, CBofRect *pRect) {
hStr = "HALLUCINATE";
if (VAR_MANAGER->GetVariable(hStr)->GetNumValue() > 0) {
if (g_VarManager->getVariable(hStr)->getNumValue() > 0) {
bHallucinating = true;
CBofPalette *pPal = pBmp->getPalette();
CBofBitmap *pTempBitmap = new CBofBitmap(g_engine->viewRect.width(), g_engine->viewRect.height(), pPal);
@ -749,11 +749,11 @@ static bool LightningFilter(CBofBitmap *pBmp, CBofRect *pRect) {
char szVBuf[256];
CBofString vStr(szVBuf, 256);
vStr = "LIGHTNINGDELAY";
CBagVar *pVar = VAR_MANAGER->GetVariable(vStr);
CBagVar *pVar = g_VarManager->getVariable(vStr);
int nLightningDelay = 0;
if (pVar != nullptr) {
nLightningDelay = pVar->GetNumValue();
nLightningDelay = pVar->getNumValue();
}
if (nLightningDelay > 0) {

View File

@ -187,9 +187,9 @@ ErrorCode CMainWindow::attach() {
_pPDABmp->attach();
// Allow the script to specify the increment height.
CBagVar *pVar = VAR_MANAGER->GetVariable("PDAINCREMENT");
CBagVar *pVar = g_VarManager->getVariable("PDAINCREMENT");
if (pVar) {
g_nPDAIncrement = pVar->GetNumValue();
g_nPDAIncrement = pVar->getNumValue();
_pPDABmp->setPosInWindow(r.width(), r.height(), g_nPDAIncrement);
} else {
g_nPDAIncrement = PDA_INCREMENT;
@ -335,10 +335,10 @@ void CMainWindow::onKeyHit(uint32 lKey, uint32 lRepCount) {
if (lKey == BKEY_SCRL_LOCK) { // Get a scroll lock hit
if (getFilterId() == 0x08) { // If we're in zzazzl filter
_bZzazzlVision = !_bZzazzlVision; // toggle the paint zzazzl flag
CBagVar *pVar = VAR_MANAGER->GetVariable("ZZAZZLVISION");
CBagVar *pVar = g_VarManager->getVariable("ZZAZZLVISION");
if (pVar != nullptr) {
pVar->SetValue(_bZzazzlVision ? 1 : 0);
pVar->setValue(_bZzazzlVision ? 1 : 0);
}
}
} else {

View File

@ -314,7 +314,7 @@ ErrorCode CNavWindow::detach() {
CBagCursor::hideSystemCursor();
// One turn has gone by
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
_bNavAttached = false;
}
@ -685,7 +685,7 @@ void CNavWindow::onBofButton(CBofObject *pObject, int nState) {
switch (pButton->getControlID()) {
case QUIT: {
logInfo("\tClicked Quit");
VAR_MANAGER->GetVariable("NPLAYEDNAV")->SetBoolValue(true);
g_VarManager->getVariable("NPLAYEDNAV")->setBoolValue(true);
close();
break;
}
@ -845,7 +845,7 @@ void CNavWindow::onKeyHit(uint32 lKey, uint32 /*lRepCount*/) {
assert(isValidObject(this));
if (lKey == BKEY_ALT_q || lKey == BKEY_ALT_F4) {
VAR_MANAGER->GetVariable("NPLAYEDNAV")->SetBoolValue(true);
g_VarManager->getVariable("NPLAYEDNAV")->setBoolValue(true);
close();
}
}
@ -1386,8 +1386,8 @@ void CNavWindow::calcFuel(double hf) {
bool isDone = (_level == 3);
if (_level == 3) {
VAR_MANAGER->GetVariable("NPASSEDTEST")->SetBoolValue(true);
VAR_MANAGER->GetVariable("NPLAYEDNAV")->SetBoolValue(true);
g_VarManager->getVariable("NPASSEDTEST")->setBoolValue(true);
g_VarManager->getVariable("NPLAYEDNAV")->setBoolValue(true);
close();
}
@ -1454,7 +1454,7 @@ void CNavWindow::calcFuel(double hf) {
}
if (_fuel <= 0) {
VAR_MANAGER->GetVariable("NPLAYEDNAV")->SetBoolValue(true);
g_VarManager->getVariable("NPLAYEDNAV")->setBoolValue(true);
killTimer(777);
close();
}

View File

@ -226,10 +226,10 @@ ErrorCode SBarSlotWnd::attach() {
// Read in their total nuggets from game
CBagVar *pVar = nullptr;
pVar = VAR_MANAGER->GetVariable("NUGGETS");
pVar = g_VarManager->getVariable("NUGGETS");
if (pVar)
_nCredit = pVar->GetNumValue();
_nCredit = pVar->getNumValue();
// Initialize their bet
_nBet = 0;
@ -311,9 +311,9 @@ ErrorCode SBarSlotWnd::detach() {
}
// Write out new value of nuggets
CBagVar *pVar = VAR_MANAGER->GetVariable("NUGGETS");
CBagVar *pVar = g_VarManager->getVariable("NUGGETS");
if (pVar)
pVar->SetValue(_nCredit);
pVar->setValue(_nCredit);
if (_pBkgSnd->isPlaying()) {
_pBkgSnd->stop();
@ -379,7 +379,7 @@ ErrorCode SBarSlotWnd::detach() {
CBagStorageDevWnd::detach();
// One turn has gone by
VAR_MANAGER->IncrementTimers();
g_VarManager->incrementTimers();
return _errCode;
}

View File

@ -745,10 +745,10 @@ bool SrafComputer::verifyDispatchTeam() {
pTeamItem->_nFlags = nTeam | nDispatchFlags;
pTeamItem->_nMeetWithID = nMeetingWith;
CBagVar *pVar = VAR_MANAGER->GetVariable("SRATURNCOUNT");
CBagVar *pVar = g_VarManager->getVariable("SRATURNCOUNT");
assert(pVar != nullptr);
pTeamItem->_nDispatchTime = pVar->GetNumValue();
pTeamItem->_nDispatchTime = pVar->getNumValue();
pTeamItem->_nMeetingTime = calculateMeetingTime(pTeamItem->_nFlags);
// The spokesperson will be the majority of the sexes
@ -942,9 +942,9 @@ ErrorCode SrafComputer::attach() {
// Set the starting time...
if (_nStartingTime == 0) {
CBagVar *pVar = VAR_MANAGER->GetVariable("SRATURNCOUNT");
CBagVar *pVar = g_VarManager->getVariable("SRATURNCOUNT");
assert(pVar != nullptr);
_nStartingTime = pVar->GetNumValue();
_nStartingTime = pVar->getNumValue();
}
assert(_pszGroup1Word != nullptr);
@ -962,9 +962,9 @@ ErrorCode SrafComputer::attach() {
restoreSraffanVars();
// Finally, if we're hallucinating, turn off the hallucination filter.
CBagVar *pVar = VAR_MANAGER->GetVariable("HALLUCINATE");
if (pVar && pVar->GetNumValue() > 0) {
pVar->SetValue(0);
CBagVar *pVar = g_VarManager->getVariable("HALLUCINATE");
if (pVar && pVar->getNumValue() > 0) {
pVar->setValue(0);
}
}
@ -1283,14 +1283,14 @@ void SrafComputer::activateDealSummary() {
}
// Retrieve IRK's and QUOSH's terms
CBagVar *pVar = VAR_MANAGER->GetVariable("IRKSTERMS");
CBagVar *pVar = g_VarManager->getVariable("IRKSTERMS");
if (pVar != nullptr) {
g_stSellerNames[IRK4]._nAmount = pVar->GetNumValue();
g_stSellerNames[IRK4]._nAmount = pVar->getNumValue();
}
pVar = VAR_MANAGER->GetVariable("QUOSHSTERMS");
pVar = g_VarManager->getVariable("QUOSHSTERMS");
if (pVar != nullptr) {
g_stSellerNames[QUOSH23]._nAmount = pVar->GetNumValue();
g_stSellerNames[QUOSH23]._nAmount = pVar->getNumValue();
}
recalcSellerSummaryList();
@ -3038,8 +3038,8 @@ void SrafComputer::onListAudioSettings() {
// Add a selection for random play.
if (g_stAudioSetting[nTrackSelection]->_pszAudioFile == nullptr) {
_bRandomAudio = true;
CBagVar *pVar = VAR_MANAGER->GetVariable("SRATURNCOUNT");
_nRandomTime = pVar->GetNumValue();
CBagVar *pVar = g_VarManager->getVariable("SRATURNCOUNT");
_nRandomTime = pVar->getNumValue();
nTrackSelection = g_engine->getRandomNumber() % (NUM_MUSICAL_SCORES - 1);
} else {
_bRandomAudio = false;
@ -3134,9 +3134,9 @@ bool SrafComputer::reportMeetingStatus(int nTeamNumber) {
}
// Get the current time...
CBagVar *pVar = VAR_MANAGER->GetVariable("SRATURNCOUNT");
CBagVar *pVar = g_VarManager->getVariable("SRATURNCOUNT");
assert(pVar != nullptr);
int nCurTime = pVar->GetNumValue();
int nCurTime = pVar->getNumValue();
// If less then 5 turns have elapsed, then we're still in the driving stage...
if ((teamListItem._nDispatchTime + kDrivingTime) >= nCurTime) {
@ -3157,7 +3157,7 @@ bool SrafComputer::reportMeetingStatus(int nTeamNumber) {
// Meeting not done yet, let 'em know it.
if (bDone == false) {
if (teamListItem._nDispatchTime + teamListItem._nMeetingTime > pVar->GetNumValue()) {
if (teamListItem._nDispatchTime + teamListItem._nMeetingTime > pVar->getNumValue()) {
bDone = true;
bTimeElapsed = false;
@ -4348,28 +4348,28 @@ void SrafComputer::onButtonFinished(bool bVictorious) {
}
// Pass our codewords back to the bar...
pVar = VAR_MANAGER->GetVariable("DEVENCODE1");
pVar = g_VarManager->getVariable("DEVENCODE1");
assert(pVar != nullptr);
if (pVar)
pVar->SetValue(_pszGroup1Word->getBuffer());
pVar->setValue(_pszGroup1Word->getBuffer());
pVar = VAR_MANAGER->GetVariable("DEVENCODE2");
pVar = g_VarManager->getVariable("DEVENCODE2");
assert(pVar != nullptr);
if (pVar)
pVar->SetValue(_pszGroup2Word->getBuffer());
pVar->setValue(_pszGroup2Word->getBuffer());
}
// Setting the flashback variable will trigger the
// event world condition which gets us back to the bar.
pVar = VAR_MANAGER->GetVariable("RFLASHBACK");
pVar = g_VarManager->getVariable("RFLASHBACK");
assert(pVar != nullptr);
if (pVar) {
if (bVictorious == true) {
pVar->SetValue(2);
pVar->setValue(2);
} else {
pVar->SetValue(1);
pVar->setValue(1);
}
}
@ -4415,7 +4415,7 @@ void SrafComputer::setMainScreen() {
}
void SrafComputer::incrementTurnCount() {
CBagVar *pVar = VAR_MANAGER->GetVariable("SRATURNCOUNT");
CBagVar *pVar = g_VarManager->getVariable("SRATURNCOUNT");
int nTurncount = 0;
assert(pVar != nullptr);
@ -4427,8 +4427,8 @@ void SrafComputer::incrementTurnCount() {
if (pVar != nullptr) {
nTurncount = pVar->GetNumValue();
pVar->SetValue(++nTurncount);
nTurncount = pVar->getNumValue();
pVar->setValue(++nTurncount);
}
// If we're in a screen that has a time count, then update it here...
@ -4510,13 +4510,13 @@ void SrafComputer::incrementTurnCount() {
}
void SrafComputer::displayTurnCount(int nLineNo) {
CBagVar *pVar = VAR_MANAGER->GetVariable("SRATURNCOUNT");
CBagVar *pVar = g_VarManager->getVariable("SRATURNCOUNT");
assert(pVar != nullptr);
char szLocalBuff[256];
szLocalBuff[0] = '\0';
CBofString sStr(szLocalBuff, 256);
int nCurrentTime = pVar->GetNumValue();
int nCurrentTime = pVar->getNumValue();
Common::sprintf_s(szLocalBuff,
"CURRENT TIME: %02d:%02d",
@ -4727,9 +4727,9 @@ void SrafComputer::restoreSraffanVars() {
break;
}
pVar = VAR_MANAGER->GetVariable(pVarName);
pVar = g_VarManager->getVariable(pVarName);
if (pVar != nullptr) {
g_stSellerNames[nSellerID]._nAmount = pVar->GetNumValue();
g_stSellerNames[nSellerID]._nAmount = pVar->getNumValue();
}
}
@ -4768,9 +4768,9 @@ void SrafComputer::restoreSraffanVars() {
break;
}
pVar = VAR_MANAGER->GetVariable(pVarName);
pVar = g_VarManager->getVariable(pVarName);
if (pVar != nullptr) {
g_stBuyerBids[nBuyerID]._nMineralVal[nMineralID] = pVar->GetNumValue();
g_stBuyerBids[nBuyerID]._nMineralVal[nMineralID] = pVar->getNumValue();
// total each one...
int nBidSum = 0;
@ -4785,9 +4785,9 @@ void SrafComputer::restoreSraffanVars() {
// Save the list of who is in on this deal... use a bit to indicate if they are in or not.
uint32 nBuyersMask = 0;
pVar = VAR_MANAGER->GetVariable("BUYERSMASK");
pVar = g_VarManager->getVariable("BUYERSMASK");
if (pVar != nullptr) {
nBuyersMask = pVar->GetNumValue();
nBuyersMask = pVar->getNumValue();
}
for (int i = 0; i < NUM_BUYERS; i++) {
@ -4803,9 +4803,9 @@ void SrafComputer::restoreSraffanVars() {
uint32 nAvailMask = 0;
uint32 nIndex = 0;
pVar = VAR_MANAGER->GetVariable("AVAILABLEMASK");
pVar = g_VarManager->getVariable("AVAILABLEMASK");
if (pVar != nullptr) {
nAvailMask = pVar->GetNumValue();
nAvailMask = pVar->getNumValue();
}
for (int i = 0; i < NUM_BUYERS; i++, nIndex++) {
@ -4854,16 +4854,16 @@ void SrafComputer::restoreSraffanVars() {
break;
}
pVar = VAR_MANAGER->GetVariable(pVarName);
pVar = g_VarManager->getVariable(pVarName);
if (pVar != nullptr) {
g_stOtherPartys[nOtherID]._nPaymentAmount = pVar->GetNumValue();
g_stOtherPartys[nOtherID]._nPaymentAmount = pVar->getNumValue();
}
}
// Retrieve swonza's state
pVar = VAR_MANAGER->GetVariable("SWONZAENLIGHTENED");
pVar = g_VarManager->getVariable("SWONZAENLIGHTENED");
if (pVar != nullptr) {
_bSwonzaEnlightened = pVar->GetNumValue();
_bSwonzaEnlightened = pVar->getNumValue();
}
// Mark each of our staffers as available before we start.
@ -4890,9 +4890,9 @@ void SrafComputer::restoreSraffanVars() {
Common::sprintf_s(szMEETINGTIME, "%s%d%s", "TEAM", i + 1, "MEETINGTIME");
// Restore the whole block...
pVar = VAR_MANAGER->GetVariable(szFLAGS);
pVar = g_VarManager->getVariable(szFLAGS);
if (pVar != nullptr) {
teamListItem._nFlags = pVar->GetNumValue();
teamListItem._nFlags = pVar->getNumValue();
// If we have a meeting going on, then mark that
// sraffan staffer as unavailable.
@ -4904,21 +4904,21 @@ void SrafComputer::restoreSraffanVars() {
}
}
}
pVar = VAR_MANAGER->GetVariable(szMEETWITH);
pVar = g_VarManager->getVariable(szMEETWITH);
if (pVar != nullptr) {
teamListItem._nMeetWithID = pVar->GetNumValue();
teamListItem._nMeetWithID = pVar->getNumValue();
}
pVar = VAR_MANAGER->GetVariable(szDISPATCHTIME);
pVar = g_VarManager->getVariable(szDISPATCHTIME);
if (pVar != nullptr) {
teamListItem._nDispatchTime = pVar->GetNumValue();
teamListItem._nDispatchTime = pVar->getNumValue();
}
pVar = VAR_MANAGER->GetVariable(szCAPTAIN);
pVar = g_VarManager->getVariable(szCAPTAIN);
if (pVar != nullptr) {
teamListItem._nTeamCaptain = pVar->GetNumValue();
teamListItem._nTeamCaptain = pVar->getNumValue();
}
pVar = VAR_MANAGER->GetVariable(szMEETINGTIME);
pVar = g_VarManager->getVariable(szMEETINGTIME);
if (pVar != nullptr) {
teamListItem._nMeetingTime = pVar->GetNumValue();
teamListItem._nMeetingTime = pVar->getNumValue();
}
// If we have a list established, then add this item to it if there's anything
@ -4945,14 +4945,14 @@ void SrafComputer::restoreSraffanVars() {
int nMetWithVal = 0;
int nMeetingResultVal = 0;
pVar = VAR_MANAGER->GetVariable("METWITH");
pVar = g_VarManager->getVariable("METWITH");
if (pVar != nullptr) {
nMetWithVal = pVar->GetNumValue();
nMetWithVal = pVar->getNumValue();
}
pVar = VAR_MANAGER->GetVariable("MEETINGRESULTS");
pVar = g_VarManager->getVariable("MEETINGRESULTS");
if (pVar != nullptr) {
nMeetingResultVal = pVar->GetNumValue();
nMeetingResultVal = pVar->getNumValue();
}
int nBitNo = 0;
@ -5009,9 +5009,9 @@ void SrafComputer::saveSraffanVars() {
break;
}
CBagVar *pVar = VAR_MANAGER->GetVariable(pVarName);
CBagVar *pVar = g_VarManager->getVariable(pVarName);
if (pVar != nullptr) {
pVar->SetValue(g_stSellerNames[nSellerID]._nAmount);
pVar->setValue(g_stSellerNames[nSellerID]._nAmount);
}
}
@ -5050,9 +5050,9 @@ void SrafComputer::saveSraffanVars() {
break;
}
pVar = VAR_MANAGER->GetVariable(pVarName);
pVar = g_VarManager->getVariable(pVarName);
if (pVar != nullptr) {
pVar->SetValue(g_stBuyerBids[nBuyerID]._nMineralVal[nMineralID]);
pVar->setValue(g_stBuyerBids[nBuyerID]._nMineralVal[nMineralID]);
}
}
@ -5064,9 +5064,9 @@ void SrafComputer::saveSraffanVars() {
}
}
pVar = VAR_MANAGER->GetVariable("BUYERSMASK");
pVar = g_VarManager->getVariable("BUYERSMASK");
if (pVar != nullptr) {
pVar->SetValue(nBuyersMask);
pVar->setValue(nBuyersMask);
}
// Save the list of who is available and who is not.
@ -5093,9 +5093,9 @@ void SrafComputer::saveSraffanVars() {
assert(nIndex < 32);
pVar = VAR_MANAGER->GetVariable("AVAILABLEMASK");
pVar = g_VarManager->getVariable("AVAILABLEMASK");
if (pVar != nullptr) {
pVar->SetValue(nAvailMask);
pVar->setValue(nAvailMask);
}
// Save other party's info
@ -5118,15 +5118,15 @@ void SrafComputer::saveSraffanVars() {
break;
}
if ((pVar = VAR_MANAGER->GetVariable(pVarName)) != nullptr) {
pVar->SetValue(g_stOtherPartys[nOtherID]._nPaymentAmount);
if ((pVar = g_VarManager->getVariable(pVarName)) != nullptr) {
pVar->setValue(g_stOtherPartys[nOtherID]._nPaymentAmount);
}
}
// Save swonza's state
pVar = VAR_MANAGER->GetVariable("SWONZAENLIGHTENED");
pVar = g_VarManager->getVariable("SWONZAENLIGHTENED");
if (pVar != nullptr) {
pVar->SetValue(_bSwonzaEnlightened);
pVar->setValue(_bSwonzaEnlightened);
}
// Now the real pain in the ass... saving team information...
@ -5163,29 +5163,29 @@ void SrafComputer::saveSraffanVars() {
teamListItem._nMeetingTime = 0;
}
pVar = VAR_MANAGER->GetVariable(szFLAGS);
pVar = g_VarManager->getVariable(szFLAGS);
if (pVar != nullptr) {
pVar->SetValue(teamListItem._nFlags);
pVar->setValue(teamListItem._nFlags);
}
pVar = VAR_MANAGER->GetVariable(szMEETWITH);
pVar = g_VarManager->getVariable(szMEETWITH);
if (pVar != nullptr) {
pVar->SetValue(teamListItem._nMeetWithID);
pVar->setValue(teamListItem._nMeetWithID);
}
pVar = VAR_MANAGER->GetVariable(szDISPATCHTIME);
pVar = g_VarManager->getVariable(szDISPATCHTIME);
if (pVar != nullptr) {
pVar->SetValue(teamListItem._nDispatchTime);
pVar->setValue(teamListItem._nDispatchTime);
}
pVar = VAR_MANAGER->GetVariable(szCAPTAIN);
pVar = g_VarManager->getVariable(szCAPTAIN);
if (pVar != nullptr) {
pVar->SetValue(teamListItem._nTeamCaptain);
pVar->setValue(teamListItem._nTeamCaptain);
}
pVar = VAR_MANAGER->GetVariable(szMEETINGTIME);
pVar = g_VarManager->getVariable(szMEETINGTIME);
if (pVar != nullptr) {
pVar->SetValue(teamListItem._nMeetingTime);
pVar->setValue(teamListItem._nMeetingTime);
}
}
@ -5230,14 +5230,14 @@ void SrafComputer::saveSraffanVars() {
}
// Now save the variables
pVar = VAR_MANAGER->GetVariable("METWITH");
pVar = g_VarManager->getVariable("METWITH");
if (pVar != nullptr) {
pVar->SetValue(nMetWithVal);
pVar->setValue(nMetWithVal);
}
pVar = VAR_MANAGER->GetVariable("MEETINGRESULTS");
pVar = g_VarManager->getVariable("MEETINGRESULTS");
if (pVar != nullptr) {
pVar->SetValue(nMeetingResultVal);
pVar->setValue(nMeetingResultVal);
}
// All done!

View File

@ -86,18 +86,18 @@ ErrorCode SBarVidWnd::attach() {
assert(isValidObject(this));
if (CMainWindow::attach() == ERR_NONE) {
_pDiscVar = VAR_MANAGER->GetVariable("CUR_VDISC");
_pTimerVar = VAR_MANAGER->GetVariable("CUR_VTIME");
_pDiscVar = g_VarManager->getVariable("CUR_VDISC");
_pTimerVar = g_VarManager->getVariable("CUR_VTIME");
// What time does the murder occur?
CBagVar *pVar = VAR_MANAGER->GetVariable("VDISC_EVTIME");
CBagVar *pVar = g_VarManager->getVariable("VDISC_EVTIME");
if (pVar != nullptr) {
_nStartTime = pVar->GetNumValue();
_nStartTime = pVar->getNumValue();
_nStartTime -= 180;
}
if (_pTimerVar != nullptr) {
_fTimer = _pTimerVar->GetNumValue();
_fTimer = _pTimerVar->getNumValue();
}
if (_pMovie != nullptr) {
@ -118,9 +118,9 @@ ErrorCode SBarVidWnd::attach() {
_fTimerDiff = 0;
_pPlayingVar = VAR_MANAGER->GetVariable("VDISC_PLAYING");
_pPlayingVar = g_VarManager->getVariable("VDISC_PLAYING");
if (_pPlayingVar != nullptr) {
int nMode = _pPlayingVar->GetNumValue();
int nMode = _pPlayingVar->getNumValue();
switch (nMode) {
case 1:
@ -155,9 +155,9 @@ ErrorCode SBarVidWnd::detach() {
_pMovie = nullptr;
}
CBagVar *pTimerVar = VAR_MANAGER->GetVariable("CUR_VTIME");
CBagVar *pTimerVar = g_VarManager->getVariable("CUR_VTIME");
if (pTimerVar != nullptr) {
pTimerVar->SetValue((int)_fTimer);
pTimerVar->setValue((int)_fTimer);
}
_pTimerVar = nullptr;
@ -174,16 +174,16 @@ void SBarVidWnd::setPlayMode(int nMode) {
assert(isValidObject(this));
if (_pPlayingVar != nullptr) {
_pPlayingVar->SetValue(nMode);
_pPlayingVar->setValue(nMode);
}
// If user is playing the disk with the death scene on it, then
// reflect that in the script.
if (nMode != 0 && _pDiscVar != nullptr) {
if (_pDiscVar->GetNumValue() == 2) {
CBagVar *pVar = VAR_MANAGER->GetVariable("VIDDISC_SEEN");
if (_pDiscVar->getNumValue() == 2) {
CBagVar *pVar = g_VarManager->getVariable("VIDDISC_SEEN");
if (pVar != nullptr) {
pVar->SetValue(1);
pVar->setValue(1);
}
}
}
@ -195,7 +195,7 @@ bool SBarVidWnd::hasDisc() {
// If either disk is in the vid player
bool bHaveDisc = false;
if ((_pDiscVar != nullptr) && (_pDiscVar->GetNumValue() != 0)) {
if ((_pDiscVar != nullptr) && (_pDiscVar->getNumValue() != 0)) {
bHaveDisc = true;
}
@ -235,7 +235,7 @@ ErrorCode SBarVidWnd::onRender(CBofBitmap *pBmp, CBofRect *pRect) {
CMainWindow::onRender(pBmp, pRect);
// If the disc is in Play, FastForward, or Rewind mode
if (hasDisc() && _pPlayingVar != nullptr && _pPlayingVar->GetNumValue() != 0) {
if (hasDisc() && _pPlayingVar != nullptr && _pPlayingVar->getNumValue() != 0) {
static uint32 nLastTime = 0;
if (getTimer() >= nLastTime + 100) {
@ -253,7 +253,7 @@ ErrorCode SBarVidWnd::onRender(CBofBitmap *pBmp, CBofRect *pRect) {
// Keep BAGEL up to date with this info
if (_pTimerVar != nullptr) {
_pTimerVar->SetValue((int)_fTimer);
_pTimerVar->setValue((int)_fTimer);
}
CBofRect cRect(344, 195, 462, 210);
@ -261,7 +261,7 @@ ErrorCode SBarVidWnd::onRender(CBofBitmap *pBmp, CBofRect *pRect) {
int nDisc = 1;
if (_pDiscVar != nullptr) {
nDisc = _pDiscVar->GetNumValue();
nDisc = _pDiscVar->getNumValue();
assert(nDisc != 0);
}