diff mm7_2.cpp @ 2037:7a9477135943

Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous) Added custom pre-compile build step (.swig -> .cxx)
author Nomad
date Fri, 22 Nov 2013 10:34:22 +0200
parents cef3439340fa
children d4cc4d71d9cf 98a727563cc3
line wrap: on
line diff
--- a/mm7_2.cpp	Thu Nov 21 14:08:35 2013 +0200
+++ b/mm7_2.cpp	Fri Nov 22 10:34:22 2013 +0200
@@ -39,7 +39,7 @@
 #include "Events.h"
 #include "Viewport.h"
 #include "FrameTableInc.h"
-#include "Math.h"
+#include "OurMath.h"
 #include "SpriteObject.h"
 #include "ObjectList.h"
 #include "Chest.h"
@@ -71,9 +71,6 @@
 #include "lib/lua/lua.h"
 #include "TestClass.h"
 
-extern "C" int luaopen_test(lua_State* L); // declare the wrapped module
-extern "C" int luaopen_UIControl(lua_State* L); // declare the wrapped module
-
 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 +4307,9 @@
 bool new_speed = true;
 
 
+
+
+
 const char *GetScriptFileLocation(const char *script_name)
 {
   static char buf[2048];
@@ -4317,6 +4317,14 @@
   strcat(buf, script_name);
   return buf;
 }
+
+
+extern "C" int luaopen_UIControl(lua_State *L); // declare the wrapped module
+void LoadLuaSWIGLibraries(lua_State *L)
+{
+  luaopen_UIControl(L);
+}
+
 //----- (00462C94) --------------------------------------------------------
 bool MM_Main(const wchar_t *pCmdLine)
 {
@@ -4332,11 +4340,8 @@
   if ( luaL_dofile(L,GetScriptFileLocation("script.lua")))
     printf ( "Error opening script.lua\n" );
 
-  luaopen_test(L);    // load the wrappered module
-  if (luaL_dofile(L,GetScriptFileLocation("test.lua")))
-    printf("unable to load file\n");
-
-  luaopen_UIControl(L);    // load the wrappered module
+  LoadLuaSWIGLibraries(L);
+  
   if (luaL_dofile(L,GetScriptFileLocation("UIControl.lua")))
     printf("unable to load file\n");
   //lua_close(l);