Hello.
I have color functions that look like this:
Code:
void tred()
{
#ifdef WIN32
HANDLE hstdo;
hstdo = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hstdo, FOREGROUND_RED);
#endif
}
And I have them print out colors on the console, like in a menu like this:
Code:
void main_menu()
{
tdefault();system("cls");
printf("\n\n\n\n\n\n\n\n\t\t\t ");face_menu_titlebar();
printf(" MENU: Main Menu ");tdefault();printf("\n\t\t\t ");bdefault();
printf(" 1. New Campaign ");tdefault();printf("\n\t\t\t ");bdefault();
printf(" 2. Options ");tdefault();printf("\n\t\t\t ");bdefault();
printf(" 3. Exit ");tdefault();printf("\n\t\t\t ");bdefault_i();
printf(" Type in # corresponding ");tdefault();printf("\n\t\t\t ");bdefault_i();
printf(" to desired choice. ");tdefault();printf("\n\t\t\t ");tdefault();
char main_menu_select = _getche();
if(main_menu_select=='1') {difficulty_select();}
if(main_menu_select=='2') {menu_options();}
if(main_menu_select=='3') {exit();}
else main_menu();
}
In windowsXp, it works perfectly fine. In win98, it SOMETIMES works perfectly fine. But heres the problem:
Tn win98, it will 1/4 the time print the text with the proper colors correctly. As an error, it sometimes prints the background of a text to be black instead of grey sometimes. Even worse, it sometimes prints yellow longer than its supposed to, even though I CLEARLY stated it to print back to black again afterwards.
What is wrong with win98 here. Its annoying, because during a combat phase in my game, I have to cls a status bar that changes color as you take damage, but sometimes it prints black instead of red. Its like it might be looking over it sometimes. But it onlysometimes doesnt print. I even turned off all optimizations in the compile, but it still does it. Even tryed fflush, but it does the same still.