Commits

Laurens Rodriguez  committed a5c1616

Fixes for compiling merge (Lua only)

  • Participants
  • Parent commits 1d85ef8
  • Branches default

Comments (0)

Files changed (6)

File platform/msvc2008/love.vcproj

 					</File>
 				</Filter>
 			</Filter>
+			<Filter
+				Name="love"
+				>
+				<File
+					RelativePath="..\..\src\modules\love\love.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\..\src\modules\love\love.h"
+					>
+				</File>
+			</Filter>
 		</Filter>
 		<Filter
 			Name="common"
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\common\math.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\common\math.h"
 				>
 			</File>
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\common\Module.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\common\Module.h"
 				>
 			</File>
 			>
 		</File>
 		<File
-			RelativePath="..\..\src\launcher.cpp"
-			>
-		</File>
-		<File
 			RelativePath="..\..\src\love.cpp"
 			>
 			<FileConfiguration

File src/common/runtime.h

 // LOVE
 #include "types.h"
 
-// Lua
+// Script
 extern "C" {
 	#include "script.h"
 }

File src/common/script.h

 /**
-* Copyright (c) 2006-2012 LOVE Development Team
-*
-* This software is provided 'as-is', without any express or implied
-* warranty.  In no event will the authors be held liable for any damages
-* arising from the use of this software.
-*
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-*
-* 1. The origin of this software must not be misrepresented; you must not
-*    claim that you wrote the original software. If you use this software
-*    in a product, an acknowledgment in the product documentation would be
-*    appreciated but is not required.
-* 2. Altered source versions must be plainly marked as such, and must not be
-*    misrepresented as being the original software.
-* 3. This notice may not be removed or altered from any source distribution.
-**/
+ * Copyright (c) 2006-2012 LOVE Development Team
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty.  In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ **/
 
-#ifndef LOVE_SCRIPT_H
-#define LOVE_SCRIPT_H
+#ifndef LOVE_SCRIPT_H_
+#define LOVE_SCRIPT_H_
 
 #ifdef LOVE_USE_LUA
 
-#include <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
+    #include <lua.h>
+    #include <lualib.h>
+    #include <lauxlib.h>
 
-#if (LUA_VERSION_NUM > 501)
+    #if (LUA_VERSION_NUM > 501)
+    #   define luaL_reg          luaL_Reg
+    #   define luaL_putchar(B,c) luaL_addchar(B,c)
+    #   define lua_open          luaL_newstate
+    #endif // #if (LUA_VERSION_NUM > 501)
 
-#define luaL_reg	        luaL_Reg
-#define luaL_putchar(B,c)   luaL_addchar(B,c)
-#define lua_open            luaL_newstate
-
-#endif // #if (LUA_VERSION_NUM > 501)
 #endif // #ifdef LOVE_USE_LUA
 
 #ifdef LOVE_USE_KILLA
-
-#include <klua.h>
-
+    #include <klua.h>
 #endif // #ifdef LOVE_USE_KILLA
 
-#endif
+#endif // LOVE_SCRIPT_H_

File src/love.cpp

 #include <SDL.h>
 
 #ifdef LOVE_BUILD_EXE
-#ifdef LOVE_USE_LUA
-#else
-#include "scripts/boot.kia.h"
-#endif
 
-// Lua
+// Script
 extern "C" {
-	#include <lua.h>
-	#include <lualib.h>
-	#include <lauxlib.h>
-#else
-		lua_rawseti(L, -2, i + KILLA_BASE);
-#endif
+	#include "common/script.h"
 }
 
 #ifdef LOVE_WINDOWS
 }
 
 #endif // LOVE_LEGENDARY_UTF8_ARGV_HACK
-
+    
 #ifdef LOVE_LEGENDARY_LIBSTDCXX_HACK
 
 #include <iostream>
 int main(int argc, char **argv)
 {
 #ifdef LOVE_LEGENDARY_UTF8_ARGV_HACK
-	int hack_argc = 0;	char **hack_argv = 0;
+	int hack_argc = 0;
+    char **hack_argv = 0;
 	get_utf8_arguments(hack_argc, hack_argv);
 	argc = hack_argc;
 	argv = hack_argv;
 	lua_State *L = lua_open();
 	luaL_openlibs(L);
 
-	love_preload(L, luaopen_love, "love");
+    love_preload(L, luaopen_love, "love");
 
 	luaopen_love(L);
 

File src/modules/graphics/opengl/VertexBuffer.cpp

 #include <algorithm>
 #include <limits>
 
+#ifdef max
+#   undef max
+#endif
+
 namespace love
 {
 namespace graphics

File src/modules/love/love.cpp

 #include "libraries/luasocket/luasocket.h"
 
 // Scripts
+#ifdef LOVE_USE_LUA
 #include "scripts/boot.lua.h"
+#else
+#include "scripts/boot.kia.h"
+#endif
 
 // All modules define a c-accessible luaopen
 // so let's make use of those, instead
 	for (int i = 0; love::VERSION_COMPATIBILITY[i] != 0; ++i)
 	{
 		lua_pushstring(L, love::VERSION_COMPATIBILITY[i]);
+#ifdef LOVE_USE_LUA
 		lua_rawseti(L, -2, i+1);
+#else
+		lua_rawseti(L, -2, i + KILLA_BASE);
+#endif
 	}
 
 	lua_setfield(L, -2, "_version_compat");
 
 int luaopen_love_boot(lua_State *L)
 {
-	if (luaL_loadbuffer(L, (const char *)love::boot_lua, sizeof(love::boot_lua), "boot.lua") == 0)
+#ifdef LOVE_USE_LUA
+    if (luaL_loadbuffer(L, (const char *)love::boot_lua, sizeof(love::boot_lua), "boot.lua") == 0)
+#else
+    if (luaL_loadbuffer(L, (const char *)love::boot_kia, sizeof(love::boot_kia), "boot.kia") == 0)
+#endif
 	lua_call(L, 0, 1);
 	return 1;
 }