Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/script_engine/OLD/RestoreStack.cc @ 8061

Last change on this file since 8061 was 8061, checked in by bensch, 18 years ago

merged the scriptengine back to the trunk

File size: 1.0 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: ...
13   co-programmer: ...
14*/
15
16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
17
18#include "RestoreStack.h"
19#include "luaincl.h"
20
21namespace OrxScript
22{
23
24  /**
25   * @brief Stores the stack and the index to the top element
26   *
27   * @param virtualMachine the virtual machine to save
28   */
29  LuaRestoreStack::LuaRestoreStack (LuaVirtualMachine& virtualMachine) : savedState (NULL)
30  {
31    savedState = (lua_State *) virtualMachine;
32    if (virtualMachine.isOk ())
33    {
34      savedTopIndex = lua_gettop (savedState);
35    }
36  }
37  /**
38  * @brief Restores the virtual machine
39  *
40  *
41  */
42  LuaRestoreStack::~LuaRestoreStack ()
43  {
44    lua_settop (savedState, savedTopIndex);
45  }
46}
Note: See TracBrowser for help on using the repository browser.