mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-19 11:44:48 +00:00
Merge pull request #307 from Quuxplusone/language-fr
Add @3raven's language-fr.cpp
This commit is contained in:
commit
e50c22134c
@ -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
|
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}
|
${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
|
${CXX} langen.cpp -o langen -g
|
||||||
|
|
||||||
language-data.cpp: langen
|
language-data.cpp: langen
|
||||||
|
@ -2737,7 +2737,7 @@ EX void selectLanguageScreen() {
|
|||||||
int v = vid.language;
|
int v = vid.language;
|
||||||
dynamicval<int> d(vid.language, -1);
|
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;
|
vid.language = i;
|
||||||
dialog::addSelItem(XLAT("EN"), its(100 * transcompleteness[i] / transcompleteness[0]) + "%", 'a'+i);
|
dialog::addSelItem(XLAT("EN"), its(100 * transcompleteness[i] / transcompleteness[0]) + "%", 'a'+i);
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ struct debugScreen {
|
|||||||
dialog::addBack();
|
dialog::addBack();
|
||||||
dialog::display();
|
dialog::display();
|
||||||
|
|
||||||
keyhandler = [this, what] (int sym, int uni) {
|
keyhandler = [this] (int sym, int uni) {
|
||||||
handlePanning(sym, uni);
|
handlePanning(sym, uni);
|
||||||
dialog::handleNavigation(sym, uni);
|
dialog::handleNavigation(sym, uni);
|
||||||
if(applyCheat(uni)) ;
|
if(applyCheat(uni)) ;
|
||||||
|
@ -3054,14 +3054,14 @@ EX hyperpoint lie_log(hyperpoint h) {
|
|||||||
}
|
}
|
||||||
else if(sol && !nih) {
|
else if(sol && !nih) {
|
||||||
h[3] = 0;
|
h[3] = 0;
|
||||||
if(abs(h[2] > 1e-6)) {
|
if(abs(h[2]) > 1e-6) {
|
||||||
h[0] *= -h[2] / (exp(-h[2]) - 1);
|
h[0] *= -h[2] / (exp(-h[2]) - 1);
|
||||||
h[1] *= h[2] / (exp(+h[2]) - 1);
|
h[1] *= h[2] / (exp(+h[2]) - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(sol && nih) {
|
else if(sol && nih) {
|
||||||
h[3] = 0;
|
h[3] = 0;
|
||||||
if(abs(h[2] > 1e-6)) {
|
if(abs(h[2]) > 1e-6) {
|
||||||
ld z = h[2] * log(2);
|
ld z = h[2] * log(2);
|
||||||
h[0] *= -z / (exp(-z) - 1);
|
h[0] *= -z / (exp(-z) - 1);
|
||||||
z = h[2] * log(3);
|
z = h[2] * log(3);
|
||||||
@ -3070,7 +3070,7 @@ EX hyperpoint lie_log(hyperpoint h) {
|
|||||||
}
|
}
|
||||||
else if(nih) {
|
else if(nih) {
|
||||||
h[3] = 1;
|
h[3] = 1;
|
||||||
if(abs(h[2] > 1e-6)) {
|
if(abs(h[2]) > 1e-6) {
|
||||||
ld z = h[2] * log(2);
|
ld z = h[2] * log(2);
|
||||||
h[0] *= z / (exp(+z) - 1);
|
h[0] *= z / (exp(+z) - 1);
|
||||||
z = h[2] * log(3);
|
z = h[2] * log(3);
|
||||||
|
24
langen.cpp
24
langen.cpp
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
template<class T> int isize(const T& x) { return x.size(); }
|
template<class T> int isize(const T& x) { return x.size(); }
|
||||||
|
|
||||||
#define NUMLAN 7
|
#define NUMLAN 8
|
||||||
|
|
||||||
// language generator
|
// language generator
|
||||||
|
|
||||||
@ -265,6 +265,27 @@ void langPT() {
|
|||||||
current_language = "-";
|
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];
|
int completeness[NUMLAN];
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -332,6 +353,7 @@ int main() {
|
|||||||
|
|
||||||
langPL(); langCZ(); langRU();
|
langPL(); langCZ(); langRU();
|
||||||
langTR(); langDE(); langPT();
|
langTR(); langDE(); langPT();
|
||||||
|
langFR();
|
||||||
|
|
||||||
// verify
|
// verify
|
||||||
compute_completeness(d);
|
compute_completeness(d);
|
||||||
|
4033
language-fr.cpp
Normal file
4033
language-fr.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -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); }
|
EX const string dnameof(eItem i) { return i >= 0 && i < ittypes ? iinf[i].name : format("[ITEM %d]", i); }
|
||||||
|
|
||||||
#if HDR
|
#if HDR
|
||||||
#define NUMLAN 7
|
#define NUMLAN 8
|
||||||
|
|
||||||
struct stringpar {
|
struct stringpar {
|
||||||
string v;
|
string v;
|
||||||
|
Loading…
Reference in New Issue
Block a user