Bladeren bron

Merge branch 'master' of github.com:bitshifter/Polycode

Conflicts:
	Modules/Contents/2DPhysics/CMakeLists.txt
	Modules/Contents/3DPhysics/CMakeLists.txt
Cameron Hart 14 jaren geleden
bovenliggende
commit
5a9a062206

+ 1 - 0
.gitignore

@@ -6,6 +6,7 @@
 *.la
 *.dylib
 *.so
+*.pyc
 *.pbxuser
 *.mode1v3
 *.swp

+ 3 - 0
Bindings/CMakeLists.txt

@@ -0,0 +1,3 @@
+ADD_SUBDIRECTORY(Scripts/create_lua_library)
+ADD_SUBDIRECTORY(Contents/LUA)
+

+ 2 - 2
Bindings/Contents/LUA/API/Polycode/Renderer.lua

@@ -380,8 +380,8 @@ function Renderer:clearLights()
 	local retVal =  Polycore.Renderer_clearLights(self.__ptr)
 end
 
-function Renderer:addLight(position, direction, type, color, specularColor, constantAttenuation, linearAttenuation, quadraticAttenuation, intensity, spotlightCutoff, spotlightExponent, shadowsEnabled, textureMatrix, shadowMapTexture)
-	local retVal = Polycore.Renderer_addLight(self.__ptr, position.__ptr, direction.__ptr, type, color.__ptr, specularColor.__ptr, constantAttenuation, linearAttenuation, quadraticAttenuation, intensity, spotlightCutoff, spotlightExponent, shadowsEnabled, textureMatrix.__ptr, shadowMapTexture.__ptr)
+function Renderer:addLight(lightImportance, position, direction, type, color, specularColor, constantAttenuation, linearAttenuation, quadraticAttenuation, intensity, spotlightCutoff, spotlightExponent, shadowsEnabled, textureMatrix, shadowMapTexture)
+	local retVal = Polycore.Renderer_addLight(self.__ptr, lightImportance, position.__ptr, direction.__ptr, type, color.__ptr, specularColor.__ptr, constantAttenuation, linearAttenuation, quadraticAttenuation, intensity, spotlightCutoff, spotlightExponent, shadowsEnabled, textureMatrix.__ptr, shadowMapTexture.__ptr)
 end
 
 function Renderer:setExposureLevel(level)

+ 9 - 0
Bindings/Contents/LUA/API/Polycode/SceneLight.lua

@@ -167,6 +167,15 @@ function SceneLight:enableDebugDraw(val)
 	local retVal = Polycore.SceneLight_enableDebugDraw(self.__ptr, val)
 end
 
+function SceneLight:setLightImportance(newImportance)
+	local retVal = Polycore.SceneLight_setLightImportance(self.__ptr, newImportance)
+end
+
+function SceneLight:getLightImportance()
+	local retVal =  Polycore.SceneLight_getLightImportance(self.__ptr)
+	return retVal
+end
+
 
 
 function SceneLight:__delete()

+ 7 - 5
Bindings/Contents/CMakeLists.txt → Bindings/Contents/LUA/CMakeLists.txt

@@ -1,19 +1,20 @@
 INCLUDE(PolycodeIncludes)
 
 FIND_PACKAGE(Lua51 REQUIRED)
+
 INCLUDE_DIRECTORIES(
     ${LUA_INCLUDE_DIR}
-    LUA/Include
+    Include
 )
 
 SET(polycodeLua_SRCS
-    LUA/Source/PolycodeLUA.cpp
+    Source/PolycodeLUA.cpp
 )
 
 SET(polycodeLua_HDRS
-    LUA/Include/PolycodeLUAWrappers.h
-    LUA/Include/PolycodeLUA.h
-    LUA/Include/PolycodeLUA2D.h
+    Include/PolycodeLUAWrappers.h
+    Include/PolycodeLUA.h
+    Include/PolycodeLUA2D.h
 )
 
 SET(CMAKE_DEBUG_POSTFIX "_d")
@@ -25,6 +26,7 @@ SET(CMAKE_DEBUG_POSTFIX "_d")
 
 #IF(POLYCODE_BUILD_STATIC)
 ADD_LIBRARY(PolycodeLua ${polycodeLua_SRCS} ${polycodeLua_HDRS})
