Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 committed Jul 21, 2024
1 parent c048a3f commit 9938f2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
15 changes: 8 additions & 7 deletions source/CScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ namespace CLEO
bool isGlobalIndex = arrayType >> 7; // is high bit set

if (elementType == ADT_POP) {
*outArrElemIdx = GetInstance().StackPop();
return;
*outArrElemIdx = GetInstance().StackPop();
return;
}

if (isGlobalIndex) {
Expand Down Expand Up @@ -429,7 +429,7 @@ namespace CLEO
break;
case DT_POP:
opcodeParams[i].dwParam = GetInstance().StackPop();
break;
break;
}
}
}
Expand Down Expand Up @@ -475,8 +475,8 @@ namespace CLEO
*GetPointerToLocalVariable(script, arrVarOffset + arrElemIdx) = opcodeParams[i];
break;
case DT_PUSH:
GetInstance().StackPush(opcodeParams[i].dwParam);
break;
GetInstance().StackPush(opcodeParams[i].dwParam);
break;
}
}
}
Expand Down Expand Up @@ -618,10 +618,11 @@ namespace CLEO
}
case DT_PUSH:
{
GetInstance().StackPush(0); // allocate space for the variable
return reinterpret_cast<SCRIPT_VAR*>(&GetInstance().CleoStack.top());
GetInstance().StackPush(0); // allocate space for the variable
return reinterpret_cast<SCRIPT_VAR*>(&GetInstance().CleoStack.top());
}
case DT_POP:
// todo: does not work, value should be popped from stack
return reinterpret_cast<SCRIPT_VAR*>(&GetInstance().CleoStack.top());
}
}
Expand Down
5 changes: 2 additions & 3 deletions source/CleoBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,16 @@ namespace CLEO
FindClose(hSearch);

return CreateStringList(found);

}

void CCleoInstance::StackPush(int val) {
GetInstance().CleoStack.push(val);
GetInstance().CleoStack.push(val);
}

int CCleoInstance::StackPop() {
int val = GetInstance().CleoStack.top();
GetInstance().CleoStack.pop();
return val;
return val;
}
}

2 changes: 1 addition & 1 deletion source/CleoBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace CLEO
CModuleSystem ModuleSystem;
CPluginSystem PluginSystem;
OpcodeInfoDatabase OpcodeInfoDb;
std::stack<int> CleoStack;
std::stack<int> CleoStack;

int saveSlot = -1; // -1 if not loaded from save

Expand Down

0 comments on commit 9938f2f

Please sign in to comment.