From 60fb5674275d4d21859b1859bbdd204596d3563f Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 19 Oct 2008 12:14:04 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1103 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/Makefile | 45 ++++++----------------- polymer/build/Makefile.shared | 14 ++++++-- polymer/eduke32/Makefile | 65 ++++++++-------------------------- polymer/eduke32/source/astub.c | 4 +-- polymer/eduke32/source/menus.c | 5 +++ 5 files changed, 44 insertions(+), 89 deletions(-) diff --git a/polymer/build/Makefile b/polymer/build/Makefile index 3d88ff6d2..e058f37cc 100644 --- a/polymer/build/Makefile +++ b/polymer/build/Makefile @@ -8,6 +8,9 @@ # try again. If things are still going wrong, call me. # +# Use colored output +PRETTY_OUTPUT = 1 + # Engine options - these may be overridden by game makefiles # SUPERBUILD - enables voxels # POLYMOST - enables Polymost renderer @@ -228,59 +231,31 @@ include Makefile.deps # RULES $(OBJ)/%.$o: $(SRC)/%.nasm $(COMPILE_STATUS) - if $(AS) $(ASFLAGS) $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(AS) $(ASFLAGS) $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/%.m $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/%.cpp $(COMPILE_STATUS) - if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/misc/%.rc $(COMPILE_STATUS) - if $(RC) -i $< -o $@ --include-dir=$(INC) --include-dir=$(SRC); then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(RC) -i $< -o $@ --include-dir=$(INC) --include-dir=$(SRC); then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/util/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(RSRC)/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c echo "#include " > $@ diff --git a/polymer/build/Makefile.shared b/polymer/build/Makefile.shared index 11bca354f..47a3a390c 100644 --- a/polymer/build/Makefile.shared +++ b/polymer/build/Makefile.shared @@ -177,7 +177,8 @@ ifneq (0,$(POLYMER)) endif endif -BUILD_STARTED = printf "\033[K\033[1;36mBuild started with $(CC) $(OURCFLAGS)\033[0m\n" +ifeq ($(PRETTY_OUTPUT),1) +BUILD_STARTED = printf "\033[K\033[1;36mBuild started using $(CC) $(OURCFLAGS)\033[0m\n" BUILD_FINISHED = printf "\033[K\033[1;36mBuild successful:\033[0m\n" COMPILE_STATUS = printf "\033[K\033[0;37mCompiling \033[1;37m$<\033[0;37m...\033[0m\r" COMPILE_OK = printf "\033[K\033[0;32mCompiled \033[1;32m$<\033[0;32m.\033[0m\n" @@ -185,4 +186,13 @@ COMPILE_FAILED = printf "\033[K\033[0;31mFailed compiling \033[1;31m$<\033[0;31m LINK_STATUS = printf "\033[K\033[0;37mLinking \033[1;37m$@\033[0;37m...\033[0m\r" LINK_OK = printf "\033[K\033[0;32mLinked \033[1;32m$@\033[0;32m.\033[0m\n" LINK_FAILED = printf "\033[K\033[0;31mFailed linking \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1 - +else +BUILD_STARTED = +BUILD_FINISHED = +COMPILE_STATUS = +COMPILE_OK = echo +COMPILE_FAILED = echo; exit 1 +LINK_STATUS = +LINK_OK = echo +LINK_FAILED = echo; exit 1 +endif \ No newline at end of file diff --git a/polymer/eduke32/Makefile b/polymer/eduke32/Makefile index 275138a11..ff9005716 100644 --- a/polymer/eduke32/Makefile +++ b/polymer/eduke32/Makefile @@ -4,6 +4,9 @@ # DEFINES +# Use colored output +PRETTY_OUTPUT = 1 + # SDK locations - adjust to match your setup DXROOT=../sdk/dx @@ -230,7 +233,9 @@ ifeq ($(USE_OPENAL),1) OURCFLAGS+= -DUSE_OPENAL endif +ifeq ($(PRETTY_OUTPUT),1) .SILENT: +endif .PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) # TARGETS @@ -251,33 +256,21 @@ notice: eduke32$(EXESUFFIX): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(LINK_STATUS) - if $(CC) -o $@ $^ $(LIBS) $(STDCPPLIB); then \ - $(LINK_OK); \ - else \ - $(LINK_FAILED); \ - fi + if $(CC) -o $@ $^ $(LIBS) $(STDCPPLIB); then $(LINK_OK); else $(LINK_FAILED); fi ifeq (1,$(RELEASE)) strip eduke32$(EXESUFFIX) endif mapster32$(EXESUFFIX): $(EDITOROBJS) $(EOBJ)/$(EDITORLIB) $(EOBJ)/$(ENGINELIB) $(LINK_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS); then \ - $(LINK_OK); \ - else \ - $(LINK_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ $(LIBS); then $(LINK_OK); else $(LINK_FAILED); fi ifeq (1,$(RELEASE)) strip mapster32$(EXESUFFIX) endif duke3d_w32$(EXESUFFIX): $(OBJ)/wrapper.$o $(LINK_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ -Wl; then \ - $(LINK_OK); \ - else \ - $(LINK_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -o $@ $^ -Wl; then $(LINK_OK); else $(LINK_FAILED); fi ifeq (1,$(RELEASE)) strip duke3d_w32$(EXESUFFIX) endif @@ -305,58 +298,30 @@ $(OBJ)/%.$o: $(SRC)/jaudiolib/%.nasm $(OBJ)/%.$o: $(SRC)/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/%.cpp $(COMPILE_STATUS) - if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CXX) $(CXXFLAGS) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/jmact/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/jaudiolib/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/misc/%.rc $(COMPILE_STATUS) - if windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC); then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if windres -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC); then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(SRC)/util/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/%.$o: $(RSRC)/%.c $(COMPILE_STATUS) - if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then \ - $(COMPILE_OK); \ - else \ - $(COMPILE_FAILED); \ - fi + if $(CC) $(CFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi $(OBJ)/game_banner.$o: $(RSRC)/game_banner.c $(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 85996820f..e187f2439 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -1232,7 +1232,7 @@ static void ReadHelpFile(const char *name) while (!Bfeof(fp)) // skip empty lines { pos = ftell(fp); - Bfgets(tempbuf, 80, fp); + if (Bfgets(tempbuf, 80, fp) == NULL) break; charsread = ftell(fp)-pos; if (!newpage(tempbuf)) { @@ -1276,7 +1276,7 @@ static void ReadHelpFile(const char *name) } pos = ftell(fp); - Bfgets(tempbuf, 80, fp); + if (Bfgets(tempbuf, 80, fp) == NULL) break; charsread = ftell(fp)-pos; if (charsread == 79 && tempbuf[78]!='\n') skip=1; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index b45272a44..3bfe74bec 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2532,6 +2532,8 @@ cheat_for_port_credits: int i = (float)r_ambientlight*1024.f; int j = i; _bar(1,d+8,yy+7, &i,128,x==io,MENUHIGHLIGHT(io),0,128,4096); + Bsprintf(tempbuf,"%.2f",r_ambientlight); + mgametextpal(d-35,yy, tempbuf, MENUHIGHLIGHT(io), 0); if (i != j) { r_ambientlight = (float)i/1024.f; @@ -3445,6 +3447,9 @@ cheat_for_port_credits: modval(0,1,(int *)&ud.detail,1,probey==5); menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),PHX(-6),"AMBIENT LIGHT"); _bar(0,c+185,50+62+16+16+16,&i,128,x==6,MENUHIGHLIGHT(6),numplayers>1,128,4096); + Bsprintf(tempbuf,"%.2f",r_ambientlight); + mgametextpal(c+185+9,50+62+16+16+16+4, tempbuf, MENUHIGHLIGHT(6), 0); + if (i != j) { r_ambientlight = (float)i/1024.f;