+ADD_DEPENDENCIES(PolycodeLua PolycodeLuaGenerate)
 #ENDIF(POLYCODE_BUILD_STATIC)
 
 IF(POLYCODE_INSTALL_FRAMEWORK)

+ 43 - 25
Bindings/Contents/LUA/Include/PolycodeLUAWrappers.h

@@ -1292,10 +1292,10 @@ static int Polycore_Renderer_setClippingPlanes(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
 	Renderer *inst = (Renderer*)lua_topointer(L, 1);
 	luaL_checktype(L, 2, LUA_TNUMBER);
-	Number near_ = lua_tonumber(L, 2);
+	Number near = lua_tonumber(L, 2);
 	luaL_checktype(L, 3, LUA_TNUMBER);
-	Number far_ = lua_tonumber(L, 3);
-	inst->setClippingPlanes(near_, far_);
+	Number far = lua_tonumber(L, 3);
+	inst->setClippingPlanes(near, far);
 	return 0;
 }
 
@@ -1399,35 +1399,37 @@ static int Polycore_Renderer_clearLights(lua_State *L) {
 static int Polycore_Renderer_addLight(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
 	Renderer *inst = (Renderer*)lua_topointer(L, 1);
-	luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
-	Vector3 position = *(Vector3*)lua_topointer(L, 2);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int lightImportance = lua_tointeger(L, 2);
 	luaL_checktype(L, 3, LUA_TLIGHTUSERDATA);
-	Vector3 direction = *(Vector3*)lua_topointer(L, 3);
-	luaL_checktype(L, 4, LUA_TNUMBER);
-	int type = lua_tointeger(L, 4);
-	luaL_checktype(L, 5, LUA_TLIGHTUSERDATA);
-	Color color = *(Color*)lua_topointer(L, 5);
+	Vector3 position = *(Vector3*)lua_topointer(L, 3);
+	luaL_checktype(L, 4, LUA_TLIGHTUSERDATA);
+	Vector3 direction = *(Vector3*)lua_topointer(L, 4);
+	luaL_checktype(L, 5, LUA_TNUMBER);
+	int type = lua_tointeger(L, 5);
 	luaL_checktype(L, 6, LUA_TLIGHTUSERDATA);
-	Color specularColor = *(Color*)lua_topointer(L, 6);
-	luaL_checktype(L, 7, LUA_TNUMBER);
-	Number constantAttenuation = lua_tonumber(L, 7);
+	Color color = *(Color*)lua_topointer(L, 6);
+	luaL_checktype(L, 7, LUA_TLIGHTUSERDATA);
+	Color specularColor = *(Color*)lua_topointer(L, 7);
 	luaL_checktype(L, 8, LUA_TNUMBER);
-	Number linearAttenuation = lua_tonumber(L, 8);
+	Number constantAttenuation = lua_tonumber(L, 8);
 	luaL_checktype(L, 9, LUA_TNUMBER);
-	Number quadraticAttenuation = lua_tonumber(L, 9);
+	Number linearAttenuation = lua_tonumber(L, 9);
 	luaL_checktype(L, 10, LUA_TNUMBER);
-	Number intensity = lua_tonumber(L, 10);
+	Number quadraticAttenuation = lua_tonumber(L, 10);
 	luaL_checktype(L, 11, LUA_TNUMBER);
-	Number spotlightCutoff = lua_tonumber(L, 11);
+	Number intensity = lua_tonumber(L, 11);
 	luaL_checktype(L, 12, LUA_TNUMBER);
-	Number spotlightExponent = lua_tonumber(L, 12);
-	luaL_checktype(L, 13, LUA_TBOOLEAN);
-	bool shadowsEnabled = lua_toboolean(L, 13);
-	luaL_checktype(L, 14, LUA_TLIGHTUSERDATA);
-	Matrix4 * textureMatrix = (Matrix4 *)lua_topointer(L, 14);
+	Number spotlightCutoff = lua_tonumber(L, 12);
+	luaL_checktype(L, 13, LUA_TNUMBER);
+	Number spotlightExponent = lua_tonumber(L, 13);
+	luaL_checktype(L, 14, LUA_TBOOLEAN);
+	bool shadowsEnabled = lua_toboolean(L, 14);
 	luaL_checktype(L, 15, LUA_TLIGHTUSERDATA);
-	Texture * shadowMapTexture = (Texture *)lua_topointer(L, 15);
-	inst->addLight(position, direction, type, color, specularColor, constantAttenuation, linearAttenuation, quadraticAttenuation, intensity, spotlightCutoff, spotlightExponent, shadowsEnabled, textureMatrix, shadowMapTexture);
+	Matrix4 * textureMatrix = (Matrix4 *)lua_topointer(L, 15);
+	luaL_checktype(L, 16, LUA_TLIGHTUSERDATA);
+	Texture * shadowMapTexture = (Texture *)lua_topointer(L, 16);
+	inst->addLight(lightImportance, position, direction, type, color, specularColor, constantAttenuation, linearAttenuation, quadraticAttenuation, intensity, spotlightCutoff, spotlightExponent, shadowsEnabled, textureMatrix, shadowMapTexture);
 	return 0;
 }
 
@@ -10856,7 +10858,7 @@ static int Polycore_SceneLight_setLightColor(lua_State *L) {
 	if(lua_isnumber(L, 5)) {
 		a = lua_tonumber(L, 5);
 	} else {
-		a = 1;
+		a = 1.0;
 	}
 	inst->setLightColor(r, g, b, a);
 	return 0;
@@ -10934,6 +10936,22 @@ static int Polycore_SceneLight_enableDebugDraw(lua_State *L) {
 	return 0;
 }
 
+static int Polycore_SceneLight_setLightImportance(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	luaL_checktype(L, 2, LUA_TNUMBER);
+	int newImportance = lua_tointeger(L, 2);
+	inst->setLightImportance(newImportance);
+	return 0;
+}
+
+static int Polycore_SceneLight_getLightImportance(lua_State *L) {
+	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);
+	lua_pushinteger(L, inst->getLightImportance());
+	return 1;
+}
+
 static int Polycore_delete_SceneLight(lua_State *L) {
 	luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
 	SceneLight *inst = (SceneLight*)lua_topointer(L, 1);

+ 2 - 0
Bindings/Contents/LUA/Source/PolycodeLUA.cpp

@@ -1169,6 +1169,8 @@ int luaopen_Polycode(lua_State *L) {
 		{"SceneLight_areShadowsEnabled", Polycore_SceneLight_areShadowsEnabled},
 		{"SceneLight_getLightType", Polycore_SceneLight_getLightType},
 		{"SceneLight_enableDebugDraw", Polycore_SceneLight_enableDebugDraw},
+		{"SceneLight_setLightImportance", Polycore_SceneLight_setLightImportance},
+		{"SceneLight_getLightImportance", Polycore_SceneLight_getLightImportance},
 		{"delete_SceneLight", Polycore_delete_SceneLight},
 		{NULL, NULL}
 	};

+ 18 - 0
Bindings/Scripts/create_lua_library/CMakeLists.txt

@@ -0,0 +1,18 @@
+INCLUDE(FindPythonModule)
+
+FIND_PACKAGE(PythonInterp REQUIRED)
+FIND_PYTHON_MODULE(ply REQUIRED)
+IF(NOT PY_PLY)
+	MESSAGE(SEND_ERROR "The Python PLY (Python Lex-Yacc) module is required to generate Lua bindings.")
+ENDIF(NOT PY_PLY)
+
+ADD_CUSTOM_TARGET(PolycodeLuaGenerate
+    ${PYTHON_EXECUTABLE} create_lua_library.py ../../../Core/Contents/Include Polycode Polycode.h polycore Polycore ../../Contents/LUA/API ../../Contents/LUA/API/Polycode ../../Contents/LUA/Include ../../Contents/LUA/Source
+	${PYTHON_EXECUTABLE} create_lua_library.py ../../../Modules/Contents/2DPhysics/Include/ Physics2D Polycode2DPhysics.h physics2d Physics2D ../../../Modules/Bindings/2DPhysics/API ../../../Modules/Bindings/2DPhysics/API/Physics2D ../../../Modules/Bindings/2DPhysics/Include ../../../Modules/Bindings/2DPhysics/Source
+	${PYTHON_EXECUTABLE} create_lua_library.py ../../../Modules/Contents/3DPhysics/Include/ Physics3D Polycode3DPhysics.h physics3d Physics3D ../../../Modules/Bindings/3DPhysics/API ../../../Modules/Bindings/3DPhysics/API/Physics3D ../../../Modules/Bindings/3DPhysics/Include ../../../Modules/Bindings/3DPhysics/Source
+	DEPENDS Polycore
+	COMMENT "Generating Lua API"
+	WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+	SOURCES create_lua_library.py
+)
+

BIN
Bindings/Scripts/create_lua_library/CppHeaderParser.pyc


+ 4 - 3
Bindings/Scripts/create_lua_library/create_lua_library.py

@@ -1,7 +1,7 @@
 import sys
 import CppHeaderParser
 import os
-
+import re
 
 def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, apiPath, apiClassPath, includePath, sourcePath):	
 	out = ""
@@ -261,9 +261,10 @@ def createLUABindings(inputPath, prefix, mainInclude, libSmallName, libName, api
 	
 									if "defaltValue" in param:
 										if checkfunc != "lua_islightuserdata" or (checkfunc == "lua_islightuserdata" and param["defaltValue"] == "NULL"):
-											param["defaltValue"] = param["defaltValue"].replace(" 0f", ".0f")
+											#param["defaltValue"] = param["defaltValue"].replace(" 0f", ".0f")
 											param["defaltValue"] = param["defaltValue"].replace(": :", "::")
-											param["defaltValue"] = param["defaltValue"].replace("0 ", "0.")
+											#param["defaltValue"] = param["defaltValue"].replace("0 ", "0.")
+											param["defaltValue"] = re.sub(r'([0-9]+) ([0-9])+', r'\1.\2', param["defaltValue"])
 	
 											out += "\t%s %s;\n" % (param["type"], param["name"])
 											out += "\tif(%s(L, %d)) {\n" % (checkfunc, idx)

+ 6 - 0
CMake/ExternalAssimp.cmake

@@ -12,6 +12,12 @@ SET(assimp_CMAKE_ARGS
     -DBUILD_TESTS=OFF
 )
 
+IF(APPLE)
+    # Work around a compiler crash building assimp on Mac
+    STRING(REPLACE "-O3" "-O2" assimp_CXX_FLAGS ${CMAKE_CXX_FLAGS_RELEASE})
+    LIST(APPEND assimp_CMAKE_ARGS -DCMAKE_CXX_FLAGS_RELEASE=${assimp_CXX_FLAGS})
+ENDIF(APPLE)
+
 ExternalProject_Add(assimp
     PREFIX ${assimp_PREFIX}
 

+ 25 - 0
CMake/FindPythonModule.cmake

@@ -0,0 +1,25 @@
+# Find if a Python module is installed
+# Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html
+# To use do: find_python_module(PyQt4 REQUIRED)
+function(find_python_module module)
+	string(TOUPPER ${module} module_upper)
+	if(NOT PY_${module_upper})
+		if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
+			set(${module}_FIND_REQUIRED TRUE)
+		endif()
+		# A module's location is usually a directory, but for binary modules
+		# it's a .so file.
+		execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" 
+			"import re, ${module}; print re.compile('/__init__.py.*').sub('',${module}.__file__)"
+			RESULT_VARIABLE _${module}_status 
+			OUTPUT_VARIABLE _${module}_location
+			ERROR_QUIET 
+			OUTPUT_STRIP_TRAILING_WHITESPACE)
+		if(NOT _${module}_status)
+			set(PY_${module_upper} ${_${module}_location} CACHE STRING 
+				"Location of Python module ${module}")
+		endif(NOT _${module}_status)
+	endif(NOT PY_${module_upper})
+	find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper})
+endfunction(find_python_module)
+

