Skip to content

Commit

Permalink
[SimpleButton] Use ARG_UNPACK in ::constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexp-sssup committed May 4, 2012
1 parent 35b1336 commit f1eda5b
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions src/scripting/flash/display/flashdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4382,27 +4382,20 @@ ASFUNCTIONBODY(SimpleButton,_constructor)
*/
InteractiveObject::_constructor(obj,NULL,0);
SimpleButton* th=static_cast<SimpleButton*>(obj);

if (argslen >= 1)
{
th->upState = _MNR(static_cast<DisplayObject*>(args[0]));
th->upState->incRef();
}
if (argslen >= 2)
{
th->overState = _MNR(static_cast<DisplayObject*>(args[1]));
th->overState->incRef();
}
if (argslen >= 3)
{
th->downState = _MNR(static_cast<DisplayObject*>(args[2]));
th->downState->incRef();
}
if (argslen == 4)
{
th->hitTestState = _MNR(static_cast<DisplayObject*>(args[3]));
th->hitTestState->incRef();
}
_NR<DisplayObject> upState;
_NR<DisplayObject> overState;
_NR<DisplayObject> downState;
_NR<DisplayObject> hitTestState;
ARG_UNPACK(upState, NullRef)(overState, NullRef)(downState, NullRef)(hitTestState, NullRef);

if (!upState.isNull())
th->upState = upState;
if (!overState.isNull())
th->overState = overState;
if (!downState.isNull())
th->downState = downState;
if (!hitTestState.isNull())
th->hitTestState = hitTestState;

th->reflectState();

Expand Down

0 comments on commit f1eda5b

Please sign in to comment.