Add upper case code for oe1_pcName() in Elvira 1/2.
svn-id: r35330
This commit is contained in:
parent
3c86a24d70
commit
c2daf686d6
5 changed files with 14 additions and 10 deletions
|
@ -657,7 +657,7 @@ protected:
|
||||||
Item *actor();
|
Item *actor();
|
||||||
|
|
||||||
void showMessageFormat(const char *s, ...);
|
void showMessageFormat(const char *s, ...);
|
||||||
const byte *getStringPtrByID(uint16 stringId);
|
const byte *getStringPtrByID(uint16 stringId, bool upperCase = false);
|
||||||
const byte *getLocalStringByID(uint16 stringId);
|
const byte *getLocalStringByID(uint16 stringId);
|
||||||
uint getNextStringID();
|
uint getNextStringID();
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ void AGOSEngine::moveDirn(Item *i, uint x) {
|
||||||
|
|
||||||
d = getDoorOf(p, x);
|
d = getDoorOf(p, x);
|
||||||
if (d) {
|
if (d) {
|
||||||
const byte *name = getStringPtrByID(d->itemName);
|
const byte *name = getStringPtrByID(d->itemName, true);
|
||||||
if (d->state == 1)
|
if (d->state == 1)
|
||||||
showMessageFormat("%s is closed.\n", name);
|
showMessageFormat("%s is closed.\n", name);
|
||||||
else
|
else
|
||||||
|
|
|
@ -592,7 +592,7 @@ void AGOSEngine_Elvira1::oe1_doClass() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine_Elvira1::oe1_pObj() {
|
void AGOSEngine_Elvira1::oe1_pObj() {
|
||||||
// 112: print object
|
// 112: print object name
|
||||||
SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
|
SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
|
||||||
getVarOrWord();
|
getVarOrWord();
|
||||||
|
|
||||||
|
@ -601,17 +601,15 @@ void AGOSEngine_Elvira1::oe1_pObj() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine_Elvira1::oe1_pName() {
|
void AGOSEngine_Elvira1::oe1_pName() {
|
||||||
// 114:
|
// 114: print item name
|
||||||
Item *i = getNextItemPtr();
|
Item *i = getNextItemPtr();
|
||||||
showMessageFormat("%s", (const char *)getStringPtrByID(i->itemName));
|
showMessageFormat("%s", (const char *)getStringPtrByID(i->itemName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine_Elvira1::oe1_pcName() {
|
void AGOSEngine_Elvira1::oe1_pcName() {
|
||||||
// 115:
|
// 115: print item case (and change first letter to upper case)
|
||||||
Item *i = getNextItemPtr();
|
Item *i = getNextItemPtr();
|
||||||
|
showMessageFormat("%s", (const byte *)getStringPtrByID(i->itemName, true));
|
||||||
// TODO: Change first letter to upper case.
|
|
||||||
showMessageFormat("%s", (const byte *)getStringPtrByID(i->itemName)); // Difference
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AGOSEngine_Elvira1::oe1_isCalled() {
|
void AGOSEngine_Elvira1::oe1_isCalled() {
|
||||||
|
|
|
@ -468,7 +468,7 @@ void AGOSEngine_Elvira2::oe2_bNotZero() {
|
||||||
// 156: is bit set
|
// 156: is bit set
|
||||||
uint bit = getVarWrapper();
|
uint bit = getVarWrapper();
|
||||||
|
|
||||||
// WORKAROUND: For a script glitch in some versions
|
// WORKAROUND: Enable copy protection again, in cracked version.
|
||||||
if (getGameType() == GType_SIMON1 && _subroutine == 2962 && bit == 63) {
|
if (getGameType() == GType_SIMON1 && _subroutine == 2962 && bit == 63) {
|
||||||
bit = 50;
|
bit = 50;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ using Common::File;
|
||||||
|
|
||||||
namespace AGOS {
|
namespace AGOS {
|
||||||
|
|
||||||
const byte *AGOSEngine::getStringPtrByID(uint16 stringId) {
|
const byte *AGOSEngine::getStringPtrByID(uint16 stringId, bool upperCase) {
|
||||||
const byte *string_ptr;
|
const byte *string_ptr;
|
||||||
byte *dst;
|
byte *dst;
|
||||||
|
|
||||||
|
@ -46,6 +46,12 @@ const byte *AGOSEngine::getStringPtrByID(uint16 stringId) {
|
||||||
|
|
||||||
dst = _stringReturnBuffer[_freeStringSlot];
|
dst = _stringReturnBuffer[_freeStringSlot];
|
||||||
strcpy((char *)dst, (const char *)string_ptr);
|
strcpy((char *)dst, (const char *)string_ptr);
|
||||||
|
|
||||||
|
if (upperCase && *dst) {
|
||||||
|
if (islower(*dst))
|
||||||
|
*dst = toupper(*dst);
|
||||||
|
}
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue