Skip to content

Commit

Permalink
Some turtle state changes should dirty TurtleSpace, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 27, 2007
1 parent 278503c commit 1bbe866
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/toby_app.c
Expand Up @@ -312,6 +312,8 @@ static void setTurtleAngle(lua_State *L, lua_Number angle)
while (angle < N(0)) angle += N(360);
turtle->angle = angle;
turtle->recalcPoints = 1;
if (turtle->visible)
turtleSpaceIsDirty = 1;
} /* if */
} /* setTurtleAngle */

Expand Down Expand Up @@ -535,15 +537,23 @@ static int luahook_setpencolor(lua_State *L)
static int luahook_showturtle(lua_State *L)
{
Turtle *turtle = getTurtle(L);
turtle->visible = 1;
if (!turtle->visible)
{
turtle->visible = 1;
turtleSpaceIsDirty = 1;
} /* if */
return 0;
} /* luahook_showturtle */


static int luahook_hideturtle(lua_State *L)
{
Turtle *turtle = getTurtle(L);
turtle->visible = 0;
if (turtle->visible)
{
turtle->visible = 0;
turtleSpaceIsDirty = 1;
} /* if */
return 0;
} /* luahook_hideturtle */

Expand Down

0 comments on commit 1bbe866

Please sign in to comment.