Merge branch 'master' into optimize

master
Vectozavr 2021-11-04 16:21:16 +07:00 committed by GitHub
commit e6590a013c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 10 deletions

View File

@ -10,10 +10,10 @@ using namespace std;
int main() {
Shooter game;
//game.create(1280, 720, ShooterConsts::PROJECT_NAME);
game.create(1280, 720, ShooterConsts::PROJECT_NAME);
//game.create(1920, 1080, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
game.create(2048, 1152, ShooterConsts::PROJECT_NAME, false);
//game.create(2048, 1152, ShooterConsts::PROJECT_NAME, true);
//game.create(3072, 1920, ShooterConsts::PROJECT_NAME, true, Consts::BACKGROUND_COLOR, sf::Style::Fullscreen);
return 0;

View File

@ -162,7 +162,7 @@ void Engine::printDebugInfo() const {
Vec2D{xPos, yPos + height + height * i},
{static_cast<sf::Uint8>(255 * width / timerWidth),
static_cast<sf::Uint8>(255 * (1 - width / timerWidth)),
0, 100});
0, 150});
screen->drawText(
@ -170,7 +170,7 @@ void Engine::printDebugInfo() const {
std::to_string((int) (1.0 / timer.elapsedMilliseconds())) + " / s \t (" +
std::to_string((int) (100 * timer.elapsedMilliseconds() / totalTime)) + "%)",
Vec2D{xPos + 10, yPos + height * i + 5}, 30,
sf::Color(0, 0, 0, 100));
sf::Color(0, 0, 0, 200));
i++;
timeSum += timer.elapsedMilliseconds();
@ -183,13 +183,13 @@ void Engine::printDebugInfo() const {
Vec2D{xPos, yPos + height + height * i},
{static_cast<sf::Uint8>(255 * width / timerWidth),
static_cast<sf::Uint8>(255 * (1 - width / timerWidth)),
0, 100});
0, 150});
screen->drawText("other:\t" + std::to_string((int) (1.0 / (totalTime - timeSum))) + " / s \t (" +
std::to_string((int) (100 * (totalTime - timeSum) / totalTime)) + "%)",
Vec2D{xPos + 10, yPos + height * i + 5}, 30,
sf::Color(0, 0, 0, 100));
sf::Color(0, 0, 0, 200));
}
}

View File

@ -4,7 +4,7 @@
#ifndef SHOOTER_TIMELINE_H
#define SHOOTER_TIMELINE_H
#include <memory>
#include "Animation.h"
class AnimationListTag final {

View File

@ -20,12 +20,13 @@ HitBox::HitBox(const Mesh &mesh) {
}
void HitBox::_addIfUnique(Vec3D &&point) {
bool addPoint = true;
auto check = [&point](const auto& p) { return (p - point).sqrAbs() < Consts::EPS; };
if (std::find_if(std::execution::par, _hitBox.rbegin(), _hitBox.rend(), check) == _hitBox.rend())
auto check = [&point](const auto& p) { return p == point; };
if (std::find_if(std::execution::par, _hitBox.rbegin(), _hitBox.rend(), check) == _hitBox.rend()) {
_hitBox.push_back(point);
}
}
HitBox HitBox::Box(const Mesh &mesh) {
HitBox result;