diff --git a/Makefile b/Makefile index 19953bb..dd82303 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,18 @@ -# _______________ ,--------------------------------------------------------. -# //`````````````\\ \ \ -# //~~~~~~~~~~~~~~~\\ \ by @ohsqueezy & @sleepin \ -# //=================\\ \ [ohsqueezy.itch.io] [sleepin.itch.io] \ -# // \\ \ \ -# // \\ \ zlib licensed code at [git.nugget.fun/nugget/gunkiss] \ -# // ☆ GUNKISS ☆ \\ \ \ -# //_________________________\\ `--------------------------------------------------------' +# _____________ ,---------------------------------------------------------. +# /,-----------,\ \ \ +# //~~~~~~~~~~~~~\\ \ By @ohsqueezy & @sleepin \ +# //===============\\ \ \ +# // \\ \ \ +# // ☆ GUNKISS ☆ \\ \ Open source code at \ +# /'_____________________'\ \ \ +# '-----------------------' `---------------------------------------------------------' # -# This Makefile is used to build a Linux executable with `make linux`. Other platform targets have not been -# tested and were copied over from a previous project. +# This Makefile is used to create a Linux or web build. # -# The [SPACEBOX] game framework source code from [git.nugget.fun/nugget/spacebox] is required. If this is the -# Git repository for Gunkiss, the source code should already have been cloned into `lib/sb` as a submodule using -# `git clone --recursive git.nugget.fun/nugget/gunkiss`. The paths below are the default for the repository, but -# they can be edited as necessary. +# The [SPACEBOX] game framework source code from is required. If this +# is the Git repository for Gunkiss, the source code should already have been cloned into `lib/sb` as a submodule +# using `git clone --recursive open.shampoo.ooo/shampoo/gunkiss`. The paths below are the default for the repository, +# but they can be edited as necessary. ######### # Paths # @@ -89,13 +88,13 @@ $(SRC_DIR)Pudding.o : $(SRC_H_FILES) $(SB_H_FILES) # Linux build # ############### -linux : CFLAGS = -g -Wall -Wextra -O1 -c -I$(SB_LIB_DIR) -I$(SB_SRC_DIR) $(SDL_CFLAGS) -I$(HOME)/local/zbar/include \ +gunkiss : CFLAGS = -g -Wall -Wextra -O1 -c -I$(SB_LIB_DIR) -I$(SB_SRC_DIR) $(SDL_CFLAGS) -I$(HOME)/local/zbar/include \ -I $(HOME)/local/opencv/include/opencv4 -I $(HOME)/ext/software/emsdk/upstream/emscripten/system/include -linux : CXXFLAGS = $(CFLAGS) --std=c++17 -linux : LFLAGS = $(SDL_LFLAGS) -Wl,--enable-new-dtags -lpthread -lGL -lGLESv2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lstdc++fs -lcurl \ +gunkiss : CXXFLAGS = $(CFLAGS) --std=c++17 +gunkiss : LFLAGS = $(SDL_LFLAGS) -Wl,--enable-new-dtags -lpthread -lGL -lGLESv2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lstdc++fs -lcurl \ -L$(HOME)/local/opencv/lib -Wl,-rpath,$(HOME)/local/opencv/lib -lopencv_videoio -lopencv_core -lopencv_highgui -lopencv_imgproc \ -l opencv_barcode -L$(HOME)/local/zbar/lib -Wl,-rpath,$(HOME)/local/zbar/lib -lzbar -linux : $(GLEW_DIR)glew.o $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPrimitives.o) \ +gunkiss : $(GLEW_DIR)glew.o $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPrimitives.o) \ $(SB_O_FILES) $(SRC_O_FILES) $(CREATE_FONT_SYMLINK) $(CXX) $^ $(LFLAGS) -D__LINUX__ -o gunkiss @@ -104,7 +103,7 @@ linux : $(GLEW_DIR)glew.o $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPri # Web build # ############# -# Use Emscripten to output JavaScript and an HTML index page for running in the browser +# Use Emscripten to output JavaScript EMSCRIPTENHOME = $(HOME)/ext/software/emsdk/upstream/emscripten EMSCRIPTEN_CFLAGS = -O0 -Wall -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS="['png', 'jpg']" -s USE_SDL_TTF=2 -s USE_SDL_MIXER=2 \ @@ -116,11 +115,11 @@ EMSCRIPTEN_LFLAGS = -s MIN_WEBGL_VERSION=2 -s EXPORTED_FUNCTIONS="['_main', '_ma EMSCRIPTEN_PRELOADS = --preload-file "BPmono.ttf"@/ --preload-file "config.json"@/ --preload-file "resource/"@/"resource/" \ --preload-file "src/shaders/"@/"src/shaders/" -emscripten : CC = $(EMSCRIPTENHOME)/emcc -emscripten : CXX = $(EMSCRIPTENHOME)/em++ -emscripten : CFLAGS = $(EMSCRIPTEN_CFLAGS) -emscripten : CXXFLAGS = $(CFLAGS) --std=c++17 -emscripten : $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPrimitives.o) $(SB_O_FILES) $(SRC_O_FILES) +gunkiss.js : CC = $(EMSCRIPTENHOME)/emcc +gunkiss.js : CXX = $(EMSCRIPTENHOME)/em++ +gunkiss.js : CFLAGS = $(EMSCRIPTEN_CFLAGS) +gunkiss.js : CXXFLAGS = $(CFLAGS) --std=c++17 +gunkiss.js : $(addprefix $(SDLGFX2_DIR),SDL2_rotozoom.o SDL2_gfxPrimitives.o) $(SB_O_FILES) $(SRC_O_FILES) $(CREATE_FONT_SYMLINK) $(CXX) $^ $(CXXFLAGS) $(EMSCRIPTEN_LFLAGS) $(EMSCRIPTEN_PRELOADS) -o gunkiss.js @@ -146,68 +145,3 @@ clean-all : clean PATH_TO_COMPILEDB = $(HOME)/.local/bin/compiledb compiledb : -$(PATH_TO_COMPILEDB) -n make linux -k - -##################### -# cross compilation # -##################### - -# WARNING: untested - -# Below assignments and targets are necessary for cross-compiling to Android, web (via emscripten), Windows (via mingw), -# and OS/X, but cross-compilation targets have not been tested in a while and won't compile without significant changes. - -BUILDDIR := build -SDLHOME := $(EXT_SRC_ROOT)/SDL2-2.0.14 -SDL_IMG_HOME := $(EXT_SRC_ROOT)/SDL2_image-2.0.4 -SDL_TTF_HOME := $(EXT_SRC_ROOT)/SDL2_ttf-2.0.14 -GLEW_WIN32_HOME = $(EXT_SRC_ROOT)/glew-2.1.0-win32 -PROJECTHOME = $(shell pwd) -WINBUILDDIR = win -SDLMINGWHOME = $(SDLHOME)/i686-w64-mingw32 -SDL_IMG_MINGW_HOME = $(SDL_IMG_HOME)/i686-w64-mingw32 -SDL_TTF_MINGW_HOME = $(SDL_TTF_HOME)/i686-w64-mingw32 -APPDIR = Main.app/Contents -SYSFWPATH = /Library/Frameworks - -android : - if [ ! -d $(BUILDDIR) ]; then mkdir $(BUILDDIR); fi; - cd $(SDLHOME)/build-scripts/ && \ - ./androidbuild.sh $(ANDROIDPROJECT) $(PROJECTHOME)/main.cpp - cp -r $(SDLHOME)/build/$(ANDROIDPROJECT) $(BUILDDIR) - sed -i s/2\.3\.3/2\.2\.3/g $(BUILDDIR)/$(ANDROIDPROJECT)/build.gradle - sed -i s/26\.0\.1/23\.0\.1/g $(BUILDDIR)/$(ANDROIDPROJECT)/app/build.gradle - cd $(BUILDDIR)/$(ANDROIDPROJECT) && ./gradlew assembleDebug - -mingw : - if [ ! -d $(BUILDDIR)/$(WINBUILDDIR) ]; then mkdir -p $(BUILDDIR)/$(WINBUILDDIR); fi; - cd $(BUILDDIR)/$(WINBUILDDIR) && \ - i686-w64-mingw32-g++ -std=c++17 $(PROJECTHOME)/main.cpp -I$(SDLMINGWHOME)/include/SDL2 \ - -I$(SDL_IMG_MINGW_HOME)/include/SDL2 -I$(SDL_TTF_MINGW_HOME)/include/SDL2 $(INC) \ - $(PROJECTHOME)/sdl2-gfx/SDL2_gfxPrimitives.c $(PROJECTHOME)/sdl2-gfx/SDL2_rotozoom.c $(PROJECTHOME)/glew/glew.c \ - -L$(SDLMINGWHOME)/lib -L$(SDL_IMG_MINGW_HOME)/lib -L$(SDL_TTF_MINGW_HOME)/lib \ - -lmingw32 -lSDL2_image \ - -lSDL2_ttf -lstdc++fs \ - -lSDL2main -lSDL2 -lopengl32 -Wall -O2 -o main.exe && \ - cp $(SDLMINGWHOME)/bin/SDL2.dll $(SDL_IMG_MINGW_HOME)/bin/SDL2_image.dll \ - $(SDL_TTF_MINGW_HOME)/bin/SDL2_ttf.dll . - -osx : - g++ -I $(SYSFWPATH)/SDL2.framework/Headers $(INC) \ - -I $(SYSFWPATH)/SDL2_image.framework/Headers -Wl,-rpath,$(SYSFWPATH) \ - -framework SDL2 -framework SDL2_image -framework OpenGL main.cpp sdl2-gfx/SDL2_rotozoom.c \ - -o main - -osx-bundle : - if [ ! -d "$(APPDIR)" ]; then mkdir -p $(APPDIR); fi; - if [ ! -d "$(APPDIR)" ]; then mkdir $(APPDIR); fi; - if [ ! -d "$(APPDIR)/MacOS" ]; then mkdir $(APPDIR)/MacOS; fi; - if [ ! -d "$(APPDIR)/Frameworks" ]; then mkdir $(APPDIR)/Frameworks; fi; - if [ ! -d "$(APPDIR)/Resources" ]; then mkdir $(APPDIR)/Resources; fi; - touch $(APPDIR)/Info.plist - cp -r $(SYSFWPATH)/SDL2.framework $(APPDIR)/Frameworks - cp -r $(SYSFWPATH)/SDL2_image.framework $(APPDIR)/Frameworks - g++ -I $(SYSFWPATH)/SDL2.framework/Headers -I $(SYSFWPATH)/SDL2_image.framework/Headers \ - -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,$(SYSFWPATH) \ - -framework SDL2 -framework SDL2_image -framework OpenGL main.cpp -o $(APPDIR)/MacOS/main - -cross : linux android emscripten mingw diff --git a/README.md b/README.md index 64db845..adfb412 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ ``` - _______________ ,--------------------------------------------------------. - //`````````````\\ \ \ - //~~~~~~~~~~~~~~~\\ \ by @ohsqueezy & @sleepin \ - //=================\\ \ [ohsqueezy.itch.io] [sleepin.itch.io] \ - // \\ \ \ - // \\ \ zlib licensed code at [git.nugget.fun/nugget/gunkiss] \ - // ☆ GUNKISS ☆ \\ \ \ - //_________________________\\ `--------------------------------------------------------' + _______________ ,-----------------------------------------------------------. + //`````````````\\ \ \ + //~~~~~~~~~~~~~~~\\ \ by @ohsqueezy & @sleepin \ + //=================\\ \ [ohsqueezy.itch.io] [sleepin.itch.io] \ + // \\ \ \ + // \\ \ zlib licensed code at [open.shampoo.ooo/shampoo/gunkiss] \ + // ☆ GUNKISS ☆ \\ \ \ + //_________________________\\ `-----------------------------------------------------------' ``` Gunkiss @@ -24,7 +24,7 @@ Building from source First, checkout the full repository. - git clone --recursive https://git.nugget.fun/nugget/gunkiss + git clone --recursive https://open.shampoo.ooo/shampoo/gunkiss ### Required Libraries @@ -69,4 +69,4 @@ The project is developed using `clang`, but `gcc` can be substituted. Environmen [OpenCV]: https://opencv.org/ [ZBar]: http://zbar.sourceforge.net/ [Makefile]: Makefile -[SPACEBOX game framework]: https://git.nugget.fun/nugget/spacebox +[SPACEBOX game framework]: https://open.shampoo.ooo/shampoo/spacebox diff --git a/lib/sb b/lib/sb index d0bf52a..f793073 160000 --- a/lib/sb +++ b/lib/sb @@ -1 +1 @@ -Subproject commit d0bf52a03ddcde96fc71a64a297574380585845a +Subproject commit f79307334847947a7d259c9c6ac0e915ef4949c4 diff --git a/src/Pudding.cpp b/src/Pudding.cpp index e1feb35..43431c0 100644 --- a/src/Pudding.cpp +++ b/src/Pudding.cpp @@ -1,11 +1,11 @@ -/* _______________ ,--------------------------------------------------------. - //`````````````\\ \ \ - //~~~~~~~~~~~~~~~\\ \ by @ohsqueezy & @sleepin \ - //=================\\ \ [ohsqueezy.itch.io] [sleepin.itch.io] \ - // \\ \ \ - // \\ \ zlib licensed code at [git.nugget.fun/nugget/gunkiss] \ - // ☆ GUNKISS ☆ \\ \ \ - //_________________________\\ `--------------------------------------------------------' +/* _____________ ,---------------------------------------------------------. + /,-----------,\ \ \ + //~~~~~~~~~~~~~\\ \ By @ohsqueezy & @sleepin \ + //===============\\ \ \ + // \\ \ \ + // ☆ GUNKISS ☆ \\ \ Open source code at \ + /'_____________________'\ \ \ + '-----------------------' `---------------------------------------------------------' Generate a custom pudding from food product UPC codes and help a pair of rats take over the video game industry, using their extraterrestrial ability to turn trash into performance enhancing drug puddings that enable business professionals