mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	Merge pull request #44 from Quuxplusone/misc-windows
Miscellaneous Windows updates.
This commit is contained in:
		| @@ -37,7 +37,7 @@ hyper.o: *.cpp language-data.cpp | ||||
| 	$(CXX) $(CXXFLAGS) -O2 -c hyper.cpp | ||||
|  | ||||
| langen: langen.cpp language-??.cpp language-ptbr.cpp | ||||
| 	$(CXX) $(CXXFLAGS) -O0 -Wno-embedded-directive langen.cpp -o langen | ||||
| 	$(CXX) $(CXXFLAGS) -O0 langen.cpp -o langen | ||||
|  | ||||
| language-data.cpp: langen | ||||
| 	./langen > language-data.cpp | ||||
|   | ||||
| @@ -35,7 +35,7 @@ hyper.res: hyper.rc hr-icon.ico | ||||
| 	windres hyper.rc -O coff -o hyper.res | ||||
|  | ||||
| langen.exe: langen.cpp language-??.cpp language-ptbr.cpp | ||||
| 	$(CXX) $(CXXFLAGS) -O0 -Wno-embedded-directive langen.cpp -o langen | ||||
| 	$(CXX) $(CXXFLAGS) -O0 langen.cpp -o langen | ||||
|  | ||||
| language-data.cpp: langen.exe | ||||
| 	./langen.exe > language-data.cpp | ||||
|   | ||||
							
								
								
									
										102
									
								
								langen.cpp
									
									
									
									
									
								
							
							
						
						
									
										102
									
								
								langen.cpp
									
									
									
									
									
								
							| @@ -2,11 +2,6 @@ | ||||
