소스 검색

Delete LuaState.h

mikymod 12 년 전
부모
커밋
4a59f6fa10
1개의 변경된 파일0개의 추가작업 그리고 54개의 파일을 삭제
  1. 0 54
      src/LuaState.h

+ 0 - 54
src/LuaState.h

@@ -1,54 +0,0 @@
-#pragma once
-
-#include "lua.hpp"
-#include <iostream>
-
-namespace crown
-{
-class LuaState
-{
-public:
-
-		LuaState()
-		{
-			m_state = luaL_newstate();
-			luaL_openlibs(m_state);
-		}
-
-		~LuaState()
-		{
-			lua_close(m_state);
-		}
-
-		lua_State* state()
-		{
-			return m_state;
-		}
-
-		int load_program(const char* src)
-		{
-			return luaL_loadfile(m_state, src);
-		}
-
-private:
-
-	lua_State* m_state;
-
-};
-
-static int execute_program(lua_State* state)
-{
-	return lua_pcall(state, 0, LUA_MULTRET, 0);
-}
-
-static void report_errors(lua_State* state, const int status)
-{
-	if (status != 0)
-	{
-		std::cerr << "-- " << lua_tostring(state, -1) << std::endl;
-
-		lua_pop(state, 1);
-	}
-}
-
-} // namespace crown