+ 1 - 1
CMakeLists.txt

@@ -48,7 +48,7 @@ ADD_SUBDIRECTORY(Core/Contents)
 ADD_SUBDIRECTORY("Assets/Default asset pack")
 
 IF(POLYCODE_BUILD_BINDINGS)
-    ADD_SUBDIRECTORY(Bindings/Contents)
+    ADD_SUBDIRECTORY(Bindings)
 ENDIF(POLYCODE_BUILD_BINDINGS)
 
 IF(POLYCODE_BUILD_EXAMPLES)

+ 5 - 3
Core/Contents/CMakeLists.txt

@@ -245,7 +245,9 @@ IF(POLYCODE_INSTALL_PLAYER)
 #    IF(POLYCODE_BUILD_SHARED)
 #        INSTALL(TARGETS Polycore_dynamic DESTINATION ${POLYCODE_RELEASE_DIR}/Player)
 #    END(POLYCODE_BUILD_SHARED)
-    
-    INSTALL(DIRECTORY ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/bin/ 
-        DESTINATION ${POLYCODE_RELEASE_DIR}/Player)
+
+    IF(MSVC)    
+        INSTALL(DIRECTORY ${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies/bin/ 
+            DESTINATION ${POLYCODE_RELEASE_DIR}/Player)
+    ENDIF(MSVC)
 ENDIF(POLYCODE_INSTALL_PLAYER)

+ 10 - 2
Core/Contents/Include/PolyRenderer.h

@@ -54,13 +54,20 @@ namespace Polycode {
 			bool shadowsEnabled;
 			Matrix4 textureMatrix;
 			Texture* shadowMapTexture;
+			int lightImportance;
 	};
 
 	class _PolyExport LightSorter {
 		public:
 			Vector3 basePosition;
 			Matrix4 cameraMatrix;
-			bool operator() (LightInfo i,LightInfo j) { return ((cameraMatrix*i.position).distance(basePosition)<(cameraMatrix*j.position).distance(basePosition));}
+			bool operator() (LightInfo i,LightInfo j) {
+				if(i.lightImportance > j.lightImportance)
+					return true;
+				if(i.lightImportance == j.lightImportance)
+					return ((cameraMatrix*i.position).distance(basePosition)<(cameraMatrix*j.position).distance(basePosition));
+				return false; 
+			}
 	};
 
 	/**
@@ -177,7 +184,7 @@ namespace Polycode {
 		virtual void cullFrontFaces(bool val) = 0;
 		
 		void clearLights();
-		void addLight(Vector3 position, Vector3 direction, int type, Color color, Color specularColor, Number constantAttenuation, Number linearAttenuation, Number quadraticAttenuation, Number intensity, Number spotlightCutoff, Number spotlightExponent, bool shadowsEnabled, Matrix4 *textureMatrix, Texture *shadowMapTexture);
+		void addLight(int lightImportance, Vector3 position, Vector3 direction, int type, Color color, Color specularColor, Number constantAttenuation, Number linearAttenuation, Number quadraticAttenuation, Number intensity, Number spotlightCutoff, Number spotlightExponent, bool shadowsEnabled, Matrix4 *textureMatrix, Texture *shadowMapTexture);
 		
 		void setExposureLevel(Number level);
 		
@@ -231,6 +238,7 @@ namespace Polycode {
 		vector<LightInfo> getSpotLights() { return spotLights;	}
 		
 	protected:
+		LightSorter sorter;	
 	
 		bool cullingFrontFaces;
 				

+ 5 - 0
Core/Contents/Include/PolySceneLight.h

@@ -183,6 +183,9 @@ namespace Polycode {
 			* If set to true, draws a wireframe primitive visualizing the light.
 			*/
 			void enableDebugDraw(bool val);
+			
+			void setLightImportance(int newImportance);
+			int getLightImportance();
 		
 			SceneEntity *lightShape;
 			
@@ -191,6 +194,8 @@ namespace Polycode {
 			Number spotlightExponent;
 			Number spotlightCutoff;
 		
+			int lightImportance;
+		
 			Number constantAttenuation;
 			Number linearAttenuation;
 			Number quadraticAttenuation;

+ 8 - 0
Core/Contents/Source/PolyGLSLShaderModule.cpp

@@ -396,6 +396,14 @@ bool GLSLShaderModule::applyShaderMaterial(Renderer *renderer, Material *materia
 	int lightIndex = 0;
 	
 	vector<LightInfo> areaLights = renderer->getAreaLights();
+	
+//	printf("Applying {\n");
+//	for(int z=0;z < areaLights.size(); z++) {
+//		LightInfo light = areaLights[z];		
+//		printf("Light: %f %f %f\n", light.position.x, light.position.y, light.position.z);
+//	}
+//	printf("}\n");
+		
 	GLfloat ambientVal[] = {1, 1, 1, 1.0};				
 	for(int i=0; i < glslShader->numAreaLights; i++) {
 		LightInfo light;

+ 2 - 2
Core/Contents/Source/PolyRenderer.cpp

@@ -125,14 +125,13 @@ void Renderer::addShaderModule(PolycodeShaderModule *module) {
 
 void Renderer::sortLights(){
 
-	LightSorter sorter;
 	sorter.basePosition = (getModelviewMatrix()).getPosition();
 	sorter.cameraMatrix = getCameraMatrix().inverse();	
 	sort (areaLights.begin(), areaLights.end(), sorter);
 	sort (spotLights.begin(), spotLights.end(), sorter);	
 }
 
-void Renderer::addLight(Vector3 position, Vector3 direction, int type, Color color, Color specularColor, Number constantAttenuation, Number linearAttenuation, Number quadraticAttenuation, Number intensity, Number spotlightCutoff, Number spotlightExponent, bool shadowsEnabled, Matrix4 *textureMatrix,Texture *shadowMapTexture) {
+void Renderer::addLight(int lightImportance, Vector3 position, Vector3 direction, int type, Color color, Color specularColor, Number constantAttenuation, Number linearAttenuation, Number quadraticAttenuation, Number intensity, Number spotlightCutoff, Number spotlightExponent, bool shadowsEnabled, Matrix4 *textureMatrix,Texture *shadowMapTexture) {
 
 	numLights++;
 	
@@ -141,6 +140,7 @@ void Renderer::addLight(Vector3 position, Vector3 direction, int type, Color col
 		info.textureMatrix = *textureMatrix;
 	}
 	
+	info.lightImportance = lightImportance;
 	info.shadowMapTexture = shadowMapTexture;
 	info.shadowsEnabled = shadowsEnabled;
 	info.spotlightCutoff = spotlightCutoff;

+ 4 - 3
Core/Contents/Source/PolyScene.cpp

@@ -160,9 +160,10 @@ void Scene::Render(Camera *targetCamera) {
 	CoreServices::getInstance()->getRenderer()->clearLights();
 	
 	for(int i=0; i < lights.size(); i++) {
-		
 		SceneLight *light = lights[i];
-		
+		if(!light->enabled)
+			continue;
+			
 		Vector3 direction;
 		Vector3 position;
 		matrixPtr = NULL;				
@@ -197,7 +198,7 @@ void Scene::Render(Camera *targetCamera) {
 		if(light->getParentEntity() != NULL) {
 			position = light->getParentEntity()->getConcatenatedMatrix() * position;			
 		}
-		CoreServices::getInstance()->getRenderer()->addLight(position, direction, light->getLightType(), light->lightColor, light->specularLightColor, light->getConstantAttenuation(), light->getLinearAttenuation(), light->getQuadraticAttenuation(), light->getIntensity(), light->getSpotlightCutoff(), light->getSpotlightExponent(), light->areShadowsEnabled(), matrixPtr, shadowMapTexture);
+		CoreServices::getInstance()->getRenderer()->addLight(light->getLightImportance(), position, direction, light->getLightType(), light->lightColor, light->specularLightColor, light->getConstantAttenuation(), light->getLinearAttenuation(), light->getQuadraticAttenuation(), light->getIntensity(), light->getSpotlightCutoff(), light->getSpotlightExponent(), light->areShadowsEnabled(), matrixPtr, shadowMapTexture);
 	}	
 	
 	targetCamera->doCameraTransform();

+ 11 - 0
Core/Contents/Source/PolySceneLight.cpp

@@ -66,8 +66,19 @@ SceneLight::SceneLight(int type, Scene *parentScene, Number intensity, Number co
 	*/
 	
 	lightShape = NULL;
+	
+	lightImportance = 0;
+}
+
+void SceneLight::setLightImportance(int newImportance) {
+	lightImportance = newImportance;
 }
 
+int SceneLight::getLightImportance() {
+	return lightImportance;
+}
+
+
 void SceneLight::enableDebugDraw(bool val) {
 	if(lightShape) {
 		lightShape->visible = val;

+ 1 - 1
Tools/Contents/polyimport/CMakeLists.txt

@@ -14,7 +14,7 @@ SET(CMAKE_DEBUG_POSTFIX "_d")
 
 #IF(POLYCODE_BUILD_STATIC)
 ADD_EXECUTABLE(polyimport Source/polyimport.cpp Include/polyimport.h)
-TARGET_LINK_LIBRARIES(polyimport Polycore ${PHYSFS_LIBRARY}  ${ZLIB_LIBRARIES} ${ASSIMP_LIBRARIES}})
+TARGET_LINK_LIBRARIES(polyimport Polycore ${PHYSFS_LIBRARY}  ${ZLIB_LIBRARIES} ${ASSIMP_LIBRARIES})
 #ENDIF(POLYCODE_BUILD_STATIC)
 
 IF(POLYCODE_INSTALL_FRAMEWORK)