Browse Source

Merge branch 'dev' of https://github.com/oxygine/oxygine-framework into dev

dmuratshin 10 years ago
parent
commit
3a6690bc3a

+ 68 - 109
CMakeLists.txt

@@ -8,29 +8,27 @@ set(OX_HAVE_LIBCURL 0)
 set(OX_HAVE_HTTP 0)
 set(OX_HAVE_HTTP 0)
 set(OX_USE_SDL2 1)
 set(OX_USE_SDL2 1)
 
 
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
 
 find_package(OpenGL)
 find_package(OpenGL)
-set(OXYGINE_INCLUDE_DIRS ${OXYGINE_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS})
-
-if (EMSCRIPTEN) #don't need SDL2
-else()
-	if(WIN32)
-		set(ENV{SDL2DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../SDL/include)
-		set(CORE_LIBS ${CORE_LIBS} SDL2main SDL2)
-	else(WIN32)
-		find_package(CURL)
-	endif()
 
 
-	find_package(SDL2)
+if (EMSCRIPTEN)
+	#don't need SDL2
+elseif (WIN32)	
+	#hardcoded path to SDL2 on windows
+	set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../SDL/include)
+else(WIN32)
+	find_path(SDL2_INCLUDE_DIRS NAMES SDL2/SDL.h)
+	message(STATUS ${SDL2_INCLUDE_DIRS_FOUND})
 
 
-	if (SDL2_FOUND)
-		message(STATUS "SDL2 found")
-		include_directories(${SDL2_INCLUDE_DIR})
+	if (SDL2_INCLUDE_DIRS)		
+		set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIRS}/SDL2)
+		message(STATUS "found")		
 	else()
 	else()
-		message(STATUS "SDL2 not found")
-		set(SDL2_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../SDL/include)
+		message(STATUS "SDL not found")
+		set(SDL2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../SDL/include)					
 	endif()
 	endif()
+
+	find_package(CURL)
 endif(EMSCRIPTEN)
 endif(EMSCRIPTEN)
 
 
 
 
