mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	Merge branch 'master' of https://github.com/zenorogue/hyperrogue
This commit is contained in:
		
							
								
								
									
										39
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								Makefile
									
									
									
									
									
								
							| @@ -1,16 +1,24 @@ | |||||||
| # This Makefile works for Mac OS X (El Capitan), MinGW, and Linux. | # This Makefile works for Mac OS X (El Capitan), MinGW, and Linux. | ||||||
| #  | #  | ||||||
|  | # Environmental vairables: | ||||||
|  | #   If you want to build with Glew, set | ||||||
|  | #     HYPERROGUE_USE_GLEW=1 | ||||||
|  | #   If you want to use libpng, set | ||||||
|  | #     HYPERROGUE_USE_PNG=1 | ||||||
|  | # | ||||||
| # For Mac OS X: | # For Mac OS X: | ||||||
| #   Run "brew install sdl" to install SDL in /usr/local. | #   Run `brew install sdl12-compat sdl_gfx sdl_mixer sdl_ttf` | ||||||
| #   Run "brew install sdl_gfx". | #   Run `brew install glew libpng` to install the optional dependencies | ||||||
| #   Run "brew install sdl_mixer". | #   Run `make` to build HyperRogue as `./hyperrogue`. | ||||||
| #   Run "brew install sdl_ttf". |  | ||||||
| #   Run "make" to build HyperRogue as ./hyperrogue. |  | ||||||
| # | # | ||||||
| # For MSYS2 and MinGW-w64: | # For MSYS2 and MinGW-w64: | ||||||
| #   You might need to run commands such as "pacman -S mingw-w64-x86_64-SDL" | #   To install SDL and other required libraries, run these commands | ||||||
| #   to install SDL and other required libraries. | #   from the MSYS2 shell: | ||||||
| #   Run "make" to build HyperRogue as ./hyperrogue.exe. | #       pacman -S mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-glew | ||||||
|  | #       pacman -S mingw-w64-ucrt-x86_64-SDL mingw-w64-ucrt-x86_64-SDL_mixer | ||||||
|  | #       pacman -S mingw-w64-ucrt-x86_64-SDL_ttf mingw-w64-ucrt-x86_64-SDL_gfx | ||||||
|  | #       pacman -S make | ||||||
|  | #   Then run "make" to build HyperRogue as ./hyperrogue.exe. | ||||||
| # | # | ||||||
| # For Ubuntu Linux: | # For Ubuntu Linux: | ||||||
| #   Run "sudo apt-get install libsdl-dev" to install SDL in /usr/local. | #   Run "sudo apt-get install libsdl-dev" to install SDL in /usr/local. | ||||||
| @@ -54,7 +62,7 @@ ifeq (${OS},linux) | |||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq (${OS},mingw) | ifeq (${OS},mingw) | ||||||
|   CXXFLAGS_EARLY += -DWINDOWS -mwindows -D_A_VOLID=8 |   CXXFLAGS_EARLY += -DWINDOWS -mwindows -D_A_VOLID=8 -I/ucrt64/include/SDL | ||||||
|   EXE_EXTENSION := .exe |   EXE_EXTENSION := .exe | ||||||
|   LDFLAGS_GL := -lopengl32 |   LDFLAGS_GL := -lopengl32 | ||||||
|   LDFLAGS_GLEW := -lglew32 |   LDFLAGS_GLEW := -lglew32 | ||||||
| @@ -68,9 +76,10 @@ ifeq (${OS},mingw) | |||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq (${OS},osx) | ifeq (${OS},osx) | ||||||
|   CXXFLAGS_EARLY += -DMAC -I/usr/local/include |   HOMEBREW_PREFIX := $(shell brew --prefix) | ||||||
|  |   CXXFLAGS_EARLY += -DMAC -I$(HOMEBREW_PREFIX)/include -I$(HOMEBREW_PREFIX)/include/SDL | ||||||
|   EXE_EXTENSION := |   EXE_EXTENSION := | ||||||
|   LDFLAGS_EARLY += -L/usr/local/lib |   LDFLAGS_EARLY += -L$(HOMEBREW_PREFIX)/lib | ||||||
|   LDFLAGS_GL := -framework AppKit -framework OpenGL |   LDFLAGS_GL := -framework AppKit -framework OpenGL | ||||||
|   LDFLAGS_GLEW := -lGLEW |   LDFLAGS_GLEW := -lGLEW | ||||||
|   LDFLAGS_PNG := -lpng |   LDFLAGS_PNG := -lpng | ||||||
| @@ -80,7 +89,7 @@ ifeq (${OS},osx) | |||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq (${TOOLCHAIN},clang) | ifeq (${TOOLCHAIN},clang) | ||||||
|   CXXFLAGS_STD = -std=c++11 |   CXXFLAGS_STD = -std=c++14 | ||||||
|   CXXFLAGS_EARLY += -fPIC |   CXXFLAGS_EARLY += -fPIC | ||||||
|   CXXFLAGS_EARLY += -W -Wall -Wextra -Wsuggest-override -pedantic |   CXXFLAGS_EARLY += -W -Wall -Wextra -Wsuggest-override -pedantic | ||||||
|   CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-char-subscripts -Wno-unknown-warning-option |   CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-char-subscripts -Wno-unknown-warning-option | ||||||
| @@ -88,7 +97,7 @@ ifeq (${TOOLCHAIN},clang) | |||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq (${TOOLCHAIN},gcc) | ifeq (${TOOLCHAIN},gcc) | ||||||
|   CXXFLAGS_STD = -std=c++11 |   CXXFLAGS_STD = -std=c++14 | ||||||
|   CXXFLAGS_EARLY += -fPIC |   CXXFLAGS_EARLY += -fPIC | ||||||
|   CXXFLAGS_EARLY += -W -Wall -Wextra -pedantic |   CXXFLAGS_EARLY += -W -Wall -Wextra -pedantic | ||||||
|   CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized |   CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized | ||||||
| @@ -96,7 +105,7 @@ ifeq (${TOOLCHAIN},gcc) | |||||||
| endif | endif | ||||||
|  |  | ||||||
| ifeq (${TOOLCHAIN},mingw) | ifeq (${TOOLCHAIN},mingw) | ||||||
|   CXXFLAGS_STD = -std=c++11 |   CXXFLAGS_STD = -std=c++14 | ||||||
|   CXXFLAGS_EARLY += -W -Wall -Wextra |   CXXFLAGS_EARLY += -W -Wall -Wextra | ||||||
|   CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized |   CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized | ||||||
|   CXXFLAGS_EARLY += -Wno-invalid-offsetof |   CXXFLAGS_EARLY += -Wno-invalid-offsetof | ||||||
| @@ -173,7 +182,7 @@ mymake$(EXE_EXTENSION): mymake.cpp | |||||||
| emscripten: hyper.html | emscripten: hyper.html | ||||||
|  |  | ||||||
| %.html %.js %.wasm: %.emscripten-sources | %.html %.js %.wasm: %.emscripten-sources | ||||||
| 	emcc -std=c++11 -O3 -s USE_ZLIB=1 -s LEGACY_GL_EMULATION=1 -s TOTAL_MEMORY=128MB hyperweb.cpp -o hyper.html | 	emcc -std=c++14 -O3 -s USE_ZLIB=1 -s LEGACY_GL_EMULATION=1 -s TOTAL_MEMORY=128MB hyperweb.cpp -o hyper.html | ||||||
|  |  | ||||||
| hyper.emscripten-sources: *.cpp autohdr.h | hyper.emscripten-sources: *.cpp autohdr.h | ||||||
|  |  | ||||||
|   | |||||||
| @@ -62,15 +62,13 @@ On Linux with apt-get: | |||||||
|  |  | ||||||
| On macOS with Homebrew: | On macOS with Homebrew: | ||||||
|  |  | ||||||
| ```brew install sdl sdl_ttf sdl_gfx sdl_mixer glew``` | ```brew install sdl sdl_ttf sdl_gfx sdl_mixer glew libpng``` | ||||||
|  |  | ||||||
| macOS users might also have to edit /usr/local/include/SDL/SDL_gfxPrimitives.h at line 38 to use quote include. |  | ||||||
|  |  | ||||||
| ### Building HyperRogue from source ### | ### Building HyperRogue from source ### | ||||||
| ``` | ``` | ||||||
| git clone https://github.com/zenorogue/hyperrogue.git hyperrogue | git clone https://github.com/zenorogue/hyperrogue.git hyperrogue | ||||||
| cd hyperrogue | cd hyperrogue | ||||||
| make | HYPERROGUE_USE_GLEW=1 HYPERROGUE_USE_PNG=1 make | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| The `mymake` program builds HyperRogue in parts. It takes longer than the method shown above, but it uses significantly less memory during compilation, and when you change something, `mymake` will only recompile the changed file. | The `mymake` program builds HyperRogue in parts. It takes longer than the method shown above, but it uses significantly less memory during compilation, and when you change something, `mymake` will only recompile the changed file. | ||||||
|   | |||||||
| @@ -28,6 +28,7 @@ EX namespace bow { | |||||||
| #if HDR | #if HDR | ||||||
| enum eWeapon { wBlade, wCrossbow }; | enum eWeapon { wBlade, wCrossbow }; | ||||||
| enum eCrossbowStyle { cbBull, cbGeodesic, cbGeometric }; | enum eCrossbowStyle { cbBull, cbGeodesic, cbGeometric }; | ||||||
|  | const string bowName[] = { "bull", "geod", "geom" }; | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| EX eWeapon weapon; | EX eWeapon weapon; | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								hud.cpp
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								hud.cpp
									
									
									
									
									
								
							| @@ -705,8 +705,7 @@ EX void drawStats() { | |||||||
|     if(peace::on) vers += " peace"; |     if(peace::on) vers += " peace"; | ||||||
|     if(racing::on) vers += " racing"; |     if(racing::on) vers += " racing"; | ||||||
|     if(daily::on) vers += " strange"; |     if(daily::on) vers += " strange"; | ||||||
|     if(bow::weapon && bow::style == bow::cbBull) vers += " b/bull"; |     if(bow::crossbow_mode()) vers += " b/" + bow::bowName[bow::style]; | ||||||
|     if(bow::weapon && bow::style == bow::cbGeodesic) vers += " b/geo"; |  | ||||||
|     if(land_structure != default_land_structure()) |     if(land_structure != default_land_structure()) | ||||||
|       vers += " " + land_structure_name(true); |       vers += " " + land_structure_name(true); | ||||||
|     if(princess::challenge) vers += " Princess"; |     if(princess::challenge) vers += " Princess"; | ||||||
|   | |||||||
| @@ -447,7 +447,7 @@ EX namespace scores { | |||||||
| /** \brief the amount of boxes reserved for each hr::score item */ | /** \brief the amount of boxes reserved for each hr::score item */ | ||||||
| #define MAXBOX 500 | #define MAXBOX 500 | ||||||
| /** \brief currently used boxes in hr::score */ | /** \brief currently used boxes in hr::score */ | ||||||
| #define POSSCORE 416 | #define POSSCORE 418 | ||||||
| /** \brief a struct to keep local score from an earlier game */ | /** \brief a struct to keep local score from an earlier game */ | ||||||
| struct score { | struct score { | ||||||
|   /** \brief version used */ |   /** \brief version used */ | ||||||
| @@ -958,6 +958,8 @@ EX void applyBoxes() { | |||||||
|   applyBoxM(moAsteroid); |   applyBoxM(moAsteroid); | ||||||
|   applyBoxNum(items[itTreat]); |   applyBoxNum(items[itTreat]); | ||||||
|   applyBoxM(moVampire); |   applyBoxM(moVampire); | ||||||
|  |   applyBoxNum(asteroids_generated); | ||||||
|  |   applyBoxNum(asteroid_orbs_generated); | ||||||
|  |  | ||||||
|   if(POSSCORE != boxid) printf("ERROR: %d boxes\n", boxid); |   if(POSSCORE != boxid) printf("ERROR: %d boxes\n", boxid); | ||||||
|   if(isize(invorb)) { println(hlog, "ERROR: Orbs not taken into account"); exit(1); } |   if(isize(invorb)) { println(hlog, "ERROR: Orbs not taken into account"); exit(1); } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue