Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rommmmaha committed Jun 5, 2024
1 parent 3530cb5 commit 6c92872
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 29 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: MSBuild

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

permissions:
contents: read

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
- uses: actions/upload-artifact@v4
with:
Expand Down
Binary file modified bin/client.exe
Binary file not shown.
Binary file removed bin/resources/dead.wav
Binary file not shown.
Binary file removed bin/resources/intro1.wav
Binary file not shown.
4 changes: 2 additions & 2 deletions client/client.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(SolutionDir)SFML\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>sfml-graphics-s.lib;sfml-window-s.lib;sfml-system-s.lib;sfml-audio-s.lib;opengl32.lib;freetype.lib;winmm.lib;gdi32.lib;openal32.lib;flac.lib;vorbisenc.lib;vorbisfile.lib;vorbis.lib;ogg.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
Expand Down
12 changes: 5 additions & 7 deletions client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ game::game()
sb_intro.loadFromFile("resources/intro.wav");
sb_damaged.loadFromFile("resources/damaged.wav");
sb_captured.loadFromFile("resources/captured.wav");
sb_dead.loadFromFile("resources/dead.wav");

intro.setBuffer(sb_intro);
damaged.setBuffer(sb_damaged);
captured.setBuffer(sb_captured);
dead.setBuffer(sb_dead);

intro.setVolume(10.f);

Expand Down Expand Up @@ -90,11 +88,11 @@ void game::init()

// Restarting clock
_Clock.restart();
_GlobalClock.restart();
// First start
if (firstStart)
{
intro.play();
_GlobalClock.restart();
firstStart = false;
}
}
Expand Down Expand Up @@ -427,14 +425,14 @@ void game::draw()
int alpha = 0, alpha2 = 255;
_RenderWindow->setFramerateLimit(0);
if (0.16 < seconds && seconds < 1.18)
alpha = int((seconds - 0.16) / 0.025) % 2 ? (100 * (seconds - 0.16f)) : 0;
alpha = int((seconds - 0.16f) / 0.025f) % 2 ? int(100.0f * (seconds - 0.16f)) : 0;
if (1.16 < seconds && seconds < 3)
alpha = 255;
if (3 < seconds)
{
_RenderWindow->setFramerateLimit(fps);
alpha = (5 - _GlobalClock.getElapsedTime().asSeconds()) / 2 * 255;
alpha2 = (5 - _GlobalClock.getElapsedTime().asSeconds()) / 2 * 255;
alpha = int((5 - _GlobalClock.getElapsedTime().asSeconds()) / 2.0f) * 255;
alpha2 = int((5 - _GlobalClock.getElapsedTime().asSeconds()) / 2.0f) * 255;
}

sf::Text _Text;
Expand All @@ -445,7 +443,7 @@ void game::draw()
_RenderWindow->getSize().y / 2 - _Text.getGlobalBounds().height / 2 -
_Text.getCharacterSize()));
_Text.setFillColor(sf::Color(255, 255, 255, alpha));
sf::RectangleShape bg(sf::Vector2f(_RenderWindow->getSize().x, _RenderWindow->getSize().y));
sf::RectangleShape bg(V2_convert<float>(_RenderWindow->getSize()));
bg.setFillColor(sf::Color(0, 0, 0, alpha2));

_RenderWindow->draw(bg);
Expand Down
1 change: 0 additions & 1 deletion client/game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class game
sf::Sound intro;
sf::Sound damaged;
sf::Sound captured;
sf::Sound dead;

sf::Font font;
int count_walls() const;
Expand Down

0 comments on commit 6c92872

Please sign in to comment.