-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolour_fix.diff
More file actions
96 lines (90 loc) · 3.16 KB
/
colour_fix.diff
File metadata and controls
96 lines (90 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
diff --git a/minuitwrp/Android.bp b/minuitwrp/Android.bp
--- a/minuitwrp/Android.bp
+++ b/minuitwrp/Android.bp
@@ -8,7 +8,8 @@ bootstrap_go_package {
],
srcs: [
"libminuitwrp_defaults.go",
- "../soong/makevars.go"
+ "../soong/makevars.go",
+ "../orangefox_defaults.go"
],
pluginFor: ["soong_build"]
}
diff --git a/minuitwrp/graphics.cpp b/minuitwrp/graphics.cpp
--- a/minuitwrp/graphics.cpp
+++ b/minuitwrp/graphics.cpp
@@ -203,7 +203,7 @@ void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a
{
GGLContext *gl = gr_context;
GGLint color[4];
-#if defined(RECOVERY_ARGB) || defined(RECOVERY_BGRA)
+#if defined(RECOVERY_ARGB) || defined(RECOVERY_BGRA) || defined(RECOVERY_ABGR) && !defined(FOX_RECOVERY_AGRB)
color[0] = ((b << 8) | r) + 1;
color[1] = ((g << 8) | g) + 1;
color[2] = ((r << 8) | b) + 1;
diff --git a/minuitwrp/libminuitwrp_defaults.go b/minuitwrp/libminuitwrp_defaults.go
--- a/minuitwrp/libminuitwrp_defaults.go
+++ b/minuitwrp/libminuitwrp_defaults.go
@@ -78,6 +78,7 @@ func globalFlags(ctx android.BaseContext) []string {
cflags = append(cflags, "-DTW_ROTATION=0")
}
}
+
return cflags
}
@@ -199,6 +200,11 @@ func libMinuiTwrpDefaults(ctx android.LoadHookContext) {
requiredModules := globalRequiredModules(ctx)
p.Required = requiredModules
ctx.AppendProperties(p)
+ // Darth9
+ f := &props{}
+ f.Cflags = fox_globalFlags(ctx)
+ ctx.AppendProperties(f)
+ // Darth9
}
func init() {
diff --git a/minuitwrp/resources.cpp b/minuitwrp/resources.cpp
--- a/minuitwrp/resources.cpp
+++ b/minuitwrp/resources.cpp
@@ -224,7 +224,7 @@ int res_create_surface_png(const char* name, gr_surface* pSurface) {
goto exit;
}
-#if defined(RECOVERY_ARGB) || defined(RECOVERY_BGRA)
+#if defined(RECOVERY_ARGB) || defined(RECOVERY_BGRA) || defined(RECOVERY_ABGR) && !defined(FOX_RECOVERY_AGRB)
png_set_bgr(png_ptr);
#endif
@@ -320,7 +320,7 @@ int res_create_surface_jpg(const char* name, gr_surface* pSurface) {
unsigned char g = pRow[sx + 1];
unsigned char b = pRow[sx + 2];
unsigned char a = 0xff;
-#if defined(RECOVERY_ARGB) || defined(RECOVERY_BGRA)
+#if defined(RECOVERY_ARGB) || defined(RECOVERY_BGRA) || defined(RECOVERY_ABGR) && !defined(FOX_RECOVERY_AGRB)
pRow[dx ] = b; // r
pRow[dx + 1] = g; // g
pRow[dx + 2] = r; // b
diff --git a/orangefox.mk b/orangefox.mk
--- a/orangefox.mk
+++ b/orangefox.mk
@@ -714,4 +714,9 @@ endif
ifeq ($(OF_FORCE_DATA_FORMAT_F2FS),1)
LOCAL_CFLAGS += -DOF_FORCE_DATA_FORMAT_F2FS
endif
+
+# whether the display colours are inverted
+ifeq ($(FOX_RECOVERY_AGRB),1)
+ LOCAL_CFLAGS += -DFOX_RECOVERY_AGRB
+endif
#
diff --git a/orangefox_defaults.go b/orangefox_defaults.go
--- a/orangefox_defaults.go
+++ b/orangefox_defaults.go
@@ -45,6 +45,10 @@ func fox_globalFlags(ctx android.BaseContext) []string {
foxflags = append(foxflags, "-DFOX_SETTINGS_ROOT_DIRECTORY="+getMakeVars(ctx, "FOX_SETTINGS_ROOT_DIRECTORY"))
}
+ if ctx.AConfig().Getenv("FOX_RECOVERY_AGRB") == "1" {
+ foxflags = append(foxflags, "-DFOX_RECOVERY_AGRB=1")
+ }
+
return foxflags
}