# HG changeset patch # User Matti Hamalainen # Date 1572365807 -7200 # Node ID f0b26daba6a9cfba7ad1e754edbcc386c1421243 # Parent aa06f72f655720d1acbf5a2a585e8c3fd0179cad Build adjustments. diff -r aa06f72f6557 -r f0b26daba6a9 Makefile --- a/Makefile Thu Oct 24 08:20:15 2019 +0300 +++ b/Makefile Tue Oct 29 18:16:47 2019 +0200 @@ -2,35 +2,52 @@ # Generic build target # include config.mak +MAKEOPTS=-j4 export DMLIB export BINPATH linux-bin: - $(MAKE) -f $(DMLIB)Makefile EXEEXT=-linux.bin + $(MAKE) $(MAKEOPTS) -f $(DMLIB)Makefile EXEEXT=-linux.bin mingw-win32: - $(MAKE) -f $(DMLIB)Makefile.cross-mingw \ + $(MAKE) $(MAKEOPTS) -f $(DMLIB)Makefile.cross-mingw \ OBJPATH=$(BPATH)/obj/win32/ \ MINGW_PREFIX=i686-w64-mingw32- \ MINGW_PATH=/usr/i686-w64-mingw32 mingw-win64: - $(MAKE) -f $(DMLIB)Makefile.cross-mingw \ + $(MAKE) $(MAKEOPTS) -f $(DMLIB)Makefile.cross-mingw \ OBJPATH=$(BPATH)/obj/win64/ \ MINGW_PREFIX=x86_64-w64-mingw32- \ MINGW_PATH=/usr/x86_64-w64-mingw32 -$(DATA): $(wildcard $(BPATH)/data/*) - cd $(BPATH)/data && $(DMLIB)/tools/packed -p $@ -c -x \*~ -v * +$(DATA_PKG): $(wildcard $(BPATH)/data/*) + cd $(BPATH)/data && $(TOOL_BINPATH)packed create $@ -x \*~ -v * tools: - @if test ! -e $(DMLIB)config.mak; then cp $(DMLIB)config.mak.in $(DMLIB)config.mak; fi - @cd $(DMLIB) && make -j4 + $(MAKE) $(MAKEOPTS) -f $(DMLIB)Makefile \ + DM_CONFIG=no \ + TOOL_BINPATH=$(TOOL_BINPATH) \ + OBJPATH=$(DMLIB)/obj/unix/ \ + DM_BUILD_TESTS=no \ + DM_BUILD_TOOLS=yes \ + DM_USE_TIMELINE=no \ + DM_BUILD_EDITOR=no \ + DM_USE_C=yes \ + DM_USE_SIMD=yes \ + DM_USE_PACKFS=yes \ + DM_USE_STDIO=yes \ + DM_USE_MEMIO=yes \ + JSS=yes \ + JSS_SUP_XM=yes \ + JSS_SUP_JSSMOD=yes \ + JSSMOD_FLAGS="-DJM_SUP_PATMODE_ALL -DJM_SUP_EXT_INSTR -DJM_SUP_INSTR -DJM_SUP_SAMPLES" \ + JSS_SUP_THREADS=yes -data: tools $(DATA) +data: tools $(DATA_PKG) -package: linux-bin mingw-win32 $(DATA) +package: linux-bin mingw-win32 $(DATA_PKG) strip $(BINPATH)/*.bin $(BINPATH)/*.exe $(RM) $(PACKAGE) cp SDL.dll LICENSE.txt README.txt file_id.diz $(BINPATH) @@ -38,7 +55,7 @@ clean: - -$(RM) $(DATA) + -$(RM) $(DATA_PKG) -$(MAKE) -f $(DMLIB)Makefile clean EXEEXT=-linux.bin -$(MAKE) -f $(DMLIB)Makefile.cross-mingw clean \ No newline at end of file diff -r aa06f72f6557 -r f0b26daba6a9 config.mak --- a/config.mak Thu Oct 24 08:20:15 2019 +0300 +++ b/config.mak Tue Oct 29 18:16:47 2019 +0200 @@ -1,6 +1,13 @@ -# Additional binaries (aka the demo) +MAKEOPTS=-j4 +EXTRA_CFLAGS=-O3 +MAKE ?= make + +#DM_CFLAGS += -fopenmp +#DM_LDFLAGS += -lgomp #DM_DEBUG=yes + +# Additional binaries (aka the demo) DEMO_BIN=krapula DEMO_OBJS=demo.o dmsimple.o @@ -8,11 +15,8 @@ DMLIB := $(BPATH)/dmlib/ PACKAGE = $(BPATH)/ap-krapula.zip BINPATH = $(BPATH)/bin/ -DATA = $(BINPATH)/orvellys.dat -MAKE ?= make - -TOOL_BINPATH=bin/ -TESTS_BINPATH=$(TOOL_BINPATH) +DATA_PKG = $(BINPATH)/orvellys.dat +TOOL_BINPATH = $(DMLIB)tools/ # Build engine tests and tools? (Please notice that what # actually gets built it also affected by other options) diff -r aa06f72f6557 -r f0b26daba6a9 demo.c --- a/demo.c Thu Oct 24 08:20:15 2019 +0300 +++ b/demo.c Tue Oct 29 18:16:47 2019 +0200 @@ -15,16 +15,15 @@ void dmMakePalette(SDL_Surface *scr) { SDL_Color pal[DM_COLORS]; - int n; - for (n = 0; n < 256; n++) + for (int n = 0; n < DM_COLORS; n++) { pal[n].r = n; pal[n].g = n; pal[n].b = n; } - SDL_SetColors(scr, pal, 0, DM_COLORS); + SDL_SetPaletteColors(scr->format->palette, pal, 0, DM_COLORS); } @@ -331,8 +330,6 @@ engine->optVidWidth = 640; engine->optVidHeight = 480; engine->optVidDepth = 32; - engine->optVFlags = SDL_SWSURFACE; - engine->demoInit = demoInit; engine->demoRender = demoRender;