From 4212320fe1da2fe5c1b34a7fb4b8c6c6c62607a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Wed, 6 Apr 2016 13:41:12 +0200 Subject: [PATCH] Affichage des accents dans le titre --- include/manager.hpp | 6 +++--- src/editor.cpp | 2 +- src/manager.cpp | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/manager.hpp b/include/manager.hpp index 73493c2..fa7f6ed 100644 --- a/include/manager.hpp +++ b/include/manager.hpp @@ -14,7 +14,7 @@ private: sf::RenderWindow window; sf::Clock clock; sf::View window_view; - std::string title; + sf::String title; ResourceManager resource_manager; std::vector events; @@ -73,12 +73,12 @@ public: /** * Renvoie le titre actuel de la fenêtre */ - std::string getTitle(); + sf::String getTitle(); /** * Modifie le titre actuel de la fenêtre */ - void setTitle(std::string set_title); + void setTitle(sf::String set_title); /** * Renvoie un booléen attestant de l'appui sur la diff --git a/src/editor.cpp b/src/editor.cpp index 45fdee2..79a346c 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -12,7 +12,7 @@ Editor::~Editor() {} void Editor::load(std::ifstream& file) { Level::load(file); - manager.setTitle("Edition de " + getName()); + manager.setTitle(sf::String(L"Édition de ") + getName()); } void Editor::frame() { diff --git a/src/manager.cpp b/src/manager.cpp index 1f2a7e2..65f02f0 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -3,7 +3,7 @@ Manager::Manager() : window( sf::VideoMode(704, 480), "Skizzle", sf::Style::Default, sf::ContextSettings(0, 0, 2) -), window_view(window.getView()), title(""), view(NULL) {} +), window_view(window.getView()), title(sf::String(L"")), view(NULL) {} void Manager::start() { while (window.isOpen()) { @@ -72,17 +72,17 @@ void Manager::setWindowView(sf::View set_window_view) { window_view = set_window_view; } -std::string Manager::getTitle() { +sf::String Manager::getTitle() { return title; } -void Manager::setTitle(std::string set_title) { +void Manager::setTitle(sf::String set_title) { title = set_title; - if (title.empty()) { - window.setTitle("Skizzle"); + if (title.isEmpty()) { + window.setTitle(sf::String(L"Skizzle")); } else { - window.setTitle("Skizzle - " + title); + window.setTitle(sf::String(L"Skizzle ‒ ") + title); } }