mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
SLUDGE: Move stack size getter to struct StackHandler
This commit is contained in:
parent
80478ee470
commit
fa72209845
@ -166,7 +166,7 @@ bool blur_createSettings(int numParams, VariableStack *&stack) {
|
||||
error = "Third and subsequent parameters in setBackgroundEffect should be arrays";
|
||||
break;
|
||||
} else {
|
||||
int w = stackSize(justToCheckSizes->thisVar.varData.theStack);
|
||||
int w = justToCheckSizes->thisVar.varData.theStack->getStackSize();
|
||||
if (a) {
|
||||
if (w != width) {
|
||||
error = "Arrays in setBackgroundEffect must be the same size";
|
||||
|
@ -527,7 +527,7 @@ builtIn(stackSize) {
|
||||
switch (fun->stack->thisVar.varType) {
|
||||
case SVT_STACK:
|
||||
// Return value
|
||||
fun->reg.setVariable(SVT_INT, stackSize(fun->stack->thisVar.varData.theStack));
|
||||
fun->reg.setVariable(SVT_INT, fun->stack->thisVar.varData.theStack->getStackSize());
|
||||
trimStack(fun->stack);
|
||||
return BR_CONTINUE;
|
||||
|
||||
|
@ -134,9 +134,9 @@ Persona *Variable::getCostumeFromVar() {
|
||||
return p;
|
||||
}
|
||||
|
||||
int stackSize(const StackHandler *me) {
|
||||
int StackHandler::getStackSize() const {
|
||||
int r = 0;
|
||||
VariableStack *a = me->first;
|
||||
VariableStack *a = first;
|
||||
while (a) {
|
||||
r++;
|
||||
a = a->next;
|
||||
@ -403,7 +403,7 @@ bool Variable::makeFastArraySize(int size) {
|
||||
}
|
||||
|
||||
bool Variable::makeFastArrayFromStack(const StackHandler *stacky) {
|
||||
int size = stackSize(stacky);
|
||||
int size = stacky->getStackSize();
|
||||
if (!makeFastArraySize(size))
|
||||
return false;
|
||||
|
||||
|
@ -56,6 +56,8 @@ struct StackHandler {
|
||||
struct VariableStack *first;
|
||||
struct VariableStack *last;
|
||||
int timesUsed;
|
||||
|
||||
int getStackSize() const;
|
||||
};
|
||||
|
||||
union VariableData {
|
||||
@ -135,7 +137,6 @@ bool addVarToStack(const Variable &va, VariableStack *&thisStack);
|
||||
bool addVarToStackQuick(Variable &va, VariableStack *&thisStack);
|
||||
void trimStack(VariableStack *&stack);
|
||||
int deleteVarFromStack(const Variable &va, VariableStack *&thisStack, bool allOfEm = false);
|
||||
int stackSize(const StackHandler *me);
|
||||
bool getSavedGamesStack(StackHandler *sH, const Common::String &ext);
|
||||
|
||||
// load & save
|
||||
|
Loading…
Reference in New Issue
Block a user