@@ -45,7 +43,7 @@ set(FOLDERS src src/closure src/minizip src/core
 
 
 if (EMSCRIPTEN)
 if (EMSCRIPTEN)
 	set(PLATFORM emscripten)
 	set(PLATFORM emscripten)
-elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") 	
 	set(PLATFORM linux)
 	set(PLATFORM linux)
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 	set(PLATFORM ios)
 	set(PLATFORM ios)
@@ -58,9 +56,11 @@ endif()
 
 
 set(THIRD_PARTY ${OXYGINE_ROOT}/third_party/${PLATFORM})
 set(THIRD_PARTY ${OXYGINE_ROOT}/third_party/${PLATFORM})
 
 
+
+
 if (EMSCRIPTEN)
 if (EMSCRIPTEN)
 	set(OX_HAVE_LIBPNG 1)
 	set(OX_HAVE_LIBPNG 1)
-	set(OX_HAVE_HTTP 1)
+	set(OX_HAVE_HTTP 1)	
 	set(OX_USE_SDL2 0)
 	set(OX_USE_SDL2 0)
 
 
 	set(SOURCES ${OXYGINE_SRC}/core/emscripten/HttpRequestEmscriptenTask.cpp)
 	set(SOURCES ${OXYGINE_SRC}/core/emscripten/HttpRequestEmscriptenTask.cpp)
@@ -68,10 +68,16 @@ if (EMSCRIPTEN)
 
 
 	file(GLOB OXYGINE_JS_LIBRARIES ${OXYGINE_SRC}/core/emscripten/*.js)
 	file(GLOB OXYGINE_JS_LIBRARIES ${OXYGINE_SRC}/core/emscripten/*.js)
 
 
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") 	
+	
+	set(OX_HAVE_LIBJPEG 1)
+	set(OX_HAVE_LIBPNG 1)
+
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 elseif(MSVC)
 elseif(MSVC)
+
 	set(OX_HAVE_LIBJPEG 1)
 	set(OX_HAVE_LIBJPEG 1)
-	set(OX_HAVE_LIBPNG 1)
+	set(OX_HAVE_LIBPNG 1)	
 	set(OX_HAVE_LIBCURL 1)
 	set(OX_HAVE_LIBCURL 1)
 	set(OX_HAVE_HTTP 1)
 	set(OX_HAVE_HTTP 1)
 
 
@@ -79,83 +85,15 @@ elseif(MSVC)
 
 
 	set(OX_DEFINITIONS	${OX_DEFINITIONS} -D_CRT_SECURE_NO_WARNINGS)
 	set(OX_DEFINITIONS	${OX_DEFINITIONS} -D_CRT_SECURE_NO_WARNINGS)
 
 
-elseif(MINGW)
+elseif(MINGW)	
+
 	set(libprefix lib)
 	set(libprefix lib)
 
 
-	set(OX_HAVE_LIBPNG 1)
+	set(OX_HAVE_LIBPNG 1)	
 	set(OX_HAVE_LIBCURL 1)
 	set(OX_HAVE_LIBCURL 1)
 	set(OX_HAVE_HTTP 1)
 	set(OX_HAVE_HTTP 1)
-else()  # anything else (POSIX we assume)
-	set(OX_HAVE_LIBJPEG 1)
-	set(OX_HAVE_LIBPNG 1)
-endif()
-
-#add png library
-if (OX_HAVE_LIBPNG)
-	set(OX_DEFINITIONS	${OX_DEFINITIONS}
-		-DOX_HAVE_LIBPNG)
-	if ((MSVC) OR (MINGW))
-		include_directories(${THIRD_PARTY}/libpng)
-		set(LIBPNG ${libprefix}png)
-		if (MSVC_VERSION EQUAL "1900")
-			set(LIBPNG ${LIBPNG}-2015)
-		endif()
-		set(CORE_LIBS ${CORE_LIBS} ${LIBPNG})
-	elseif(EMSCRIPTEN)
-		include_directories(${THIRD_PARTY}/libpng)
-		set(LIBPNG ${libprefix}png)
-		set(LIBPNG libz libpng16)
-		set(CORE_LIBS ${CORE_LIBS} ${LIBPNG})
-	else()
-		find_package(PNG)
-
-        if (PNG_FOUND)
-
-		include_directories(
-			${PNG_INCLUDE_DIR}
-		)
-            else(PNG_FOUND)
-            		include_directories(${THIRD_PARTY}/libpng)
-		set(LIBPNG ${libprefix}png)
-                        endif()
-		set (CORE_LIBS
-			${CORE_LIBS}
-			${PNG_LIBRARIES}
-		)
-		set(OXYGINE_INCLUDE_DIRS
-			${OXYGINE_INCLUDE_DIRS}
-			${PNG_INCLUDE_DIR}
-		)
-	endif()
-endif(OX_HAVE_LIBPNG)
-
-#add jpeg library
-if (OX_HAVE_LIBJPEG)
-	set(OX_DEFINITIONS	${OX_DEFINITIONS}
-		-DOX_HAVE_LIBJPEG)
-	if (MSVC)
-		set(LIBJPEG ${libprefix}jpeg)
-		if (MSVC_VERSION EQUAL "1900")
-			set(LIBJPEG ${LIBJPEG}-2015)
-		endif()
-		set(CORE_LIBS ${CORE_LIBS} ${LIBJPEG})
-		include_directories(${THIRD_PARTY}/libjpeg)		
-	else()
-		find_package(JPEG REQUIRED)
-		set (CORE_LIBS
-			${CORE_LIBS}
-			${JPEG_LIBRARIES}
-		)
-		include_directories(
-			${JPEG_INCLUDE_DIR}
-		)
-		set(OXYGINE_INCLUDE_DIRS
-			${OXYGINE_INCLUDE_DIRS}
-			${JPEG_INCLUDE_DIR}
-		)
-	endif()
-endif(OX_HAVE_LIBJPEG)
 
 
+endif()
 
 
 if (OX_HAVE_LIBCURL)	
 if (OX_HAVE_LIBCURL)	
 	set(FOLDERS ${FOLDERS} src/core/curl)
 	set(FOLDERS ${FOLDERS} src/core/curl)
@@ -183,8 +121,6 @@ endforeach(ITEM)
 
 
 set(OXYGINE_INCLUDE_DIRS 
 set(OXYGINE_INCLUDE_DIRS 
 	${OXYGINE_SRC}
 	${OXYGINE_SRC}
-	${SDL2_INCLUDE_DIR}
-	${OPENGL_INCLUDE_DIR}
 	${THIRD_PARTY}/pthreads/include/
 	${THIRD_PARTY}/pthreads/include/
 	${THIRD_PARTY}/zlib)
 	${THIRD_PARTY}/zlib)
 
 
@@ -213,11 +149,9 @@ set(CORE_LIBS
 
 
 
 
 if (OX_USE_SDL2)
 if (OX_USE_SDL2)
-	if (WIN32)
-	elseif(EMSCRIPTEN)
-	else(WIN32)
-		set(CORE_LIBS ${CORE_LIBS} ${SDL2_LIBRARY})
-	endif(WIN32)
+	set(CORE_LIBS ${CORE_LIBS}
+		SDL2main SDL2)
+	set(OXYGINE_INCLUDE_DIRS ${OXYGINE_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS})
 endif(OX_USE_SDL2)	
 endif(OX_USE_SDL2)	
 
 
 
 
@@ -232,6 +166,39 @@ else(WIN32)
 endif(WIN32)
 endif(WIN32)
 
 
 
 
+
+if (OX_HAVE_LIBPNG)		
+	set(OX_DEFINITIONS	${OX_DEFINITIONS} -DOX_HAVE_LIBPNG)
+	include_directories(${THIRD_PARTY}/libpng)
+	set(LIBPNG ${libprefix}png)
+
+	if (MSVC)		
+		if (MSVC_VERSION EQUAL "1900")
+			set(LIBPNG ${LIBPNG}-2015)
+		endif()
+	elseif(EMSCRIPTEN)
+		set(LIBPNG libz libpng16)
+	endif()	
+
+	set(CORE_LIBS ${CORE_LIBS} ${LIBPNG})
+endif(OX_HAVE_LIBPNG)
+
+
+if (OX_HAVE_LIBJPEG)	
+	set(OX_DEFINITIONS	${OX_DEFINITIONS} -DOX_HAVE_LIBJPEG)
+	include_directories(${THIRD_PARTY}/libjpeg)
+	set(LIBJPEG ${libprefix}jpeg)
+	
+	if (MSVC)
+		if (MSVC_VERSION EQUAL "1900")
+			set(LIBJPEG ${LIBJPEG}-2015)
+		endif()	
+	endif()
+
+	set(CORE_LIBS ${CORE_LIBS} ${LIBJPEG})
+endif(OX_HAVE_LIBJPEG)
+
+
 if (NOT EMSCRIPTEN)
 if (NOT EMSCRIPTEN)
 	set(CORE_LIBS ${CORE_LIBS}
 	set(CORE_LIBS ${CORE_LIBS}
 		${libprefix}z${libprefix})
 		${libprefix}z${libprefix})
@@ -242,20 +209,12 @@ if (NOT MSVC)
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
 endif(NOT MSVC)
 endif(NOT MSVC)
 
 
-if (MINGW)
-    # workaround for pthread.h and time.h from mingw colliding
-    include(CheckStructHasMember)
-
-    CHECK_STRUCT_HAS_MEMBER ("struct timespec" tv_sec time.h HAVE_STRUCT_TIMESPEC)
-    if (HAVE_STRUCT_TIMESPEC)
-        set(OX_DEFINITIONS	${OX_DEFINITIONS} -D_TIMESPEC_DEFINED=1)
-    endif()
-endif()
 
 
 add_definitions(${OX_DEFINITIONS})
 add_definitions(${OX_DEFINITIONS})
 include_directories(${OXYGINE_INCLUDE_DIRS})
 include_directories(${OXYGINE_INCLUDE_DIRS})
 add_library(oxygine-framework STATIC ${SOURCES})
 add_library(oxygine-framework STATIC ${SOURCES})
 
 
+
 set(OXYGINE_LIBRARY_DIRS
 set(OXYGINE_LIBRARY_DIRS
 	${OXYGINE_LIBRARY_DIRS}
 	${OXYGINE_LIBRARY_DIRS}
 	PARENT_SCOPE)
 	PARENT_SCOPE)
@@ -276,7 +235,7 @@ set(OXYGINE_JS_LIBRARIES
 	${OXYGINE_JS_LIBRARIES}
 	${OXYGINE_JS_LIBRARIES}
 	PARENT_SCOPE)
 	PARENT_SCOPE)
 
 
-message(STATUS "SDL includes: ${SDL2_INCLUDE_DIR}")
+message(STATUS "SDL includes: ${SDL2_INCLUDE_DIRS}")
 message(STATUS "Libs:     ${CORE_LIBS}")
 message(STATUS "Libs:     ${CORE_LIBS}")
 message(STATUS "Platform: ${PLATFORM}")
 message(STATUS "Platform: ${PLATFORM}")
 
 

+ 1 - 0
oxygine/src/Box9Sprite.cpp

@@ -120,6 +120,7 @@ namespace oxygine
             if (!attr.empty())
             if (!attr.empty())
                 _horzMode = (StretchMode)attr.as_uint();
                 _horzMode = (StretchMode)attr.as_uint();
         }
         }
+        _Sprite::animFrameChanged(f);
     }
     }
 
 
     RectF Box9Sprite::getDestRect() const
     RectF Box9Sprite::getDestRect() const

+ 11 - 0
oxygine/src/TextField.cpp

@@ -91,6 +91,11 @@ namespace oxygine
         needRebuild();
         needRebuild();
     }
     }
 
 
+    const Font* TextField::getFont() const
+    {
+        return _style.font;
+    }
+
     void TextField::setFont(const Font* font)
     void TextField::setFont(const Font* font)
     {
     {
         _style.font = font;
         _style.font = font;
@@ -346,6 +351,8 @@ namespace oxygine
         setAttr(node, "halign", _style.hAlign, def.hAlign);
         setAttr(node, "halign", _style.hAlign, def.hAlign);
         setAttr(node, "multiline", _style.multiline, def.multiline);
         setAttr(node, "multiline", _style.multiline, def.multiline);
         setAttr(node, "breakLongWords", _style.breakLongWords, def.breakLongWords);
         setAttr(node, "breakLongWords", _style.breakLongWords, def.breakLongWords);
+        if (_style.font)
+            node.append_attribute("font").set_value(_style.font->getName().c_str());
         node.set_name("TextField");
         node.set_name("TextField");
     }
     }
 
 
@@ -362,6 +369,10 @@ namespace oxygine
         _style.breakLongWords = node.attribute("breakLongWords").as_bool(def.breakLongWords);
         _style.breakLongWords = node.attribute("breakLongWords").as_bool(def.breakLongWords);
         _style.fontSize2Scale = node.attribute("fontsize2scale").as_int(def.fontSize2Scale);
         _style.fontSize2Scale = node.attribute("fontsize2scale").as_int(def.fontSize2Scale);
         _style.linesOffset = node.attribute("linesOffset").as_int(def.linesOffset);
         _style.linesOffset = node.attribute("linesOffset").as_int(def.linesOffset);
+        const char* fnt = node.attribute("font").as_string(0);
+        if (fnt)
+            _style.font = data->factory->getResFont(fnt)->getFont();
+
         needRebuild();
         needRebuild();
         setText(node.attribute("text").as_string());
         setText(node.attribute("text").as_string());
     }
     }

+ 1 - 0
oxygine/src/TextField.h

@@ -30,6 +30,7 @@ namespace oxygine
         const Rect&                 getTextRect();
         const Rect&                 getTextRect();
         /**Returns current text*/
         /**Returns current text*/
         const std::string&          getText() const { return _text; }
         const std::string&          getText() const { return _text; }
+        const Font*                 getFont() const;
         int                         getFontSize2Scale() const;
         int                         getFontSize2Scale() const;
         int                         getLinesOffset() const;
         int                         getLinesOffset() const;
         TextStyle::VerticalAlign    getVAlign() const;
         TextStyle::VerticalAlign    getVAlign() const;

+ 5 - 1
oxygine/src/core/STDFileSystem.cpp

@@ -208,6 +208,8 @@ namespace oxygine
 
 
 #if __S3E__
 #if __S3E__
             return (s3eFileDelete(buff) == S3E_RESULT_SUCCESS ? status_ok : status_error);
             return (s3eFileDelete(buff) == S3E_RESULT_SUCCESS ? status_ok : status_error);
+#elif OXYGINE_EDITOR
+            return status_error;
 #elif _WIN32
 #elif _WIN32
             return DeleteFileA(buff) ? status_ok : status_error;
             return DeleteFileA(buff) ? status_ok : status_error;
 #else
 #else
@@ -257,6 +259,8 @@ namespace oxygine
 
 
 #if __S3E__
 #if __S3E__
             return (s3eFileRename(buffSrc, buffDest) == S3E_RESULT_SUCCESS ? status_ok : status_error);
             return (s3eFileRename(buffSrc, buffDest) == S3E_RESULT_SUCCESS ? status_ok : status_error);
+#elif OXYGINE_EDITOR
+            return status_error;
 #elif _WIN32
 #elif _WIN32
             return MoveFileA(buffSrc, buffDest) ? status_ok : status_error;
             return MoveFileA(buffSrc, buffDest) ? status_ok : status_error;
 #else
 #else
@@ -281,4 +285,4 @@ namespace oxygine
 #endif
 #endif
         }
         }
     }
     }
