فهرست منبع

add color shader

[email protected] 8 سال پیش
والد
کامیت
1446b38a2d

+ 1 - 1
oxygine/src/AsyncTask.cpp

@@ -13,7 +13,7 @@ namespace oxygine
 
 
     AsyncTask::~AsyncTask()
     AsyncTask::~AsyncTask()
     {
     {
-        LOGD("~");
+        //LOGD("~");
     }
     }
 
 
     void AsyncTask::run()
     void AsyncTask::run()

+ 4 - 4
oxygine/src/core/STDFileSystem.cpp

@@ -232,11 +232,11 @@ namespace oxygine
             std::string     root = path;
             std::string     root = path;
             std::string     strFilePath;                 // Filepath
             std::string     strFilePath;                 // Filepath
             std::string     strPattern;                  // Pattern
             std::string     strPattern;                  // Pattern
-            WIN32_FIND_DATA FileInformation;             // File information
+            WIN32_FIND_DATAA FileInformation;             // File information
 
 
 
 
             strPattern = root + "\\*.*";
             strPattern = root + "\\*.*";
-            hFile = ::FindFirstFile(strPattern.c_str(), &FileInformation);
+            hFile = ::FindFirstFileA(strPattern.c_str(), &FileInformation);
             if (hFile == INVALID_HANDLE_VALUE)
             if (hFile == INVALID_HANDLE_VALUE)
                 return -1;
                 return -1;
 
 
@@ -253,11 +253,11 @@ namespace oxygine
                     }
                     }
                     else
                     else
                     {
                     {
-                        DeleteFile(strFilePath.c_str());
+                        DeleteFileA(strFilePath.c_str());
                     }
                     }
                 }
                 }
             }
             }
-            while (::FindNextFile(hFile, &FileInformation) == TRUE);
+            while (::FindNextFileA(hFile, &FileInformation) == TRUE);
 
 
             // Close handle
             // Close handle
             ::FindClose(hFile);
             ::FindClose(hFile);

+ 3 - 0
oxygine/src/core/UberShaderProgram.cpp

@@ -66,6 +66,9 @@ namespace oxygine
             if (flags & MASK)
             if (flags & MASK)
                 strcat(prepend, "#define MASK\n");
                 strcat(prepend, "#define MASK\n");
 
 
+            if (flags & ADD_COLOR)
+                strcat(prepend, "#define ADD_COLOR\n");
+
             if (flags & SDF)
             if (flags & SDF)
             {
             {
                 strcat(prepend, "#define SDF\n");
                 strcat(prepend, "#define SDF\n");

+ 2 - 1
oxygine/src/core/UberShaderProgram.h

@@ -54,8 +54,9 @@ namespace oxygine
             MASK_R_CHANNEL = 1 << 2,
             MASK_R_CHANNEL = 1 << 2,
             MASK = 1 << 3,
             MASK = 1 << 3,
             SDF = 1 << 4,
             SDF = 1 << 4,
+            ADD_COLOR = 1 << 5,
             SDF_OUTLINE = 1 << 1,//same as SEPARATE_ALPHA
             SDF_OUTLINE = 1 << 1,//same as SEPARATE_ALPHA
-            _SIZE = 1 << 5
+            _SIZE = 1 << 6
         };
         };
 
 
         enum
         enum

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

@@ -102,6 +102,8 @@ namespace oxygine
 
 
         handle open(const std::string& file_, const char* mode, error_policy ep)
         handle open(const std::string& file_, const char* mode, error_policy ep)
         {
         {
+            if (file_ == "sounds/button_click.mp3")
+                int q = 0;
 
 
 #ifdef OX_DEBUG
 #ifdef OX_DEBUG
             if (!strstr(mode, "b"))
             if (!strstr(mode, "b"))

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1
oxygine/src/core/system_data.cpp


+ 9 - 2
oxygine/system_data/original/system/shader.glsl

@@ -35,6 +35,7 @@ void program_main_vs()
 
 
 #ifdef PS
 #ifdef PS
 uniform lowp vec4 clip_mask;
 uniform lowp vec4 clip_mask;
+uniform lowp vec4 add_color;
 uniform lowp sampler2D base_texture;
 uniform lowp sampler2D base_texture;
 uniform lowp sampler2D mask_texture;
 uniform lowp sampler2D mask_texture;
 uniform lowp sampler2D alpha_texture;
 uniform lowp sampler2D alpha_texture;
@@ -130,10 +131,16 @@ lowp vec4 get_color()
 
 
 #ifdef DONT_MULT_BY_RESULT_COLOR
 #ifdef DONT_MULT_BY_RESULT_COLOR
 	//for your purposes
 	//for your purposes
-	return base;
+	lowp vec4 res = base;
 #else
 #else
-	return base * result_color;
+	lowp vec4 res = base * result_color;
 #endif	
 #endif	
+
+#ifdef ADD_COLOR
+	res = res + add_color * res.a;
+#endif
+
+	return res;
 }
 }
 
 
 
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است