1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-19 15:20:27 +00:00

Merge pull request #307 from Quuxplusone/language-fr

Add @3raven's language-fr.cpp
This commit is contained in:
Zeno Rogue 2022-07-04 12:02:15 +02:00 committed by GitHub
commit e50c22134c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 4063 additions and 8 deletions

View File

@ -63,7 +63,7 @@ savepng-loc.o: savepng.cpp
hyper-rogueviz.o: hyper.cpp graph.cpp hyperpoint.cpp geometry.cpp cell.cpp heptagon.cpp game.cpp classes.cpp polygons.cpp language.cpp language-data.cpp achievement.cpp shmup.cpp patterns.cpp mapeditor.cpp netgen.cpp yendor.cpp hyper.h rug.cpp flags.cpp system.cpp landgen.cpp orbs.cpp complex.cpp conformal.cpp menus.cpp init.cpp dialogs.cpp sound.cpp util.cpp ${drogueviz} fieldpattern.cpp ${MAIN} control.cpp commandline.cpp
${CXX} ${PROF} ${MAIN} -c -o hyper-rogueviz.o ${MYFLAGS}
langen: langen.cpp language-cz.cpp language-pl.cpp language-tr.cpp language-ru.cpp language-de.cpp
langen: langen.cpp language-cz.cpp language-pl.cpp language-tr.cpp language-ru.cpp language-de.cpp language-ptbr.cpp language-fr.cpp
${CXX} langen.cpp -o langen -g
language-data.cpp: langen

View File

@ -2737,7 +2737,7 @@ EX void selectLanguageScreen() {
int v = vid.language;
dynamicval<int> d(vid.language, -1);
for(int i=0; i<NUMLAN-1 || i == v; i++) {
for(int i=0; i<NUMLAN; i++) {
vid.language = i;
dialog::addSelItem(XLAT("EN"), its(100 * transcompleteness[i] / transcompleteness[0]) + "%", 'a'+i);
}

View File

@ -447,7 +447,7 @@ struct debugScreen {
dialog::addBack();
dialog::display();
keyhandler = [this, what] (int sym, int uni) {
keyhandler = [this] (int sym, int uni) {
handlePanning(sym, uni);
dialog::handleNavigation(sym, uni);
if(applyCheat(uni)) ;

View File

@ -3054,14 +3054,14 @@ EX hyperpoint lie_log(hyperpoint h) {
}
else if(sol && !nih) {
h[3] = 0;
if(abs(h[2] > 1e-6)) {
if(abs(h[2]) > 1e-6) {
h[0] *= -h[2] / (exp(-h[2]) - 1);
h[1] *= h[2] / (exp(+h[2]) - 1);
}
}
else if(sol && nih) {
h[3] = 0;
if(abs(h[2] > 1e-6)) {
if(abs(h[2]) > 1e-6) {
ld z = h[2] * log(2);
h[0] *= -z / (exp(-z) - 1);
z = h[2] * log(3);
@ -3070,7 +3070,7 @@ EX hyperpoint lie_log(hyperpoint h) {
}
else if(nih) {
h[3] = 1;
if(abs(h[2] > 1e-6)) {
if(abs(h[2]) > 1e-6) {
ld z = h[2] * log(2);
h[0] *= z / (exp(+z) - 1);
z = h[2] * log(3);

View File

@ -22,7 +22,7 @@
template<class T> int isize(const T& x) { return x.size(); }
#define NUMLAN 7
#define NUMLAN 8
// language generator
@ -265,6 +265,27 @@ void langPT() {
current_language = "-";
}
void langFR() {
current_language = "FR";
static std::pair<const char *, const char *> ds[] = {
#define S(a,b) { a, b },
#define N(a,b,c,d,e)
#include "language-fr.cpp"
#undef N
#undef S
};
static std::pair<const char *, noun2> ns[] = {
#define S(a,b)
#define N(a,b,c,d,e) { a, noun2{ b, c, d, "", e } },
#include "language-fr.cpp"
#undef N
#undef S
};
for(auto&& elt : ds) d[7].add(elt.first, elt.second);
for(auto&& elt : ns) nouns[7].add(elt.first, elt.second);
current_language = "-";
}
int completeness[NUMLAN];
template<class T>
@ -332,6 +353,7 @@ int main() {
langPL(); langCZ(); langRU();
langTR(); langDE(); langPT();
langFR();
// verify
compute_completeness(d);

4033
language-fr.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ EX const string dnameof(eWall w) { return w >= 0 && w < walltypes ? winf[w].name
EX const string dnameof(eItem i) { return i >= 0 && i < ittypes ? iinf[i].name : format("[ITEM %d]", i); }
#if HDR
#define NUMLAN 7
#define NUMLAN 8
struct stringpar {
string v;