From 15fb1c2cf1a172b842e055e32cd6eb1cdc6a9d81 Mon Sep 17 00:00:00 2001 From: AnonymusRaccoon Date: Fri, 31 Jan 2020 10:52:55 +0100 Subject: [PATCH] Adding the SFML to the CMake libraries --- CMakeLists.txt | 10 +++++++++- sources/Cartridge/Cartridge.cpp | 4 ++-- .../{InvalidAcction.hpp => InvalidAction.hpp} | 10 +++++----- sources/Renderer/SFRenderer.hpp | 4 ++-- 4 files changed, 18 insertions(+), 10 deletions(-) rename sources/Exceptions/{InvalidAcction.hpp => InvalidAction.hpp} (58%) diff --git a/CMakeLists.txt b/CMakeLists.txt index a15830a..fa72c08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,5 +78,13 @@ add_executable(ComSquare sources/Renderer/IRenderer.hpp sources/Renderer/SFRenderer.hpp sources/Renderer/SFRenderer.cpp - sources/Exceptions/InvalidAcction.hpp + sources/Exceptions/InvalidAction.hpp ) + +target_link_libraries(ComSquare + sfml-graphics + sfml-window + sfml-system + sfml-audio + sfml-network +) \ No newline at end of file diff --git a/sources/Cartridge/Cartridge.cpp b/sources/Cartridge/Cartridge.cpp index 88275fb..8051e69 100644 --- a/sources/Cartridge/Cartridge.cpp +++ b/sources/Cartridge/Cartridge.cpp @@ -8,7 +8,7 @@ #include "Cartridge.hpp" #include "../Exceptions/InvalidAddress.hpp" #include "../Exceptions/InvalidRom.hpp" -#include "../Exceptions/InvalidAcction.hpp" +#include "../Exceptions/InvalidAction.hpp" namespace ComSquare::Cartridge { @@ -56,7 +56,7 @@ namespace ComSquare::Cartridge { (void)addr; (void)data; - throw InvalidAcction("Witting to the ROM is not allowed."); + throw InvalidAction("Witting to the ROM is not allowed."); } uint32_t Cartridge::_getHeaderAddress() diff --git a/sources/Exceptions/InvalidAcction.hpp b/sources/Exceptions/InvalidAction.hpp similarity index 58% rename from sources/Exceptions/InvalidAcction.hpp rename to sources/Exceptions/InvalidAction.hpp index 75a9337..a7827ea 100644 --- a/sources/Exceptions/InvalidAcction.hpp +++ b/sources/Exceptions/InvalidAction.hpp @@ -2,8 +2,8 @@ // Created by anonymus-raccoon on 1/30/20. // -#ifndef COMSQUARE_INVALIDACCTION_HPP -#define COMSQUARE_INVALIDACCTION_HPP +#ifndef COMSQUARE_INVALIDACTION_HPP +#define COMSQUARE_INVALIDACTION_HPP #include #include @@ -11,12 +11,12 @@ namespace ComSquare { //! @brief Exception thrown when someone tries to load an invalid rom. - class InvalidAcction : std::exception { + class InvalidAction : std::exception { private: std::string _msg; public: - explicit InvalidAcction(const std::string &msg) : _msg(msg) {} + explicit InvalidAction(const std::string &msg) : _msg(msg) {} const char *what() const noexcept override { return this->_msg.c_str(); } }; } -#endif //COMSQUARE_INVALIDACCTION_HPP +#endif //COMSQUARE_INVALIDACTION_HPP diff --git a/sources/Renderer/SFRenderer.hpp b/sources/Renderer/SFRenderer.hpp index 4d1c97a..cdc529d 100644 --- a/sources/Renderer/SFRenderer.hpp +++ b/sources/Renderer/SFRenderer.hpp @@ -27,8 +27,8 @@ namespace ComSquare::Renderer //! @brief Update the screen by printing the buffer. void drawScreen() override; //! @brief Add a pixel to the buffer to the coordinates x, y with the color rgba. - //! @param X : horizontal index. - //! @param Y : vertical index. + //! @param X horizontal index. + //! @param Y vertical index. //! @param rgba : The color of the pixel. void putPixel(int x, int y, uint8_t rgba) override ; };