diff options
author | inmarket <andrewh@inmarket.com.au> | 2018-07-08 11:19:43 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2018-07-08 11:19:43 +1000 |
commit | f9c848e9851713d7a33962b9b4768c0a0d1751f1 (patch) | |
tree | 2b2caf1949078428ca3fd3cd47547d0485efa407 /demos | |
parent | cfb1b2a488d5b1a9e14c889b80e5324d16f63f1b (diff) | |
download | uGFX-f9c848e9851713d7a33962b9b4768c0a0d1751f1.tar.gz uGFX-f9c848e9851713d7a33962b9b4768c0a0d1751f1.tar.bz2 uGFX-f9c848e9851713d7a33962b9b4768c0a0d1751f1.zip |
Change color_t to gColor
Diffstat (limited to 'demos')
-rw-r--r-- | demos/3rdparty/bubbles/main.c | 6 | ||||
-rw-r--r-- | demos/3rdparty/notepad-2/notepadApp.c | 8 | ||||
-rw-r--r-- | demos/3rdparty/notepad-2/notepadCore.c | 6 | ||||
-rw-r--r-- | demos/3rdparty/notepad-2/notepadCore.h | 4 | ||||
-rw-r--r-- | demos/3rdparty/notepad-2/notepadUIDefines.h | 18 | ||||
-rw-r--r-- | demos/applications/combo/bounce.c | 2 | ||||
-rw-r--r-- | demos/applications/mandelbrot/main.c | 2 | ||||
-rw-r--r-- | demos/applications/notepad/main.c | 2 | ||||
-rw-r--r-- | demos/benchmarks/main.c | 2 | ||||
-rw-r--r-- | demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h | 4 | ||||
-rw-r--r-- | demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h | 4 | ||||
-rw-r--r-- | demos/games/tetris/tetris.c | 4 | ||||
-rw-r--r-- | demos/modules/gdisp/streaming/main.c | 2 |
13 files changed, 32 insertions, 32 deletions
diff --git a/demos/3rdparty/bubbles/main.c b/demos/3rdparty/bubbles/main.c index f167b536..7ab4da2e 100644 --- a/demos/3rdparty/bubbles/main.c +++ b/demos/3rdparty/bubbles/main.c @@ -44,7 +44,7 @@ void initialize (void) } -void matrix (int16_t xyz[3][N], color_t col[N]) +void matrix (int16_t xyz[3][N], gColor col[N]) { static uint32_t t = 0; int16_t x = -SCALE, y = -SCALE; @@ -106,7 +106,7 @@ void rotate (int16_t xyz[3][N], uint16_t angleX, uint16_t angleY, uint16_t angle } -void draw(int16_t xyz[3][N], color_t col[N]) +void draw(int16_t xyz[3][N], gColor col[N]) { static uint16_t oldProjX[N] = {0}; static uint16_t oldProjY[N] = {0}; @@ -142,7 +142,7 @@ int16_t angleX = 0, angleY = 0, angleZ = 0; int16_t speedX = 0, speedY = 0, speedZ = 0; int16_t xyz[3][N]; -color_t col[N]; +gColor col[N]; int main (void) diff --git a/demos/3rdparty/notepad-2/notepadApp.c b/demos/3rdparty/notepad-2/notepadApp.c index 57d2ad20..722e2c8d 100644 --- a/demos/3rdparty/notepad-2/notepadApp.c +++ b/demos/3rdparty/notepad-2/notepadApp.c @@ -63,9 +63,9 @@ static GButtonObject btnClose; // Image object static gdispImage toolbarImageFilmstrip; -static color_t myColors[] = { GFX_BLACK, GFX_RED, GFX_GREEN, GFX_BLUE, GFX_CYAN, GFX_MAGENTA, GFX_YELLOW, GFX_WHITE }; +static gColor myColors[] = { GFX_BLACK, GFX_RED, GFX_GREEN, GFX_BLUE, GFX_CYAN, GFX_MAGENTA, GFX_YELLOW, GFX_WHITE }; -static color_t selColor = GFX_BLACK; +static gColor selColor = GFX_BLACK; static int selColorIndex = 0, selPenWidth = 1, tbMode = 1; static NColorScheme nCurColorScheme; @@ -156,7 +156,7 @@ static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const c #define ccs nCurColorScheme int i, j = 0, k; - color_t ca, cb; + gColor ca, cb; GEventMouse ptr; (void)txt; @@ -218,7 +218,7 @@ static void nbtnColorBarSelDraw(GHandle gh, gBool enabled, gBool isdown, const c static void nToolbarImageButtonDraw(GHandle gh, gBool isenabled, gBool isdown, const char *txt, const GButtonDrawStyle *pstyle, void *param) { (void)txt; (void)pstyle; (void)isenabled; - color_t cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel; + gColor cl = isdown ? nCurColorScheme.toolbarBgActive : nCurColorScheme.toolbarBgUnsel; gdispImageSetBgColor(&toolbarImageFilmstrip, cl); gdispFillArea(gh->x, gh->y, gh->width, gh->height, cl); diff --git a/demos/3rdparty/notepad-2/notepadCore.c b/demos/3rdparty/notepad-2/notepadCore.c index 2a739e12..ffe95d50 100644 --- a/demos/3rdparty/notepad-2/notepadCore.c +++ b/demos/3rdparty/notepad-2/notepadCore.c @@ -56,7 +56,7 @@ static GHandle nStatusConsole = NULL; static volatile gBool doExit; static void draw_point(gCoord x, gCoord y) { - color_t c = ncoreDrawingArea->color; + gColor c = ncoreDrawingArea->color; if (nMode == NCORE_MODE_DRAW) c = ncoreDrawingArea->color; @@ -227,8 +227,8 @@ void ncoreSetPenWidth(uint8_t penWidth) { nPenWidth = penWidth; } uint8_t ncoreGetPenWidth(void) { return nPenWidth; } /* Get and set the drawing color */ -void ncoreSetPenColor(color_t penColor) { gwinSetColor(ncoreDrawingArea, penColor); } -color_t ncoreGetPenColor(void) { return ncoreDrawingArea->color; } +void ncoreSetPenColor(gColor penColor) { gwinSetColor(ncoreDrawingArea, penColor); } +gColor ncoreGetPenColor(void) { return ncoreDrawingArea->color; } /* Set mode */ void ncoreSetMode(uint8_t mode) { nMode = mode; } diff --git a/demos/3rdparty/notepad-2/notepadCore.h b/demos/3rdparty/notepad-2/notepadCore.h index 937a023b..dc75be3e 100644 --- a/demos/3rdparty/notepad-2/notepadCore.h +++ b/demos/3rdparty/notepad-2/notepadCore.h @@ -58,8 +58,8 @@ void ncoreSetPenWidth(uint8_t penWidth); uint8_t ncoreGetPenWidth(void); /* Get and set the drawing color */ -void ncoreSetPenColor(color_t penColor); -color_t ncoreGetPenColor(void); +void ncoreSetPenColor(gColor penColor); +gColor ncoreGetPenColor(void); /* Get and set the pen mode */ void ncoreSetMode(uint8_t mode); diff --git a/demos/3rdparty/notepad-2/notepadUIDefines.h b/demos/3rdparty/notepad-2/notepadUIDefines.h index 4d3aef9b..e1637d87 100644 --- a/demos/3rdparty/notepad-2/notepadUIDefines.h +++ b/demos/3rdparty/notepad-2/notepadUIDefines.h @@ -97,18 +97,18 @@ /* Color scheme definition */ typedef struct colScheme { - color_t titleBarColor; - color_t titleTextColor; + gColor titleBarColor; + gColor titleTextColor; - color_t winBgColor; - color_t drawingWinBorder; + gColor winBgColor; + gColor drawingWinBorder; - color_t toolbarSeparator; - color_t toolbarBgUnsel; - color_t toolbarBgActive; - color_t toolbarBgSel; + gColor toolbarSeparator; + gColor toolbarBgUnsel; + gColor toolbarBgActive; + gColor toolbarBgSel; - color_t statusBarText; + gColor statusBarText; } NColorScheme; diff --git a/demos/applications/combo/bounce.c b/demos/applications/combo/bounce.c index 33bb8394..1ca82d00 100644 --- a/demos/applications/combo/bounce.c +++ b/demos/applications/combo/bounce.c @@ -66,7 +66,7 @@ static DECLARE_THREAD_FUNCTION(task, param) { gCoord width, height, x, y, radius, ballx, bally, dx, floor; gCoord minx, miny, maxx, maxy, winx, winy; gCoord ballcx, ballcy; - color_t colour; + gColor colour; float ii, spin, dy, spinspeed, h, f, g; (void) param; diff --git a/demos/applications/mandelbrot/main.c b/demos/applications/mandelbrot/main.c index 808ef1c2..d5af7720 100644 --- a/demos/applications/mandelbrot/main.c +++ b/demos/applications/mandelbrot/main.c @@ -32,7 +32,7 @@ void mandelbrot(float x1, float y1, float x2, float y2) {
unsigned int i,j, width, height;
uint16_t iter;
- color_t color;
+ gColor color;
float fwidth, fheight;
float sy = y2 - y1;
diff --git a/demos/applications/notepad/main.c b/demos/applications/notepad/main.c index 72fb23e2..877be7fa 100644 --- a/demos/applications/notepad/main.c +++ b/demos/applications/notepad/main.c @@ -74,7 +74,7 @@ void drawScreen(void) { GEventMouse ev;
int main(void) {
- color_t color = GFX_BLACK;
+ gColor color = GFX_BLACK;
uint16_t pen = 0;
gfxInit();
diff --git a/demos/benchmarks/main.c b/demos/benchmarks/main.c index 65dbd0bc..17058610 100644 --- a/demos/benchmarks/main.c +++ b/demos/benchmarks/main.c @@ -89,7 +89,7 @@ void benchmark(void) { uint32_t i, pixels, ms, pps;
char pps_str[25];
gCoord height, width, rx, ry, rcx, rcy;
- color_t random_color;
+ gColor random_color;
font_t font;
gdispSetOrientation(GDISP_ROTATE_90);
diff --git a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h index dc3580e6..736840e2 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h @@ -155,7 +155,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); @@ -166,7 +166,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); diff --git a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h index 7e2bb05d..f8ddfe51 100644 --- a/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h +++ b/demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h @@ -153,7 +153,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) - static GFXINLINE void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_noinc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); @@ -164,7 +164,7 @@ static GFXINLINE uint16_t read_data(GDisplay *g) { } } - static GFXINLINE void dma_with_inc(GDisplay *g, color_t *buffer, int area) { + static GFXINLINE void dma_with_inc(GDisplay *g, gColor *buffer, int area) { (void) g; dmaStreamSetPeripheral(GDISP_DMA_STREAM, buffer); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PINC | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); diff --git a/demos/games/tetris/tetris.c b/demos/games/tetris/tetris.c index cf73c978..937ca87a 100644 --- a/demos/games/tetris/tetris.c +++ b/demos/games/tetris/tetris.c @@ -63,7 +63,7 @@ E C D */ const uint8_t sevenSegNumbers[10] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F}; // 0,1,2,3,4,5,6,7,8,9 -const color_t tetrisShapeColors[9] = {GFX_BLACK, HTML2COLOR(0x009000), GFX_RED, GFX_BLUE, GFX_MAGENTA, GFX_SKYBLUE, GFX_ORANGE, HTML2COLOR(0xBBBB00), GFX_WHITE}; // shape colors +const gColor tetrisShapeColors[9] = {GFX_BLACK, HTML2COLOR(0x009000), GFX_RED, GFX_BLUE, GFX_MAGENTA, GFX_SKYBLUE, GFX_ORANGE, HTML2COLOR(0xBBBB00), GFX_WHITE}; // shape colors // default tetris shapes const int tetrisShapes[TETRIS_SHAPE_COUNT][4][2] = { {{4, 17},{4, 16},{5, 16},{4, 15}}, @@ -143,7 +143,7 @@ static int uitoa(unsigned int value, char * buf, int max) { return n; } -static void sevenSegDraw(int x, int y, uint8_t number, color_t color) { +static void sevenSegDraw(int x, int y, uint8_t number, gColor color) { if (number & 0x01) gdispFillArea(x+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, y, SEVEN_SEG_WIDTH, SEVEN_SEG_HEIGHT, color); // A if (number & 0x02) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+SEVEN_SEG_HEIGHT+SEVEN_SEG_SIZE, SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // B if (number & 0x04) gdispFillArea(x+SEVEN_SEG_HEIGHT+(SEVEN_SEG_SIZE*2)+SEVEN_SEG_WIDTH, y+(SEVEN_SEG_HEIGHT*2)+SEVEN_SEG_WIDTH+(SEVEN_SEG_SIZE*3), SEVEN_SEG_HEIGHT, SEVEN_SEG_WIDTH, color); // C diff --git a/demos/modules/gdisp/streaming/main.c b/demos/modules/gdisp/streaming/main.c index 695b15b6..08067c4d 100644 --- a/demos/modules/gdisp/streaming/main.c +++ b/demos/modules/gdisp/streaming/main.c @@ -60,7 +60,7 @@ int main(void) { gCoord width, height, x, y, radius, ballx, bally, dx, floor; gCoord minx, miny, maxx, maxy; gCoord ballcx, ballcy; - color_t colour; + gColor colour; float ii, spin, dy, spinspeed, h, f, g; gfxInit(); |