17.01.2009, 19:09
Edited my last post: arguments was mixed, and converted as a macro
Edit: some other things, but now i can't think of something else to do with it :P:
Also renamed colors function because that name can be already used for a variable or whatever..and made it using bit operation (more efficient, i think)
that's all, i think.
SUGGESTIONS if possible:
GetConsoleBufferWidth : returns the max characters of a line
GetConsoleBufferHeight : returns max lines that can be displayed (without 'overwriting')
Edit: some other things, but now i can't think of something else to do with it :P:
pawn Код:
//until you change functions names :)
native GetConsoleColors();
native SetConsoleColors(colors);
#define GetConsoleColors() \
GetConsoleTextColor()
#define SetConsoleColors(%1) \
SetConsoleTextColor(%1)
pawn Код:
//and then, MAYBE also replace all *Foreground* by *Text*
native GetConsoleForegroundColor();
native GetConsoleBackgroundColor();
native SetConsoleForegroundColor(e_console_color:color);
native SetConsoleBackgroundColor(e_console_color:color);
native SetConsoleColorsEx(e_console_color:foreground, e_console_color:background);
#define GetConsoleForegroundColor() \
(GetConsoleColors() & 0xF)
#define GetConsoleBackgroundColor() \
(GetConsoleColors() >> 4 & 0xF)
#define SetConsoleForegroundColor(%1) \
SetConsoleColors(GetConsoleBackgroundColor() << 4 | _:%1)
#define SetConsoleBackgroundColor(%1) \
SetConsoleColors(_:%1 << 4 | GetConsoleForegroundColor())
#define SetConsoleColorsEx(%1,%2) \
SetConsoleColors(_:%2 << 4 | _:%1)
pawn Код:
native ConsoleColors(e_console_color:foreground, e_console_color:background);
#define ConsoleColors(%1,%2) \
(_:%2 << 4 | _:%1)
SUGGESTIONS if possible:
GetConsoleBufferWidth : returns the max characters of a line
GetConsoleBufferHeight : returns max lines that can be displayed (without 'overwriting')

