Browse Source

Merge branch 'master' into ox-move

dmuratshin 8 years ago
parent
commit
3b1b5f340f

+ 8 - 2
oxygine/src/oxygine/actor/Actor.cpp

@@ -1520,9 +1520,15 @@ namespace oxygine
         tl = tr.transform(tl);
         tl = tr.transform(tl);
         br = tr.transform(br);
         br = tr.transform(br);
 
 
-        Vector2 size = br - tl;
+        Vector2 size = Vector2(
+			abs(br.x - tl.x),
+			abs(br.y - tl.y));
 
 
-        return RectF(tl, size);
+        Vector2 ntl;
+		ntl.x = std::min(tl.x, br.x);
+		ntl.y = std::min(tl.y, br.y);
+
+        return RectF(ntl, size);
     }
     }
 
 
 
 

+ 12 - 2
oxygine/src/oxygine/core/oxygine.cpp

@@ -251,7 +251,7 @@ namespace oxygine
             log::messageln("SDL build");
             log::messageln("SDL build");
 
 
 
 
-            SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
+            SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, desc.allow_screensaver ? "1" : "0");
 
 
             SDL_Init(SDL_INIT_VIDEO);
             SDL_Init(SDL_INIT_VIDEO);
 
 
@@ -285,11 +285,21 @@ namespace oxygine
 
 
             SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
             SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
 
 
-            int flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
+            int flags = SDL_WINDOW_OPENGL;
 
 
 #if TARGET_OS_IPHONE
 #if TARGET_OS_IPHONE
+            flags |= SDL_WINDOW_SHOWN;
             flags |= SDL_WINDOW_BORDERLESS;
             flags |= SDL_WINDOW_BORDERLESS;
             flags |= SDL_WINDOW_ALLOW_HIGHDPI;
             flags |= SDL_WINDOW_ALLOW_HIGHDPI;
+#else
+            if(desc.show_window)
+                flags |= SDL_WINDOW_SHOWN;
+
+            if(desc.borderless)
+                flags |= SDL_WINDOW_BORDERLESS;
+
+            if(desc.resizable)
+                flags |= SDL_WINDOW_RESIZABLE;
 #endif
 #endif
 
 
             //SDL_DisplayMode mode;
             //SDL_DisplayMode mode;

+ 17 - 8
oxygine/src/oxygine/core/oxygine.h

@@ -46,18 +46,30 @@ namespace oxygine
     {
     {
         struct init_desc
         struct init_desc
         {
         {
-            init_desc() : mode24bpp(true), w(-1), h(-1), fullscreen(false), title("Oxygine"), vsync(true), appName(0), companyName(0), force_gles(false) {}
+            init_desc() :w(-1), h(-1),  mode24bpp(true), vsync(true), fullscreen(false), resizable(false), borderless(false), show_window(true), force_gles(false), allow_screensaver(true), title("Oxygine"), appName(0), companyName(0) {}
 
 
-            /**sets 24 bits per pixel, otherwise sets 16 bits per pixel?*/
-            bool mode24bpp;
             /**display width*/
             /**display width*/
             int w;
             int w;
             /**display height*/
             /**display height*/
             int h;
             int h;
+
+            /**sets 24 bits per pixel, otherwise sets 16 bits per pixel?*/
+            unsigned int mode24bpp :1;
             /**vertical sync*/
             /**vertical sync*/
-            bool vsync;
+            unsigned int vsync :1;
             /**fullscreen mode*/
             /**fullscreen mode*/
-            bool fullscreen;
+            unsigned int fullscreen :1;
+            /**can the window be resized*/
+            unsigned int resizable :1;
+            /**borderless window*/
+            unsigned int borderless :1;
+            /**will the window be visible*/
+            unsigned int show_window :1;
+            /**use OpenGLES driver. Could be used on Windows for emulation OpenGLES via Direct3D*/
+            unsigned int force_gles :1;
+            /**allow screensaver*/
+            unsigned int allow_screensaver :1;
+
             /**window title*/
             /**window title*/
             const char* title;
             const char* title;
 
 
@@ -65,9 +77,6 @@ namespace oxygine
             const char* appName;
             const char* appName;
             /** Company name to be used as part of the file system directory for writable storage*/
             /** Company name to be used as part of the file system directory for writable storage*/
             const char* companyName;
             const char* companyName;
-
-            /**use OpenGLES driver. Could be used on Windows for emulation OpenGLES via Direct3D*/
-            bool force_gles;
         };
         };
 
 
         void init0();
         void init0();

+ 14 - 2
readme/emscripten.txt

@@ -2,9 +2,9 @@
 2. emscripten build configured with CMakeFiles
 2. emscripten build configured with CMakeFiles
 
 
 How to build. Steps:
 How to build. Steps:
-- Install Emscripten SDK and setup it. Minimal version 1.35.0 required
+- Install Emscripten SDK and setup it. Latest tested version 1.37.22 required
 - Install CMake
 - Install CMake
-- Installe JDK version 6/7
+- Install JDK version 7/8
 - if you are Windows user you need also install Make tool:
 - if you are Windows user you need also install Make tool:
   - Install GnuMake (http://gnuwin32.sourceforge.net/packages/make.htm) or any other 
   - Install GnuMake (http://gnuwin32.sourceforge.net/packages/make.htm) or any other 
   - add it to PATH environment variable
   - add it to PATH environment variable
@@ -29,6 +29,18 @@ How to build. Steps:
 - Go to new created "build_emsc" folder and open Demo.html with Browser
 - Go to new created "build_emsc" folder and open Demo.html with Browser
 
 
 
 
+*** 
+In case of build error:
+   "error: reference to 'log' is ambiguous"
+ open emscripten file:
+    emscripten\emscripten\1.37.22\system\include\libcxx\math.h
+find line:
+	log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
+and replace it with:
+	log(_A1 __lcpp_x) _NOEXCEPT {return ::log((double)__lcpp_x);}
+***
+
+
 2b. You could generate your own emscipten build configuration
 2b. You could generate your own emscipten build configuration
 =================================================================================================
 =================================================================================================
 - You need python 2.7 installed
 - You need python 2.7 installed