From 1195e6c73d18f011c00b82b569d37d5ac51e3194 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 29 Mar 2024 12:38:14 -0500 Subject: [PATCH] makefile doesn't rebuild everything on one script change --- Makefile | 19 +++++++++---------- scripts/components.js | 3 +-- scripts/entity.js | 5 ++--- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 3158861..da47926 100755 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -MAKEFLAGS = --jobs=4 +MAKEFLAGS = --jobs=8 UNAME != uname MAKEDIR != pwd # Options @@ -184,6 +184,8 @@ all: $(NAME) SHADERS = $(shell ls source/shaders/*.sglsl) SHADERS := $(patsubst %.sglsl, %.sglsl.h, $(SHADERS)) +prereqs: $(SHADERS) source/engine/core.cdb.h + DESTDIR ?= ~/.bin install: $(NAME) @echo Copying to destination @@ -191,20 +193,20 @@ install: $(NAME) $(NAME): $(OBJS) $(DEPS) @echo Linking $(NAME) - $(CROSSWIN)$(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@ + $(LD) $^ $(CPPFLAGS) $(LDFLAGS) -L. $(LDPATHS) $(LDLIBS) -o $@ @echo Finished build -%$(INFO).o: %.c source/engine/core.cdb.h $(SHADERS) +%$(INFO).o: %.c @echo Making C object $@ - $(CROSSWIN)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ %$(INFO).o: %.cpp @echo Making C++ object $@ - $(CROSSWIN)$(CXX) $(CPPFLAGS) $(CXXFLAGS) -fpermissive -c $< -o $@ + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fpermissive -c $< -o $@ %$(INFO).o: %.m @echo Making Objective-C object $@ - $(CROSSWIN)$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ + $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@ shaders: $(SHADERS) @echo Making shaders @@ -238,11 +240,8 @@ icon.ico: $(ICON) rm $(ICNNAME) resource.o: resource.rc resource.manifest icon.ico - $(CROSSWIN)windres -i $< -o $@ + windres -i $< -o $@ -crosswin: packer resource.o - make CROSSWIN=x86_64-w64-mingw32- CC=$(CROSSWIN)gcc OS=Windows_NT ARCH=x86_64 DEBUG=$(DEBUG) OPT=$(OPT) - crossios: make OS=IOS ARCH=arm64 DEBUG=$(DEBUG) OPT=$(OPT) diff --git a/scripts/components.js b/scripts/components.js index 6d199e1..68a9ee6 100644 --- a/scripts/components.js +++ b/scripts/components.js @@ -244,8 +244,7 @@ var SpriteAnim = { else return undefined; - animcache[path] = anim; - console.spam(`Created animation like this:\n${json.encode(animcache[path])}`); + animcache[path] = anim; return animcache[path]; }, gif(path) { diff --git a/scripts/entity.js b/scripts/entity.js index 17d6a44..27e0f31 100644 --- a/scripts/entity.js +++ b/scripts/entity.js @@ -208,7 +208,7 @@ var gameobject = { }, tween(prop, values, def) { - var t = Tween.make(this, prop, values, def); + var t = Tween.make(this, prop, values, def); t.play(); var k = function() { t.pause(); } @@ -217,7 +217,6 @@ var gameobject = { }, cry(file) { - return; this.crying = audio.play(file, audio.bus.sfx); var killfn = () => { this.crying = undefined; console.warn("killed"); } @@ -227,7 +226,7 @@ var gameobject = { gscale() { return this.scale; }, sgscale(x) { - if (typeof x === 'number') + if (typeof x === 'number') x = [x, x]; physics.sgscale(this, x)