Fixed compile warnings about unused variables in IME test program.
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
diff --git a/test/testime.c b/test/testime.c
index ff1c529..d536bea 100644
--- a/test/testime.c
+++ b/test/testime.c
@@ -29,8 +29,10 @@
static SDLTest_CommonState *state;
static SDL_Rect textRect, markedRect;
static SDL_Color lineColor = {0,0,0,0};
-static SDL_Color backColor = {255,255,255,0};
+static SDL_Color backColor = {255,255,255,255};
+#ifdef HAVE_SDL_TTF
static SDL_Color textColor = {0,0,0,0};
+#endif
static char text[MAX_TEXT_LENGTH], markedText[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
static int cursor = 0;
#ifdef HAVE_SDL_TTF
@@ -113,7 +115,7 @@ void _Redraw(SDL_Renderer * renderer) {
int w = 0, h = textRect.h;
SDL_Rect cursorRect, underlineRect;
- SDL_SetRenderDrawColor(renderer, 255,255,255,255);
+ SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a);
SDL_RenderFillRect(renderer,&textRect);
#ifdef HAVE_SDL_TTF
@@ -148,7 +150,7 @@ void _Redraw(SDL_Renderer * renderer) {
cursorRect.w = 2;
cursorRect.h = h;
- SDL_SetRenderDrawColor(renderer, 255,255,255,255);
+ SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a);
SDL_RenderFillRect(renderer,&markedRect);
if (markedText[0])
@@ -182,11 +184,11 @@ void _Redraw(SDL_Renderer * renderer) {
underlineRect.h = 2;
underlineRect.w = w;
- SDL_SetRenderDrawColor(renderer, 0,0,0,0);
+ SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a);
SDL_RenderFillRect(renderer,&markedRect);
}
- SDL_SetRenderDrawColor(renderer, 0,0,0,0);
+ SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a);
SDL_RenderFillRect(renderer,&cursorRect);
SDL_SetTextInputRect(&markedRect);