Add upper case code for oe1_pcName() in Elvira 1/2.

svn-id: r35330
This commit is contained in:
Travis Howell 2008-12-13 07:38:37 +00:00
parent 3c86a24d70
commit c2daf686d6
5 changed files with 14 additions and 10 deletions

View file

@ -657,7 +657,7 @@ protected:
Item *actor();
void showMessageFormat(const char *s, ...);
const byte *getStringPtrByID(uint16 stringId);
const byte *getStringPtrByID(uint16 stringId, bool upperCase = false);
const byte *getLocalStringByID(uint16 stringId);
uint getNextStringID();

View file

@ -241,7 +241,7 @@ void AGOSEngine::moveDirn(Item *i, uint x) {
d = getDoorOf(p, x);
if (d) {
const byte *name = getStringPtrByID(d->itemName);
const byte *name = getStringPtrByID(d->itemName, true);
if (d->state == 1)
showMessageFormat("%s is closed.\n", name);
else

View file

@ -592,7 +592,7 @@ void AGOSEngine_Elvira1::oe1_doClass() {
}
void AGOSEngine_Elvira1::oe1_pObj() {
// 112: print object
// 112: print object name
SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), kObjectType);
getVarOrWord();
@ -601,17 +601,15 @@ void AGOSEngine_Elvira1::oe1_pObj() {
}
void AGOSEngine_Elvira1::oe1_pName() {
// 114:
// 114: print item name
Item *i = getNextItemPtr();
showMessageFormat("%s", (const char *)getStringPtrByID(i->itemName));
}
void AGOSEngine_Elvira1::oe1_pcName() {
// 115:
// 115: print item case (and change first letter to upper case)
Item *i = getNextItemPtr();
// TODO: Change first letter to upper case.
showMessageFormat("%s", (const byte *)getStringPtrByID(i->itemName)); // Difference
showMessageFormat("%s", (const byte *)getStringPtrByID(i->itemName, true));
}
void AGOSEngine_Elvira1::oe1_isCalled() {

View file

@ -468,7 +468,7 @@ void AGOSEngine_Elvira2::oe2_bNotZero() {
// 156: is bit set
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) {
bit = 50;
}

View file

@ -32,7 +32,7 @@ using Common::File;
namespace AGOS {
const byte *AGOSEngine::getStringPtrByID(uint16 stringId) {
const byte *AGOSEngine::getStringPtrByID(uint16 stringId, bool upperCase) {
const byte *string_ptr;
byte *dst;
@ -46,6 +46,12 @@ const byte *AGOSEngine::getStringPtrByID(uint16 stringId) {
dst = _stringReturnBuffer[_freeStringSlot];
strcpy((char *)dst, (const char *)string_ptr);
if (upperCase && *dst) {
if (islower(*dst))
*dst = toupper(*dst);
}
return dst;
}