get rid of getStringLen and use the more powerful resStrLen instead; moved resStrLen from common/ to scumm/, where it belongs; enhanced resStrLen to suport V8; fixed translateText to support embeded vars (in strings I mean) - it may still not be fully correct but at least is better now; rewrote o6_arrayOps to parallel the V8 version - needs testing
svn-id: r6215
This commit is contained in:
parent
319facc9c3
commit
ae5b30df3d
9 changed files with 82 additions and 168 deletions
|
@ -133,31 +133,6 @@ void hexdump(const byte * data, int len)
|
|||
printf("|\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Given a pointer to a Scumm resource, this function returns the length
|
||||
// of the (string) data in that resource. To do so it understands certain
|
||||
// special chars starting with FF. The reason for this function is that
|
||||
// sometimes resource data will contain 0 bytes, thus we can't just use strlen.
|
||||
//
|
||||
int resStrLen(const char *src)
|
||||
{
|
||||
int num = 0;
|
||||
byte chr;
|
||||
while ((chr = *src++) != 0) {
|
||||
num++;
|
||||
if (chr == 255) {
|
||||
chr = *src++;
|
||||
num++;
|
||||
|
||||
if (chr != 1 && chr != 2 && chr != 3 && chr != 8) {
|
||||
src += 2;
|
||||
num += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
RandomSource::RandomSource(uint32 seed)
|
||||
{
|
||||
_randSeed = seed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue