Browse Source

minor fixes

dmuratshin 10 years ago
parent
commit
7c466f5b83

+ 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;
         }
         }
     }
     }
-}
+}

+ 19 - 15
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,14 +70,23 @@ 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   EMSCRIPTEN
+        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)
+        gles = profile == SDL_GL_CONTEXT_PROFILE_ES;
+#else
+#endif
+
+        if (gles)
         {
         {
+            *ptr = "precision float mediump;";
         }
         }
         else
         else
         {
         {
@@ -89,14 +99,8 @@ namespace oxygine
                 "#define highp\n";
                 "#define highp\n";
 
 
             *ptr = nonGLES;
             *ptr = nonGLES;
-            ptr++;
-
         }
         }
-
-#   else
-        *ptr = "precision float mediump;";
-#   endif
-#endif
+        ptr++;
 
 
 
 
         if (prepend)
         if (prepend)

+ 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

+ 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;
     };
     };
-}
+}