changeset 2031:e21db9518295

Lua included
author Ritor1
date Mon, 18 Nov 2013 20:17:24 +0600
parents 3fa489e0a3f2
children b9e11e88b157
files lib/lua/lua.h mm7_2.cpp
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/lua/lua.h	Sun Nov 17 23:46:35 2013 +0600
+++ b/lib/lua/lua.h	Mon Nov 18 20:17:24 2013 +0600
@@ -2,5 +2,7 @@
 
 extern "C"
 {
-  #include "lua-5.2.2/lua.hpp"
+  #include "lua-5.2.2/lua.h"
+  #include "lua-5.2.2/lualib.h"
+  #include "lua-5.2.2/lauxlib.h"
 }
\ No newline at end of file
--- a/mm7_2.cpp	Sun Nov 17 23:46:35 2013 +0600
+++ b/mm7_2.cpp	Mon Nov 18 20:17:24 2013 +0600
@@ -68,6 +68,8 @@
 #include "NewUI/MainMenu.h"
 #include "Level/Decoration.h"
 
+#include "lib/lua/lua.h"
+
 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam);
 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4);
 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive);
@@ -4310,6 +4312,14 @@
   char test[1024];
   sprintfex(test, "^Pi[%s]: знахар^R[ь;ка;]", "Золтан");
 
+  lua_State *l = luaL_newstate();
+  if ( l == NULL )
+    printf ( "Error creating Lua context.\n" );
+  luaL_openlibs(l);
+  if ( luaL_dofile(l,"lua_scripts/script.lua"))
+    printf ( "Error opening script.lua\n" );
+  lua_close(l);
+
   bool bNoMargareth = false;
   if (pCmdLine && *pCmdLine)
   {