mark debug executables (Windows), add game icon and new build targets
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,6 +16,7 @@ Chinczyk188/res/SFML
|
||||
# PL: Plik wykonywalny tworzony przez g++ (mingw).
|
||||
output.exe
|
||||
Chinczyk188/output.exe
|
||||
*.res
|
||||
|
||||
# EN: Don't include include directory with Doxygen documentation.
|
||||
# PL: Aby nie brać pod uwagę katalogu include z dokumentacją Doxygen.
|
||||
|
||||
@@ -274,15 +274,6 @@ void Engine::nextTurn() {
|
||||
this->board.smartSleep(1000);
|
||||
}
|
||||
|
||||
// Debug: odkomentuj, aby wymusić wygraną:
|
||||
// currentPlayer.tryMovingPawn(0, 0);
|
||||
|
||||
// if (!pickAPlace) {
|
||||
// std::cout << "Brak ruchu.\n";
|
||||
// }
|
||||
|
||||
|
||||
|
||||
if (currentPlayer.hasWon()) {
|
||||
|
||||
// Zostanie wykorzystane do zwiększenia liczby wygranych
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
|
||||
void Game::printGameWelcomeText() const {
|
||||
|
||||
#ifdef DEBUG
|
||||
std::cout << "Uruchamiasz wersje DEBUG!\n\n";
|
||||
#endif
|
||||
|
||||
std::cout << "\n"
|
||||
" .o88b. db db d888888b d8b db .o88b. d88888D db db db dD db .d888b. .d888b.\n"
|
||||
"d8P Y8 88 88 `88' 888o 88 d8P Y8 YP d8' `8b d8' 88 ,8P' o88 88 8D 88 8D\n"
|
||||
@@ -183,7 +187,11 @@ Game::Game() {
|
||||
|
||||
// W Windows Terminal na Windowsie, oraz większości terminali Linuxowych
|
||||
// ta sekwencja ustawia tytuł okna/zakładki terminala.
|
||||
std::cout << "\033]0;" << "Chinczyk188" << "\007" << "\n";
|
||||
std::cout << "\033]0;" << "Chinczyk188"
|
||||
#ifdef DEBUG
|
||||
<< " DEBUG"
|
||||
#endif
|
||||
<< "\007" << "\n";
|
||||
|
||||
this->initVariables();
|
||||
this->board.initVariables();
|
||||
|
||||
@@ -3,17 +3,34 @@
|
||||
# EN: Warning: mingw-w64-x86_64-gcc-14.1.0-3 is the last version of gcc, which supports wildcards ("*.cpp").
|
||||
# PL: Uwaga: mingw-w64-x86_64-gcc-14.1.0-3 to ostatnia wspierana wersja gcc, w której można stosować wildcard'y ("*.cpp").
|
||||
CC = "C:\\msys64\\mingw64\\bin\\g++.exe"
|
||||
WNDRES = "C:\\msys64\\mingw64\\bin\\windres.exe"
|
||||
DEPS = -lsfml-graphics-s -lsfml-window-s -lsfml-audio-s -lopenal32 -lfreetype -lflac -lvorbisenc -lvorbisfile -lvorbis -logg -lsfml-system-s -lopengl32 -lwinmm -lgdi32 -lpthread
|
||||
LINK = -L. -Lres/SFML/lib-mingw/
|
||||
FLAGS = -DSFML_STATIC # -DCHINCZYK188_IGNORE_USER_SEED -DDEBUG
|
||||
OUTPUT = output.exe
|
||||
CPPSTD = c++17
|
||||
|
||||
default:
|
||||
$(CC) -g "*.cpp" $(LINK) $(DEPS) -std=$(CPPSTD) $(FLAGS) -static -static-libgcc -fno-keep-inline-dllexport -Os -s -Wl,--build-id=none -o $(OUTPUT)
|
||||
|
||||
default: metadata icon
|
||||
$(CC) -g "*.cpp" logo.res metadata.res $(LINK) $(DEPS) -std=$(CPPSTD) $(FLAGS) -static -static-libgcc -fno-keep-inline-dllexport -Os -s -Wl,--build-id=none -o $(OUTPUT)
|
||||
|
||||
debug: metadata-debug icon
|
||||
$(CC) -g "*.cpp" logo.res metadata.res $(LINK) $(DEPS) -std=$(CPPSTD) $(FLAGS) -DDEBUG -static -static-libgcc -fno-keep-inline-dllexport -Os -s -Wl,--build-id=none -o $(OUTPUT)
|
||||
|
||||
icon:
|
||||
$(WNDRES) logo.rc -O coff -o logo.res
|
||||
|
||||
metadata:
|
||||
$(WNDRES) metadata.rc -O coff -o metadata.res
|
||||
|
||||
metadata-debug:
|
||||
$(WNDRES) metadata-debug.rc -O coff -o metadata.res
|
||||
|
||||
run: default
|
||||
$(OUTPUT)
|
||||
|
||||
run-debug: debug
|
||||
$(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm $(OUTPUT)
|
||||
rm $(OUTPUT) logo.res metadata.res
|
||||
@@ -28,29 +28,11 @@ short Player::getColor() const {
|
||||
}
|
||||
|
||||
short Player::tryMovingPawn(short pawnID, short fields) {
|
||||
// this->pawnsFinished = 4; // do debugowania, wymusza zakończenia gry
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Player::movePawn(int pawnIndex, int steps) {
|
||||
if (pawnIndex < 0 || pawnIndex >= pawns.size()) return;
|
||||
|
||||
// TODO: zaimplementować logikę ruchu pionków
|
||||
Pawn& pawn = pawns[pawnIndex];
|
||||
if (pawn.isAtBase()) {
|
||||
if (steps == 6) {
|
||||
pawn.setRelativePosition(1);
|
||||
}
|
||||
} else {
|
||||
int newPosition = pawn.getRelativePosition() + steps;
|
||||
// TODO: sprawdź pozycję pionków
|
||||
pawn.setRelativePosition(newPosition);
|
||||
|
||||
if (newPosition >= 51/* "koniec", do przerobienia */) {
|
||||
pawn.setRelativePosition(51/* "koniec" */);
|
||||
pawnsFinished++;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool Player::hasWon() const {
|
||||
|
||||
1
Chinczyk188/logo.rc
Normal file
1
Chinczyk188/logo.rc
Normal file
@@ -0,0 +1 @@
|
||||
id ICON "res/sprites/Chinczyk188_logo.ico"
|
||||
23
Chinczyk188/metadata-debug.rc
Normal file
23
Chinczyk188/metadata-debug.rc
Normal file
@@ -0,0 +1,23 @@
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
PRODUCTVERSION 1,0,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "041504E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "177188"
|
||||
VALUE "FileDescription", "Zagraj w Chinczyka!"
|
||||
VALUE "FileVersion", "0.1"
|
||||
VALUE "InternalName", "chinczyk188-debug"
|
||||
VALUE "LegalCopyright", "gitea.7o7.cx/sherl/Chinczyk188"
|
||||
VALUE "OriginalFilename", "Chinczyk188.exe"
|
||||
VALUE "ProductName", "Chinczyk188 DEBUG"
|
||||
VALUE "ProductVersion", "0.1-DEBUG"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x415, 1252
|
||||
END
|
||||
END
|
||||
23
Chinczyk188/metadata.rc
Normal file
23
Chinczyk188/metadata.rc
Normal file
@@ -0,0 +1,23 @@
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
PRODUCTVERSION 1,0,0,0
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "041504E4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "177188"
|
||||
VALUE "FileDescription", "Zagraj w Chinczyka!"
|
||||
VALUE "FileVersion", "0.1"
|
||||
VALUE "InternalName", "chinczyk188"
|
||||
VALUE "LegalCopyright", "gitea.7o7.cx/sherl/Chinczyk188"
|
||||
VALUE "OriginalFilename", "Chinczyk188.exe"
|
||||
VALUE "ProductName", "Chinczyk188"
|
||||
VALUE "ProductVersion", "0.1"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x415, 1252
|
||||
END
|
||||
END
|
||||
BIN
Chinczyk188/res/sprites/Chinczyk188_logo.ico
Normal file
BIN
Chinczyk188/res/sprites/Chinczyk188_logo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
BIN
Chinczyk188/res/sprites/Chinczyk188_logo.png
Normal file
BIN
Chinczyk188/res/sprites/Chinczyk188_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
Reference in New Issue
Block a user