-}
+}

+ 1 - 1
oxygine/src/core/coroutines.cpp

@@ -3,7 +3,7 @@
 #if __S3E__
 #if __S3E__
 #define OXYGINE_COROUTINES
 #define OXYGINE_COROUTINES
 #include "IwFibre.h"
 #include "IwFibre.h"
-#elif OXYGINE_QT
+#elif OXYGINE_EDITOR
 #elif OXYGINE_SDL
 #elif OXYGINE_SDL
 #ifndef __APPLE__
 #ifndef __APPLE__
 //#include "greenlet.h"
 //#include "greenlet.h"

+ 2 - 1
oxygine/src/core/file.cpp

@@ -54,6 +54,7 @@ namespace oxygine
             _nfsWrite.setPath(SDL_AndroidGetInternalStoragePath());
             _nfsWrite.setPath(SDL_AndroidGetInternalStoragePath());
 #elif __APPLE__
 #elif __APPLE__
             _nfsWrite.setPath(getSupportFolder().c_str());
             _nfsWrite.setPath(getSupportFolder().c_str());
+#elif OXYGINE_EDITOR
 #else
 #else
             if (company && app && *company && *app)
             if (company && app && *company && *app)
             {
             {
@@ -242,4 +243,4 @@ namespace oxygine
             return _nfsWrite;
             return _nfsWrite;
         }
         }
     }
     }
-}
+}

+ 18 - 18
oxygine/src/core/gl/ShaderProgramGL.cpp

@@ -45,15 +45,16 @@ namespace oxygine
         oxglGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
         oxglGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
         if (length)
         if (length)
         {
         {
-            std::vector<char> bf;
-            bf.resize(length);
-            oxglGetShaderInfoLog(shader, (int)bf.size(), NULL, &bf.front());
-            log::messageln("shader compiled: %s", &bf.front());
-
             GLint success;
             GLint success;
             oxglGetShaderiv(shader, GL_COMPILE_STATUS, &success);
             oxglGetShaderiv(shader, GL_COMPILE_STATUS, &success);
             if (success != GL_TRUE)
             if (success != GL_TRUE)
             {
             {
+
+                std::vector<char> bf;
+                bf.resize(length);
+                oxglGetShaderInfoLog(shader, (int)bf.size(), NULL, &bf.front());
+
+                log::messageln("shader build error: %s", &bf.front());
                 OX_ASSERT(!"shader build error");
                 OX_ASSERT(!"shader build error");
                 exit(1);
                 exit(1);
             }
             }
@@ -69,18 +70,22 @@ namespace oxygine
         const char* sources[16];
         const char* sources[16];
         const char** ptr = &sources[0];
         const char** ptr = &sources[0];
 
 
+        bool gles = false;
 
 
-#ifndef __S3E__
-#   ifndef EMSCRIPTEN
+#ifdef __S3E__
+        gles = true;
+#elif OXYGINE_SDL
         int profile = 0;
         int profile = 0;
         SDL_GL_GetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, &profile);
         SDL_GL_GetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, &profile);
 
 
