Try fix linux. Formatted code
This commit is contained in:
parent
ba3b18d726
commit
eb028441da
@ -1,11 +1,17 @@
|
||||
#include "ColorUI.h"
|
||||
#include <Windows.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <conio.h> // getch
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <cstdio>
|
||||
#endif
|
||||
|
||||
namespace _cns
|
||||
{
|
||||
|
||||
#ifdef _WIN32 /// Windows Platform
|
||||
class _auto_init_console_info_class
|
||||
{
|
||||
public:
|
||||
@ -116,6 +122,17 @@ inline void cprint()
|
||||
{
|
||||
SetConsoleTextAttribute(_auto_init_console_info_obj.hout, _auto_init_console_info_obj.color);
|
||||
}
|
||||
#else /// Linix-like
|
||||
inline void cprint(ConsoleColor FrontColor, ConsoleColor BackColor, bool withIntensity = true)
|
||||
{
|
||||
/// Ignore intensity option?
|
||||
printf("\033[%d;%dm", (int)FrontColor + 30, (int)BackColor + 40);
|
||||
}
|
||||
inline void cprint()
|
||||
{
|
||||
printf("\033[0m");
|
||||
}
|
||||
#endif /// End of platform
|
||||
|
||||
int _last_keyval;
|
||||
int _GetUserInputKey_Real()
|
||||
|
Reference in New Issue
Block a user