1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Address review

This commit is contained in:
leo60228 2023-09-05 13:13:27 -04:00 committed by Misa Elizabeth Kai
parent f3f9d1b523
commit 3e0cf57a99
2 changed files with 18 additions and 17 deletions

View file

@ -376,18 +376,15 @@ void Screen::recacheTextures(void)
} }
} }
#ifdef __ANDROID__
bool Screen::isForcedFullscreen(void)
{
return true;
}
#else
bool Screen::isForcedFullscreen(void) bool Screen::isForcedFullscreen(void)
{ {
/* This is just a check to see if we're on a desktop or tenfoot setup. /* This is just a check to see if we're on a desktop or tenfoot setup.
* If you're working on a tenfoot-only build, add a def that always * If you're working on a tenfoot-only build, add a def that always
* returns true! * returns true!
*/ */
#ifdef __ANDROID__
return true;
#else
return SDL_GetHintBoolean("SteamTenfoot", SDL_FALSE); return SDL_GetHintBoolean("SteamTenfoot", SDL_FALSE);
}
#endif #endif
}

View file

@ -2,12 +2,16 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#ifdef _WIN32 #ifdef __ANDROID__
// forward to SDL logging on Android, since stdout/stderr are /dev/null
#define VLOG_USE_SDL 1
#endif
#ifdef VLOG_USE_SDL
# include <SDL.h>
#elif defined(_WIN32)
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
#elif defined(__ANDROID__)
// forward to SDL logging on Android, since stdout/stderr are /dev/null
# include <SDL.h>
#elif defined(__unix__) || defined(__APPLE__) #elif defined(__unix__) || defined(__APPLE__)
# include <unistd.h> # include <unistd.h>
#endif #endif
@ -32,7 +36,7 @@ static void check_color_support(void);
void vlog_init(void) void vlog_init(void)
{ {
#ifdef __ANDROID__ #ifdef VLOG_USE_SDL
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE); SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_VERBOSE);
#endif #endif
check_color_support(); check_color_support();
@ -77,7 +81,7 @@ SDL_PRINTF_VARARG_FUNC(1) void vlog_debug(const char* text, ...)
return; return;
} }
#ifdef __ANDROID__ #ifdef VLOG_USE_SDL
va_start(list, text); va_start(list, text);
SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, text, list); SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, text, list);
va_end(list); va_end(list);
@ -104,7 +108,7 @@ SDL_PRINTF_VARARG_FUNC(1) void vlog_info(const char* text, ...)
return; return;
} }
#ifdef __ANDROID__ #ifdef VLOG_USE_SDL
va_start(list, text); va_start(list, text);
SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, text, list); SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, text, list);
va_end(list); va_end(list);
@ -131,7 +135,7 @@ SDL_PRINTF_VARARG_FUNC(1) void vlog_warn(const char* text, ...)
return; return;
} }
#ifdef __ANDROID__ #ifdef VLOG_USE_SDL
va_start(list, text); va_start(list, text);
SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, text, list); SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, text, list);
va_end(list); va_end(list);
@ -158,7 +162,7 @@ SDL_PRINTF_VARARG_FUNC(1) void vlog_error(const char* text, ...)
return; return;
} }
#ifdef __ANDROID__ #ifdef VLOG_USE_SDL
va_start(list, text); va_start(list, text);
SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, text, list); SDL_LogMessageV(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_ERROR, text, list);
va_end(list); va_end(list);
@ -255,7 +259,7 @@ static void check_color_support(void)
} }
color_supported = 1; color_supported = 1;
#elif (defined(__unix__) || defined(__APPLE__)) && !defined(__ANDROID__) #elif (defined(__unix__) || defined(__APPLE__)) && !defined(VLOG_USE_SDL)
if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO)) if (isatty(STDOUT_FILENO) && isatty(STDERR_FILENO))
{ {
color_supported = 1; color_supported = 1;