-        if (profile == SDL_GL_CONTEXT_PROFILE_ES)
-        {
-        }
-        else
-        {
+        gles = profile == SDL_GL_CONTEXT_PROFILE_ES;
+#else
+#endif
+
 
 
+#ifndef   EMSCRIPTEN
+        if (!gles)
+        {
             log::messageln("not gles version");
             log::messageln("not gles version");
 
 
             static const char nonGLES[] =
             static const char nonGLES[] =
@@ -89,13 +94,8 @@ namespace oxygine
                 "#define highp\n";
                 "#define highp\n";
 
 
             *ptr = nonGLES;
             *ptr = nonGLES;
-            ptr++;
-
+			ptr++;
         }
         }
-
-#   else
-        *ptr = "precision float mediump;";
-#   endif
 #endif
 #endif
 
 
 
 

+ 6 - 7
oxygine/src/core/oxygine.cpp

@@ -383,7 +383,7 @@ namespace oxygine
 
 
         void init2()
         void init2()
         {
         {
-#ifdef OXYGINE_QT
+#ifdef OXYGINE_EDITOR
             setlocale(LC_ALL, "POSIX");
             setlocale(LC_ALL, "POSIX");
 #endif
 #endif
 
 
@@ -537,7 +537,9 @@ namespace oxygine
             //sleep(1000/50);
             //sleep(1000/50);
         }
         }
 
 
-#ifndef __S3E__
+#ifdef __S3E__
+#elif OXYGINE_EDITOR
+#else
         void SDL_handleEvent(SDL_Event& event, bool& done)
         void SDL_handleEvent(SDL_Event& event, bool& done)
         {
         {
             Input* input = &Input::instance;
             Input* input = &Input::instance;
@@ -817,11 +819,8 @@ namespace oxygine
             }
             }
 
 
             return Point(width, height);
             return Point(width, height);
-#elif OXYGINE_QT
-            if (!_window)
-            {
-                return _qtFixedSize;
-            }
+#elif OXYGINE_EDITOR
+            return _qtFixedSize;
 #elif OXYGINE_SDL
 #elif OXYGINE_SDL
             int w = 0;
             int w = 0;
             int h = 0;
             int h = 0;

+ 2 - 0
oxygine/src/oxygine_include.h

@@ -28,6 +28,8 @@
 #   ifndef NDEBUG
 #   ifndef NDEBUG
 #       define OX_DEBUG 1
 #       define OX_DEBUG 1
 #   endif // DEBUG  
 #   endif // DEBUG  
+#elif OXYGINE_EDITOR
+#   define OXYGINE_FILESYSTEM_USE_STDIO 1
 #else
 #else
 #   define OXYGINE_SDL 1
 #   define OXYGINE_SDL 1
 #   ifdef _WIN32
 #   ifdef _WIN32

+ 7 - 4
oxygine/src/pugixml/pugiconfig.hpp

