near label adjustments

Former-commit-id: 25bbea7e72dc4a10d4e21b8930ba043410208f49
Former-commit-id: e830a7f9cea6d804dca76b84c2fd8491b7dedccd
This commit is contained in:
Nathan 2017-10-06 18:44:08 -05:00
parent 0ad396a728
commit c87d2b8c13
4 changed files with 15 additions and 11 deletions

View file

@ -13,7 +13,7 @@
#define SCREEN_WIDTH 320 #define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 480 #define SCREEN_HEIGHT 480
#define UPSCALE 3 #define UPSCALE 1
#define LOGMAXDIST 1000.0 #define LOGMAXDIST 1000.0
#define MAXDIST 50.0 #define MAXDIST 50.0

View file

@ -12,6 +12,7 @@ void mouseSetup() {
pinMode(27, INPUT); pinMode(27, INPUT);
pullUpDnControl (27, PUD_UP); pullUpDnControl (27, PUD_UP);
SDL_ShowCursor(SDL_DISABLE);
#endif #endif
} }
@ -44,8 +45,6 @@ void init(char *title)
exit(1); exit(1);
} }
SDL_ShowCursor(SDL_DISABLE);
#ifdef RPI #ifdef RPI
const SDL_VideoInfo* vInfo = SDL_GetVideoInfo(); const SDL_VideoInfo* vInfo = SDL_GetVideoInfo();

View file

@ -68,8 +68,11 @@ void drawStatusBox(int *left, int *top, char *label, char *message, SDL_Color co
int labelWidth = ((strlen(label) > 0 ) ? 1.5 : 0) * game.labelFontHeight; int labelWidth = ((strlen(label) > 0 ) ? 1.5 : 0) * game.labelFontHeight;
int messageWidth = (strlen(message) + ((strlen(message) > 0 ) ? 1 : 0)) * game.messageFontWidth; int messageWidth = (strlen(message) + ((strlen(message) > 0 ) ? 1 : 0)) * game.messageFontWidth;
//newline if no message or label
if(strlen(label) == 0 && strlen(message) == 0 ) { if(strlen(label) == 0 && strlen(message) == 0 ) {
boxRGBA(game.screen, *left, *top, Modes.screen_width - PAD, *top + game.messageFontHeight, darkGrey.r, darkGrey.g, darkGrey.b, SDL_ALPHA_OPAQUE); boxRGBA(game.screen, *left, *top, Modes.screen_width - PAD, *top + game.messageFontHeight,0, 0, 0, 0);
*left = PAD;
*top = *top - game.messageFontHeight - PAD;
return; return;
} }
@ -133,6 +136,11 @@ void drawStatus() {
drawStatusBox(&left, &top, "||||", "MENU", grey); drawStatusBox(&left, &top, "||||", "MENU", grey);
if(Status.closeCall != NULL) { if(Status.closeCall != NULL) {
// if no flight id, "near" box goes on first line
if(!strlen(Status.closeCall->flight)) {
drawStatusBox(&left, &top, "near", "", red);
}
char strSpeed[8] = " "; char strSpeed[8] = " ";
snprintf(strSpeed, 8, "%.0fkm/h", Status.closeCall->speed * 1.852); snprintf(strSpeed, 8, "%.0fkm/h", Status.closeCall->speed * 1.852);
drawStatusBox(&left, &top, "vel", strSpeed, white); drawStatusBox(&left, &top, "vel", strSpeed, white);
@ -141,14 +149,11 @@ void drawStatus() {
snprintf(strAlt, 8, "%.0fm", Status.closeCall->altitude / 3.2828); snprintf(strAlt, 8, "%.0fm", Status.closeCall->altitude / 3.2828);
drawStatusBox(&left, &top, "alt", strAlt, white); drawStatusBox(&left, &top, "alt", strAlt, white);
drawStatusBox(&left, &top, "", "", black); //this is effectively a newline
if(strlen(Status.closeCall->flight)) { if(strlen(Status.closeCall->flight)) {
drawStatusBox(&left, &top, "near", "", red);
drawStatusBox(&left, &top, "id", Status.closeCall->flight, white); drawStatusBox(&left, &top, "id", Status.closeCall->flight, white);
} }
drawStatusBox(&left, &top, "near", "", red);
} }
//drawStatusBox(&left, &top, "", "", black);
} }

View file

@ -1 +1 @@
b5241264afa7daa6932550d55fbf3c936b530c90 d5ebf86bb1a0e40d3ca3749d31c89c02dbc12fc6