mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 11:51:52 +00:00
DIRECTOR: Add changes from code review
This commit is contained in:
parent
2674b628c4
commit
689d08a396
@ -673,15 +673,15 @@ void LB::b_deleteAt(int nargs) {
|
||||
}
|
||||
|
||||
void LB::b_deleteOne(int nargs) {
|
||||
Datum indexD = g_lingo->pop();
|
||||
Datum val = g_lingo->pop();
|
||||
Datum list = g_lingo->pop();
|
||||
TYPECHECK3(indexD, INT, FLOAT, SYMBOL);
|
||||
TYPECHECK3(val, INT, FLOAT, SYMBOL);
|
||||
TYPECHECK2(list, ARRAY, PARRAY);
|
||||
|
||||
switch (list.type) {
|
||||
case ARRAY: {
|
||||
g_lingo->push(list);
|
||||
g_lingo->push(indexD);
|
||||
g_lingo->push(val);
|
||||
b_getPos(nargs);
|
||||
int index = g_lingo->pop().asInt();
|
||||
if (index > 0) {
|
||||
@ -691,7 +691,7 @@ void LB::b_deleteOne(int nargs) {
|
||||
}
|
||||
case PARRAY: {
|
||||
Datum d;
|
||||
int index = LC::compareArrays(LC::eqData, list, indexD, true, true).u.i;
|
||||
int index = LC::compareArrays(LC::eqData, list, val, true, true).u.i;
|
||||
if (index > 0) {
|
||||
list.u.parr->arr.remove_at(index - 1);
|
||||
}
|
||||
|
@ -292,12 +292,17 @@ struct LingoArchive {
|
||||
};
|
||||
|
||||
struct LingoState {
|
||||
Common::Array<CFrame *> callstack;
|
||||
uint pc = 0;
|
||||
ScriptData *script = nullptr;
|
||||
ScriptContext *context = nullptr;
|
||||
DatumHash *localVars = nullptr;
|
||||
Datum me;
|
||||
// Execution state for a Lingo process, created every time
|
||||
// a top-level handler is called (e.g. on mouseDown).
|
||||
// Can be swapped out when another script gets called with priority.
|
||||
// Call frames are pushed and popped from the callstack with
|
||||
// pushContext and popContext.
|
||||
Common::Array<CFrame *> callstack; // call stack
|
||||
uint pc = 0; // current program counter
|
||||
ScriptData *script = nullptr; // current Lingo script
|
||||
ScriptContext *context = nullptr; // current Lingo script context
|
||||
DatumHash *localVars = nullptr; // current local variables
|
||||
Datum me; // current me object
|
||||
|
||||
~LingoState();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user