@@ -1,7 +1,7 @@
 /**
 /**
- * pugixml parser - version 1.6
+ * pugixml parser - version 1.7
  * --------------------------------------------------------
  * --------------------------------------------------------
- * Copyright (C) 2006-2015, by Arseny Kapoulkine ([email protected])
+ * Copyright (C) 2006-2016, by Arseny Kapoulkine ([email protected])
  * Report bugs and download new versions at http://pugixml.org/
  * Report bugs and download new versions at http://pugixml.org/
  *
  *
  * This library is distributed under the MIT License. See notice at the end
  * This library is distributed under the MIT License. See notice at the end
@@ -17,6 +17,9 @@
 // Uncomment this to enable wchar_t mode
 // Uncomment this to enable wchar_t mode
 // #define PUGIXML_WCHAR_MODE
 // #define PUGIXML_WCHAR_MODE
 
 
+// Uncomment this to enable compact mode
+// #define PUGIXML_COMPACT
+
 // Uncomment this to disable XPath
 // Uncomment this to disable XPath
 // #define PUGIXML_NO_XPATH
 // #define PUGIXML_NO_XPATH
 
 
@@ -46,7 +49,7 @@
 #endif
 #endif
 
 
 /**
 /**
- * Copyright (c) 2006-2015 Arseny Kapoulkine
+ * Copyright (c) 2006-2016 Arseny Kapoulkine
  *
  *
  * Permission is hereby granted, free of charge, to any person
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
  * obtaining a copy of this software and associated documentation
@@ -59,7 +62,7 @@
  *
  *
  * The above copyright notice and this permission notice shall be
  * The above copyright notice and this permission notice shall be
  * included in all copies or substantial portions of the Software.
  * included in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

File diff suppressed because it is too large
+ 666 - 88
oxygine/src/pugixml/pugixml.cpp


+ 102 - 60
oxygine/src/pugixml/pugixml.hpp

@@ -1,7 +1,7 @@
 /**
 /**
- * pugixml parser - version 1.6
+ * pugixml parser - version 1.7
  * --------------------------------------------------------
  * --------------------------------------------------------
- * Copyright (C) 2006-2015, by Arseny Kapoulkine ([email protected])
+ * Copyright (C) 2006-2016, by Arseny Kapoulkine ([email protected])
  * Report bugs and download new versions at http://pugixml.org/
  * Report bugs and download new versions at http://pugixml.org/
  *
  *
  * This library is distributed under the MIT License. See notice at the end
  * This library is distributed under the MIT License. See notice at the end
@@ -13,7 +13,7 @@
 
 
 #ifndef PUGIXML_VERSION
 #ifndef PUGIXML_VERSION
 // Define version macro; evaluates to major * 100 + minor so that it's safe to use in less-than comparisons
 // Define version macro; evaluates to major * 100 + minor so that it's safe to use in less-than comparisons
-#	define PUGIXML_VERSION 160
+#	define PUGIXML_VERSION 170
 #endif
 #endif
 
 
 // Include user configuration file (this can define various configuration macros)
 // Include user configuration file (this can define various configuration macros)
@@ -65,7 +65,7 @@
 
 
 // If the platform is known to have long long support, enable long long functions
 // If the platform is known to have long long support, enable long long functions
 #ifndef PUGIXML_HAS_LONG_LONG
 #ifndef PUGIXML_HAS_LONG_LONG
-#	if defined(__cplusplus) && __cplusplus >= 201103
+#	if __cplusplus >= 201103
 #		define PUGIXML_HAS_LONG_LONG
 #		define PUGIXML_HAS_LONG_LONG
 #	elif defined(_MSC_VER) && _MSC_VER >= 1400
 #	elif defined(_MSC_VER) && _MSC_VER >= 1400
 #		define PUGIXML_HAS_LONG_LONG
 #		define PUGIXML_HAS_LONG_LONG
@@ -133,13 +133,13 @@ namespace pugi
 
 
 	// This flag determines if EOL characters are normalized (converted to #xA) during parsing. This flag is on by default.
 	// This flag determines if EOL characters are normalized (converted to #xA) during parsing. This flag is on by default.
 	const unsigned int parse_eol = 0x0020;
 	const unsigned int parse_eol = 0x0020;
-	
+
 	// This flag determines if attribute values are normalized using CDATA normalization rules during parsing. This flag is on by default.
 	// This flag determines if attribute values are normalized using CDATA normalization rules during parsing. This flag is on by default.
 	const unsigned int parse_wconv_attribute = 0x0040;
 	const unsigned int parse_wconv_attribute = 0x0040;
 
 
 	// This flag determines if attribute values are normalized using NMTOKENS normalization rules during parsing. This flag is off by default.
 	// This flag determines if attribute values are normalized using NMTOKENS normalization rules during parsing. This flag is off by default.
 	const unsigned int parse_wnorm_attribute = 0x0080;
 	const unsigned int parse_wnorm_attribute = 0x0080;
-	
+
 	// This flag determines if document declaration (node_declaration) is added to the DOM tree. This flag is off by default.
 	// This flag determines if document declaration (node_declaration) is added to the DOM tree. This flag is off by default.
 	const unsigned int parse_declaration = 0x0100;
 	const unsigned int parse_declaration = 0x0100;
 
 
@@ -158,6 +158,11 @@ namespace pugi
 	// is a valid document. This flag is off by default.
 	// is a valid document. This flag is off by default.
 	const unsigned int parse_fragment = 0x1000;
 	const unsigned int parse_fragment = 0x1000;
 
 
+	// This flag determines if plain character data is be stored in the parent element's value. This significantly changes the structure of
+	// the document; this flag is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments.
+	// This flag is off by default.
+	const unsigned int parse_embed_pcdata = 0x2000;
+
 	// The default parsing mode.
 	// The default parsing mode.
 	// Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
 	// Elements, PCDATA and CDATA sections are added to the DOM tree, character/reference entities are expanded,
 	// End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
 	// End-of-Line characters are normalized, attribute values are normalized using CDATA normalization rules.
@@ -184,16 +189,16 @@ namespace pugi
 	};
 	};
 
 
 	// Formatting flags
 	// Formatting flags
-	
+
 	// Indent the nodes that are written to output stream with as many indentation strings as deep the node is in DOM tree. This flag is on by default.
 	// Indent the nodes that are written to output stream with as many indentation strings as deep the node is in DOM tree. This flag is on by default.
 	const unsigned int format_indent = 0x01;
 	const unsigned int format_indent = 0x01;
-	
+
 	// Write encoding-specific BOM to the output stream. This flag is off by default.
 	// Write encoding-specific BOM to the output stream. This flag is off by default.
 	const unsigned int format_write_bom = 0x02;
 	const unsigned int format_write_bom = 0x02;
 
 
 	// Use raw output mode (no indentation and no line breaks are written). This flag is off by default.
 	// Use raw output mode (no indentation and no line breaks are written). This flag is off by default.
 	const unsigned int format_raw = 0x04;
 	const unsigned int format_raw = 0x04;
-	
+
 	// Omit default XML declaration even if there is no declaration in the document. This flag is off by default.
 	// Omit default XML declaration even if there is no declaration in the document. This flag is off by default.
 	const unsigned int format_no_declaration = 0x08;
 	const unsigned int format_no_declaration = 0x08;
 
 
@@ -225,7 +230,7 @@ namespace pugi
 	class xml_node;
 	class xml_node;
 
 
 	class xml_text;
 	class xml_text;
-	
+
 	#ifndef PUGIXML_NO_XPATH
 	#ifndef PUGIXML_NO_XPATH
 	class xpath_node;
 	class xpath_node;
 	class xpath_node_set;
 	class xpath_node_set;
@@ -299,13 +304,13 @@ namespace pugi
 
 
 	private:
 	private:
 		xml_attribute_struct* _attr;
 		xml_attribute_struct* _attr;
-	
+
 		typedef void (*unspecified_bool_type)(xml_attribute***);
 		typedef void (*unspecified_bool_type)(xml_attribute***);
 
 
 	public:
 	public:
 		// Default constructor. Constructs an empty attribute.
 		// Default constructor. Constructs an empty attribute.
 		xml_attribute();
 		xml_attribute();
-		
+
 		// Constructs attribute from internal pointer
 		// Constructs attribute from internal pointer
 		explicit xml_attribute(xml_attribute_struct* attr);
 		explicit xml_attribute(xml_attribute_struct* attr);
 
 
@@ -354,6 +359,8 @@ namespace pugi
 		// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 		// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 		bool set_value(int rhs);
 		bool set_value(int rhs);
 		bool set_value(unsigned int rhs);
 		bool set_value(unsigned int rhs);
+		bool set_value(long rhs);
+		bool set_value(unsigned long rhs);
 		bool set_value(double rhs);
 		bool set_value(double rhs);
 		bool set_value(float rhs);
 		bool set_value(float rhs);
 		bool set_value(bool rhs);
 		bool set_value(bool rhs);
@@ -367,6 +374,8 @@ namespace pugi
 		xml_attribute& operator=(const char_t* rhs);
 		xml_attribute& operator=(const char_t* rhs);
 		xml_attribute& operator=(int rhs);
 		xml_attribute& operator=(int rhs);
 		xml_attribute& operator=(unsigned int rhs);
 		xml_attribute& operator=(unsigned int rhs);
+		xml_attribute& operator=(long rhs);
+		xml_attribute& operator=(unsigned long rhs);
 		xml_attribute& operator=(double rhs);
 		xml_attribute& operator=(double rhs);
 		xml_attribute& operator=(float rhs);
 		xml_attribute& operator=(float rhs);
 		xml_attribute& operator=(bool rhs);
 		xml_attribute& operator=(bool rhs);
@@ -417,7 +426,7 @@ namespace pugi
 
 
 		// Borland C++ workaround
 		// Borland C++ workaround
 		bool operator!() const;
 		bool operator!() const;
-	
+
 		// Comparison operators (compares wrapped node pointers)
 		// Comparison operators (compares wrapped node pointers)
 		bool operator==(const xml_node& r) const;
 		bool operator==(const xml_node& r) const;
 		bool operator!=(const xml_node& r) const;
 		bool operator!=(const xml_node& r) const;
@@ -438,7 +447,7 @@ namespace pugi
 		// Get node value, or "" if node is empty or it has no value
 		// Get node value, or "" if node is empty or it has no value
 		// Note: For <node>text</node> node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes.
 		// Note: For <node>text</node> node.value() does not return "text"! Use child_value() or text() methods to access text inside nodes.
 		const char_t* value() const;
 		const char_t* value() const;
-	
+
 		// Get attribute list
 		// Get attribute list
 		xml_attribute first_attribute() const;
 		xml_attribute first_attribute() const;
 		xml_attribute last_attribute() const;
 		xml_attribute last_attribute() const;
@@ -450,7 +459,7 @@ namespace pugi
 		// Get next/previous sibling in the children list of the parent node
 		// Get next/previous sibling in the children list of the parent node
 		xml_node next_sibling() const;
 		xml_node next_sibling() const;
 		xml_node previous_sibling() const;
 		xml_node previous_sibling() const;
-		
+
 		// Get parent node
 		// Get parent node
 		xml_node parent() const;
 		xml_node parent() const;
 
 
@@ -466,6 +475,9 @@ namespace pugi
 		xml_node next_sibling(const char_t* name) const;
 		xml_node next_sibling(const char_t* name) const;
 		xml_node previous_sibling(const char_t* name) const;
 		xml_node previous_sibling(const char_t* name) const;
 
 
+		// Get attribute, starting the search from a hint (and updating hint so that searching for a sequence of attributes is fast)
+		xml_attribute attribute(const char_t* name, xml_attribute& hint) const;
+
 		// Get child value of current node; that is, value of the first child node of type PCDATA/CDATA
 		// Get child value of current node; that is, value of the first child node of type PCDATA/CDATA
 		const char_t* child_value() const;
 		const char_t* child_value() const;
 
 
@@ -475,7 +487,7 @@ namespace pugi
 		// Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
 		// Set node name/value (returns false if node is empty, there is not enough memory, or node can not have name/value)
 		bool set_name(const char_t* rhs);
 		bool set_name(const char_t* rhs);
 		bool set_value(const char_t* rhs);
 		bool set_value(const char_t* rhs);
-		
+
 		// Add attribute with specified name. Returns added attribute, or empty attribute on errors.
 		// Add attribute with specified name. Returns added attribute, or empty attribute on errors.
 		xml_attribute append_attribute(const char_t* name);
 		xml_attribute append_attribute(const char_t* name);
 		xml_attribute prepend_attribute(const char_t* name);
 		xml_attribute prepend_attribute(const char_t* name);
@@ -529,11 +541,11 @@ namespace pugi
 		template <typename Predicate> xml_attribute find_attribute(Predicate pred) const
 		template <typename Predicate> xml_attribute find_attribute(Predicate pred) const
 		{
 		{
 			if (!_root) return xml_attribute();
 			if (!_root) return xml_attribute();
-			
+
 			for (xml_attribute attrib = first_attribute(); attrib; attrib = attrib.next_attribute())
 			for (xml_attribute attrib = first_attribute(); attrib; attrib = attrib.next_attribute())
 				if (pred(attrib))
 				if (pred(attrib))
 					return attrib;
 					return attrib;
-		
+
 			return xml_attribute();
 			return xml_attribute();
 		}
 		}
 
 
@@ -541,11 +553,11 @@ namespace pugi
 		template <typename Predicate> xml_node find_child(Predicate pred) const
 		template <typename Predicate> xml_node find_child(Predicate pred) const
 		{
 		{
 			if (!_root) return xml_node();
 			if (!_root) return xml_node();
-	
+
 			for (xml_node node = first_child(); node; node = node.next_sibling())
 			for (xml_node node = first_child(); node; node = node.next_sibling())
 				if (pred(node))
 				if (pred(node))
 					return node;
 					return node;
-		
+
 			return xml_node();
 			return xml_node();
 		}
 		}
 
 
@@ -555,7 +567,7 @@ namespace pugi
 			if (!_root) return xml_node();
 			if (!_root) return xml_node();
 
 
 			xml_node cur = first_child();
 			xml_node cur = first_child();
-			
+
 			while (cur._root && cur._root != _root)
 			while (cur._root && cur._root != _root)
 			{
 			{
 				if (pred(cur)) return cur;
 				if (pred(cur)) return cur;
@@ -587,7 +599,7 @@ namespace pugi
 
 
 		// Recursively traverse subtree with xml_tree_walker
 		// Recursively traverse subtree with xml_tree_walker
 		bool traverse(xml_tree_walker& walker);
 		bool traverse(xml_tree_walker& walker);
-	
+
 	#ifndef PUGIXML_NO_XPATH
 	#ifndef PUGIXML_NO_XPATH
 		// Select single node by evaluating XPath query. Returns first node from the resulting node set.
 		// Select single node by evaluating XPath query. Returns first node from the resulting node set.
 		xpath_node select_node(const char_t* query, xpath_variable_set* variables = 0) const;
 		xpath_node select_node(const char_t* query, xpath_variable_set* variables = 0) const;
@@ -602,7 +614,7 @@ namespace pugi
 		xpath_node select_single_node(const xpath_query& query) const;
 		xpath_node select_single_node(const xpath_query& query) const;
 
 
 	#endif
 	#endif
-		
+
 		// Print subtree using a writer object
 		// Print subtree using a writer object
 		void print(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
 		void print(xml_writer& writer, const char_t* indent = PUGIXML_TEXT("\t"), unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
 
 
@@ -698,6 +710,8 @@ namespace pugi
 		// Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 		// Set text with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")
 		bool set(int rhs);
 		bool set(int rhs);
 		bool set(unsigned int rhs);
 		bool set(unsigned int rhs);
+		bool set(long rhs);
+		bool set(unsigned long rhs);
 		bool set(double rhs);
 		bool set(double rhs);
 		bool set(float rhs);
 		bool set(float rhs);
 		bool set(bool rhs);
 		bool set(bool rhs);
@@ -711,6 +725,8 @@ namespace pugi
 		xml_text& operator=(const char_t* rhs);
 		xml_text& operator=(const char_t* rhs);
 		xml_text& operator=(int rhs);
 		xml_text& operator=(int rhs);
 		xml_text& operator=(unsigned int rhs);
 		xml_text& operator=(unsigned int rhs);
+		xml_text& operator=(long rhs);
+		xml_text& operator=(unsigned long rhs);
 		xml_text& operator=(double rhs);
 		xml_text& operator=(double rhs);
 		xml_text& operator=(float rhs);
 		xml_text& operator=(float rhs);
 		xml_text& operator=(bool rhs);
 		xml_text& operator=(bool rhs);
@@ -864,11 +880,11 @@ namespace pugi
 
 
 	private:
 	private:
 		int _depth;
 		int _depth;
-	
+
 	protected:
 	protected:
 		// Get current traversal depth
 		// Get current traversal depth
 		int depth() const;
 		int depth() const;
-	
+
 	public:
 	public:
 		xml_tree_walker();
 		xml_tree_walker();
 		virtual ~xml_tree_walker();
 		virtual ~xml_tree_walker();
@@ -939,10 +955,10 @@ namespace pugi
 		char_t* _buffer;
 		char_t* _buffer;
 
 
 		char _memory[192];
 		char _memory[192];
-		
+
 		// Non-copyable semantics
 		// Non-copyable semantics
 		xml_document(const xml_document&);
 		xml_document(const xml_document&);
-		const xml_document& operator=(const xml_document&);
+		xml_document& operator=(const xml_document&);
 
 
 		void create();
 		void create();
 		void destroy();
 		void destroy();
@@ -1043,12 +1059,12 @@ namespace pugi
 		xpath_value_type _type;
 		xpath_value_type _type;
 		xpath_variable* _next;
 		xpath_variable* _next;
 
 
-		xpath_variable();
+		xpath_variable(xpath_value_type type);
 
 
 		// Non-copyable semantics
 		// Non-copyable semantics
 		xpath_variable(const xpath_variable&);
 		xpath_variable(const xpath_variable&);
 		xpath_variable& operator=(const xpath_variable&);
 		xpath_variable& operator=(const xpath_variable&);
-		
+
 	public:
 	public:
 		// Get variable name
 		// Get variable name
 		const char_t* name() const;
 		const char_t* name() const;
@@ -1075,17 +1091,29 @@ namespace pugi
 	private:
 	private:
 		xpath_variable* _data[64];
 		xpath_variable* _data[64];
 
 
-		// Non-copyable semantics
-		xpath_variable_set(const xpath_variable_set&);
-		xpath_variable_set& operator=(const xpath_variable_set&);
+		void _assign(const xpath_variable_set& rhs);
+		void _swap(xpath_variable_set& rhs);
 
 
-		xpath_variable* find(const char_t* name) const;
+		xpath_variable* _find(const char_t* name) const;
+
+		static bool _clone(xpath_variable* var, xpath_variable** out_result);
+		static void _destroy(xpath_variable* var);
 
 
 	public:
 	public:
 		// Default constructor/destructor
 		// Default constructor/destructor
 		xpath_variable_set();
 		xpath_variable_set();
 		~xpath_variable_set();
 		~xpath_variable_set();
 
 
+		// Copy constructor/assignment operator
+		xpath_variable_set(const xpath_variable_set& rhs);
+		xpath_variable_set& operator=(const xpath_variable_set& rhs);
+
+	#if __cplusplus >= 201103
+		// Move semantics support
+		xpath_variable_set(xpath_variable_set&& rhs);
+		xpath_variable_set& operator=(xpath_variable_set&& rhs);
+	#endif
+
 		// Add a new variable or get the existing one, if the types match
 		// Add a new variable or get the existing one, if the types match
 		xpath_variable* add(const char_t* name, xpath_value_type type);
 		xpath_variable* add(const char_t* name, xpath_value_type type);
 
 
@@ -1118,26 +1146,35 @@ namespace pugi
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on compilation errors.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on compilation errors.
 		explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0);
 		explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0);
 
 
+		// Constructor
+		xpath_query();
+
 		// Destructor
 		// Destructor
 		~xpath_query();
 		~xpath_query();
 
 
+	#if __cplusplus >= 201103
+		// Move semantics support
+		xpath_query(xpath_query&& rhs);
+		xpath_query& operator=(xpath_query&& rhs);
+	#endif
+
 		// Get query expression return type
 		// Get query expression return type
 		xpath_value_type return_type() const;
 		xpath_value_type return_type() const;
-		
+
 		// Evaluate expression as boolean value in the specified context; performs type conversion if necessary.
 		// Evaluate expression as boolean value in the specified context; performs type conversion if necessary.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 		bool evaluate_boolean(const xpath_node& n) const;
 		bool evaluate_boolean(const xpath_node& n) const;
-		
+
 		// Evaluate expression as double value in the specified context; performs type conversion if necessary.
 		// Evaluate expression as double value in the specified context; performs type conversion if necessary.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 		double evaluate_number(const xpath_node& n) const;
 		double evaluate_number(const xpath_node& n) const;
-		
+
 	#ifndef PUGIXML_NO_STL
 	#ifndef PUGIXML_NO_STL
 		// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 		// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 		string_t evaluate_string(const xpath_node& n) const;
 		string_t evaluate_string(const xpath_node& n) const;
 	#endif
 	#endif
-		
+
 		// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 		// Evaluate expression as string value in the specified context; performs type conversion if necessary.
 		// At most capacity characters are written to the destination buffer, full result size is returned (includes terminating zero).
 		// At most capacity characters are written to the destination buffer, full result size is returned (includes terminating zero).
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
 		// If PUGIXML_NO_EXCEPTIONS is not defined, throws std::bad_alloc on out of memory errors.
@@ -1164,7 +1201,7 @@ namespace pugi
 		// Borland C++ workaround
 		// Borland C++ workaround
 		bool operator!() const;
 		bool operator!() const;
 	};
 	};
-	
+
 	#ifndef PUGIXML_NO_EXCEPTIONS
 	#ifndef PUGIXML_NO_EXCEPTIONS
 	// XPath exception class
 	// XPath exception class
 	class PUGIXML_CLASS xpath_exception: public std::exception
 	class PUGIXML_CLASS xpath_exception: public std::exception
@@ -1183,20 +1220,20 @@ namespace pugi
 		const xpath_parse_result& result() const;
 		const xpath_parse_result& result() const;
 	};
 	};
 	#endif
 	#endif
-	
+
 	// XPath node class (either xml_node or xml_attribute)
 	// XPath node class (either xml_node or xml_attribute)
 	class PUGIXML_CLASS xpath_node
 	class PUGIXML_CLASS xpath_node
 	{
 	{
 	private:
 	private:
 		xml_node _node;
 		xml_node _node;
 		xml_attribute _attribute;
 		xml_attribute _attribute;
-	
+
 		typedef void (*unspecified_bool_type)(xpath_node***);
 		typedef void (*unspecified_bool_type)(xpath_node***);
 
 
 	public:
 	public:
 		// Default constructor; constructs empty XPath node
 		// Default constructor; constructs empty XPath node
 		xpath_node();
 		xpath_node();
-		
+
 		// Construct XPath node from XML node/attribute
 		// Construct XPath node from XML node/attribute
 		xpath_node(const xml_node& node);
 		xpath_node(const xml_node& node);
 		xpath_node(const xml_attribute& attribute, const xml_node& parent);
 		xpath_node(const xml_attribute& attribute, const xml_node& parent);
@@ -1204,13 +1241,13 @@ namespace pugi
 		// Get node/attribute, if any
 		// Get node/attribute, if any
 		xml_node node() const;
 		xml_node node() const;
 		xml_attribute attribute() const;
 		xml_attribute attribute() const;
-		
+
 		// Get parent of contained node/attribute
 		// Get parent of contained node/attribute
 		xml_node parent() const;
 		xml_node parent() const;
 
 
 		// Safe bool conversion operator
 		// Safe bool conversion operator
 		operator unspecified_bool_type() const;
 		operator unspecified_bool_type() const;
-		
+
 		// Borland C++ workaround
 		// Borland C++ workaround
 		bool operator!() const;
 		bool operator!() const;
 
 
@@ -1236,13 +1273,13 @@ namespace pugi
 			type_sorted,			// Sorted by document order (ascending)
 			type_sorted,			// Sorted by document order (ascending)
 			type_sorted_reverse		// Sorted by document order (descending)
 			type_sorted_reverse		// Sorted by document order (descending)
 		};
 		};
-		
+
 		// Constant iterator type
 		// Constant iterator type
 		typedef const xpath_node* const_iterator;
 		typedef const xpath_node* const_iterator;
 
 
 		// We define non-constant iterator to be the same as constant iterator so that various generic algorithms (i.e. boost foreach) work
 		// We define non-constant iterator to be the same as constant iterator so that various generic algorithms (i.e. boost foreach) work
 		typedef const xpath_node* iterator;
 		typedef const xpath_node* iterator;
-	
+
 		// Default constructor. Constructs empty set.
 		// Default constructor. Constructs empty set.
 		xpath_node_set();
 		xpath_node_set();
 
 
@@ -1251,42 +1288,49 @@ namespace pugi
 
 
 		// Destructor
 		// Destructor
 		~xpath_node_set();
 		~xpath_node_set();
-		
+
 		// Copy constructor/assignment operator
 		// Copy constructor/assignment operator
 		xpath_node_set(const xpath_node_set& ns);
 		xpath_node_set(const xpath_node_set& ns);
 		xpath_node_set& operator=(const xpath_node_set& ns);
 		xpath_node_set& operator=(const xpath_node_set& ns);
 
 
+	#if __cplusplus >= 201103
+		// Move semantics support
+		xpath_node_set(xpath_node_set&& rhs);
+		xpath_node_set& operator=(xpath_node_set&& rhs);
+	#endif
+
 		// Get collection type
 		// Get collection type
 		type_t type() const;
 		type_t type() const;
-		
+
 		// Get collection size
 		// Get collection size
 		size_t size() const;
 		size_t size() const;
 
 
 		// Indexing operator
 		// Indexing operator
 		const xpath_node& operator[](size_t index) const;
 		const xpath_node& operator[](size_t index) const;
-		
+
 		// Collection iterators
 		// Collection iterators
 		const_iterator begin() const;
 		const_iterator begin() const;
 		const_iterator end() const;
 		const_iterator end() const;
 
 
 		// Sort the collection in ascending/descending order by document order
 		// Sort the collection in ascending/descending order by document order
 		void sort(bool reverse = false);
 		void sort(bool reverse = false);
-		
+
 		// Get first node in the collection by document order
 		// Get first node in the collection by document order
 		xpath_node first() const;
 		xpath_node first() const;
-		
+
 		// Check if collection is empty
 		// Check if collection is empty
 		bool empty() const;
 		bool empty() const;
-	
+
 	private:
 	private:
 		type_t _type;
 		type_t _type;
-		
+
 		xpath_node _storage;
 		xpath_node _storage;
-		
+
 		xpath_node* _begin;
 		xpath_node* _begin;
 		xpath_node* _end;
 		xpath_node* _end;
 
 
 		void _assign(const_iterator begin, const_iterator end, type_t type);
 		void _assign(const_iterator begin, const_iterator end, type_t type);
+		void _move(xpath_node_set& rhs);
 	};
 	};
 #endif
 #endif
 
 
@@ -1294,25 +1338,23 @@ namespace pugi
 	// Convert wide string to UTF8
 	// Convert wide string to UTF8
 	std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str);
 	std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const wchar_t* str);
 	std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >& str);
 	std::basic_string<char, std::char_traits<char>, std::allocator<char> > PUGIXML_FUNCTION as_utf8(const std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >& str);
-	
+
 	// Convert UTF8 to wide string
 	// Convert UTF8 to wide string
 	std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
 	std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const char* str);
 	std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >& str);
 	std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > PUGIXML_FUNCTION as_wide(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >& str);
 #endif
 #endif
 
 
-
 	pugi::xml_attribute PUGIXML_FUNCTION find_next_attribute(const pugi::xml_node &node, pugi::xml_attribute& attr, const char *name);
 	pugi::xml_attribute PUGIXML_FUNCTION find_next_attribute(const pugi::xml_node &node, pugi::xml_attribute& attr, const char *name);
 
 
-
 	// Memory allocation function interface; returns pointer to allocated memory or NULL on failure
 	// Memory allocation function interface; returns pointer to allocated memory or NULL on failure
 	typedef void* (*allocation_function)(size_t size);
 	typedef void* (*allocation_function)(size_t size);
-	
+
 	// Memory deallocation function interface
 	// Memory deallocation function interface
 	typedef void (*deallocation_function)(void* ptr);
 	typedef void (*deallocation_function)(void* ptr);
 
 
 	// Override default memory management functions. All subsequent allocations/deallocations will be performed via supplied functions.
 	// Override default memory management functions. All subsequent allocations/deallocations will be performed via supplied functions.
 	void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
 	void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
-	
+
 	// Get current memory management functions
 	// Get current memory management functions
 	allocation_function PUGIXML_FUNCTION get_memory_allocation_function();
 	allocation_function PUGIXML_FUNCTION get_memory_allocation_function();
 	deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function();
 	deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function();
@@ -1348,7 +1390,7 @@ namespace std
 #endif
 #endif
 
 
 /**
 /**
- * Copyright (c) 2006-2015 Arseny Kapoulkine
+ * Copyright (c) 2006-2016 Arseny Kapoulkine
  *
  *
  * Permission is hereby granted, free of charge, to any person
  * Permission is hereby granted, free of charge, to any person
  * obtaining a copy of this software and associated documentation
  * obtaining a copy of this software and associated documentation
@@ -1361,7 +1403,7 @@ namespace std
  *
  *
  * The above copyright notice and this permission notice shall be
  * The above copyright notice and this permission notice shall be
  * included in all copies or substantial portions of the Software.
  * included in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

+ 4 - 3
oxygine/src/res/ResFontBM.cpp

@@ -63,11 +63,12 @@ namespace oxygine
         cleanup();
         cleanup();
     }
     }
 
 
-    void ResFontBM::init(const char* path, const char* file, bool premultipliedAlpha, bool signedDistanceFont)
+
+    void ResFontBM::init(const char* path, bool premultipliedAlpha)
     {
     {
         _premultipliedAlpha = premultipliedAlpha;
         _premultipliedAlpha = premultipliedAlpha;
-        _file = std::string(path) + "/" + file;
-        _createFont(0, signedDistanceFont, false);
+        _file = path;
+        _createFont(0, false, false);
     }
     }
 
 
     void ResFontBM::cleanup()
     void ResFontBM::cleanup()

+ 2 - 2
oxygine/src/res/ResFontBM.h

@@ -23,7 +23,7 @@ namespace oxygine
         ~ResFontBM();
         ~ResFontBM();
 
 
         /**use it only if you want create font without Resources*/
         /**use it only if you want create font without Resources*/
-        void init(const char* path, const char* file, bool premultipliedAlpha = true, bool signedDistanceFont = false);
+        void init(const char* fntPath, bool premultipliedAlpha = true);
 
 
         void cleanup();
         void cleanup();
 
 
@@ -54,4 +54,4 @@ namespace oxygine
         std::string _file;
         std::string _file;
         bool _premultipliedAlpha;
         bool _premultipliedAlpha;
     };
     };
-}
+}

+ 1 - 1
oxygine/src/res/Resources.h

@@ -129,9 +129,9 @@ namespace oxygine
 
 
 
 
         resources _resources;
         resources _resources;
-        //resources _owned;
         resources _fastAccessResources;
         resources _fastAccessResources;
 
 
+
         typedef std::vector< registeredResource > registeredResources;
         typedef std::vector< registeredResource > registeredResources;
         static registeredResources _registeredResources;
         static registeredResources _registeredResources;
 
 

Some files were not shown because too many files changed in this diff