Ivan Safrin 13 лет назад
Родитель
Сommit
53710dcae0

+ 1 - 1
CMake/physfs.cmake

@@ -266,7 +266,7 @@ IF(PHYSFS_NEED_ZLIB)
     IF(PHYSFS_INTERNAL_ZLIB)
         INCLUDE_DIRECTORIES(zlib123)
         ADD_DEFINITIONS(-DZ_PREFIX=1)
-        SET(PHYSFS_SRCS ${PHYSFS_SRCS})
+        SET(PHYSFS_SRCS ${PHYSFS_SRCS} ${ZLIB_SRCS})
     ELSE(PHYSFS_INTERNAL_ZLIB)
         SET(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${ZLIB_LIBRARY})
         INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})

+ 3 - 0
Core/Contents/Include/PolyGlobals.h

@@ -39,6 +39,9 @@ THE SOFTWARE.
 	#pragma warning(disable:4996)
 	#pragma warning(disable:4309)
 	#define NULL 0
+
+#include <stdint.h>
+
 #endif
  
 #ifndef NULL

+ 1 - 1
Core/Contents/Include/PolyShader.h

@@ -133,7 +133,7 @@ namespace Polycode {
 			ShaderBinding(Shader *shader);
 			virtual ~ShaderBinding();
 
-			virtual Texture *getTexture(const String& name){};
+			virtual Texture *getTexture(const String& name){ return NULL;};
 			virtual void clearTexture(const String& name){};
 			virtual void addTexture(const String& name, Texture *texture)  {};
 			virtual void addParam(const String& type, const String& name, const String& value) {};

+ 1 - 0
Core/Contents/Source/PolyCamera.cpp

@@ -37,6 +37,7 @@ Camera::Camera(Scene *parentScene) : SceneEntity() {
 	setParentScene(parentScene);
 	orthoMode = false;
 	fov = 45.0f;
+	filterShaderMaterial = NULL;
 	originalSceneTexture = NULL;
 	zBufferSceneTexture = NULL;
 	exposureLevel = 1.0f;

+ 1 - 1
Core/Contents/Source/PolyData.cpp

@@ -75,7 +75,7 @@ bool Data::loadFromFile(const String& fileName) {
 	data = (char*)malloc(dataSize);
 	if(!data) {
 		OSBasics::close(file);		
-		return;
+		return false;
 	}
 	
 	OSBasics::read(data, sizeof(char), dataSize, file);	

+ 6 - 1
Core/Contents/Source/PolyGLSLShaderModule.cpp

@@ -49,6 +49,7 @@ PFNGLUNIFORM1IPROC glUniform1i;
 PFNGLUNIFORM1FPROC glUniform1f;
 PFNGLUNIFORM2FPROC glUniform2f;
 PFNGLUNIFORM3FPROC glUniform3f;
+PFNGLUNIFORM4FPROC glUniform4f;
 extern PFNGLACTIVETEXTUREPROC glActiveTexture;
 PFNGLCREATESHADERPROC glCreateShader;
 PFNGLSHADERSOURCEPROC glShaderSource;
@@ -75,6 +76,7 @@ GLSLShaderModule::GLSLShaderModule() : PolycodeShaderModule() {
 	glUniform1f = (PFNGLUNIFORM1FPROC)wglGetProcAddress("glUniform1f");	
 	glUniform2f = (PFNGLUNIFORM2FPROC)wglGetProcAddress("glUniform2f");	
 	glUniform3f = (PFNGLUNIFORM3FPROC)wglGetProcAddress("glUniform3f");
+	glUniform4f = (PFNGLUNIFORM4FPROC)wglGetProcAddress("glUniform4f");
 	glCreateShader = (PFNGLCREATESHADERPROC)wglGetProcAddress("glCreateShader");
 	glShaderSource = (PFNGLSHADERSOURCEPROC)wglGetProcAddress("glShaderSource");
 	glCompileShader = (PFNGLCOMPILESHADERPROC)wglGetProcAddress("glCompileShader");
@@ -469,7 +471,10 @@ GLSLProgramParam GLSLShaderModule::addParamToProgram(GLSLProgram *program,TiXmlN
 		void *maxData = NULL;
 		
 		TiXmlElement *nodeElement = node->ToElement();
-		if (!nodeElement) return; // Skip comment nodes
+		if (!nodeElement) {
+			GLSLProgramParam::createParamData(&paramType, "Number", "0.0", "0.0", "0.0", &defaultData, &minData, &maxData);		
+			return program->addParam("Unknown", "Number", nodeElement->Attribute("default"), isAuto, autoID, paramType, defaultData, minData, maxData); // Skip comment nodes
+		}
 
 		isAuto = false;
 		

+ 1 - 0
Core/Contents/Source/PolyObject.cpp

@@ -544,6 +544,7 @@ bool BinaryObjectWriter::writeToFile(const String& fileName) {
 	OSBasics::write(&data32, sizeof(uint32_t), 1, outFile);	
 	
 	OSBasics::close(outFile);
+	return true;
 }
 
 

+ 1 - 0
Core/Contents/Source/PolyScreenEntityInstance.cpp

@@ -301,4 +301,5 @@ bool ScreenEntityInstance::loadFromFile(const String& fileName) {
 		rootEntity = loadObjectEntryIntoEntity(root);				
 		addChild(rootEntity);		
 	}
+	return true;
 }

+ 4 - 0
Core/Contents/Source/PolyString.cpp

@@ -112,9 +112,13 @@ void String::setDataWithEncoding(char *data, int encoding) {
 }
 
 bool String::isNumber() {
+#ifdef _WINDOWS
+	return false;
+#else
     std::string::const_iterator it = contents.begin();
     while (it != contents.end() && std::isdigit(*it)) ++it;
     return !contents.empty() && it == contents.end();
+#endif
 }				
 
 

+ 6 - 0
Core/Contents/Source/PolyWinCore.cpp

@@ -162,6 +162,11 @@ void Win32Core::setVSync(bool vSyncVal) {
 
 void Win32Core::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel) {
 
+	this->xRes = xRes;
+	this->yRes = yRes;
+	this->fullScreen = fullScreen;
+	this->aaLevel = aaLevel;
+
 	if(fullScreen) {
 
 		SetWindowLong(hWnd, GWL_STYLE, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_POPUP);
@@ -197,6 +202,7 @@ void Win32Core::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, in
 
 	setVSync(vSync);
 
+	renderer->setAnisotropyAmount(anisotropyLevel);
 	renderer->Resize(xRes, yRes);
 }