summaryrefslogtreecommitdiffstats
path: root/dimension-code
diff options
context:
space:
mode:
authorLyes Saadi <mail@lyes.eu>2020-03-08 20:44:27 +0100
committerLyes Saadi <mail@lyes.eu>2020-03-08 20:44:27 +0100
commiteee49f719976a807964a6e7013d1f05cc79b8feb (patch)
treefe782f233b72ce31c76195da77513871e46884a9 /dimension-code
parent0759170c675fe67e2b79ade8b34b28c032baa834 (diff)
Update disease-propagation.
Diffstat (limited to 'dimension-code')
-rw-r--r--dimension-code/disease-propagation-add-math.patch8
-rw-r--r--dimension-code/disease-propagation-data-path.patch18
-rw-r--r--dimension-code/disease-propagation-fix-accents.patch25
-rw-r--r--dimension-code/disease-propagation-fix-types-headers.patch18
-rw-r--r--dimension-code/disease-propagation-fix-types.patch11
-rw-r--r--dimension-code/disease-propagation-icon-path.patch10
-rw-r--r--dimension-code/disease-propagation.spec21
7 files changed, 95 insertions, 16 deletions
diff --git a/dimension-code/disease-propagation-add-math.patch b/dimension-code/disease-propagation-add-math.patch
new file mode 100644
index 0000000..82cf726
--- /dev/null
+++ b/dimension-code/disease-propagation-add-math.patch
@@ -0,0 +1,8 @@
+--- sources/simulation.cpp 2020-02-29 16:33:56.000000000 +0100
++++ simulationPatched.cpp 2020-03-08 11:09:57.665915105 +0100
+@@ -1,4 +1,5 @@
+ #include "simulation.h"
++#include <math.h>
+
+
+
diff --git a/dimension-code/disease-propagation-data-path.patch b/dimension-code/disease-propagation-data-path.patch
index a9e6e22..200f6fd 100644
--- a/dimension-code/disease-propagation-data-path.patch
+++ b/dimension-code/disease-propagation-data-path.patch
@@ -1,6 +1,6 @@
---- sources/menu.cpp 2020-02-22 18:58:06.505035837 +0100
-+++ menuPatched.cpp 2020-02-22 19:03:41.201259658 +0100
-@@ -468,7 +468,7 @@
+--- sources/menu.cpp 2020-02-29 16:33:56.000000000 +0100
++++ menuPatched.cpp 2020-03-08 10:19:10.711214199 +0100
+@@ -475,7 +475,7 @@
this->variables = variables;
this->background = background;
@@ -9,7 +9,7 @@
}
-@@ -559,8 +559,8 @@
+@@ -566,8 +566,8 @@
void Menu::init_start(const double& start_size, const double& start_x_position, const double& start_y_position, const sf::Color& start_color)
{
@@ -20,7 +20,7 @@
start_texture.setSmooth(true);
start_texture_grabbed.setSmooth(true);
-@@ -724,8 +724,8 @@
+@@ -733,8 +733,8 @@
grabbed = false;
grab_forbiden = false;
@@ -31,10 +31,10 @@
texture.setSmooth(true);
texture_grabbed.setSmooth(true);
-@@ -865,4 +865,4 @@
- }
-
- return text;
+@@ -883,4 +883,4 @@
+ double resize(double value, double width)
+ {
+ return (value / 1920.) * width;
-}
\ Pas de fin de ligne à la fin du fichier
+}
diff --git a/dimension-code/disease-propagation-fix-accents.patch b/dimension-code/disease-propagation-fix-accents.patch
new file mode 100644
index 0000000..b77dfe4
--- /dev/null
+++ b/dimension-code/disease-propagation-fix-accents.patch
@@ -0,0 +1,25 @@
+--- sources/main.cpp 2020-03-08 10:20:47.050520443 +0100
++++ mainPatched.cpp 2020-03-08 20:39:23.994667444 +0100
+@@ -34,14 +34,14 @@
+ window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr());
+
+ std::vector<Variable> variables;
+- variables.push_back(Variable("Taille des pixels", Int, 5, 1, 20));
+- variables.push_back(Variable("Pourcentage de vaccinés", Double, 50., 0., 100., 1, 1));
+- variables.push_back(Variable("Nombre de malades", Int, 1, 1, 1000));
+- variables.push_back(Variable("Mortalité de la maladie", Double, 50., 0., 100., 1, 1));
+- variables.push_back(Variable("Contagiosité de la maladie", Double, 3., 0., 100., 1, 1));
+- variables.push_back(Variable("Temps avant la mort", Int, 50, 1, 1000));
+- variables.push_back(Variable("Temps avant la guérison", Int, 80, 1, 1000));
+- variables.push_back(Variable("FPS (0 = pas de limite)", Int, 0, 0, 1000));
++ variables.push_back(Variable(L"Taille des pixels", Int, 5, 1, 20));
++ variables.push_back(Variable(L"Pourcentage de vaccinés", Double, 50., 0., 100., 1, 1));
++ variables.push_back(Variable(L"Nombre de malades", Int, 1, 1, 1000));
++ variables.push_back(Variable(L"Mortalité de la maladie", Double, 50., 0., 100., 1, 1));
++ variables.push_back(Variable(L"Contagiosité de la maladie", Double, 3., 0., 100., 1, 1));
++ variables.push_back(Variable(L"Temps avant la mort", Int, 50, 1, 1000));
++ variables.push_back(Variable(L"Temps avant la guérison", Int, 80, 1, 1000));
++ variables.push_back(Variable(L"FPS (0 = pas de limite)", Int, 0, 0, 1000));
+
+ Menu menu = Menu(variables, sf::Color(20, 20, 200), width, height);
+ menu.init_names(50, 750, sf::Color::White, 150);
diff --git a/dimension-code/disease-propagation-fix-types-headers.patch b/dimension-code/disease-propagation-fix-types-headers.patch
new file mode 100644
index 0000000..f293d15
--- /dev/null
+++ b/dimension-code/disease-propagation-fix-types-headers.patch
@@ -0,0 +1,18 @@
+--- includes/menu.h 2020-02-29 16:33:56.000000000 +0100
++++ menuPatched.h 2020-03-08 20:38:10.205698893 +0100
+@@ -95,7 +95,7 @@
+
+ Variable();
+ Variable(const Variable& variable);
+- Variable(const std::string& name, Variable_type type, const double& initial_value, double min = 0., double max = 1., int precision = 0, bool percent = false);
++ Variable(const wchar_t* name, Variable_type type, const double& initial_value, double min = 0., double max = 1., int precision = 0, bool percent = false);
+
+ void operator=(const Variable& variable);
+
+@@ -173,4 +173,4 @@
+ std::string double_to_string(const double& value, int precision, bool percent);
+ double resize(double value, double width);
+
+-#endif
+\ Pas de fin de ligne à la fin du fichier
++#endif
diff --git a/dimension-code/disease-propagation-fix-types.patch b/dimension-code/disease-propagation-fix-types.patch
new file mode 100644
index 0000000..9ea2ddb
--- /dev/null
+++ b/dimension-code/disease-propagation-fix-types.patch
@@ -0,0 +1,11 @@
+--- sources/menu.cpp 2020-03-08 19:50:59.447452024 +0100
++++ menuPatched.cpp 2020-03-08 20:37:45.285384967 +0100
+@@ -224,7 +224,7 @@
+
+ // Construit une variable à partir de ces paramètres
+
+-Variable::Variable(const std::string& name, Variable_type type, const double& initial_value, double min, double max, int precision, bool percent)
++Variable::Variable(const wchar_t* name, Variable_type type, const double& initial_value, double min, double max, int precision, bool percent)
+ {
+ this->name.setString(name);
+ this->precision = precision;
diff --git a/dimension-code/disease-propagation-icon-path.patch b/dimension-code/disease-propagation-icon-path.patch
index ae3ac60..aaabc25 100644
--- a/dimension-code/disease-propagation-icon-path.patch
+++ b/dimension-code/disease-propagation-icon-path.patch
@@ -1,7 +1,7 @@
---- sources/main.cpp 2020-02-22 18:58:06.505035837 +0100
-+++ mainPatched.cpp 2020-02-22 19:04:02.281329017 +0100
-@@ -16,7 +16,7 @@
- sf::RenderWindow window(sf::VideoMode(WIDTH, HEIGHT), "Disease propagation", window_settings, settings);
+--- sources/main.cpp 2020-02-29 16:33:56.000000000 +0100
++++ mainPatched.cpp 2020-03-08 10:20:04.059722515 +0100
+@@ -29,7 +29,7 @@
+ sf::RenderWindow window(sf::VideoMode(width, height), "Disease propagation", sf::Style::Close | sf::Style::Titlebar, settings);
sf::Image icon;
- icon.loadFromFile("dependencies/resources/icon.png");
@@ -9,7 +9,7 @@
window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr());
-@@ -143,4 +143,4 @@
+@@ -156,4 +156,4 @@
}
return 0;
diff --git a/dimension-code/disease-propagation.spec b/dimension-code/disease-propagation.spec
index 7b3392c..7636088 100644
--- a/dimension-code/disease-propagation.spec
+++ b/dimension-code/disease-propagation.spec
@@ -1,10 +1,10 @@
-%global commit df9ee40be7fa7e14e40c5c59da97503e52bf8eaf
+%global commit cd81dd2bc3c89a02aad8f8979c99cdb76c614d63
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global reponame Disease_propagation
Name: disease-propagation
-Version: 0
+Version: 1.1
Release: 1.%(date +%%Y%%m%%d)git%{shortcommit}%{?dist}
Summary: Basic simulation of disease propagation
@@ -12,10 +12,15 @@ License: CC0
URL: https://www.youtube.com/watch?v=hrLrEfP2Wjo
Source0: https://github.com/angeluriot/%{reponame}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Source1: disease-propagation.desktop
+Source2: https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt
Patch0: cmake-remove-sfml-main.patch
Patch1: disease-propagation-data-path.patch
Patch2: disease-propagation-icon-path.patch
+Patch4: disease-propagation-add-math.patch
+Patch5: disease-propagation-fix-accents.patch
+Patch6: disease-propagation-fix-types.patch
+Patch7: disease-propagation-fix-types-headers.patch
BuildRequires: cmake
BuildRequires: gcc-c++
@@ -38,12 +43,17 @@ menu. Where you can change things like:
%build
rm -rf dependencies/SFML
+# Convert every file from ISO-8859-1 to UTF-8
+find . -type f \! -name "*.png" \! -name "*.ttf" -exec iconv -f ISO-8859-1 -t UTF-8 {} -o {} \; -exec basename {} \;
%cmake .
%make_build
# Rename the binary to a more common name
mv Disease_propagation disease-propagation
+# Getting the license
+cp -p %{SOURCE2} .
+
%install
# Installing the binary
install -Dpm 0755 -t %{buildroot}%{_bindir}/ disease-propagation
@@ -59,7 +69,14 @@ install -Dpm 0644 -t %{buildroot}%{_datadir}/applications %{SOURCE1}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%doc README.md
+%license legalcode.txt
%changelog
+* Sun Feb 23 2020 Lyes Saadi <fedora@lyes.eu> - 1.1-1.20200308gitcd81dd2
+- Update to v1.1
+- Now, the program work on all screens.
+- Fix encoding.
+- Including CC0 License.
+
* Sat Feb 22 2020 Lyes Saadi <fedora@lyes.eu> - 0-1.20200222gitdf9ee40
- Initial package.