mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-26 20:59:00 +00:00
DIRECTOR: LINGO: Add LC::readChunkRef
This commit is contained in:
parent
7f9137cbf8
commit
9c6165554f
@ -954,9 +954,7 @@ Datum LC::chunkRef(ChunkType type, int startChunk, int endChunk, const Datum &sr
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LC::c_of() {
|
Datum LC::readChunkRef(const Datum &src) {
|
||||||
// put char 5 of word 1 of line 2 into field "thing"
|
|
||||||
Datum src = g_lingo->pop();
|
|
||||||
Datum lastLine = g_lingo->pop();
|
Datum lastLine = g_lingo->pop();
|
||||||
Datum firstLine = g_lingo->pop();
|
Datum firstLine = g_lingo->pop();
|
||||||
Datum lastItem = g_lingo->pop();
|
Datum lastItem = g_lingo->pop();
|
||||||
@ -966,18 +964,22 @@ void LC::c_of() {
|
|||||||
Datum lastChar = g_lingo->pop();
|
Datum lastChar = g_lingo->pop();
|
||||||
Datum firstChar = g_lingo->pop();
|
Datum firstChar = g_lingo->pop();
|
||||||
|
|
||||||
Datum res = src;
|
|
||||||
|
|
||||||
if (firstChar.asInt() > 0)
|
if (firstChar.asInt() > 0)
|
||||||
res = LC::chunkRef(kChunkChar, firstChar.asInt(), lastChar.asInt(), src);
|
return LC::chunkRef(kChunkChar, firstChar.asInt(), lastChar.asInt(), src);
|
||||||
else if (firstWord.asInt() > 0)
|
if (firstWord.asInt() > 0)
|
||||||
res = LC::chunkRef(kChunkWord, firstWord.asInt(), lastWord.asInt(), src);
|
return LC::chunkRef(kChunkWord, firstWord.asInt(), lastWord.asInt(), src);
|
||||||
else if (firstItem.asInt() > 0)
|
if (firstItem.asInt() > 0)
|
||||||
res = LC::chunkRef(kChunkItem, firstItem.asInt(), lastItem.asInt(), src);
|
return LC::chunkRef(kChunkItem, firstItem.asInt(), lastItem.asInt(), src);
|
||||||
else if (lastLine.asInt() > 0)
|
if (lastLine.asInt() > 0)
|
||||||
res = LC::chunkRef(kChunkLine, firstLine.asInt(), lastLine.asInt(), src);
|
return LC::chunkRef(kChunkLine, firstLine.asInt(), lastLine.asInt(), src);
|
||||||
|
|
||||||
g_lingo->push(res);
|
return src;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LC::c_of() {
|
||||||
|
Datum src = g_lingo->pop();
|
||||||
|
Datum ref = readChunkRef(src);
|
||||||
|
g_lingo->push(ref.eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LC::c_charOf() {
|
void LC::c_charOf() {
|
||||||
|
@ -57,6 +57,7 @@ void c_starts();
|
|||||||
void c_intersects();
|
void c_intersects();
|
||||||
void c_within();
|
void c_within();
|
||||||
Datum chunkRef(ChunkType type, int startChunk, int endChunk, const Datum &src);
|
Datum chunkRef(ChunkType type, int startChunk, int endChunk, const Datum &src);
|
||||||
|
Datum readChunkRef(const Datum &src);
|
||||||
void c_of();
|
void c_of();
|
||||||
void c_charOf();
|
void c_charOf();
|
||||||
void c_charToOf();
|
void c_charToOf();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user