fixed some bugs related to string handling

svn-id: r3445
This commit is contained in:
Ludvig Strigeus 2001-10-24 20:12:52 +00:00
parent 61c7eccfd7
commit f9daf35824
6 changed files with 34 additions and 6 deletions

View file

@ -17,6 +17,9 @@
*
* Change Log:
* $Log$
* Revision 1.6 2001/10/24 20:12:52 strigeus
* fixed some bugs related to string handling
*
* Revision 1.5 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
@ -575,6 +578,16 @@ byte *Scumm::getResourceAddress(int type, int index) {
return ptr + sizeof(ResHeader);
}
byte *Scumm::getStringAddress(int i) {
byte *b = getResourceAddress(7, i);
if (!b)
return b;
if (_majorScummVersion==6)
return ((ArrayHeader*)b)->data;
return b;
}
void Scumm::setResourceFlags(int type, int index, byte flag) {
res.flags[type][index] &= 0x80;
res.flags[type][index] |= flag;

View file

@ -17,6 +17,9 @@
*
* Change Log:
* $Log$
* Revision 1.3 2001/10/24 20:12:52 strigeus
* fixed some bugs related to string handling
*
* Revision 1.2 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
@ -1557,7 +1560,7 @@ void Scumm::o6_verbOps() {
if (a==0) {
ptr = (byte*)"";
} else {
ptr = getResourceAddress(7, a);
ptr = getStringAddress(a);
}
loadPtrToResource(8, slot, ptr);
vs->type = 0;

View file

@ -17,6 +17,9 @@
*
* Change Log:
* $Log$
* Revision 1.13 2001/10/24 20:12:52 strigeus
* fixed some bugs related to string handling
*
* Revision 1.12 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
@ -521,6 +524,7 @@ enum GameId {
GID_MONKEY2 = 2,
GID_INDY4 = 3,
GID_MONKEY = 4,
GID_SAMNMAX = 5,
};
struct ScummDebugger;
@ -940,6 +944,7 @@ struct Scumm {
void nukeResource(int type, int i);
byte *getResourceAddress(int type, int i);
byte *getStringAddress(int i);
void ensureResourceLoaded(int type, int i);
int loadResource(int type, int i);
int getResourceRoomNr(int type, int index);

View file

@ -17,6 +17,9 @@
*
* Change Log:
* $Log$
* Revision 1.12 2001/10/24 20:12:52 strigeus
* fixed some bugs related to string handling
*
* Revision 1.11 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
@ -443,6 +446,7 @@ static const VersionSettings version_settings[] = {
{"atlantis", "Indiana Jones 4 and the Fate of Atlantis", GID_INDY4, 5, 5, 0},
{"fate", "Indiana Jones 4 and the Fate of Atlantis (Demo)", GID_INDY4, 5, 5, 0},
{"tentacle", "Day Of The Tenctacle", GID_TENTACLE, 6, 4, 2},
{"samnmax", "Sam & Max", GID_SAMNMAX, 6, 4, 2},
{NULL,NULL}
};

View file

@ -136,10 +136,6 @@ SOURCE=.\scummvm.cpp
# End Source File
# Begin Source File
SOURCE=.\sdl.cpp
# End Source File
# Begin Source File
SOURCE=.\sound.cpp
# End Source File
# Begin Source File

View file

@ -17,6 +17,9 @@
*
* Change Log:
* $Log$
* Revision 1.4 2001/10/24 20:12:52 strigeus
* fixed some bugs related to string handling
*
* Revision 1.3 2001/10/23 19:51:50 strigeus
* recompile not needed when switching games
* debugger skeleton implemented
@ -568,8 +571,12 @@ void Scumm::unkAddMsgToStack4(int var) {
void Scumm::unkAddMsgToStack5(int var) {
byte *ptr;
if (_majorScummVersion==6)
var = readVar(var);
if (var) {
ptr = getResourceAddress(7, var);
ptr = getStringAddress(var);
if (ptr) {
addMessageToStack(ptr);
return;