Skip to content

Commit

Permalink
Versión 1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Suazo-kun committed Nov 24, 2022
1 parent 43bab80 commit b94737d
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 105 deletions.
2 changes: 1 addition & 1 deletion make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ IF "%~1" == "--testear" (
cd %BAT_RUTA%

windres -i src\equiscero.rc -o equiscero.res --output-format=coff
gcc -O2 -Wall src\main.c src\equiscero.c equiscero.res -o "%RUTA_ACTUAL%\EquisCero.exe" %testeararg%
gcc -O2 -Wall src\main.c src\equiscero.c src\imprimircolor.c equiscero.res -o "%RUTA_ACTUAL%\EquisCero.exe" %testeararg%

del equiscero.res

Expand Down
8 changes: 4 additions & 4 deletions src/equiscero.rc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
1 ICON "res\\icon.ico"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEVERSION 1,1,0,0
PRODUCTVERSION 1,1,0,0
FILEOS 0x4
FILETYPE 0x1
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080A04E4"
BEGIN
VALUE "FileVersion", "1.0.0.0"
VALUE "ProductVersion", "1.0.0.0"
VALUE "FileVersion", "1.1.0.0"
VALUE "ProductVersion", "1.1.0.0"
VALUE "OriginalFilename", "EquisCero.exe"
VALUE "InternalName", "EquisCero.exe"
VALUE "FileDescription", "Oh, juego de equis y cero mi loco"
Expand Down
39 changes: 39 additions & 0 deletions src/imprimircolor.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#if (defined __WIN32__) || (defined _WIN32)
#include <windows.h>
//#else
#endif

int colores = -1;

#if (defined __WIN32__) || (defined _WIN32)
void ObtenerColoresOriginales() {
CONSOLE_SCREEN_BUFFER_INFO temp;

if (!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &temp)) {
colores = 0 | 7; // Fondo blanco y texto negro.
} else {
colores = temp.wAttributes;
}
}
//#else
#endif

void EstablecerColores(int color) {
if (colores == -1) {
ObtenerColoresOriginales();
}

#if (defined __WIN32__) || (defined _WIN32)
SetConsoleTextAttribute(
GetStdHandle(STD_OUTPUT_HANDLE),
color
);
//#else
#endif
}

void RestablecerColores() {
if (colores != -1) {
EstablecerColores(colores);
}
}
Loading

0 comments on commit b94737d

Please sign in to comment.