[Scummvm-cvs-logs] SF.net SVN: scummvm:[35330] scummvm/trunk/engines/agos
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Sat Dec 13 08:38:38 CET 2008
Revision: 35330
http://scummvm.svn.sourceforge.net/scummvm/?rev=35330&view=rev
Author: Kirben
Date: 2008-12-13 07:38:37 +0000 (Sat, 13 Dec 2008)
Log Message:
-----------
Add upper case code for oe1_pcName() in Elvira 1/2.
Modified Paths:
--------------
scummvm/trunk/engines/agos/agos.h
scummvm/trunk/engines/agos/rooms.cpp
scummvm/trunk/engines/agos/script_e1.cpp
scummvm/trunk/engines/agos/script_e2.cpp
scummvm/trunk/engines/agos/string.cpp
Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h 2008-12-13 07:05:18 UTC (rev 35329)
+++ scummvm/trunk/engines/agos/agos.h 2008-12-13 07:38:37 UTC (rev 35330)
@@ -657,7 +657,7 @@
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();
Modified: scummvm/trunk/engines/agos/rooms.cpp
===================================================================
--- scummvm/trunk/engines/agos/rooms.cpp 2008-12-13 07:05:18 UTC (rev 35329)
+++ scummvm/trunk/engines/agos/rooms.cpp 2008-12-13 07:38:37 UTC (rev 35330)
@@ -241,7 +241,7 @@
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
Modified: scummvm/trunk/engines/agos/script_e1.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_e1.cpp 2008-12-13 07:05:18 UTC (rev 35329)
+++ scummvm/trunk/engines/agos/script_e1.cpp 2008-12-13 07:38:37 UTC (rev 35330)
@@ -592,7 +592,7 @@
}
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_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() {
Modified: scummvm/trunk/engines/agos/script_e2.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_e2.cpp 2008-12-13 07:05:18 UTC (rev 35329)
+++ scummvm/trunk/engines/agos/script_e2.cpp 2008-12-13 07:38:37 UTC (rev 35330)
@@ -468,7 +468,7 @@
// 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;
}
Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp 2008-12-13 07:05:18 UTC (rev 35329)
+++ scummvm/trunk/engines/agos/string.cpp 2008-12-13 07:38:37 UTC (rev 35330)
@@ -32,7 +32,7 @@
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 @@
dst = _stringReturnBuffer[_freeStringSlot];
strcpy((char *)dst, (const char *)string_ptr);
+
+ if (upperCase && *dst) {
+ if (islower(*dst))
+ *dst = toupper(*dst);
+ }
+
return dst;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list