|  | ||||
| // Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details | ||||
|  | ||||
| #define GEN_M 0 | ||||
| #define GEN_F 1 | ||||
| #define GEN_N 2 | ||||
| #define GEN_O 3 | ||||
|  | ||||
| #include <map> | ||||
| #include <string> | ||||
| #include <cstdio> | ||||
| @@ -14,6 +9,17 @@ | ||||
| #include <cstdlib> | ||||
| #include <set> | ||||
|  | ||||
| #define GEN_M 0 | ||||
| #define GEN_F 1 | ||||
| #define GEN_N 2 | ||||
| #define GEN_O 3 | ||||
|  | ||||
| #if MAC | ||||
|  #define IF_MAC(y,z) y | ||||
| #else | ||||
|  #define IF_MAC(y,z) z | ||||
| #endif | ||||
|  | ||||
| template<class T> int isize(const T& x) { return x.size(); } | ||||
|  | ||||
| #define NUMLAN 7 | ||||
| @@ -29,7 +35,7 @@ template<class T> struct dictionary { | ||||
|     else m[s] = std::move(val); | ||||
|     } | ||||
|   T& operator [] (const std::string& s) { return m[s]; } | ||||
|   int count(const std::string& s) { return m.count(s); } | ||||
|   int count(const std::string& s) const { return m.count(s); } | ||||
|   }; | ||||
|  | ||||
| dictionary<std::string> d[NUMLAN]; | ||||
| @@ -242,8 +248,37 @@ void langPT() { | ||||
|  | ||||
| int completeness[NUMLAN]; | ||||
|  | ||||
| template<class T> | ||||
| void compute_completeness(const T& dict) | ||||
| { | ||||
|   std::set<std::string> s; | ||||
|   for(int i=1; i<NUMLAN; i++)  | ||||
|     for(auto&& elt : dict[i].m) | ||||
|       s.insert(elt.first); | ||||
|    | ||||
|   for(auto&& elt : s) { | ||||
|     std::string mis = "", mis1 = ""; | ||||
|     for(int i=1; i<NUMLAN; i++) if(dict[i].count(elt) == 0) { | ||||
|       std::string which = d[i]["EN"]; | ||||
|       if(which != "TR" && which != "DE" && which != "PT-BR") | ||||
|         mis += which; | ||||
|       else | ||||
|         mis1 += which; | ||||
|       } | ||||
|     if(mis != "" && !isrepeat(elt)) | ||||
|       printf("// #warning Missing [%s/%s]: %s\n", mis.c_str(), mis1.c_str(), escape(elt, "?")); | ||||
|  | ||||
|     if(!isrepeat(elt)) { | ||||
|       completeness[0]++; | ||||
|       for(int i=1; i<NUMLAN; i++) if(dict[i].count(elt)) completeness[i]++; | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|    | ||||
| int main() { | ||||
|  | ||||
|   printf("// DO NOT EDIT -- this file is generated automatically with langen\n\n"); | ||||
|  | ||||
|   nothe.insert("R'Lyeh"); | ||||
|   nothe.insert("Camelot"); | ||||
|   plural.insert("Crossroads"); | ||||
| @@ -257,58 +292,13 @@ int main() { | ||||
|   allchars.insert("∞"); | ||||
|   allchars.insert("½"); | ||||
|   allchars.insert("²"); | ||||
|    | ||||
|  | ||||
|   langPL(); langCZ(); langRU(); | ||||
|   langTR(); langDE(); langPT(); | ||||
|  | ||||
|   // verify | ||||
|   std::set<std::string> s; | ||||
|   for(int i=1; i<NUMLAN; i++)  | ||||
|     for(auto&& elt : d[i].m) | ||||
|       s.insert(elt.first); | ||||
|    | ||||
|   printf("// DO NOT EDIT -- this file is generated automatically with langen\n\n"); | ||||
|  | ||||
|   for(auto&& elt : s) { | ||||
|     std::string mis = "", mis1 = ""; | ||||
|     for(int i=1; i<NUMLAN; i++) if(d[i].count(elt) == 0) { | ||||
|       std::string which = d[i]["EN"]; | ||||
|       if(which != "TR" && which != "DE" && which != "PT-BR") | ||||
|         mis += which; | ||||
|       else | ||||
|         mis1 += which; | ||||
|       } | ||||
|     if(mis != "" && !isrepeat(elt)) | ||||
|       printf("// #warning Missing [%s/%s]: %s\n", mis.c_str(), mis1.c_str(), escape(elt, "?")); | ||||
|  | ||||
|     if(!isrepeat(elt)) { | ||||
|       completeness[0]++; | ||||
|       for(int i=1; i<NUMLAN; i++) if(d[i].count(elt)) completeness[i]++; | ||||
|       } | ||||
|     } | ||||
|    | ||||
|   s.clear(); | ||||
|  | ||||
|   for(int i=1; i<NUMLAN; i++)  | ||||
|     for(auto&& elt : nouns[i].m) | ||||
|       s.insert(elt.first); | ||||
|  | ||||
|   for(auto&& elt : s) { | ||||
|     std::string mis = "", mis1 = ""; | ||||
|     for(int i=1; i<NUMLAN; i++) if(nouns[i].count(elt) == 0) { | ||||
|       std::string which = d[i]["EN"]; | ||||
|       if(which != "TR" && which != "DE" && which != "PT-BR") | ||||
|         mis += which; | ||||
|       else mis1 += which; | ||||
|       } | ||||
|     if(mis != "" && !isrepeat(elt)) | ||||
|       printf("// #warning Missing [%s/%s]: %s\n", mis.c_str(), mis1.c_str(), escape(elt, "?")); | ||||
|  | ||||
|     if(!isrepeat(elt)) { | ||||
|       completeness[0]++; | ||||
|       for(int i=1; i<NUMLAN; i++) if(nouns[i].count(elt)) completeness[i]++; | ||||
|       } | ||||
|     } | ||||
|   compute_completeness(d); | ||||
|   compute_completeness(nouns); | ||||
|  | ||||
|   for(int i=1; i<NUMLAN; i++) { | ||||
|     addutftoset(allchars, d[i]); | ||||
| @@ -332,10 +322,6 @@ int main() { | ||||
|   for(int i=0; i<NUMLAN; i++) printf("%d, ", completeness[i]); | ||||
|   printf("};\n"); | ||||
|  | ||||
|   for(int i=1; i<NUMLAN; i++)  | ||||
|     for(auto&& elt : d[i].m) | ||||
|       s.insert(elt.first); | ||||
|    | ||||
|   printf("\n//statistics\n"); | ||||
|   for(auto&& elt : d[1].m) | ||||
|     d[0][elt.first] = elt.first; | ||||
|   | ||||
| @@ -5192,27 +5192,17 @@ S("The game starts in the Icy Lands. Collect the Ice Diamonds " | ||||
| S("Hypersian Rug model", "Model hyperského koberce") | ||||
| S( | ||||
|   "New players think that the action of HyperRogue takes place on a sphere. " | ||||
| #if NORUG | ||||
|   "This is not true -- try the Tutorial in the native desktop version shows " | ||||
|   "the surface HyperRogue actually takes place on.", | ||||
| #else | ||||
|   "This is not true -- the next slide will show the surface HyperRogue " | ||||
|   "actually takes place on.\n\n" | ||||
|   "Use arrow keys to rotate the model, and Page Up/Down to zoom.\n\n" | ||||
|   "If you do not see anything, press '5' to try a safer renderer.", | ||||
| #endif | ||||
|    | ||||
|  | ||||
|   "Noví hráči si často myslí, že se HyperRogue odehrává na povrchu koule. " | ||||
| #if NORUG | ||||
|   "Není to pravda -- Tutoriál v desktopové verzi ti může ukázat povrch, " | ||||
|   "na jakém se HyperRogue opravdu odehrává." | ||||
| #else | ||||
|   "Není to pravda -- další snímek ti ukáže povrch, na jakém se " | ||||
|   "HyperRogue opravdu odehrává.\n\n" | ||||
|   "Model můžeš otáčet šipkami a zoomovat klávesami Page Up/Down.\n\n" | ||||
|   "Pokud nic nevidíš, stiskni klávesu '5' pro aktivaci bezpečnějšího rendereru." | ||||
| #endif | ||||
|   ) | ||||
|  | ||||
| S("Expansion", "Expanze") | ||||
| @@ -5294,23 +5284,23 @@ S( | ||||
|   "it will appear to go slower -- this is because you are running " | ||||
|   "in a straight line, and the Running Dog has to run in a curve " | ||||
|   "called an equidistant.\n\n" | ||||
| #if ISMAC | ||||
|  "Remember that you can click with right Shift on anything to get more information.", | ||||
| #else | ||||
|   "Remember that you can right click on anything to get more information.", | ||||
| #endif | ||||
| IF_MAC( | ||||
|  "Remember that you can click with right Shift on anything to get more information." | ||||
| , | ||||
|   "Remember that you can right click on anything to get more information." | ||||
| ), | ||||
|   "Chceš-li se dozvědět víc o přímkách, běž dál a měl bys najít Zemi " | ||||
|   "věčného pohybu. Pokus se tam běžet po přímce, zatímco vedle tebe běží " | ||||
|   "Běžící pes. I když běží stejně rychle jako ty, bude se zdát, že je " | ||||
|   "pomalejší -- to proto, že ty běžíš po přímce, zatímco Běžící pes musí " | ||||
|   "běžet po křivce zvané 'ekvidistanta'.\n\n" | ||||
| #if ISMAC | ||||
| IF_MAC( | ||||
|   "Nezapomeň, že pokud na cokoli klikneš s pravým shiftem, můžeš o tom " | ||||
|   "získat víc informací." | ||||
| #else | ||||
| , | ||||
|   "Nezapomeň, že pokud na cokoli klikneš pravým tlačítkem, můžeš o tom " | ||||
|   "získat víc informací." | ||||
| #endif | ||||
| ) | ||||
|   ) | ||||
|  | ||||
| S("Equidistants", "Ekvidistanty") | ||||
|   | ||||
| @@ -5134,27 +5134,17 @@ S("The game starts in the Icy Lands. Collect the Ice Diamonds " | ||||
| S("Hypersian Rug model", "Model Hiperskiego Dywanu") | ||||
| S( | ||||
|   "New players think that the action of HyperRogue takes place on a sphere. " | ||||
| #if NORUG | ||||
|   "This is not true -- the Tutorial in the native desktop version shows " | ||||
|   "the surface HyperRogue actually takes place on.", | ||||
| #else | ||||
|   "This is not true -- the next slide will show the surface HyperRogue " | ||||
|   "actually takes place on.\n\n" | ||||
|   "Use arrow keys to rotate the model, and Page Up/Down to zoom.\n\n" | ||||
|   "If you do not see anything, press '5' to try a safer renderer.", | ||||
| #endif | ||||
|    | ||||
|  | ||||
|   "Nowi gracze myślą, że akcja HyperRogue toczy się na sferze. " | ||||
| #if NORUG | ||||
|   "To nieprawda -- Podręcznik w komputerowej wersji wykonywalnej " | ||||
|   "pokazuje powierzchnię, na której w rzeczywistości toczy się rozgrywka." | ||||
| #else | ||||
|   "To nieprawda -- kolejny slajd pokazuje powierzchnię, " | ||||
|   "na której toczy się gra. " | ||||
|   "Obracaj modelem strzałkami, Page Up/Down by skalować.\n\n" | ||||
|   "Jeśli nic nie widzisz, naciśnij '5' dla bezpieczniejszego renderera." | ||||
| #endif | ||||
|   ) | ||||
|  | ||||
| S("Expansion", "Ekspansja") | ||||
| @@ -5232,22 +5222,22 @@ S( | ||||
|   "it will appear to go slower -- this is because you are running " | ||||
|   "in a straight line, and the Running Dog has to run in a curve " | ||||
|   "called an equidistant.\n\n" | ||||
| #if ISMAC | ||||
|  "Remember that you can click with right Shift on anything to get more information.", | ||||
| #else | ||||
|   "Remember that you can right click on anything to get more information.", | ||||
| #endif | ||||
| IF_MAC( | ||||
|  "Remember that you can click with right Shift on anything to get more information." | ||||
| , | ||||
|  "Remember that you can right click on anything to get more information." | ||||
| ), | ||||
|   "By dowiedzieć się więcej o liniach prostych, " | ||||
|   "podróżuj dalej, aż znajdziesz Krainę Wiecznego Ruchu. " | ||||
|   "Biegnij w linii prostej z Psem biegnącym obok. " | ||||
|   "Mimo że Pies biegnie z tą samą prędkością, nie będzie " | ||||
|   "w stanie Cię dogonić -- ponieważ Ty ruszasz się w linii prostej, " | ||||
|   "a Pies biegnie po krzywej zwanej ekwidystantą.\n\n" | ||||
| #if ISMAC | ||||
| IF_MAC( | ||||
|  "Pamiętaj, że możesz klikać z prawym Shiftem na różnych elementach gry, by dowiedzieć się o nich więcej." | ||||
| #else | ||||
| , | ||||
|  "Pamiętaj, że możesz klikać prawym przyciskiem na różnych elementach gry, by dowiedzieć się o nich więcej." | ||||
| #endif | ||||
| ) | ||||
|   ) | ||||
|  | ||||
| S("Equidistants", "Ekwidystanty") | ||||
|   | ||||
| @@ -5215,27 +5215,16 @@ S("The game starts in the Icy Lands. Collect the Ice Diamonds " | ||||
| S("Hypersian Rug model", "Model Hiperskiego Dywanu") | ||||
| S( | ||||
|   "New players think that the action of HyperRogue takes place on a sphere. " | ||||
| #ifdef MOBWEB | ||||
|   "This is not true -- the Tutorial in the native desktop version shows " | ||||
|   "the surface HyperRogue actually takes place on.", | ||||
| #else | ||||
|   "This is not true -- the next slide will show the surface HyperRogue " | ||||
|   "actually takes place on.\n\n" | ||||
|   "Use arrow keys to rotate the model, and Page Up/Down to zoom.\n\n" | ||||
|   "If you do not see anything, press '5' to try a safer renderer.", | ||||
| #endif | ||||
|    | ||||
|  | ||||
|   "Nowi gracze myślą, że akcja HyperRogue toczy się na sferze. " | ||||
| #ifdef MOBWEB | ||||
|   "To nieprawda -- Podręcznik w komputerowej wersji wykonywalnej " | ||||
|   "pokazuje powierzchnię, na której w rzeczywistości toczy się rozgrywka." | ||||
| #else | ||||
|   "To nieprawda -- kolejny slajd pokazuje powierzchnię, " | ||||
|   "na której toczy się gra. " | ||||
|   "Obracaj modelem strzałkami, Page Up/Down by skalować.\n\n" | ||||
|   "Jeśli nic nie widzisz, naciśnij '5' dla bezpieczniejszego renderera." | ||||
| #endif | ||||
|   ) | ||||
|  | ||||
| S("Expansion", "Ekspansja") | ||||
| @@ -5313,22 +5302,22 @@ S( | ||||
|   "it will appear to go slower -- this is because you are running " | ||||
|   "in a straight line, and the Running Dog has to run in a curve " | ||||
|   "called an equidistant.\n\n" | ||||
| #ifdef MAC | ||||
|  "Remember that you can click with right Shift on anything to get more information.", | ||||
| #else | ||||
|   "Remember that you can right click on anything to get more information.", | ||||
| #endif | ||||
| IF_MAC( | ||||
|  "Remember that you can click with right Shift on anything to get more information." | ||||
| , | ||||
|   "Remember that you can right click on anything to get more information." | ||||
| ), | ||||
|   "By dowiedzieć się więcej o liniach prostych, " | ||||
|   "podróżuj dalej, aż znajdziesz Krainę Wiecznego Ruchu. " | ||||
|   "Biegnij w linii prostej z Psem biegnącym obok. " | ||||
|   "Mimo że Pies biegnie z tą samą prędkością, nie będzie " | ||||
|   "w stanie Cię dogonić -- ponieważ Ty ruszasz się w linii prostej, " | ||||
|   "a Pies biegnie po krzywej zwanej ekwidystantą.\n\n" | ||||
| #ifdef MAC | ||||
| IF_MAC( | ||||
|  "Pamiętaj, że możesz klikać z prawym Shiftem na różnych elementach gry, by dowiedzieć się o nich więcej." | ||||
| #else | ||||
| , | ||||
|  "Pamiętaj, że możesz klikać prawym przyciskiem na różnych elementach gry, by dowiedzieć się o nich więcej." | ||||
| #endif | ||||
| ) | ||||
|   ) | ||||
|  | ||||
| S("Equidistants", "Ekwidystanty") | ||||
|   | ||||
| @@ -5290,25 +5290,14 @@ S("The game starts in the Icy Lands. Collect the Ice Diamonds " | ||||
| S("Hypersian Rug model", "Модель Гиперсидского ковра") | ||||
| S( | ||||
|   "New players think that the action of HyperRogue takes place on a sphere. " | ||||
| #if NORUG | ||||
|   "This is not true -- the Tutorial in the native desktop version shows " | ||||
|   "the surface HyperRogue actually takes place on.", | ||||
| #else | ||||
|   "This is not true -- the next slide will show the surface HyperRogue " | ||||
|   "actually takes place on.\n\n" | ||||
|   "Use arrow keys to rotate the model, and Page Up/Down to zoom.\n\n" | ||||
|   "If you do not see anything, press '5' to try a safer renderer.", | ||||
| #endif | ||||
|   | ||||
|   "Новички иногда думают, что действие в HyperRogue происходит на сфере. " | ||||
| #if NORUG | ||||
|   "Это неправда -- Руководство в компьютерной версии покажет тебе " | ||||
|   "настоящую поверхность HyperRogue." | ||||
| #else | ||||
|   "Это неправда -- на следующем слайде показана настоящая поверхность HyperRogue.\n\n" | ||||
|   "Используйте стрелки, чтобы поворачивать модель, и Page Up/Down, чтобы менять размер.\n\n" | ||||
|   "Если ничего не видно, нажми '5' для безопасного визуализатора." | ||||
| #endif | ||||
|   ) | ||||
|   | ||||
| S("Expansion", "Расширение") | ||||
| @@ -5387,11 +5376,11 @@ S( | ||||
|   "it will appear to go slower -- this is because you are running " | ||||
|   "in a straight line, and the Running Dog has to run in a curve " | ||||
|   "called an equidistant.\n\n" | ||||
| #if ISMAC | ||||
|  "Remember that you can click with right Shift on anything to get more information.", | ||||
| #else | ||||
|   "Remember that you can right click on anything to get more information.", | ||||
| #endif | ||||
| IF_MAC( | ||||
|  "Remember that you can click with right Shift on anything to get more information." | ||||
| , | ||||
|   "Remember that you can right click on anything to get more information." | ||||
| ), | ||||
|   "Чтобы узнать больше о прямых линиях, " | ||||
|   "найди Землю вечного движения. " | ||||
|   "Попробуй двигаться по прямой вместе с собакой, бегущей рядом. " | ||||
|   | ||||
| @@ -924,6 +924,7 @@ namespace mapeditor { | ||||
|  | ||||
|   void drawHandleKey(int sym, int uni); | ||||
|    | ||||
| #if CAP_TEXTURE | ||||
|   static ld brush_sizes[10] = { | ||||
|     0.001, 0.002, 0.005, 0.0075, 0.01, 0.015, 0.02, 0.05, 0.075, 0.1}; | ||||
|    | ||||
| @@ -942,6 +943,7 @@ namespace mapeditor { | ||||
|     0x404040FF, | ||||
|     0x804000FF | ||||
|     }; | ||||
| #endif | ||||
|      | ||||
|   void showDrawEditor() { | ||||
|     cmode = sm::DRAW; | ||||
| @@ -1524,6 +1526,7 @@ namespace mapeditor { | ||||
|         dialog::editNumber(texture::penwidth, 0, 0.1, 0.005, 0.02, XLAT("brush size"), XLAT("brush size")); | ||||
|       } | ||||
| #else | ||||
|     (void)clickused; | ||||
|     if(0); | ||||
| #endif     | ||||
|  | ||||
|   | ||||
| @@ -250,6 +250,11 @@ | ||||
| #define HYPERPATH "" | ||||
| #endif | ||||
|  | ||||
| #if ISWINDOWS | ||||
| #define hyper fake_hyper // avoid "hyper" typedef in <_mingw.h> | ||||
| #define WIN32_LEAN_AND_MEAN // avoid "rad1" macro in <windows.h> | ||||
| #endif | ||||
|  | ||||
| #include <stdio.h> | ||||
|  | ||||
| #if CAP_SDL | ||||
| @@ -407,3 +412,7 @@ extern "C" { | ||||
| #if CAP_SDL | ||||
| union SDL_Event; | ||||
| #endif | ||||
|  | ||||
| #if ISWINDOWS | ||||
| #undef hyper  // avoid "hyper" typedef in <_mingw.h> | ||||
| #endif | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue