aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-04-25 15:38:47 +0300
committerJoursoir <chat@joursoir.net>2022-04-25 15:38:47 +0300
commitfb21722ed2dde51ca04d95e86f44d159673fff2d (patch)
tree2b34847972c4ca28121cb6f8ff67d120ebf423a4
parent6270073d0f155ba0d570ef597a8efb6bc9853f75 (diff)
downloadumt-fb21722ed2dde51ca04d95e86f44d159673fff2d.tar.gz
umt-fb21722ed2dde51ca04d95e86f44d159673fff2d.tar.bz2
umt-fb21722ed2dde51ca04d95e86f44d159673fff2d.zip
replace local color constants with global ones
-rw-r--r--UefiMonitorTest/Graphics.c19
-rw-r--r--UefiMonitorTest/Graphics.h22
-rw-r--r--UefiMonitorTest/UefiMonitorTest.c35
3 files changed, 41 insertions, 35 deletions
diff --git a/UefiMonitorTest/Graphics.c b/UefiMonitorTest/Graphics.c
index ce0b757..0570dd8 100644
--- a/UefiMonitorTest/Graphics.c
+++ b/UefiMonitorTest/Graphics.c
@@ -33,6 +33,25 @@ CONST EFI_PIXEL_BITMASK mBgrPixelMasks = {
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
};
+CONST GRAPHICS_PIXEL_COLOR gUmtColors[UMT_COLOR_END] = {
+ { 0x00, 0x00, 0x00, 0x00 },
+ { 0xFF, 0xFF, 0xFF, 0x00 },
+ { 0x00, 0x00, 0xFF, 0x00 },
+ { 0x00, 0xFF, 0x00, 0x00 },
+ { 0xFF, 0x00, 0x00, 0x00 },
+ { 0x00, 0xFF, 0xFF, 0x00 },
+ { 0xFF, 0xFF, 0x00, 0x00 },
+ { 0xFF, 0x00, 0xFF, 0x00 },
+ { 0xC0, 0xC0, 0xC0, 0x00 },
+ { 0x80, 0x80, 0x80, 0x00 },
+ { 0x00, 0x00, 0x80, 0x00 },
+ { 0x00, 0x80, 0x80, 0x00 },
+ { 0x00, 0x80, 0x00, 0x00 },
+ { 0x80, 0x00, 0x80, 0x00 },
+ { 0x80, 0x80, 0x00, 0x00 },
+ { 0x80, 0x00, 0x00, 0x00 }
+};
+
STATIC
VOID
ParseGraphicsPixelFormat (
diff --git a/UefiMonitorTest/Graphics.h b/UefiMonitorTest/Graphics.h
index 44c72aa..503a222 100644
--- a/UefiMonitorTest/Graphics.h
+++ b/UefiMonitorTest/Graphics.h
@@ -79,6 +79,28 @@ typedef struct {
EFI_SIMPLE_POINTER_PROTOCOL *MouseInterface;
} GRAPHICS_CONTEXT;
+enum UMT_COLORS {
+ UMT_COLOR_BLACK = 0,
+ UMT_COLOR_WHITE,
+ UMT_COLOR_RED,
+ UMT_COLOR_LIME,
+ UMT_COLOR_BLUE,
+ UMT_COLOR_YELLOW,
+ UMT_COLOR_AQUA,
+ UMT_COLOR_MAGENTA,
+ UMT_COLOR_SILVER,
+ UMT_COLOR_GRAY,
+ UMT_COLOR_MAROON,
+ UMT_COLOR_OLIVE,
+ UMT_COLOR_GREEN,
+ UMT_COLOR_PURPLE,
+ UMT_COLOR_TEAL,
+ UMT_COLOR_NAVY,
+ UMT_COLOR_END
+};
+
+extern CONST GRAPHICS_PIXEL_COLOR gUmtColors[];
+
EFI_STATUS
PrepareGraphicsInfo (
IN GRAPHICS_CONTEXT *Graphics,
diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c
index 1fadfca..09923a1 100644
--- a/UefiMonitorTest/UefiMonitorTest.c
+++ b/UefiMonitorTest/UefiMonitorTest.c
@@ -7,41 +7,6 @@
#include "UefiMonitorTest.h"
-#define UMT_COLOR_BLACK 0
-#define UMT_COLOR_WHITE 1
-#define UMT_COLOR_RED 2
-#define UMT_COLOR_LIME 3
-#define UMT_COLOR_BLUE 4
-#define UMT_COLOR_YELLOW 5
-#define UMT_COLOR_AQUA 6
-#define UMT_COLOR_MAGENTA 7
-#define UMT_COLOR_SILVER 8
-#define UMT_COLOR_GRAY 9
-#define UMT_COLOR_MAROON 10
-#define UMT_COLOR_OLIVE 11
-#define UMT_COLOR_GREEN 12
-#define UMT_COLOR_PURPLE 13
-#define UMT_COLOR_TEAL 14
-#define UMT_COLOR_NAVY 15
-
-STATIC GRAPHICS_PIXEL_COLOR mColors[16] = {
- { 0x00, 0x00, 0x00, 0x00 },
- { 0xFF, 0xFF, 0xFF, 0x00 },
- { 0x00, 0x00, 0xFF, 0x00 },
- { 0x00, 0xFF, 0x00, 0x00 },
- { 0xFF, 0x00, 0x00, 0x00 },
- { 0x00, 0xFF, 0xFF, 0x00 },
- { 0xFF, 0xFF, 0x00, 0x00 },
- { 0xFF, 0x00, 0xFF, 0x00 },
- { 0xC0, 0xC0, 0xC0, 0x00 },
- { 0x80, 0x80, 0x80, 0x00 },
- { 0x00, 0x00, 0x80, 0x00 },
- { 0x00, 0x80, 0x80, 0x00 },
- { 0x00, 0x80, 0x00, 0x00 },
- { 0x80, 0x00, 0x80, 0x00 },
- { 0x80, 0x80, 0x00, 0x00 },
- { 0x80, 0x00, 0x00, 0x00 }
-};
STATIC
EFI_GRAPHICS_OUTPUT_PROTOCOL *